<!--
function jsopen(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=500');");
}
function fnd(n, d) 
{ 
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=fnd(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function tNv() 
{ 
	var i,p,v,obj,args=tNv.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=fnd(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function hde() {
 tNv('ddl-pws','','hide');
 tNv('ddl-nat','','hide');
}

function hideDD(sect) 
{
	tNv(sect,'','hide');
	hde();
}

var sectionSetting = null;
var activeTimer = null;
var bHover = '';
function Act(sect, windowStatusVal, bshow) 
{
	hde();
	if ((bHover==windowStatusVal)||(bshow))
	{
		tNv(sect,'','show');
		if (sectionSetting != null)
		{
			window.clearTimeout(sectionSetting);
		}
	}
}

function Tim(sect){
	if (sectionSetting != null){
		window.clearTimeout(sectionSetting);
	}
	sectionSetting = window.setTimeout('hideDD("' + sect + '")',500);
}
function emptylfi($var){
	if ($var == 1 && document.label.line1.value == "Line 1"){
		document.label.line1.value = "";
	}
	if ($var == 2 && document.label.line2.value == "Line 2"){
		document.label.line2.value = "";
	}
	if ($var == 3 && document.label.line3.value == "Line 3"){
		document.label.line3.value = "";
	}
	if ($var == 4 && document.label.line4.value == "Line 4"){
		document.label.line4.value = "";
	}
}

function submitform() {
	document.paypalform.submit();
}

function setcheckedvalue(radioobj, newvalue) {
	if(!radioobj)
		return;
	var radiolength = radioobj.length;
	if(radiolength == undefined) {
		radioobj.checked = (radioobj.value == newvalue.toString());
		return;
	}
	for(var i = 0; i < radiolength; i++) {
		radioobj[i].checked = false;
		if(radioobj[i].value == newvalue.toString()) {
			radioobj[i].checked = true;
		}
	}
}

function omni_wine_collection_select(mode){
	switch(mode){
		case 'most_popular': 
			show('omni_most_popular');
			hide('omni_dry_white');
			hide('omni_medium_white');
			hide('omni_dry_red');
			hide('omni_rose');
		break;
		case 'dry_white':
			hide('omni_most_popular');
			show('omni_dry_white');
			hide('omni_medium_white');
			hide('omni_dry_red');
			hide('omni_rose');
		break;
		case 'medium_white':
			hide('omni_most_popular');
			hide('omni_dry_white');
			show('omni_medium_white');
			hide('omni_dry_red');
			hide('omni_rose');
		break;
		case 'dry_red':
			hide('omni_most_popular');
			hide('omni_dry_white');
			hide('omni_medium_white');
			show('omni_dry_red');
			hide('omni_rose');
		break;
		case 'rose':
			hide('omni_most_popular');
			hide('omni_dry_white');
			hide('omni_medium_white');
			hide('omni_dry_red');
			show('omni_rose');
		break;
		case 'champagne': 
			show('omni_champagne');
			hide('omni_tas_valley');
		break;
		case 'tas_valley': 
			hide('omni_champagne');
			show('omni_tas_valley');
		break;
	}
}

function omni_label_collection_select(mode){
	switch(mode){
		case 'wedding': 
			show('omni_wedding');
			hide('omni_birthday');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'birthday':
			hide('omni_wedding');
			show('omni_birthday');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'christmas':
			hide('omni_wedding');
			hide('omni_birthday');
			show('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'corporate':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_christmas');
			show('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'with_love':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_christmas');
			hide('omni_corporate');
			show('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'mother_s_day':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			show('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'father_s_day':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			show('omni_father_s_day');
		break;
	}
}

function pws_label_collection_select(mode){
	switch(mode){
		case 'wedding': 
			show('omni_wedding');
			hide('omni_birthday');
			hide('omni_anniversary');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'birthday':
			hide('omni_wedding');
			show('omni_birthday');
			hide('omni_anniversary');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'anniversary':
			hide('omni_wedding');
			hide('omni_birthday');
			show('omni_anniversary');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'christmas':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_anniversary');
			show('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'corporate':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_anniversary');
			hide('omni_christmas');
			show('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'with_love':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_anniversary');
			hide('omni_christmas');
			hide('omni_corporate');
			show('omni_with_love');
			hide('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'mother_s_day':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_anniversary');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			show('omni_mother_s_day');
			hide('omni_father_s_day');
		break;
		case 'father_s_day':
			hide('omni_wedding');
			hide('omni_birthday');
			hide('omni_anniversary');
			hide('omni_christmas');
			hide('omni_corporate');
			hide('omni_with_love');
			hide('omni_mother_s_day');
			show('omni_father_s_day');
		break;
	}
}

function pws_pb_collection_select(mode){
	switch(mode){
		case 'single_bottle_boxes':
			show('omni_single_bottle_boxes');
			hide('omni_two_bottle_boxes');
			hide('omni_three_bottle_cartons');
			hide('omni_private_preserve');
		break;
		case 'two_bottle_boxes':
			hide('omni_single_bottle_boxes');
			show('omni_two_bottle_boxes');
			hide('omni_three_bottle_cartons');
			hide('omni_private_preserve');

		break;
		case 'three_bottle_cartons':
			hide('omni_single_bottle_boxes');
			hide('omni_two_bottle_boxes');
			show('omni_three_bottle_cartons');
			hide('omni_private_preserve');

		break;
		case 'private_preserve':
			hide('omni_single_bottle_boxes');
			hide('omni_two_bottle_boxes');
			hide('omni_three_bottle_cartons');
			show('omni_private_preserve');
		break;
	}
}

function show(id){
	if (document.getElementById){
		obj = document.getElementById(id);
		obj.style.visibility = 'visible';
		obj.style.display = '';
	}	
}

function hide(id){
	if (document.getElementById){
		obj = document.getElementById(id);
		obj.style.visibility = 'hidden';
		obj.style.display = 'none';
	}	
}

function checkout_deliver(){
	show('checkout_delivery');
	show('checkout_contactname_info');
	document.checkout_form.delivery_name.value = "";
	document.checkout_form.delivery_address1.value = "";
	document.checkout_form.delivery_address2.value = "";
	document.checkout_form.delivery_address3.value = "";
	document.checkout_form.delivery_postcode.value = "";
}

function checkout_collect(){
	hide('checkout_delivery');
	hide('checkout_contactname_info');
	document.checkout_form.delivery_name.value = "Collect from vineyard";
	document.checkout_form.delivery_address1.value = "Collect from vineyard";
	document.checkout_form.delivery_address2.value = "Collect from vineyard";
	document.checkout_form.delivery_address3.value = "Collect from vineyard";
	document.checkout_form.delivery_postcode.value = "NR16 1LW";
}

function checkout_cardM_deliver(){
	show('checkout_delivery');
	
//	objDeliveryName=document.getElementById('delivery_name');
//	if (objDeliveryName == 'Collect from vineyard'){
		document.checkout_form.delivery_name.value = "";
//	}
//	objAddress1=document.getElementById('delivery_address1');
//	if (objAddress1 == 'Collect from vineyard'){
		document.checkout_form.delivery_address1.value = "";
//	}
//	objAddress2=document.getElementById('delivery_address2');
//	if (objAddress2 == 'Collect from vineyard'){
		document.checkout_form.delivery_address2.value = "";
//	}
//	objAddress3=document.getElementById('delivery_address3');
//	if (objAddress3 == 'Collect from vineyard'){
		document.checkout_form.delivery_address3.value = "";
//	}
//	objPostcode=document.getElementById('delivery_postcode');
//	if (objPostcode == 'NR16 1LW'){
		document.checkout_form.delivery_postcode.value = "";
//	}
}

function checkout_cardM_collect(){
	hide('checkout_delivery');
	document.checkout_form.delivery_name.value = "Collect from vineyard";
	document.checkout_form.delivery_address1.value = "Collect from vineyard";
	document.checkout_form.delivery_address2.value = "Collect from vineyard";
	document.checkout_form.delivery_address3.value = "Collect from vineyard";
	document.checkout_form.delivery_postcode.value = "NR16 1LW";
}
function checkoutShowHide(){
	objIsUserLoggedIn=document.getElementById('isUserLoggedIn');
	var isUserLoggedIn = objIsUserLoggedIn.value;
	if (isUserLoggedIn == 1){
		document.getElementById('delivery_select').style.visibility='visible';
		document.getElementById('delivery_select').style.display='block';	
		document.getElementById('billing_select').style.visibility='visible';
		document.getElementById('billing_select').style.display='block';	
	} else {
		document.getElementById('delivery_select').style.visibility='hidden';
		document.getElementById('delivery_select').style.display='none';	
		document.getElementById('billing_select').style.visibility='hidden';
		document.getElementById('billing_select').style.display='none';	
	}
	objDeliveryAddress=document.getElementById('deliveryAddress');
	var deliveryAddress = objDeliveryAddress.value;
	if (deliveryAddress == 0){
		document.getElementById('delivery_new').style.visibility='visible';
		document.getElementById('delivery_new').style.display='block';	
	} else {
		document.getElementById('delivery_new').style.visibility='hidden';
		document.getElementById('delivery_new').style.display='none';	
	}
	objBillingAddress=document.getElementById('billingAddress');
	var billingAddress = objBillingAddress.value;
	if (billingAddress == 0){
		document.getElementById('billing_new').style.visibility='visible';
		document.getElementById('billing_new').style.display='block';	
	} else {
		document.getElementById('billing_new').style.visibility='hidden';
		document.getElementById('billing_new').style.display='none';	
	}
}
// -->