﻿/// <reference path="jquery-1.4.1-vsdoc.js" />
jQuery(document).ready(function () {
    
});

function showxw(obj) {
    for (var i = 1; i < 5; i++) {
        if (i == obj) {
            $("#index_" + obj).attr("class", "hk_nav1");
            $("#indexs_" + obj).show();

        } else {
            $("#index_" + i).attr("class", "hk_nav2");
            $("#indexs_" + i).hide();
        }
    }
}

function IsSearch() {
    var search = $("#search").val();
    if (search == "请输入关键字！") {
        search = "";
        $("#search").focus();
    } else if (search == "") {
        alert("请输入关键字！");
        $("#search").focus();
    } else {
       // var $selectsearch = document.getElementById("selectsearch").value;
        window.location.href = "Search.aspx?key=" + encodeURIComponent(search);
    }
}
function ShowMessage(showobj, hideobj) {
    $("#" + hideobj).hide();
    $("#" + showobj).show();
}

function MM_jumpMenu(targ, selObj, restore) {
    eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
    if (restore) selObj.selectedIndex = 0;
}

function jobsave() {

    if ($("#Postion").val() == "") {
        alert("请输入应聘职位！");
        $("#Postion").focus();
        return false;
    }

    if ($("#name").val() == "") {
        alert("请输入姓名！");
        $("#name").focus();
        return false;
    }
    $year = document.getElementById("year").value;
    if ($year == "年") {
        alert("请选择年份！");
        document.getElementById("year").focus();
        return false;
    }
    $month = document.getElementById("month").value;
    if ($month == "月") {
        alert("请选择月份！");
        document.getElementById("month").focus();
        return false;
    }
    $daty = document.getElementById("daty").value;
    if ($daty == "日") {
        alert("请选择那一天！");
        document.getElementById("daty").focus();
        return false;
    }
    if ($("#sfzId").val() == "") {
        alert("请输入身份证号码！");
        $("#sfzId").focus();
        return false;
    }
    if ($("#telephone").val() == "") {
        alert("请输入电话！");
        $("#telephone").focus();
        return false;
    }
    return true;
}

function savetousu() {

    if ($("#txttopic").val() == "") {
        alert("请输入主题！");
        $("#txttopic").focus();
        return false;
    }

    if ($("#txtrmark").val() == "") {
        alert("请输入描述！");
        $("#txtrmark").focus();
        return false;
    }

    if ($("#txtjg").val() == "") {
        alert("请输入希望结果！");
        $("#txtjg").focus();
        return false;
    }

    if ($("#txtname").val() == "") {
        alert("请输入投诉人名字！");
        $("#txtname").focus();
        return false;
    }

    if ($("#txttel").val() == "") {
        alert("请输入联系电话！");
        $("#txttel").focus();
        return false;
    }
    return true;
}
function savemessage() {
    if ($("#txtzt").val() == "") {
        alert("请输入主题！");
        $("#txtzt").focus();
        return false;
    }
    if ($("#txtname").val() == "") {
        alert("请输入姓名！");
        $("#txtname").focus();
        return false;
    }
    if ($("#txttel").val() == "") {
        alert("请输入联系电话！");
        $("#txttel").focus();
        return false;
    }
    return true;
}
var interval;
function Files(StrTitle,obj, Url) {
    var boardDiv= "<div class=\"tous\" id='divPanel'>";
    boardDiv += "<div style=\" position:relative; width:100%;height:100%;\">";
    boardDiv += "<div class=\"tous_topbg\"></div>";
    boardDiv += "<div class=\"tous_midbg\">";
    boardDiv += "<div class=\"tous_column\"><Span>" + StrTitle + "</Span></div>";
    boardDiv += "<iframe frameborder=\"0\" src=\""+Url+"\" style= \"width:330px;height:" + obj + "px;\"></iframe>";
    boardDiv += "</div>";
    boardDiv += "<div class=\"tous_btmbg\"></div>";
    boardDiv += "</div>";
    boardDiv += "</div>";
    boardDiv += "<div id='divPane2' style='position:absolute;left:0px;top:0px;z-index:2;display:none;background-color:#000;margin:0px auto;'></div>";
    $(document.body).append(boardDiv);
    interval = setInterval("YIDONG("+obj+")", 200);

}

function YIDONG(obj) {
    $height = ($(window).height() - obj-40) / 2 + document.documentElement.scrollTop;
    $left = ($("html").width() - 390) / 2;
    $height2 = $("body").height();
    $left2 = $("body").width();
    
    $("#divPanel").css({ left: $left });
    $("#divPanel").css({ top: $height });

    $("#divPane2").css({ width: $left2 });
    $("#divPane2").css({ height: $height2 });
    $("#divPane2").css({ filter: 'alpha(opacity=10)' });
    $("#divPane2").css({ opacity: '0.1' });
    $("#divPanel").show();
    $("#divPane2").show();
}

function AddFiles(type,obj) {

    switch (type) {
        case 1:
            Files('投诉',obj, "/toushu.aspx");
            break;
        case 2:
            Files('挂号', obj, "/guahao.aspx");
            break;
        case 3:
            Files('帮助中心',obj, "/bzzx.aspx");
            break;
        case 4:
            Files('留言板', obj, "/message.aspx");
            break;
        default:
            document.write("This type does not exist!");
            break;
    }

}


/*关闭拖动DIV*/
function ShowDivColose(msvalue) {
    parent.clearInterval(interval);
    parent.RemoveFiles();

}
/*移除拖拽div*/
function RemoveFiles() {
    clearInterval(interval);
    if ($("#divPanel") != null) {
        $("#divPanel").remove();
    }
    if ($("#divPane2") != null) {
        $("#divPane2").remove();
    }
}

function yishen(obj) {
    for (var i = 1; i < 8; i++) {
        if (i == obj) {
            $("#ys" + obj).attr("class", "zjjs_nav1");
            $("#ys_" + obj).show();

        } else {
            $("#ys" + i).attr("class", "zjjs_nav2");
            $("#ys_" + i).hide();
        }
    }
}
