/***************************************************
Javascript 1.3 (ECMA-262, Edition 1 specification)
http://www.ecma-international.org/publications/standards/Ecma-262.htm

last modified 05/16/2006

Copyright 2006
RDVO, Inc. | http://www.rdvo.com
***************************************************/
//Pop up a window containing the video presentation
function SeminarPopup(url) {
	window.open('http://www.vicorpower.com/library/video_seminars/shared/media_player_detect.php?url=' + escape(url), 'video_presentation', 'width=795,height=560,resizable,scrollbars');
}

//Pop up a window containing the video presentation
function videoPopup(url, title) {
	window.open('http://www.vicorpower.com/library/video_seminars/video_popup/index.php?title=' + escape(title) + '&url=' + escape(url), 'video_popup', 'width=346,height=317,resizable');
}

// Clears 'Search...' text from search form
function clearSearch(obj) {
  var keywords = $(obj).value;
  if (keywords=='Search...') {
    $(obj).value = '';
  }
}
//Toggles tabs on product pages
	function toggleTab(thelink, contentid) {
		theul = document.getElementById('productTabs')
		thelinks = theul.getElementsByTagName('li');
		for (i=0;i<thelinks.length;i++) {
			thelinks[i].className = 'tab';
			thelinks[i].blur();
			document.getElementById('tab' + i + 'content').style.display = 'none';

		}
		thelink.parentNode.className = 'tab tabOn';
		document.getElementById('tab' + contentid + 'content').style.display = 'block';
	}


//Jum menu in Choose a Region
function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//IE hover fix
ieHover = function() {
	var sfEls = document.getElementById("navbar").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" ieHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" ieHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ieHover);

function sfHoverEvents(sfEls) {
  var len = sfEls.length;
  for (var i=0; i<len; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" iefix";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(" iefix", "");
    }
  }
}
function sfHover() {
var ULs = document.getElementsByTagName("UL");
var len = ULs.length;
  for(var i=0;i<len;i++) {
    if(ULs[i].className.indexOf("dropdownlists") != -1)
      sfHoverEvents(ULs[i].getElementsByTagName("LI"));
  }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



