function ImgHover(img)
{	
	if (img) {
		var url = document.getElementById(img.id).getAttribute("src");
		if (url.indexOf("_off") != -1) {
			url = url.replace("_off","_on");
		} else { url = url.replace("_on","_off"); }
		document.getElementById(img.id).setAttribute("src",url);}}
function ExpandCollapse (elementRef, classExpand, classCollapse) 
{  if (document.getElementById(elementRef).className == classExpand) {
  document.getElementById(elementRef).className = classCollapse  }  
  else { document.getElementById(elementRef).className = classExpand }
}
function createWindow(URL, windowName, features) {
    window.open (URL, windowName, features);}
function checkanddo(lay) {
	if (document.getElementById(lay).style.display == "block") {
		document.getElementById(lay).style.display = "none";
	} else { document.getElementById(lay).style.display = "block"; }}
function replaceimage(imgid) {
	var stringX = document.getElementById(imgid).src;
	if (stringX.indexOf("plus") == -1) {
		stringX = stringX.replace(/minus/, "plus");	}
	else { stringX = stringX.replace(/plus/, "minus"); }
	document.getElementById(imgid).src = stringX;
}
function ValidateSearch() {
	var oQuery = document.getElementById("Query");
	alert(oQuery.value);
	if(oQuery.value == ""){
		return false;
	} else { return true; }}
// Check whether string s is empty.
function isEmpty(s)
{   return ((s == null) || (s.length == 0)); }
//validate keyword search text box
function validateKeyword(s)
{	
	if( s != null )
	{
		if( !isEmpty(s) )
		{	
			return true;
		}
		else {//alert("Please enter search criteria");
			return false;}	}}
//submit searchn when <enter> key is presses
function submitSearchForm(buttonName,e,txtbx)
{	
	var key;
	if(window.event || !e.which)
	{	
		key = e.keyCode; 
	}
	else { key = e.which; }

	if (key == 13)
	{
		//disable <enter> for Netscape
		//if(!document.all){return false;} 
		
		if( validateKeyword(txtbx.value) )
		{	//validate keyword text search
			SetFocus(buttonName);
			__doPostBack(document.getElementById(buttonName).name,'');
		}
		else { return true; }	}}
function SetFocus(buttonName) 
{ document.getElementById(buttonName).focus(); }
//new function to handle item references from item pages pop up
function itemReferencePopUp(URL) {
    window.open (WebSiteBaseURL + URL, 'itemReferences', 'toolbar=no,resizable=no,scrollbars=yes,left=0,top=0,screenX=0,screenY=0,width=600,height=400');}
    
function SendFeedback(url) {
  var destination = url.replace("RES",screen.width+"x"+screen.height);
  var mywindow=window.open(destination,'surveywindow','width=1010,height=520,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,left=5,top=5');
} 
//addthis js
var addthis_pub="lifeextension";
var addthis_options = 'aim, ask, delicious, digg, facebook, furl, google, linkedin, live, mixx, myspace, reddit, slashdot, spurl, stumbleupon, twitter, more';
var addthis_exclude = 'email, print';
var addthis_test0309 = false; //removes the "Related: you may also like"
var addthis_hover_delay = 50;
  