//var aImgData = [];
var aImgData = [
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=10463" target="_blank"><img src="images/10_1_5/gd/1.jpg" width="42" height="42" /></a><strong>急流尾舵</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=10562" target="_blank"><img src="images/10_1_5/gd/2.jpg" width="42" height="42" /></a><strong>巨岩精华</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=890" target="_blank"><img src="images/10_1_5/gd/3.jpg" width="42" height="42" /></a><strong>炼金3阶</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=10561" target="_blank"><img src="images/10_1_5/gd/4.jpg" width="42" height="42" /></a><strong>凝气精华</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=8394" target="_blank"><img src="images/10_1_5/gd/5.jpg" width="42" height="42" /></a><strong>反应晶石</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=7639" target="_blank"><img src="images/10_1_5/gd/6.jpg" width="42" height="42" /></a><strong>紫晶魔石</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=10578" target="_blank"><img src="images/10_1_5/gd/7.jpg" width="42" height="42" /></a><strong>秘宝钥匙</strong></li>',
	'<li><a href="http://shop.woniu.com/direct/merDetail.do?cmd=queryMerById&id=9862" target="_blank"><img src="images/10_1_5/gd/8.jpg" width="42" height="42" /></a><strong>梦幻</strong></li>'
];
/*
function getTopPic(json) {
	
	for (var i=0; i<json.data.length; i++) {
		aImgData.push('<li><span><img src="../../images/10_1_5/'+json.data[i]['bigpic']+'" width="165" height="98" /></span></li>');
	}
	
}
*/
$(document).ready(function () {
	var showImgBox = $('#scrollImgBox'),
		imgDataL = aImgData.length,
		startIndex = 0,
		endIndex = 3,
		zI = 1021;
	showImgBox.html(aImgData[0]+aImgData[1]+aImgData[2]+aImgData[3]);
	showBigImg();
	$('#moveL').click(function () {
		var firstLi = $('#scrollImgBox li:first'),
			lastLi = $('#scrollImgBox li:last');

		startIndex++;
		endIndex++;
		
		if (endIndex == imgDataL) {
			endIndex = 0;
		}
		if (startIndex == imgDataL) {
			startIndex = 0;
		}
		
		firstLi.remove();
		showImgBox.append(aImgData[endIndex]);
		
		showBigImg();
	});
	// 向右移动一张图
	$('#moveR').click(function () {
		var firstLi = $('#scrollImgBox li:first'),
			lastLi = $('#scrollImgBox li:last');

		startIndex--;
		endIndex--;
		
		if (startIndex < 0) {
			startIndex = (imgDataL-1);
		}
		if (endIndex < 0) {
			endIndex = (imgDataL-1);
		}
		
		lastLi.remove();
		showImgBox.prepend(aImgData[startIndex]);
		
		showBigImg();
	});
	// 显示大图片
	function showBigImg() {
		var imgs = $('#scrollImgBox li a');
		imgs.mousemove(function() {
			$(this).css({width:'45px',height:'45px',display:'block',zIndex:zI++});
			$(this).children().attr({width:'45',height:'45'});
		}).mouseout(function() {
			$(this).removeAttr('style')
			$(this).children().attr({width:'42',height:'42'});
		});
	};
	$('#scrollImg').mouseover(function () {
		autoMoveL_stop();
	}).mouseout(function () {
		autoMoveL_start();
	});
	var startMoveL;
	function autoMoveL_start() {
		startMoveL = setInterval(function(){$('#moveR').click()},2000);
	}
	function autoMoveL_stop() {
		window.clearInterval(startMoveL);
	}
	autoMoveL_start();
});



/*右侧漂浮条*/
lastScrollY=0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop){
	diffY = document.documentElement.scrollTop;
}else if (document.body) {
	diffY = document.body.scrollTop
}else
{/*Netscape stuff*/}

//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("ALayer1").style.top=parseInt(document.getElementById("ALayer1").style.top)+percent+"px";
document.getElementById("ALayer2").style.top=parseInt(document.getElementById("ALayer1").style.top)+percent+"px";

lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
//suspendcode12="<DIV id=\"ALayer1\" style='z-index:1006;right:0px;position:absolute; TOP:126px; float:right; display:none; width:103px;' ><a href=\"javascript:;\" onclick='closepf();'><img src=\"img30/ind_pf_03.png\" border=\"0\"></a><a href=\"javascript:;\" onclick='showBanner();'><img src=\"/img30/ind_pfzk_05.png\" border=\"0\"></a><img src=\"/img30/ind_pf_23.png\" border=\"0\"></div>"
//suspendcode14 = "<div id=\"ALayer2\" style='z-index:1006;right:0px; TOP:126px;position:absolute; float:right;'>";
//suspendcode14 += "<div class=\"numberxone\"><a href=\"javascript:;\" onclick='closepf();'>";
//suspendcode14 += "<img src=\"img30/ind_pf_03.png\" border=\"0\"></a><a href=\"javascript:;\" onclick='closeBanner();'>";
//suspendcode14 += "<img src=\"/img30/ind_pf_05.png\" border=\"0\"></a></div><div class=\"numberxtwo\"><a href=\"http://res.woniu.com/support/support.html\" target=\"_blank\"><img src=\"/img30/ind_pf_06.png\" border=\"0\"></a><img src=\"/img30/ind_pf_07.png\" border=\"0\"><a href=\"http://shop.woniu.com/home/wujie/index.xml\" target=\"_blank\"><img src=\"/img30/ind_pf_08.png\" border=\"0\"></a><a href=\"http://shop.woniu.com/cart/shop_guide.jsp?gameId=4\" target=\"_blank\"><img src=\"/img30/ind_pf_09.png\" border=\"0\"></a><a href=\"http://imprest.woniu.com/imprest/imprest_main.html?gameId=1\" target=\"_blank\"><img src=\"/img30/ind_pf_10.png\" border=\"0\"></a><a href=\"http://5jq.woniu.com/news/promotions/\" target=\"_blank\"><img src=\"/img30/ind_pf_11.png\" border=\"0\"></a><img src=\"/img30/ind_pf_12.png\" border=\"0\"><img src=\"/img30/ind_pf_13.png\" border=\"0\"><a href=\"http://act.woniu.com/5jq/costume/web/2j.php\" target=\"_blank\"><img src=\"/img30/ind_pf_14.png\" border=\"0\"></a><a href=\"http://act.woniu.com/5jq/costume/web/wdyx_bm.php\" target=\"_blank\"><img src=\"/img30/ind_pf_15.png\" border=\"0\"></a><a href=\"http://act.woniu.com/5jq/costume/web/wdyx_zt.php\" target=\"_blank\"><img src=\"/img30/ind_pf_16.png\" border=\"0\"></a><a href=\"http://act.woniu.com/5jq/costume/web/index.php\" target=\"_blank\"><img src=\"/img30/ind_pf_17.png\" border=\"0\"></a><img src=\"/img30/ind_pf_18.png\" border=\"0\"><a href=\"http://act.woniu.com/5jq/music/web/index.php\" target=\"_blank\"><img src=\"/img30/ind_pf_19.png\" border=\"0\"></a><a href=\"http://passport.woniu.com/PassportDetailPrepare.do?method=findUserInfo\" target=\"_blank\"><img src=\"/img30/ind_pf_20.png\" border=\"0\"></a><a href=\"http://act.woniu.com//5jq/advice090514/web/index.php\" target=\"_blank\"><img src=\"/img30/ind_pf_21.png\" border=\"0\"></a><a href=\"http://5jq.woniu.com/newver/index.html\" target=\"_blank\"><img src=\"/img30/ind_pf_22.png\" border=\"0\"></a><img src=\"/img30/ind_pf_23.png\" border=\"0\"></div></div>";

suspendcode12 ="<DIV id=\"ALayer1\" style='z-index:1006;right:30px;position:absolute; TOP:146px; float:right; display:none;' ><div class=\"piao_kj\">";
suspendcode12+="<div class=\"piao_head\"></div><div class=\"piao_shouqi\"><a href=\"javascript:;\" onclick='showBanner();'><img src=\"style/images/piao_05.jpg\" border=\"0\"></a></div>";
suspendcode12+="<div class=\"piao_foot\"></div>";
suspendcode12 += "</div></div>";

