	// iPhone redirect
//if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){
//	location.href='/iphone';
//}
//
// Start Kinko's Track
function isKinkosOrder(string){
	if (typeof(string) != 'string'){return false;}
	if (string.length != 16){return false;}
	if (string.match(/^\d+$/)){return true;}
	return false;
}
function TAtoArray(textArea){
	//convert textarea form entry type into an array of entries
	if (typeof(textArea) == 'undefined' || typeof(textArea.type) == 'undefined' || textArea.type != 'textarea')
	{
		//unexpected or bad element passed in
		return null;
	}
	var value = textArea.value;
	var valueArray = value.split('\n');
	var i = 0;
	var newArray = new Array();
	var arrayOffset = 0;
	for(i = 0; i < valueArray.length; i++){
		valueArray[i] = valueArray[i].replace(/\s/g, "");
		if (valueArray[i].length > 0)		{
			newArray[arrayOffset] = valueArray[i];
			arrayOffset++;
		}
	}
	return newArray;
}
function buildKinkosURL(orderArray){
	var kinkosURL = "http://tracking.fedexkinkos.com/trackOrder.do?gtns=";
	var i = 0;
	var wsslist = "";
	for (i = 0; i < orderArray.length; i++)	{
		kinkosURL += orderArray[i] + "%0D%0A";
		if (i < (orderArray.length - 1)){
			wsslist += orderArray[i] + ",";
		}
	}
	kinkosURL += "&hbx.c2=" + wsslist;
	return kinkosURL;
}
function openKinkosWindow(destURL){
	var openWidth = 800;
	var openHeight = 600;
	var xpos = (screen.width - openWidth)/2;
	var ypos = (screen.height - openHeight)/2;
	var windowParams = "resizable=yes,scrollbars=yes,status=no,";
	windowParams += "height=" + openHeight + ",";
	windowParams += "width=" + openWidth + ",";
	windowParams += "screenX=" + xpos + ",";
	windowParams += "screenY=" + ypos + ",";
	windowParams += "left=" + xpos + ",";
	windowParams += "top=" + ypos + ",";
	if (window.open){
		window.open(destURL, "KinkosOrderTracking", windowParams);
	}
	return false;
}
function checkKinkosOrders(textArea){
	if (typeof javalocale == 'undefined' || javalocale != "en_US"){
		return true;
	}
	if (typeof clienttype == 'undefined' || clienttype == "fsm"){
		return true;
	}
	var entriesArray = TAtoArray(textArea);
	var i = 0;
	var kinkosnumbers = 0;
	var nonkinkos = 0;
	for (i = 0; i < entriesArray.length; i++){
		if (isKinkosOrder(entriesArray[i])){
			kinkosnumbers++;
		}
		else{
			nonkinkos++;
		}
	}
	if (kinkosnumbers + nonkinkos > 30){
		return true;
	}
	if (kinkosnumbers > 0 && nonkinkos == 0){
		var newLocation = buildKinkosURL(entriesArray);
		window.location.href=newLocation;
		return false;
	}
	else{
		return true;
	}
}
// End Kinko's Track

