﻿function checkSelectAll() {
    $('input[name=chkList]').each(function(i) {
        this.checked = true;
    });
}

function checkSelectReverse() {
    $('input[name=chkList]').each(function(i) {
        this.checked = !this.checked;
    });
}

//  ajax请求WebService
function ajaxRequest(config) {
    $.ajax({
        type: 'POST', contentType: 'application/json', dataType: 'json',
        url: config.url, data: config.data,
        complete: function(httpRequest, textStatus) {
            //alert("");
            //alert(httpRequest.responseText);
            var obj = eval('(' + httpRequest.responseText + ')');
            if (textStatus == 'success') {
                if (typeof (config.fnSuccess) == 'function') {
                    config.fnSuccess(obj, '成功');
                }
            } else if (textStatus == 'error') {
                if (typeof (config.fnFailure) == 'function') {
                    config.fnFailure(obj, '数据发送异常,请重新发送F01');
                }
            } else {
                if (typeof (config.fnFailure) == 'function') {
                    config.fnFailure(obj, '操作超时,请重新尝试F02');
                }
            }
        }
    });
}



function ajaxRequest1(config) {
    alert('aa');
    $.ajax({
        type: 'POST', contentType: 'application/json', dataType: 'jsonp', jsonp: "callBack",
        url: config.url, data: config.data,
        complete: function(httpRequest, textStatus) {
            //alert("");
            //alert(httpRequest.responseText);
            var obj = eval('(' + httpRequest.responseText + ')');
            if (textStatus == 'success') {
                if (typeof (config.fnSuccess) == 'function') {
                    config.fnSuccess(obj, '成功');
                }
            } else if (textStatus == 'error') {
                if (typeof (config.fnFailure) == 'function') {
                    config.fnFailure(obj, '数据发送异常,请重新发送F01');
                }
            } else {
                if (typeof (config.fnFailure) == 'function') {
                    config.fnFailure(obj, '操作超时,请重新尝试F02');
                }
            }
        }
    });
}


//校验邮政编码
function isPostalCode(s) {
    //var patrn=/^[a-zA-Z0-9]{3,12}$/;// 国际
    var patrn = /^\d{6}$/; //中国
    if (!patrn.exec(s))
    { return false; }
    return true;
}

function ShowDetail(divid) {
    $("#" + divid).show();
}

function HideDetail(divid) {
    $("#" + divid).hide();
}

