﻿function mquotesend(z, s) {
    var zv = document.getElementById(z).value;
    var sv = document.getElementById(s).value;
    if (zv.toLowerCase() == "zip code") zv = "";
    window.location.href = "/quotes/residential/?fz=" + zv + "&ts=" + sv;
    return false;
}

function toggle(a, b, type) {
    if (type == undefined) type = 'block';
    if(a != null) document.getElementById(a).style.display = "none";
    if (b != null) document.getElementById(b).style.display = type;
    return false;
}

function sendbuttonclick(buttonName, e) {
    var key;
    if (window.event) key = window.event.keyCode;
    else key = e.which;
    if (key == 13) {
        var btn = document.getElementById(buttonName);
        if (btn != null) { //If we find the button click it
            btn.click();
            event.keyCode = 0
        }
    }
}

function onfocusInput(e, initvalue, c) {
    if (e.value.toLowerCase == initvalue.toLowerCase) {
        e.value = "";
        e.setAttribute("class", c);
    }
    if (e.onblur == null) {
        e.onblur = function () {
            if (e.value == "") {
                e.value = initvalue;
                e.setAttribute("class", c + " gtxt");
            }
        }
    }
}
