// Javascript for popups 

var prices      = new Array(75, 150, 295);
/*var shiprates = new Array(10, 15, 18);*/

var sizes = new Array( ['8.5"x11"','11"x14"'], ['13"x19"','16"x24"'], ['17"x24"','24"x30"'] );

function closepopup(pid)
{
	window.close();
}

function ValidateForm(formname)
{
	var the_radios = formname.os0;
	var current_button = null;
	if (the_radios)
	{
		for (i=0; i < the_radios.length; i++)
		{
			current_button = the_radios[i];
			if (current_button.checked)
			{
				var size_code = current_button.value;
				if (size_code == 'A')
				{
					/*SetPrices(formname, prices[0], shiprates[0]);*/		
					SetPrices(formname, prices[0]);		
				}
				else if (size_code == 'B')
				{
					/*SetPrices(formname, prices[1], shiprates[1]);*/		
					SetPrices(formname, prices[1]);		
				}
				else if (size_code == 'C')
				{
					/*SetPrices(formname, prices[2], shiprates[2]);*/		
					SetPrices(formname, prices[2]);		
				}
				else   /*  change this if more than 4 prices */
				{
					/*SetPrices(formname, prices[3], shiprates[3]);*/		
					SetPrices(formname, prices[3]);		
				}
			}
		}
		return true;
	}
	else
	{
		/*alert("Error: Could not find form elements....");*/
		return false;
	}
}

function SetPrices(formname, price)
{
	formname.amount.value = price;
	/*formname.shipping.value = shiprate;*/			
	/*formname.shipping2.value = shiprate;*/			
}

function ValidateCustomPayment(formname)
{
	var the_price = formname.os0.value;
	var the_desc =  formname.ox0.value;
	formname.amount.value = price;
	formname.item_name.value = the_desc;
	return true;
}

function viewcart()
{
	document.viewcart.submit();
}

