/*
	purpose:
		used in the front of the site
	page:
		/budget_buddy/<subdir>/index.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckBudgetBuddyForm(theform)
{
	var submit_form=true;
	var budget_buddy_type=0;
	
	budget_buddy_type=theform.budget_buddy_type.value;
	
	//signs and graphics
	if (budget_buddy_type == 1)
	{
	
		if (submit_form)
		{
			//check and see if they are interested in Illuminated Fascia Sign Box
			if ((theform.budgetbuddysignsgraphicssignboxlength.value.length > 0) || (theform.budgetbuddysignsgraphicssignboxheight.value.length > 0) || (theform.budgetbuddysignsgraphicssignboxwidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicssignboxlength.value))
				{
					alert("Please enter a valid Illuminated Fascia Sign Box length value.");
					theform.budgetbuddysignsgraphicssignboxlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicssignboxheight.value))
					{
						alert("Please enter a valid Illuminated Fascia Sign Box height value.");
						theform.budgetbuddysignsgraphicssignboxheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicssignboxwidth.value))
					{
						alert("Please enter a valid Illuminated Fascia Sign Box width value.");
						theform.budgetbuddysignsgraphicssignboxwidth.focus();
						submit_form=false;
					}
				}
			}	
		}
	
		if (submit_form)
		{
			//check and see if they are interested in Individual Illuminated Letters 
			if ((theform.budgetbuddysignsgraphicsilluminatedletterslength.value.length > 0) || (theform.budgetbuddysignsgraphicsilluminatedlettersheight.value.length > 0) || (theform.budgetbuddysignsgraphicsilluminatedletterswidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsilluminatedletterslength.value))
				{
					alert("Please enter a valid Individual Illuminated Letters length value.");
					theform.budgetbuddysignsgraphicsilluminatedletterslength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsilluminatedlettersheight.value))
					{
						alert("Please enter a valid Individual Illuminated Letters height value.");
						theform.budgetbuddysignsgraphicsilluminatedlettersheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsilluminatedletterswidth.value))
					{
						alert("Please enter a valid Individual Illuminated Letters width value.");
						theform.budgetbuddysignsgraphicsilluminatedletterswidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Individual Non-Illuminated Letters 
			if ((theform.budgetbuddysignsgraphicsnonilluminatedletterslength.value.length > 0) || (theform.budgetbuddysignsgraphicsnonilluminatedlettersheight.value.length > 0) || (theform.budgetbuddysignsgraphicsnonilluminatedletterswidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsnonilluminatedletterslength.value))
				{
					alert("Please enter a valid Individual Non-Illuminated Letters length value.");
					theform.budgetbuddysignsgraphicsnonilluminatedletterslength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsnonilluminatedlettersheight.value))
					{
						alert("Please enter a valid Individual Non-Illuminated Letters height value.");
						theform.budgetbuddysignsgraphicsnonilluminatedlettersheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsnonilluminatedletterswidth.value))
					{
						alert("Please enter a valid Individual Non-Illuminated Letters width value.");
						theform.budgetbuddysignsgraphicsnonilluminatedletterswidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Exposed Neon Sign 
			if ((theform.budgetbuddysignsgraphicsneonsignlength.value.length > 0) || (theform.budgetbuddysignsgraphicsneonsignheight.value.length > 0) || (theform.budgetbuddysignsgraphicsneonsignwidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsneonsignlength.value))
				{
					alert("Please enter a valid Exposed Neon Sign length value.");
					theform.budgetbuddysignsgraphicsneonsignlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsneonsignheight.value))
					{
						alert("Please enter a valid Exposed Neon Sign height value.");
						theform.budgetbuddysignsgraphicsneonsignheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsneonsignwidth.value))
					{
						alert("Please enter a valid Exposed Neon Sign width value.");
						theform.budgetbuddysignsgraphicsneonsignwidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		
		if (submit_form)
		{
			//check and see if they are interested in Pylon or Monument Ground Sign
			if ((theform.budgetbuddysignsgraphicsgroundsignlength.value.length > 0) || (theform.budgetbuddysignsgraphicsgroundsignheight.value.length > 0) || (theform.budgetbuddysignsgraphicsgroundsignwidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsgroundsignlength.value))
				{
					alert("Please enter a valid Pylon or Monument Ground Sign length value.");
					theform.budgetbuddysignsgraphicsgroundsignlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsgroundsignheight.value))
					{
						alert("Please enter a valid Pylon or Monument Ground Sign height value.");
						theform.budgetbuddysignsgraphicsgroundsignheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsgroundsignwidth.value))
					{
						alert("Please enter a valid Pylon or Monument Ground Sign width value.");
						theform.budgetbuddysignsgraphicsgroundsignwidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Graphics & Digital Printing
			if ((theform.budgetbuddysignsgraphicsprintinglength.value.length > 0) || (theform.budgetbuddysignsgraphicsprintingheight.value.length > 0) || (theform.budgetbuddysignsgraphicsprintingwidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsprintinglength.value))
				{
					alert("Please enter a valid Graphics & Digital Printing length value.");
					theform.budgetbuddysignsgraphicsprintinglength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsprintingheight.value))
					{
						alert("Please enter a valid Graphics & Digital Printing height value.");
						theform.budgetbuddysignsgraphicsprintingheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsprintingwidth.value))
					{
						alert("Please enter a valid Graphics & Digital Printing width value.");
						theform.budgetbuddysignsgraphicsprintingwidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Way-finding Signs
			if ((theform.budgetbuddysignsgraphicswayfindinglength.value.length > 0) || (theform.budgetbuddysignsgraphicswayfindingheight.value.length > 0) || (theform.budgetbuddysignsgraphicswayfindingwidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicswayfindinglength.value))
				{
					alert("Please enter a valid Way-finding Signs length value.");
					theform.budgetbuddysignsgraphicswayfindinglength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicswayfindingheight.value))
					{
						alert("Please enter a valid Way-finding Signs height value.");
						theform.budgetbuddysignsgraphicswayfindingheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicswayfindingwidth.value))
					{
						alert("Please enter a valid Way-finding Signs width value.");
						theform.budgetbuddysignsgraphicswayfindingwidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Specialty Signs
			if ((theform.budgetbuddysignsgraphicsspecialtylength.value.length > 0) || (theform.budgetbuddysignsgraphicsspecialtyheight.value.length > 0) || (theform.budgetbuddysignsgraphicsspecialtywidth.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsspecialtylength.value))
				{
					alert("Please enter a valid Specialty Signs length value.");
					theform.budgetbuddysignsgraphicsspecialtylength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsspecialtyheight.value))
					{
						alert("Please enter a valid Specialty Signs height value.");
						theform.budgetbuddysignsgraphicsspecialtyheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check width
					if (!IsBudgetBuddyValue(theform.budgetbuddysignsgraphicsspecialtywidth.value))
					{
						alert("Please enter a valid Specialty Signs width value.");
						theform.budgetbuddysignsgraphicsspecialtywidth.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		
		//required graphics
		if (submit_form)
		{
			//if they entered a value in the required graphics field, validate it
			if (theform.budgetbuddysignsgraphicsrequiredgraphics.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddysignsgraphicsrequiredgraphics.value))
				{
					alert("Please enter a valid required graphics value.");
					theform.budgetbuddysignsgraphicsrequiredgraphics.focus();
					submit_form=false;
				}
			}
		}
	
		//required lighting
		if (submit_form)
		{
			//if they entered a value in the required lighting field, validate it
			if (theform.budgetbuddysignsgraphicsrequiredlighting.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddysignsgraphicsrequiredlighting.value))
				{
					alert("Please enter a valid required lighting value.");
					theform.budgetbuddysignsgraphicsrequiredlighting.focus();
					submit_form=false;
				}
			}
		}
	
	
		if (submit_form)
		{
			if (!IsWordSpace(theform.budgetbuddysignsgraphicsfirstname.value))
			{
				alert("Please enter a valid first name.");
				theform.budgetbuddysignsgraphicsfirstname.focus();
				submit_form=false;
			}
		}
		
		if (submit_form)
		{
			if (!IsWordSpace(theform.budgetbuddysignsgraphicslastname.value))
			{
				alert("Please enter a valid last name.");
				theform.budgetbuddysignsgraphicslastname.focus();
				submit_form=false;
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the title field, validate it
			if (theform.budgetbuddysignsgraphicstitle.value.length > 0)
			{
				if (!IsWordNumberSpecial(theform.budgetbuddysignsgraphicstitle.value))
				{
					alert("Please enter a valid title.");
					theform.budgetbuddysignsgraphicstitle.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			if (!IsPhone(theform.budgetbuddysignsgraphicsphone.value))
			{
				alert("Please enter a valid phone number.");
				theform.budgetbuddysignsgraphicsphone.focus();
				submit_form=false;
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the email field, validate it
			if (theform.budgetbuddysignsgraphicsemail.value.length > 0)
			{
				if (!IsEmail(theform.budgetbuddysignsgraphicsemail.value))
				{
					alert("Please enter a valid email address.");
					theform.budgetbuddysignsgraphicsemail.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the company name field, validate it
			if (theform.budgetbuddysignsgraphicscompanyname.value.length > 0)
			{
				if (!IsWordNumberSpecial(theform.budgetbuddysignsgraphicscompanyname.value))
				{
					alert("Please enter a valid company name.");
					theform.budgetbuddysignsgraphicscompanyname.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the location of work required field, validate it
			if (theform.budgetbuddysignsgraphicslocationwork.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddysignsgraphicslocationwork.value))
				{
					alert("Please enter a valid location of work required value.");
					theform.budgetbuddysignsgraphicslocationwork.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the work request field, validate it
			if (theform.budgetbuddysignsgraphicsisrequest.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddysignsgraphicsisrequest.value))
				{
					alert("Please enter a valid location of work request value.");
					theform.budgetbuddysignsgraphicsisrequest.focus();
					submit_form=false;
				}
			}
		}
	}
	else
	{
	if (submit_form)
		{
			//check and see if they are interested in Quarter-Ball
			if ((theform.budgetbuddyawningscanopiesquarterballlength.value.length > 0) || (theform.budgetbuddyawningscanopiesquarterballheight.value.length > 0) || (theform.budgetbuddyawningscanopiesquarterballprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesquarterballlength.value))
				{
					alert("Please enter a valid Quarter-Ball length value.");
					theform.budgetbuddyawningscanopiesquarterballlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesquarterballheight.value))
					{
						alert("Please enter a valid Quarter-Ball height value.");
						theform.budgetbuddyawningscanopiesquarterballheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesquarterballprojection.value))
					{
						alert("Please enter a valid Quarter-Ball projection value.");
						theform.budgetbuddyawningscanopiesquarterballprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
	
		if (submit_form)
		{
			//check and see if they are interested in Eyelid 
			if ((theform.budgetbuddyawningscanopieseyelidlength.value.length > 0) || (theform.budgetbuddyawningscanopieseyelidheight.value.length > 0) || (theform.budgetbuddyawningscanopieseyelidprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopieseyelidlength.value))
				{
					alert("Please enter a valid Eyelid length value.");
					theform.budgetbuddyawningscanopieseyelidlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopieseyelidheight.value))
					{
						alert("Please enter a valid Eyelid height value.");
						theform.budgetbuddyawningscanopieseyelidheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopieseyelidprojection.value))
					{
						alert("Please enter a valid Eyelid projection value.");
						theform.budgetbuddyawningscanopieseyelidprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Angular/Lean-To 
			if ((theform.budgetbuddyawningscanopiesleantolength.value.length > 0) || (theform.budgetbuddyawningscanopiesleantoheight.value.length > 0) || (theform.budgetbuddyawningscanopiesleantoprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesleantolength.value))
				{
					alert("Please enter a valid Angular/Lean-To length value.");
					theform.budgetbuddyawningscanopiesleantolength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesleantoheight.value))
					{
						alert("Please enter a valid Angular/Lean-To height value.");
						theform.budgetbuddyawningscanopiesleantoheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesleantoprojection.value))
					{
						alert("Please enter a valid Angular/Lean-To projection value.");
						theform.budgetbuddyawningscanopiesleantoprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Waterfall 
			if ((theform.budgetbuddyawningscanopieswaterfalllength.value.length > 0) || (theform.budgetbuddyawningscanopieswaterfallheight.value.length > 0) || (theform.budgetbuddyawningscanopieswaterfallprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopieswaterfalllength.value))
				{
					alert("Please enter a valid Waterfall length value.");
					theform.budgetbuddyawningscanopieswaterfalllength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopieswaterfallheight.value))
					{
						alert("Please enter a valid Waterfall height value.");
						theform.budgetbuddyawningscanopieswaterfallheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopieswaterfallprojection.value))
					{
						alert("Please enter a valid Waterfall projection value.");
						theform.budgetbuddyawningscanopieswaterfallprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		
		
		if (submit_form)
		{
			//check and see if they are interested in Concave
			if ((theform.budgetbuddyawningscanopiesconcavelength.value.length > 0) || (theform.budgetbuddyawningscanopiesconcaveheight.value.length > 0) || (theform.budgetbuddyawningscanopiesconcaveprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesconcavelength.value))
				{
					alert("Please enter a valid Concave length value.");
					theform.budgetbuddyawningscanopiesconcavelength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesconcaveheight.value))
					{
						alert("Please enter a valid Concave height value.");
						theform.budgetbuddyawningscanopiesconcaveheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesconcaveprojection.value))
					{
						alert("Please enter a valid Concave projection value.");
						theform.budgetbuddyawningscanopiesconcaveprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Retractable Roll-Out Awnings
			if ((theform.budgetbuddyawningscanopiesretractablelength.value.length > 0) || (theform.budgetbuddyawningscanopiesretractableheight.value.length > 0) || (theform.budgetbuddyawningscanopiesretractableprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesretractablelength.value))
				{
					alert("Please enter a valid Retractable Roll-Out Awnings length value.");
					theform.budgetbuddyawningscanopiesretractablelength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesretractableheight.value))
					{
						alert("Please enter a valid Retractable Roll-Out Awnings height value.");
						theform.budgetbuddyawningscanopiesretractableheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesretractableprojection.value))
					{
						alert("Please enter a valid Retractable Roll-Out Awnings projection value.");
						theform.budgetbuddyawningscanopiesretractableprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Pull-up Window Awnings
			if ((theform.budgetbuddyawningscanopiespulluplength.value.length > 0) || (theform.budgetbuddyawningscanopiespullupheight.value.length > 0) || (theform.budgetbuddyawningscanopiespullupprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiespulluplength.value))
				{
					alert("Please enter a valid Pull-up Window Awnings length value.");
					theform.budgetbuddyawningscanopiespulluplength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiespullupheight.value))
					{
						alert("Please enter a valid Pull-up Window Awnings height value.");
						theform.budgetbuddyawningscanopiespullupheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiespullupprojection.value))
					{
						alert("Please enter a valid Pull-up Window Awnings projection value.");
						theform.budgetbuddyawningscanopiespullupprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Entranceway Canopy 
			if ((theform.budgetbuddyawningscanopiesentrancewaylength.value.length > 0) || (theform.budgetbuddyawningscanopiesentrancewayheight.value.length > 0) || (theform.budgetbuddyawningscanopiesentrancewayprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesentrancewaylength.value))
				{
					alert("Please enter a valid Entranceway Canopy length value.");
					theform.budgetbuddyawningscanopiesentrancewaylength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesentrancewayheight.value))
					{
						alert("Please enter a valid Entranceway Canopy height value.");
						theform.budgetbuddyawningscanopiesentrancewayheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesentrancewayprojection.value))
					{
						alert("Please enter a valid Entranceway Canopy projection value.");
						theform.budgetbuddyawningscanopiesentrancewayprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in  Lead in Entranceway over steps with Flat Face style 
			if ((theform.budgetbuddyawningscanopiesleadinlength.value.length > 0) || (theform.budgetbuddyawningscanopiesleadinheight.value.length > 0) || (theform.budgetbuddyawningscanopiesleadinprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesleadinlength.value))
				{
					alert("Please enter a valid Lead in Entranceway over steps with Flat Face style length value.");
					theform.budgetbuddyawningscanopiesleadinlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesleadinheight.value))
					{
						alert("Please enter a valid Lead in Entranceway over steps with Flat Face style height value.");
						theform.budgetbuddyawningscanopiesleadinheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesleadinprojection.value))
					{
						alert("Please enter a valid Lead in Entranceway over steps with Flat Face style projection value.");
						theform.budgetbuddyawningscanopiesleadinprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Patio Canopy style 
			if ((theform.budgetbuddyawningscanopiespatiolength.value.length > 0) || (theform.budgetbuddyawningscanopiespatioheight.value.length > 0) || (theform.budgetbuddyawningscanopiespatioprojection.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiespatiolength.value))
				{
					alert("Please enter a valid Patio Canopy length value.");
					theform.budgetbuddyawningscanopiespatiolength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiespatioheight.value))
					{
						alert("Please enter a valid Patio Canopy height value.");
						theform.budgetbuddyawningscanopiespatioheight.focus();
						submit_form=false;
					}
				}
				
				if (submit_form)
				{
					//check projection
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiespatioprojection.value))
					{
						alert("Please enter a valid Patio Canopy projection value.");
						theform.budgetbuddyawningscanopiespatioprojection.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Banner
			if ((theform.budgetbuddyawningscanopiesbannerlength.value.length > 0) || (theform.budgetbuddyawningscanopiesbannerheight.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesbannerlength.value))
				{
					alert("Please enter a valid Banner length value.");
					theform.budgetbuddyawningscanopiesbannerlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiesbannerheight.value))
					{
						alert("Please enter a valid Banner height value.");
						theform.budgetbuddyawningscanopiesbannerheight.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		if (submit_form)
		{
			//check and see if they are interested in Curtain
			if ((theform.budgetbuddyawningscanopiescurtainlength.value.length > 0) || (theform.budgetbuddyawningscanopiescurtainheight.value.length > 0))
			{
				//check length
				if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiescurtainlength.value))
				{
					alert("Please enter a valid Curtain length value.");
					theform.budgetbuddyawningscanopiescurtainlength.focus();
					submit_form=false;
				}

				if (submit_form)
				{
					//check height
					if (!IsBudgetBuddyValue(theform.budgetbuddyawningscanopiescurtainheight.value))
					{
						alert("Please enter a valid Curtain height value.");
						theform.budgetbuddyawningscanopiescurtainheight.focus();
						submit_form=false;
					}
				}
			}	
		}
		
		//required graphics
		if (submit_form)
		{
			//if they entered a value in the required graphics field, validate it
			if (theform.budgetbuddyawningscanopiesrequiredgraphics.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddyawningscanopiesrequiredgraphics.value))
				{
					alert("Please enter a valid required graphics value.");
					theform.budgetbuddyawningscanopiesrequiredgraphics.focus();
					submit_form=false;
				}
			}
		}
	
		//required lighting
		if (submit_form)
		{
			//if they entered a value in the required lighting field, validate it
			if (theform.budgetbuddyawningscanopiesrequiredlighting.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddyawningscanopiesrequiredlighting.value))
				{
					alert("Please enter a valid required lighting value.");
					theform.budgetbuddyawningscanopiesrequiredlighting.focus();
					submit_form=false;
				}
			}
		}
	
	
		if (submit_form)
		{
			if (!IsWordSpace(theform.budgetbuddyawningscanopiesfirstname.value))
			{
				alert("Please enter a valid first name.");
				theform.budgetbuddyawningscanopiesfirstname.focus();
				submit_form=false;
			}
		}
		
		if (submit_form)
		{
			if (!IsWordSpace(theform.budgetbuddyawningscanopieslastname.value))
			{
				alert("Please enter a valid last name.");
				theform.budgetbuddyawningscanopieslastname.focus();
				submit_form=false;
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the title field, validate it
			if (theform.budgetbuddyawningscanopiestitle.value.length > 0)
			{
				if (!IsWordNumberSpecial(theform.budgetbuddyawningscanopiestitle.value))
				{
					alert("Please enter a valid title.");
					theform.budgetbuddyawningscanopiestitle.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			if (!IsPhone(theform.budgetbuddyawningscanopiesphone.value))
			{
				alert("Please enter a valid phone number.");
				theform.budgetbuddyawningscanopiesphone.focus();
				submit_form=false;
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the email field, validate it
			if (theform.budgetbuddyawningscanopiesemail.value.length > 0)
			{
				if (!IsEmail(theform.budgetbuddyawningscanopiesemail.value))
				{
					alert("Please enter a valid email address.");
					theform.budgetbuddyawningscanopiesemail.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the company name field, validate it
			if (theform.budgetbuddyawningscanopiescompanyname.value.length > 0)
			{
				if (!IsWordNumberSpecial(theform.budgetbuddyawningscanopiescompanyname.value))
				{
					alert("Please enter a valid company name.");
					theform.budgetbuddyawningscanopiescompanyname.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the location of work required field, validate it
			if (theform.budgetbuddyawningscanopieslocationwork.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddyawningscanopieslocationwork.value))
				{
					alert("Please enter a valid location of work required value.");
					theform.budgetbuddyawningscanopieslocationwork.focus();
					submit_form=false;
				}
			}
		}
		
		if (submit_form)
		{
			//if they entered a value in the work request field, validate it
			if (theform.budgetbuddyawningscanopiesisrequest.value.length > 0)
			{
				if (!IsDescription(theform.budgetbuddyawningscanopiesisrequest.value))
				{
					alert("Please enter a valid location of work request value.");
					theform.budgetbuddyawningscanopiesisrequest.focus();
					submit_form=false;
				}
			}
		}
	}
	//if there were no problems, submit the form
	if (submit_form)
		theform.submit();
}


/*
	purpose:
		used in the front of the site
	page:
		/contact_us/index.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckContactForm(theform)
{
	var submit_form=true;
	
	if (!IsWordSpace(theform.contactfirstname.value))
	{
		alert("Please enter a valid first name.");
		theform.contactfirstname.focus();
		submit_form=false;
	}
	
	if (submit_form)
	{
		if (!IsWordSpace(theform.contactlastname.value))
		{
			alert("Please enter a valid last name.");
			theform.contactlastname.focus();
			submit_form=false;
		}
	}
	
	if (submit_form)
	{
		//if they entered a value in the title field, validate it
		if (theform.contacttitle.value.length > 0)
		{
			if (!IsWordNumberSpecial(theform.contacttitle.value))
			{
				alert("Please enter a valid title.");
				theform.contacttitle.focus();
				submit_form=false;
			}
		}
	}
	
	if (submit_form)
	{
		if (!IsPhone(theform.contactphone.value))
		{
			alert("Please enter a valid phone number.");
			theform.contactphone.focus();
			submit_form=false;
		}
	}
	
	if (submit_form)
	{
		//if they entered a value in the email field, validate it
		if (theform.contactemail.value.length > 0)
		{
			if (!IsEmail(theform.contactemail.value))
			{
				alert("Please enter a valid email address.");
				theform.contactemail.focus();
				submit_form=false;
			}
		}
	}
	
	if (submit_form)
	{
		//if they entered a value in the company name field, validate it
		if (theform.contactcompanyname.value.length > 0)
		{
			if (!IsWordNumberSpecial(theform.contactcompanyname.value))
			{
				alert("Please enter a valid company name.");
				theform.contactcompanyname.focus();
				submit_form=false;
			}
		}
	}
	
	if (submit_form)
	{
		//if they entered a value in the location of work required field, validate it
		if (theform.contactworklocation.value.length > 0)
		{
			if (!IsDescription(theform.contactworklocation.value))
			{
				alert("Please enter a valid location of work required value.");
				theform.contactworklocation.focus();
				submit_form=false;
			}
		}
	}
	
	if (submit_form)
	{
		//if they entered a value in the work request field, validate it
		if (theform.contactworkrequest.value.length > 0)
		{
			if (!IsDescription(theform.contactworkrequest.value))
			{
				alert("Please enter a valid location of work request value.");
				theform.contactworkrequest.focus();
				submit_form=false;
			}
		}
	}
	
	//if there were no problems, submit the form
	if (submit_form)
		theform.submit();
}

/*
	purpose:
		used in the control panel
	page:
		all /module_setorder.cfm pages
	Parameters:
		theform - object reference to the form being passed
*/
function CheckDisplayOrderForm(theform)
{
	if (theform.orderlist.value <= 0)
	{
		alert("The order has not changed, no update required.");
		return false;
	}

	return true;
}


