﻿// JavaScript Document
//搜索
var s_Type=0; //默认搜索产品类型为全部  1为特价商品　2为积分况换商品
var s_TopCls=0; //默认全部全品分类   大于0则表示一级大类ID
var s_SubCls=0; //默认全部全品小类   大于0则表示二级分类ID
function getStype(sType)
{
	if(sType>=0 &&sType<3)
	{
		s_Type=sType;    
        for(var i=0;i<3;i++){ 
		   if (i!=sType){
             $("sType_"+i).className=""; 
		   }else{
			 $("sType_"+i).className="active";   
		   }
        } 		
	}
}
function getTopCls(sTopCls)
{
	s_TopCls=sTopCls;
	var obj=$$("#search_list dt");
	for (i=0;i<obj.length;i++){
		if(obj[i].className=="active"){
		   obj[i].className="";
		}
	}
	obj=$$("#search_list dd");
	for (i=0;i<obj.length;i++){
		if(obj[i].className=="active"){
		   obj[i].className="";
		}
	}
	$("s_"+sTopCls).className="active";
}
function getSubCls(sTopCls,sSubCls)
{
	s_TopCls=sTopCls;
	s_SubCls=sSubCls;
	var obj=$$("#search_list dt");
	for (i=0;i<obj.length;i++){
		if(obj[i].className=="active"){
		   obj[i].className="";
		}
	}
	obj=$$("#search_list dd");
	for (i=0;i<obj.length;i++){
		if(obj[i].className=="active"){
		   obj[i].className="";
		}
	}
	$("s_"+sTopCls).className="active";
	$("s_"+sTopCls+"_"+sSubCls).className="active";
}
function _doSearch(){
	var key_Word=$("key_word").value;
	key_Word=key_Word.replace("-","");
	key_Word=key_Word.length>10?key_Word.substring(1,10):key_Word;
	//key_Word=escape(key_Word);
	//alert(key_Word);
	var red_url="/Category-"+s_TopCls+"-"+s_SubCls+"-"+s_Type+".aspx?k="+encodeURI(key_Word);
	//alert(red_url);
	document.location.href=red_url;
}

//搜索end

var waitting = 1;
var secondLeft = waitting;
var timer;				
var sourceObj;
var number;
function SetTimer()//主导航时间延迟的函数
    {
	    for(j=1; j <10; j++){
		    if (j == number){
		        if($("ctl00_Hd1_mm"+j)){
			        $("ctl00_Hd1_mm"+ number).className = "now";

			    }
		    }
		    else{
		         if($("ctl00_Hd1_mm"+j)){ 
			        $("ctl00_Hd1_mm"+ j).className = "";
			    }
		    }
	    }
    }
function CheckTime()//设置时间延迟后
    {
	    secondLeft--;
	    if ( secondLeft == 0 )
	    {
	    clearInterval(timer);						
	    SetTimer();		
	    }
    }
function showM(thisobj,Num)//主导航鼠标滑过函数，带时间延迟
    {
	    number = Num;
	    sourceObj = thisobj;
	    secondLeft = 1;
	    timer = setTimeout('CheckTime()',100);
    }
function OnMouseLeft()//主导航鼠标移出函数，清除时间函数
    {
	    clearInterval(timer);
    }
	
   
  
