function hideSelects(){
  document.getElementById('depMonth').style.visibility='hidden'
  document.getElementById('arrMonth').style.visibility='hidden'
  document.getElementById('depTime').style.visibility='hidden'
  document.getElementById('retTime').style.visibility='hidden'
  document.getElementById('pref').style.visibility='hidden'
  document.getElementById('ADTCOUNT').style.visibility='hidden'
  document.getElementById('YTHCOUNT').style.visibility='hidden'
  document.getElementById('CHDCOUNT').style.visibility='hidden'
  document.getElementById('YCDCOUNT').style.visibility='hidden'
}
function showSelects(){
  document.getElementById('depMonth').style.visibility='visible'
  document.getElementById('arrMonth').style.visibility='visible'
  document.getElementById('depTime').style.visibility='visible'
  document.getElementById('retTime').style.visibility='visible'
  document.getElementById('pref').style.visibility='visible'
  document.getElementById('ADTCOUNT').style.visibility='visible'
  document.getElementById('YTHCOUNT').style.visibility='visible'
  document.getElementById('CHDCOUNT').style.visibility='visible'
  document.getElementById('YCDCOUNT').style.visibility='visible'
}

function ablur(ID,form)
{ 
  row=-1
  setTimeout("document.getElementById('"+ID+"').style.display='none'",200)
  setTimeout("document.getElementById('"+ID+"').innerHTML=''",250)
  setTimeout("showSelects()",100)
}

function showhide(ID)
{
  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
  var url="menu_disp.php"
  if(document.getElementById(ID).style.display=='block')
  {
    url=url+"?q=none";
    document.getElementById(ID).style.display='none';
  }
  else
  {
    url=url+"?q=block"
    document.getElementById(ID).style.display='block';
  }
  url=url+"&sid="+Math.random()
  xmlHttp.open("GET",url,true)
  xmlHttp.send(null)
}

var xmlHttp
var div

function sipky(input_id,key)
{
  if(key!=40 && key!=38 && key!=39 && key!=13){return;}
  if(key==40){
    if(document.getElementById(input_id+'_'+(row+1))){
      row++
      mouse_over(row,input_id)
    }
  }
  if(key==38){
    if(row>=-1){row=row-1}
    if(row==-1){
      ablur(input_id+'_div')
    } else {
      mouse_over(row,input_id)
    }
  }
  var val=''
  if((key==39 || key==9 || key==13) && document.getElementById('val_'+input_id+'_'+row)){
    val=document.getElementById('val_'+input_id+'_'+row).value
    document.getElementById(input_id).value=val
    ablur(input_id+'_div')
  }
}

function showHint(str,div2,browser,event)
{
var key = event.keyCode;
if(key==38 || key==39 || key==13){return;}
div=div2+"_div"
if (str.length==0)
{ 
document.getElementById(div).innerHTML=""
document.getElementById(div).style.display='none'
return
}
if(key!=40 || document.getElementById(div).style.display!='block'){

  document.getElementById(div).style.display='block'
  row=-1
  if(browser){hideSelects()}
  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
  var url="ajax.php"
  url=url+"?q="+str
  url=url+"&sid="+Math.random()
  url=url+"&act="+div2
  xmlHttp.onreadystatechange=stateChanged
  xmlHttp.open("GET",url,true)
  xmlHttp.send(null)
  }
} 



function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(div).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 goTo(href)
{
	window.open(href,null,"height=450,width=850,status=no,toolbar=no,scrollbars=yes,resiable=1,menubar=no,left="+Math.floor((screen.width-900)/2)+",top="+Math.floor((screen.height-500)/2));
}

