//CLEAR TEXT INSIDE FIELD
function doClear(theText) {
	if (theText.value == theText.defaultValue) {
		theText.value = ""
	}
}

//EXTERNAL LINKS (use instead of target="_blank")
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
	var anchor = anchors[i];
	if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
	anchor.target = "_blank";
	}
}
window.onload = externalLinks;

function switch_div_content(id,idToShow) {
	$("#splash").fadeOut("fast", function() {
		$("#splash").empty();
		});
	$("#splashStill").fadeIn("fast");
	//document.getElementById(id).style.display = 'none';
	//document.getElementById(idToShow).style.display = 'inline';
}

//dropdown menus
function hidesubmenus() {$('.submenu').removeClass('submenu-current').fadeOut(200);} 

 $(document).ready(function()
   {
   $('.nav .hassubmenu').mouseover(function()
   {
   clearTimeout($submenuhide);
   var $target = $(this).find('.submenu');
   if ($target.hasClass('submenu-current')) {return false;}
   $('.submenu-current').removeClass('submenu-current').hide();
   $target.addClass('submenu-current').fadeIn(200);
   });
     
   $('.hassubmenu').mouseout(function()
   {
   $submenuhide=setTimeout('hidesubmenus();', 500); 
   });
   
   var $submenuhide=setTimeout('hidesubmenus();', 50);
});