/*	Dropdown Main nav */
var IE6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)  && (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1);

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("TD");
	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"), "");
		}
	}
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			if(IE6 && (this.id=='shopping-tools')) {
				$$('#modelSelector select').setStyle('visibility','hidden');
			}
			if(IE6 && (this.id=='street')) {
				$$('#modelSelector select').setStyle('visibility','hidden');
				$$('#HDForm select').setStyle('visibility','hidden');
			}
			if(IE6 && (this.id=='sportbike')) {
				$$('#HDForm select').setStyle('visibility','hidden');
			}
			if(IE6 && (this.id=='adventure')) {
				$$('#HDForm select').setStyle('visibility','hidden');
			}
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			if(IE6 && (this.id=='shopping-tools')) {
				$$('#modelSelector select').setStyle('visibility','visible');
			}
			if(IE6 && (this.id=='street')) {
				$$('#modelSelector select').setStyle('visibility','visible');
				$$('#HDForm select').setStyle('visibility','visible');
			}
			if(IE6 && (this.id=='sportbike')) {
				$$('#HDForm select').setStyle('visibility','visible');
			}
			if(IE6 && (this.id=='adventure')) {
				$$('#HDForm select').setStyle('visibility','visible');
			}
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//Open link in new window. Yay XHTML Strict!
$('.bvLinkTargetBlank').click(function(e) {
	e.preventDefault();
	var newWindow = window.open(this.getAttribute('href'), '_blank');
	newWindow.focus();
});
