﻿$(function () {
    showImg(0);
    var len = $("#idNum > li").length;
    var index = 0;
    $("#idNum li").mouseover(function () { index = $("#idNum li").index(this); showImg(index); });
    //滑入 停止动画，滑出开始动画.
    $('#idTransformView').hover(function () {
        if (MyTime) { clearInterval(MyTime); }
    }, function () {
        MyTime = setInterval(function () {
            showImg(index); index++; if (index == len) { index = 0; }
        }, 3000);
    });
    //自动开始
    var MyTime = setInterval(function () {
        showImg(index); index++; if (index == len) { index = 0; }
    }, 3000);
})
// Demo1 : 关键函数：通过控制top ，来显示不通的幻灯片
function showImg(i) {
    $("#idSlider").stop(true, false).animate({ left: -745 * i }, 500);
    $("#idNum li").eq(i).addClass("on").siblings().removeClass("on");
}

function menuSwitch(num) {
    for (var id = 0; id <= 6; id++) {
        if (id == num) {
            $("#qh_con" + id)[0].style.display = "block";
            $("#mynav" + id)[0].className = "nav_on";
        }
        else {
            $("#qh_con" + id)[0].style.display = "none";
            $("#mynav" + id)[0].className = "";
        }
    }
}

function view(model, id) {
    window.open('/' + model + '/View.aspx?ID=' + id, 'View', 'height=400,width=550,top=' + (window.screen.height - 400) / 2 + ',left=' + (window.screen.width - 550) / 2 + ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
}

function UrlArgsJump(jumptourl) {
    this.location.search = jumptourl;
}

function OpenLogin(mobile) {
    window.open('/Send.aspx?mobile=' + mobile, 'Login', 'height=400,width=550,top=' + (window.screen.height - 400) / 2 + ',left=' + (window.screen.width - 550) / 2 + ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
}

function OpenSendPush(mobile) {
    window.open('/Send.aspx?Part=SendPush&amp;mobile=' + mobile, 'SendPush', 'height=400,width=550,top=' + (window.screen.height - 400) / 2 + ',left=' + (window.screen.width - 550) / 2 + ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
}

function OpenNewestNews() {
    window.open('/NewestNews.aspx', 'NewestNews', 'height=400,width=550,top=' + (window.screen.height - 400) / 2 + ',left=' + (window.screen.width - 550) / 2 + ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
}

function OpenOtherpage(gotourl) {
    window.open(gotourl, 'gotourl', 'height=400,width=550,top=' + (window.screen.height - 400) / 2 + ',left=' + (window.screen.width - 550) / 2 + ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
}