function ValidateFields()
{
	var FullName = document.getElementById("FullName");
	var Email = document.getElementById("Email");
	var Phone = document.getElementById("Phone");
	var Comments = document.getElementById("Comments");
	
	if(FullName==null || FullName.value=="")
	{
		alert("Full Name is a required field");
		return false
	}
	
	if(Email==null || Email.value=="")
	{
		alert("Email is a required field blat");
		return false
	}
	
	var atIndex = Email.value.indexOf("@");
	var dotIndex = Email.value.lastIndexOf(".")
	if(atIndex<1||dotIndex-atIndex<2) 
	{
		alert("Invalid Email Address");
		return false
	}
	
	if(Phone==null || Phone.value=="")
	{
		alert("Phone is a required field");
		return false
	}
	
	var len = Phone.value.toString().length;
	if(len != 12)
	{
		alert("Phone should be 10 digits\nex. 702-333-7385");
		return false
	}
	
	var BadWords = /fuck|fvck|asshole/i;
	var matchPos = Comments.value.toString().search(BadWords);
	if(matchPos != -1)
	{
		alert("Invalid Comments");
		return false
	}
	else
		return true
}


function ValidateNumber()
{
	var BookBox = document.getElementById("BookBox");
	var DishPackBox = document.getElementById("DishPackBox");
	var LinenBox = document.getElementById("LinenBox");
	var WardrobeBox = document.getElementById("WardrobeBox");
	var FileBox = document.getElementById("FileBox");
	var PictureBox = document.getElementById("PictureBox");
	var LampBox = document.getElementById("LampBox");
	var PackingPaper = document.getElementById("PackingPaper");
	var ShrinkWrap = document.getElementById("ShrinkWrap");
	var Bubble = document.getElementById("Bubble");
	var PackingTape = document.getElementById("PackingTape");
	var TapeDispenser = document.getElementById("TapeDispenser");
	var Markers = document.getElementById("Markers");
	var fragile = document.getElementById("fragile");
	
	var FullName = document.getElementById("FullName");
	var Email = document.getElementById("Email");	
	var Phone = document.getElementById("Phone");

	
	if(FullName==null || FullName.value=="")
	{
		alert("Full Name is a required field");
		return false
	}
	
	if(Email==null || Email.value=="")
	{
		alert("Email is a required field");
		return false
	}
	
	if(Phone==null || Phone.value=="")
	{
		alert("Phone is a required field");
		return false
	}
	
	var atIndex = Email.value.indexOf("@");
	var dotIndex = Email.value.lastIndexOf(".")
	if(atIndex<1||dotIndex-atIndex<2) 
	{
		alert("Invalid Email Address");
		return false
	}
	
	var len = Phone.value.toString().length;
	if(len != 12)
	{
		alert("Phone should be 10 digits\nex. 702-333-7385");
		return false
	}
	
	if(IsNumeric(BookBox.value.toString()) == false || IsNumeric(DishPackBox.value.toString()) == false ||
		IsNumeric(LinenBox.value.toString()) == false || IsNumeric(WardrobeBox.value.toString()) == false ||
		IsNumeric(FileBox.value.toString()) == false || IsNumeric(PictureBox.value.toString()) == false ||
		IsNumeric(LampBox.value.toString()) == false || IsNumeric(PackingPaper.value.toString()) == false ||
		IsNumeric(ShrinkWrap.value.toString()) == false || IsNumeric(Bubble.value.toString()) == false ||
		IsNumeric(PackingTape.value.toString()) == false || IsNumeric(TapeDispenser.value.toString()) == false ||
		IsNumeric(Markers.value.toString()) == false || IsNumeric(fragile.value.toString()) == false)
	{
		alert("Each Order Qty must be a number");
		return false
	}
	else
	{
		var total = parseInt(BookBox.value)*4 + parseInt(DishPackBox.value)*13 + parseInt(LinenBox.value)*5 + 
					parseInt(WardrobeBox.value)*15 + parseInt(FileBox.value)*4.5 + parseInt(PictureBox.value)*10 + 
					parseInt(LampBox.value)*8 + parseInt(PackingPaper.value)*50 + parseInt(ShrinkWrap.value)*30 + 
					parseInt(Bubble.value)*60 + parseInt(PackingTape.value)*3 + parseInt(TapeDispenser.value)*15 +
					parseInt(Markers.value)*4 + parseInt(fragile.value)*1;
		alert("Thank You for your order " + FullName.value + "\nYour Total is $" + total +
			  "\nOne of our representatives will contact you soon");
		return true
	}
	return true // Never gets to this point - but just in case for compiling issues...
}


