function ChangeFlow(topage)
{
	document.ShoppingCart.ToPageStatus.value=topage;	
	document.ShoppingCart.submit();

}
function ReCalculateOnCheckOut()
{
	ChangeFlow('check');
	//window.location.href='checkout.php';
}

/* Shipping Address Is Same As Billing Address Starts */
function SameAsAboveClick(sel)
{	
	if (sel.checked) {CheckShipAdd();} else {CheckShipDel();}	
}

function CheckShipAdd()
{		
	document.getElementById("ship_first_name").value=document.getElementById("bill_first_name").value;
	document.getElementById("ship_sur_name").value=document.getElementById("bill_sur_name").value;
	document.getElementById("ship_home_address").value=document.getElementById("bill_home_address").value;
	document.getElementById("ship_city").value=document.getElementById("bill_city").value;
	document.getElementById("ship_state").value=document.getElementById("bill_state").value;
	document.getElementById("ship_postcode").value=document.getElementById("bill_postcode").value;
	document.getElementById("ship_country").value=document.getElementById("bill_country").value;
	document.getElementById("ship_phone").value=document.getElementById("bill_phone").value;	
	document.getElementById("ship_email").value=document.getElementById("bill_email").value;
}
function CheckBillDel()
{	
	document.getElementById("bill_first_name").value="";
	document.getElementById("bill_sur_name").value="";
	document.getElementById("bill_home_address").value="";
	document.getElementById("bill_city").value="";
	document.getElementById("bill_state").value="";
	document.getElementById("bill_postcode").value="";
	document.getElementById("bill_country").value="";
	document.getElementById("bill_phone").value="";	
	document.getElementById("bill_email").value="";
}
function CheckShipDel()
{	
	document.getElementById("ship_first_name").value="";
	document.getElementById("ship_sur_name").value="";
	document.getElementById("ship_home_address").value="";
	document.getElementById("ship_city").value="";
	document.getElementById("ship_state").value="";
	document.getElementById("ship_postcode").value="";
	document.getElementById("ship_country").value="";
	document.getElementById("ship_phone").value="";	
	document.getElementById("ship_email").value="";
}
function ClearAll()
{	
	CheckBillDel();
	window.document.getElementById("same_as_above").checked=false;
	CheckShipDel();
}

function Uncheck()
{
	
	window.document.getElementById("IsSameAsBill").checked=false;
	if(document.getElementById("ShipCountry").value==75)
	{
		document.getElementById("IsleOfMan").style.display='block';
	}
	else
	{
		document.getElementById("IsleOfMan").style.display='none';
	}
}


/* Shipping Address Is Same As Billing Address Starts */

function ShowProductImageLarge(image_path)
{	
	$('ImageLarge').src=image_path;	
}

function removetxt()
{
	if($('SearchText').value=="Search by keywords")
	{
	 	$('SearchText').value="";
	}
}

function puttxt()
{
	if($('SearchText').value=="")
	{
	 	$('SearchText').value="Search by keywords";
	}
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
   //window.resizeTo()
window.open(href, windowname, 'width=500,height=350,scrollbars=yes');
return false;
}

function resize(win,width,height)
{
if (parseInt(navigator.appVersion)>3)
  win.resizeTo(width,height+125);
}


// ===================================================================
// 				New functions [Suman - 31.12.08] [Start]
// ===================================================================

  // Pay by cheque...
	function payByCheque()
	{
		window.location = 'cheque_payment.php';
	}
	
  // Pay by credit-card...
  	function payByCC()
	{
		$j.blockUI({  
            message: '<H4>Please wait, you will be redirected to WorldPay...</H4>',  
			css: { 
					padding:        0,
					margin:         0,
					width:          '40%',
					height:			'5%',
					top:            '40%', 
					left:           '35%', 
					textAlign:      'center',
					verticalAlign:	'middle',
					color:          '#000', 
					border:         '3px solid #aaa',
					backgroundColor:'#fff',
					cursor:         'wait'
				},
			overlayCSS:  { 
					backgroundColor:'#000', 
					opacity:        '0.6' 
				}
        }); 
         
        setTimeout('submitForm()', 4000);
		
	}
	
  // submit the WorldPay hidden form...
  	function submitForm()
	{
		document.confirm_order.submit();
		$j.unblockUI();
	}

// ===================================================================
// 				New functions [Suman - 31.12.08] [End]
// ===================================================================