Event.observe(window, 'load', function (){
	var i = 1;
	while ($('tabcontent'+i)){
		$('tab'+i).childElements()[0].setAttribute('href','javascript: showTab('+i+');')
		i++;
	}

	i = 0;
	while ($('sizetab'+i)){
		$('sizetab'+i).childElements()[0].setAttribute('href','javascript: showSizes('+i+');')
		i++;
	}
	showSizes(1);
});

if (/msie/i.test (navigator.userAgent)) //only override IE
{
	document.nativeGetElementById = document.getElementById;
	document.getElementById = function(id)
	{
		var elem = document.nativeGetElementById(id);
		if(elem)
		{
			//make sure that it is a valid match on id
			if(elem.id == id)
			{
				return elem;
			}
			else
			{
				//otherwise find the correct element
				for(var i=1;i<document.all[id].length;i++)
				{
					if(document.all[id][i].id == id)
					{
						return document.all[id][i];
					}
				}
			}
		}
		return null;
	};
}

showTab = function(whichtab){
                var k = 1;
                if ($('tab1').style.display=='none') {k++;}
	var i = k;
	while ($('tabcontent'+i)){
		$('tab'+i).removeClassName('noborderright');
		$('tab'+i).removeClassName('noborderleft');
		if (i==whichtab){
			$('tabcontent'+i).style.display = 'block';
			$('tab'+i).addClassName('producttabhigh');
			$('tab'+i).removeClassName('borderright');
			if (i == k) {$('tab'+i).addClassName('noborderleft');}
		} else {
			
			$('tabcontent'+i).style.display = 'none';
			$('tab'+i).addClassName('borderright');
			$('tab'+i).removeClassName('producttabhigh');
			if (i == whichtab-1) {$('tab'+i).addClassName('noborderright');}
		}
		i++;
	}
}

//showSizes = function(whichsize){
//	temp = $$('#sizestable tr');
//	var hide = true;
//	if (whichsize == 0) hide = false;
//	for (i=0;i<temp.length;i++){
//		if (temp[i].id && whichsize != 0){
//			if (temp[i].id == 'sizesrow'+whichsize) hide = false;
//			else hide = true;
//		}
//		if (hide) temp[i].hide();
//		else temp[i].show();
//	}
//	i=0;
//	while ($('sizetab'+i)){
//		$('sizetab'+i).removeClassName('sizestabnavhigh');
//		i++;
//	}
//	$('sizetab'+whichsize).addClassName('sizestabnavhigh');
//	
//	
//}

	

