function openwin( url, target, width, height )
{
	var left = ( screen.availWidth - width ) / 2;
	var top = ( screen.availHeight - height ) / 2;

	var args = 'top=' + top + ', left=' + left + 
				', height=' + height + ', width=' + width +
				', menubar=0,toolbar=0,location=0, resizable=no, scrollbars=no';

	window.open( url, target, args );
	
}

var text_scale = 1;

function increaseText()
{
	text_scale += 0.2;
	document.getElementById('body').style.fontSize = text_scale + 'em';
}

function decreaseText()
{
	text_scale -= 0.2;
	document.getElementById('body').style.fontSize = text_scale + 'em';
}

function setTextSize(size)
{
	document.getElementById('body').style.fontSize = size + 'em';
}


function changeImage(filename)
{
	document.mainimage.src = filename;
}


function OnButton1(form)
{
	form.action = "?action=add";
	//form.target = "add1";	// Open in a new window
	//form.submit();			// Submit the page	// Submit the page
	//return true;
}

function OnButton2(form)
{
	form.action = "?action=addwishlist";
	//form.target = "?action=addwishlist";	// Open in a new window
	//form.submit();			// Submit the page	// Submit the page
	//return true;
}

function update_total_price()
	{
	var price = parseFloat(document.checkout.subtotal.value);
	var freight = parseFloat(document.checkout.freight.value);
	var new_price = price + freight;
	
	document.checkout.total.value = new_price;
	}