function IsNumeric(str)
{
	//var ValidChars = "0123456789."; With Decimal Point !
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char; 
	
	if(str.length == 0)
		IsNumber=false;
		
	for (i = 0; i < str.length && IsNumber == true; i++) 
		{ 
			Char = str.charAt(i); 
			//if ((i == 0) && (Char == "-")) // check first character for minus sign
			//	continue;
			if (ValidChars.indexOf(Char) == -1) 
			{
				IsNumber = false;
			}
		}
	return IsNumber;
}


function ValidateOnlineEstimate()
{
	var FullName = document.getElementById("FullName");
	var Email = document.getElementById("Email");	
	var Phone = document.getElementById("Phone");
	var alertMsg = "Please complete/correct the following fields:\n";
	var Result = true
	
	if(FullName==null || FullName.value=="")
	{
		//alert("Full Name is a required field");
		alertMsg += " - " + "Full Name" + "\n";
		Result = false
	}
	
	if(Email==null || Email.value=="")
	{
		//alert("Email is a required field");
		alertMsg += " - " + "Email" + "\n";
		Result = false
	}
	else
	{
		var atIndex = Email.value.indexOf("@");
		var dotIndex = Email.value.lastIndexOf(".")
		if(atIndex<1||dotIndex-atIndex<2) 
		{
			//alert("Invalid Email Address");
			alertMsg += " - " + "Invalid Email Address" + "\n";
			Result = false
		}	
	}
	
	if(Phone==null || Phone.value=="")
	{
		//alert("Phone is a required field");
		alertMsg += " - " + "Phone" + "\n";
		Result = false
	}
	else
	{
		var len = Phone.value.toString().length;
		if(len < 10)
		{
			//alert("Phone should be 10 digits");
			alertMsg += " - " + "Phone should be 10 digits\nex. 702-333-7385" + "\n";
			Result = false
		}
	}
	
	if (Result == false)
	{
		alert(alertMsg);
		return false
	}
}


