window.onload = jsFnOnload;

/*** Set up functions on page load ***/
function jsFnOnload()
{
	if (document.getElementById)
	{
		aProductContent = document.getElementById('features');
		if (aProductContent != null)
		{
			var aDiv = document.getElementsByTagName("div");
			var aFirst = true;
			if (aDiv != null) 
			{
				for(aDivIndex=0; aDivIndex < aDiv.length; aDivIndex++)
				{
					if(aDiv[aDivIndex].className=='tab')
					{
						if(aFirst) aFirst = false;
						else aDiv[aDivIndex].style.display = 'none';
					}
				}
			}
		}
		
		aProductMenu = document.getElementById('tabs');
		if (aProductMenu != null)
		{
// 			aProductMenu.firstChild.style.border = '1px solid #000';     
// 			aProductMenu.firstChild.style.borderBottom = '1px solid #000';
// 			aProductMenu.firstChild.style.backgroundColor = "#000";
			
			var aLinks = aProductMenu.getElementsByTagName("a");
			if (aLinks != null) 
			{
				for(aLinkIndex=0; aLinkIndex < aLinks.length; aLinkIndex++)
				{
					aLinks[aLinkIndex].onclick = ShowProductTab;
				}
			}
		}
	}	
}

function ShowProductTab()
{
	HideTabs();
	aTabID = this.href.substr(this.href.indexOf('#')+1);
	
	ResetBorders();
	
	this.parentNode.style.backgroundImage = 'url(images/featuresTabbed_selected.jpg)';
  this.style.color = '#d15e2c';     

	aTab = document.getElementById(aTabID);
	if (aTab != null) aTab.style.display = 'block';

	return false;
}

function ResetBorders()
{
	aProductMenuContent = document.getElementById('tabs');
	if (aProductMenuContent != null)
	{
		var aLi = aProductMenuContent.getElementsByTagName("li");
		if (aLi != null) 
		{
			for(aLiIndex=0; aLiIndex < aLi.length; aLiIndex++)
			{
 				aLi[aLiIndex].style.backgroundImage = 'url(images/featuresTabbed_normal.jpg)';
        aLi[aLiIndex].childNodes[0].style.color = '#82281f';     
			}
		}
	}
}


//hide all tabs
function HideTabs()
{
	aProductContent = document.getElementById('content');
	if (aProductContent != null)
	{
		var aDiv = document.getElementsByTagName("div");
		if (aDiv != null) 
		{
			for(aDivIndex=0; aDivIndex < aDiv.length; aDivIndex++)
			{
				if(aDiv[aDivIndex].className=='tab') aDiv[aDivIndex].style.display = 'none';
			}
		}
	}
}

function JSFnImageZoom(url)
{
	var aWindow = window.open(url, 'productbig', 'menubar=no, resizeable=no, toolbar=no, width=900px, height=900px');
	aWindow.focus();
	return false;
}
/**********************************************************************************************************************************/
