/**

	Clothing page Javascript - mostly used to get the handles on jquery stuff
	
	author:	Andrew Fisher (andrew.fisher@xmlinfinity.com)
	version:	0.1
	
**/

function ChangeColour(themenu, idcode) {
	// this function changes colour.
	//alert(themenu.selectedIndex);
	
	// switch off all items
	$("div#" + idcode + " a.gallink").addClass("off");
	$("div#" + idcode + " select.sizes").addClass("off");
	
	// switch on just the ones we need.
	//alert("div.product select#sizes_" + idcode + "_" + themenu.selectedIndex);
	$("div.product select#sizes_" + idcode + "_" + themenu.selectedIndex).removeClass("off");
	$("div.product a#gallink_" + idcode + "_" + themenu.selectedIndex).removeClass("off");
	
}

function UpdateProdCode(themenu, idcode) {
	// this function takes the menu item for the size and colour and changes the buy link to the right one.
	
	//alert(themenu.options[themenu.selectedIndex].value);
	//alert(idcode);
	thelink = $("a#cartlink_" + idcode);
	//alert(thelink.attr("href"));
	newlink = thisPage + "?add=" + themenu.options[themenu.selectedIndex].value
	//alert(newlink);
	thelink.attr("href", newlink)

}
