
//document.write("<script src='/Jscript/jquery-1.4.1.min.js'><\/script>");
//
//参数是页面名称-宽*高-参数  如：index-710-90-1  说明是首页710*90的第一个广告
function getadinfo1(adname) {
    var connad = "";
    var wh = adname.split('-');//解析参数
    var w = wh[1];//得到宽
    var h = wh[2];//得到高
    switch (adname) {
        case "index-710-90-2":
//            connad = "<script type=\"text/javascript\">/*728*90，创建于2012-3-14*/ var cpro_id = 'u806526';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            connad = "<a href=\"http://www.18sucai.com\" target=\"_blank\"><img src=\"/admanager/images/index-948-90-1.gif\" style=\"width:710px;height:90px;border-width:0px;\"></a>";
            break;
        case "sucailist-200-200-bd":
            connad = "<script type=\"text/javascript\">/*js素材列表右侧200*200，创建于2012-3-23*/ var cpro_id = 'u819848';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            break;
        case "300-250-ad":
//            connad = "<script type=\"text/javascript\">/*300*250，创建于2012-8-15*/ var cpro_id = 'u1024572';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            connad = "<a href=\"http://www.18sucai.com\" target=\"_blank\"><img src=\"/admanager/images/index-948-90-1.gif\" style=\"width:300px;border-width:0px;\"></a>";
            break;
         case "show-960-90":
//            connad = "<script type=\"text/javascript\">/*960*90，创建于2012-6-28*/ var cpro_id = 'u961350';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
             connad = "<a href=\"http://www.18sucai.com\" target=\"_blank\"><img src=\"/admanager/images/index-948-90-1.gif\" style=\"width:960px;border-width:0px;\"></a>";
            break;
        case "show-250-250":
            connad = "<script type=\"text/javascript\">/*250*250，创建于2013-2-21*/var cpro_id = \"u1217438\";</script><script src=\"http://cpro.baidustatic.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            break;
        case "show-580-90":
//            connad = "<script type=\"text/javascript\">/*580*90，创建于2013-3-17*/var cpro_id = \"u1236485\";</script><script src=\"http://cpro.baidustatic.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            connad = "<a href=\"http://www.18sucai.com\" target=\"_blank\"><img src=\"/admanager/images/index-948-90-1.gif\" style=\"width:580px;border-width:0px;\"></a>";
            break;
        case "list_468-15link":
            connad = "<script type=\"text/javascript\">/*468*15，创建于2013-3-19*/var cpro_id = \"u1238721\";</script><script src=\"http://cpro.baidustatic.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            break;
        case "index-220-90-1": //首页第一个通栏广告
            connad = "<a href=\"http://www.51wake.com\" target=\"_blank\"><img src=\"/admanager/images/index-948-90-1.gif\" style=\"width:"+w+"px;height:"+h+"px;border-width:0px;\"></a>";
            break;
        case "index-220-90-2": //首页第二个通栏广告
            connad = "<a href=\"http://www.51wake.com\" target=\"_blank\"><img src=\"/admanager/images/index-948-90-2.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        case "sucailist-685-75-1": //素材列表下方第一个通栏广告
            connad = "<a href=\"http://www.vakei.com\" target=\"_blank\"><img src=\"/admanager/images/sucailist-685-75-1.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        case "sucailist-685-75-2": //素材列表下方第二个通栏广告
            connad = "<a href=\"http://www.51wake.com\" target=\"_blank\"><img src=\"/admanager/images/sucailist-685-75-2.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        case "jslist-625-75-1": //js列表下方第一个通栏广告
            connad = "<a href=\"http://www.vakei.com\" target=\"_blank\"><img src=\"/admanager/images/jslist-625-75-1.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        case "jslist-625-75-2": //js列表下方第二个通栏广告
            connad = "<a href=\"http://www.51wake.com\" target=\"_blank\"><img src=\"/admanager/images/jslist-625-75-2.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        case "articlelist-625-75-1": //文库列表下方第一个通栏广告
            connad = "<a href=\"http://www.vakei.com\" target=\"_blank\"><img src=\"/admanager/images/articlelist-625-75-1.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        case "articlelist-625-75-2": //文库列表下方第二个通栏广告
            connad = "<a href=\"http://www.51wake.com\" target=\"_blank\"><img src=\"/admanager/images/articlelist-625-75-2.gif\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
        default://暂无图片
            connad = "<a href=\"http://www.18sucai.com\" target=\"_blank\"><img src=\"/admanager/images/ad.jpg\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
    }
    document.write(connad);
}


