
  
    function addQuotation( lang, item_display )
				{
					
					switch( lang )
					{
						case 'en':
						 alert("Your items are added to the system!");
						break;
					}					
					document.frm_items.action.value='add';			
					document.frm_items.item_display.value=item_display;			
				}



    function sendQuotation( lang )
				{
					
					switch( lang )
					{
						case 'en':
						break;
					}					
					document.all.action.value='send';			
				}





    function check_public_quotation( lang )
				{		
				/*
				 if ( document.frm_public_info.company_name.value == "" )
					{
						alert("You must enter the Company Name!");
						document.frm_public_info.company_name.focus();
						return false;
					}		
					
				 if ( document.frm_public_info.contact.value == "" )
					{
						alert("You must enter the Contact!");
						document.frm_public_info.contact.focus();
						return false;
					}		
					
				 if ( document.frm_public_info.tel.value == "" )
					{
						alert("You must enter the Telephone Number!");
						document.frm_public_info.tel.focus();
						return false;
					}		
					
				 if ( document.frm_public_info.fax.value == "" )
					{
						alert("You must enter the Fax Number!");
						document.frm_public_info.fax.focus();
						return false;
					}		
					
				 if ( document.frm_public_info.email.value == "" )
					{
						alert("You must enter the Email Address!");
						document.frm_public_info.email.focus();
						return false;
					}		
					
				 if ( document.frm_public_info.address_1.value == "" )
					{
						alert("You must enter the Address!");
						document.frm_public_info.address_1.focus();
						return false;
					}		
					
					if ( document.frm_public_info.state.options.length > 2 )
					{
						if ( document.frm_public_info.state.value == "" )
						{
							alert("You must enter the State!");
							document.frm_public_info.state.focus();
							return false;
						}	
					}
					
				 if ( document.frm_public_info.city.value == "" )
					{
						alert("You must enter the City!");
						document.frm_public_info.city.focus();
						return false;
					}		
					
				 if ( document.frm_public_info.zipcode.value == "" )
					{
						alert("You must enter the Zipcode!");
						document.frm_public_info.zipcode.focus();
						return false;
					}		
					
					
					if ( document.frm_public_info.state.options.length <= 2 )
					{
							alert("You must choose a dealer!");
							document.frm_public_info.choose_dealer.focus();
							return false;
					}
					else
					{
						if ( document.frm_public_info.choose_dealer.value == "" )
						{
							alert("You must choose a dealer!");
							document.frm_public_info.choose_dealer.focus();
							return false;
						}	
					}
					*/
					alert("Your Quotation Request has been sent to the dealer!");
					document.frm_public_info.save.value = '1';
					return true;
				
				}




    function dealer_check_step1( lang )
				{
					/*
					if ( document.frm_dealer_application.irs.value == "" )
					{
						alert("You must enter the IRS #!");
						document.frm_dealer_application.irs.focus();
						return false;
					}		
					
					if ( document.frm_dealer_application.company_name.value == "" )
					{
						alert("You must enter the Company Name!");
						document.frm_dealer_application.company_name.focus();
						return false;
					}
					*/
					document.getElementById('step1').style.display='none';
					document.getElementById('step2').style.display='';
					
				}
				
				
				
				function dealer_check_step2( lang )
				{
					/*
					if ( document.frm_dealer_application.shipping_address_1.value == "" )
					{
						alert("You must enter the Shipping Address!");
						document.frm_dealer_application.shipping_address_1.focus();
						return false;
					}				
				 					
					if ( document.frm_dealer_application.shipping_country.value == "" )
					{
						alert("You must enter the Shipping Country!");
						document.frm_dealer_application.shipping_country.focus();
						return false;
					}	
					if ( document.frm_dealer_application.shipping_state.options.length > 2 )
					{
						if ( document.frm_dealer_application.shipping_state.value == "" )
						{
							alert("You must enter the Shipping State!");
							document.frm_dealer_application.shipping_state.focus();
							return false;
						}	
					}
					if ( document.frm_dealer_application.shipping_city.value == "" )
					{
						alert("You must enter the Shipping City!");
						document.frm_dealer_application.shipping_city.focus();
						return false;
					}	
										
					if ( document.frm_dealer_application.shipping_zipcode.value == "" )
					{
						alert("You must enter the Shipping Postal Code!");
						document.frm_dealer_application.shipping_zipcode.focus();
						return false;
					}	
					*/
					document.getElementById('step2').style.display='none';
					document.getElementById('step3').style.display='';
					
				}
				
				
				function dealer_check_step3( lang )
				{
					
					document.getElementById('step3').style.display='none';
					document.getElementById('step4').style.display='';
					
				}
				
				
    
				function dealer_check_step4( lang )
				{					
					
		 		if ( document.frm_dealer_application.acc_name.value == "" )
					{
						alert("You must enter an account name!");
						document.frm_dealer_application.acc_name.focus();
						return false;
					}
					
		 		if ( document.frm_dealer_application.unique_acc_name.value == "" )
					{
						alert("The account name is not available, please enter a new account name!");
						document.frm_dealer_application.acc_name.focus();
						return false;
					}
					
					
		 		if ( document.frm_dealer_application.acc_pwd.value == "" )
					{
						alert("You must enter an account password!");
						document.frm_dealer_application.acc_pwd.focus();
						return false;
					}
					
		 		if ( document.frm_dealer_application.retype_pwd.value == "" )
					{
						alert("You must re-type then account password!");
						document.frm_dealer_application.retype_pwd.focus();
						return false;
					}
					
					
		 		if ( document.frm_dealer_application.retype_pwd.value != document.frm_dealer_application.acc_pwd.value )
					{
						alert("The password you re-typed is not identical to the account password!");
						document.frm_dealer_application.retype_pwd.focus();
						return false;
					}
					
					alert("Your Dealer Application has been sent!");
					document.frm_dealer_application.save.value='1';
				 return true;
				}
    
				
				
				function dealer_back_step1()
				{
					
					document.getElementById('step2').style.display='none';
					document.getElementById('step1').style.display='';
				}
				function dealer_back_step2()
				{
					
					document.getElementById('step3').style.display='none';
					document.getElementById('step2').style.display='';
				}
				function dealer_back_step3()
				{
					
					document.getElementById('step4').style.display='none';
					document.getElementById('step3').style.display='';
				}



		
		
		
		
		
		
  		function check_dealer_profile( lang )
				{	
					
					/*
		 		if ( document.frm_dealer_application.acc_name.value == "" )
					{
						alert("You must enter an account name!");
						document.frm_dealer_application.acc_name.focus();
						return false;
					}
					
		 		if ( document.frm_dealer_application.unique_acc_name.value == "" )
					{
						alert("The account name is not available, please enter a new account name!");
						document.frm_dealer_application.acc_name.focus();
						return false;
					}
					
		 		if ( document.frm_dealer_application.acc_name.value.length < 6 )
					{
						alert("The account name must be between 6 and 20 characters!");
						document.frm_dealer_application.acc_name.focus();
						return false;
					}
					
					
		 		if ( document.frm_dealer_application.acc_pwd.value == "" )
					{
						alert("You must enter an account password!");
						document.frm_dealer_application.acc_pwd.focus();
						return false;
					}
					
					
		 		if ( document.frm_dealer_application.acc_pwd.value.length < 6 )
					{
						alert("The account name must be between 6 and 20 characters!");
						document.frm_dealer_application.acc_pwd.focus();
						return false;
					}
					
		 		if ( document.frm_dealer_application.retype_pwd.value == "" )
					{
						alert("You must re-type then account password!");
						document.frm_dealer_application.retype_pwd.focus();
						return false;
					}
					
					
		 		if ( document.frm_dealer_application.retype_pwd.value != document.frm_dealer_application.acc_pwd.value )
					{
						alert("The password you re-typed is not identical to the account password!");
						document.frm_dealer_application.retype_pwd.focus();
						return false;
					}
					*/
					document.frm_dealer_application.save.value='1';
				 return true;
				}
    
		
		
		
		
		
		function dealer_login( lang )
		{
			if ( document.frm_dealer_login.username.value == "" )
			{
				document.frm_dealer_login.username.focus();
				return false;
			}
			if ( document.frm_dealer_login.userpwd.value == "" )
			{
				document.frm_dealer_login.userpwd.focus();
				return false;
			}
			return true;
		}
		
		
		
		
		
		function verify_item()
		{			
			
			document.form1.save.value ='1';
		}
		
		
		
		
		function delete_item()
		{			
			answer = confirm("Are you sure you want to delete this record?");	
			
			if ( answer == null )
			{
				return false;
			}
			
			if ( answer == false )
			{
				return false;
			}
			document.form1.action.value ='delete';
			document.form1.del.value ='1';
		}
		
		
				
				
		function delete_advertisement()
		{			
			answer = confirm("Are you sure you want to delete this record?");	
			
			if ( answer == null )
			{
				return false;
			}
			
			if ( answer == false )
			{
				return false;
			}
			document.form1.action.value ='delete';
			document.form1.del.value ='1';
		}
				
		
		
		function show_dealer_row( id )
		{
			if ( document.frm_find_dealer.last_open.value != "" )
			{
			 document.getElementById('full_info_'+document.frm_find_dealer.last_open.value).style.display='none';
			}
			if ( document.frm_find_dealer.last_open.value != id )
			{
			 document.getElementById('full_info_' + id).style.display='';
			 document.frm_find_dealer.last_open.value=id;
			}
			else
			{
			 document.frm_find_dealer.last_open.value="";
			}
		}
		
		
		
		
		
		
		
		function isEmail(str) {
  // are regular expressions supported?
				var supported = 0;
				if (window.RegExp) {
						var tempStr = "a";
						var tempReg = new RegExp(tempStr);
						if (tempReg.test(tempStr)) supported = 1;
				}
				if (!supported) 
						return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
				var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
				var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
				return (!r1.test(str) && r2.test(str));
  }
		
		
  
		
		
		
  function save_plan( edit, lang )
		{
			document.boothPlan.save_booths( edit, lang );			
		}	
		
		function add_booths( addBooth, lang )
		{
			if ( isNaN(addBooth) )
	  {
		  if ( lang.toLowerCase() == "fr" )
				{
					alert("Vous devez renseigné le Nombre de Kiosques à ajouter!");
				}
				else
				{
					alert("You must enter the quantity of Booths to add!");
				}		
			}
			else
			{				
			 document.boothPlan.add_new_booth( addBooth );			
			}
		}
	 
		function del_booth( delBooth, lang )
		{
		 if ( delBooth == "" )
	  {
		  if ( lang.toLowerCase() == "fr" )
				{
					alert("Vous devez renseigné le # du Kiosque!");
				}
				else
				{
					alert("You must enter the Booth #!");
				}		
			}
			else
			{				
			 document.form1.delBooth.value="";
			 document.boothPlan.del_booth( delBooth );			
			}
		}
		
		
function validateEmail(msg, theform) {
	
	var emailReg = /^[a-z][a-z-_0-9\.]+@[a-z-_=>0-9\.]+\.[a-z]{2,3}$/i
		
	if (emailReg.test(theform.Email.value) == false)
	{
		alert(msg);
		theform.Email.focus();
		return false;
	}	
	else
	{
		theform.submit();
	}
	
}	
