
function CheckExForm(){

		//Validation of Exhibitor Registration Form
		
		
		var cnt,i,q,chkgrp;
		var exform = document.form1;
		var errs = new Array();
		var emess = "";
		cnt=0;
		var objRegExp = /^\d{3}\-\d{3}\-\d{4}$/;
		var objRegExp1 = /[a-z]/;
		var objRegExp2 = /[0-9]/;
		var objRegExp3 = /\55/;
		var objRegExp4 = /[*&%$#@!`~+=|\{}()]/;
		var errorIndex = 0;
		
		
		if(exform.ex_name.value == "")
			{
				errs[errorIndex++] = "* Exhibitor Name is a required field \n"
			}

		if(exform.address.value == "")
			{
				errs[errorIndex++] = "* Mailing Address is a required field \n"
			}

		if(exform.city.value == "")
			{
				errs[errorIndex++] = "* City is a required field \n"
			}
		
		if(exform.state.value == "")
			{
				errs[errorIndex++] = "* State is a required field \n"
			}
		
		if(exform.zip.value == "")
			{
				errs[errorIndex++] = "* Zip is a required field \n"
			}

		if(exform.phone.value == "")
			{
				errs[errorIndex++] = "* Phone is a required field \n"
			}
		else
		{
			if(exform.country.value == "USA")
			{	
				if(exform.phone.value.search(objRegExp)==-1)
					errs[errorIndex++] = "* Invalid Phone number format \n"
			}
			else if(exform.country.value != "USA")
			{
	
				if(exform.phone.value.search(objRegExp1)!= -1 && exform.phone.value.search(objRegExp4)!= -1 && exform.phone.value.search(objRegExp2)== -1 )
					errs[errorIndex++] = "*Invalid Phone number format \n"
			}
		}
		
		if(exform.sales_contact.value == "")
			{
				errs[errorIndex++] = "* Sales Contact is a required field \n"
			}


		if(false){
			if(exform.fax.value == "")
			{
				errs[errorIndex++] = "* Fax is a required field \n"
			}
		}
			if(exform.fax.value != "" && exform.country.value == "USA")
			{
				
				if(exform.fax.value.search(objRegExp)==-1)
					errs[errorIndex++] = "* Invalid Fax number format \n"
			}
			else if(exform.fax.value != "" && exform.country.value != "USA")
			{
			if(exform.fax.value.search(objRegExp1)!= -1 && exform.fax.value.search(objRegExp4)!= -1 && exform.fax.value.search(objRegExp2)== -1 )
				errs[errorIndex++] = "*Invalid Fax number format \n"
			}


		if(exform.email.value == "")
			{
				errs[errorIndex++] = "* Email is a required field \n"
			}
		else
			{
			if(exform.email.value.indexOf("@") < 0 || exform.email.value.indexOf(".")<0)
				{
				errs[errorIndex++] = "* Invalid Email ID \n"
			 	}
			}


		if(exform.products.value == "")
			{
				errs[errorIndex++] = "* Types of products manufactured is a required field \n"
			}
			
		if(!exform.elements['FirstTimeAttnd'][0].checked && !exform.elements['FirstTimeAttnd'][1].checked )
			{
				errs[errorIndex++] = "* Please indicate whether this is your first time exhibiting at the ABC Show \n"
			}	

		if(exform.ContactPerson.value == "")
			{
				errs[errorIndex++] = "* Contact Person is a required field\n"
			}

		if(exform.ContactPhone.value == "")
			{
				errs[errorIndex++] = "* Contact Phone is a required field \n"
			}
			
		if(exform.ContactEmail.value == "")
			{
				errs[errorIndex++] = "* Contact Email is a required field\n"
			}
		else
			{
			if(exform.ContactEmail.value.indexOf("@") < 0 || exform.ContactEmail.value.indexOf(".")<0)
				{
				errs[errorIndex++] = "* Invalid Contact Email ID\n"
			 	}
			}
			
		//**********Exhibitor Categories
		if	(document.getElementById("1") )
		{
			var i, CategoryCount
			CategoryCount = 0
			for ( i=1; i<=66 ;i++ )
			{
				if( document.getElementById(i).checked )
				{
					CategoryCount++;	
				}
			}
			
			if( CategoryCount == 0)
			{
				errs[errorIndex++] = "* Please select at least one checkbox in the Exhibitor Category\n"
			}
		}

			
		//**********primaryproduct
		var primProdgrp
		var primProdj
		var ppcnt = 0;
		primProdgrp = form1.elements['primaryproduct']
		primProdj = primProdgrp.length;
		do
		{
			if(primProdgrp [--primProdj].checked)
			{		
				ppcnt++
				break;
			}
		}
		while(primProdj)
		
		if(ppcnt == 0)
		{
			errs[errorIndex++]= "* Select indicate Primary Product or Service Category \n"
		}	
		
		//**********Booth Reservation 
		var str=window.location.href;
		
		var echoicegrp;
		var echoicej;
		var eccnt = 0;
		echoicegrp = form1.elements['ExhibitChoice']
		echoicej = echoicegrp.length;
			do
				{
					if(echoicegrp [--echoicej].checked)
					{		
						eccnt++
						break;
					}
				}
			while(echoicej)
				
			if(eccnt == 0)
			{
				errs[errorIndex++]= "* Select appropriate Exhibit Choice \n"
			}	
			else
			{
				if(echoicegrp[0].checked) // Shared Booth
				{	
					if(exform.ShareBoothWith.value == 0)
					{
						errs[errorIndex++]= "* Select Company to share booth with \n"
					}
				}
				else if(echoicegrp[2].checked && str.indexOf("exhibitor2.asp") > 0 ) // Multiple In-Line Exhibit Booths
				{	
					if (exform.boothspace_multi_inline_booth.value == 0 || exform.boothspace_multi_inline_booth.value < 2)
					{
						errs[errorIndex++]= "* A minimum of 2 booths is required for Multiple In-Line Booths \n"
					}
				}

				else if(echoicegrp[3].checked && str.indexOf("exhibitor2.asp") > 0 ) // End Cap/Peninsula
				{
					if(exform.boothspace_end_cap.value == 0 || exform.boothspace_end_cap.value < 2)
					{
						errs[errorIndex++]= "* A minimum of 2 booths is required for End Cap/Peninsula Booths \n"
					}
				}
				/*else if(echoicegrp[4].checked && str.indexOf("exhibitor2.asp") > 0 ) // L-Shaped End Cap/Peninsula
				{
					if(exform.boothspace_L_shaped.value == 0 || exform.boothspace_L_shaped.value < 3)
					{
						errs[errorIndex++]= "* A minimum of 3 booths is required for L-Shaped End Cap/Peninsula Booths \n"
					}
				}*/
				else if(echoicegrp[4].checked && str.indexOf("exhibitor2.asp") > 0 ) // Split Island
				{
					if(exform.boothspace_split_island.value == 0 || exform.boothspace_split_island.value < 4)
					{
						errs[errorIndex++]= "* A minimum of 4 booths is required for Split Island Booths \n"
					}
				}
				else if(echoicegrp[5].checked && str.indexOf("exhibitor2.asp") > 0 ) // Island
				{
					if(exform.boothspace_island.value == 0 || exform.boothspace_island.value < 4)
					{
						errs[errorIndex++]= "* A minimum of 4 booths is required for Island Booths \n"
					}
					
					if( exform.islandwidth.value < 1 || exform.islandwidth.value == "" )
					{
						errs[errorIndex++]= "* Booth Width is required for Island Booths. \n"
					}
					if( exform.islandlength.value < 1 || exform.islandlength.value == "" )
					{
						errs[errorIndex++]= "* Booth Length is required for Island Booths. \n"
					}
				}
			

			}

			
				
		//**************************************************************************			
		
			
		if(exform.Completedby.value == "")
			{
				errs[errorIndex++] = "* Please Indicate who this form was completed by \n"
			}	

		if(errs.length == 0){
			try{
				if(!exform.agreement.checked)
				{	alert("Error : Form will not be submitted if Agreement not checked")
					return false
				}
				else
				{
					var theForm = document.getElementById("exhibitorForm").innerHTML
					document.form1.exhibitorForm.value = theForm.replace(/"/g, "'")
					return true	
				}
			
			}
			catch(e)
			{
				return true			
			}
			
		}
		else 
			{for(i = 0; i <= errs.length; i++)
				if(errs[i] != null)
					{emess += errs[i]}
			
			alert("Error : The form was not submitted due to following errors \n\n"+ emess)
			
			return false
			
			}
		
			
	}
		