// Start Login Module
function goLogin(cc,clang,cpath){
	var startLoc = new String(window.location);
	var startHost = startLoc.replace(/http(s)?:\/\/((.*\.)?fedex\.com)\/.*/, "$2");
	var FSMHost = startHost;
	var secondHost;
	if ((startHost == "cms.idev.fedex.com") || (startHost == "contentdev.idev.fedex.com") || (startHost == "cmsdev.idev.fedex.com") || (startHost == "cmsdev1.idev.fedex.com") || (startHost == "teamsite.idev.fedex.com")){startHost="fedex.com";}
	if (startHost == "fedex.com") {startHost="www.fedex.com";}
	if ((FSMHost == "cms.idev.fedex.com") || (FSMHost == "contentdev.idev.fedex.com") || (FSMHost == "cmsdev.idev.fedex.com") || (FSMHost == "cmsdev1.idev.fedex.com") || (FSMHost == "teamsite.idev.fedex.com")){FSMHost="fedex.com";}
	if (FSMHost == "fedex.com") {FSMHost="www.fedex.com";}if (FSMHost == "images.fedex.com") {FSMHost="www.fedex.com";}
	var gtmHost = startHost.replace("www", "gtm");
        if (gtmHost == "gtmtest.fedex.com") {gtmHost = "gtm.test.fedex.com";}
	var fcl_locale  = cc+"_"+clang;
	var fsm_url  ="ship";
        var apac_countries = ["fj","fm","la","pf","as","pg","th","au","gu","mh","ph","bn","hk","mm","mn","ck","id","mo","tw","cn","pw","mp","vn","jp","my","vu","kh","nc","wf","nz","kr","sg"];
        
        for(var i=0; i<apac_countries.length; i++) {
	var value = apac_countries[i];
		if(cc == apac_countries[i]){
	          fsm_url  ="shipping_apac";
                //alert(value);
                //alert(fsm_url);
		}
        }

	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FSM") {
		if(clang == "tc"){
			clang="zht";
                        fcl_locale=cc+"_tc";
		}
		if(clang == "sc"){
			clang="zhs";
                        fcl_locale=cc+"_sc";
		}
		if(clang == "kr"){
			clang="ko";
                        fcl_locale=cc+"_kr";
		}
		if(clang == "sp"){
			clang="es";
		}
		if(clang == "th"){
			clang="en";
			cpath="th";
		}
		if(cpath == "be_francais"){clang="fr"; fcl_locale=cc+"_fr";}
		if(cpath == "be_nederlands"){clang="nl";fcl_locale=cc+"_nl";}
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "MFX") {
		if(clang == "ja"){
			clang="en";
		}
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FXF") {
		if((startHost == "wwwdrt.idev.fedex.com")||(startHost == "wwwbase.idev.fedex.com")){
			secondHost = "qax.freight.fedex.com";
		}
		else{
			secondHost = "www.fedexfreight.fedex.com";
		}
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FNL") {
		if((startHost == "wwwdrt.idev.fedex.com")||(startHost == "wwwbase.idev.fedex.com")){
			secondHost = "qax.freight.fedex.com";
		}
		else{
			secondHost = "fnl.fedexnational.fedex.com";
		}
	}
	
	//PleaseSelect
	PleaseSelect_appName = "fclfsm";
	PleaseSelect_stepURL = "https%3A%2F%2F"+startHost+"%2Fship%2FshipEntryAction.do?method=doRegistration%26locale="+clang+"_"+cc+"%26urlparams="+cpath+"%26sType=F%26action=fsmregister";
	PleaseSelect_afterURL ="http%3A%2F%2F"+startHost+"%2F"+cpath;
	
	//GTM
	GTM_appName = "fclgtm";
	GTM_stepURL = "https%3A%2F%2F"+startHost+"%2FGTM%2FFclStep3?cntry_code="+cpath+"%26link=1%26lid=%2F%2FInternational%2F%2FPack+GTM+Intl+Doc+Corp";
	GTM_afterURL = "https%3A%2F%2F"+startHost+"%2FFID?cntry_code="+cpath+"%26link=1%26lid=%2F%2FInternational%2F%2FPack+GTM+Intl+Doc+Corp";
	
	//FSM
	FSM_appName = "fclfsm";
	FSM_stepURL = "https%3A%2F%2F"+FSMHost+"%2F"+fsm_url+"%2FshipEntryAction.do?method=doRegistration%26locale="+clang+"_"+cc+"%26urlparams="+cpath+"%26sType=F%26action=fsmregister";
	FSM_afterURL = "https%3A%2F%2F"+FSMHost+"%2F"+fsm_url+"%2FshipEntryAction.do?method=doEntry%26locale="+clang+"_"+cc+"%26urlparams="+cpath+"%26sType=F";
	
	//MFX
	MFX_appName = "fclmfx";
	MFX_stepURL = "https%3A%2F%2F"+startHost+"%2Fmyfedex%2Fgo%2Ffclstep3?cc="+cc+"%26language="+clang;
	MFX_afterURL = "https%3A%2F%2F"+startHost+"%2Fmyfedex%2Fgo%2Fhome?cc="+cc+"%26language="+clang;
	
	//RATES
	RATE_appName = "fclrates";
	RATE_stepURL = "https%3A%2F%2F"+startHost+"%2Fratefinder%2Fregstep3?cc="+cc+"%26language="+clang+"%26action=Registration";
	RATE_afterURL = "https%3A%2F%2F"+startHost+"%2Fratefinder%2Ffclhome?cc="+cc+"%26language="+clang;
	
	//INSIGHT
	INSIGHT_appName = "fclinsight";
	INSIGHT_stepURL = "https%3A%2F%2F"+startHost+"%2Finsight%2Fentrance%2Ffcl_registration_landing_post.jsp";
	INSIGHT_afterURL = "https%3A%2F%2F"+startHost+"%2Finsight%2Fentrance%2Fpre_entrance_post.jsp";
	
	//BILLING ONLINE
	FIO_appName = "fclfio";
	FIO_stepURL = "https%3A%2F%2F"+startHost+"%2FFedExMMA%2Fjsp%2FFioStep3.jsp";
	FIO_afterURL = "https%3A%2F%2F"+startHost+"%2FFedExMMA%2Fjsp%2FRegistrationRouter.jsp";
	
	//Pickup
	PICKUP_appName = "fclpickup";
	PICKUP_stepURL = "https%3A%2F%2F"+startHost+"%2FPickupApp%2FFCLStep3.jsp";
	PICKUP_afterURL = "https%3A%2F%2F"+startHost+"%2FPickupApp%2F?locale="+clang+"_"+cc;
	
	//Freight
	FXF_appName = "fclfreight";
	FXF_stepURL = "https%3A%2F%2F"+secondHost+"%2FfclStep3.jsp";
	FXF_afterURL = "https%3A%2F%2F"+secondHost+"%2Ffcllogin.do?programIndicator=3";
	
	//Freight National
	FNL_appName = "fclfreight";
	FNL_stepURL = "https%3A%2F%2F"+secondHost+"%2Fus%2FfclStep3.jsp";
	FNL_afterURL = "https%3A%2F%2F"+secondHost+"%2Fus%2FFCLLogon?programIndicator=3";
	
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FIO") {
		document.logonForm.appName.value=FIO_appName;
		document.logonForm.step3URL.value=FIO_stepURL;
		document.logonForm.afterwardsURL.value=FIO_afterURL;
		document.logonForm.returnurl.value=FIO_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+FIO_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+FIO_stepURL+"&amp;afterwardsURL="+FIO_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FNL") {
		document.logonForm.appName.value=FNL_appName;
		document.logonForm.step3URL.value=FNL_stepURL;
		document.logonForm.afterwardsURL.value=FNL_afterURL;
		document.logonForm.returnurl.value=FNL_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+FNL_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+FNL_stepURL+"&amp;afterwardsURL="+FNL_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FXF") {
		document.logonForm.appName.value=FXF_appName;
		document.logonForm.step3URL.value=FXF_stepURL;
		document.logonForm.afterwardsURL.value=FXF_afterURL;
		document.logonForm.returnurl.value=FXF_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+FXF_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+FXF_stepURL+"&amp;afterwardsURL="+FXF_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "PICKUP") {
		document.logonForm.appName.value=PICKUP_appName;
		document.logonForm.step3URL.value=PICKUP_stepURL;
		document.logonForm.afterwardsURL.value=PICKUP_afterURL;
		document.logonForm.returnurl.value=PICKUP_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+PICKUP_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+PICKUP_stepURL+"&amp;afterwardsURL="+PICKUP_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "RATE") {
		document.logonForm.appName.value=RATE_appName;
		document.logonForm.step3URL.value=RATE_stepURL;
		document.logonForm.afterwardsURL.value=RATE_afterURL;
		document.logonForm.returnurl.value=RATE_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+RATE_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+RATE_stepURL+"&amp;afterwardsURL="+RATE_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "INSIGHT") {
		document.logonForm.appName.value=INSIGHT_appName;
		document.logonForm.step3URL.value=INSIGHT_stepURL;
		document.logonForm.afterwardsURL.value=INSIGHT_afterURL;
		document.logonForm.returnurl.value=INSIGHT_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+INSIGHT_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+INSIGHT_stepURL+"&amp;lang="+clang+"&afterwardsURL="+INSIGHT_afterURL+"&amp;lang="+clang;		
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "MFX") {
		document.logonForm.appName.value=MFX_appName;
		document.logonForm.step3URL.value=MFX_stepURL;
		document.logonForm.afterwardsURL.value=MFX_afterURL;
		document.logonForm.returnurl.value=MFX_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+MFX_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+MFX_stepURL+"&amp;afterwardsURL="+MFX_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "PleaseSelect") {
		document.logonForm.appName.value=PleaseSelect_appName;
		document.logonForm.step3URL.value=PleaseSelect_stepURL;
		document.logonForm.afterwardsURL.value=PleaseSelect_afterURL;
		document.logonForm.returnurl.value=PleaseSelect_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+PleaseSelect_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+PleaseSelect_stepURL+"&amp;afterwardsURL="+PleaseSelect_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FSM") {
		document.logonForm.appName.value=FSM_appName;
		document.logonForm.step3URL.value=FSM_stepURL;
		document.logonForm.afterwardsURL.value=FSM_afterURL;
		document.logonForm.returnurl.value=FSM_afterURL;
		document.logonForm.action = "https://"+FSMHost+"/fcl/logon.do?appName="+FSM_appName+"&amp;locale="+fcl_locale+"&amp;step3URL="+FSM_stepURL+"&amp;afterwardsURL="+FSM_afterURL;
	}
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "GTM") {
		document.logonForm.appName.value=GTM_appName;
		document.logonForm.step3URL.value=GTM_stepURL;
		document.logonForm.afterwardsURL.value=GTM_afterURL;
		document.logonForm.returnurl.value=GTM_afterURL;
		document.logonForm.action = "https://"+startHost+"/fcl/logon.do?appName="+GTM_appName+"&amp;locale="+cc+"_"+clang+"&amp;step3URL="+GTM_stepURL+"&amp;afterwardsURL="+GTM_afterURL;
	}
}
// shows/hides a tag by id
function hideID(val){
	var id 	= document.getElementById(val);
	if(!id) return;
	id.style.display = 'none';
}
// shows/hides a tag by id
function showID(val){
	var id 	= document.getElementById(val);
	if(!id) return;
	id.style.display = 'inline'; 
}
function getexpirydate( nodays){
	var UTCstring;
	Today = new Date();
	nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	UTCstring = Today.toUTCString();
	return UTCstring;
}
function getcookie(cookiename) {
	var cookiestring=""+document.cookie;
	var index1=cookiestring.indexOf(cookiename);
	if (index1==-1 || cookiename=="") return ""; 
	var index2=cookiestring.indexOf(';',index1);
	if (index2==-1) index2=cookiestring.length; 
	return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}
