var xmlhttp_polling = false; try {xmlhttp_polling = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp_polling = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp_polling = false; } } if (!xmlhttp_polling && typeof XMLHttpRequest != 'undefined') { xmlhttp_polling = new XMLHttpRequest(); } function getE(elem){ return document.getElementById(elem); } function ckPolling(thisform){ var is_checked=-1; var rd_value=0; var str; for(i=thisform.rdPolling.length-1;i>-1;i--){ if(thisform.rdPolling[i].checked){is_checked =i;rd_value=thisform.rdPolling[i].value;i=-1;} } if (is_checked<0){ alert("Pilih salah satu jawaban jajak pendapat.");return false; } if(Get_Cookie("ecea09abcbf4c7e0b48d186f075f1115_[polling]")!=null){ alert("Maaf, anda hanya dapat mengikuti satu jajak pendapat saja setiap harinya"); return false; } else { Set_Cookie("ecea09abcbf4c7e0b48d186f075f1115_[polling]","1","1","/","",""); } url='http://srandal.com/do-polling/send-polling.html'; xmlhttp_polling.open('POST',url, true); xmlhttp_polling.onreadystatechange = function() { if ( xmlhttp_polling.readyState == 4 && xmlhttp_polling.status == 200 ) { if(xmlhttp_polling.responseText==-1){str="Jajak pendapat yang anda maksud tidak ditemukan.";}else{str="Terima kasih telah mengikuti jajak pendapat kami.";} getE("ckSubmitPolling").disabled=false; getE("FloatMenu").style.visibility="hidden"; getE("FloatMenu").innerHTML=' loading..'; for(i=thisform.rdPolling.length-1;i>-1;i--){thisform.rdPolling[i].checked=false;}alert(str); } else { getE("ckSubmitPolling").disabled=true; getE("FloatMenu").style.visibility="visible"; getE("FloatMenu").innerHTML=' sending..'; } } var poststr =''+ 'id_polling=' + encodeURI(getE("id_polling").value) + '&rdPolling=' + encodeURI(rd_value); xmlhttp_polling.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xmlhttp_polling.setRequestHeader('Content-length', poststr.length); xmlhttp_polling.setRequestHeader('Connection', 'close'); xmlhttp_polling.send(poststr); return false; }