function show_hide(o)
{
	if ($(o).style.display == "none") $(o).style.display = "";
	else $(o).style.display = "none";
}

function show_hide_check(to_check, to_hide)
{
	if (to_check.checked) $(to_hide).style.display = "none";
	else $(to_hide).style.display = "";
}

function u(obj_id, price, qty)
{
	tot = price*qty;
	if(obj_id.match(","))
	{
		obj_ids = obj_id.split(",");
		for(var i = 0;i<(obj_ids.length);i++)
		{
			obj = obj_ids[i];
			if(obj == "tax_tot")
			{
				tot = (tot*0.08375).toFixed(2);
				$(obj).innerHTML = tot;
			}
			else $(obj).innerHTML = tot;
		}
	}
	else
	{
		if(obj_id == "don_tot" || obj_id == "del_tot") tot = tot.toFixed(2);
		$(obj_id).innerHTML = tot;
	}
}

function ut()
{
	var sub_tot = new Number($('sub_tot').innerHTML);
	var don_tot = new Number($('don_tot').innerHTML);
	var tax_tot = new Number($('tax_tot').innerHTML);
	tot =  (sub_tot+don_tot+tax_tot).toFixed(2);
	$('amount').innerHTML = tot;
}
function udel(previous_total, opt, qty)
{
	opts = [8,14,26];
	tot = opts[opt-1]*qty;
	$('del_tot').innerHTML = tot.toFixed(2);;
	$('amount').innerHTML = (tot + (previous_total*1)).toFixed(2);
}
function valid(f) {
	if (!/^\d*$/.test(f.value)) {
		f.value = f.value.replace(/[^\d]/g,"");
	}
}
function valid1(f) {
	if (!/^\d\.*$/.test(f.value)) {
		f.value = f.value.replace(/[^\d\.]/g,"");
	}
}
function getWindowHeight() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}
function getScrollY() {
	var scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
	}
	return scrOfY;
}
function enlarge(img,main)
{
	obj = $("enlarge");
	yscroll = getScrollY();
	wHeight = getWindowHeight();
	offset = (wHeight/2)-490+yscroll;
//	alert(offset);
	obj.style.top = offset+"px";
	obj.style.display = "block";
	new_src = img.src.split("/");
	new_src = new_src[new_src.length-1].split(".");
	if(main) new_src = "/images/shop/"+new_src[0]+"_large."+new_src[1];
	else new_src = "/images/products/"+new_src[0]+"_large."+new_src[1];
	$("enlarge_img").src = new_src;
}
function unlarge()
{
	$("enlarge").style.display = "none";
	$("enlarge_img").src = "/images/loading.gif";
}
