var xmlHttp
var mycontest_index
var mycontest_id

function dispcontest(contest_index)
{ 

mycontest_index = contest_index

//if(mycontest_index == '1') {
  //document.getElementById("bothcol").innerHTML="<table><tr><td>Loading...</td></tr></table>"
//}
//else {
  document.getElementById("middlecol").innerHTML="Loading..."
//}

xmlHttp1=GetXmlHttpObject()
if (xmlHttp1==null)
 {
 alert ("Browser does not contest HTTP Request")
 return
 } 
 
xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null)
 {
 alert ("Browser does not contest HTTP Request")
 return
 } 


var url2="getContest.php"
url2=url2+"?ci="+mycontest_index
url2=url2+"&sid="+Math.random()
xmlHttp2.onreadystatechange=stateChangedright
xmlHttp2.open("GET",url2,true)
xmlHttp2.send(null)

//if(mycontest_index != '1') {
    var url="getContestBtns.php"
    url=url+"?ci="+mycontest_index
    url=url+"&sid="+Math.random()
    xmlHttp1.onreadystatechange=stateChangedleft 
    xmlHttp1.open("GET",url,true)
    xmlHttp1.send(null)
//}//end if

}//end dispcontest

function fullStory(news_id)
{ 
 
xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 

mynews_id = news_id
 
var url2="getFullStory.php"
url2=url2+"?ni="+mynews_id
url2=url2+"&sid="+Math.random()
xmlHttp2.onreadystatechange=stateChangedright
xmlHttp2.open("GET",url2,true)
xmlHttp2.send(null)

}

function stateChangedleft() 
{ 
if (xmlHttp1.readyState==4 | xmlHttp1.readyState=="complete")
 { 
 //if(mycontest_index == '1'){
 			//document.getElementById("bothcol").innerHTML=xmlHttp1.responseText
 //}
 //else {
 			document.getElementById("leftcol").innerHTML=xmlHttp1.responseText
 //} 
 
 } 
}

function stateChangedright() 
{ 
if (xmlHttp2.readyState==4 | xmlHttp2.readyState=="complete")
 { 
 //if(mycontest_index == '1'){
   			//document.getElementById("bothcol").innerHTML=xmlHttp2.responseText
   //}
   //else {
   			document.getElementById("middlecol").innerHTML=xmlHttp2.responseText
   //} 
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
