var ExpirationDate=GetExpirationDate();
var TodaysDateAsString=GetTodaysDateAsString();
function navOver(o){
	o.className='tdOver';}
function navOut(o){
	o.className='tdOut';}
function launchSearch(site, query){
	var q='http://search.msn.com/results.aspx?q=';
	if (site.checked){
		q+='site%3Asafety.live.com ';}
	window.location = q+query.value;}
function launchVirusSearch(query){
	window.location = getGlobalPath()+'/virusenc/virussearch.htm?SearchKey='+UrlEncode(query.value);}
function UrlEncode(val){
	return escape(val).replace(/\//g, '%2F');}
function getGlobalPath(){
	var path;
	var href=document.location.href;
	if (href.indexOf('NRMODE') > -1){
		var start = href.indexOf('NRORIGINALURL')+14;
		path = unescape(href.substring(start, href.indexOf('&', start)));}
	else
		path = document.location.pathname;
	var index=-1;
	var count=0;
	for(var i=0;i<3;i++){
		index=path.indexOf("/", index+1);
		if(index<0){
			throw "URL does not conform to global path pattern";}}
	return path.substring(0,index);}
function getGlobalPathFull(){
	var path;
	var href=document.location.href;
	if (href.indexOf('NRMODE') > -1){
		var start = href.indexOf('NRORIGINALURL')+14;
		path = unescape(href.substring(start, href.indexOf('&', start)));}
	else
		path = document.location.pathname;
	var index=-1;
	var count=0;
	for(var i=0;i<3;i++){
		index=path.indexOf("/", index+1);
		if(index<0){
			throw "URL does not conform to global path pattern";}}
	return path;}
function OpenWindow(strURL,winType,winName,winWidth,winHeight){
	var objWindow,blnlongcall=false,winHeightBrowserShell=0;
	switch(winType)
	{
		case "scanner":
			winWidth=500,winHeight=500,blnlongcall=true;
			winHeightBrowserShell=50;
			break;

		default:
			objWindow=window.open(strURL);
			return;
	}
	//center window
	var screenMarginL=0;
	var screenMarginTop=0;
	if(winWidth>0 && winHeight>0){
		screenMarginL=(screen.width - winWidth)/2;
		screenMarginTop=(screen.height - winHeight - winHeightBrowserShell)/2;}
	if(blnlongcall==true){
		objWindow=window.open(strURL,winName,'width='+winWidth+',height='+winHeight+',left=' + screenMarginL + ',top=' + screenMarginTop + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no');}
	else{
		objWindow=window.open(strURL,winName,'scrollbars,resizable,width='+winWidth+',height='+winHeight+',left=' + screenMarginL + ',top=' + screenMarginTop);}
	objWindow.focus();}
function TestForOpener(){}
function ManageWindows(strURL, useWinParent, closeWinCurrent){
	ManageWindows(strUrl, useWinParent, false, closeWinCurrent);}
function ManageWindows(strURL, useWinParent, useNewWindow, closeWinCurrent){
	if(useWinParent=="true" || useWinParent){
		var navDone=false;
		if(typeof(window.opener)=="object"){
			try{
				window.opener.TestForOpener();
				window.opener.location.href=strURL;
				window.opener.focus();
				navDone=true;}
			catch(e){
			  /* .TestForOpener failed so must launch new window*/}}
		if(!navDone){
			OpenWindow(strURL, "", "", "", "");}
	}else if(useNewWindow=="true" || useNewWindow){
		OpenWindow(strURL, "", "", "", "");}
	else{
		this.location.href=strURL;}
	if(closeWinCurrent=="true"||closeWinCurrent){
		window.close();}}
function IsActiveXEnabled(){
	var activeXEnabled = false;
	try{
		var control=new ActiveXObject("Microsoft.ActiveXPlugin.1");
		activeXEnabled=control!=null;
		control= null;}
	catch(e){
		try{
			var control=new ActiveXObject("MSXML");
			activeXEnabled=control!=null;
			control=null;}
		catch(e){}}
	return activeXEnabled;}
function GetExpirationDate(){
	var expires=new Date();
	expires.setFullYear(expires.getFullYear()+10);
	return expires;}
function GetTodaysDateAsString(){
	var date=new Date();
	var sDate=(date.getMonth()+1)+"/";
	sDate+=date.getDate()+"/";
	sDate+=date.getYear();
	return sDate;}
function SendURL(url){
	try{
		var req=new ActiveXObject("Microsoft.XMLHTTP");
		url=document.location.protocol+'//'+document.location.host+url;
		req.open("POST",url);
		req.send();}
	catch(e){}}


