//preload.src = "Images/Buttons/minus.gif";

function Expand(whichEl) {
if (document.layers) // NS 4.x
   {
      d1=document.layers[whichEl];
	  //imgbtn = document.
	  
      if (d1.visibility=="hide")
      {
         d1.visibility="show";
      }
      else
      {
         d1.visibility="hide";
      }
   }
   else
   {
      if (document.getElementById) // DOM-compliant browsers
      {
         d1=document.getElementById(whichEl);
      }
      else if (document.all) // IE 4.x
      {
         d1=document.all[whichEl];
      }
      else
      {
         return
      }
      if (d1.style.display=="none")
      {
         d1.style.display="block";
		 document['btn' + whichEl].src = "/images/buttons/minus.gif";
      }
      else
      {
         d1.style.display="none";
		 document['btn' + whichEl].src = "/images/buttons/plus.gif";
      }
   }
}
/*
function Expand(whichEl) {
	//whichEl.style.visibility = (whichEl.style.visibility == "hide") ? "hide" : "show";
	if(navigator.appName == 'Netscape')
    {
	   whichEl.visibility = (whichEl.visibility == "hide") ? "hide" : "show";
	} else
	{
	   whichEl.style.display = (whichEl.style.display == "none" ) ? "" : "none";
	}
	//navigator.appName == 'Netscape'
	//if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
	//if (whichEl.className == "child") whichEl.style.display = "none";
}
*/

function formHandler(form_stat){
var URL = form_stat;
  //if (URL == 's') {
  //alert('please select a search category.');
  //} else {
  window.location.href = URL;
  //}
}
function GoToURL(DropNo){
   var URL = DropNo;
   window.location.href = URL;
}
function Search()
{
    window.location.href="Search.aspx?s=";
	// + document.form1.SearchField.value;
}
//Function to show a menu

function showLayer(layerid) {
var layer = document.getElementById(layerid);
layer.style.visibility = "visible";
}

//Function to hide a menu

function hideLayer(layerid) {
var layer = document.getElementById(layerid);
layer.style.visibility = "hidden";
}

function ToggleSelectList(drop,stat) {
 document.getElementById(drop).style.visibility = (stat);
}

function formHandler(form_stat){
var URL = form_stat;
  if (URL == 's') {
  alert('please select a search category.');
  } else {
  window.location.href = URL;
  }
}

function get_weather(){
   parent.loc.innerHTML = ("Loading...");
   parent.document['pic'].src='images/weather/blank.gif';
   parent.forcast.innerHTML = ("Loading...");
   parent.temp.innerHTML = ("Loading...");
   parent.max.innerHTML = ("Loading...");
   parent.min.innerHTML = ("Loading...");
   parent.wind.innerHTML = ("Loading...");
   parent.tides.innerHTML = ("Loading...");
   //-----
   location_val = document.weather.re.options[document.weather.re.selectedIndex].value
   time_val = document.weather.day.options[document.weather.day.selectedIndex].value
   //-----
   //parent.frames["portal"].location = ("w_data.aspx?loc=" + location_val)
   setTimeout("find_weather('DataSource/Wdata.aspx?day=' + time_val + '&loc=' + location_val)",1000);
}

//var scriptUrl = "DataSource/Wdata.aspx";
  function find_weather(scriptUrl) {

  		var head = document.getElementsByTagName('head').item(0);
		var old  = document.getElementById('lastLoadedCmds');
		if (old) head.removeChild(old);
		
		script = document.createElement('script');
  		script.src = scriptUrl;
		script.type = 'text/javascript';
		script.defer = true;
		script.id = 'lastLoadedCmds';
		
		void(head.appendChild(script));
  //---------------
  }
