function clear2010GPSNEWSFORM(a){a.txtsubject.value="";a.txtauthors.value="";a.txtdatepub.value="";a.txttimepub.value="";a.txtTeeser.value="";a.txtUrllink.value=""}function refreshFrame(a){parent.document.getElementById(a).src=parent.document.getElementById(a).src}function showLoadingMessage(a,b){b.innerHTML="<center><p>"+a+"</p><br><img src='images2010/ajax-loader.gif' alt='Loading.....'></center>"}function getXMLHttpObject(){var a=null;try{a=new XMLHttpRequest}catch(b){try{a=ActiveXObject("Msxml2.XMLHTTP")}catch(b){a=ActiveXObject("Microsoft.XMLHTTP")}}return a}function getDivTarget(){return divTarget}function setDivTarget(a){divTarget=a}function updateParent(a,b){$.get(a,function(a){$("#"+b,parent.document).html(a);setDivTarget(b)})}function showPage(a,b){$("#"+b,parent.document).html("<img src=images2010/balls64.gif>");$.get(a,function(a){$("#"+b,parent.document).html(a);xmlElement=b;if(b=="xOnlines"){if($("#"+b,parent.document).height!=260){$("#"+b,parent.document).height=260}}})}function runPage(a){$.get(a)}function runQuick(a){$.get(a)}function quickSaveAccess(a,b,c){var d="update TRACKUSERS set "+a+" = "+b+" where recordID = "+c;runQuick("2010runQuick.ASP?command="+d)}function setDelay(a){for(var b=1;b<=a;b++){}}function deleteGPS(a,b,c){if(confirm("ARE YOU SURE THAT YOU WANT TO DELETE THIS RECORD?")==false)return;var d="2010GPSNewsEntry.asp?recordID="+b+"&displayNo="+c;$.get(d,function(b){xmlElement=a;$("#"+xmlElement).html("<p>DELETING...</p><br><img src='images2010/ajax-loader.gif' src='LOADING......'>");$("#"+xmlElement).html(b);setDelay(30);showPage("2010Webmasters.asp?displayNo=4","xContents")})}function saveGPS(a,b,c,d){myForm=document.forms[a];if(myForm.txtsubject.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER A HEADLINES</font></p>";myForm.txtsubject.focus();myForm.txtsubject.select;return false}if(myForm.txtdatepub.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER A DATE PUBLISHED</font></p>";myForm.txtdatepub.focus();myForm.txtdatepub.select;return false}if(myForm.txtTeeser.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER THE TEESER</font></p>";myForm.txtTeeser.focus();myForm.txtTeeser.select;return false}if(myForm.txtUrllink.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER THE URL</font></p>";myForm.txtUrllink.focus();myForm.txtUrllink.select;return false}if(confirm("ARE YOU SURE THAT YOU WANT TO SAVE THIS RECORD?")==false)return;var e="2010GPSNewsEntry.asp?recordID="+c+"&displayNo="+d;e+="&xsubject="+encodeURIComponent(myForm.txtsubject.value)+"&xauthors="+encodeURIComponent(myForm.txtauthors.value)+"&xdatepub="+encodeURIComponent(myForm.txtdatepub.value)+"&xtimepub="+myForm.txttimepub.value+"&xTeeser="+encodeURIComponent(myForm.txtTeeser.value)+"&xUrllink="+encodeURIComponent(myForm.txtUrllink.value);$.get(e,function(a){xmlElement=b;$("#"+xmlElement).html("<p>SAVING...</p><br><img src='images2010/ajax-loader.gif' src='LOADING......'>");$("#"+xmlElement).html(a);setDelay(30);updateParent("2010Webmasters.asp?displayNo=4","xContents")})}function deleteFAQ(a,b,c){if(confirm("ARE YOU SURE THAT YOU WANT TO DELETE THIS RECORD?")==false)return;var d="2010FAQ.asp?recordID="+b+"&displayNo="+c;$.get(d,function(b){xmlElement=a;$("#"+xmlElement).html("<p>DELETING...</p><br><img src='images2010/ajax-loader.gif' src='LOADING......'>");$("#"+xmlElement).html(b);setDelay(30);showPage("2010Webmasters.asp?displayNo=3","xContents")})}function saveFAQ(a,b,c,d){myForm=document.forms[a];if(myForm.txtcategory.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER A CATEGORY</font></p>";myForm.txtcategory.focus();myForm.txtcategory.select;return}if(myForm.txtQuestion.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER A QUESTON</font></p>";myForm.txtQuestion.focus();myForm.txtQuestion.select;return}if(myForm.txtAnswer.value==""){document.getElementById("validationForm"+c).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>PLEASE ENTER A ANSWER</font></p>";myForm.txtAnswer.focus();myForm.txtAnswer.select;return}if(confirm("ARE YOU SURE THAT YOU WANT TO SAVE THIS RECORD?")==false)return;var e="2010FAQ.asp?recordID="+c+"&displayNo="+d;e+="&category="+encodeURIComponent(myForm.txtcategory.value)+"&question="+encodeURIComponent(myForm.txtQuestion.value)+"&answer="+encodeURIComponent(myForm.txtAnswer.value);$.get(e,function(a){xmlElement=divElement;$("#"+xmlElement).html("<p>SAVING...</p><br><img src='images2010/ajax-loader.gif' src='LOADING......'>");$("#"+xmlElement).html(a);setDelay(20);updateParent("2010Webmasters.asp?displayNo=3","xContents")})}function saveRoverInfo(a){var b=document.forms[a].clientCode.value;var c=document.forms[a].divisionCode.value;var d=document.forms[a].terminalCode.value;var e=document.forms[a].plateNo.value;var f=document.forms[a].bodyNo.value;var g=document.forms[a].makeModel.value;var h=document.forms[a].mobileNo.value;var i=document.forms[a].roverID.value;var j=document.forms[a].recordID.value;var k=document.forms[a].GSM1.value;var l=document.forms[a].GSM2.value;var m=document.forms[a].GSM3.value;var n=document.forms[a].GSM4.value;var o=document.forms[a].roverType.value;var p=document.forms[a].dateInstalled.value;var q=document.forms[a].expirationDate.value;var r=document.forms[a].underRepair.value;var s=document.forms[a].speedometer.value;var t=document.forms[a].fuelCon.value;var u=document.forms[a].hot.value;var v=document.forms[a].Route.value;var w=document.forms[a].intervalReporting.value;showPage("2010SaveRoverInfo.ASP?dateInstalled="+p+"&hot="+u+"&fuelCon="+t+"&speedometer="+s+"&underRepair="+r+"&expirationDate="+q+"&roverType="+o+"&GSM1="+k+"&GSM2="+l+"&GSM3="+m+"&GSM4="+n+"&roverID="+i+"&recordID="+j+"&clientCode="+b+"&divisionCode="+c+"&TerminalCode="+d+"&plateNo="+e+"&bodyno="+f+"&makeModel="+g+"&mobileNo="+h+"&Route="+v+"&intervalreporting="+w,j)}function textLimit(a,b){if(a.value.length>b+1)if(a.value.length>b)a.value=a.value.substring(0,b)}function saveProfile(a){var b=document.forms[a].firstName.value;var c=document.forms[a].lastName.value;var d=document.forms[a].password.value;var e=document.forms[a].password1.value;var f=document.forms[a].password2.value;var g=document.forms[a].mobileNo.value;var h=document.forms[a].recordID.value;if(e!==f){alert("Passwords did not match. Please check your entry!");return}showPage("2010SaveProfile.ASP?recordID="+h+"&firstName="+b+"&lastName="+c+"&password1="+e+"&password2="+f+"&mobileNo="+g+"&password="+d,"divMyProfile")}function checkOptionBox(a){var b=document.forms["frmRovers"];var c;var d=b.optRoverId;if(d[0].checked==true){c=true}else{c=false}for(var e=1;e<b.optRoverId.length;e++){d[e].checked=c}}function isValidEMail(a){var b="@";var c=".";var d=a.indexOf(b);var e=a.length;var f=a.indexOf(c);if(a.indexOf(b)==-1){return false}if(a.indexOf(b)==-1||a.indexOf(b)==0||a.indexOf(b)==e){return false}if(a.indexOf(c)==-1||a.indexOf(c)==0||a.indexOf(c)==e){return false}if(a.indexOf(b,d+1)!=-1){return false}if(a.substring(d-1,d)==c||a.substring(d+1,d+2)==c){return false}if(a.indexOf(c,d+2)==-1){return false}if(a.indexOf(" ")!=-1){return false}return true}function saveUserProfile(a,b,c,d){myForm=document.forms[d];Client=myForm.clientCode.value;division=myForm.divisionCode.value;terminal=myForm.terminalCode.value;Client=myForm.clientCode.value;firstName=myForm.firstName.value;lastName=myForm.lastName.value;email=myForm.eMail.value;pass=myForm.password1.value;mobile=myForm.mobileNo.value;expiration=myForm.expiration.value;if(Client==""){document.getElementById("validationForm"+a).innerHTML="<p><font size='2' style='font-weight:bold'>*</font><font size='2' color='#FF0000' style='font-weight:bold'>Please enter a clientCode</font></p>";myForm.clientCode.focus();myForm.clientCode.select();return}else{if(email!=""){if(isValidEMail(email)==false){document.getElementById("validationForm"+a).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>Invalid E-mail ID</font></p>";myForm.eMail.focus();myForm.eMail.select();return}}if(pass!=""){if(pass.length<6){document.getElementById("validationForm"+a).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>Please enter a password atleast 6 character or more</font></p>";myForm.password1.focus();myForm.password1.select();return}}if(mobile!=""){if(mobile.length<11){document.getElementById("validationForm"+a).innerHTML="<p><font size='2' style='font-weight:bold'>*</font> <font size='2' color='#FF0000' style='font-weight:bold'>Please enter a mobile number atleast 11 character</font></p>";myForm.mobileNo.focus();myForm.mobileNo.select();return}}updateParent("2010EditUserProfile.asp?terminalCode="+terminal+"&divisionCode="+division+"&method=1&recordID="+a+"&initials="+b+"&divElement="+c+"&clientCode="+Client+"&firstName="+firstName+"&lastName="+lastName+"&password="+pass+"&expiration="+expiration+"&mobileNo="+mobile+"&email="+email,c)}}function rollBG(a){if(document.images!=null){a.style.backgroundImage="url('images2010/BGRoll.gif')"}}function unrollBG(a){if(document.images!=null){a.style.backgroundImage="none"}}function setDefaults(a){var b=document.forms[a];b.access_01.value=1;b.access_08.value=1;b.access_09.value=1;b.access_10.value=1}function jchange(a){var b=new Array;b[0]="/images2010/openarrow.gif";b[1]="/images2010/closedarrow.gif";if(document.getElementById(a).style.display=="none"){document.getElementById(a).style.display="block";if(document.getElementById("nfolding")){document.getElementById("nfolding").src=b[0]}}else{document.getElementById(a).style.display="none";if(document.getElementById("nfolding")){document.getElementById("nfolding").src=b[1]}}}function newWin(a,b,c,d){var e=(screen.width-c)/2;var f=(screen.height-d)/2;winprops="height="+d+",width="+c+",top="+f+",left="+e+",directories=no,menubar=no,location=no,scrollbars=no,resizable=no";win=window.open(a,b,winprops);if(parseInt(navigator.appVersion)>=4){win.window.focus()}}function imposeMaxLength(a,b){return a.value.length<=b}var xmlhttp;var divTarget;
