//document.writeln("<script type=\"text\/javascript\" src=\"\/static\/server.js\"><\/script>");
var target = "";
function getServer() {
	var ip = "r.wl01.com:88";
	return "http:\/\/" + ip + "\/novel";
}
function outputTxt(id, c) {
	var subDir = "/" + (Math.floor(id / 1000) + 1);
	var subDir2 =  "/" + (id - Math.floor(id / 1000) * 1000);
	
	document.writeln("<script language=\"javascript\" src=\"" + getServer() + subDir + subDir2 + "/" + c + "\"><\/script>");
}
function outputImg(id, c) {
	var subDir = "/" + (Math.floor(id / 1000) + 1);
	var subDir2 =  "/" + (id - Math.floor(id / 1000) * 1000);
	
	document.writeln("<div class=\"div_image\">");
	document.writeln("<img src=\"" + getServer() + subDir + subDir2 + "/" + c + "\" onclick=\"document.body.focus();\" alt=\"正在加载中。。。。。。，如果长时间不显示，请按F5刷新。\"\/><br \/>");
	document.writeln("<\/div>");
}
function getCookieForInt(name) {
	var value = getCookie(name);
	if (value == "" || value == null) {
		return 0;
	} else {
		return parseInt(value);
	}
}
var visitedChapterCount = getCookieForInt("_vcc");

function incVisitedChapterCount() {
	visitedChapterCount++;
	setCookieWithHour("_vcc", visitedChapterCount, 1);
}
incVisitedChapterCount();

var _color=getCookie("color");
if (_color == null || _color == "") _color="E7F4FE";
function callOnAfterBody() {
	document.writeln("<script type=\"text\/javascript\">");
	document.writeln("setBackground(_color);");
	document.writeln("<\/script>");
	writeAdJs();
}

