

var visibleTech;
var visibleColorName;
var clickedColorName;
var swapColorIndicator;
var swapColorTimeout;
var swapColorFadeIn;
var swapColorFadeCount;

function swapTech(id)
{
var swapTechWith=document.getElementById(id);

if(!visibleTech)
{
visibleTech=document.getElementById('tech1');}visibleTech.style.display="none";swapTechWith.style.display="block";visibleTech=swapTechWith;
}



function swapColor (id,styleNumber,colorCode)
{
clickedColorName=id;document.imgProduct.src='/media/gear/catalog/'+styleNumber+'/'+styleNumber+'-'+colorCode+'_feature.jpg';selectedColorCode=colorCode;
}



function swapColorOver(id)
{
	if(swapColorTimeout)
	{
	window.clearTimeout(swapColorTimeout);
	}
	if(swapColorFadeIn)
	{
	window.clearTimeout(swapColorFadeIn);visibleColorName.style.color="#000000";
	}

	if(clickedColorName)
	{
	swapColorIndicator=document.getElementById(clickedColorName+'bg');swapColorIndicator.style.borderColor="#586976";
	}

	var swapColorNameWith=document.getElementById(id);

	if(!visibleColorName)
	{
	visibleColorName=document.getElementById('color0');}visibleColorName.style.display="none";swapColorNameWith.style.display="block";visibleColorName=swapColorNameWith;swapColorIndicator=document.getElementById(id+'bg');swapColorIndicator.style.borderColor="#FE0000";
	}

	function swapColorOut()
	{
	if(visibleColorName.id!=clickedColorName)

	{
	var
	swapColorNameWith=document.getElementById('colorX');visibleColorName.style.display="none";swapColorNameWith.style.display="block";swapColorIndicator.style.borderColor="#586976";visibleColorName=swapColorNameWith;swapColorTimeout=window.setTimeout('swapColorReset()',750);
	}
}

function swapColorReset()
{
	if(clickedColorName)
	{
	var swapColorNameWith=document.getElementById(clickedColorName);swapColorIndicator=document.getElementById(clickedColorName+'bg');swapColorIndicator.style.borderColor="#FE0000";
	}

	else{
	var
	swapColorNameWith=document.getElementById('color0');}visibleColorName.style.display="none";swapColorNameWith.style.color="#FFFFFF";swapColorNameWith.style.display="block";visibleColorName=swapColorNameWith;swapColorFadeCount=0;swapColorFadeIn=setInterval('fadeInColorName()',50);
	}

	function fadeInColorName()
	{
	var colors=new
Array("#EEEEEE","#DDDDDD","#BBBBBB","#999999","#777777","#555555","#333333","#000000");colorValue=colors[swapColorFadeCount];visibleColorName.style.color=colorValue;swapColorFadeCount++;

	if(swapColorFadeCount==8)
	{
	clearInterval(swapColorFadeIn);
	}
}
