function popupApp(hst) { window.open(hst,'ICARD','toolbar=no,width=780,height=550,scrollbars=yes,location=yes,status=yes,resizable=yes'); } function applyOnlineTM(strP,strI,strS) { if (intronum=validAgentCode()) { var hst = "https://www.citibank.com.au/AUGCB/ICARD/apps/internet_telephone_application/apply_now.do?S="+ strS+"&P="+strP+"&T=TAG01&A="+intronum; hst = parseOrg(hst); popupApp(hst); } } function applyOnlineTM2(strP,strS,strO) { if (intronum=validAgentCode()) { //var hst = "http://uat.onlinebanking.citibank.com.au/global_docs/vero.htm?P=768&S=8B6YYHK1&O=111&A=0271234"; var hst = "http://uat.onlinebanking.citibank.com.au/global_docs/vero.htm?P="+strP+"&S="+strS+"&T=TAG01&A="+intronum; //hst = parseOrg(hst); popupApp(hst); } } function applyOnlineTM1(strP,strI,strS) { var hst = "https://www.citibank.com.au/AUGCB/ICARD/apps/internet_telephone_application/apply_now.do?S="+ strS+"&P="+strP; hst = parseOrg(hst); popupApp(hst); } function linkTM(url) { if (intronum=validAgentCode()) { location.href = "" + url + "?" + intronum; } } function prefill() { var urlArray = location.href.split('?'); if (urlArray.length == 2) { document.agentForm.agentid.value = urlArray[1]; } } function applyOnlineCITM(strP,strI,strS,strE) { if (intronum=validAgentCode()) { var hst = "https://www.citibank.com.au/AUGCB/ICARD/apps/internet_telephone_application/apply_now.do?S="+ strS+"&P="+strP+"&E="+strE+"&T=TAG01&A="+intronum; hst = parseOrg(hst); popupApp(hst); } } function validAgentCode(intronum) { var intronum = document.agentForm.agentid.value; if (intronum == '' || intronum > 99999999 || intronum < 0) { alert("Please check the introducer number you have entered"); document.agentForm.agentid.focus(); return 0; } else { return intronum; } } function linkBPTM(code) { if (intronum=validAgentCode()) { location.href = "/cardsoffer/offers/BP_SelectTM.htm?Code="+code+"&Agent="+intronum; } } function linkBP(code) { location.href = "/cardsoffer/offers/BP_SelectBPTM.htm?Code="+code; } function linkBPTM1(code) { if (intronum=validAgentCode()) { location.href = "/cardsoffer/offers/BP_select2.htm?Code="+code+"&Agent="+intronum; } } function parseOrg(urlString) { var sc = getParameterString(urlString, 'S'); var scType = sc.charAt(0); if (scType == '6') { //PIL urlString += '&O=650'; } else if (scType == 'V' || scType == 'R' || scType == 'A' || scType == 'Q') { //PC, RC, DCCL, QFF urlString += '&O=222'; } else { //Cards urlString += '&O=111'; } return urlString; } function getParameterString(urlString, parmeter) { var sli="" var index = urlString.indexOf(parmeter); if(index!=-1) { var str1 = urlString.substring(index); var index1 = str1.indexOf("&"); if (index1 == -1){ var index = str1.indexOf("="); var sli = str1.slice(index+1); } else { var index = str1.indexOf("="); var sli = str1.slice(index+1,index1); } } return sli; }