﻿/*=============================================================================================*/
function g(o){return document.getElementById(o);
}
if (document.attachEvent){
  addEvent = function(o,evn,f){o.attachEvent("on"+evn,f)
}
}
else if (document.addEventListener){
  addEvent = function(o,evn,f){o.addEventListener(evn,f,false)
}
}
function initTab(nid,cid,action,defaultIndex){
  var ls = g(nid).getElementsByTagName('li');
  var cc = g(cid).childNodes;
  var c = [];
  var index = defaultIndex?defaultIndex:0;
  for (var i = 0 ; i < cc.length ; i ++)if(cc[i].nodeType==1)c.push(cc[i]);
  if (ls.length!=c.length)
    throw({description:'菜单和内容数量不对应'
});
  for (var i = 0 ; i < ls.length ; i ++){
    ls[i].index = i;
    if (i==index){
      ls[i].className = 'hovertab';
      c[i].className = 'dis'
      ls[i].parentNode.last = ls[i];
    }
    addEvent(ls[i],action,function(e){
      var self = window.event?window.event.srcElement:e?e.target:null;
      if (self.parentNode.last){
        self.parentNode.last.className = 'normaltab';
        c[self.parentNode.last.index].className = 'undis';
      };
      self.className = 'hovertab';
      c[self.index].className = 'dis';
      self.parentNode.last = self;
    });
  }
}
/*=============================================================================================*/
function changesubmit() 
{
FORM_TPL_SEARCHMORE.gOo.value = "goods_search_more.dwt";
FORM_TPL_SEARCHMORE.submit();
}

/*=============================================================================================*/
function switchMenu(curr_id, total_num) 
{
     for(var i=0; i<total_num; i++)
     {
         var el = document.getElementById('menu_sub_'+i);

          if(!el) return;

         var img = document.getElementById('menu_master_'+i);

          if(i == curr_id)
         {
             el.style.display = "block";
             img.src = "images/open.gif";
         }
         else
         {
             el.style.display = "none";
             img.src = "images/close.gif";
         }
     }
 }



/*=============================================================================================*/

var number=5; //定义条目数

function LMYC() {
var lbmc;
    for (i=1;i<=number;i++) {
        lbmc = eval('LM' + i);
        lbmc.style.display = 'none';
    }
}
 
function ShowFLT(i) {
    lbmc = eval('LM' + i);
    if (lbmc.style.display == 'none') {
        LMYC();
        lbmc.style.display = '';
    }
    else {
        lbmc.style.display = 'none';
    }
}


/*=============================================================================================*/
function menuFix() {
	var l_usernav = document.getElementById("l_usernav");
	var k_usernav = document.getElementById("k_usernav");
	if(l_usernav!=null&&k_usernav!=null){
		l_usernav.innerHTML = k_usernav.innerHTML;
		k_usernav.outerHTML = "";
	}
	if(l_usernav==null){k_usernav.style.visibility = "visible";}
	
	var sfEls = document.getElementById("k_menu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseDown=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseUp=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onmouseout=function() {
		this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"");
		}
	}
}

function MyCat(path){
	var cat=window.open(path+"/showcat.asp?"+Math.random(),"cat","toolbar=no,menubar=no,location=no,status=no,width=600,height=400,scrollbars=yes");
}

function AddCat(catid,number,path){ //把商品添加到“手推车”函数
	QUERY_STRING = "?action=add&sid="+ catid +"&number="+number;
	var cat=window.open(path+"/showcat.asp"+QUERY_STRING,"cat","toolbar=no,menubar=no,location=no,status=no,width=600,height=400,scrollbars=yes"); //打开一个新窗口来显示统计的商品信息,即显示“手推车”
} 

function EditCat(catid,number,path){ //把商品添加到“手推车”函数
	QUERY_STRING = "?action=edit&sid="+ catid +"&number="+number;
	var cat=window.open(path+"/showcat.asp"+QUERY_STRING,"cat","toolbar=no,menubar=no,location=no,status=no,width=600,height=400,scrollbars=yes"); //打开一个新窗口来显示统计的商品信息,即显示“手推车”
} 

function IsDeleteCookie(str,name,path){//清除商品列表
	if(confirm(str)){
		QUERY_STRING = "?action=del&sid="+ name ;
		self.location.href = path + "/showcat.asp" + QUERY_STRING ;
	}
}

function IsClearCookie(str,path){//清除商品列表
	if(confirm(str)){
		QUERY_STRING = "?action=clear";
		self.location.href = path + "/showcat.asp" + QUERY_STRING ;
	}
}

function DeleteOrder(oid){
	if(confirm('是否删除此订单？')){
		self.location.href='user.asp?action=delorder&oid='+oid;
	}
}

function OpenOrder(path,oid){
	var Order=window.open(path+"/showorder.asp?oid="+oid,"Order","toolbar=no,menubar=no,location=no,status=no,width=600,height=400,scrollbars=yes");
}

function AddFav()
{
	var localurl = location.href;                  //获取当前的url地址信息
	window.external.AddFavorite(localurl, document.title)
}

/*tabs.js===========================================================================================*/



function reviewArticle()
{
	document.getElementById("Content").focus();
}

function AddFav()
{
	var localurl = location.href;                  //获取当前的url地址信息
	window.external.AddFavorite(localurl, document.title)
}

function doZoom(size)
{
	document.getElementById('zoom').style.fontSize=size+'px';
}
	