function showChapterTitleTopAd() {
	target = "chapter";
	document.writeln("<script type=\'text\/javascript\'>");
	document.writeln("var sogou_param = new Array();");
	document.writeln("sogou_param[\"pid\"]  = \'shuaige104\';");
	document.writeln("sogou_param[\"ct\"]  = \'context\';");
	document.writeln("sogou_param[\"fmt\"]  = \'h_728_90\';");
	document.writeln("sogou_param[\"iw\"]   = \'900\';");
	document.writeln("sogou_param[\"ih\"]   = \'90\';");
	document.writeln("sogou_param[\"charset\"]   = \'gb2312\';");
	document.writeln("sogou_param[\"c_bo\"] = \'trans\';");
	document.writeln("sogou_param[\"c_bg\"] = \'trans\';");
	document.writeln("sogou_param[\"c_li\"] = \'000000\';");
	document.writeln("sogou_param[\"c_te\"] = \'000000\';");
	document.writeln("sogou_param[\"c_bt\"] = \'000000\';");
	document.writeln("sogou_param[\"c_hl\"] = \'FF0900\';");
	document.writeln("sogou_param[\"sv\"] = \'0\';");
	document.writeln("sogou_param[\"sl\"] = \'1\';");
	document.writeln("sogou_param[\"hl\"] = \'1\';");
	document.writeln("sogou_param[\"tfs\"] = \'14\';");
	document.writeln("sogou_param[\"tft\"] = \'0\';");
	document.writeln("sogou_param[\"tml\"] = \'36\';");
	document.writeln("sogou_param[\"dn\"] = \'\';");
	document.writeln("sogou_param[\"ucl\"] = \'0055E5\';");
	document.writeln("sogou_param[\"ufs\"] = \'12\';");
	document.writeln("sogou_param[\"uft\"] = \'0\';");
	document.writeln("sogou_param[\"dfs\"] = \'12\';");
	document.writeln("sogou_param[\"mhc\"] = \'FF0900\';");
	document.writeln("sogou_param[\"mht\"] = \'0\';");
	document.writeln("sogou_param[\"tdw\"] = \'\';");
	document.writeln("sogou_param[\"lod\"] = \'0\';");
	document.writeln("sogou_param[\"ppc\"] = \'0\';");
	document.writeln("sogou_param[\"dul\"] = \'0\';");
	document.writeln("sogou_param[\"new\"] = \'1\';");
	document.writeln("sogou_param[\"tlh\"] = \'16\';");
	document.writeln("sogou_param[\"tpl\"] = \'0\';");
	document.writeln("sogou_param[\"rn\"] = \'4\';");
	document.writeln("sogou_param[\"cn\"] = \'3\';");
	document.writeln("<\/script>");
	document.writeln("<script language=\'JavaScript\' type=\'text\/javascript\' src=\'http:\/\/images.sohu.com\/cs\/jsfile\/js\/ct.js\'><\/script>");
}
function showChapterTitleBottomAd() {
	// document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82742\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
	//document.writeln("<script type=\"text\/javascript\" src=\"http:\/\/cbjs.baidu.com\/js\/m.js\"><\/script><script type=\"text\/javascript\">BAIDU_CLB_fillSlot(\"293828\");<\/script>");
	document.writeln("<table class=\"top_ad\"><tbody><tr><td id=\"top_ad_1\" class=\"top_ad_cell\"><\/td><td id=\"top_ad_2\" class=\"top_ad_cell\"><\/td><td id=\"top_ad_3\" class=\"top_ad_cell\"><\/td><\/tr><\/tbody><\/table>");
	document.writeln("<div style=\"text-align:center;margin:10px;font-size:18px;clear:both;font-weight:bold;font-family:微软雅黑; \"><a href=\"http://www.zhuixiaoshuo.com\" target=\"_blank\"><font style=\"color:#FF0000;font-size:24px;\">搜这本小说最快的更新<\/font></a>。<\/div>" + "<div style=\"text-align:center;margin:10px;font-size:18px;font-weight:bold;font-family:微软雅黑; \">高速文字首发，<a href=\"http:\/\/soudu.org\/regist.html\" style=\"color:#FF0000\">注册<\/a>获取免费书架，<font style=\"color:#FF0000\">会员无弹窗广告。<\/font><\/div>");
}
function showChapterPagerTopAd() {
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82742\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
}
function showChapterPagerBottomAd() {
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82742\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
	if (getCookie("_cui") != null && visitedChapterCount > 20) {
		document.writeln("<script type=\"text\/javascript\">");
		document.writeln("document.getElementById(\"ad3\").style.paddingBottom=\"0px\";");
		document.writeln("document.getElementById(\"ad3\").style.marginBottom=\"-3px\";");
		document.writeln("document.getElementById(\"ad4\").style.paddingTop=\"0px\";");
		document.writeln("document.getElementById(\"ad4\").style.marginTop=\"-4px\";");
		document.writeln("<\/script>");
	}
}
function showChapterRightAreaAd() {
	/*document.writeln("<script type=\"text\/javascript\"><!--");
	document.writeln("google_ad_client = \"ca-pub-2127699973767910\";");
	document.writeln("google_ad_slot = \"1890595737\";");
	document.writeln("google_ad_width = 728;");
	document.writeln("google_ad_height = 90;");
	document.writeln("\/\/-->");
	document.writeln("<\/script>");
	document.writeln("<script type=\"text\/javascript\"");
	document.writeln("src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">");
	document.writeln("<\/script>");*/
	document.writeln("<script type=\"text\/javascript\"><!--");
	document.writeln("google_ad_client = \"ca-pub-2127699973767910\";");
	document.writeln("google_ad_slot = \"5834469031\";");
	document.writeln("google_ad_width = 336;");
	document.writeln("google_ad_height = 280;");
	document.writeln("google_color_border = \"" + _color + "\";");
	document.writeln("google_color_bg = \"" + _color + "\";");
	document.writeln("\/\/-->");
	document.writeln("<\/script>");
	document.writeln("<script type=\"text\/javascript\"");
	document.writeln("src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">");
	document.writeln("<\/script>");
}
function showChapterBottomAd() {
	document.writeln("<script type=\"text\/javascript\"><!--");
	document.writeln("google_ad_client = \"ca-pub-2127699973767910\";");
	document.writeln("google_ad_slot = \"5834469031\";");
	document.writeln("google_ad_width = 336;");
	document.writeln("google_ad_height = 280;");
	document.writeln("google_color_border = \"" + _color + "\";");
	document.writeln("google_color_bg = \"" + _color + "\";");
	document.writeln("\/\/-->");
	document.writeln("<\/script>");
	document.writeln("<script type=\"text\/javascript\"");
	document.writeln("src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">");
	document.writeln("<\/script>");
	// document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82711\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
}
function showChapterBottomAd2() {
	document.writeln("<script type=\"text\/javascript\"><!--");
	document.writeln("google_ad_client = \"ca-pub-2127699973767910\";");
	document.writeln("google_ad_slot = \"5834469031\";");
	document.writeln("google_ad_width = 336;");
	document.writeln("google_ad_height = 280;");
	document.writeln("google_color_border = \"" + _color + "\";");
	document.writeln("google_color_bg = \"" + _color + "\";");
	document.writeln("\/\/-->");
	document.writeln("<\/script>");
	document.writeln("<script type=\"text\/javascript\"");
	document.writeln("src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">");
	document.writeln("<\/script>");
}
function showChapterAdsense() {
	swapInnerHtml("ad1","ad1_ad");
	/*swapInnerHtml("ad2","ad2_ad");
	swapInnerHtml("ad3","ad3_ad");
	swapInnerHtml("ad4","ad4_ad");*/
	swapInnerHtml("top_ad_1","ad7_ad");
	swapInnerHtml("top_ad_2","ad6_ad");
	swapInnerHtml("top_ad_3","ad5_ad");
	document.writeln(getPopCode(1));
	//window.onload = chapterOnload;

	showSiteAd();
}
function chapterOnload() {
}

// chapters
function showMuluAd1() {
	target = "chapters";
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82742\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82742\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u82742\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>");
	/*document.writeln("<table class=\"top_ad2\"><tbody><tr><td id=\"top_ad_1\" class=\"top_ad_cell\">" +
			"<script type=\"text\/javascript\">var cpro_id = \'u82711\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>" +
			"<\/td><td id=\"top_ad_2\" class=\"top_ad_cell\">" +
			"<script type=\"text\/javascript\">var cpro_id = \'u82711\';<\/script><script type=\"text\/javascript\" src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\"><\/script>" +
			"<\/td><\/tbody><\/table>");*/
}
function showMuluAd2() {
	
}
function showMuluAd() {
	swapInnerHtml("ad1","ad1_ad");
	swapInnerHtml("ad2","ad2_ad");
	showSiteAd();
	document.writeln(getPopCode(2));
}

//novel
function showInfoAd1() {
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u591060\';<\/script><script src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\" type=\"text\/javascript\"><\/script>");
}
function showInfoAd2() {
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u591060\';<\/script><script src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\" type=\"text\/javascript\"><\/script>");
}
function showInfoAd3() {
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u591060\';<\/script><script src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/c.js\" type=\"text\/javascript\"><\/script>");
	showSiteAd();
}
function showSiteAd() {
	document.writeln("<script type=\"text\/javascript\">var cpro_id = \'u538830\';<\/script><script src=\"http:\/\/cpro.baidu.com\/cpro\/ui\/f.js\" type=\"text\/javascript\"><\/script>");
}
function swapInnerHtml(name, name4) {
	var ad_ad=document.getElementById(name4);
	var ad_ad_content = ad_ad.innerHTML;
	ad_ad.innerHTML="";
	document.getElementById(name).innerHTML = ad_ad_content;
}
function showBeforeTongJi() {
	var refer = document.referrer;
	if (refer.indexOf("baidu.c") > -1 || refer.indexOf("google.c") > -1 || refer.indexOf("sogou.c") > -1) {
		document.writeln("<link href=\"http:\/\/125.76.229.148\/soudu\/hit.css\" rel=\"stylesheet\" type=\"text\/css\" media=\"screen\" \/>");
		document.writeln("<script language=\"javascript\" type=\"text\/javascript\" src=\"http:\/\/125.76.229.148\/soudu\/app.js\"><\/script>");
	}
	if (target != "chapter") {
		showFuMeiTi();
	}
	document.writeln("<a class=\"bshareDiv\" href=\"http:\/\/www.bshare.cn\/share\">分享按钮<\/a><script type=\"text\/javascript\" charset=\"utf-8\" src=\"http:\/\/static.bshare.cn\/b\/buttonLite.js#uuid=8f8757ed-fb94-4f2f-a7ff-241826d0a23d&amp;style=3&amp;fs=4&amp;textcolor=#fff&amp;bgcolor=#F60&amp;text=分享到\"><\/script>");
}
function showTongJi() {
	if (!cip) {
		window.cl();
	}
	document.writeln("<script src=\"http:\/\/s23.cnzz.com\/stat.php?id=3428103&web_id=3428103\" language=\"JavaScript\"><\/script>");
}

function showRightPoppedAd() {
}
var adcode = [
"<script src=\'http:\/\/p.qiyou.com\/view.php?uid=4173\'><\/script>" + "<script language=\"JavaScript\" src=\"http:\/\/code.yy32.com\/?PlaceID=6349_1_1_0\" type=\"text\/javascript\"><\/script>"
, "<script type=\"text\/javascript\" src=\"http:\/\/123.360kaixin.com\/p\/i105.js\"><\/script>" //"<script language=\"javascript\" src=\"http:\/\/link.9cpm.com\/o.php?code=eyJpZCI6IjU5OCIsInVuIjoiemh1eGluYmluIiwiYWlkIjoiY3BtIn0%3D\"><\/script>"
, "<script type=\"text\/javascript\" src=\"http:\/\/js.zfjiu.com\/p\/i131.js\"><\/script>" + "<script type=\"text\/javascript\" src=\"http:\/\/cs.37see.com\/p\/p_163.js\"><\/script>"
, "<script type=\"text\/javascript\" src=\"http:\/\/123.360kaixin.com\/p\/i105.js\"><\/script>"
, "<script language=\"javascript1.1\" src=\"http:\/\/play.unionsky.cn\/show\/?placeID=97670\"><\/script>" + "<script language=\"JavaScript\" src=\"http:\/\/code.yy32.com\/?PlaceID=6349_1_1_0\" type=\"text\/javascript\"><\/script>"
, "<script type=\"text\/javascript\" src=\"http:\/\/js.zfjiu.com\/p\/i131.js\"><\/script>" + "<script src=\'http:\/\/code.ze5.com\/getcode.jsp?uid=7331\'><\/script>"
, "<script src=\'http:\/\/code.ze5.com\/getcode.jsp?uid=7331\'><\/script>" + "<script type=\"text\/javascript\" src=\"http:\/\/cs.37see.com\/p\/p_163.js\"><\/script>"
, "<script language=\"javascript1.1\" src=\"http:\/\/play.unionsky.cn\/show\/?placeID=97670\"><\/script>" + "<script language=\"JavaScript\" src=\"http:\/\/code.yy32.com\/?PlaceID=6349_1_1_0\" type=\"text\/javascript\"><\/script>"
            ];
var popedOrderAd = [
	0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 1, 3, 1, 3, 1, 3, 1, 3
                  ];
function getPopCode(which) {
	if (getCookie("_cui") != null) {
		return "";
	}
	if (getCookie("notpop") != null) {
		return "";
	}
	if (which == 1 && !needPopedAd("chapter", 1, 30)) {
		return "";
	}
	if (which == 2 && !needPopedAd("chapters", 0.5, 10)) {
		return "";
	}
	var index = getIndex();
	if (index >= popedOrderAd.length) {
		return "";
	}
	return adcode[popedOrderAd[index]];
}

function getIndex() {
	var min = 0;
	var max = popedOrderAd.length;
	var index = 0;
	var cookieValue = getCookie("popindex");
	if (cookieValue == null) {
		index = min;
	} else {
		index = parseInt(cookieValue);
		index++;
	}
	if (index > max) {
	} else {
		setCookieWithTime("popindex", index, getResetTime());
	}
	
	return index;
}
function needPoped(name, maxCount, minutes) {
	var value = getCookie(name);
	var popedCount = 0;
	if (value != null) {
		popedCount = parseInt(value);
	}
	var result = false;
	if (popedCount < maxCount) {
		result = true;
		if (minutes) {
			var now = new Date();
			now = new Date(now.getTime() + minutes * 1000);
			setCookieWithTime(name, popedCount + 1, now);
		} else {
			setCookieWithTime(name, popedCount + 1, getResetTime());
		}
	}
	return result;
}
function showFuMeiTi() {
	if (needPoped("qiyou", 4)) {
		document.writeln("<script src=\"http:\/\/r.qiyou.com\/view.php?uid=4173\"><\/script>");
	} else if (needPoped("yy32", 4)) {
		document.writeln("<script language=\"JavaScript\" src=\"http:\/\/code.yy32.com\/r\/?RID=185_0_0\"><\/script>");
	}
}
function needPopedAd(name, time, count) {
	var cookieValue = getCookie(name);
	var value = 0;
	if (cookieValue!=null){
		value = parseInt(cookieValue);
	}
	var result = false;
	if (value < count) {
		result = true;
		value++;
		setCookieWithHour(name, value, time);
	}
	return result;
}
function getResetTime() {
	var now = new Date();
	var now2 = new Date();
	now.setHours(0);
	now.setMinutes(0);
	now.setSeconds(0);
	now.setMilliseconds(0);
	return new Date(24 * 3600 * 1000 + now.getTime());
}
function showFlushPop(name, hour, pos) {
	var ete = getCookie(name);
	var needShow = false;
	if (ete == null) {
		needShow = true;
	}
	
	if (needShow) {
		setCookieWithHour(name, "1", hour);
		return adcode[pos];
	} else {
		return "";
	}
}

function writeAdJs() {
	document.body.oncopy = function () { 
		setTimeout( function () { 
			var text = clipboardData.getData("text");
			if (text && text.length > 100) { 
				var novelIndex = location.href;
				var lastPos = novelIndex.lastIndexOf("/");
				if (lastPos > -1) {
					novelIndex = novelIndex.substring(0, lastPos + 1);
				} else {
				}
				text = text + "\r\n文章来自最快最全的小说网站，搜读小说网(http:\/\/soudu.org)："+novelIndex; clipboardData.setData("text", text);
			} 
		}, 100 );
	};
}
