﻿$(function() {
    var title = document.title.substring(0, 4);
    if (title == "北京数字" | title == "公司客户") {
        $(".customer>tbody>tr>td>a>img").css("border-width", "1px");
        $(".customer>tbody>tr>td>a>img").mouseover(function() { $(this).css("border-color", "orange"); });
        $(".customer>tbody>tr>td>a>img").mouseout(function() { $(this).css("border-color", "white"); });
    }
    if (title == "北京数字") {
        $("#tab>tbody>tr>td>img").mouseover(function() {
            var src = $(this).attr("src");
            var n = src.search("_");
            if (n == -1) {
                $(this).attr("src", src.replace(".", "_h."));
            }
        });
        $("#tab>tbody>tr>td>img").mouseout(function() {
            var src = $(this).attr("src");
            var n = src.search("_h");
            if (n > -1) {
                $(this).attr("src", src.replace("_h.", "."));
            }
        });
        $(".div1").parent("td").mouseover(function() { $(this).css("background-color", "#EEE"); });
        $(".div1").parent("td").mouseout(function() { $(this).css("background-color", "#fff"); });
    }
    if (title == "成功案例") {
        $(function() {
            var str = location.href;
            var type = 2;
            var m = str.search("type=");
            if (m != -1) {
                type = str.substring(m + 5, m + 6);
            }
            for (var i = 0; i < 5; i++) {
                if (i != type - 1) {
                    $("#portfolio>tbody>tr>td>a>img").eq(i).mouseover(function() {
                        var src = $(this).attr("src");
                        var n = src.search("_");
                        if (n == -1) {
                            $(this).attr("src", src.replace(".", "_s."));
                        }
                    });
                    $("#portfolio>tbody>tr>td>a>img").eq(i).mouseout(function() {
                        var src = $(this).attr("src");
                        var n = src.search("_");
                        if (n != -1) {
                            $(this).attr("src", src.replace("_s.", "."));
                        }
                    });
                }
            }

        });
        $("#casestory>tbody>tr>td>a>img").mouseover(function() {
            var src = $(this).attr("src");
            var n = src.search("_");
            if (n == -1) {
                $(this).attr("src", src.replace(".", "_s."));
            }
        });
        $("#casestory>tbody>tr>td>a>img").mouseout(function() {
            var src = $(this).attr("src");
            var n = src.search("_");
            if (n != -1) {
                $(this).attr("src", src.replace("_s.", "."));
            }
        });
    }
    if (title == "服务项目") {
        $("#tab>tbody>tr>td>a>img").mouseover(function() {
            var src = $(this).attr("src");
            var n = src.search("_");
            if (n == -1) {
                $(this).attr("src", src.replace(".", "_h."));
            }
        });
        $("#tab>tbody>tr>td>a>img").mouseout(function() {
            var src = $(this).attr("src");
            var n = src.search("_h");
            if (n > -1) {
                $(this).attr("src", src.replace("_h.", "."));
            }
        });
    }
});