var hi_cats = [
	[60,"Additions and Remodels"],
	[61,"Appraisers and Home Inspectors"],
	[62,"Architects"],
	[63,"Bathroom Remodeling"],
	[64,"Cabinets and Countertops"],
	[65,"Carpentry"],
	[66,"Carpet"],
	[67,"Cleaning"],
	[68,"Concrete and Masonry"],
	[69,"Custom Homes"],
	[70,"Decks and Porches"],
	[71,"Decorators and Designers"],
	[72,"Doors"],
	[73,"Drywall"],
	[74,"Electrical"],
	[75,"Engineers"],
	[76,"Fences"],
	[77,"Flooring"],
	[78,"Foundations"],
	[79,"Garage Doors"],
	[80,"Handyman"],
	[81,"HVAC"],
	[82,"Kitchen Remodeling"],
	[83,"Landscaping"],
	[84,"Moving"],
	[85,"Painting"],
	[86,"Pest Control"],
	[87,"Plumbing"],
	[88,"Roofing"],
	[89,"Siding"],
	[90,"Small Projects and Repairs"],
	[91,"Solar Energy"],
	[92,"Sunrooms"],
	[93,"Swimming Pools"],
	[94,"Tile Work"],
	[95,"Walls"],
	[96,"Windows"]
];

var hi_tasks = [
	[60,"Additions - Closet"],
	[60,"Additions - Garage"],
	[60,"Additions - To Existing Structure"],
	[60,"Remodel - Accommodate a Disability"],
	[60,"Remodel - Basement"],
	[60,"Remodel - Garage"],
	[60,"Remodel - Multiple Rooms"],
	[60,"Other"],
	[61,"Appraisers - Real Estate"],
	[61,"Inspection - General Home"],
	[61,"Inspection - Roofing"],
	[61,"Other"],
	[64,"Cabinets - Custom Build"],
	[64,"Cabinets - Install"],
	[64,"Cabinets - Reface"],
	[64,"Cabinets - Refinish"],
	[64,"Countertops - Install Stone"],
	[64,"Other"],
	[65,"Built-In Furniture - Construct"],
	[65,"Exterior Trim - Install"],
	[65,"Framing - Install"],
	[65,"Interior Trim & Moldings - Install"],
	[65,"Other"],
	[66,"Carpet Cleaning"],
	[66,"Install Carpets"],
	[66,"Other"],
	[67,"Building Site - Preparation and Clearing"],
	[67,"Cleaning - Exterior"],
	[67,"Cleaning - Interior"],
	[67,"Toxicity and Mold Removal"],
	[67,"Other"],
	[68,"Brick and Stone Patios, Walks & Steps"],
	[68,"Driveways & Floors - Install"],
	[68,"Driveways & Floors - Install Interlocking Paving"],
	[68,"Patios, Walks & Steps - Install Interlocking Paving"],
	[68,"Stamped Concrete - Install"],
	[68,"Other"],
	[70,"Build or Replace"],
	[70,"Repair"],
	[71,"Designer - Bathroom"],
	[71,"Designer - Building"],
	[71,"Designer - Interior Lighting Plan"],
	[71,"Designer - Kitchen"],
	[71,"Designer - Landscape"],
	[71,"Designer - Residential"],
	[71,"Interior Decorator"],
	[71,"Stage a Home"],
	[71,"Other"],
	[72,"Install Exterior Doors"],
	[72,"Install Interior Doors"],
	[72,"Install Sliding Door(s)"],
	[73,"Install Drywall"],
	[73,"Repair Drywall"],
	[74,"Electrical Wiring or Panel Upgrade"],
	[74,"Install a Generator"],
	[74,"Install Electrical for Home Addition or Remodel"],
	[74,"Install Home Automation System"],
	[74,"Install Home Theater Surround Sound"],
	[74,"Install Home Theater System or Media Center"],
	[74,"Install Home Theater Wiring"],
	[74,"Other"],
	[76,"Install Aluminum or Steel Fence"],
	[76,"Install Wood Fence"],
	[76,"Repair Wood Fence"],
	[76,"Other"],
	[77,"Install Simulated Wood or Stone Laminate Flooring"],
	[77,"Install Wood Flooring"],
	[77,"Refinish Wood Flooring"],
	[77,"Other"],
	[78,"Concrete Foundation - Repair"],
	[81,"Install Central A/C"],
	[81,"Install Gas or Electric Boiler or Radiator"],
	[81,"Install Gas or Electric Furnace"],
	[81,"Install Heat Pump"],
	[81,"Install Oil Boiler or Radiator"],
	[81,"Install Oil Furnace"],
	[81,"Install Swamp Cooler"],
	[81,"Other"],
	[83,"Foundation Drainage Install"],
	[83,"Fountain or Waterfall Install"],
	[83,"Gazebo or Freestanding Porch - Build or Install"],
	[83,"Greenhouse or Conservatorium - Build"],
	[83,"Landscaping for Yard or Garden"],
	[83,"Pond Install"],
	[83,"Retaining Walls Over 3 ft"],
	[83,"Retaining Walls Under 3 ft"],
	[83,"Other"],
	[84,"Professional Moving Service - Long Distance / Out of State"],
	[84,"Other"],
	[85,"Exterior Painting"],
	[85,"Interior Painting"],
	[85,"Specialty Painting - Faux Finishes"],
	[85,"Specialty Painting - Textures"],
	[85,"Other"],
	[87,"Install a Water Heater"],
	[87,"Install or Replace a Sewer Main"],
	[87,"Install or Replace a Water Main"],
	[87,"Install Plumbing for an Addition or Remodel"],
	[87,"Plumbing Repair"],
	[87,"Other"],
	[88,"Install Asphalt Shingle Roofing"],
	[88,"Install Flat, Foam, or Single Ply Roofing"],
	[88,"Install Gutters"],
	[88,"Install Metal Roofing"],
	[88,"Install Natural Slate Roofing"],
	[88,"Install Traditional Tile Roofing"],
	[88,"Install Wood or Composite Roofing"],
	[88,"Roofing Repair"],
	[88,"Other"],
	[89,"Install Brick or Stone Siding"],
	[89,"Install Metal Siding"],
	[89,"Install Stucco Siding"],
	[89,"Install Vinyl Siding"],
	[89,"Install Wood or Fiber-Cement Siding"],
	[89,"Other"],
	[91,"Solar Electrical"],
	[91,"Solar Thermal"],
	[93,"Build or Install a Swimming Pool"],
	[93,"Remodel a Swimming Pool"],
	[93,"Other"],
	[94,"Install Ceramic & Porcelain Tile"],
	[94,"Install Natural Stone Tile"],
	[94,"Tile Repair"],
	[94,"Other"],
	[95,"Install Brick, Stone or Block Wall"],
	[95,"Install Plaster"],
	[95,"Other"],
	[96,"Install Multiple Windows"],
	[96,"Install One Window"],
	[96,"Install Storm Windows"],
	[96,"Window Cleaning"]
];