function ShowHover(ObjIDs){    
  if(document.all){ // 判断是否IE浏览器    
    var obj=$$(ObjIDs);    
    for(var i=0;i<obj.length;i++){    
      obj[i].onmouseover=function(){this.className="on"};    
      obj[i].onmouseout=function(){this.className=""}    
     }    
  }    
}    
/* ========== 舌签构造函数 begin ========== */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('r z=1g.1h.1i("1j")!=-1?I:9;s 6(h,j,k,l,m){5.1k="1.0";5.1l="1m";5.t=6.$(h);7(5.t==q){J B K("6(x)参数错误:x 对像存在!")};7(!6.u){6.u=B 1n()};5.x=6.u.v;6.u.17(5);5.1o=9;5.8=[];5.R=k==q?0:k;5.L=5.R;5.S=l==q?"1p":l;5.T=m==q?"":m;5.M=9;r n=U("6.u["+5.x+"].M = I");r o=U("6.u["+5.x+"].M = 9");7(z){5.t.C("V",n)}w{5.t.D("W",n,9)};7(z){5.t.C("X",o)}w{5.t.D("Y",o,9)};7(Z(j)!="1q"){j="1r"};j=j.1s();1t(j){N"V":5.y="W";E;N"X":5.y="Y";E;N"1u":5.y="1v";E;N"1w":5.y="1x";E;1y:5.y="1z"};5.18=s(a,b,c,d,e){7(6.$(a)==q){J B K("18(19)参数错误:19 对像存在!")};r f=5.8.v;7(c==""){c=q};5.8.17([a,b,c,d,e]);r g=U(\'6.u[\'+5.x+\'].F(\'+f+\')\');7(z){6.$(a).C("1A"+5.y,g)}w{6.$(a).D(5.y,g,9)};7(f==5.R){6.$(a).O=5.S;7(6.$(b)){6.$(b).A.P=""};7(c!=q){5.t.A.1a=c};7(d!=q){G(d)}}w{6.$(a).O=5.T;7(6.$(b)){6.$(b).A.P="1b"}};7(6.$(b)){7(z){6.$(b).C("V",n)}w{6.$(b).D("W",n,9)};7(z){6.$(b).C("X",o)}w{6.$(b).D("Y",o,9)}}};5.F=s(a){7(Z(a)!="10"){J B K("F(1c)参数错误:1c 不是 10 类型!")};r i;11(i=0;i<5.8.v;i++){7(i==a){6.$(5.8[i][0]).O=5.S;7(6.$(5.8[i][1])){6.$(5.8[i][1]).A.P=""};7(5.8[i][2]!=q){5.t.A.1a=5.8[i][2]};7(5.8[i][3]!=q){G(5.8[i][3])}}w 7(5.L==i){6.$(5.8[i][0]).O=5.T;7(6.$(5.8[i][1])){6.$(5.8[i][1]).A.P="1b"};7(5.8[i][4]!=q){G(5.8[i][4])}}};5.L=a};5.12=s(){7(H.v!=5.8.v){J B K("12()参数错误:参数数量与标签数量不符!")};r a=0,i;11(i=0;i<H.v;i++){a+=H[i]};r b=1B.12(),13=0;11(i=0;i<H.v;i++){13+=H[i]/a;7(b<13){5.F(i);E}}};5.Q=9;r p=q;5.14=1C;5.1D=s(a){7(Z(a)=="10"){5.14=a};1d(p);p=1E("6.u["+5.x+"].1e()",5.14);5.Q=I};5.1e=s(){7(5.Q==9||5.M==I){15};r a=5.L;a++;7(a>=5.8.v){a=0};5.F(a)};5.1F=s(){1d(p);5.Q=9}};6.$=s(a){7(16.1f){15 G(\'16.1f("\'+a+\'")\')}w{15 G(\'16.1G.\'+a)}}',62,105,'|||||this|SubShowClass|if|label|false|||||||||||||||||null|var|function|parentObj|childs|length|else|ID|eventType|isIE|style|new|attachEvent|addEventListener|break|select|eval|arguments|true|throw|Error|selectedIndex|mouseIn|case|className|display|autoPlay|defaultID|openClassName|closeClassName|Function|onmouseover|mouseover|onmouseout|mouseout|typeof|number|for|random|percent|spaceTime|return|document|push|addLabel|labelID|background|none|num|clearInterval|nextLabel|getElementById|navigator|appVersion|indexOf|MSIE|version|author|mengjia|Array|lock|selected|string|onmousedown|toLowerCase|switch|onclick|click|onmouseup|mouseup|default|mousedown|on|Math|5000|play|setInterval|stop|all'.split('|'),0,{}))
/* ========== 舌签构造函数 end ========== */   


function collection()
{
    if (document.all){   
        window.external.addFavorite('http://www.tenou.com', '腾游网-欧美游戏专业交易平台,在线金币收购,游戏虚拟商城');   
    }else if (window.sidebar){   
        window.sidebar.addPanel('腾游网-欧美游戏专业交易平台,在线金币收购,游戏虚拟商城', 'http://www.tenou.com', "");   
    } 
}
function home(name,url)
{
    if (document.all){   
        document.body.style.behavior = 'url(#default#homepage)';   
        document.body.setHomePage('http://www.tenou.com');   
    }else if (window.sidebar){   
        if (window.netscape){   
            try {   
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
            }catch (e) {   
                alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");   
            }   
        }   
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);   
        prefs.setCharPref('browser.startup.homepage', 'http://www.tenou.com'); 
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  var redirect;
  redirect=selObj.options[selObj.selectedIndex].value;
  if (redirect!="-1")
  {
     eval(targ+".location='"+redirect+"'");
  }
  if (restore) selObj.selectedIndex=0;
}
