// What does this function do? It's not even run properly in page_header.cfm
/*
function sfHover() {
	var sfEls = document.getElementById("productsDrop");
	
	// alert(sfEls.length);
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}

		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
*/

//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isOP    = false;  // Opera
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOP = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as Netscape 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
}

browser = new Browser();

function showmenu(e) {
	document.getElementById('nav_dropdown').style.visibility='visible';
	
}


function hidemenu(e) {

	alert(browser.isIE);
	if (browser.isIE) {
		alert(e.toElement.id);
	} else {
		try {
		alert(e.relatedTarget.id);
		} catch (err) { }
	}
}

function ddHoverOff() {
	//Turn off the tab hilight
	var myImg = document.getElementById("products");
	myImg.setAttribute('src',myImg.getAttribute('xsrc'));
			
	var prodImg = document.getElementById("prodImg");
	prodImg.setAttribute('src', "/img/nav/product_7700K.jpg");
	document.getElementById("chairDrop").style.display = "none";
}
		
function ddHoverOn(id) {
	//Turn on the tab hilight
	var myImg1 = document.getElementById("products");
	myImg1.setAttribute('src',myImg1.className.match(/domroll (\S+)/)[1]);
	
	var prodImg = document.getElementById("prodImg");
	document.getElementById("chairDrop").style.display = "block";
	
	if (id == "7700K") {
		prodImg.setAttribute('src', '/img/nav/product_7700K.gif');	
	} else if (id == "7700BR") {
		prodImg.setAttribute('src', '/img/nav/product_7700BR.gif');
	} else if (id == "6700K") {
		prodImg.setAttribute('src', '/img/nav/product_6700K.gif');
	} else if (id == "5000K") {
		prodImg.setAttribute('src', '/img/nav/product_5000K.gif');
	} else if (id == "5000C") {
		prodImg.setAttribute('src', '/img/nav/product_5000C.gif');
	} else if (id == "1000K") {
		prodImg.setAttribute('src', '/img/nav/product_1000K.gif');
	} else if (id == "RX1BK") {
		prodImg.setAttribute('src', '/img/nav/product_RX1BK.gif');
	} else if (id == "RX1CR") {
		prodImg.setAttribute('src', '/img/nav/product_RX1CR.gif');
	} else if (id == "RX1BR") {
		prodImg.setAttribute('src', '/img/nav/product_RX1BR.gif');
	} else if (id == "herfa500w") {
		prodImg.setAttribute('src', '/img/nav/product_herfa500w.gif');
	}
}
		

/*
function ddHoverOff() {
		myImg = document.getElementById("products");
		myImg.setAttribute('src',myImg.getAttribute('xsrc'))
		//alert("bye");
}

*/