/* begin spam killer */
function CedarockKS(JC0,handler) {  /* "KS" = kill spam */
    var JC1 = "cedarock"            /* this is the "do" in "do.us" */
    var JC2 = "com"                 /* this is the "us" in "do.us" */
    if (handler=="mto") {           /* write mail to only */
        document.write("<a href=\"mai")
        document.write("lto:"+JC0+"@")
        document.write(JC1+"."+JC2+"\">")
    }
    if (handler=="add") {           /* write address only */
        document.write(JC0+"@")
        document.write(JC1+"."+JC2)
    }
    if (handler=="all") {           /* write mail to and address */
        document.write("<a href=\"mai")
        document.write("lto:"+JC0+"@")
        document.write(JC1+"."+JC2+"\">")
        document.write(JC0+"@")
        document.write(JC1+"."+JC2)
        document.write("</a>")
    }
    return true
}
/* end of spam killer */


/* start of CVgeneric */
function CVgeneric() {
    for(i=0; i<document.contact.elements.length; i++) {
        if ((document.contact.elements[i].type != "submit") && (document.contact.elements[i].type != "checkbox") && (document.contact.elements[i].type != "textarea")) {
            document.contact.elements[i].className = "fieldinquiry";
        }
    }
    if ((document.contact.email.value == "") && (document.contact.phone.value == "")) {
        alert("Would you like us to reply by phone or email?  Please provide at least one way for us to answer your request.  Thank you.");
        document.contact.email.className = "fieldinquiryerror";
        document.contact.phone.className = "fieldinquiryerror";
        document.contact.email.focus();
        return false;
    }
    if (document.contact.verifytext.value == "") {
        alert("Please complete the anti-spam test.");
        document.contact.verifytext.className = "fieldinquiryerror";
        document.contact.verifytext.focus();
        return false;
    }
    if (document.contact.email.value != "") {
        document.contact.emailtest.value = "valid";
        document.cookie = "CedarockValidate=valid";
    }
    return true
}
/* end of CVgeneric */


/* start of CVrfq */
function CVrfq() {
    for(i=0; i<document.contact.elements.length; i++) {
        if ((document.contact.elements[i].type != "submit") && (document.contact.elements[i].type != "checkbox")) {
            document.contact.elements[i].className = "fieldrfq";
        }
    }
    if ((document.contact.email.value == "") && (document.contact.phone.value == "")) {
        alert("Would you like us to reply by phone or email?  Please provide at least one way for us to answer your request.  Thank you.");
        document.contact.email.className = "fieldrfqerror";
        document.contact.phone.className = "fieldrfqerror";
        document.contact.email.focus();
        return false;
    }
    if (document.contact.verifytext.value == "") {
        alert("Please complete the anti-spam test.");
        document.contact.verifytext.className = "fieldrfqerror";
        document.contact.verifytext.focus();
        return false;
    }
    if (document.contact.email.value != "") {
        document.contact.emailtest.value = "valid";
        document.cookie = "CedarockValidate=valid";
    }
    return true
}
/* end of CVrfq */


/* start of CVincentive */
function CVincentive() {
    var error = 0;
    for(i=0; i<document.contact.elements.length; i++) {
        if ((document.contact.elements[i].type != "submit") && (document.contact.elements[i].type != "checkbox")) {
            document.contact.elements[i].className = "fieldincentive";
        }
    }
    if (document.contact.verifytext.value == "") {
        document.contact.verifytext.className = "fieldincentiveerror";
        document.contact.verifytext.focus();
        error++;
    }
    if (document.contact.zip.value == "") {
        document.contact.zip.className = "fieldincentiveerror";
        document.contact.zip.focus();
        error++;
    }
    if (document.contact.state.selectedIndex == 0) {
        document.contact.state.className = "fieldincentiveerror";
        document.contact.state.focus();
        error++;
    }
    if (document.contact.city.value == "") {
        document.contact.city.className = "fieldincentiveerror";
        document.contact.city.focus();
        error++;
    }
    if (document.contact.address.value == "") {
        document.contact.address.className = "fieldincentiveerror";
        document.contact.address.focus();
        error++;
    }
    if (document.contact.company.value == "") {
        document.contact.company.className = "fieldincentiveerror";
        document.contact.company.focus();
        error++;
    }
    if (document.contact.phone.value == "") {
        document.contact.phone.className = "fieldincentiveerror";
        document.contact.phone.focus();
        error++;
    }
    if (document.contact.email.value == "") {
        document.contact.email.className = "fieldincentiveerror";
        document.contact.email.focus();
        error++;
    }
    if (document.contact.name.value == "") {
        document.contact.name.className = "fieldincentiveerror";
        document.contact.name.focus();
        error++;
    }
    if (error > 0) {
        alert("Please provide all requested information. Thank you!");
        return false;
    }
    document.contact.emailtest.value = "valid";
    document.cookie = "CedarockValidate=valid";
    return true
}
/* end of CVincentive */


/* start of ThankYou */
function cookieVal(cookieName) {
    thisCookie = document.cookie.split("; ")
    for (i=0; i<thisCookie.length; i++){
        if (cookieName == thisCookie[i].split("=")[0]){
            return thisCookie[i].split("=")[1]
        }
    }
    return 0
}
function ThankYou() {
    if (cookieVal("CedarockValidate") == "valid") {document.write("Our server has emailed a copy of your request to you for your records, and we will reply&nbsp;soon.")}
    else {document.write("We will reply&nbsp;soon.")}
}
/* end of ThankYou */
