
var img_dir='/~ybskin/images/';

var img_sources=new Array(
"yb_highlight.gif",
"products_highlight.gif",
"pro_highlight.gif",
"media_highlight.gif",
"where_buy_highlight.gif",

"yb.gif",
"products.gif",
"pro.gif",
"media.gif",
"where_buy.gif",

"face.gif",
"eyes.gif",
"lips.gif",
"tools.gif",

"face_highlight.gif",
"eyes_highlight.gif",
"lips_highlight.gif",
"tools_highlight.gif"
);

var images=new Array();
var img=0;
while(img_sources[img]){
images[img]=new Image(); images[img].src=img_dir+img_sources[img];
img++;
}

function setSwatch(thing,src){
document.getElementById("swatch_img").src=src;
thing.style.backgroundColor="#303032";
if(thing.childNodes[0]){
  thing.childNodes[0].style.textDecoration='underline';
  }
if(thing.childNodes[1]){
  thing.childNodes[1].style.borderStyle="solid";
  thing.childNodes[1].style.borderColor="white";
  thing.childNodes[1].style.borderWidth="1px";
  }  
}

function clearSwatch(thing,element_type){
document.getElementById("swatch_img").style.backgroundColor='#010202';
thing.style.backgroundColor="transparent";
if(element_type!='heading'){
thing.childNodes[1].style.border='none';
thing.childNodes[0].style.textDecoration='none';
}
}

function show(id){
document.getElementById(id).style.display='block';
}

function displayBuyWindow(swatch_id){
document.getElementById(swatch_id).style.display='block';
}

function show_shopping_controls(swatch_id){
document.getElementById('shopping_controls_'+swatch_id).style.display='block';
document.getElementById('choose_dealer_or_direct_'+swatch_id).style.display='none';
}

function hide(id){
document.getElementById(id).style.display='none';
}

function highlight(node){
var id=node.parentNode.parentNode.id;
node.style.backgroundImage='url('+img_dir+id+'_highlight.gif)';
}

function reset(node){
var id=node.parentNode.parentNode.id;
node.style.backgroundImage='url('+img_dir+id+'.gif)';
}

function ChangeColorDiv(swid)
{
	var id = document.getElementById('free_products_id_'+swid).value;
	for(var i = 10; i < 300; i++)
	{
		if(document.getElementById('displayFreeProductColor_'+i+'_'+swid))
		{
			if(parseInt(id) == i)
			{
				document.getElementById('displayFreeProductColor_'+i+'_'+swid).style.display = '';
			}
			else
			{
				document.getElementById('displayFreeProductColor_'+i+'_'+swid).style.display = 'none';
			}
		}
	}
}

