        function checkboxClick(control)
        {
            if(!control)
                return false;
            else if (control.id == "contact_ind") {
                if(f1.contact_bus.checked && control.checked)
                    f1.contact_bus.checked = false;
                return true;
                }
            else if (control.id == "contact_bus") {
                if(f1.contact_ind.checked && control.checked)
                    f1.contact_ind.checked = false;
                return true;
                }
            return false;
        }
        function $(a) { return document.getElementById(a); } 
        function submitform()
        {
            var allowSubmit = true;
            if(!document.f1.contact_ind.checked && !document.f1.contact_bus.checked )
            {
                jQuery("#type_error").css("display", "");
                //$("whois").style.fontWeight = "bold";
                //alert("Please choose individual or business.");
                document.f1.contact_ind.focus();
                allowSubmit = false;
            }
            else
	    {
                jQuery("#type_error").css("display", "none");
                //$("whois").style.color = "#ffffff";
	     }

            if(document.f1.email.value == "")
            {
                jQuery("#email_error").css("display", "");
                //document.f1.email.style.backgroundColor = "#8E0011";
                document.f1.email.focus();
                allowSubmit = false;
            }
            else {
                jQuery("#email_error").css("display", "none");
		//document.f1.email.style.backgroundColor = "#ffffff";
            	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
            	var address = document.f1.email.value;
            	if(reg.test(address) == false) {
                	//alert("Please supply a valid email address!");
                	//document.f1.email.style.backgroundColor = "#8E0011";
                	jQuery("#email_invalid").css("display", "");
                	document.f1.email.focus();
                	return false;
            	}
            	else {
                	jQuery("#email_invalid").css("display", "none");
			//document.f1.email.style.backgroundColor = "#ffffff";
		}

	    }

            if(document.f1.phone.value == "")
            {
                jQuery("#phone_error").css("display", "");
                //document.f1.phone.style.backgroundColor = "#8E0011";
                document.f1.phone.focus();
                allowSubmit = false;
            }
            else 
                jQuery("#phone_error").css("display", "none");
		//document.f1.phone.style.backgroundColor = "#ffffff";

            if(document.f1.name.value == "")
            {
                jQuery("#name_error").css("display", "");
		//document.f1.name.style.backgroundColor = "#8E0011";
                document.f1.name.focus();
                allowSubmit = false;
            }
            else 
                jQuery("#name_error").css("display", "none");
		//document.f1.name.style.backgroundColor = "#ffffff";

            if(document.f1.zip.value == "")
            {
		jQuery("#zip_error").css("display", "");
                //document.f1.zip.style.backgroundColor = "#8E0011";
                document.f1.zip.focus();
                allowSubmit = false;
            }
            else 
		jQuery("#zip_error").css("display", "none");
		//document.f1.zip.style.backgroundColor = "#ffffff";
		
	    if(typeof document.f1.captcha != 'undefined') {
		jQuery("#captcha_error").css("display", "none");
		    jQuery.ajax({
			type: 'POST',
			url: '/captcha/captcha.php',
			data: ({captcha : document.f1.captcha.value }),
			async: false,
			success: function(responseText) {
				if(responseText!=='Passed!') {
					jQuery("#captcha_error").css("display", "");
					allowSubmit = false;
					jQuery(".ajax-fc-container").empty();
					jQuery(".ajax-fc-container").captcha();
					return false;
				} else {
					allowSubmission(allowSubmit);
				}
			}
		});
	    } else {
		allowSubmit = false;
		jQuery("#captcha_error").css("display", "");
		return false;
	    }
	    
        }
	
	function allowSubmission(allowSubmit) {
	    if(!allowSubmit)
		return false;
		

	    var ind=document.f1.contact_ind.checked ? 1 : 0;
	    var url = "php/submit.php?name="+document.f1.name.value+"&zip="+document.f1.zip.value+"&phone="+document.f1.phone.value+"&email="+document.f1.email.value+"&type="+ind+"&details="+document.f1.describe.value;
	    //if (window.showModalDialog) {
		//var retval = window.showModalDialog(url,"Further Details",
			//"dialogWidth:850px;dialogHeight:600px");
		//if ((typeof retval)!="undefined" && (""+retval != "null")) {
			//window.location = retval + "&modal=false";
			//return false;
		//}
	    //} else {
		//window.open(url,"Further Details",
			//"height=600,width=850,toolbar=no,directories=no,status=no,continued from previous linemenubar=no,scrollbars=no,resizable=no,modal=yes");
					//} 
	    document.f1.action = url;
	    //hideBackground();
	    return true;
	}

