//This script allows dynamic redirection without using switchdir.asp
//Author:  Celina Wimprine 06-21-01

//Usage:  
//First, insert the following code into the <head> section of your page: 
//<script language="JavaScript" src="/onlinebanking/gotoURL.js" type="text/javascript"></script>

//Use the following for the appropriate hotlink: <a href="javascript:gotoURL('homedir',0,null)">
//or if you want to open a new windows: <a href="javascript:gotoURL('Fees',1,'menubar=yes,scrollbars=yes')">
//or if you want it to return a specified path i.e. the homedir: gotoURL('homedir',2,null)

var newwin;

function popUpWin(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=380,left = 200,top = 200');");
}

function popUpWinF(URL,features) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', '" + features + "');");
}

function gotoLink(prefix,myLink,opennewwin,windowfeatures) {
	var myURL = "";

	myURL = gotoURL(prefix,2,null);
	myURL = myURL + myLink;
	
	if (opennewwin == 0) {
		top.location.href = myURL;
	}
	else {
	  if (opennewwin == 1) {
		top.location.href = myURL;
	  }
	  else {	
		return(myURL);
	  }
	}
}
			  
function gotoURL(urltype,opennewwin,windowfeatures) {
  var myHost = location.hostname.toLowerCase();
  var myURL = "";

	if (myHost == "wib03") {
		if (urltype == "homedir") {
			myURL = "http://wib03/whitneydev/";
		}
		if (urltype == "olb") {
			myURL = "https://wib03/";
		}		
		if (urltype == "BPLogon") {
			myURL = "https://cert.mybills.com/wpsgen/wps?sp=2403&rq=pme";
		}
		if (urltype == "BPSignup") {
			myURL = "https://cert.mybills.com/wpsgen/wps?rq=enf&sp=2403&confirm=yes";
		}		
		if (urltype == "BBPLogon") {
			myURL = "https://cert.bizbills.com/wpsb2b/wps?rq=home&sp=4823";
		}		
		if (urltype == "BBPSignup") {
			myURL = "https://wib03/whitneydev/whitneyapps/billpayenrollment/bp_enroll_application.asp";
		}		
		if (urltype == "Fees") {
			myURL = "http://wib03/whitneydev/disclosure/onlinefees.asp";
		}
	}
	else {
	  if (myHost == "wibstage") {
		if (urltype == "homedir") {
			myURL = "http://wibstage/home/";
		}
		if (urltype == "olb") {
			myURL = "https://wibstage/";
		}
		if (urltype == "BPLogon") {
			myURL = "https://cert.mybills.com/wpsgen/wps?sp=2403&rq=pme";
		}
		if (urltype == "BPSignup") {
			myURL = "https://cert.mybills.com/wpsgen/wps?rq=enf&sp=2403&confirm=yes";
		}		
		if (urltype == "BBPLogon") {
			myURL = "https://cert.bizbills.com/wpsb2b/wps?rq=home&sp=4823";
		}		
		if (urltype == "BBPSignup") {
			myURL = "https://wibstage/home/whitneyapps/billpayenrollment/bp_enroll_application.asp";
		}		
		if (urltype == "Fees") {
			myURL = "http://wibstage/disclosure/onlinefees.asp";
		}
	  }
	  else {
       if (myHost == "172.31.6.218") {
		if (urltype == "homedir") {
			myURL = "http://172.31.6.218/home/";
		}
		if (urltype == "olb") {
			myURL = "http://172.31.6.218/";
		}		
		if (urltype == "BPLogon") {
			myURL = "https://cert.mybills.com/wpsgen/wps?sp=2403&rq=pme";
		}
		if (urltype == "BPSignup") {
			myURL = "https://cert.mybills.com/wpsgen/wps?rq=enf&sp=2403&confirm=yes";
		}		
		if (urltype == "BBPLogon") {
			myURL = "https://cert.bizbills.com/wpsb2b/wps?rq=home&sp=4823";
		}		
		if (urltype == "BBPSignup") {
			myURL = "https://172.31.6.218/home/whitneyapps/billpayenrollment/bp_enroll_application.asp";
		}		
		if (urltype == "Fees") {
			myURL = "http://172.31.6.218/disclosure/onlinefees.asp";
		}
       }
	   else {	
		if (urltype == "homedir") {
			myURL = "http://www.whitneybank.com/";
		}
		if (urltype == "olb") {
			myURL = "https://tms.whitneybank.com/";
		}		
		if (urltype == "BPLogon") {
			myURL = "https://mybills.com/wpsgen/wps?sp=2403&rq=pme";
		}
		if (urltype == "BPSignup") {
			myURL = "https://mybills.com/wpsgen/wps?rq=enf&sp=2403&confirm=yes";
		}		
		if (urltype == "Fees") {
			myURL = "http://www.whitneybank.com/disclosure/onlinefees.asp";
		}
		if (urltype == "BBPLogon") {
			myURL = "https://bizbills.com/wpsb2b/wps?rq=home&sp=4823";
		}			
		if (urltype == "BBPSignup") {
			myURL = "https://tms.whitneybank.com/whitneyapps/billpayenrollment/bp_enroll_application.asp";
		}
	   }
	  }
	}

	if (opennewwin == 0) {
		top.location.href = myURL;
	}
	else {
	  if (opennewwin == 1) {
		top.location.href = myURL;
	  }
	  else {	
		return(myURL);
	  }
	}
}