|
|||
|
"); source = search.substring(begin+8,end); eval(source); search = search.substring(end+9); } tabContent=content; } var divId; var timerFlag = 10; function yahooConnect(url,id) { divId=id; var formid=document.getElementById('user_registration'); YUC.setForm(formid); YUC.asyncRequest('POST', url, result,formid); } var result = { success: function(cObj) { // setInnerHtml(divId,cObj.responseText); document.getElementById(divId).innerHTML = cObj.responseText; } } // Global var regcount is used to disable multiple submits var regcount = 0; function registerUser(){ regcount++; if (1==regcount){ document.getElementById('captcha').value=grecaptcha.getResponse(); document.getElementById('register').disabled=true; pushToGoogleTM(); document.getElementById('user_registration').action='/Tawuniya/public/registrationSaveAction.action;jsessionid=Y6VNHWwe7TdoClfZjDB6fpPL.node5'; document.getElementById('user_registration').submit(); } } function SmsVerifyCode() { document.getElementById('user_registration').action='/Tawuniya/public/regSmsChkSaveAction.action;jsessionid=Y6VNHWwe7TdoClfZjDB6fpPL.node5'; document.getElementById('user_registration').submit(); } function checkUserExists(username){ if(trimAll(username)!=''){ var url='../portal/registrationCheckUserNameAction.action'; yahooConnect(url,'usernamediv'); }else{ document.getElementById('usernamediv').innerHTML =''; } } function trimAll(sString) { while (sString.substring(0,1) == ' ') { sString = sString.substring(1, sString.length); } while (sString.substring(sString.length-1, sString.length) == ' ') { sString = sString.substring(0,sString.length-1); } return sString; } function doSigIn() { window.location.href = "/Tawuniya/portal/home.action?langId=1"; //document.getElementById('test').href='/Tawuniya/portal/home.action'; //document.security_frm.action="/Tawuniya/portal/home.action"; //document.security_frm.submit(); } function forgotPassword() { document.user_registration.action="../public/forgotpwsAction.action"; document.user_registration.submit(); } function helpwithReg() { url="../public/helpwithReg.action"; LeftPosition = (screen.width) ? (screen.width-400)/2 : 0; TopPosition = (screen.height) ? (screen.height-350)/2 : 0; settings='toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=400,left ='+ LeftPosition +' ,top = '+TopPosition ; window.open(url,'Online_Registration',settings); } function secureNprivacy() { url="../public/secureNprivacy.action"; settings='toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=0,width=920,height=380'; OpenPopupWindow = window.open(url,'Online_Registration',settings); } function clearfeilds() { document.getElementById('iqama').value=''; document.getElementById('policy').value=''; //document.getElementById('premium').value=''; //document.getElementById('birthyear').value=''; // document.getElementById('medcard').value=''; //document.getElementById('expirayDate').value=''; document.getElementById('username').value=''; //document.getElementById('reusername').value=''; //document.getElementById('lang').value='1'; //document.getElementById('means').value='E'; document.getElementById('mobile').value='966'; document.getElementById('reemail').value=''; document.getElementById('email').value=''; grecaptcha.reset(); } function displayFields() { document.getElementById("crn").style.display='none'; document.getElementById("idno").style.display=''; document.getElementById("active_pol_tr").style.display=''; document.getElementById("premium_tr").style.display='none'; document.getElementById("medicalholderlbl_tr").style.display=''; document.getElementById("birth_year_tr").style.display=''; document.getElementById("med_card_tr").style.display=''; document.getElementById("exp_date_tr").style.display=''; //DPC_autoInit(); } function onRadioChange() { clearfeilds(); displayFields() } function DisableRightClick(event) { //For mouse right click ## 20/06/2010 if (event.button==2) { alert('Please do not copy/paste in Re-enter E-mail address field.'); } } function DisableCtrlKey(e) { var code = (document.all) ? event.keyCode:e.which; var ctrl = (document.all) ? event.ctrlKey:e.modifiers & Event.CONTROL_MASK; // look for CTRL key press ## 20/06/2010 if (ctrl && code==86) { window.event.returnValue = false; } } function validateNumber(elementId){ var text = document.getElementById(elementId).value; var ValidChars = "0123456789"; var returnString = ""; var Char; var check = "0"; for (i = 0; i < text.length ; i++) { Char = text.charAt(i) ; if (ValidChars.indexOf(Char) != -1){ if(check == "0" || Char != "."){ returnString += Char; if(Char == "."){ check = "1"; } } } } document.getElementById(elementId).value = returnString; //appendAddress(); } function showhint1(menucontents, obj, e, tipwidth,menuArabiccontents){ var lang=1; lang=1; if ((ie||ns6) && document.getElementById("hintbox")){ dropmenuobj=document.getElementById("hintbox") if(lang==1){ dropmenuobj.innerHTML=menucontents } else{ dropmenuobj.innerHTML=menuArabiccontents } dropmenuobj.style.left=dropmenuobj.style.top=-500 if (tipwidth!=""){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=tipwidth } dropmenuobj.x=getposOffset(obj, "right") dropmenuobj.y=getposOffset(obj, "top") dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px" dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px" dropmenuobj.style.visibility="visible" obj.onmouseout=hidetip } } function pushToGoogleTM() { var email = document.getElementById("email").value; var idno =document.getElementById("iqama").value; var policy = document.getElementById("policy").value; window.dataLayer.push({'event': 'updated value','name':'CustomerPortal','id':'Portal_Registraion','category':'CustomerPortal','email':email,'idNumber':idno,'policy':policy}); }
|