// JavaScript Document


function chooseColorGraphic( color, graphic ) {
	// assumes color dropdown menu has id "color"
	// assumes graphic dropdown menu has id "graphic"
   	document.getElementsByName("option[409]")[0].value = color;
	document.getElementsByName("option[410]")[0].value = graphic;	
	tb_remove();
}

function chooseColorGraphic( color, graphic ) {
	// assumes color dropdown menu has id "color"
	// assumes graphic dropdown menu has id "graphic"
   	document.getElementsByName("option[409]")[0].value = color;
	document.getElementsByName("option[410]")[0].value = graphic;	
	tb_remove();
}

//Paul - coder
function translateColorToNumber(color)
{
	if(color=="Baby Blue")
		return 1314;
	if(color=="Sky Blue")
		return 1315;
	if(color=="Peacock")
		return 1316;
	if(color=="Baby Pink")
		return 1336;
	if(color=="Candy")
		return 1337;
	if(color=="Hot Pink")
		return 1338;
	if(color=="Pale Green")
		return 1339;
	if(color=="Garden Green")
		return 1341;
	if(color=="Lavender")
		return 1342;
	if(color=="Violet")
		return 1343;
	if(color=="Plum")
		return 1344;
	if(color=="Aqua")
		return 1345;
	if(color=="Turquoise")
		return 1346;
	if(color=="Marine")
		return 1347;
	if(color=="Lemon")
		return 1348;
	if(color=="Tangerine")
		return 1349;
	if(color=="Apricot")
		return 1350;
	if(color=="Latte")
		return 1351;
	if(color=="Cafe")
		return 1352;
	if(color=="Mocha")
		return 1353;
	if(color=="Bubble Gum")
		return 1354;
	if(color=="Lipstick")
		return 1355;
	if(color=="Brick")
		return 1356;
	if(color=="Dusk")
		return 1357;
	if(color=="Moonlight")
		return 1358;
	if(color=="Midnight")
		return 1359;
	if(color=="Cream")
		return 1360;
	if(color=="Desert Tan")
		return 1361;
	if(color=="Golden Jewel")
		return 1362;
	if(color=="Soft Pastel")
		return 1363;
	if(color=="White")
		return 1364;
}

function translateBorderToNumber(border1)
{
	if(border1=="Stripes")
		return 1533;
	if(border1=="Dots")
		return 1534;
	if(border1=="Plaid")
		return 1535;
	if(border1=="Jungle")
		return 1536;
	if(border1=="Hollywood")
		return 1537;
	if(border1=="Wave")
		return 1538;
	if(border1=="Toast")
		return 1539;
	if(border1=="Victorian Pink")
		return 1540;
	if(border1=="Starplex")
		return 1541;
	if(border1=="Black And White Swirls")
		return 1542;
	if(border1=="Cinema Blue")
		return 1543;
	if(border1=="Leopard")
		return 1544;
	if(border1=="Victorian Blue")
		return 1545;
	if(border1=="Pixie Pink")
		return 1546;
}


function chooseColorBorderGraphic( color, border, graphic ) {
	// assumes color dropdown menu has id "color"
	// assumes color dropdown menu has id "color"
	// assumes graphic dropdown menu has id "graphic"
	document.getElementsByName("option[409]")[0].value = translateColorToNumber(color);
	document.getElementsByName("option[425]")[0].value = translateBorderToNumber(border);
	document.getElementsByName("option[410]")[0].value = graphic;
	tb_remove();
}
//Paul - end code
/*
function chooseColorBorderGraphic( color, border, graphic ) {
	// assumes color dropdown menu has id "color"
	// assumes border dropdown menu has id "border"
	// assumes graphic dropdown menu has id "graphic"
	document.getElementsByName("option[409]")[0].value = color;
	document.getElementsByName("option[425]")[0].value = border;
	document.getElementsByName("option[410]")[0].value = graphic;
	tb_remove();
}*/

function changeInnerHTML ( theID, theContent ) {
	document.getElementById( theID ).innerHTML = theContent;
}


function GetWidth() {
	var x = 0;
	if (self.innerWidth) {
		x = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		x = document.documentElement.clientWidth;
	} else if (document.body) {
		x = document.body.clientWidth;
	}
	return x;
} //function GetWidth() {

function GetHeight() {
	var y = 0;
	if (self.innerHeight) {
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		y = document.documentElement.clientHeight;
	} else if (document.body) {
		 y = document.body.clientHeight;
	}
	return y;
} //function GetHeight() {

function hideBlacks() {
	// if black background is chosen, this hides all 
	// graphics that are mostly black. These
	// will be invisible on a black background anyway
	//alert("hiding dark graphics");
	var totalGraphics = 52;
	for ( var i = 0; i < 52; i++ ) {
		if ( document.getElementById("hideBlack" + i) ) {
			document.getElementById("hideBlack" + i).style.display = "none";
		}
	}
}

function showBlacks() {
	// shows all graphics that are mostly black
	//alert("unhiding dark graphics");
	var totalGraphics = 52;
	for ( var i = 0; i < 52; i++ ) {
		if ( document.getElementById("hideBlack" + i) ) {
			document.getElementById("hideBlack" + i).style.display = "";
		}
	}
}

function hideLights() {
	// if light background is chosen, this hides all 
	// graphics that are mostly light. These
	// will be invisible on a light background anyway
	//alert("hiding dark graphics");
	var totalGraphics = 52;
	for ( var i = 0; i < 52; i++ ) {
		if ( document.getElementById("hideLight" + i) ) {
			document.getElementById("hideLight" + i).style.display = "none";
		}
	}
}

function showLights() {
	// shows all graphics that are mostly light
	//alert("unhiding dark graphics");
	var totalGraphics = 52;
	for ( var i = 0; i < 52; i++ ) {
		if ( document.getElementById("hideLight" + i) ) {
			document.getElementById("hideLight" + i).style.display = "";
		}
	}
}
