function getTabNumb(prodID) { var defProdIDVals = "null|HOME|CREDITCARDS|LOANS|DEPOSITS|INVESTMENTS|INSURANCE|FINANCIALMANAGEMENT|ISLAMICBANKING"; var myTabNoArray = defProdIDVals.split('|'); for (i=0; i0) qryStrFlag = 'NEW'; else if (path.indexOf(pattern2) >0) qryStrFlag = 'ADDED'; switch (qryStrFlag) { case "NEW": 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,""); break; case "ADDED": 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,""); break; } var url = ""; var win_height = height; var win_width = width; var isWebServerFile = false; var isExternalSite = false; var isBMPage = false; if ((win_height == "") || (win_height== "null")) height = "534"; if ((win_width == "") || (win_width =="null")) width = "650"; if (path.indexOf("/global_docs/citibank_bahasa/") >= 0) { isBMPage = true; toBahasaLink(path, target, height, width) } switch (external) { case "N": case "": case "null": if (path.indexOf("http://") >= 0 || path.indexOf("https://") >= 0) { isExternalSite = true; url = path; } else if (path.indexOf("/") < 0) { isWebServerFile = true; url = trim(path); } else if (path.indexOf("/portal/") >= 0) { isWebServerFile = true; url = trim(path); } else { url = "http://www.citibank.com.my/APPS/portal/genericLoadPage.do?htmlPageName="+path;; } switch (target) { case "": case "0": case "null": top.location.href = url; return; break; case "1": parm = "left=95,top=11,width=" + width + ",height=" + height + ",location=no,status=no,toolbar=yes,menubar=yes,"; parm += "scrollbars=yes,resizable=yes"; window.open(url,'', parm); return; break; case "2": var parm = "left=95,width=" + width +",height=" + height + ",scrollbars=yes,resizable=yes"; if (url.indexOf("/popup/") >= 0) url="http://www.citibank.com.my/APPS/portal/loadPopup.do?htmlPageName="+path; window.open(url,'', parm); return ; break; case "3": var parm = "left=95,width=" + width + ",height=" + height + ",location=yes,status=no,toolbar=no,menubar=no,"; parm += "scrollbars=yes,resizable=yes"; if (url.indexOf("/popup/") >= 0) url="http://www.citibank.com.my/APPS/portal/loadPopup.do?htmlPageName="+path; window.open(url,'', parm); return ; break; case "4": var parm = "left=95,width=" + width + ",height=" + height + ",location=yes,status=no,toolbar=no,menubar=no,"; parm += "scrollbars=yes,resizable=yes,location=yes"; if (url.indexOf("/popup/") >= 0) url="http://www.citibank.com.my/APPS/portal/loadPopup.do?htmlPageName="+path; window.open(url,'', parm); return; break; } break; case "Y": showConfirm(path, target, height, width); break; } } //Function Added to open the Bahasa link in the same window function toBahasaLink(path,target, height, width) { if (target == "6") window.location=path; else return; } function showConfirm(path,target, height, width) { var name = confirm("You are now leaving the Citibank Malaysia website and entering a third party website. \n Any information you may provide on the third party website shall be subject to the confidentiality and security terms of such website and not the privacy policies of Citibank Malaysia, and Citibank Malaysia shall not bear any responsibility for any unauthorised disclosure or breach of confidentiality in relation to such information provided. \n Furthermore any link to a third party website contained herein does not constitute an endorsement by Citibank Malaysia of such third party, their website or their products and/or services, and Citibank Malaysia also makes no warranties as to the content of such website.\n Would you like to continue?") if (name == true) { if (target == "1") { parm = "left=95,top=11,width=" + width + ",height=" + height + ",location=no,status=no,toolbar=no,menubar=yes,"; parm += "scrollbars=yes,resizable=yes"; window.open(path,'NewWinDow', parm); return ; } else if(target == "2") { var parm = "left=95,width=" + width +",height=" + height + ",scrollbars=yes,resizable=yes"; window.open(path,'NewWinDow', parm); return; } else { window.location=path; } } else { return; } } function trim(inputString) { var newInputString = replace(inputString,'%20',' '); if (typeof newInputString != "string") return newInputString; var retValue = newInputString; var ch = retValue.substring(0, 1); while (ch == " ") { retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length-1, retValue.length); while (ch == " ") { retValue = retValue.substring(0, retValue.length-1); ch = retValue.substring(retValue.length-1, retValue.length); } while (retValue.indexOf(" ") != -1) retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); return retValue; } function replace(string, text, by) { var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } function popwin(targetUrl,winTitel){ window.open(targetUrl,winTitel, 'top=60,left=75,toolbar=no,Location=0,directories=no,status=no,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=675,height=460'); } function popbigwin(targetUrl,winTitel){ window.open(targetUrl,winTitel, 'top=60,left=75,toolbar=no,Location=0,directories=no,status=no,menubar=0,scrollbars=no,resizable=yes,copyhistory=0,width=800,height=600'); }