﻿function SubmitPoll(id, poll) {

    //var url = "http://67.192.255.156:8090/pages/pollresponse.aspx";
      var url = "/pages/pollresponse.aspx";
    var params = "qid=" + id + "&res=" + poll;
    postMethod(url,params);
}


  var req;
  var response;
  var http = false;
 function getHTTPObject() 
 {
    //Use IE's ActiveX items to load the file.
    if(typeof ActiveXObject != 'undefined') 
    {
        try 
        {
            http = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) 
        {
            try 
            {   
                http = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (E) 
            {
                http = false;
            }
        }
         //If ActiveX is not available, use the XMLHttpRequest of Firefox/Mozilla etc. to load the document.
         } 
         else if (XMLHttpRequest) 
         {
            try 
            {
                http = new XMLHttpRequest();
            }
            catch (e) 
            {
                http = false;
            }
        }
        return http;
    }
    var http = getHTTPObject();
    
    function postMethod(url, params) 
    {
        http.open("POST", url, true);
         //Send the proper header infomation along with the request
        http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        http.setRequestHeader("Content-length", params.length);
        http.setRequestHeader("Connection", "close");
        http.onreadystatechange = processPostReq;
        http.send(params);
    }
 function processPostReq() 
  {
      if (http.readyState == 4) 
      {
          if (http.status == 200) 
          {
              //                req.responseText!=''

                //document.getElementById('divAgentProfile').innerHTML=req.responseText;
                //document.getElementById('contentBox').innerHTML=http.responseText;
                //alert('done');
              document.location.href = "/pages/realunreal.aspx";
//              document.location.href = "http://localhost:1508/pages/realunreal.aspx";
          } 
          else 
          {
              //No response
          }
      }
  }