//tb = 64 //timeout_array[2] = window.setTimeout("reload_page()",); var optinform_1 = document.getElementById("optinform_1"); var mobile_1 = document.getElementById("mobiledisplay_1"); var temp_value_1; var error_flag_1 = false; var errortimeout_1; function checkform_1(){ if (mobile_1.value.length < 10){display_error_1("10-digit number");return false;} if ((/^[2-9]\d{2}[2-9]\d{6}$/.test(mobile_1.value)&!/^555/.test(mobile_1.value)&!/^\d{3}555/.test(mobile_1.value)) != 1){display_error_1("Invalid Phone #");return false;} return true; } function addCode_1(key){ if (show_Menu_Last_Time > (new Date()).getTime()){return;} display_error_done_1(); if(mobile_1.value.length > 3){mphone_1(mobile_1);} if(mobile_1.value.length < 10){mobile_1.value = mobile_1.value + key;} window.clearTimeout(timeout_array[2]); timeout_array[2] = window.setTimeout("reload_page()",10000); key_pressed_flag = true; } function key_pressed_1(){ display_error_done_1(); window.clearTimeout(timeout_array[2]); timeout_array[2] = window.setTimeout("reload_page()",10000); key_pressed_flag = true; } function clear_mobile_1(){ mobile_1.value = ""; temp_value_1 = ""; error_flag_1 = false; fix_width_mob(1); } function deleteCode_1(all_flag){ if (all_flag==true){ mobile_1.value = ""; }else{ if(mobile_1.value.length > 0){mobile_1.value = mobile_1.value.substr(0,mobile_1.value.length-1);} } display_error_done_1(); window.clearTimeout(timeout_array[2]); timeout_array[2] = window.setTimeout("reload_page()",10000); key_pressed_flag = true; } function display_error_1(message) { //mobile_1.readOnly = true; temp_value_1 = mobile_1.value; mobile_1.value = message; error_flag_1 = true; errortimeout_1 = window.setTimeout("display_error_done_1()",2000); } function display_error_done_1() { if (error_flag_1 == true) { error_flag_1 = false; mobile_1.value = temp_value_1; window.clearTimeout(errortimeout_1); } //mobile_1.readOnly = false; } function submitform_1(){ if (error_flag_1 == true){return;} window.clearTimeout(timeout_array[2]); window.clearTimeout(timeout_array[3]); if (!checkform_1()) { timeout_array[2] = window.setTimeout("reload_page()",10000); } else { display_loader(); paddy_submit2(optinform_1); } } function mphone_1(that){ var x = that.value.match(/\d/ig),y; x = (x == null?'':x.join('')); if (that.value != x){that.value = x;} //var y; for(var z=that.value.length;z>0;z--){y=that.value.charCodeAt(0);if(y==48||y==49){that.value=that.value.substr(1);}else{z=0;}} if (that.value.length>10){that.value=that.value.substr(0,10);} } function debug(db_data){document.getElementById("paddy_progress").innerHTML += db_data.replace(/[<]/g,"<").replace(/[>]/g,">") + "
";} var alert_count = 0; function optin_init_1(){ var stage = ""; if ((window.Touch||window.TouchEvent)&&(navigator.userAgent.indexOf("Mobile")>=0||navigator.userAgent.indexOf("Android")>=0)){ try{ var btn, codex = "";; for(var in_x=0;in_x<=9;in_x++){ stage = "num_num_1_" + in_x; btn = document.getElementById("num_num_1_" + in_x); btn.addEventListener("touchstart",function(){addCode_1(this.id.substr(this.id.length-1));}, true); //btn.removeEventListener("mousedown",addCode_1('' + in_x + ''), false); btn.onmousedown = null; } stage = "deleteCode_1_btn"; btn = document.getElementById("deleteCode_1_btn"); btn.addEventListener("touchstart",function(){deleteCode_1();}, true); btn.onmousedown = null; stage = "coupon_clear_singlekey"; btn = document.getElementById("coupon_clear_singlekey"); btn.addEventListener("touchstart",function(){deleteCode_1(true);}, true); btn.onmousedown = null; stage = "coupon_enter_singlekey"; btn = document.getElementById("coupon_enter_singlekey"); btn.addEventListener("touchstart",function(){submitform_1();}, true); btn.onmousedown = null; stage = "opt_btn_1"; btn = document.getElementById("opt_btn_1"); if (btn!=null){ btn.addEventListener("touchstart",function(){show_menu(0);}, true); btn.onmousedown = null; } stage = "window"; window.addEventListener("scroll",function(){if (window.scrollY>0||window.scrollX>0){window.scroll(0,0);}}, true); }catch(e){ } } } optin_init_1();