
//function to make dropdown menu work in IE
function sfHover() {
	var sfEls = document.getElementById('nav').getElementsByTagName('LI');
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=' sfhover';
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace((' sfhover'), '');
		}
	}
}


//populate search box and clear text when focused
function formprep() {
	if (!document.getElementById) return false;
	var formtext = document.getElementById ('inputext');
	formtext.value = 'Search WHP';
	formtext.style.color = '#666';	
	formtext.onfocus = function() {	
		this.value = '';
	}	
}

// function to launch video
function launchVideo() {
	if(!document.getElementsByTagName) return;
	var links = document.getElementsByTagName('a');
	var features = 'width=330,height=280';
	for (var i=0; i<links.length; i++) {
		if (links[i].className != 'popup') continue;
		links[i].onclick = function() {	
			 var theURL = this.getAttribute('href');
			 var whpwin = window.open(theURL,'popup',features);
			 whpwin.focus();
			 return false;
		}
	}	
}


//initate functions on window load
window.onload=function() {
if (window.attachEvent) sfHover();
formprep();
launchVideo();
}