function CalculateOnlineEstimate()
{
	var totalCF = 0;
	var totalWeight  = 0;
	
	if (ValidateOnlineEstimate() == false)
		return false
	/*	
	var FullName = document.getElementById("FullName");
	var Email = document.getElementById("Email");	
	var Phone = document.getElementById("Phone");
	
	var inventory = Array(document.getElementById("Bar_Portable").value,document.getElementById("Fireplace_Equipment").value,
						  document.getElementById("Sofa_2_Cushions").value,document.getElementById("Bench_Fireside_or_Piano").value,
						  document.getElementById("Foot_Stool").value,document.getElementById("Sofa_3_Cushions").value,
						  document.getElementById("Bookcase").value,document.getElementById("Lamp_Floor_or_Pole").value,
						  document.getElementById("Sofa_4_Cushions").value,document.getElementById("Bookshelves_sectional").value,
						  document.getElementById("Magazine_Rack").value,document.getElementById("Sofa_Sectional_per_section").value,
						  document.getElementById("Chair_Arm").value,document.getElementById("Music_Cabinet").value,
						  document.getElementById("Stereo").value,document.getElementById("Chair_Occasional").value,
						  document.getElementById("Piano_Baby_Grand_or_Upright").value,
						  document.getElementById("Stud_Couch_and_Hideabed").value,
						  document.getElementById("Chair_Overstuffed").value,document.getElementById("Piano_Parlor_Grand").value,
						  document.getElementById("Tables_Droplf_Occas").value,
						  document.getElementById("Chair_Rocker").value,document.getElementById("Piano_Spinet").value,
						  document.getElementById("Tables_Coffee_End_or_Nest").value,
						  document.getElementById("Chair_Straight").value,document.getElementById("Radio_Table").value,
						  document.getElementById("Telephone_Stand_and_Chair").value,document.getElementById("Clock_Grandfather").value,
						  document.getElementById("Record_Player_Port").value,document.getElementById("Television_Combination").value,
						  document.getElementById("Day_Bed").value,document.getElementById("Rugs_Large_Roll_or_Pad").value,
						  document.getElementById("Television_or_Radio_Console").value,
						  document.getElementById("Desk_Small_or_Winthrop").value,
						  document.getElementById("Rugs_Small_Roll_or_Pad").value,document.getElementById("Television_Table_Model").value,
						  document.getElementById("Desk_Secretary").value,document.getElementById("Bench_Harvest").value,
						  document.getElementById("Chair_Dining").value,document.getElementById("Tea_Cart").value,
						  document.getElementById("Buffet").value,document.getElementById("Server").value,
						  document.getElementById("Rugs_Large_Roll_or_Pad_Dining").value,document.getElementById("Cabinet_Corner").value,
						  document.getElementById("Table_Dining").value,document.getElementById("Rugs_Small_Roll_or_Pad_Dining").value,
						  document.getElementById("Cabinet_China").value,
						  document.getElementById("Bureau_Dresser_Chest_of_Drawers_Chifrb_Chinfr").value,
						  document.getElementById("Dresser_Double").value,document.getElementById("Bed_Double").value,
						  document.getElementById("Cedar_Chest").value,document.getElementById("Night_Table").value,
						  document.getElementById("Bed_King_Size").value,document.getElementById("Chair_Boudoir").value,
						  document.getElementById("Rugs_Large_Roll_or_Pad_Bedroom").value,
						  document.getElementById("Bed_Single_or_Hollywood").value,
						  document.getElementById("Chair_Straight_or_Rocker").value,
						  document.getElementById("Rugs_Small_Roll_or_Pad_Bedroom").value,
						  document.getElementById("Bed_Rollaway").value,document.getElementById("Chaise_Lounge").value,
						  document.getElementById("Vanity_Dresser").value,document.getElementById("Bed_Bunk_set_of_2").value,
						  document.getElementById("Desk_Small_or_Winthrop_Bedroom").value,document.getElementById("Wardrobe_Small").value,
						  document.getElementById("Bookshelves").value,document.getElementById("Dresser_of_Vanity_Bench").value,
						  document.getElementById("Wardrobe_Large").value,document.getElementById("Bassinette").value,
						  document.getElementById("Chest").value,document.getElementById("Pen_Play").value,
						  document.getElementById("Bed_Youth").value,document.getElementById("Chest_Toy").value,
						  document.getElementById("Rugs_Large_Roll_or_Pad_Nursery").value,document.getElementById("Chair_Childs").value,
						  document.getElementById("Crib_Baby").value,document.getElementById("Rugs_Small_Roll_or_Pad_Nursery").value,
						  document.getElementById("Chair_High_Nursery").value,document.getElementById("Table_Child").value,
						  document.getElementById("Breakfast_Suite_Chairs").value,document.getElementById("Kitchen_Cabinet").value,
						  document.getElementById("Table_Kitchen").value,document.getElementById("Breakfast_Table").value,
						  document.getElementById("Roaster").value,document.getElementById("Utility_Cabinet").value,
						  document.getElementById("Chair_High_Kitchen").value,document.getElementById("Serving_cart").value,
						  document.getElementById("Vegetable_Bin").value,document.getElementById("Ironing_Board").value,
						  document.getElementById("Stool").value,document.getElementById("Air_Conditioner").value,
						  document.getElementById("Ironer_or_Mangle").value,document.getElementById("Dehumidifier").value,
						  document.getElementById("Range_Electric_or_Gas").value,document.getElementById("Dishwasher").value,
						  document.getElementById("Dryer_Electric_or_Gas").value,
						  document.getElementById("Refrigerator_6_Cubic_Feet_or_less").value,
						  document.getElementById("Refrigerator_7_to_10_Cubic_Feet").value,
						  document.getElementById("Freezer_10_Cubic_Feet_or_less").value,
						  document.getElementById("Refrigerator_11_Cubic_Feet_or_More").value,
						  document.getElementById("Freezer_11_to_15_Cubic_Feet").value,
						  document.getElementById("Vacuum_Cleaner").value,document.getElementById("Freezer_16_Cubic_Feet_and_Up").value,
						  document.getElementById("Washing_Machine").value,document.getElementById("Barbecue_or_Port_Grill").value,
						  document.getElementById("Lawn_Mower_Power").value,document.getElementById("Rocker_Swing").value,
						  document.getElementById("Bath_Bird").value,document.getElementById("Lawn_Mower_Riding").value,
						  document.getElementById("Roller_Lawn").value,document.getElementById("Chairs_Lawn").value,
						  document.getElementById("Leaf_Sweeper").value,document.getElementById("Rug_Large").value,
						  document.getElementById("Chairs_Porch").value,document.getElementById("Outdoor_Childs_Slide").value,
						  document.getElementById("Rug_Small").value,document.getElementById("Clothes_Line").value,
						  document.getElementById("Outdoor_Childs_Gym").value,document.getElementById("Sand_Box").value,
						  document.getElementById("Clothes_Dryer_Rack").value,document.getElementById("Outdoor_Drying_Racks").value,
						  document.getElementById("Settee").value,document.getElementById("Garden_Hose_and_Tools").value,
						  document.getElementById("Outdoor_Swings").value,document.getElementById("Spreader").value,
						  document.getElementById("Glider_or_Settee").value,document.getElementById("Picnic_Table").value,
						  document.getElementById("Table_Porch").value,document.getElementById("Ladder_Extension").value,
						  document.getElementById("Picnic_Bench").value,document.getElementById("Umbrella").value,
						  document.getElementById("Lawn_Mower_Hand").value,document.getElementById("Wheel_Barrow").value,
						  document.getElementById("Ash_or_Trash_Can").value,document.getElementById("Fan").value,
						  document.getElementById("Sewing_Machine").value,document.getElementById("Basket_Clothes").value,
						  document.getElementById("Fernery_or_Plant_Stands").value,document.getElementById("Sled").value,
						  document.getElementById("Bicycle").value,document.getElementById("Foot_Lockers").value,
						  document.getElementById("Step_Ladder").value,document.getElementById("Bird_Cage_and_Stand").value,
						  document.getElementById("Garbage_Cans").value,document.getElementById("Suitcase").value,
						  document.getElementById("Card_Table").value,document.getElementById("Golf_Bag").value,
						  document.getElementById("Table_Utility").value,document.getElementById("Cabinet_Filing").value,
						  document.getElementById("Heater_Gas_or_Electric").value,document.getElementById("Tackle_Box").value,
						  document.getElementById("Carriage_Baby").value,document.getElementById("Incinerator").value,
						  document.getElementById("Tool_Chest").value,document.getElementById("Chairs_Folding").value,
						  document.getElementById("Metal_Shelves").value,document.getElementById("Tricycle").value,
						  document.getElementById("Clothes_Hamper").value,document.getElementById("Ping_Pong_Table").value,
						  document.getElementById("Wagon_Childs").value,document.getElementById("Cot_Folding").value,
						  document.getElementById("Pool_Table").value,document.getElementById("Waste_Paper_Basket").value,
						  document.getElementById("Boxes_Small").value,document.getElementById("Boxes_Large").value,
						  document.getElementById("Boxes_Picture").value,document.getElementById("Boxes_Medium").value,
						  document.getElementById("Boxes_Dishpak").value,document.getElementById("Boxes_Wardrobe").value,
						  document.getElementById("Desk_Office").value,document.getElementById("Power_Tools").value,
						  document.getElementById("Work_Bench").value);
	
	var inventoryCF = Array(15,5,35,5,2,50,20,3,60,5,2,30,10,10,20,15,70,50,25,80,12,12,60,5,5,2,5,20,2,25,30,10,15,22,3,10,35,10,
							5,10,30,15,10,20,30,3,25,25,50,60,15,5,70,10,10,40,5,3,20,25,20,70,22,20,3,40,5,12,10,30,5,10,3,10,3,
							5,5,5,30,5,10,5,10,5,15,3,2,3,30,12,10,30,20,25,30,45,30,60,45,5,60,25,10,15,15,5,35,15,5,5,7,10,10,
							3,5,20,10,5,5,20,10,30,1,20,20,10,10,5,5,5,10,8,7,5,10,5,10,2,10,5,5,5,7,5,1,2,5,20,5,1,20,10,10,1,
							5,5,5,20,5,10,40,2,1.5,6,5,3,10,15,30,20,20);
	
	for(var i = 0; i < inventoryCF.length; i++)
	{
		totalCF+= inventory[i]*inventoryCF[i];
	}
	
	totalWeight  = totalCF*7;
	
	alert("Thank You " + FullName.value + " for using our Online Estimate!\n" +
		  "You will receive your full Online Estimate by email shortly.\n" +
		  "The Total Volume and Weight of your inventory are:\n" +
		  "Total Volume: " + totalCF + " cf" + "\nTotal Weight : " + totalWeight  + " lb");
	*/
	return true
}
		
		
///////////// File A Claim	----------------------------------------------------------------------------------------

