// JavaScript Document
	Menu = {timer : null, current : null};
	Menu.getStyle = function(name){
		if(document.getElementById) return document.getElementById(name).style;
		else if(document.all) return document.all[name].style;
		else if(document.layers) return document.layers[name];
	}
	Menu.show = function(name){
		if(this.timer) clearTimeout(this.timer);
		this.getStyle(name).visibility = "visible";
		this.current = name;
	}
	Menu.hide = function(){
		this.timer = setTimeout("Menu.doHide()",300);
	}
	Menu.doHide = function(){
		if(this.current){
			this.getStyle(this.current).visibility = "hidden";
			this.current = null;
		}
	}
	
/////////////////////////////////////////////////////////
function searchAirport(searchUrl){
  window.open(searchUrl, "searchAiportWd", "width=400,height=250,resizable=1");
}
function getAirportCode(fname){
  var url = wwwroot + "/searchAirport.aspx?f=" + fname;
  searchAirport(url);
}
function openWd(url, wdName, width, height){
  var str = "width=" + width + ",height=" + height + ",resizable=1,scrollbars=1";
  window.open(url, wdName, str);
}
function getAirlineCode(fname){
  var url = wwwroot + "/searchAirline.aspx?f=" + fname;
  openWd(url, "searchAirlineWd", 500, 300);
}
function focusField(fid, blurStr){
  var field = eval("document.Form1." + fid);
  if(field != null){
    if(field.value == blurStr)
      field.value = "";
    else if(field.value == "")
      field.value = blurStr;
  }
}
function swapView(div1, div2){
  var div1 = document.getElementById(div1);
  var div2 = document.getElementById(div2);
  if(div1 != null && div2 != null){
    div1.style.display = "none";
    div2.style.display = "block";
  }
}
function scrollToLastPos(){
  if(document.Form1.scrollVal != null && document.Form1.scrollVal.value != "")
    document.body.scrollTop = document.Form1.scrollVal.value;
}
function saveScrollPos(){
  if(document.Form1.scrollVal != null)
    document.Form1.scrollVal.value = document.body.scrollTop;
    
  return true;
}
function verifyAirportCode(obj){
  var val = obj.value;
  if(!val.match(/^[a-z0-9]+$/i)) alert("Invalid airport code");
  obj.value = obj.value.toUpperCase(); 
}
function verifyFlightID(obj){
  var val = obj.value;
  if(!val.match(/^[a-z0-9]+$/i)) alert("Invalid flight ID");
  obj.value = obj.value.toUpperCase(); 
}
//////////////////////////////




