
// JavaScript Document

/*
 $ 标签内容切换函数 TabSwitch()
   TagsId: 标签区域id
   idpre:  切换的各个内容区id号的前缀,如"content_1,content_2,content_3"的idpre为"content_"
   id:     切换的各个内容区id号的后缀,如"content_1,content_2,content_3"的id分别为"1,2,3"
 */

function TabSwitch(TagsId,idpre,id){
	var divs;
	var TabsMenu=document.getElementById(TagsId);
	var lis=TabsMenu.getElementsByTagName("li");
	for(var i=1;i<lis.length+1;i++)
	{
		divs=document.getElementById(idpre+i);
		if(divs)
		{
		if(i==id){
			lis[i-1].className="current";
			divs.style.display="block";
			}
		else{
			lis[i-1].className="";
			divs.style.display="none";
			}
		}
	}
}

function menuSelect(){
	var menu=document.getElementById("leftPanel");
	var menu_li=menu.getElementsByTagName("li");
	for(var i=0; i<menu_li.length; i++){
		menu_li[i].className="";
		menu_li[i].onclick=function(){
			var menu_list=menu.getElementsByTagName("li");
			for(var j=0; j<menu_list.length; j++){
				menu_list[j].className="";
			}
			this.className="current";
		}
	}
}

//广告js
// data      : 2010-05-25
// Script by : linx
function OpenWBS_ChangeImg(pre,n) {
	if(n>0){
		eval(''+pre+'Slider_nn = n');
		window.clearInterval(eval(''+pre+'Slider_tt'));
	}
	eval('document.getElementById("'+pre+'Sliderpic").src='+pre+'Slider_img['+ eval(''+pre+'Slider_nn') +']');
	eval('document.getElementById("'+pre+'url").href='+pre+'Slider_url['+ eval(''+pre+'Slider_nn') +']');
	eval('document.getElementById("'+pre+'Sliderpic").alt='+pre+'Slider_alt['+ eval(''+pre+'Slider_nn') +']');
	if (eval(''+pre+'Slider_nn') == 1) {
		document.getElementById(""+pre+"url").target = "_blank";
		document.getElementById(""+pre+"url").style.cursor = "pointer";
	} else {
		document.getElementById(""+pre+"url").target = "_blank"
		document.getElementById(""+pre+"url").style.cursor = "pointer"
	}
	for ( var i = 1; i <= eval(''+pre+'Slider_counts'); i++) {
		document.getElementById(""+pre+"xxjdjj" + i).className = 'axx';
	}
	document.getElementById(pre+"xxjdjj"+eval(''+pre+'Slider_nn')).className = "current";
	eval(''+pre+'Slider_nn++');
	if (eval(''+pre+'Slider_nn') > eval(''+pre+'Slider_counts')) {
		eval(''+pre+'Slider_nn = 1');
	}
	eval(''+pre+'Slider_tt = setTimeout("OpenWBS_ChangeImg(\''+pre+'\',0)", 30000)');
}
function ImageShow(pre,width,height) {
	document.writeln("<style type=\"text/css\">")
	document.writeln("."+pre+"picshow_main { background:#AABCD2; height:"+height+"px; width:"+width+"px; overflow:hidden; position:relative; z-index:2; }");
	document.writeln("."+pre+"picshow_main .imgbig { height:"+height+"px; width:"+width+"px; }");
	document.writeln("."+pre+"picshow_change { position:absolute; text-align:left; bottom:12px; right:15px; z-index:3;}");
	document.writeln("."+pre+"picshow_change a { background:#000; color:#FFF; display:inline-block; font-size:10px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; height:18px; line-height:18px; margin:0px 1px 0px 0px; width:18px; text-align:center; }");
	document.writeln("."+pre+"picshow_change a:hover{ background:#000; text-decoration:none; color:#FFF;}");
	document.writeln("."+pre+"picshow_change a.axx { filter:alpha(opacity=30); opacity:0.3; -moz-opacity:0.3;}");
	document.writeln("."+pre+"picshow_change a.axx:hover { filter:alpha(opacity=100); opacity:1.0; -moz-opacity:1.0; }");
	document.writeln("."+pre+"picshow_change a.current { background:#000; color:#FFF;}");
	document.writeln("</style>")
	
	document.write('<div class="'+pre+'picshow_main">');
	document.write('<div><a id="'+pre+'url"><img id="'+pre+'Sliderpic" class="imgbig" /></a></div>');
	document.write('<div class="'+pre+'picshow_change">');
	
	for ( var i = 0; i < eval(''+pre+'Slider_counts'); i++) {
		document.write('<a href="javascript:OpenWBS_ChangeImg(\''+pre+'\','+(i+1)+')" id=\"'+pre+'xxjdjj' +(i+1)+'\" class=\"axx\" target=\"_self\">'+(i+1)+'</a>');
	}
	document.write('</div></div>');
	OpenWBS_ChangeImg(pre,0);
}
//商城购物版
function ImageShow_shop(pre,width,height) {
	document.writeln("<style type=\"text/css\">")
	document.writeln("."+pre+"picshow_main { background:#AABCD2; height:"+height+"px; width:"+width+"px; overflow:hidden; position:relative; z-index:2; }");
	document.writeln("."+pre+"picshow_main .imgbig { height:"+(height-28)+"px; width:"+width+"px; }");
	document.writeln("."+pre+"picshow_change { background:#EEE url(Images/SliderPic_Title_bg.gif) 0px 0px repeat-x; border:1px solid #DAC5A6; border-top:0px; height:28px; position:absolute; bottom:0px; left:0px; text-align:left; width:"+(width-2)+"px; z-index:3; overflow:hidden; font-family:Arial, Helvetica, sans-serif;}");
	document.writeln("."+pre+"picshow_change a , ."+pre+"picshow_change a:visited{ border-right:1px solid #E3D2B7; border-left:1px solid #FFF; color:#876635; display:inline-block; font-size:12px; height:24px; line-height:24px; padding:4px 0px 0px 0px; width:240px; text-align:center; text-decoration:none;}");
	document.writeln("."+pre+"picshow_change a:hover{ text-decoration:none; color:#5B3C0E;}");
	document.writeln("."+pre+"picshow_change a.current { color:#5B3C0E; font-weight:bold;}");
	document.writeln("</style>")
	
	document.write('<div class="'+pre+'picshow_main">');
	document.write('<div><a id="'+pre+'url"><img id="'+pre+'Sliderpic" class="imgbig" /></a></div>');
	document.write('<div class="'+pre+'picshow_change">');
	for ( var i = 0; i < eval(''+pre+'Slider_counts'); i++) {
		document.write('<a href="javascript:OpenWBS_ChangeImg(\''+pre+'\','+(i+1)+')" id=\"'+pre+'xxjdjj' +(i+1)+'\" class=\"axx\" target=\"_self\">' + eval(''+pre+'Slider_alt[('+i+' + 1)]') + '</a>');
	}
	document.write('</div></div>');
	OpenWBS_ChangeImg(pre,0);
}
//广告js:end
