/*
 *	Custom JavaScript Functions
*/

/* IE Hover Hack */
ieHover = function() {
	var sfEls = document.getElementById("sub_menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" iehover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ieHover);





function get_ships(str)
{
if (str=="")
  {
  //document.getElementById("ship_select_holder").innerHTML=xmlhttp.responseText;
  return;
  }
if (window.XMLHttpRequest)
  { // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  { // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("ship_select_holder").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open('GET','/cruise/shiplist_ajax/'+str,true);
xmlhttp.send();
}

set_ships = function()
{
  get_ships(document.getElementById('company').value);
}

//if (window.addEventListener)
//	window.addEventListener("load", set_ships, false);
//else if (window.attachEvent)
//	window.attachEvent("onload", set_ships);
