window.dgebi = document.getElementById; window.sutime = 1532319568; window.agtime = 2592000; window.lptime = sutime-agtime; window.sfile = '/survey/actions/survey_actions_test.php'; function ReadCookie(cookieName) { var theCookie=""+document.cookie; var ind=theCookie.indexOf(cookieName); if (ind==-1 || cookieName=="") return ""; var ind1=theCookie.indexOf(';',ind); if (ind1==-1) ind1=theCookie.length; return unescape(theCookie.substring(ind+cookieName.length+1,ind1)); } function SetCookie(cookieName,cookieValue,nDays) { var today = new Date(); var expire = new Date(); if (nDays==null || nDays==0) nDays=1; expire.setTime(today.getTime() + 3600000*24*nDays); document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString(); } function DeleteCookie(cookieName,cookieValue,nDays) { var today = new Date(); var expire = new Date(); if (nDays==null || nDays==0) nDays=1; expire.setTime(today.getTime() - 3600000*24*nDays); document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString(); } function jc_surveyRequest(url,callback,postData,obj,setcookie) { if (navigator.userAgent.indexOf("Firefox")!=-1){ var tester = 1; } if (navigator.userAgent.indexOf("Safari")!=-1){ var tester = 1; } if (navigator.userAgent.indexOf("Netscape")!=-1){ var tester = 1; } if (window.XMLHttpRequest) { var req = new XMLHttpRequest(); } else if (window.ActiveXObject) { var req = jccreateXMLHTTPObj(); } if (!req){ return; } var method = (postData) ? "POST" : "GET"; req.open(method,url,true); req.setRequestHeader('User-Agent','XMLHTTP/1.0'); if (postData){ req.setRequestHeader('Content-type','application/x-www-form-urlencoded'); } req.onreadystatechange = function () { if (req.readyState != 4) return; if (req.status != 200 && req.status != 304) { alert('HTTP error ' + req.status); return; } if(setcookie==1 && !(req.responseText.match("error") || req.responseText.match("message"))){ if(stage_name.length>=5){ DeleteCookie("JesusUnderstanding","a",1000); } SetCookie("JesusUnderstanding",req.responseText,1000); } callback(req,obj); } if (req.readyState == 4) return; req.send(postData); } var jcXMLHttpFactories = [ function () {return new XMLHttpRequest()}, function () {return new ActiveXObject("Msxml2.XMLHTTP")}, function () {return new ActiveXObject("Msxml3.XMLHTTP")}, function () {return new ActiveXObject("Microsoft.XMLHTTP")} ]; function jccreateXMLHTTPObj() { var xmlhttp = false; for (var i=0;i=5){ var today = new Date(); var data = ReadCookie('JesusUnderstanding'); var parts = data.split('@'); window.stage_name = parts[0]; window.stage = parts[1]; window.stage_date = parts[2]; var tnow = today.getTime(); tnow = tnow/1000; if(stage_date <= lptime){ postData = "update=1&stage_name="+stage_name+"&stage=0&stage_date="+tnow+"&tnow=true"; window.alarmclock = 1; }else{ postData = "update=1&stage_name="+stage_name+"&stage="+stage+"&stage_date="+stage_date; window.alarmclock = ''; } jc_surveyRequest(sfile,jcSurveyProcessCB,postData,'',1) }else{ window.stage_name = ''; window.stage = ''; window.stage_date = ''; window.alarmclock = ''; } function jcSurveyProcessCB(rep,obj){ if(obj){ checkTheBox(obj); } } if(alarmclock){ var postData = "resetdate=1"; jc_surveyRequest(sfile,jcSurveyProcessCB,postData,'',1); }