/*
	purpose:
		used in the control panel
	page:
		/admin/group/module_edit.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckGroupForm(theform)
{
	var test=false;
	
	if (!IsWordSpace(theform.groupinfoname.value))
	{
		alert("Please enter a valid group name.");
		theform.groupinfoname.focus();
		return false;
	}

	if (!IsDescription(theform.groupinfodescription.value))
	{
		alert("Please enter a valid group description.");
		theform.groupinfodescription.focus();
		return false;
	}

						
	return true;
}


/*
	purpose:
		used in the control panel
	page:
		main control panel login page
	Parameters:
		theform - object reference to the form being passed
*/
function CheckLoginForm(theform)
{

	if (!IsUsername(theform.username.value))
	{
		alert("Please enter a valid username. (MIN. 5 characters)");
		theform.username.focus();
		return false;
	}

	if (!IsPassword(theform.password.value))
	{
		alert("Please enter a valid password. (MIN. 5 characters)");
		theform.password.focus();
		return false;
	}

	return true;
}


/*
	purpose:
		used in the control panel
	page:
		/admin/photo/module_edit.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckPhotoForm(theform)
{
	var thumbnail_value="";
	var image_value="";
	
	if (!IsWordNumberSpecial(theform.photoname.value))
	{
		alert("Please enter a valid Photo Name.");
		theform.photoname.focus();
		return false;
	}
	
	if (!IsDescription(theform.photodescription.value))
	{
		alert("Please enter some valid Photo Description.");
		theform.photodescription.focus();
		return false;
	}

	//if we are supposed to upload an thumbnail
	if (theform.uploadthumbnail.value == 1)
	{
		thumbnail_value=theform.photothumbnailfile_file.value;
		
		if (!IsImageExtension(thumbnail_value.substring(thumbnail_value.lastIndexOf("."),thumbnail_value.length)))
		{
			alert("Please select an thumbnail file for uploading (must be .jpg or .gif).");
			theform.photothumbnailfile_file.focus();
			return false;
		}
	}
						
	//if we are supposed to upload an image
	if (theform.uploadimage.value == 1)
	{
	 	image_value=theform.photoimagefile_file.value;
		
		if (!IsImageExtension(image_value.substring(image_value.lastIndexOf("."),image_value.length)))
		{
			alert("Please select an image file for uploading (must be .jpg or .gif).");
			theform.photoimagefile_file.focus();
			return false;
		}
	}
						
	return true;
}

/*
	purpose:
		used in the control panel
	page:
		/admin/presentation/module_edit.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckPresentationForm(theform)
{
	if (!IsWordNumber(theform.presentationname.value))
	{
		alert("Please enter a valid presentation name.");
		theform.presentationname.focus();
		return false;
	}

	if (!IsDescription(theform.presentationdescription.value))
	{
		alert("Please enter a valid presentation description.");
		theform.presentationdescription.focus();
		return false;
	}

	return true;
}




/*
	purpose:
		used in the control panel
	page:
		/admin/projectgallery/module_edit.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckProjectGalleryUniqueSearch(theform)
{
	if (!IsUniqueId(theform.photouniqueid.value))
	{
		alert("Please enter a valid unique identifier.");
		theform.photouniqueid.focus();
		return false;
	}

	return true;
}

/*
	purpose:
		used in the control panel
	page:
		/admin/user/module_edit.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckUserForm(theform)
{
	
	if (!IsWordSpace(theform.userinfofirstname.value))
	{
		alert("Please enter a valid first name.");
		theform.userinfofirstname.focus();
		return false;
	}
	
	if (!IsWordSpace(theform.userinfolastname.value))
	{
		alert("Please enter a valid last name.");
		theform.userinfolastname.focus();
		return false;
	}

	if (!IsUsername(theform.userinfousername.value))
	{
		alert("Please enter a valid username.");
		theform.userinfousername.focus();
		return false;
	}

	if ((theform.updatepassword.checked == 1) || (theform.submit_type.value == "add"))
	{
		if (!IsPassword(theform.userinfopassword.value))
		{
			alert("Please enter a valid password.");
			theform.userinfopassword.focus();
			return false;
		}
		
		if (!IsPassword(theform.userinfopasswordconfirm.value))
		{
			alert("Please enter a valid password confirmation password.");
			theform.userinfopasswordconfirm.focus();
			return false;
		}
	 	
		if (theform.userinfopassword.value != theform.userinfopasswordconfirm.value)
		{
		 	alert ("You Password and Confirm Password do not match");
			theform.userinfopasswordconfirm.focus();
			return false;
		}
	}

	if (!IsWordSpace(theform.userinfojobtitle.value))
	{
		alert("Please enter a valid job title.");
		theform.userinfojobtitle.focus();
		return false;
	}
	
	if (!IsEmail(theform.userinfoemailaddress.value))
	{
		alert("Please enter a valid email address.");
		theform.userinfoemailaddress.focus();
		return false;
	}

	//if we are supposed to upload an thumbnail
	if (theform.groupinfoid.selectedIndex == -1)
	{
		alert("Please select at least one group.");
		theform.groupinfoid[0].focus();
		return false;
	}

	return true;
}