function doPrint(){
	var str="<html>";
	var article;
	var css;
	var strAdBegin="<!--NEWSZW_HZH_BEGIN-->";
	var strAdEnd="<!--NEWSZW_HZH_END-->";
	var strFontSize='【<A href="javascript:doZoom(16)">大</A> <A href="javascript:doZoom(14)">中</A> <A href="javascript:doZoom(12)">小</A>】'
	var strdoPrint="doPrint()";
	var strTmp;
	
	css="<style>"
	+"body{font-family:宋体}"
	+"td,.f12{font-size:12px}"
	+".f24 {font-size:24px;}"
	+".f14 {font-size:14px;}"
	+".title14 {font-size:14px;line-height:130%}"
	+".l17 {line-height:170%;}"
	+"</style>";

	str +=	css;
	str +=	'<meta http-equiv="content-type" content="text/html; charset=gb2312">';
	str +=	'<title>'+document.title+'</title>';
	str +=	"<body bgcolor=#ffffff topmargin=5 leftmargin=5 marginheight=5 marginwidth=5 onLoad='window.print()'>";
	str +=	"<center><table width=600 border=0 cellspacing=0 cellpadding=0><tr><td height=34 width=150><a href=http://www.92wy.com><img src=http://business.92wy.com/logo/92wy.gif width=88 height=31 border=0 alt=万宇在线></a></td><td valign=bottom><font color=#0000ff><a href=http://www.92wy.com/ class=a02>万宇首页</a> > <a href=http://news.92wy.com/ class=a02>新闻中心</a> >  正文</font></td><td align=right valign=bottom><a href='javascript:history.back()'>返回</a>　<a href='javascript:window.print()'>打印</a></td></tr></table>";
	str +=	"<table width=600 border=0 cellpadding=0 cellspacing=20 bgcolor=#EDF0F5><tr><td>";
	
	article=document.getElementById('article').innerHTML;
	if(article.indexOf(strAdBegin)!=-1){
		str +=article.substr(0,article.indexOf(strAdBegin));
		strTmp=article.substr(article.indexOf(strAdEnd)+strAdEnd.length, article.length);
	}else{
		strTmp=article
	}
	str +=strTmp
	str += window.location.href
	str +=	"</td></tr></table></center>";
	str +=	"</body></html>";
	document.write(str);
	document.close();
}

function setReviewSpan()
{
	if (document.getElementById("review_span"))
	{
		document.getElementById("review_span_show").innerHTML = document.getElementById("review_span").innerHTML;
	}
	else
	{
		setTimeout(setReviewSpan, 1000);
	}
}
setReviewSpan();


/*=============================================================================================*/
/*=============================================================================================*/
/*=============================================================================================*/
/*=============================================================================================*/


















function menuFix() {
	var sfEls = document.getElementById("k_menu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseDown=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseUp=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onmouseout=function() {
		this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 

"");
		}
	}
}

function jumpmenu(obj){eval("parent.location='"+obj.options[obj.selectedIndex].value+"'");}

var path='/page/';//前台系统目录

function openinfo(id){
	var obj=document.getElementById(id);
	if (obj.style.display=='')
	{
		obj.style.display='none';
		document.getElementById(id+'img').src=path+'images/open.gif'
	}
	else
	{
		obj.style.display='';
		document.getElementById(id+'img').src=path+'images/close.gif'
	}
}


function ll(l1,l2,l3,l4,l5,l6,l7,l8,l9,la,lb,lc,ld,le,lf,lg,lh,li,lj,lk)
{
var out='<dd class="userinfo" id="'+l4+l3+'" style="display:none;">';
out=out+'<div class="k_fl" style="width:30%;text-align:center;">';
out=out+l5+'<br/>'+l6;
out=out+'</div>';
out=out+'<div class="k_fr" style="width:68%;text-align:left;">';
out=out+'<span class="k_fr">';
out=out+'<a href="'+path+'post.asp?action='+l4+'&'+l4+'id='+l3+'"><img src="'+path+'image/info/edit.gif" alt="编辑"/></a>';
out=out+'<a href="'+path+'post.asp?action=del&'+l4+'id='+l3+'" onClick="javascript:return confirm(\'确定要删除吗?\')" ><img src="'+path+'image/info/del.gif" alt="删除"/></a>';
out=out+'<a href="'+path+'post.asp?action=board&retopic='+l2+'&quote'+l4+'='+l3+'"><img src="'+path+'image/info/quote.gif" alt="引用"/></a>';
out=out+'</span>';
out=out+'<span><strong><a target="_blank" href="'+path+'user.asp?userid='+l1+'" title="'+l7+'">'+l7+'</a></strong></span><br/>';
out=out+'<span>会员级别：'+l8+' '+l9+'</span><br/>';
out=out+'<span>积分：'+la+'</span>';//la
out=out+'<span>威望：'+lb+'</span>';//11
out=out+'<span>精华：'+lc+'</span>';
out=out+'<span>帖子：'+ld+'</span>';
out=out+'<span>删除：'+le+'</span><br/>';
out=out+'<span>注册：'+lf+'</span>';
out=out+'<span>性别：'+lg+'</span>';
out=out+'<span>来自：'+lh+'</span><br/>';
out=out+'<span>特长：'+li+'</span><br/>';
out=out+'<span>联络：<a href="'+path+'user.asp?action=pm&userid='+l1+'" title="给 '+l7+' 发信息"><img alt="PM" src="'+path+'image/info/pm.gif"/></a>';
out=out+lj;//lj = (king:site/)(king:icq/)(king:qq/)(king:yahoo/)
out=out+'</span>';
out=out+'<span class="sign">'+lk+'</span>';//usersign
out=out+'</div>';
out=out+'</dd>';

document.write(out);
}
//A B C D E F G H I J K L M N Ñ O P Q R S T U V W X Y Z
