
  //var rootloc   = "https://gtm.fedex.com";
  //var rootloc   = "https://wwwdevtest2.idev.fedex.com:9443";
  //var rootloc   = "https://wwwtest2.dmz.fedex.com:9443";
  //var rootloc   = "https://gtmbeta.sac.fedex.com";

  	var host1 = window.location.host;
	var hostsplit1 = host1.split(".");
	var rootloc;
	
	if (hostsplit1[0] == "wwwdev1")
		rootloc = "https://gtmdev.idev.fedex.com";
	else if (hostsplit1[0] == "wwwdev2")
		rootloc = "https://gtmdev.idev.fedex.com";
	else if (hostsplit1[0] == "wwwdev")
		rootloc = "https://gtmdev.idev.fedex.com";
	else if (hostsplit1[0] == "wwwdrt")
		rootloc = "https://gtmdrt.idev.fedex.com";
	else if (hostsplit1[0] == "wwwtest")
		rootloc = "https://gtmtest.dmz.fedex.com";
	else if (hostsplit1[0] == "wwwbase")
		rootloc = "https://gtmbase.idev.fedex.com";
	else if (hostsplit1[0] == "wwwstress")
		rootloc = "https://gtmstress.idev.fedex.com";
	else if (hostsplit1[0] == "wwwbit")
		rootloc = "https://gtmbit.idev.fedex.com";
    else if (hostsplit1[0] == "wwwbeta")
   		rootloc = "https://gtmbeta.sac.fedex.com";
    else if (host1 == "www.fedex.com")
   		rootloc = "https://gtm.fedex.com";
    else if (host1 == "fedex.com")
   		rootloc = "https://gtm.fedex.com";
	else
		rootloc = "https://" + hostsplit1[0] + ".gtm.idev.fedex.com";
  


  var docdetloc = (rootloc + "/cgi-bin/doc_det"); 
  var newWin;

function metaRedirect(url) 
{
	var host = window.location.host;
	var hostsplit = host.split(".");
	var path = url;

	if (hostsplit[0] == "wwwdev")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwtmp")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwtmptest")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwstress")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwbit")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwdevtest")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwtest")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwnewtest")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + host + ":9443" + path + "'>");
	else if (hostsplit[0] == "wwwbeta")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://gtmbeta.sac.fedex.com" + path + "'>");
	else if (host == "www.fedex.com")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://gtm.fedex.com" + path + "'>");
	else if (host == "fedex.com")
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://gtm.fedex.com" + path + "'>");
	else
		document.write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=https://" + hostsplit[0] + ".gtm.idev.fedex.com" + path + "'>");
}

function redirect(url) 
{
	var host = window.location.host;
	var hostsplit = host.split(".");
	var path = url;
	if (hostsplit[0] == "wwwdev")
		window.location = "https://gtmdev.idev.fedex.com"+path;
	else if (hostsplit[0] == "wwwdev1")
		window.location = "https://gtmdev.idev.fedex.com"+path;
	else if (hostsplit[0] == "wwwdev2")
		window.location = "https://gtmdev.idev.fedex.com"+path;
	else if (hostsplit[0] == "wwwstress")
		window.location = "https://gtmstress.idev.fedex.com"+path;
	else if (hostsplit[0] == "wwwbit")
		window.location = "https://gtmbit.idev.fedex.com"+path;
	else if (hostsplit[0] == "wwwdevtest")
		window.location = "https://gtmdevtest.idev.fedex.com"+path;
	else if (hostsplit[0] == "wwwtest")
		window.location = "https://gtmtest.dmz.fedex.com"+path;
	else if (hostsplit[0] == "wwwnewtest")
		window.location = "https://gtmnewtest.dmz.fedex.com"+path;
	else if (hostsplit[0] == "wwwbeta")
		window.location = ("https://gtmbeta.sac.fedex.com" + path);
    else if (host == "www.fedex.com")
    	window.location = ("https://gtm.fedex.com" + path);
    else if (host == "fedex.com")
    	window.location = ("https://gtm.fedex.com" + path);
    else if (hostsplit[0] == "wwwbase1")
        window.location = ("https://gtmbase.idev.fedex.com" + path) ;
    else if (hostsplit[0] == "wwwbase")
        window.location = ("https://gtmbase.idev.fedex.com" + path) ;
	else
		window.location = ("https://" + hostsplit[0] + ".gtm.idev.fedex.com" + path);
}

function docdet(url) {      
  window.location = (docdetloc + url + "?gtmcc=" + document.mainform.gtmcc.value);
}

function gtmsecure(url)
{
	var host = window.location.host;
	var hostsplit = host.split(".");
	var path = url;
	if (hostsplit[0] == "wwwdev")
		window.location = "https://gtmdev.idev.fedex.com" + path;
	else if (hostsplit[0] == "wwwdev1")
		window.location = "https://gtmdev.idev.fedex.com"+ path;
	else if (hostsplit[0] == "wwwdev2")
		window.location = "https://gtmdev.idev.fedex.com"+ path;
	else if (hostsplit[0] == "wwwstress")
		window.location = "https://gtmstress.idev.fedex.com"+ path;
	else if (hostsplit[0] == "wwwbit")
		window.location = "https://gtmbit.idev.fedex.com"+ path;
	else if (hostsplit[0] == "wwwdevtest")
		window.location = "https://gtmdevtest.idev.fedex.com"+ path;
	else if (hostsplit[0] == "wwwtest")
		window.location = "https://gtmtest.dmz.fedex.com"+ path;
	else if (hostsplit[0] == "wwwnewtest")
		window.location = "https://gtmnewtest.dmz.fedex.com"+ path;
	else if (hostsplit[0] == "wwwbeta")
		window.location = ("https://gtmbeta.sac.fedex.com" + path);
    else if (host == "www.fedex.com")
    	window.location = ("https://gtm.fedex.com" + path);
    else if (host == "fedex.com")
    	window.location = ("https://gtm.fedex.com" + path);
    else if (hostsplit[0] == "wwwbase1")
        window.location = ("https://gtmbase.idev.fedex.com" + path) ;
    else if (hostsplit[0] == "wwwbase")
        window.location = ("https://gtmbase.idev.fedex.com" + path) ;
	else
		window.location = ("https://" + hostsplit[0] + ".gtm.idev.fedex.com" + path);
}

function opentour(){ 
        if(newWin && !newWin.closed){
                newWin.close(); 
                newWin = null; 
        } 
           newWin = window.open("/us/international/irc/tour/detect/detect.html", "popup", "width=775,height=500,scrollbars=0,resizable=no");
        newWin.focus();
}

function opensed(){
        if(newWin && !newWin.closed){
                newWin.close();
                newWin = null;
        }
           newWin = window.open("http://www.fedex.com/us/sed/?link=1", "popup", "height=600,width=640,scrollbars=1,resizable=yes");
        newWin.focus();
}


function openconfig(){ 
        if(newWin && !newWin.closed){
                newWin.close(); 
                newWin = null; 
        } 
           newWin = window.open("/us/international/config.html", "popup", "height=480,width=640,scrollbars=1,resizable=yes");
        newWin.focus();
}

function opentac(){
        if(newWin && !newWin.closed){
                newWin.close();
                newWin = null;
        }
           newWin = window.open("/us/international/tac.html", "popup", "height=400,width=600,scrollbars=1,resizable=yes");
        newWin.focus();
}

function closeWin(){
        if(newWin && !newWin.closed){ 
                newWin.close(); 
                newWin = null; 
        } 
} 



