﻿var xmlHttp;
var id1;

function resultSlide(cnt)
{    
    //$("#slide").animate({width:'toggle'},2000);
        
    $("#slide1").animate({width: 'show'});     
    $("#slide2").animate({width: 'show'});
    $("#slide3").animate({width: 'show'});
    $("#slide4").animate({width: 'show'});
    $("#slide5").animate({width: 'show'});     
    $("#slide6").animate({width: 'show'});
    $("#slide7").animate({width: 'show'});
    $("#slide8").animate({width: 'show'});
     
}

function mainStartUp()
{    
    showPollResults("f", "results", -1, -1);
}

function mainStartUp2()
{
    //ShowRegisterBar2("register");    
    //ShowMainMenu2("menu");
}

function ShowMainMenu(id)
{
  xmlHttp = GetXmlHttpObject();
  id1 = id;     
    
  if (xmlHttp == null)
  {
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = "MainMenu.aspx"; 
  
  //xmlHttp.onreadystatechange = stateChanged; 
  
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);  
  
  document.getElementById(id1).innerHTML = xmlHttp.responseText; 
}

function ShowMainMenu2(id)
{
  xmlHttp = GetXmlHttpObject();
  id1 = id;     
    
  if (xmlHttp == null)
  {
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = "../MainMenu.aspx"; 
  
  //xmlHttp.onreadystatechange = stateChanged; 
  
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);  
  
  document.getElementById(id1).innerHTML = xmlHttp.responseText; 
}

function ShowRegisterBar(id)
{
  xmlHttp = GetXmlHttpObject();
  id1 = id;     
    
  if (xmlHttp == null)
  {
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = "RegisterBar.aspx"; 
  
  //xmlHttp.onreadystatechange = stateChanged; 
  
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);  
  
  document.getElementById(id1).innerHTML = xmlHttp.responseText; 
}

function showPollResults(party, id, qID, oID, uID)
{ 
  xmlHttp = GetXmlHttpObject();
  id1 = id; 
    
  if (xmlHttp == null)
  {
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = "PollResults.aspx?qID=" + qID + "&oID=" + oID + "&party=" + party + "&uID=" + uID; 
  
  //xmlHttp.onreadystatechange = stateChanged; 
  
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);    
  
  document.getElementById(id1).innerHTML = xmlHttp.responseText; 
}

function ShowPollQuestion(id)
{
  xmlHttp = GetXmlHttpObject();
  id1 = id;     
    
  if (xmlHttp == null)
  {
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = "PollQuestion.aspx"; 
  
  //xmlHttp.onreadystatechange = stateChanged; 
  
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);  
  
  document.getElementById(id1).innerHTML = xmlHttp.responseText; 
}

function ShowRegisterBar2(id)
{
  xmlHttp = GetXmlHttpObject();
  id1 = id;     
    
  if (xmlHttp == null)
  {
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = "../RegisterBar.aspx"; 
  
  //xmlHttp.onreadystatechange = stateChanged; 
  
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);  
  
  document.getElementById(id1).innerHTML = xmlHttp.responseText; 
}

function GetXmlHttpObject()
{ 
  var objXMLHttp = null;
  if (window.XMLHttpRequest)
  {
    objXMLHttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {
    objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  return objXMLHttp;
}

function stateChanged() 
{   
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
  { 
    document.getElementById(id1).innerHTML = xmlHttp.responseText; 
  } 
} 

