var	nonsslPort = null;

// SSL port for Amgen staging. Comment this line out if using standard port 443.
//nonsslPort = 8044; 

var currentURL=location.href.substring(0,5);

if (currentURL.toLowerCase()!="http:") {
	currentURL = location.href.substring(5,location.href.lastIndexOf(''));
	var portStartPos = currentURL.lastIndexOf(':');

	if (portStartPos!=0) {
		var relativeURL = currentURL.substring(portStartPos);
		var postPortURL = relativeURL.substring(relativeURL.indexOf('/'));
		var URL = currentURL.substring(0,portStartPos);
	
		if (nonsslPort == null)
			currentURL = URL + postPortURL;
		else
			currentURL = URL + ":" + nonsslPort + postPortURL;
	}
	window.self.location.replace("http" + currentURL);
}