<!--//
/*
Script for generic functions

Instructions for Use:

*/
function launchWindow(URL){
	newWind=window.open(URL,"newWindow","status=no,toolbar=no,scrollbars=yes,directories=no,location=no,resizable=yes,width=520,height=350")
	if (URL.indexOf("http")==-1)
		newWind.focus();
}

function launchWindowLarge(URL){
	newWind=window.open(URL,"newWindow","status=no,toolbar=no,scrollbars=yes,directories=no,location=no,resizable=yes,width=620,height=550")
	if (URL.indexOf("http")==-1)
		newWind.focus();
}

function launchHelp(here){
	var where;
	where="/help/default.asp?index="+here;
	newWind=window.open(where,"newWindow","status=no,toolbar=no,scrollbars=yes,directories=no,location=no,resize=on,width=530,height=320")
	newWind.focus();
}
	
function openPopUp(sItem) {
	
	var sPopupWindowOptions= "width=530,height=474,toolbar=yes,location=no,status=yes,resizable=no,scrollbars=yes,top=100,left=150";
	var sWinName= '';
	var popUpWindow, sTitle;
	
	sURL= "/html/";
	switch (sItem) {
		case "ABOUTUS":
			sURL= sURL+ "popup/default.asp?popup=ABOUTUS";
			break;
		case "CONTACTUS":
			sURL= sURL+ "/popup/default.asp?popup=CONTACTUS";
			break;
		case "PRIVACY":
			sURL= sURL+ "popup/default.asp?popup=PRIVACY";
			break;
		case "SECURITY":
			sURL= sURL+ "popup/default.asp?popup=SECURITY";
			break;
		case "CAREERS":
			sURL= sURL+ "popup/default.asp?popup=CAREERS";
			sPopupWindowOptions= "width=766,height=500,toolbar=yes,location=no,status=no,resizable=yes,top=50,left=100";
			break;			
		case "LICENSING":
			sURL= sURL+ "popup/default.asp?popup=LICENSING";
			break;
		case "TERMSOFUSE":
			sURL= sURL+ "popup/default.asp?popup=TERMSOFUSE";
			break;
		case "SITEFEEDBACK":
			sURL= sURL+ "popup/default.asp?popup=SITEFEEDBACK";
			break;
	}
	
	popUpWindow= window.open(sURL,sWinName,sPopupWindowOptions);
	
	popUpWindow.focus();
}

function makeSecure(path) {
	var strHostname = getHostname();

	var secure = "https://" + strHostname + path;
	var nonsecure = "http://" + strHostname + path;
		
	if(document.location.hostname.indexOf("heinz.com") != -1) {
		if( (document.location.hostname.indexOf("test") != -1 )	|| (document.location.hostname.indexOf("beta") != -1) ) {
			document.location = nonsecure;
		}
		else {
			document.location = secure;
		}
	}
	else {
		document.location = nonsecure;
	}		
}

function makeUnsecure(path) {
	var strHostname = getHostname();

	var nonsecure = "http://" + strHostname + path;
	document.location = nonsecure;
}

function getHostname() {
	var strHostname = window.location.hostname;

	if (window.location.port != "" && window.location.port != "80" && window.location.port != "443")
		strHostname += ":" + window.location.port;
		
	return strHostname;
}