// This include file has all scripts required for determine
// the path automatically for production and test server
// include syntax: <SCRIPT language="JavaScript" src="/jump.js"></SCRIPT> 
// Code usage example: <a href="javascript:jump('residential/info.html','s');">LINK</a>

var sys_url = location.href.toUpperCase();
if (sys_url.indexOf("DEV") != "-1") {
    var perlpath   = "http:\/\/webdev.swgas.com\/perl\/";
    var secrperl   = "https:\/\/webdev.swgas.com\/perl\/";
    var urlpath    = "http:\/\/webdev.swgas.com\/";
    var secrpath   = "https:\/\/webdev.swgas.com\/";
    var searchpath = "http:\/\/webdev.swgas.com\/";
} else if (sys_url.indexOf("UAT") != "-1") {
    var perlpath   = "http:\/\/webuat.swgas.com\/perl\/";
    var secrperl   = "https:\/\/webuat.swgas.com\/perl\/";
    var urlpath    = "http:\/\/webuat.swgas.com\/";
    var secrpath   = "https:\/\/webuat.swgas.com\/";
    var searchpath = "http:\/\/webuat.swgas.com\/";
} else {
    var perlpath   = "http:\/\/www.swgas.com\/perl\/";
    var secrperl   = "https:\/\/www.swgas.com\/perl\/";
    var urlpath    = "http:\/\/www.swgas.com\/";
    var secrpath   = "https:\/\/www.swgas.com\/";
    var searchpath = "http:\/\/www.swgas.com\/";
}
 
function jump(whr,pth) {
   if (pth == "r") {window.location = secrperl + whr;}  // r= https perl
   if (pth == "p") {window.location = perlpath + whr;}  // p= http perl
   if (pth == "u") {window.location = urlpath + whr;}   // u= http
   if (pth == "s") {window.location = secrpath + whr;}  // s= https
   if (pth == "f") {window.location = searchpath + whr;}  // f= http find (For Search Engine)
}

function win_jump(whr,pth) {
   if (pth == "u") {
      mw =  window.open(urlpath  + whr, 'mywin');
   }  // u= http
   if (pth == "s") {
      mw =  window.open(secrpath + whr, 'mywin');
   }  // s= https
      
}