suspendcode14 = "<div id=\"ALayer2\" style='z-index:1006;right:30px; TOP:146px;position:absolute; float:right;'><div class=\"piao_kj\">";
suspendcode14 += "<div class=\"piao_head\"></div>";
suspendcode14 += "<div class=\"numberxone\"><div class=\"piao_shouqi\"><a href=\"javascript:;\" onclick='closeBanner();'><img src=\"style/images/piao_05.jpg\" border=\"0\"></a></div>";
suspendcode14 += "<div class=\"piao_nr\"> <a href=\"http://res.woniu.com/support/support.html\" target=\"_blank\" class=\"khzx\"></a> <a href=\"http://shop.woniu.com/home/voyage/index.xml\" target=\"_blank\" class=\"jrsc\"></a> <a href=\"http://shop.woniu.com/cart/shop_guide.jsp?gameId=1\" target=\"_blank\" class=\"gwzn\"></a> <a href=\"http://imprest.woniu.com/imprest/imprest_main.html?gameId=1\" target=\"_blank\" class=\"hycz\"></a> <a href=\"http://vc.woniu.com/news/cx/\" target=\"_blank\" class=\"yhhd\"></a> <a href=\"http://support.woniu.com/index.do?gameid=1\" target=\"_blank\" class=\"jrym\"></a> <a href=\"http://support.woniu.com/index.do?gameid=1\" target=\"_blank\" class=\"rhym\"></a> <a href=\"http://support.woniu.com/index.do?gameid=1\" target=\"_blank\" class=\"ymfy\"></a> <a href=\"http://vc.woniu.com/2j/chaxun.html\" target=\"_blank\" class=\"hfbwl\"></a> <a href=\"http://passport.woniu.com/PassportDetailPrepare.do?method=findUserInfo\" target=\"_blank\" class=\"zlbt\"></a> <a href=\"http://act.woniu.com/vc/vchd/index.php\" target=\"_blank\" class=\"ntwg\"></a> <a href=\"http://vc.woniu.com/media/\" target=\"_blank\" class=\"hhsjk\"></a> </div>";
suspendcode14 += "<div class=\"piao_foot\"></div>";
suspendcode14 += "</div></div></div>";

document.write(suspendcode12);
document.write(suspendcode14);

$(window).ready(function() {
	window.setInterval("heartBeat()",1);
});

function closeBanner()
{
document.getElementById("ALayer1").style.display= 'block';
document.getElementById("ALayer2").style.display= 'none';
document.getElementById("nav").style.margin = '3px 0px 0px 20px';
document.getElementById("header").style.width = '98%';
document.getElementById("header").style.margin = '0px 5px 0px 10px';
document.getElementById("header").style.float ='none';
document.getElementById("main-div").style.width = '98%';
document.getElementById("main-div").style.margin = '0px 5px 0px 10px';
document.getElementById("main-div").style.float ='none';
document.getElementById("main-right").style.display= 'none';
}
function showBanner(){
document.getElementById("ALayer1").style.display= 'none';
document.getElementById("ALayer2").style.display= 'block';
document.getElementById("nav").style.margin = '3px 0px 0px 20px';
document.getElementById("header").style.width = '85%';
document.getElementById("header").style.margin = '0px 5px 0px 0px';
document.getElementById("header").style.float ='left';
document.getElementById("main-div").style.width = '85%';
document.getElementById("main-div").style.margin = '0px 5px 0px 10px';
document.getElementById("main-div").style.float ='left';
document.getElementById("main-right").style.display= 'block';
}
function newposts(){
 try{
 var fid = document.getElementById("fid-div").value;
 if (fid=='' || fid=='undefined'){
 return;
 }else{
 //alert(fid);
 location.href=fid;
 }
 }catch(ex){
 alert('请先进入相关主题板块再点击发表');
 }
}
function im_sousuo(){
 var txt = document.getElementById("haoyoukeywd").value;
 if (txt =='按昵称搜索好友'){txt='';}
 location.href='http://www.woniu.com/home/search.html?searchStyle=exact&nickName='+txt;
 return;
 if (txt.search("^-?\\d+$")){
 location.href='http://www.woniu.com/home/search.html?searchStyle=exact&nickName='+txt;
 }else{
 location.href='http://www.woniu.com/home/search.html?searchStyle=exact&userId='+txt;
 }
}

function closepf(){
 document.getElementById("ALayer1").style.display= 'none';
 document.getElementById("ALayer2").style.display= 'none';
 }