//include Omniture Site Catalyst code
document.write("<script src='/include/wa/wa_setup.js'></script>");
document.write("<script src='/education/wa/EDU_setup.js'></script>");
document.write("<script src='/education/wa/EDU_sites.js'></script>");
document.write("<script src='/include/wa/wa_process.js'></script>");

//Showing Evidence functions
//--------------------------------------------------------------------
var gPIAlreadySaved = 0;
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;


function callPIGoodBye(strURL)
{
	callPIFlash();
	window.location=(strURL);
}


function callPIStuFlash()
{	
		var ProveIt = isInternetExplorer ? document.all.ProveIt : document.ProveIt;
		
		if (ProveIt != undefined)
		{
			
			if (ProveIt.GetVariable("jsDirty") == 1)
			{
				ProveIt.SetVariable("jsSaveNow", "1");
			}
		}	
		
		//do not show alert if the conclusion textbox is empty.
		if (document.PageForm.elements["Table_SETool_Content_Conclusion_txtConclusion"].value != "")
		{
			alert(msgConclusionSave); //need this for IE to work.
		}

		gPIAlreadySaved = 1;	
}

function savePIonSubmit(source, arguments)
{	
	callPIUnload();
	arguments.IsValid = true;
}


function callPIUnload()
{	
	if (gPIAlreadySaved !=1)
	{
		var ProveIt = isInternetExplorer ? document.all.ProveIt : document.ProveIt;
		
		if (ProveIt != undefined)
		{
			var jsDirty = ProveIt.GetVariable("jsDirty");
			if (jsDirty == 1)
			{
				ProveIt.SetVariable("jsSaveNow", "1");
				alert(msgAutoSave); //need this for IE to work.
			}
		}	
	}
}


function callPIFlash()
{	
		var ProveIt = isInternetExplorer ? document.all.ProveIt : document.ProveIt;
		
		if (ProveIt != undefined)
		{
			if (ProveIt.GetVariable("jsDirty") == 1)
				ProveIt.SetVariable("jsSaveNow", "1");
		}
		
		gPIAlreadySaved = 1;	
}




function ProveIt_DoFSCommand(command, args) {
setDirty(args);
}

function setDirty(fDirty) {
if (fDirty == 1) {
myDirty = 1;
} else {
myDirty = 0;
}
}
//--------------------------------------------------------------------
//End Showing Evidence functions







//MT 05/10/05: Added to disable/reset Remember Me cookie
document.cookie='INTEL-REMEMBER-ME=' + '' + '; path=/; domain=.intel.com; expires=Fri, 02-Jan-1970 00:00:00 GMT;'; 


//MT 10/05/2003: Save on Exit...
//--------------------------------------------------------------------
function callFlash()
{
	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	
	if (InternetExplorer)
	{
		//10/06/2003: Added map changes sniffing...
		//if (window.document.SeeingReason.GetVariable("_global.isDirty") == "true") 
		if (window.document.SeeingReason.GetVariable("flg.isDirty") == "true")
		{
			window.document.SeeingReason.SetVariable("flg.theSave", "true");
			
			 //pause to show result of "save". Need this for IE.
			alert(msgAutoSave);
			
		}
	}
	else
	{
		window.document.SeeingReason.SetVariable("flg.theSave", "true");

	}

}


//MT: Added to redirect email functionality to dynamic server
function chkHost()
{
	
	var sHostName = new String(location.hostname);
	switch(sHostName.toLowerCase())
	{
		case "educate.intel.com":
				return( 'http://www.intel.com/');
				break;
			case "www97.intel.com":
				return( 'http://www.intel.com/');
				break;
			case "day1educate.sym.cps.intel.com":
				return ('http://proto-cps.cps.intel.com/');
				break;		
			case "tst1educate.sym.cps.intel.com":
				return('http://proto-cps.cps.intel.com/');
				break;
			case "dev-edtools.cps.intel.com":
				return( 'http://devstatic-edweb01.cps.intel.com/');
				break;
			case "dev1educate.sym.cps.intel.com":
				return( 'http://dev1educatestatic01.sym.cps.intel.com/');
				break;	
			default:
				return( 'http://www.intel.com/');
 				break;
	}
}


var sScriptPath  = chkHost();

function openWindow(sHref){
    var newWin = window.open(sHref, 'newWin', 'width=790,height=700,toolbar=0,resizable=1,status=1,scrollbars=1');
	newWin.focus();
}

function openModalWindow(sHref){
    var newWin = window.open(sHref, 'newWin', 'width=790,height=700,toolbar=0,resizable=0,status=0,scrollbars=1,modal=1');
	newWin.focus();
}



//TJI popup utility code Added Charles Clampitt
function popup(url,width,height)
{
	param = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + width + ",height=" + height;
	sealWin=window.open(url,"win",param);
	self.name = "mainWin"; 
}

// DisplayParent(location)
// - Display cover page on the parent window.
//   If it's closed, display on a new window.
//   CS - 4/19/04

function DisplayParent(location)
{
	if (window.opener && !window.opener.closed)
	{
		window.opener.location.replace(location);
		window.opener.focus(); 
	} else {
		newwindow = window.open(location, "cover");
		newwindow.focus();
	}
	
}