﻿$((document)).ready(function () {
    $(".serviceImage").each(function () {
        this.onmouseover = function () {
            var navigate_url = $((this)).find(".url").val();
            $((this)).find("img").each(function () {
                if (this.className != "serviceShadow") {
                    this.original_image = this.src;
                    this.src = this.src.replace(".png", "_over.png");
                }
            });
            $((this)).find("*").each(function () {
                this.url = navigate_url;
                this.onclick = serviceImageClick;
            });
            document.body.style.cursor = "Pointer";
        }
        this.onmouseout = function () {
            $((this)).find("img").each(function () {
                if (this.className != "serviceShadow") {
                    this.src = this.original_image;
                }
            });
            $((this)).find("*").each(function () {
                this.onclick = null;
            });
            document.body.style.cursor = "Auto";
        }
    });
});

function serviceImageClick() {
    window.location = this.url;
}