function getadinfo(adname) {
    var connad = "";
    var wh = adname.split('-'); //解析参数
    var w = wh[1]; //得到宽
    var h = wh[2]; //得到高
    switch (adname+"1") {
        case "index-710-90-2":
            connad = "<script type=\"text/javascript\">var sogou_ad_id=170427;var sogou_ad_height=90;var sogou_ad_width=728;</script><script language='JavaScript' type='text/javascript' src='http://images.sohu.com/cs/jsfile/js/c.js'></script>";
            break;
        case "show-960-90":
            connad = "<script type=\"text/javascript\">var sogou_ad_id=171815;var sogou_ad_height=90;var sogou_ad_width=960;</script><script language='JavaScript' type='text/javascript' src='http://images.sohu.com/cs/jsfile/js/c.js'></script>";
            break;
        case "300-250-ad":
            connad = "<script type=\"text/javascript\">var sogou_ad_id=171817;var sogou_ad_height=250;var sogou_ad_width=300;</script><script language='JavaScript' type='text/javascript' src='http://images.sohu.com/cs/jsfile/js/c.js'></script>";
            break;
        case "show-250-250":
            connad = "<script type=\"text/javascript\">var sogou_ad_id=171818;var sogou_ad_height=250;var sogou_ad_width=250;</script><script language='JavaScript' type='text/javascript' src='http://images.sohu.com/cs/jsfile/js/c.js'></script>";
            break;
        case "show-580-90":
            connad = "<script type=\"text/javascript\">/*580*90，创建于2013-3-17*/var cpro_id = \"u1236485\";</script><script src=\"http://cpro.baidustatic.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
            break;
        default: //暂无图片
            connad = "<a href=\"http://www.18sucai.com\" target=\"_blank\"><img src=\"/admanager/images/ad.jpg\" style=\"width:" + w + "px;height:" + h + "px;border-width:0px;\"></a>";
            break;
    }
    document.write(connad);
}

//function GetBaiduAd(adname,eid) {
//    var connad = "";
//    switch (adname) {
//        case "index-710-90-2":
//            connad = "<script type=\"text/javascript\">/*728*90，创建于2012-3-14*/ var cpro_id = 'u806526';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
//            break;
//        case "sucailist-200-200-bd":
//            connad = "<script type=\"text/javascript\">/*js素材列表右侧200*200，创建于2012-3-23*/ var cpro_id = 'u819848';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
//            break;
//        case "300-250-ad":
//            connad = "<script type=\"text/javascript\">/*300*250，创建于2012-8-15*/ var cpro_id = 'u1024572';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
//            break;
//        case "960-90-ad":
//            connad = "<script type=\"text/javascript\">/*960*90，创建于2012-8-15*/ var cpro_id = 'u961350';</script><script src=\"http://cpro.baidu.com/cpro/ui/c.js\" type=\"text/javascript\"></script>";
//            break;
//    }
//    document.getElementById(eid).innerHTML = connad;
//}

//
//参数是页面名称-宽*高-参数  如：index-710-90-1  说明是首页710*90的第一个广告

