// Note, this file requires inclusion of /web/corp/html/js/BrowserDetect.js files as well. AG.

function getDesiredProtocol()
{	var IE4plus = (document.all) ? true : false;
	var protocol = "https";

//  	var PROD_1 = "globalam";
//	var PROD_2 = "brinson";
//	var QA_1 = "161.15.246.230";
//	var QA_2 = "161.15.246.233";
//	var DEV  = "161.15.115.109";
//	var LOCAL = "localhost";

//	var hostName = window.location.hostname;
//	if ((hostName.search(DEV) > -1)
//		|| (hostName.search(QA_1) > -1)
//		|| (hostName.search(QA_2) > -1)
//		|| (hostName.toLowerCase().search(PROD_1) > -1)
//		|| (hostName.toLowerCase().search(PROD_2) > -1)
//		|| (hostName.toLowerCase().search(LOCAL) > -1))
//	{	var protocol = "https://";
//	}

	return protocol;
}

function getPortToUse(){
	var port = (window.location.port == "") ? "" : ":" + window.location.port;
	return port;
}

function redirectPage(action, protocol)
{
    // constants
	var hostName = window.location.hostname;
	if(protocol == null)
	    protocol = getDesiredProtocol();
	var port = getPortToUse();

	if (IE4plus)
	{	window.top.location = protocol + "://" + hostName + port + "/site/jsp/user/loginFrame.jsp?action=" + action;
	}
	else
	{	window.top.location = "http://" + hostName + "/netscape_warning_frames.htm";
	}
}

function redirectNonSSL(url)
{	var hostName = window.location.hostname;
	var protocol = "http://";
	var port = (window.location.port == "") ? "" : ":" + window.location.port;

	window.top.location = protocol + hostName + port + url;
}

/**
* $Log: redirect.js,v $
* Revision 1.1.1.1  2008/01/15 15:36:38  thomasb
*
*
* Revision 1.1.1.1  2007/12/12 03:08:00  thomasb
* websphere migration
*
* Revision 1.18  2004/07/27 16:41:42  nulmane
* Added protocol parameter to redirectPage()
*
*/