window.onload = function() 
{
	var c_form = document.getElementById('reqform');
	var pp = document.getElementById('paymentmethod_paypal');
	var url = document.location.href;
	if( url.indexOf( 'act=cart&do=checkout' ) != -1 )
	{
		if( c_form && typeof c_form != 'undefined' && pp && typeof pp != 'undefined' )
		{
			c_form.onsubmit = function()
			{
				if (! validatePaymentDetails()) { return false; }
				if( pp.checked )
				{
					c_form.method = 'get';
				}
			};
		}
	}
}