function SetAdSense(arg)
{
    var arguments=new Array();
    arguments=arg.split(',');
	if(arguments.length == 4)
	{
		document.write('<script type="text/javascript">');
		document.write('google_ad_client = "ca-pub-'+arguments[0]+'";');
		document.write('google_ad_slot = "'+arguments[1]+'";');
		document.write('google_ad_width = '+arguments[2]+';');
		document.write('google_ad_height = '+arguments[3]+';');
		document.write('<\/script>');
		document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
		document.write('<\/script>');
	}
}/*
function getadinfo(flag) {
    var strpar=flag.replace("'","");
    $.ajax({ 
    url:"http://www.51wake.com/admanager/GetAdsence.ashx?flag="+strpar,
    cache:true,
    success:function(data){
    document.write(data);
    }
    })
	document.write("<script src='/admanager/GetAdsence.ashx?flag="+flag.replace("'","")+"'><\/script>");
//document.write("<script src='/source/admanager/GetAdsence.ashx?flag="+flag.replace("'","")+"'><\/script>");
}*/
/*
function SetAdSense(arg,innerhtmlid) {
    var arguments = new Array();
    arguments = arg.split(',');
    var str = "";
    if (arguments.length == 4) {
        str+='<script type="text/javascript">';
        str+='google_ad_client = "ca-pub-' + arguments[0] + '";';
        str+='google_ad_slot = "' + arguments[1] + '";';
        str+='google_ad_width = ' + arguments[2] + ';';
        str+='google_ad_height = ' + arguments[3] + ';';
        str+='<\/script>';
        str+='<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">';
        str+='<\/script>';
    }
    document.getElementById(innerhtmlid).innerHTML = str;
}
*/
function SetSerch(docid) { 
   var str="";
   str+="<form action=\"http://www.18sucai.com/serch.shtml\" id=\"cse-search-box\">";
   str+="<div>";
    str+="<input type=\"hidden\" name=\"cx\" value=\"partner-pub-1572300694561508:3644570431\" />";
    str+="<input type=\"hidden\" name=\"cof\" value=\"FORID:10\" />";
    str+="<input type=\"hidden\" name=\"ie\" value=\"UTF-8\" />";
    str+="<input type=\"text\" name=\"q\" size=\"14\" />";
    str+="<input type=\"submit\" name=\"sa\" value=\"&#x641c;&#x7d22;\" />";
  str+="</div>";
str+="</form>";

str += "<script type=\"text/javascript\" src=\"http://www.google.com.hk/coop/cse/brand?form=cse-search-box&amp;lang=zh-Hans\"></script>";
document.getElementById(docid).innerHTML = str;
}

//右侧分享
document.writeln("<script type=\"text/javascript\" >");
document.writeln("var jiathis_config={");
document.writeln("summary:\"\",");
document.writeln("marginTop:80,");
document.writeln("showClose:true,");
document.writeln("hideMore:false");
document.writeln("}");
document.writeln("</script>");
document.writeln("<script type=\"text/javascript\" src=\"http://v3.jiathis.com/code/jiathis_r.js?btn=r4.gif&move=0\" charset=\"utf-8\"></script>");
document.writeln("</script>");

//添加百度首页
function AddBdindex() {
    document.writeln("<script id=\"bdaddtocite_shell\"></script>");
    document.writeln("<script>");
    document.writeln("var bdShare_config_addtocite = {");
    document.writeln("\"type\":\"slide\"");
    document.writeln(",\"pos\":\"right\"");
    document.writeln(",\"color\":\"red\"");
    document.writeln(",\"top\":\"235\"");
    document.writeln(",\"uid\":\"163185\"");
    document.writeln("};");
    document.writeln("document.getElementById(\"bdaddtocite_shell\").src=\"http://bdimg.share.baidu.com/static/js/addtocite_shell.js?t=\" + Math.ceil(new Date()/3600000);");
    document.writeln("</script>");
}

function getCookie(name) {
    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg)) {
        return unescape(arr[2]);
    }
    else
        return null;
}

function userlogout() {
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval = getCookie("userid");
    document.cookie = "userid=" + cval + ";expires=" + exp.toGMTString();
    var cvalname = getCookie("username");
    document.cookie = "username=" + cvalname + ";expires=" + exp.toGMTString();
    document.location.href = "/info/sucai/userlogin.aspx";
}

function islogininfo() {
    var username = getCookie("username");
    if (username == null||username=="") {
        document.writeln("<li>[<a href=\"/Info/sucai/userlogin.aspx\" target=\"_blank\">登录</a>]</li>");
        document.writeln("<li>[<a href=\"/Info/sucai/userreg.aspx\" target=\"_blank\">注册</a>]</li>");
    }
    else {
        document.writeln("<li><a href=\"/Info/sucai/userindex.aspx\" target=\"_blank\">" + username + "</a></li>");
        document.writeln("<li>欢迎登陆18素材网！</li>");
    }
}