﻿
var whkUrl = location.href;
whkUrl = whkUrl.replace("http://", "");
whkUrl = whkUrl.substring(0, whkUrl.indexOf("."));
 
if (whkUrl == "hrb") {

    location.href = "http://www.95195.cc/hrb/";
    
}
$(function() {
 
  
  


    $("#s1").change(dzzzChange);
    $("#btnSearch1").click(function() {
        var v = $("#txtSearch1").val();
        if (v.length == 0 || v == "请输入关键字") {
            $("#txtSearch1").val("请输入关键字");
            return;
        }

        location.href = "/MyChannel/Slist.aspx?keyword=" + escape(v);


    });

getMemberConent();
   

});

//取得会员数量
function getMemberConent() {

    $.get("/ashx/Default.ashx", { a: "" + Math.random() + "", type: "16" }, function(data) {

        if (data.length > 0) {

            $("#MemberCount").html(data);

        }
    });

}

//取得一个视频
function getVideo(id) {
    
    $.get("/ashx/Default.ashx", { vid: "" + escape(id) + "", a: "" + Math.random() + "", type: "1" }, function(data) {
       
        if (data.length > 0) {

            $('.vi1').html(data);

        }
    });

}
//更改按钮样式
function changeClass(con) {
    $(".o2").attr("class", "o1");
    con.className = "o2";
}

 
function dzzzChange() {
    if ($("#s1").val() == "/skin/dzsc/di1qi.exe")
        $("#imgdm").attr("src", "images/1.gif");
    if ($("#s1").val() == "/skin/dzsc/di2qi.exe")
        $("#imgdm").attr("src", "images/2.gif");
    if ($("#s1").val() == "/skin/dzsc/di3qi.exe")
        $("#imgdm").attr("src", "images/disanqi.jpg");
    if ($("#s1").val() == "/skin/dzsc/di4qi.exe")
        $("#imgdm").attr("src", "images/bsd4.jpg");
}
function dowcdz() {
    window.location = document.getElementById("s1").value;
}

//添加礼品到礼品盒
function addGif(id, pname) {

    $.get("/ashx/Default.ashx", { a: "" + Math.random() + "", type: "9", pid: id, name: pname }, function(data) {
        if (data == "0") {
            alert("请登录");
            location.href = "/login.aspx?url=" + location.href;
        }
        else if (data == "1") {
            location.href = "/UCenter/shop_giftBox.aspx";
        }
        else if (data == "2") {

            alert("抱歉，添加失败");
        }



    });
}


function myGod(id, w, n) {
    var box = document.getElementById(id), can = true, w = w || 1500, fq = fq || 10, n = n == -1 ? -1 : 1;
    box.innerHTML += box.innerHTML;
    box.onmouseover = function() { can = false };
    box.onmouseout = function() { can = true };
    var max = parseInt(box.scrollHeight / 2);
    new function() {
        var stop = box.scrollTop % 18 == 0 && !can;
        if (!stop) {
            var set = n > 0 ? [max, 0] : [0, max];
            box.scrollTop == set[0] ? box.scrollTop = set[1] : box.scrollTop += n;
        };
        setTimeout(arguments.callee, box.scrollTop % 18 ? fq : w);
    };
}
 
 
 