function setcookie(name,value,duration){
	cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration)+"; path=/; domain=.fedex.com;";
	document.cookie=cookiestring;
	if(!getcookie(name)){
		return false;
	}else{
		return true;
	}
}
function setsessioncookie(name,value){
	cookiestring=name+"="+escape(value)+"; EXPIRES=; path=/; domain=.fedex.com;";
	document.cookie=cookiestring;
	if(!getcookie(name)){
		return false;
	}else{
		return true;
	}
}
function deletecookie(name){
	cookiestring=name+"=; EXPIRES=Thu, 01-Jan-70 00:00:01 GMT; path=/; domain=.fedex.com;";
	document.cookie=cookiestring;
	if(!getcookie(name)){
		return false;
	}else{
		return true;
	}
}
function GoTo(page,cc,clang,cpath) {
	var startLoc = new String(window.location);
	var startHost = startLoc.replace(/http(s)?:\/\/((.*\.)?fedex\.com)\/.*/, "$2");
	var FSMHost = startHost;
	if ((startHost == "cms.idev.fedex.com") || (startHost == "contentdev.idev.fedex.com") || (startHost == "cmsdev.idev.fedex.com") || (startHost == "cmsdev1.idev.fedex.com") || (startHost == "teamsite.idev.fedex.com")){startHost="fedex.com";}
	if (startHost == "fedex.com") {startHost="www.fedex.com";}
	if ((FSMHost == "cms.idev.fedex.com") || (FSMHost == "contentdev.idev.fedex.com") || (FSMHost == "cmsdev.idev.fedex.com") || (FSMHost == "cmsdev1.idev.fedex.com") || (FSMHost == "teamsite.idev.fedex.com")){FSMHost="fedex.com";}
	if (FSMHost == "fedex.com") {FSMHost="www.fedex.com";}if (FSMHost == "images.fedex.com") {FSMHost="www.fedex.com";}
	var gtmHost = startHost.replace("www", "gtm");
        if (gtmHost == "gtmtest.fedex.com") {gtmHost = "gtm.test.fedex.com";}
	var locale = cc+"_"+clang;
	var fcl_locale = locale;
	
	if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FSM") {
		if(clang == "tc"){
			clang="zht";
			fcl_locale=cc+"_tc";
		}
		if(clang == "sc"){
			clang="zhs";
			fcl_locale=cc+"_sc";
		}
		if(clang == "sp"){
			clang="es";
		}
	}
	
	//PleaseSelect
	PleaseSelect_appName = "fclfsm";
	PleaseSelect_stepURL = "https%3A%2F%2F"+FSMHost+"%2Fship%2FshipEntryAction.do?method=doRegistration%26locale="+clang+"_"+cc+"%26urlparams="+cpath+"%26sType=F%26action=fsmregister";
	PleaseSelect_afterURL ="http%3A%2F%2F"+FSMHost+"%2F"+cpath;
	
	//GTM
	GTM_appName = "fclgtm";
	GTM_stepURL = "https%3A%2F%2F"+startHost+"%2FGTM%2FFclStep3?cntry_code="+cpath+"%26link=1%26lid=%2F%2FInternational%2F%2FPack+GTM+Intl+Doc+Corp";
	GTM_afterURL = "https%3A%2F%2F"+startHost+"%2FFID?cntry_code="+cpath+"%26link=1%26lid=%2F%2FInternational%2F%2FPack+GTM+Intl+Doc+Corp";

	//FSM
	FSM_appName = "fclfsm";
	FSM_stepURL = "https%3A%2F%2F"+FSMHost+"%2Fship%2FshipEntryAction.do?method=doRegistration%26locale="+clang+"_"+cc+"%26urlparams="+cpath+"%26sType=F%26action=fsmregister";
	FSM_afterURL = "https%3A%2F%2F"+FSMHost+"%2Fship%2FshipEntryAction.do?method=doEntry%26locale="+clang+"_"+cc+"%26urlparams="+cpath+"%26sType=F";
	
	//MFX
	MFX_appName = "fclmfx";
	MFX_stepURL = "https%3A%2F%2F"+startHost+"%2Fmyfedex%2Fgo%2Ffclstep3?cc="+cc+"%26language="+clang;
	MFX_afterURL = "https%3A%2F%2F"+startHost+"%2Fmyfedex%2Fgo%2Fhome?cc="+cc+"%26language="+clang;
	
	//RATES
	RATE_appName = "fclrates";
	RATE_stepURL = "https%3A%2F%2F"+startHost+"%2Fratefinder%2Fregstep3?cc="+cc+"%26language="+clang+"%26action=Registration";
	RATE_afterURL = "https%3A%2F%2F"+startHost+"%2Fratefinder%2Ffclhome?cc="+cc+"%26language="+clang;
	
	//INSIGHT
	INSIGHT_appName = "fclinsight";
	INSIGHT_stepURL = "https%3A%2F%2F"+startHost+"%2Finsight%2Fentrance%2Ffcl_registration_landing_post.jsp";
	INSIGHT_afterURL = "https%3A%2F%2F"+startHost+"%2Finsight%2Fentrance%2Fpre_entrance_post.jsp";
	
	//BILLING ONLINE
	FIO_appName = "fclfio";
	FIO_stepURL = "https%3A%2F%2F"+startHost+"%2FFedExMMA%2Fjsp%2FFioStep3.jsp";
	FIO_afterURL = "https%3A%2F%2F"+startHost+"%2FFedExMMA%2Fjsp%2FRegistrationRouter.jsp";
	
	//Pickup
	PICKUP_appName = "fclpickup";
	PICKUP_stepURL = "https%3A%2F%2F"+startHost+"%2FPickupApp%2FFCLStep3.jsp";
	PICKUP_afterURL = "https%3A%2F%2F"+startHost+"%2FPickupApp%2FscheduleExpressPickup.do?actionText=init%26locale="+cc+"_"+clang+"%26HIFlag=null%26programIndicator=4";
	
	//Freight
	FXF_appName = "fclfreight";
	FXF_stepURL = "https%3A%2F%2Fwww.fedexfreight.fedex.com%2FfclStep3.jsp";
	FXF_afterURL = "https%3A%2F%2Fwww.fedexfreight.fedex.com%2Ffcllogin.do?programIndicator=3";
	
	//Freight National
	FNL_appName = "fclfreight";
	FNL_stepURL = "https%3A%2F%2Ffnl.fedexnational.fedex.com%2Fus%2FfclStep3.jsp";
	FNL_afterURL = "https%3A%2F%2Ffnl.fedexnational.fedex.com%2Fus%2FFCLLogon?programIndicator=3";
	
	if (document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "") {
		alert("Please select a Start Page.");
	} else {
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FIO") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+FIO_appName+"&locale="+locale+"&step3URL="+FIO_stepURL+"&afterwardsURL="+FIO_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FNL") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+FXF_appName+"&locale="+locale+"&step3URL="+FNL_stepURL+"&afterwardsURL="+FNL_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FXF") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+FXF_appName+"&locale="+locale+"&step3URL="+FXF_stepURL+"&afterwardsURL="+FXF_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "PICKUP") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+PICKUP_appName+"&locale="+locale+"&step3URL="+PICKUP_stepURL+"&afterwardsURL="+PICKUP_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "RATE") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+RATE_appName+"&locale="+locale+"&step3URL="+RATE_stepURL+"&afterwardsURL="+RATE_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "INSIGHT") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+INSIGHT_appName+"&locale="+locale+"&step3URL="+INSIGHT_stepURL+"&amp;lang="+clang+"&afterwardsURL="+INSIGHT_afterURL+"&amp;lang="+clang;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "MFX") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+MFX_appName+"&locale="+locale+"&step3URL="+MFX_stepURL+"&afterwardsURL="+MFX_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "PleaseSelect") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+PleaseSelect_appName+"&locale="+fcl_locale+"&step3URL="+PleaseSelect_stepURL+"&afterwardsURL="+PleaseSelect_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "FSM") {
			window.location="https://"+FSMHost+"/fcl/web/jsp/"+page+".jsp?appName="+FSM_appName+"&locale="+locale+"&step3URL="+FSM_stepURL+"&afterwardsURL="+FSM_afterURL;
		}
		if(document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value == "GTM") {
			window.location="https://"+startHost+"/fcl/web/jsp/"+page+".jsp?appName="+GTM_appName+"&locale="+locale+"&step3URL="+GTM_stepURL+"&afterwardsURL="+GTM_afterURL;
		}
	}
}
function Save() {
	if(document.logonForm.remusrid.checked && document.logonForm.username.value != "") {
		setcookie('FCLID',document.logonForm.username.value,9125);
	} else {
		setcookie('FCLID',"",9125);
	}
	if(document.logonForm.remusrid.checked){
		setcookie('FCL_START',document.logonForm.startpage.options[document.logonForm.startpage.selectedIndex].value,9125);
	}
	else{
		deletecookie('FCL_START');
	}
}
function addWSSInfo(name) {
return;
}
// End Login Module

