function makeHttpRequest(d,g,c,f,h,e,b){var a=false;if(d==undefined||d==null||d==""){d="GET"}if(g==undefined||g==null||g==""){g="application/x-www-form-urlencoded"}if(f==undefined||f==null){f=""}if(e==undefined||e==null){e=true}a=createHttpRequestObject(h);if(!a){return false}window.document.body.style.cursor="wait";a.onreadystatechange=function(){alertContents(a,h,b)};a.open(d,c,true);if(d=="POST"){a.setRequestHeader("Content-type",g)}if(f!=undefined&&f!=null&&f!=""){a.setRequestHeader("Content-length",f.length)}a.setRequestHeader("Connection","close");a.send(f);return a}function createHttpRequestObject(c){var a=false;if(c==undefined||c==null||c==""){c="text/html"}if(window.XMLHttpRequest){a=new XMLHttpRequest();if(a.overrideMimeType){a.overrideMimeType(c)}}else{if(window.ActiveXObject){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser does not support AJAX. Download the Firefox browser for maximum compatibility."+b);return false}}}}return a}function alertContents(b,d,a){try{if(b.readyState==4){if(b.status==200){if((!a)||a==undefined||a==null){}else{if(d=="text/xml"){a(b.responseXML)}else{a(b.responseText)}}window.document.body.style.cursor="default"}else{window.document.body.style.cursor="default"}}}catch(c){window.document.body.style.cursor="default"}}function makeAjaxGetRequest(b,a){return makeHttpRequest("GET",undefined,b,undefined,"text/html",true,a)}function isValid(d,c){var b=document.getElementById(d),a=document.getElementById(c);if(b.value==null||b.value==""){a.innerHTML="Please enter your email address.";a.className="error";b.focus();b.className="error";return false}else{if(!echeck(b.value,a)){a.className="error";a.innerHTML="Invalid E-mail address";b.focus();b.className="error";return false}else{b.className="";a.className="hidden"}}return true}function echeck(f,c){var a="@",b=".",e=f.indexOf(a),d=f.length;if(f.indexOf(a)==-1){return false}if(f.indexOf(a)==-1||f.indexOf(a)==0||f.indexOf(a)==d){return false}if(f.indexOf(b)==-1||f.indexOf(b)==0||f.indexOf(b)==d){return false}if(f.indexOf(a,(e+1))!=-1){return false}if(f.substring(e-1,e)==b||f.substring(e+1,e+2)==b){return false}if(f.indexOf(b,(e+2))==-1){return false}if(f.indexOf(" ")!=-1){return false}return true}function processAjaxResponse(a){if(a==1){alert("Your vote will only be counted once.")}else{if(a==0){alert("Your web browser must accept cookies for your vote to be counted.")}else{document.getElementById("poll").innerHTML="<legend>Monthly poll</legend>"+a}}}function processAjaxResponseSubscribe(a){var b=document.getElementById("error");if(a==1){b.innerHTML="Subscribed successully.";b.className="msg"}else{if(a==2){b.innerHTML="Already subscribed.";b.className="msg"}else{if(a==0){b.innerHTML="Subscription failed. (Invalid email address)";b.className="error"}}}};