var isSubappBusy;
var warnType = "";
var lockType = "";
var displayType = "";
var displayPhrase = "";
var displayPhrase2= "";
var LOCK = "lock";
var WARN = "warn";
var logOffWhenCancelled = "false";
var suppressWarn = "false";
var suppressLock = "false";
var isE2e = false;
var openWins = new Array();
var openWinsCount = 0;
var execFuncName = "";
function addWinToList(winHandle)
{
openWins[openWinsCount++] = winHandle;
}
function closeOpenWins()
{
var i = 0;
for(i = 0; i < openWins.length; i++)
{
if(openWins[i])
openWins[i].close();
}
}
function isSubappBusy()
{
return ((displayPhrase != null) && (displayPhrase != ""));
}
function confirmGo(sprWarn, sprLock)
{
suppressWarn = sprWarn;
if(typeof suppressWarn == 'undefined')
suppressWarn = "false";
suppressLock = sprLock;
if(typeof suppressLock == 'undefined')
suppressLock = "false";
if(typeof execFuncName != 'undefined' && execFuncName != "")
return ConfirmGo2();
else
return ConfirmGo();
}
function ConfirmGo()
{
var subappBusy = isSubappBusy();
if (subappBusy)
{
if (lockType == LOCK && suppressLock == "false")
{
alert (displayPhrase);
return false;
}
else if (warnType == WARN && suppressWarn == "false" )
{
if (!confirm(displayPhrase))
{
if(logOffWhenCancelled == "true")
{
logOff();
}
return false;
}
else
{
if (displayPhrase2 != "")
{
if (!confirm(displayPhrase2))
{
if(logOffWhenCancelled == "true")
{
logOff();
}
return false;
}
}
}
}
else
{
if(suppressWarn == "false" && suppressLock == "false")
alert("Dialog Error: ConfirmGo 'Type' not alert or confirm!");
}
}
//setSubappBusy("","","");
return true;
}
function setSubappBusy(dType, phrase1, phrase2, execFunc)
{
if (dType == "")
{
lockType = dType;
warnType = dType;
displayPhrase = "";
displayPhrase2 = "";
execFuncName = "";
}
else
{
if(dType == WARN)
warnType = dType;
else if(dType == LOCK)
lockType = dType;
displayPhrase = phrase1;
displayPhrase2 = phrase2;
logOffWhenCancelled = "false";
execFuncName = execFunc;
}
}
function setSubappBusy2(dType, phrase1, phrase2, logOffIfCancelled, execFunc)
{
if (dType == "")
{
lockType = dType;
warnType = dType;
displayPhrase = "";
displayPhrase2 = "";
logOffWhenCancelled = "false";
execFuncName = "";
}
else
{
if(dType == WARN)
warnType = dType;
else if(dType == LOCK)
lockType = dType;
displayPhrase = phrase1;
displayPhrase2 = phrase2;
logOffWhenCancelled = logOffIfCancelled;
execFuncName = execFunc;
}
}
function ConfirmGo2()
{
var subappBusy = isSubappBusy();
if (subappBusy)
{
if (lockType == LOCK && suppressLock == "false")
{
alert (displayPhrase);
return false;
}
else if (warnType == WARN && suppressWarn == "false" )
{
if (confirm(displayPhrase))
{
if(typeof execFuncName != 'undefined' && execFuncName != ""){eval(execFuncName)};
return false;
}
}
else
{
if(suppressWarn == "false" && suppressLock == "false")
alert("Dialog Error: ConfirmGo 'Type' not alert or confirm!");
}
}
//setSubappBusy("","","");
return true;
}
function submitLinkPostForm(formName)
{
var myForm = document.forms[formName];
myForm.submit();
}
function submitLinkPostForm2(formName, actionURL)
{
var myForm = document.forms[formName];
myForm.action=actionURL;
myForm.submit();
}
function encryptE2e(form)
{
if (!document.e2e)
return;
e2eapplet = document.e2e;
if (form.pin) {
enc = e2eapplet.encryptPIN(form.pin.value,eid);
if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5)
form.pin.maxLength = enc.length();
form.pin.value = enc;
}
if (form.pwd) {
enc = e2eapplet.encryptPassword(form.pwd.value,eid);
if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5)
form.pwd.maxLength = enc.length();
form.pwd.value = enc;
}
}
function validateToken(form) {
return true;
}
function validateCredential(form) {
var isValid = true;
var focusField = null;
var i = 0;
var NO_SELECTION = '-1';
var fields = new Array();
oRequired = new credentials();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if(typeof field != 'undefined') {
if(field.type != null) {
if(field != null && field.disabled == false) {
if (field.type == 'text' ||
field.type == 'password') {
if (field.type == 'text' || field.type == 'password') {
if (field.value == '' || field.value == null) {
focusField = field;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
}
}
}
}
}   
if (fields.length > 0 && focusField != null) {
alert(fields.join('\n'));
focusField.focus();
}
if (isValid && document.getElementById("reentry"))
disablePinPad();
if (isValid && (document.getElementById("vkb") || document.getElementById("largevkb")))
hideVkb('done');
if (isValid && isE2e)
encryptE2e(form);
return isValid;
}
function validateCredentialOnClient(form) {
var isValid = true;
var focusField = null;
var i = 0;
var NO_SELECTION = '-1';
var fields = new Array();
oRequired = new credentialsonclient();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if(typeof field != 'undefined') {
if(field.type != null) {
if(field != null && field.disabled == false) {
if (field.type == 'text' ||
field.type == 'password') {
if (field.type == 'text' || field.type == 'password') {
if (field.value == '' || field.value == null) {
focusField = field;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
}
}
}
}  
}   
if (fields.length > 0 && focusField != null) {
alert(fields.join('\n'));
focusField.focus();
}
if (isValid && document.getElementById("reentry"))
disablePinPad();
if (isValid && isE2e)
encryptE2e(form);
return isValid;
}
function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var NO_SELECTION = '-1';
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if(typeof field != 'undefined') {
if(field.type != null) {
if(field != null &&  field.disabled == false && (typeof field.readOnly == 'undefined' || field.readOnly == false) ) {
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password' ||
field.type == 'hidden' ||
field.type == 'checkbox') {
var value = NO_SELECTION;
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
}
}
else {
value = field.value;
}
if (field.type == "select-one" && value == NO_SELECTION) {
if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
if (field.type == 'text' 
|| field.type == 'password'
|| field.type == 'textarea'
|| field.type == 'hidden' || field.type == 'file') {
if (field.value == '' || field.value == null) {
focusField = field;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
if (field.type == 'checkbox') {
var checked = false;
if (field.checked) {
checked=true;
}
if(checked==false){
focusField=field;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
}
}
}
else {
var checked = false;
var skipped = true;
var focusElem;
for(j=0;j<field.length;j++) {
temp = field[j];
if (temp == null
|| temp.disabled == true
|| typeof  temp.readOnly == 'undefined'
|| temp.readOnly == true) {
continue;
}
else {
skipped = false;
if (temp.type == 'radio') {
focusElem=temp;
if(temp.checked) {
checked=true;
}
}
if(temp.type == 'checkbox') {
focusElem=temp;
if(temp.checked) {
checked=true;
}
}
if(temp.type == 'text') {
focusElem=temp;
if(temp.value !='') {
checked=true;
}
}
}
}
if(checked==false && !skipped) {
focusField=focusElem;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
}
}
if (fields.length > 0 && focusField != null) {
if (focusField.type != "hidden"){
alert(fields.join('\n'));
/** ITO Fix - 3/23/2009 **/
if (focusField.type == "radio"){
if(field.length>0){
field[0].focus();
}else{
focusField.focus();
}
}else{
focusField.focus();
}
}else{
alert(fields.join('\n'));
}
}
return isValid;
}
function validateRequired2(form) {
var isValid = true;
var focusField = null;
var i = 0;
var NO_SELECTION = '-1';
var fields = new Array();
oRequired = new required2();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if(typeof field != 'undefined') {
if(field.type != null) {
if(field != null &&  field.disabled == false && (typeof field.readOnly == 'undefined' || field.readOnly == false) ) {
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password' ||
field.type == 'hidden') {
var value = NO_SELECTION;
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
}
}
else {
value = field.value;
}
if (field.type == "select-one" && value == NO_SELECTION) {
if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
if (field.type == 'text' 
|| field.type == 'password'
|| field.type == 'textarea'
|| field.type == 'hidden'
|| field.type == 'file') {
if (field.value == '' || field.value == null) {
focusField = field;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
}
}
}
else {
var checked = false;
var skipped = true;
var focusElem;
for(j=0;j<field.length;j++) {
temp = field[j];
if (temp == null
|| temp.disabled == true
|| typeof  temp.readOnly == 'undefined'
|| temp.readOnly == true) {
continue;
}
else {
skipped = false;
if (temp.type == 'radio') {
focusElem=temp;
if(temp.checked) {
checked=true;
}
}
if(temp.type == 'checkbox') {
focusElem=temp;
if(temp.checked) {
checked=true;
}
}
if(temp.type == 'text') {
focusElem=temp;
if(temp.value !='') {
checked=true;
}
}
}
}
if(checked==false && !skipped) {
focusField=focusElem;
fields[i++] = oRequired[x][1];
isValid = false;
break;
}
}
}
}
if (fields.length > 0 && focusField != null) {
if (focusField.type != "hidden"){
alert(fields.join('\n'));
/** ITO Fix - 3/23/2009 **/
if (focusField.type == "radio"){
if(field.length>0){
field[0].focus();
}else{
focusField.focus();
}
}else{
focusField.focus();
}
}else{
alert(fields.join('\n'));
}
}
return isValid;
}
function validateMaxLength(form) {
return true;
}
function validateInputText(form) {
return true;
}
function getCookie(name)
{
var c=""+document.cookie;
var index = c.indexOf(name + "=");
if (index == -1) return null;
var endstr = c.indexOf(";", index);
if (endstr == -1) endstr = c.length;
return unescape(c.substring(index+name.length+1, endstr));
}
function setCookie (name,value,expires,path,domain,secure) {
document.cookie = name + "=" + value + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
}
function isEmpty(s){ return ((s == null) || (s.length == 0)) }
function isWhitespace (s)
{
var i;
var whitespace = " \t\n\r";
if (isEmpty(s)) return true; // Is s empty?
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (whitespace.indexOf(c) == -1) return false;
}
return true;
}
function displayHelp(helpURL, windowName, openWinOptions)
{
var anchor = "";
if(helpURL.indexOf("#") != -1)
{
anchor = helpURL.substring(helpURL.indexOf("#") + 1);
}
if(!isWhitespace(applicationID))
{
helpURL += (helpURL.indexOf("?") != -1) ? "&" : "?";
helpURL += "appId=" + applicationID;
}
if(!isWhitespace(screenID))
{
helpURL += (helpURL.indexOf("?") != -1) ? "&" : "?";
helpURL += "screenId=" + screenID;
}
if(!isWhitespace(transactionTypeCode))
{
helpURL += (helpURL.indexOf("?") != -1) ? "&" : "?";
helpURL += "ttc=" + transactionTypeCode;
}
if(!isWhitespace(helpVariant))
{
helpURL += (helpURL.indexOf("?") != -1) ? "&" : "?";
helpURL += "helpVariant=" + helpVariant;
}       
if(!isWhitespace(anchor))
helpURL += "#" + anchor;
var winHandle = showPopup_W_XY(helpURL, windowName,openWinOptions, 160, 80);
addWinToList(winHandle);
winHandle.focus();
}
function OnClickHandler() {
var el=null;
var flag=true;
el=event.srcElement;
while (flag && el) {
if (el.tagName=="A") {
flag=false;
if (el.protocol=="javascript:" || el.href.indexOf("javascript:")!=-1) {
execScript(unescape(el.href),"javascript");
window.event.returnValue=false;
}
}
else
el=el.parentElement;
}
}
if ((navigator.appName.indexOf("Microsoft")!=-1) && (navigator.appVersion.substring(0,1)>"3"))
if (navigator.userAgent.indexOf('Mac') == -1)
document.onclick=OnClickHandler;
function NS6OnClickHandler(event) {
var srcElement=event.target;
if (srcElement.nodeType==1 || srcElement.nodeType==3)
srcElement=srcElement.parentNode;
if (srcElement.tagName=="A") {
// Display the popup only if the link that was clicked on will not
if (lockType==LOCK && srcElement.onclick!=null && srcElement.onclick.toString().indexOf("confirmGo")==-1) {
alert(displayPhrase);
return false;
}
}
return true;
}
if (navigator.appName.indexOf("Netscape")!=-1  && document.getElementById  && navigator.userAgent.indexOf("Safari") == -1)
document.onclick = NS6OnClickHandler;
if(window.location.protocol.indexOf("https") != -1)
setCookie("JSESSIONID", getCookie("JSESSIONID"), null, "/", null, true);
if (document.captureEvents) 
{//non IE
if (Event.MOUSEDOWN)
{//NS 4, NS 6+, Mozilla 0.9+
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = winMouseDown;
}
}
var _evt = null;
function winMouseDown(e)
{
_evt = e;
}
function winSize() 
{
var wW = -1;
var wH = -1;
if (typeof(window.innerWidth) == 'number') 
{//Non-IE
wW = window.innerWidth;
wH = window.innerHeight;
} 
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
{//IE 6+ in 'standards compliant mode'
wW = document.documentElement.clientWidth;
wH = document.documentElement.clientHeight;
} 
else if (document.body && (document.body.clientWidth || document.body.clientHeight)) 
{//IE 4 compatible
wW = document.body.clientWidth;
wH = document.body.clientHeight;
}
var win = new Object();
win.x = wW;
win.y = wH;
return win;
}
function popupWinSize(winProp)
{
var wW = -1;
var wH = -1;
var props = winProp.split(',');
for (var i = 0; i < props.length; i++)
{
var nv = props[i].split('=');
if (nv.length == 2)
{
var n = nv[0].replace(/^\s+/, '').replace(/\s+$/, '');
var v = nv[1].replace(/^\s+/, '').replace(/\s+$/, '');
if (n.toLowerCase() == "width" && !isNaN(parseInt(v,10))) wW = parseInt(v,10);  
else if (n.toLowerCase() == "height" && !isNaN(parseInt(v,10))) wH = parseInt(v,10);
}
}
var win = new Object();
win.x = wW;
win.y = wH;
return win;
}
function getClickPos()
{
var mouseX = 0;
var mouseY = 0;
if (!_evt) _evt=window.event||arguments.callee.caller.arguments[0];
if (_evt)
{
if (typeof(_evt.pageX) == 'number' ) 
{
mouseX = _evt.pageX;
mouseY = _evt.pageY;
}
else if(typeof(_evt.clientX) == 'number')
{
mouseX = _evt.clientX;
mouseY = _evt.clientY;
}
}
var mouse = new Object();
mouse.x = mouseX;
mouse.y = mouseY;
return mouse;   
}
function showPopup_W_XY(url, wn, winProp, X, Y)
{
var mouse = new Object();
mouse.x = X;
mouse.y = Y;
mouse.offsetX = 0;
mouse.offsetY = 0;
return doPopup(url, wn, winProp, mouse, 'W');
}
function showPopup_L_XY(url, wn, winProp, X, Y)
{
var mouse = getClickPos();
mouse.offsetX = X;
mouse.offsetY = Y;
return doPopup(url, wn, winProp, mouse, 'L');
}
function showPopup(url, wn, winProp)
{
var mouse = getClickPos();
mouse.offsetX = 25;
mouse.offsetY = 0;
return doPopup(url, wn, winProp, mouse, 'L');
}
function doPopup(url, wn, winProp, mouse, type)
{  
var x = 0;
var y = 0;
var offsetX = 0;
var offsetY = 0;
url+="";
wn+="";
winProp+="";
if (winProp == null) winProp = "";
if (document.getElementById) 
{
if (isNaN(window.screenX))
{// IE6
x=mouse.x+window.screenLeft
y=mouse.y+window.screenTop
}
else 
{// Mozilla Firefox 0.9
if (type=='L')
{
offsetX = window.pageXOffset;
offsetY = window.pageYOffset;
}
x=mouse.x+window.screenX+(window.outerWidth-window.innerWidth)-offsetX;
y=mouse.y+window.screenY+(window.outerHeight-24-window.innerHeight)-offsetY;
}
}
else if (document.all) 
{
x=mouse.x+window.screenLeft
y=mouse.y+window.screenTop      
}
else if (document.layers) 
{// NS 4.7x
if (type=='L')
{
offsetX = window.pageXOffset;
offsetY = window.pageYOffset;
}       
x=mouse.x+window.screenX+(window.outerWidth-window.innerWidth)-offsetX;
y=mouse.y+window.screenY+(window.outerHeight-24-window.innerHeight)-offsetY;
}
x += mouse.offsetX;
y += mouse.offsetY;
if (x<0) x=0;
if (y<0) y=0;
var popupWin = popupWinSize(winProp);
if (popupWin.x < 0 || popupWin.y < 0)
{
var win = winSize();
if (popupWin.x < 0) popupWin.x = win.x;
if (popupWin.y < 0) popupWin.y = win.y; 
}
if (screen && screen.availHeight)
{
if ((y + popupWin.y) > screen.availHeight)
y = screen.availHeight - popupWin.y;
}
if (screen && screen.availWidth)
{
if ((x + popupWin.x) > screen.availWidth)
x = screen.availWidth - popupWin.x;
}
return window.open (url, wn, winProp + ',screenX='+x+',left='+x+',screenY='+y+',top='+y);
}
function linkParentAndCloseSelf(url){
self.opener.location = url;
window.close();
}
function trim(str){
var reTrimRight = / +$/;
var reTrimLeft = /^ +/;
str = str.replace( reTrimRight, "" );
str = str.replace( reTrimLeft, "" );
return str;
}
function openPrintWin(url, wn, winProp)
{
var winHandle = window.open(url, wn, winProp);
addWinToList(winHandle);
winHandle.focus();
}
var navClass="";
var L1,L2,L3,L4;
function hlMenu() {
var l = new Array("","A","B","C","D");
for (var i = 1; i <= L; i++) {
var className = "NavL"+l[i]+"On";
if (navClass != "") className = navClass;
eval("var cellID = 'cell_link_'+L"+i);
eval("var linkID = 'link_'+L"+i);
if (document.getElementById(cellID) == null)
continue;               
document.getElementById(cellID).className = className;
document.getElementById(linkID).className = className;
if (i == 1) {
if (document.getElementById(cellID+"L") == null)
continue;               
eval("var imgID = 'image_link_'+L"+i);  
document.getElementById(cellID+"L").className = className+"L";
document.getElementById(cellID+"R").className = className+"R";          
var imgR = document.getElementById(imgID+"R").src;
var imgL = document.getElementById(imgID+"L").src;                                      
var imgONR = imgR.substr(0,imgR.indexOf('spacer.gif')) + 'tab_r.gif';
var imgONL = imgL.substr(0,imgL.indexOf('spacer.gif')) + 'tab_l.gif';
document.images[imgID+"R"].src = imgONR;
document.images[imgID+"L"].src = imgONL;                
}
}
}
// Timeout processing
var TimerId=0;
var NumExt=0;
var bTimerId=false;
var img=new Image();
//var TimerMsg1="\nYou have not used the site for a while. You can extend your connection for 6 more minutes.\n\n(For your security, your connection will close if there is no activity within one minute.)\n\nWould you like to extend your connection?\n"
//var TimerMsg2="\nYou have not used the site for a while.\n\nFor your security, your connection has been closed.\n"
//var TmrWarn=6;
//var nAllowed=5;
//var SignOffLink="";
//var KeepAliveLink="";
function TimeStamp()
{
var zDate = new Date;
var zTime = zDate.getTime();
return zTime.toString();
}
function clrScrTOwinp()
{
if (bTimerId) { clearTimeout(TimerId); bTimerId = false }
}
function setScrTO(minutes)
{
clrScrTOwinp();
NumExt  = 0;
TmrWarn = minutes;
Begin = new Date();
TimerId = setTimeout('getmoretime(TmrWarn)', (TmrWarn-1)*60*1000);
bTimerId = true
}
function TerminateTO(sMsg)
{
clrScrTOwinp()   
alert(sMsg);
SignOff = true; 
window.location = SignOffLink + "&_ts=" + TimeStamp();
}
function GetTimeDiff(begin)
{
var end = new Date();
return end.getTime() - begin.getTime();
}
function getmoretime(TmrWarn)
{
window.focus();
Begin = new Date();
NumExt++;
if (NumExt > nAllowed)
{
window.location = SignOffLink + "&_ts=" + TimeStamp();
TerminateTO(TimerMsg2)
return;
}
alert(TimerMsg1)
if (GetTimeDiff(Begin) < 55000)
{
img.src = KeepAliveLink + "?_ts=" + TimeStamp();
clrScrTOwinp()
TimerId = setTimeout('getmoretime(TmrWarn)', (TmrWarn-1)*60*1000);
bTimerId = true
Begin = new Date();
} 
else 
{
TerminateTO(TimerMsg2)
}
}
function doOnload()
{
hlMenu();
pageLoaded = true;
if(callJPSOnload)
JPSOnload();
if(callJBAOnload)
JBAOnload();
if(callJSOOnload)
JSOOnload();
loadCookie();
}

function doUnload()
{
closeOpenWins();
unloadCookie();
}

function Loadpage(path, productId, target, external,height,width)
{
        if ((path == "" ) || (productId == ""))
        {
                return alert ( "path and product id cannot be empty");
        }

        var prod_cat_Id = trim(productId);
        prod_cat_Id = prod_cat_Id.replace(/&/g,"");

/// Change done by
        var pattern1 = "?WOW_PROD_CAT=";
        var pattern2 = "&WOW_PROD_CAT=";
        var qryStrFlag;
        var realProdID;
        if(path.indexOf(pattern1) >0) {
                qryStrFlag = 'NEW';
        } else if (path.indexOf(pattern2) >0) {
                qryStrFlag = 'ADDED';
        }
        //alert(path);
        if(qryStrFlag == "NEW") {
                //alert(path.indexOf(pattern1));
                queryStr = path.substring(path.indexOf(pattern1));
                prodCat = queryStr.substring(pattern1.length);
                prod_cat_Id = trim(prodCat);
                realProdID =   trim(prodCat);
                prod_cat_Id = prod_cat_Id.replace(/&/g,"");
                path = path.replace(queryStr,"");
                //alert(queryStr);
        } else if (qryStrFlag == "ADDED") {
                //alert(path.indexOf(pattern2));
                queryStr = path.substring(path.indexOf(pattern2));
                prodCat = queryStr.substring(pattern2.length);
                prod_cat_Id = trim(prodCat);
                prod_cat_Id = prod_cat_Id.replace(/&/g,"");
                path = path.replace(queryStr,"");
                //alert(queryStr);
        }

/// Change End


        var url                 = "";

        var win_height  = height ;
        var win_width   = width;

        var isWebServerFile = false;
        var isExternalSite = false;

        if ((win_height == "") || (win_height== "null"))
        {
                height = "534";
        }

        if ((win_width == "") || (win_width =="null"))
        {
                width = "650";
        }

        /* Add by  , 2004-06-09, change for TW forms showing status bar
         * if the path include stringID=cititwmigrateform1, then set the tagert to 3
         * target = 3 is not a standard value, it is used only internally
         * target = 3 will make the popup windows have status bar only
         *
         * add footerCID parameter to change the footer sytle (the popup window footer)
         */

        if ((external == "N") || (external == "")|| (external == "null"))
        {
                /* comment by  , "null" will mapping to "home" in database
                if (prod_cat_Id == "null")
                {
                        prod_cat_Id="Home_gl";
                }
                */

                if(path.indexOf("http://") >= 0 || path.indexOf("https://") >= 0) {
                        isExternalSite = true;
                        url = path;
                }else if(path.indexOf("global_docs/") >= 0) {
                        isWebServerFile = true;
                        url = trim(path);
                }else if(path.indexOf("/portal/") >= 0) {
                        isWebServerFile = true;
                        url = trim(path);
                }else {
                        url="/TWGCB/APPS/portal/loadPage.do?path="+path;;
                }

                if ((target == "") || (target == "0") || (target == "null"))
{
if(isWebServerFile || isExternalSite) {
top.location.href = url;
return;
}
var prodAttr = "tabNo=" + getTabNumb(prod_cat_Id);
//top.location.href = "/portal/citiwm_home_center.jsp?"+prodAttr+ "&path=/mygcb/english/"+path+"&frameset=myCenterFrameset&frameval1=wowWorkID&framevar1=myWorkID";
top.location.href = "/TWGCB/APPS/portal/loadPage.do?"+prodAttr+ "&path="+path;
return ;
}
else if (target == "1")
{
parm = "left=95" + "," + "top=11" + "," + "width=" + width + "," + "height=" + height + "," +"location=no" + "," +"status=no" +"," +"toolbar=yes" + "," + "menubar=yes" + "," + "scrollbars=yes" + "," + "resizable=yes";
window.open(url,'', parm);
return ;
}
else if (target == "2")
{
var parm = "left=95" + "," + "width=" + width +"," + "height=" + height + "," + "scrollbars=yes" + "," + "resizable=yes";
if(isWebServerFile || isExternalSite) {
window.open(url,'', parm);
return ;
}
url="/TWGCB/APPS/portal/loadPopup.do?path="+path;
window.open(url,'', parm);
return;
}
}
else if (external == "Y")
{
confirnbox(path,target, height, width);
}
}




/**

 * This JSP is created by  . It has two functions which are used by IPTLightModule's dynamic link.

 * It is cloned from sgipb's loadPopup_new.js, with the modification on default value of tabNo based on the language and user type.

 *

 *

 * 1)  Functions = Createlink(obj)

 *

 *         params

 *         obj :- This would contain the comma seperated values to be passed to loadPopup function.

 *                        This function is called when there is a dropdown containing a list of landing pages. on cliking the go button

 *                        adjecent to the dropdown, this function will be called, which would intern parse the parameters and pass it to

 *                        loadPopup function.

 *

 * 2)  Functions = loadPopup(path, productId, target, external,height,width)

 *                          confirnbox(path)

 *

 *               params

 *

 *                path :- path of the landing page. This is a mandatory input

 *                productId :- This is mandatorr. Product id will be used to get the meniId and the brandmap

 *                target :- This is where the target page will open, it could be

 *                                      A) same work area (default if no value is passed, or value 0 is passed, or null passed)

 *                                      B) Pop up with browser controls (value 1 is passed)

 *                                      C) pop up without browser controls (value 2 is passed)

 *

 *              external :- Y if external site

 *                                      N if not external (default, if no value is passed or null passed)

 *              height  :- Height of the window, in case of popup. This is optional field, pass null if dont require to pass                            height.

 *              width   :- width of the window, in case of popup. This is optional field, pass null if dont require to pass height

 *

 */



function getTabNumb ( prodID) {

        //alert (prodID);

        var defProdIDVals = "null|home|CreditCards|SavingsInvestments|Loans|Insurance";

        var myTabNoArray = defProdIDVals.split('|');

        for (i=0;i < myTabNoArray.length; i++ ) {

                        if (myTabNoArray[i] == prodID){

                                //alert ( "tab number=" + myTabNoArray[i] );

                                //return myTabNoArray[i+1];

                                return i+1;

                        }

        }

        return 1 ;

}

function Createlink(obj)

{

        if ( (obj == "") || (obj == "null") ){return alert ('Feature not implemented');}

        top.location.href = obj;

}



function Createlink(obj)

{

        var myArray = obj.split(',');

        var size = myArray.length;



        if ( (obj == "") || (obj == "null") || (size < 6) )

        {

                return alert ("insufficient parameter");

        }



        var path                =       myArray[0];

        var productId   =       myArray[1];

        var target              =       myArray[2];

        var external    =       myArray[3];

        var height              =       myArray[4];

        var width               =       myArray[5];



        Loadpage(path, productId, target, external,height,width);

}

