// Swap panes on front page
function swapDiv(strName) {
	hideDiv('frontPane1');
	hideDiv('frontPane2');
	hideDiv('frontPane3');
	hideDiv('frontPane4');
	hideDiv('frontPane5');
	hideDiv('frontPane6');
	hideDiv('selected1');
	hideDiv('selected2');
	hideDiv('selected3');
	hideDiv('selected4');
	hideDiv('selected5');
	hideDiv('selected6');
	strDiv = "frontPane" + strName;
	strButton = "selected" + strName;
	showDiv(strButton);
	showDiv(strDiv);
}

// Show passed DIV
function showDiv(layer_ref){
	hza2 = document.getElementById(layer_ref);
	state = 'inline';

	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
	}
	
}

// Hide passed DIV
function hideDiv(layer_ref) {
	hza2 = document.getElementById(layer_ref);
	state = 'none';

	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
	}
}

// Show passed colour box on front page
function showColour(strName) {
	hideDiv('purple');
	hideDiv('blue');
	hideDiv('green');
	hideDiv('yellow');
	hideDiv('orange');
	hideDiv('red');
	hideDiv('white');
	hideDiv('beige');
	hideDiv('grey');
	hideDiv('brown');
	hideDiv('black');
	showDiv(strName);
	showDiv('resetcolour');
	document.findRug.rugColour.value = "colour:" + strName;
}

// Reset colour box on front page
function resetColour() {
	showDiv('purple');
	showDiv('blue');
	showDiv('green');
	showDiv('yellow');
	showDiv('orange');
	showDiv('red');
	showDiv('white');
	showDiv('beige');
	showDiv('grey');
	showDiv('brown');
	showDiv('black');
	hideDiv('resetcolour');
	document.findRug.rugColour.value = "";
}

// Show passed shape box on front page
function showShape(strName) {
	hideDiv('square');
	hideDiv('rectangle');
	hideDiv('circle');
	hideDiv('scolloped');
	hideDiv('octagonal');
	hideDiv('runner');
	showDiv(strName);
	showDiv('resetshape');
	document.findRug.rugShape.value = "shape:" + strName;
}

// Reset shape box on front page
function resetShape() {
	showDiv('square');
	showDiv('rectangle');
	showDiv('circle');
	showDiv('scolloped');
	showDiv('octagonal');
	showDiv('runner');
	hideDiv('resetshape');
	document.findRug.rugShape.value = "";
}