function ValidateClaim()
{
	var CustomerName = document.getElementById("CustomerName");
	var Email = document.getElementById("Email");
	var OldStreet = document.getElementById("OldStreet");
	var OldCity = document.getElementById("OldCity");
	var OldState = document.getElementById("OldState");
	var OldZip = document.getElementById("OldZip");
	var HomePhone = document.getElementById("HomePhone");
	var WorkPhone = document.getElementById("WorkPhone");
	var NewStreet = document.getElementById("NewStreet");
	var NewCity = document.getElementById("NewCity");
	var NewState = document.getElementById("NewState");
	var NewZip = document.getElementById("NewZip");
	var PickUpDate = document.getElementById("PickUpDate");
	var DeliveryDate = document.getElementById("DeliveryDate");
	var TypeOfMove = document.getElementById("TypeOfMove");
	var Protection = document.getElementById("Protection");
	var OtherInsurance = document.getElementById("OtherInsurance");
	var DeclaredValueAmount = document.getElementById("DeclaredValueAmount");
	var Warehoused = document.getElementById("Warehoused");
	var ItemsInClaim = document.getElementById("ItemsInClaim");
	var TypeofClaim = document.getElementById("TypeofClaim");
	var TotalValueofShipment = document.getElementById("TotalValueofShipment");
	var Comments = document.getElementById("Comments");
	
	if(CustomerName==null || CustomerName.value=="" ||
	   Email==null || Email.value=="" ||
	   OldStreet==null 	|| OldStreet.value=="" ||
	   OldCity==null || OldCity.value=="" ||
	   OldState==null || OldState.value=="" ||
	   OldZip==null || OldZip.value=="" ||
	   HomePhone==null || HomePhone.value=="" ||
	   WorkPhone==null || WorkPhone.value=="" ||
	   NewStreet==null || NewStreet.value=="" ||
	   NewCity==null || NewCity.value=="" ||
	   NewState==null || NewState.value=="" ||
	   NewZip==null || NewZip.value=="" ||
	   PickUpDate==null || PickUpDate.value=="" ||
	   DeliveryDate==null || DeliveryDate.value=="" ||
	   TypeOfMove==null || TypeOfMove.value=="" ||
	   Protection==null || Protection.value=="" ||
	   DeclaredValueAmount==null || DeclaredValueAmount.value=="" ||
	   //Warehoused.checked == false ||
	   ItemsInClaim==null || ItemsInClaim.value=="" ||
	   TypeofClaim==null || TypeofClaim.value=="" ||
	   TotalValueofShipment==null || TotalValueofShipment.value=="" ||
	   Comments==null || Comments.value=="")
	{
		alert("All fields are required !");
		return false
	}
	
	var atIndex = Email.value.indexOf("@");
	var dotIndex = Email.value.lastIndexOf(".")
	if(atIndex<1||dotIndex-atIndex<2) 
	{
		alert("Invalid Email Address !");
		return false
	}
	
	var len = HomePhone.value.toString().length;
	if(len < 12)
	{
		alert("Home Phone should be 10 digits ! \nex. 702-333-7385");
		return false
	}
	
	len = WorkPhone.value.toString().length;
	if(len < 12)
	{
		alert("Work Phone should be 10 digits ! \nex. 702-333-7385");
		return false
	}
	
	var BadWords = /fuck|fvck|asshole/i;
	var matchPos = Comments.value.toString().search(BadWords);
	if(matchPos != -1)
	{
		alert("Invalid Comments");
		return false
	}
	else
		return true
	
	return true
}


