// JavaScript Document

function ShowHide(sElement)
{
  objElement = document.getElementById(sElement);
  if (objElement != null)
    {
	if (objElement.style.display == '')
	  {
	  objElement.style.display = 'none';
	  }
	  else
	  {
	  objElement.style.display = '';
	  }
	}
}

function MaxDescription(sProduct)
{
  objMax = document.getElementById('MaxDescription' + sProduct);
  objMin = document.getElementById('MinDescription' + sProduct);
  if (objMin != null)
    {
	objMin.style.display = 'none';
	}
  if (objMax != null)
    {
	objMax.style.display = '';
	}
}

function MinDescription(sProduct)
{
  objMax = document.getElementById('MaxDescription' + sProduct);
  objMin = document.getElementById('MinDescription' + sProduct);
  if (objMax != null)
    {
	objMax.style.display = 'none';
	}
  if (objMin != null)
    {
	objMin.style.display = '';
	}
}

function ShowTab(sTab)
{
var section = [];
section[0] = 'description';
section[1] = 'devices';
section[2] = 'related';
section[3] = 'similar';
section[4] = 'specs';
	for(i=0; i<5; i++) 
		{ 
		objContent = document.getElementById(section[i]+'_content');
		objTab = document.getElementById(section[i]+'_tab');
		if (objContent != null)
			{
			if (sTab == section[i])
				{
				objContent.style.display = '';
				objTab.className = 'open';
				} else {
				objContent.style.display = 'none';
				objTab.className = 'closed';
				}
			}
		}
}

function ShowHideGroup(sGroup)
{
	objDIV = document.getElementById('prodGroupDiv' + sGroup);
	objIMG = document.getElementById('prodGroupImg' + sGroup);
	if (objDIV != null)
		{
		if (objDIV.style.display == 'none')
			{
			objDIV.style.display = '';
			objIMG.src = 'images/prodGroupOpen.png';
			} else {
			objDIV.style.display = 'none';
			objIMG.src = 'images/prodGroupClosed.png';
			}
		}
}

$(function() {
	
	if($.browser.msie && parseFloat($.browser.version) < 7){
		
		//EUGH! IE < 8! Do nothing.
		return;
		
	} else {
	  
		//nice web browsers - do fancy menus
		
		function addDropdown(){
	    	$(this).addClass("hovering");
		}
	
		function removeDropdown(){
	    	$(this).removeClass("hovering");
		}
	
		var dropdownConfig = {
			interval: 0,
			sensitivity: 4,
			over: addDropdown,
			timeout: 50,
			out: removeDropdown
	  	};
		  	
  		$("li.dropdown").hoverIntent(dropdownConfig);

	}
  
});


