function CheckTree(thisform, ptr, PidList, CidList){
	var ListOptions = thisform.SegmentID;
	if(ListOptions.length > 0){
		var bCheck = ptr.checked;
		var arrIdList;
		if(bCheck) arrIdList = PidList.split(",");
		else arrIdList = CidList.split(",");
		for(var i = (ListOptions.length-1); i >= 0; i--)
			for(var j=0; j < (arrIdList.length); j++)
				if(ListOptions[i].value == arrIdList[j]) ListOptions[i].checked = bCheck;
	}
}
	
function CheckAll(thisform, IdList){
	var ListOptions = thisform.SegmentID;
	var arrIdList = IdList.split(",");
	var allchecked = true;
	if(ListOptions.length > 0)
		for(var i = (ListOptions.length - 1); i >= 0; i--)
			for(var j=0; j <= (arrIdList.length - 1); j++)
				if((ListOptions[i].value == arrIdList[j]) && ListOptions[i].checked == false)
					allchecked = false;
	if(ListOptions.length > 0)
		for(var i = (ListOptions.length - 1); i >= 0; i--)
			for(var j=0; j <= (arrIdList.length - 1); j++)
				if(ListOptions[i].value == arrIdList[j])
					if (allchecked == false)
						ListOptions[i].checked = true;
					else
						ListOptions[i].checked = false;
}
	
//set proper form name here	
formSetmain(document.SUPPORTER158805);
onunload = fileClose;
function SubmitForm158805(thisform){
	if(thisform.SubmitButtom!=null) thisform.SubmitButtom.disabled = true;
	if(CheckForm158805(thisform)) thisform.submit();
	else if(thisform.SubmitButton!=null) thisform.SubmitButton.disabled = false;
}

function CheckForm158805(thisform){
	focus_field = "";
	warning = "";
	warning=checkField(thisform.first_name,"First Name",warning);warning=checkField(thisform.last_name,"Last Name",warning);warning=checkField(thisform.zip,"ZIP/Postal Code",warning);warning=checkSelect(thisform.Field2180641,"Question",warning);
	if(thisform.country.value=="US") {
	warning+=checkField(thisform.email_address,"Email",warning);
	}
	if(warning!=""){
		warning = "Please enter the following fields to continue:\n- "+warning+"";
		alert(warning);
		if(focus_field!="")
			focus_field.focus();
		return false;
	}
	if(thisform.email_address!=null){
		if(thisform.email_address.value!=""){
			if(validEmail(thisform.email_address.value, "You have entered an invalid email address.") == false){
				thisform.email_address.focus();
				return false;
			}
		}
	}
	if(thisform.email_address_1!=null){
		if(thisform.email_address_1.value!=""){
			if(validEmail(thisform.email_address_1.value) == false){
				//alert("Please enter a valid email address.");
				thisform.email_address_1.focus();
				return false;
			}
		}
	}
	if(thisform.email_address_2!=null){
		if(thisform.email_address_2.value!=""){
			if(validEmail(thisform.email_address_2.value) == false){
				//alert("Please enter a valid email address.");
				thisform.email_address_2.focus();
				return false;
			}
		}
	}
	if ((thisform.zip != null) && (thisform.country != null)){ 
		if (checkCountryZip(thisform.zip, thisform.country, "Please enter a correct format zip/postal code") == false) {
			thisform.zip.focus();
			return false;
		}
	}
	
	// thisform.action = "**rootURLCommunity**apps/ka/ct/contactadd.asp?c=**cindex**&b=**bindex**&targetURL=**targetURL**"; 
	
	return true;
}