function openWin(url,w,h,s){
	var l=(screen.width-w)/2;
	var t=(screen.height-h)/2;

	if(window.thiswin != undefined){
		thiswin.close();
	}
	thiswin = window.open(url,"popupwin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+s+',resizable=0,width='+w+',height='+h+',left='+l+',top='+t);
}

function changeColour(colour,colour_url){
	document.getElementById("img_tee").className="dtimg dtimg-tee colour-"+colour;
	document.getElementById("img_detail").className="dtimg dtimg-dt colour-"+colour;
	//document.getElementById("buyurlcolour").value="?body_color="+colour_url;
	//document.getElementById("buycolour").value=colour;
	//document.getElementById("sizeurl").href="http://www.redbubble.com/products/configure/"+document.getElementById("prodid").value+"?body_color="+colour_url+"#product-info";
	document.getElementById("buyurl").href = "/buy-tshirt.php?id="+document.getElementById("teeid").value+"&colour="+colour+"&urlcolour="+colour_url;
}

function formFocus(id,action){
	if(document.getElementById(id)){
		if(action == 1){
			document.getElementById(id).className="field-sel";
		}else{
			document.getElementById(id).className="field-norm";
		}
	}
}

function sendMessage(){
	document.forms.contactForm.submit();
}

function loadItem(id){
	if(document.getElementById("load"+id)){
		Effect.Fade('load'+id, { duration: 1.0 });
		id++;
		setTimeout("loadItem("+id+");", 150);
	}
}

function addLoad(id){
	if(document.getElementById("addload"+id)){
		Effect.Fade('addload'+id, { duration: 1.0 });
		id++;
		setTimeout("addLoad("+id+");", 150);
	}
}

/*function buyTee(){
 	var buyurl = document.getElementById("buyurl").value;
 	var buyurlcolour = document.getElementById("buyurlcolour").value;
	document.forms.buyForm.action="http://www.redbubble.com/settings/currency?return_to="+buyurl+buyurlcolour;
	document.forms.buyForm.submit();

	var buyid = document.getElementById("buyid").value;
	var buycolour = document.getElementById("buycolour").value;
	frames["buyframe"].location.href = "/buy-tshirt.php?id="+buyid+"&colour="+buycolour;
}*/
