﻿//PNG File Fix
function png() {
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])

    if ((version >= 5.5) && (document.body.filters)) {
        for (var i = 0; i < document.images.length; i++) {
            var img = document.images[i]
            var imgName = img.src.toUpperCase()
            if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                var imgID = (img.id) ? "id='" + img.id + "' " : ""
                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                var imgStyle = "display:inline-block;" + img.style.cssText
                if (img.align == "left") imgStyle = "float:left;" + imgStyle
                if (img.align == "right") imgStyle = "float:right;" + imgStyle
                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                var strNewHTML = "<span " + imgID + imgClass + imgTitle
                         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
                         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                img.outerHTML = strNewHTML
                i = i - 1
            }
        }
    }
}
function loadRequestQuote(service) {
    var width = 800;
    var height = 800;
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var from_top = windowHeight / 2 - height / 2;
    var from_left = windowWidth / 2 - width / 2;
    var toolbar = 'no';
    var location = 'no';
    var directories = 'no';
    var status = 'no';
    var menubar = 'no';
    var scrollbars = 'yes';
    var resizable = 'yes';
    var atts = 'width=' + width + 'show,height=' + height + ',top=' + from_top + ',screenY=';
    atts += from_top + ',left=' + from_left + ',screenX=' + from_left + ',toolbar=' + toolbar;
    atts += ',location=' + location + ',directories=' + directories + ',status=' + status;
    atts += ',menubar=' + menubar + ',scrollbars=' + scrollbars + ',resizable=' + resizable;
    window.open("http://www.phdmaintenance.com/requestquote.aspx?" + service, 'win_name', atts);
}

function selectService() {
    var qs = window.location.search.substring(1);
    //var ddl = document.getElementById("ddlServices");
    if (qs != "lm") {
        $("#cblm").attr('checked', false);
    } else {
        $("#cblm").attr('checked', true);
    }
    if (qs != "e") {
        $("#cbe").attr('checked', false);
    } else {
        $("#cbe").attr('checked', true);
    }
    if (qs != "w") {
        $("#cbw").attr('checked', false);
    } else {
        $("#cbw").attr('checked', true);
    }
    if (qs != "sfc") {
        $("#cbsfc").attr('checked', false);
    } else {
        $("#cbsfc").attr('checked', true);
    }
    if (qs != "f") {
        $("#cbf").attr('checked', false);
    } else {
        $("#cbf").attr('checked', true);
    }
    if (qs != "la") {
        $("#cbla").attr('checked', false);
    } else {
        $("#cbla").attr('checked', true);
    }
    if (qs != "sr") {
        $("#cbsr").attr('checked', false);
    } else {
        $("#cbsr").attr('checked', true);
    }
    if (qs != "sa") {
        $("#cbsa").attr('checked', false);
    } else {
        $("#cbsa").attr('checked', true);
    }
    if (qs != "gi") {
        $("#cbgi").attr('checked', false);
    } else {
        $("#cbgi").attr('checked', true);
    }
    if (qs != "mi") {
        $("#cbmi").attr('checked', false);
    } else {
        $("#cbmi").attr('checked', true);
    }
    if (qs != "tt") {
        $("#cbtt").attr('checked', false);
    } else {
        $("#cbtt").attr('checked', true);
    }
    if (qs != "ti") {
        $("#cbti").attr('checked', false);
    } else {
        $("#cbti").attr('checked', true);
    }
    if (qs != "tr") {
        $("#cbtr").attr('checked', false);
    } else {
        $("#cbtr").attr('checked', true);
    }
    if (qs != "rw") {
        $("#cbrw").attr('checked', false);
    } else {
        $("#cbrw").attr('checked', true);
    }
    if (qs != "bp") {
        $("#cbbp").attr('checked', false);
    } else {
        $("#cbbp").attr('checked', true);
    }
}
function focusFirstName() {
    document.getElementById("txtName").focus();
}

