﻿function WatermarkFocus(txtElem, strWatermark) 
{  
   if (txtElem.value == strWatermark) txtElem.value = '';
}

function WatermarkBlur(txtElem, strWatermark) 
{  
   if (txtElem.value == '') txtElem.value = strWatermark;
}

function clickButton(e, buttonid)
{
      var evt = e ? e : window.event;
      var bt = document.getElementById(buttonid);
      
      if (bt)
      { 
          if (evt.keyCode == 13)
          { 
               bt.click(); 
               return false; 
          } 
     }
 }

 function GetHttpRequest(pRequestUrl) {
     var xmlhttp;
     
     if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
         xmlhttp = new XMLHttpRequest();
     }
     else {// code for IE6, IE5
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
     }
     xmlhttp.open("GET", pRequestUrl, false);
     xmlhttp.send();
     return xmlhttp.responseText;
 }

 function Vote(pPollguid) 
 {
     var val = 0;

     for (i = 0; i < document.myform.mygroup.length; i++) {
         if (document.myform.mygroup[i].checked == true)
             val = document.myform.mygroup[i].value;
     }
     alert("val = " + val);


     document.getElementById('PollDataContainer').innerHTML =
     GetHttpRequest('/castvote.ashx?pollguid=' + pPollguid);
     return false;
 }