//首页990宽度的第1张横幅,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function Index_990_hengfu1() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk2.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页990宽度的第2张横幅
function Index_990_hengfu2() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://www.quansou.com/Home/NewDetail/ID=3103' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu2_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//新闻详细页第1张横幅
function NewsDetail_990_hengfu1() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write(" <a href='http://315.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/NewsDetail_990X70.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//新闻详细页第2张横幅
function NewsDetail_990_hengfu2() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write(" <a href='http://315.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/NewsDetail_990X70.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页990宽度的第3张横幅
function Index_990_hengfu3() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://www.quansou.com/game/XMOL/' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu3_990X60.gif' style='width: 990px; height: 60px;' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页110*190的左边广告
function Index_110_190_left() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://chibi.wanmei.com/' alt=\"仙途终极封测\"  target='_blank'>");
        document.write("<img src='/Image/guanggao/Index_110X190_right.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页110*190的右边广告
function Index_110_190_right() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://chibi.wanmei.com/' alt=\"仙途终极封测\"  target='_blank'>");
        document.write("<img src='/Image/guanggao/Index_110X190_right.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页300*70的广告1
function Index_300_70_left1() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<dt style='width:300px; height:70px; margin-top:5px;'>");
        document.write("<a href='http://www.quansou.com/Home/NewDetail/ID=2579' alt=\"《昆仑OL》“北仑沧海”线上活动计划\"  target='_blank'>");
        document.write("<img src='http://www.quansou.com/Image/guanggao/Index_300X70_1.jpg' /></a></dt>");
        document.write("<dd style='width:300px; height:20px; margin-top:5px; line-height:15px;'>《昆仑OL》“北仑沧海”线上活动计划</dd>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页300*70的广告2
function Index_300_70_left2() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<dt style='width:300px; height:70px;'>");
        document.write("<a href='http://www.quansou.com/ka/cjxxsg.html' alt=\"超级西西三国超爽体验卡发放活动\"  target='_blank'>");
        document.write("<img src='http://www.quansou.com/Image/guanggao/Index_300X70_2.jpg' /></a></dt>");
        document.write("<dd style='width:300px; height:20px; margin-top:5px; line-height:15px;'>超级西西三国超爽体验卡发放活动</dd>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//首页300*70的广告3
function Index_300_70_left3() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<dt style='width:300px; height:70px;'>");
        document.write("<a href='http://www.quansou.com/Home/NewDetail/ID=2843' alt=\"第八届50万现金《蜀门》争霸赛开启\"  target='_blank'>");
        document.write("<img src='http://www.quansou.com/Image/guanggao/Index_300X70_3.jpg' /></a></dt>");
        document.write("<dd style='width:300px; height:20px; margin-top:5px; line-height:15px;'>第八届50万现金《蜀门》争霸赛开启</dd>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//play页658*310的flash
function play_658_310_left() {
    var isFlase = 1;
    if (isFlase == 0) {
        document.write("<dt style='width:300px; height:70px;'>");
        document.write("<a href='http://bbs.quansou.com/viewthread.php?tid=3669' alt=\"降龙之剑惊世封测激活码发放活动\"  target='_blank'>");
        document.write("<img src='http://www.quansou.com/Image/guanggao/Index_300X70_3.jpg' /></a></dt>");
        document.write("<dd style='width:300px; height:20px; margin-top:5px; line-height:15px;'>降龙之剑惊世封测激活码发放活动</dd>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(677, 315, "/Image/Flash/xz_712X312.swf");
    }
}

//公会页面990宽度的头部横幅,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function GH_990_Top_hengfu() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}


//公会页面的尾部横幅,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function GH_990_Buttom_hengfu() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//积分兑奖页面的头部广告,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function Jang_Top_hengfu() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}
//积分兑奖页面的尾部广告,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function Jang_Buttom_hengfu() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//用户中心顶部的横幅
function User_Top_hengfu() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://www.quansou.com/Home/NewDetail/ID=2452' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu2_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//领卡列表页的头部广告,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function CardList_Top_adv() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}
//领卡列表页的尾部广告,isFlase=1表示该广告是flash类型,则指FlashAdStr(0,0,"")里面的宽,高,falsh文件路径
function CardList_Buttom_adv() {
    var isFlase = 0;
    if (isFlase == 0) {
        document.write("<a href='http://talk.quansou.com' target='_blank'>");
        document.write("<img src='/Image/guanggao/hengfu1_990X60.jpg' /></a>");
    }
    else {
        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
        FlashAdStr(0, 0, "");
    }
}

//var play_90_60_ImageSrcs;
//var play_90_60_ImageLinks;
//var play_90_60_ImageTitle;

////play页90*60的广告
//function Index_90_60_right() {
//    var isFlase = 0;
//    if (isFlase == 0) {
//        play_90_60_ImageSrcs = new Array();
//        play_90_60_ImageLinks = new Array();
//        play_90_60_ImageTitle = new Array();
//        play_90_60_ImageSrcs[0] = "http://quansou.com/Upload/Game/200912161521165291622.jpg";
////        document.write("<dl style='width: 90px;height: 80px;margin-left: 7px;float: left;'>");
////        document.write("<dt style='width: 90px;height: 60px;'>");
////        document.write("<a href='http://bbs.quansou.com/viewthread.php?tid=3669' alt=\"降龙之剑惊世封测激活码发放活动\"  target='_blank'>");
////        document.write("<img src='http://localhost:46530/Image/Company/2010120113558434507.jpg' /></a></dt>");
////        document.write("<dd style=' width: 90px;height: 20px;text-align: center;margin-top:5px;'>激活码发放活动</dd>");
////        document.write("</dl>");

////        document.write("<dl style='width: 90px;height: 80px;margin-left: 7px;float: left;'>");
////        document.write("<dt style='width: 90px;height: 60px;'>");
////        document.write("<a href='http://bbs.quansou.com/viewthread.php?tid=3669' alt=\"降龙之剑惊世封测激活码发放活动\"  target='_blank'>");
////        document.write("<img src='http://localhost:46530/Image/Company/20101209941109148.jpg' /></a></dt>");
////        document.write("<dd style=' width: 90px;height: 20px;text-align: center;margin-top:5px;'>激活码发放活动</dd>");
////        document.write("</dl>");

////        document.write("<dl style='width: 90px;height: 80px;margin-left: 7px;float: left;'>");
////        document.write("<dt style='width: 90px;height: 60px;'>");
////        document.write("<a href='http://bbs.quansou.com/viewthread.php?tid=3669' alt=\"降龙之剑惊世封测激活码发放活动\"  target='_blank'>");
////        document.write("<img src='http://localhost:46530/Image/Company/201012095633750189.jpg' /></a></dt>");
////        document.write("<dd style=' width: 90px;height: 20px;text-align: center;margin-top:5px;'>激活码发放活动</dd>");
////        document.write("</dl>");


//    }
//    else {
//        //falseh广告,第一个参数是宽,第二参数是高,第三个则是该falsh文件路径(相对于网站根目录,要加上"/")
//        FlashAdStr(0, 0, "");
//    }
//}


//领卡详细页第1个横幅
function CardOut_hengfu1() {
    document.write(" <a href='http://www.quansou.com/Home/NewDetail/ID=2709' target='_blank'>");
    document.write("<img src='/Image/guanggao/hengfu2_990X80.jpg' /></a>");
}

//领卡详细页第2个横幅
function CardOut_hengfu2() {
    document.write("<a href='http://yh.quansou.com' target='_blank'>");
    document.write("<img src='/Image/guanggao/CardOut_990X60.gif' style='width: 990px; height: 60px;' /></a>");
}

function FlashAdStr(width, height, filePath) {
    document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\")");
    document.write("id=\"index_manu\" align=\"middle\" width='" + width + "' height='" + height + "'>");
    document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
    document.write("<param name=\"movie\" value='" + filePath + "' />");
    document.write("<param name=\"quality\" value=\"high\" />");
    document.write("<embed src=\"index_manu.swf\" quality=\"high\" bgcolor=\"#990000\" name=\"index_manu\" align=\"middle\")");
    document.write("width='" + width + "' height='" + height + "' allowscriptaccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\" http://www.macromedia.com/go/getflashplayer\" \/><\/object>");
}