function populateProtection() 
{        
	 if(document.forms['claimForm1'].TypeOfMove.options[document.forms['claimForm1'].TypeOfMove.selectedIndex].value == "Interstate_Long_Distance") {
		document.forms['claimForm1'].Protection.options[5] = null;	
		document.forms['claimForm1'].Protection.options[4] = null;	
		document.forms['claimForm1'].Protection.options[3] = new Option('MovingInsurance.com','MovingInsurance.com');							
		document.forms['claimForm1'].Protection.options[2] = new Option('$5.00/$1000 Depreciated Value Coverage',"5_and_1000_Depreciated_Value_Coverage");
		document.forms['claimForm1'].Protection.options[1] = new Option('$0.30/Lb','30_cents_per_pound');
		document.forms['claimForm1'].Protection.options[0] = new Option(' - Select One - ','-');
	} else if(document.forms['claimForm1'].TypeOfMove.options[document.forms['claimForm1'].TypeOfMove.selectedIndex].value == "Intrastate_Local") {
		document.forms['claimForm1'].Protection.options[5] = new Option('Other Insurance','Other_Insurance');
		document.forms['claimForm1'].Protection.options[4] = new Option('$500 Deductible','500_dollar_deductible');
		document.forms['claimForm1'].Protection.options[3] = new Option('$250 Deductible','250_dollar_deductible');
		document.forms['claimForm1'].Protection.options[2] = new Option('$0 Deductible','0_dollar_deductible');
		document.forms['claimForm1'].Protection.options[1] = new Option('$0.60/Lb','60_cents_per_pound');
		document.forms['claimForm1'].Protection.options[0] = new Option(' - Select One - ','-');
	 } else {
		document.forms['claimForm1'].Protection.options[5] = null;
		document.forms['claimForm1'].Protection.options[4] = null;
		document.forms['claimForm1'].Protection.options[3] = null;
		document.forms['claimForm1'].Protection.options[2] = null;
		document.forms['claimForm1'].Protection.options[1] = null;
		document.forms['claimForm1'].Protection.options[0] = new Option(' - Select One - ','-');
	 }
	 document.forms['claimForm1'].Protection.options[0].selected = true;
}

function check_Other() 
{
			
	var ans = document.getElementById("otherField");
	if(document.forms['claimForm1'].Protection.options[document.forms['claimForm1'].Protection.selectedIndex].value == "Other_Insurance")
	{
		ans.style.display = '';	
		//document.forms['claimForm1'].submitBtn.value = "Add Claim Details"; 
	} 
	else 
	{
		ans.style.display = 'none';
		//document.forms['claimForm1'].submitBtn.value = "Add Claim Details";
	}               		
}          
///////////////////////// End File A Claim ---------------------------------------------------------
