	function resetwines(){
			document.asearch.svalue.value='';
			document.asearch.ProducerID.value='';
			document.asearch.TypeID.value='';
			document.asearch.CountryID.value='';
			document.asearch.VarietalID.value='';
			document.asearch.RegionID.value='';
			document.asearch.PriceRangeID.value='';
			document.asearch.VintageYear.value='';
			document.asearch.RatingType.value='';
				}
				
	function chkwines(){
			if ((document.asearch.svalue.value=='')&(document.asearch.ProducerID.value=='')&(document.asearch.CountryID.value=='')&(document.asearch.TypeID.value=='')&(document.asearch.VarietalID.value=='')&(document.asearch.RegionID.value=='')&(document.asearch.PriceRangeID.value=='')&(document.asearch.VintageYear.value=='')&(document.asearch.RatingType.value=='')){
				window.alert('Please enter some sort of search criteria.');
				return false;
					}
				}

	function resetspirits(){
			document.asearch.svalue.value='';
			document.asearch.TypeID.value='';
			document.asearch.CountryID.value='';
				}
	
	function chkspirits(){
			if ((document.asearch.svalue.value=='')&(document.asearch.TypeID.value=='')&(document.asearch.CountryID.value=='')){
				window.alert('Please enter some sort of search criteria.');
				return false;
					}
				}
			
	function resetbeers(){
			document.asearch.svalue.value='';
			document.asearch.TypeID.value='';
			document.asearch.CountryID.value='';
			
				}
				
	function chkbeers(){
			if ((document.asearch.svalue.value=='')&(document.asearch.TypeID.value=='')&(document.asearch.CountryID.value=='')){
				window.alert('Please enter some sort of search criteria.');
				return false;
					}
				}
	
	function resetcigars(){
			document.asearch.svalue.value='';
			// document.asearch.ProducerID.value='';
			document.asearch.CountryID.value='';
			document.asearch.ShapeID.value='';
			document.asearch.StrengthID.value='';
			document.asearch.WrapperID.value='';
			document.asearch.PriceRangeID.value='';
				}
	
	function shipsame(){
			if(document.checkoutlogin.shipsameas.checked == true)
			{
			document.checkoutlogin.Ship_Name.value = document.checkoutlogin.Account_FirstName.value + " " + document.checkoutlogin.Account_LastName.value;
			// document.checkoutlogin.Ship_LastName.value = document.checkoutlogin.Account_LastName.value;
			document.checkoutlogin.Ship_Address1.value = document.checkoutlogin.Account_Address1.value;
			document.checkoutlogin.Ship_Address2.value = document.checkoutlogin.Account_Address2.value;
			document.checkoutlogin.Ship_City.value = document.checkoutlogin.Account_City.value;
			document.checkoutlogin.Ship_FK_StateID.value = document.checkoutlogin.Account_FK_StateID.value;
			document.checkoutlogin.Ship_State_Other.value = document.checkoutlogin.Account_State_Other.value;
			document.checkoutlogin.Ship_FK_CountryID.value = document.checkoutlogin.Account_FK_CountryID.value;
			document.checkoutlogin.Ship_Zip.value = document.checkoutlogin.Account_Zip.value;
			document.checkoutlogin.Ship_Phone.value = document.checkoutlogin.Account_DayPhone.value;
			
			}
				}
	
	function chkcigars(){
			if ((document.asearch.svalue.value=='')&(document.asearch.CountryID.value=='')&(document.asearch.ShapeID.value=='')&(document.asearch.StrengthID.value=='')&(document.asearch.WrapperID.value=='')&(document.asearch.PriceRangeID.value=='')){
				window.alert('Please enter some sort of search criteria.');
				return false;
					}
				}
				//&(document.asearch.ProducerID.value=='')	
	function resetgifts(){
			document.asearch.svalue.value='';
			document.asearch.GiftsID.value='';
				}
			// &(document.asearch.GiftsID.value=='')
	function chkgifts(){
			if ((document.asearch.svalue.value=='')){
				window.alert('Please enter some sort of search criteria.');
				return false;
					}
				}
	
	var mycallBack = function(){
        document.getElementById("shiptypediv").innerHTML = "<br><br><b>This is printed by the callback handler.</b>";
    } 

	<!--- The error handler pops an alert with the error code and message. --->
    var myerrorhandler = function(errorCode,errorMessage){
        alert("[In Error Handler]" + "\n\n" + "Error Code: " + errorCode + "\n\n" + "Error Message: " + errorMessage);
    } 
	
	
	 //The init function removes the toolbox and makes sure the title is empty       
      var initCFWin = function(cfwinname){
         myWindow = ColdFusion.Window.getWindowObject(cfwinname);
         myWindow.toolbox.remove();
         myWindow.header.remove();
         // myWindow.setTitle('');
      }
		
		
	function errorCatch(cfpname,error){
		
		// day = new Date();
      // var windowID = 'billingBatch' + day.getTime();
      //var windowOptions = new Object();
		  //windowOptions.width = 250;
		  //windowOptions.height = 150;
		  //windowOptions.center = true;
		  //windowOptions.modal = true;
		  //windowOptions.initshow = false;
		  //windowOptions.resizeable = false;
		  //windowOptions.draggable = false;
		  //windowOptions.closeable = false;
		  // windowOptions.headerstyle = 'font-family: verdana; background-color: #0066FF;';
		  //windowOptions.bodystyle = 'border:1px solid #9b3e39;';
			// {x:100,y:100,height:300,width:400,modal:true,closable:false,draggable:false,resizable:false,center:true,initshow:false}
	ColdFusion.Window.create(cfpname,'','/content/error_popup.cfm');
	initCFWin(cfpname);
	// ColdFusion.navigate('/content/error_popup.cfm?error=' + error + '&winname=errorwindow',cfpname);
	ColdFusion.Window.show(cfpname);
	}
	
	var closeErrorWin = function(winname){
		ColdFusion.Window.hide(winname);	
	}
	
	var ShipDisagree = function(){
		window.location.href='/content/noship.cfm?disagree=1';	
	}
	
	function selectship()
			{
			for (var i=0; i < document.selectshipping.shipestselect.length; i++)
			   {
			   if (document.selectshipping.shipestselect[i].checked)
				  {
				  var shiptype = document.selectshipping.shipestselect[i].value;
				  ColdFusion.navigate('/content/shipping/shipselectsource.cfm?stype=ship&shipcalc=true&zip=' + document.selectshipping.zip.value + '&shipupd=1&method=' + shiptype,'shiptypediv');
				  }
			   }
			}
	
	function checkinternational()
		{
			if(document.internationalform.international.checked == true)
				{
					window.location.href='/cart/?international';
				}
			if(document.internationalform.international.checked == false)
				{
					window.location.href='/cart/?toio';
				}
			
			
		}
	
	function internationalValidation()
		{
			if (document.checkoutlogin.International.checked == true)
				{
					window.location.href='/secure/content/checkout_direct.cfm?intbill=1';
				}
			if (document.checkoutlogin.International.checked == false)
				{
					window.location.href='/secure/content/checkout_direct.cfm?intbill=0';
				}
				
		}
		
	
