﻿var myarray = new Array("http", "www", "src", "插你", "我操", "短信投票", "承接", "联系电话", "投票服务", "插下", "日你", "日死你", "插下你", "插死你", "插一下", "搞你", "和你搞", "bb", "sb", "小b", "小样",
"投票联盟", "解决投票", "我日", "鸡巴", "你妈B", "你妈的", "操你妈", "干你", "干你妈", "干你娘", "干你老母", "日你老母", "操你老母", "插你老母");
var pretext;
document.execCommand("BackgroundImageCache", false, true); //防止css背景图闪烁
function checktxtdiv(o) {
    var v = document.getElementById(o).value.toLowerCase();
    if (v.length < 5) { alert("发贴内容太少"); return false; }
    for (i = 0; i < myarray.length; i++) {
        if (v.replace(/[ ]/g, "").indexOf(myarray[i]) != -1) { alert("内容包括禁止使用的字句"); return false; }
    }
    if (pretext == v) { alert("请勿重复发言,谢谢合作!"); return false; }
    pretext = v;
    return true;
}

function SendAjax (url, target) {
    $("#" + target).html("<img src='/image/Loading.gif'/>");
    $.post(url, null, function (responsexx) {
        $("#" + target).html(responsexx);
        $.cleanup;
        CollectGarbage();
    });
}
function SignOut() {
    SendAjax("/quit.aspx", null);
    document.location.href = document.location.href;
}

function ShowWin(title,url,width,height) {
    win({ title: title, fixPosition: true, maxBtn: true, minBtn: true, width: width, height: height, iframe: { src: url }, handler: ok })
}
//关闭或应用按钮时触发事件
function ok(tp) {
    // msgbox('你已经点击了退出,哟吉？' + tp);
}

//读取产品类型
function GetProductType(div) {
     SendAjax("/command/getproducttype.aspx", "dropmenu");
}
function GetGreen(div) {
     SendAjax("/command/green.aspx", div);
}

var catchmenudiv;
$(function () {
    //**菜单**===================================================
    $(".homemenu").mousemove(function () { //移动到菜单显示子菜单
        var typeid = this.id;
        if (catchmenudiv != typeid) {
            try {//还原上一次记录的菜单背景颜色为默认颜色
                $("#" + catchmenudiv).css({ "background": "#f3f3f3", "color": "#222222" });
            }
            catch (e) {
            }
            //元素定位
            $("#" + typeid).css({ "background": "#8c0b01", "color": "white" });
            var top = $("#" + typeid).offset().top;
            var left = $("#" + typeid).offset().left;
            $("#submenudiv").css({ "border": "solid 3px #8c0b01", "top": top, "left": left + 205, "position": "absolute" }).show("slow").html("<img src='/image/Loading.gif'/>"); //.animate({ "width": 230, height: 120 }, "slow");
            //加载子菜单内容
            $.post("/command/getsubproducttype.aspx?tid=" + typeid, null, function (responsexx) {
                $("#submenudiv").html(responsexx);
                $.cleanup;
            });
            catchmenudiv = typeid;
        }
    })
    $(".homemenu").mouseout(function () {
        $("#submenudiv").hide();

    });
    $("#homemenu").mouseover(function () {
        $(this).show();
    });
    $("#submenudiv").mouseover(function () {
        $(this).show();
        $("#" + catchmenudiv).css({ "background": "#8c0b01", "color": "white" });
    })

    $("#submenudiv").mouseout(function () {
        $("#" + catchmenudiv).css({ "background": "#f3f3f3", "color": "#222222" });
        $("#submenudiv").hide();
    });

    $(document.body).click(function () {
        $("#submenudiv").hide();
    });
    //=========================================================
    //product--//

    $(".imgcontent").mousemove(function () {
        $(this).find(".titletooltip").show();
        $(this).css("border", "solid 1px #f2efef");
    })
    $(".imgcontent").mouseout(function () {
        $(this).find(".titletooltip").hide();
        $(this).css("border", "solid 1px white");
    })
    $("#lxme").click(function () {

    })
});


