

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,prod_id,form_ans_id)
{
		var test_path = '/secureshop/photos/forms/medium/'+prod_id+'_'+form_ans_id+'.jpg';
		xajax_checkImageExist(test_path);
		
		clickedColorName=id;
		selected_ssa_id = form_ans_id;
}

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);}}
