function order_product(idp) {
	if ($val('quantity_'+idp)=='') {
		alert('Please type the quantity!');
	} else {
		window.location='order-'+eurl(idp)+'-'+eurl($val('quantity_'+idp))+'.html';
	}
}
function copyBillingAddress(value) {
	if (value.checked) {
		$v('shippingAddress',$val('billingAddress'));
		$v('shippingZipCode',$val('billingZipCode'));
		$v('shippingCity',$val('billingCity'));
		$v('shippingCounty',$val('billingCounty'));
		$v('shippingCountry',$val('billingCountry'));
	} else {
		$v('shippingAddress','');
		$v('shippingZipCode','');
		$v('shippingCity','');
		$v('shippingCounty','');
		$v('shippingCountry','');
	}
}
function buy(idp,quantInput) {
	if ($val(quantInput)<1) {
		alert('Quantity must be at least 1 unit!');
	} else {
		window.location=window.siteurl+'cart.html?id='+idp+'&oper=add&quant='+eurl($val(quantInput));
	}
}
function refreshShopcart() {
	if (document.getElementById('divBoxShopcart')) {
		var trim2='';
		trim2+='oper=ajax';
		EjaxCb(window.siteurl+'includes/ajax_php/shopcart_box.php',trim2,'',function (r) {
			$html('divBoxShopcart',r);
		});
	}
}
function shopcart(type,val,val2) {
	if (type=='add') {
		var trim='';
		trim+='type='+type;
		trim+='&id='+val;
		trim+='&quant='+val2;
		Ejax(window.siteurl+'includes/ajax_php/shopcart.php',trim,'divShopcart');
	}
	if (type=='del') {
		if ($val('quantity_'+val)==1) {
			if (confirm('Are you sure you want to delete this product?')) {
				var trim='';
				trim+='type='+type;
				trim+='&id='+val;
				trim+='&quant='+val2;
				Ejax(window.siteurl+'includes/ajax_php/shopcart.php',trim,'divShopcart');
			}
		} else {
			var trim='';
			trim+='type='+type;
			trim+='&id='+val;
			trim+='&quant='+val2;
			Ejax(window.siteurl+'includes/ajax_php/shopcart.php',trim,'divShopcart');
		}
	}
}
function webshop_product_operation(type,val,val2) {
	if (type=='winVideoOpen') {
		var trim='';
		trim+='id='+val;
		trim+='&idf='+val2;
		AjaxW(trim,window.siteurl+'includes/windows/win_product_video.php','product_video','Product Video',450,350,0,0,1);
	}
}