function hi_fill_type(_tkfld) {
	if (_tkfld==null || _tkfld.type.toLowerCase().indexOf("select")!=0)
		return;
	if (_tkfld.options.length)
		_tkfld.options.length=0;
	_tkfld.options[_tkfld.options.length] = new Option("Select Project", "");
	for (var x=0;x<hi_cats.length;x++) {
		var s01 = hi_cats[x][1];
		_tkfld.options[_tkfld.options.length] = new Option(s01, hi_cats[x][0]);
	}
}

function hi_fill_task(_ofld, _tkfld) {
	if (_ofld==null || _tkfld==null || _tkfld.type.toLowerCase().indexOf("select")!=0)
		return;
	var val = parseInt(_ofld.value);
	if (_tkfld.options.length)
		_tkfld.options.length=0;
	_tkfld.options[_tkfld.options.length] = new Option("Select Task", "");
	_tkfld.style.visibility ="hidden";
	for (var x=0;x<hi_tasks.length;x++) {
		if (hi_tasks[x][0]== val){
			var s01 = hi_tasks[x][1];
			_tkfld.options[_tkfld.options.length] = new Option(hi_tasks[x][1], hi_tasks[x][1]);
			
		}
	}
	if (_tkfld.options.length > 1)
	_tkfld.style.visibility ="visible";
}


function validateForm(form) {
	if (testIsValidObject(form.type)) {
		if (form.type.options.length > 0){
			if (form.type.options[form.type.selectedIndex].value==""){
				alert("Please select a Project.");
				form.type.focus();
				return false;
			}
		}
	}
	if (testIsValidObject(form.task)) {
		if (form.task.options.length > 1){
			if (form.task.options[form.task.selectedIndex].value==""){
				alert("Please select a Task.");
				form.task.focus();
				return false;
			}
		}
	}
	if (testIsValidObject(form.zip)) {
		var zipcode =form.zip;
		if (zipcode.value.length<=0){
			alert("Please enter your Zip Code.");
			zipcode.value="";
			zipcode.focus();
			return false;                
		}
		else{
			reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
			if (!reZip.test(zipcode.value)){
				alert("Please enter a valid Zip Code.");  
				zipcode.value="";
				zipcode.focus();         
				return false;
			}       
		}  
	}
	return true;
}

function testIsValidObject(objToTest) {
	if (objToTest == null || objToTest == undefined) {
		return false;
	}
	return true;
}