// Start App Module
function togglediv1(divid){
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'inline'; 
		document.getElementById('track_container').style.background = '#6d6d6d url(/images/homepage/activeTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('track_container').style.borderBottom = '#6d6d6d';
		document.getElementById('track_container').style.color = '#ffffff';
		document.getElementById('locations_tab').style.display = 'none'; 
		document.getElementById('locations_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left'; 
		document.getElementById('locations_container').style.borderBottom = '#ffffff';
		document.getElementById('locations_container').style.color = '#666666';
	        if(document.getElementById('lite_container')){
		   document.getElementById('lite_container').style.color = '#666666';
		   document.getElementById('lite_container').style.borderBottom = '#ffffff';
		   document.getElementById('lite_tab').style.display = 'none'; 
		   document.getElementById('lite_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left'; 
	        }
	}
	else{
		if(document.getElementById('locations_tab')){
			document.getElementById('locations_tab').style.display = 'none'; 
			document.getElementById('locations_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left'; 
			document.getElementById('locations_container').style.borderBottom = '#ffffff';
			document.getElementById('locations_container').style.color = '#666666';
	                if(document.getElementById('lite_container')){
			   document.getElementById('lite_container').style.borderBottom = '#ffffff';
			   document.getElementById('lite_container').style.color = '#666666';
			   document.getElementById('lite_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left'; 
		        }
		}
		document.getElementById(divid).style.display = 'inline'; 
		document.getElementById('track_container').style.background = '#6d6d6d url(/images/homepage/activeTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('track_container').style.borderBottom = '#6d6d6d';
		document.getElementById('track_container').style.color = '#ffffff';
		
	}
}
function togglediv2(divid){
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'inline';
		document.getElementById('track_tab').style.display = 'none';
		document.getElementById('lite_tab').style.display = 'none';
		document.getElementById('track_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('track_container').style.borderBottom = '#ffffff';
		document.getElementById('track_container').style.color = '#666666';
	        if(document.getElementById('lite_container')){
		   document.getElementById('lite_container').style.color = '#666666';
		   document.getElementById('lite_container').style.borderBottom = '#ffffff';
		   document.getElementById('lite_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
                }
		document.getElementById('locations_container').style.background = '#6d6d6d url(/images/homepage/activeTab_bg.gif) repeat-x scroll bottom left'; 
		document.getElementById('locations_container').style.borderBottom = '#6d6d6d';
		document.getElementById('locations_container').style.color = '#ffffff';
	}
	else{
		document.getElementById('track_tab').style.display = 'none';
		document.getElementById('track_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('track_container').style.borderBottom = '#ffffff';
		document.getElementById('track_container').style.color = '#666666';
		document.getElementById('locations_container').style.display = 'inline';
		document.getElementById('locations_container').style.background = '#6d6d6d url(/images/homepage/activeTab_bg.gif) repeat-x scroll bottom left';		
		document.getElementById('locations_container').style.borderBottom = '#6d6d6d';
		document.getElementById('locations_container').style.color = '#ffffff';
	        if(document.getElementById('lite_container')){
		   document.getElementById('lite_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
		   document.getElementById('lite_container').style.color = '#666666';
		   document.getElementById('lite_container').style.borderBottom = '#ffffff';
	        }
	}
}
function togglediv3(divid){
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'inline';
		document.getElementById('track_tab').style.display = 'none';
		document.getElementById('locations_tab').style.display = 'none';
		document.getElementById('track_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('locations_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('track_container').style.borderBottom = '#ffffff';
		document.getElementById('locations_container').style.borderBottom = '#ffffff';
		document.getElementById('track_container').style.color = '#666666';
		document.getElementById('locations_container').style.color = '#666666';
		document.getElementById('lite_container').style.background = '#6d6d6d url(/images/homepage/activeTab_bg.gif) repeat-x scroll bottom left'; 
		document.getElementById('lite_container').style.borderBottom = '#6d6d6d';
		document.getElementById('lite_container').style.color = '#ffffff';
	}
	else{
		document.getElementById('track_tab').style.display = 'none';
		document.getElementById('track_container').style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
		document.getElementById('track_container').style.borderBottom = '#ffffff';
		document.getElementById('track_container').style.color = '#666666';
		document.getElementById('locations_container').style.display = 'inline';
		document.getElementById('locations_container').style.background = '#6d6d6d url(/images/homepage/activeTab_bg.gif) repeat-x scroll bottom left';		
		document.getElementById('locations_container').style.borderBottom = '#6d6d6d';
		document.getElementById('locations_container').style.color = '#ffffff';
	}
}
function toggleDiv(divid) {
                toggleOff("track_container");
                toggleOff("locations_container");
                toggleOff("lite_container");
                toggleOn(divid);
}
                

function toggleOn(divid){
                if (document.getElementById(divid)) {
                                document.getElementById(divid).style.display = 'inline';
                                document.getElementById(divid).style.background = '#ffffff     url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
                                document.getElementById(divid).style.borderBottom = '#ffffff';
                                document.getElementById(divid).style.color = '#666666';
                }
}

function toggleOff(divid){
                if (document.getElementById(divid)) {
                document.getElementById(divid).style.display = 'none';
                document.getElementById(divid).style.background = '#ffffff url(/images/homepage/inactiveTab_bg.gif) repeat-x scroll bottom left';
                document.getElementById(divid).style.borderBottom = '#ffffff';
                document.getElementById(divid).style.color = '#666666';
                }
}
// End App Module


// ************************************************************************************
// * BEGIN: Flash checker. This will check to see if Flash is available
// ************************************************************************************

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;			
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
 			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }
    document.write(str);

 }

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
// ************************************************************************************
// * END: Flash checker. This will check to see if Flash is available
// ************************************************************************************




// This was for grabbing alternate content if flash is off
//function loadXMLDoc(dname) 
//{
//if (window.XMLHttpRequest)
//  {
//  xhttp=new XMLHttpRequest();
//  }
//else
//  {
//  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
//  }
//xhttp.open("GET",dname,false);
//xhttp.send();
//return xhttp.responseXML;
//}

// Write BAG object tag out
function bag(){
// BAG
	var requiredMajorVersion = 9;
	var requiredMajorVersionXPlusOne = 10;
	var requiredMinorVersion = 0;
	var requiredRevision = 0;
	var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	var hasRequestedVersionXPlusOne = DetectFlashVer(requiredMajorVersionXPlusOne, requiredMinorVersion, requiredRevision);
	// Default XPlus One to on
	
	
	var XPlusOne = "off";
	var xp1_str = location.href;
	var patt1=/\/ca_english\//gi;
	var patt2=/\/ca_french\//gi;
	var patt3=/\/gb\//gi;
	var patt4=/\/in\//gi;
	var XPlusOneTestresult = xp1_str.match(patt1) || xp1_str.match(patt2) || xp1_str.match(patt3);
	//var XPlusOneTestresult = xp1_str.match(patt1) || xp1_str.match(patt2) || xp1_str.match(patt3) || xp1_str.match(patt4);

	// If we are in one of our countries lets turn XPlus One on
	if(XPlusOneTestresult){
	   XPlusOne = "on";
	}
	// Lets check if XPlusOne is turned off 
	if (XPlusOne == "off")
	{
		// No XPlusOne
		// Check to see if client has correct version of flash player
		if (hasRequestedVersion) {
			document.write('<object align="middle" id="bagShell" height="206" width="540" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">\n');
			document.write('<param value="always" name="allowScriptAccess"/>\n');
			document.write('<param value="XMLPath=index_bag%2Exml" name="FlashVars"/>\n');
			document.write('<param value="false" name="allowFullScreen"/>\n');
			document.write('<param value="/images/homepage/shell/bagShell.swf" name="movie"/>\n');
			document.write('<param value="high" name="quality"/>\n');
			document.write('<param value="transparent" name="wmode"/>\n');
			document.write('<param value="#ffffff" name="bgcolor"/>\n');
			document.write('<embed pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" allowFullScreen="false" allowScriptAccess="always" align="middle" name="bagShell" height="206" width="540" bgcolor="#ffffff" wmode="transparent" quality="high" FlashVars="XMLPath=index_bag%2Exml" src="/images/homepage/shell/bagShell.swf">\n');
			document.write('</embed>\n');
			document.write('</object>\n');
		} else {
			// We need to display alternate content
			displayAlternateBagContent();
		}
	}
	else if (XPlusOne == "on") {
		// Has XPlusOne
		// Check to see if client has correct version of flash player
		if (hasRequestedVersionXPlusOne) {
			document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="540" height="206" id="bagShell" align="middle">\n');
			document.write('<param name="allowScriptAccess" value="always" />\n');
			document.write('<param name="FlashVars" value="referrer='+encodeURIComponent(document.referrer)+'">\n');
			document.write('<param name="allowFullScreen" value="false">\n');
			document.write('<param name="movie" value="/images/homepage/shell/bagShellXPlus_1.swf">\n');
			document.write('<param name="quality" value="high">\n');
			document.write('<param name="wmode" value="transparent">\n');
			document.write('<param name="bgcolor" value="#ffffff">\n');
			document.write('<embed src="/images/homepage/shell/bagShellXPlus_1.swf" FlashVars="referrer='+encodeURIComponent(document.referrer)+'" quality="high" wmode="transparent" bgcolor="#cccccc" width="540" height="206" name="bagShell" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www. adobe.com/go/getflashplayer" >\n');
			document.write('</embed>\n');
			document.write('</object>\n');
		} else {
			// We need to display alternate content
			displayAlternateBagContent();
		}

	 }
}

function displayAlternateBagContent() {
	// If alternate content is set then display that 
	if (document.getElementById("alternate_bag_content") ) {
		document.getElementById("alternate_bag_content").style.display="block";
	} else {
		// Default for all pages that do not have alternate content set.
		document.write('<img src="http://images.fedex.com/images/homepage/bags/static/static_01.jpg" width="540" height="206" alt="Welcome to FedEx"/>\n');
	}
}

 // BAG END

function rtl_bag(){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="540" height="206" id="bagShell" align="middle">\n');
                document.write('<param name="allowScriptAccess" value="always" />\n');
                document.write('<param name="FlashVars" value="XMLPath=index_bag%2Exml">\n');
                document.write('<param name="allowFullScreen" value="false">\n');
                document.write('<param name="movie" value="/images/homepage/shell/bagShell_rtl.swf">\n');
                document.write('<param name="quality" value="high">\n');
                document.write('<param name="wmode" value="transparent">\n');
                document.write('<param name="bgcolor" value="#ffffff">\n');
                document.write('<embed src="/images/homepage/shell/bagShell_rtl.swf" FlashVars="XMLPath=index_bag%2Exml" quality="high" wmode="transparent" bgcolor="#cccccc" width="540" height="206" name="bagShell" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" >\n');
                document.write('</embed>\n');
                document.write('</object>\n');
}
/*
	parseUri 1.2.1
	(c) 2007 Steven Levithan <stevenlevithan.com>
	MIT License
*/
function parseUri (str) {
	var	o   = parseUri.options,
		m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
		uri = {},
		i   = 14;

	while (i--) uri[o.key[i]] = m[i] || "";

	uri[o.q.name] = {};
	uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
		if ($1) uri[o.q.name][$1] = $2;
	});

	return uri;
};

parseUri.options = {
	strictMode: false,
	key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
	q:   {
		name:   "queryKey",
		parser: /(?:^|&)([^&=]*)=?([^&]*)/g
	},
	parser: {
		strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
		loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
	}
};


// Alert Box
function alertFlash(){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" width="540" height="36">\n');
	document.write('<param name=movie value="/images/homepage/shell/alertMessage_.swf">\n');
	document.write('<param name=quality value=high>\n');
	document.write('<PARAM NAME=FlashVars VALUE="XMLPath=index_alert%2Exml">\n');
	document.write('<param name="WMode" value="Transparent">\n');
	document.write('<embed src="/images/homepage/shell/alertMessage_.swf" WMode="Transparent" FlashVars="XMLPath=index_alert%2Exml" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="540" height="36">\n');
	document.write('</embed>\n');
	document.write('</object>\n');
}

// Popup
function popUp(url,name,w,h){
	openwin = window.open(url,name,"height="+h+",width="+w+",resizable=yes,toolbar=no,location=no,scrollbars=yes,status=no");
	return false;
}

// Display Module
function displayModule(){
	var fclID = getcookie('FCLID');
	var fclStart = getcookie('FCL_START');
	if (fclStart != "" && fclStart != ";") {
		if (document.logonForm){
			for (var optn = 0;optn<document.logonForm.startpage.options.length;optn++) {
				if (document.logonForm.startpage.options[optn].value == fclStart) {
					document.logonForm.startpage.value=fclStart;				
				}
			}
			if (fclID != "" && fclID !=";") {
				document.logonForm.username.value=fclID;
				document.logonForm.remusrid.checked="true";
			}
		}
	}
	if(getcookie('fcl_fname').length > 1) {
		hideID('nojavascript');
		hideID('login');
		hideID('newCustomerController');
		showID('logout');
	} else {
		hideID('nojavascript');
		showID('login');
		showID('newCustomerController');
	}
}
			
// Display Dropdown
var ddstate = new Array();
function displayDD(mn,am){
	var imgname = "img"+mn;
	var endname = mn+"end";
	if (((ddstate[mn] == 0)||(ddstate[mn]==undefined))&&(am == 1)){
		ddstate[mn] = 1;
		showID(mn);
		switch_dd(document.getElementById(imgname),1);
		document.getElementById(endname).scrollIntoView(true); 
	}
	else if ((ddstate[mn] == 1)&&(am == 2)){
		ddstate[mn] = 0;
		setTimeout(function(){hideID(mn)},500);
		setTimeout(function(){switch_dd(document.getElementById(imgname),0)},500);
	}
	else{
		ddstate[mn] = 0;
		hideID(mn);
		switch_dd(document.getElementById(imgname),0);
	}
}

// Switch Dropdown Arrow
function switch_dd(dimg,bool) {
	(bool) ? dimg.src="/images/homepage/dd_up.gif": dimg.src="/images/homepage/dd_down.gif";
}

// this function determines whether the event is the equivalent of the microsoft 
// mouseleave or mouseenter events. 
function isMouseLeaveOrEnter(e, handler) {
	if (e.type != 'mouseout' && e.type != 'mouseover') return false;
	var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
	while (reltg && reltg != handler) reltg = reltg.parentNode;
	return (reltg != handler); 
}


