function trackFormRFQ(form) {
	if(checkValueRFQ(form)) { 
		insitePostRFQ(form); 
	}
	setTimeout(function(){form.submit();},500); // increase this value if it's not tracking properly
}

function checkValueRFQ(form) {

	// Add additional fields if needed or more advanced validation below here.
	if (form.Contact.value == "") { return false; }
	
	return true;
}

function insitePostRFQ(form) {

	//save the action to insite
	url = "http://www.topfloortech.com/insitemetrics/uRMJ/uniformv2.php?actk=10ssxq2-48wmn7aeq9";
	//url += "?actk=ACTION_KEY"; //unique action key
	url += "&imReferrerField=" + escape(document.referrer);
	url += "&imEmailField=" + escape(form.email.value);
	url += "&Name=" + escape(form.Contact.value);
	url += "&Phone=" + escape(form.Phone.value);
	url += "&Requirements=" + escape(form.SpecialReq.value);
	url += "&Company=" + escape(form.Company.value);
	url += "&Date Needed=" + escape(form.DateNeeded.value);
	url += "&Fax=" + escape(form.Fax.value);
	url += "&Address=" + escape(form.Address.value);
	url += "&Parlt=" + escape(form.PartNum.value);
	url += "&Rev=" + escape(form.Rev.value);
	url += "&NewPart=" + escape(getCheckedRadio('NewPart'));
	
	
	
	url += "&EAU=" + escape(form.EAU.value);
	url += "&QuoteQuantity1=" + escape(form.QuoteQuantity1.value);
	url += "&QuoteQuantity2=" + escape(form.QuoteQuantity2.value);
	url += "&QuoteQuantity3=" + escape(form.QuoteQuantity3.value);
	url += "&QuoteQuantity4=" + escape(form.QuoteQuantity4.value);
	url += "&QuoteQuantity5=" + escape(form.QuoteQuantity5.value);
	url += "&QuoteQuantity6=" + escape(form.QuoteQuantity6.value);
	url += "&SplitShipment=" + escape(getCheckedRadio('SplitShipment'));
	
	
	url += "&TimeFrame=" + escape(form.TimeFrame.value);
	url += "&ReleaseQuantity=" + escape(form.ReleaseQuantity.value);
	url += "&Dimension1=" + escape(form.Dimension1.value);
	url += "&Dimension2=" + escape(form.Dimension2.value);
	url += "&Tolerance=" + escape(form.Tolerance.value);
	url += "&Screen=" + escape(getCheckedBoxes('Screen'));
	url += "&Etch=" + escape(getCheckedBoxes('Etch'));
	url += "&MetalPhoto=" + escape(getCheckedBoxes('MetalPhoto'));
	url += "&FabOnly=" + escape(getCheckedBoxes('FabOnly'));
	url += "&Style=" + escape(getCheckedRadio('Style'));
	
	url += "&Color1=" + escape(form.Color1.value);
	url += "&Color2=" + escape(form.Color2.value);
	url += "&Color3=" + escape(form.Color3.value);
	url += "&Color4=" + escape(form.Color4.value);
	url += "&Color5=" + escape(form.Color5.value);
	url += "&MaterialType=" + escape(form.MaterialType.value);
	url += "&MaterialThickness=" + escape(form.MaterialThickness.value);
	url += "&HoleRequirements=" + escape(form.HoleRequirements.value);
	url += "&Locations=" + escape(form.Locations.value);
	url += "&Corners=" + escape(getCheckedRadio('Corners'));
	
	
	url += "&Radius=" + escape(form.Radius.value);
	url += "&HowMany=" + escape(form.HowMany.value);
	
	url += "&Serialization=" + escape(getCheckedRadio('Serialization'));
	url += "&Consecutive=" + escape(getCheckedRadio('Consecutive'));
	url += "&FilledBlack=" + escape(getCheckedRadio('FilledBlack'));
	url += "&Maximum=" + escape(getCheckedRadio('Maximum'));
	url += "&Adhesive=" + escape(getCheckedRadio('Adhesive'));
	url += "&Premask=" + escape(getCheckedRadio('Premask'));
	url += "&AdhesiveOption=" + escape(getCheckedRadio('AdhesiveOption'));
	
	
	url += "&AdhesiveType=" + escape(form.AdhesiveType.value);
	url += "&AdhesiveThickness=" + escape(form.AdhesiveThickness.value);
	url += "&RollLabel=" + escape(getCheckedBoxes('RollLabel'));
	url += "&Application=" + escape(getCheckedRadio('Application'));
	url += "&ApplicationType=" + escape(getCheckedBoxes('ApplicationType'));
	url += "&PlasticType=" + escape(form.PlasticType.value);
	url += "&ApplicationType=" + escape(getCheckedBoxes('ApplicationType'));
	url += "&SampleSupplied=" + escape(getCheckedBoxes('SampleSupplied'));
	url += "&SpecialReq=" + escape(form.SpecialReq.value);
	url += "&DrawingAvailable=" + escape(getCheckedBoxes('DrawingAvailable'));
	url += "&SampleAvailable=" + escape(getCheckedBoxes('SampleAvailable'));
	url += "&RoemerArt=" + escape(getCheckedBoxes('RoemerArt'));
	url += "&CustomerArt=" + escape(getCheckedBoxes('CustomerArt'));
	url += "&ProofforApproval=" + escape(getCheckedBoxes('ProofforApproval'));

	img = new Image(0,0);
 	img.src = url;
	
	function getCheckedRadio(r_name) {
	var radioButtons = document.getElementsByName(r_name);
	var value='';
	for (var x = 0; x < radioButtons.length; x ++) {
		if (radioButtons[x].checked) { value = radioButtons[x].value; }  
	}
	return value;
}

function getCheckedBoxes(c_name) {
	var checkBoxes = document.getElementsByName(c_name);
	var value="";
	for (var x = 0; x < checkBoxes.length; x ++) {
		if (checkBoxes[x].checked) { value += checkBoxes[x].value+","; }  
	}
	if(value!=""){ value = value.substring(0, value.length-1); }
	return value;
}
}