var xmlHttp;
var progressAt = 9;
var test="";
function Gethits(str,sti)
{
var getit=document.getElementById('txtHint');
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var myrandom=parseInt(Math.random()*99999999);
var url="/listacti.php?date="+str+"&loc="+sti+"&rand="+myrandom; 
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function(){
var getit=document.getElementById('txtHint');
if (xmlHttp.readyState==1){
getit.innerHTML=test1();
progress_update();
}
if (xmlHttp.readyState==4)

{ 
//document.write(xmlHttp.responseText);
getit.innerHTML=xmlHttp.responseText;
progressAt = 9
}
}
xmlHttp.send(null);
} 


function getsch(tm,dt){

xmlHttp2=GetXmlHttpObject();
if (xmlHttp2==null)
  {
  alert ("Your browser does not support This Program!");
  return;
  }

var pgname;
if (document.acsh.ore[0].checked){
pgname ='tmsch';
}else{
pgname ='tmschcal';
}


var myrandom=parseInt(Math.random()*99999999); 
var url="/"+pgname+".php?tm="+tm+"&dt="+dt+"&rand="+myrandom; 
xmlHttp2.open("GET",url,true);
xmlHttp2.onreadystatechange=function(){
var getit=document.getElementById('txtHint');
if (xmlHttp2.readyState==1){

//getit.innerHTML='<br><p align=center><font size=4>----LOADING DATA-----</font></p><p align=center><i>Please Wait</i></p><br>&nbsp;<br>';
getit.innerHTML=test1();

progress_update();
}
if (xmlHttp2.readyState==4)

{ 
//clearTimeout(progressTimer);
//document.write(xmlHttp2.responseText);
getit.innerHTML=xmlHttp2.responseText;
progressAt = 9
}
}
xmlHttp2.send(null);
} 


/*function stateChanged() 
{
var getit=document.getElementById('txtHint');
getit.innerHTML=test1();
if (xmlHttp.readyState==1){

//getit.innerHTML='<br><p align=center><font size=4>----LOADING DATA-----</font></p><p align=center><i>Please Wait</i></p><br>&nbsp;<br>';
getit.innerHTML=test1();

progress_update();
}
if (xmlHttp.readyState==4)

{ 
clearTimeout(progressTimer);
//document.write(xmlHttp.responseText);
getit.innerHTML=xmlHttp.responseText;
progressAt = 9
}


}*/

function boeget(str)
{
xmlHttp3=GetXmlHttpObject();
if (xmlHttp3==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var myrandom=parseInt(Math.random()*99999999);
var url="cir.php?content="+str+"&rand="+myrandom; 
xmlHttp3.open("GET",url,true);
xmlHttp3.onreadystatechange=function(){
var getit=document.getElementById('boedis');
if (xmlHttp3.readyState==4)

{ 
//document.write(xmlHttp.responseText);
getit.innerHTML=xmlHttp3.responseText;
}
}
xmlHttp3.send(null);
} 




function test1(){
var test="<br><br><p align=center>----LOADING DATA- <i>Please Wait</i>----</p><table align='center'><tr><td><div id='showbar' style='font-size:8pt;padding:2px;border:solid black 1px'><span id='progress1'>&nbsp; &nbsp;</span><span id='progress2'>&nbsp; &nbsp;</span><span id='progress3'>&nbsp; &nbsp;</span><span id='progress4'>&nbsp; &nbsp;</span><span id='progress5'>&nbsp; &nbsp;</span><span id='progress6'>&nbsp; &nbsp;</span><span id='progress7'>&nbsp; &nbsp;</span><span id='progress8'>&nbsp; &nbsp;</span><span id='progress9'>&nbsp; &nbsp;</span></div></td></tr></table>";
return test;
}

function progress_update() {
//document.getElementById('showbar').style.visibility = 'visible';
progressAt++;
if (progressAt > 9){
for (var i = 1; i <= 9; i++){ 
if (document.getElementById('progress'+i)){
document.getElementById('progress'+i).style.backgroundColor = 'transparent';
progressAt = 0;}
}
}else{
if (document.getElementById('progress'+progressAt)){
document.getElementById('progress'+progressAt).style.backgroundColor = 'Navy';
}
}
var progressTimer = setTimeout('progress_update()',500);
}

function editup(typ, id) {

var url = "/manage/editor/index.php?uptype="+typ+"&key="+id;
window.open(url, '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=750,height=500');

}


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;
}

function sendvar(){
var num=0;
var len= document.acsh.acti.length;
for (i=0; i<len;i++){
if (document.acsh.acti[i].checked){
num=i;
}
}

var send= document.acsh.acti[num].value;
var tm= document.acsh.advty.value;
getsch(tm,send)

}

function tmsch(tm){
getsch(tm,'CSR')
}

function print(){
var num;
var len= document.acsh.acti.length;
for (i=0; i<len;i++){
if (document.acsh.acti[i].checked){
num=i;
}
}
var pgname;
if (document.acsh.ore[0].checked){
pgname ='tmsch';
}else{
pgname ='tmschcal';
}

var ser=document.acsh.advty.value;
var send= document.acsh.acti[num].value;
var path ="/"+pgname+".php?tm="+ser+"&dt="+send+"&pr=1"; 

window.open(path, '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=750,height=500');

}


function results(tm){
var rpath = '/acti/results.php?key='+tm;
window.open(rpath, '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=400');
}


function nomination(){
var rpath = '/nomination.php';
window.open(rpath, '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=750,height=500');
}

function showseasch(link){

if (link == 'close'){
document.all.seasch.style.display='none';
document.getElementById('tabsearch').href="javascript: showseasch('show')";
document.getElementById('tabsearch').innerHTML='Open Search';
}else{
document.all.seasch.style.display='block';
document.getElementById('tabsearch').innerHTML='Close Search';
document.getElementById('tabsearch').href="javascript: showseasch('close')";
} 

}

