// JavaScript Document
// JavaScript Document
/**************************************************************
           ALIMAMA.COM! JavaScriptComponent Base
Written by:limu(lenel@yahoo.cn)
Important:to use this script don't remove these comments
Version 1.0
Created Date: 2007-5-1
Copyright:1997-2007 Alimama.Com All rights reserved.
**************************************************************/

var $w = window;
var $d = document;
var $l = location;
function $i(s){return $d.getElementById(s);}
function $t(s){return $d.getElementsByTagName(s);}
function $n(s){return $d.getElementsByName(s);}

var _jsc = {};
if(!_jschome)var _jschome='http://www.alimama.com/jsc/';

_jsc.loaded = false;

_jsc.client = (function(){	
	var t = {};
	var b = navigator.userAgent.toLowerCase();
	t.isOpera = (b.indexOf('opera') > -1);
	t.isIE = (!t.isOpera && b.indexOf('msie') > -1);
	t.isFF = (!t.isOpera &&!t.isIE&&b.indexOf('firefox') > -1);
	return t;
})();

_jsc.util = (function(){
	var t = {};
	t.addEvent = function(o,c,h){
		if(_jsc.client.isIE){
			o.attachEvent('on'+c,h);
		}else{
			o.addEventListener(c,h,false);
		}
		return true;
	};
	t.delEvent = function(o,c,h){
		if(_jsc.client.isIE){
			o.detachEvent('on'+c,h);
		}else{
			o.removeEventListener(c,h,false);
		}
		return true;
	};
	t.ga = function(o,s){
		return o.getAttribute(s);
	};
	t.sa = function(o,k,v){
		return o.setAttribute(k,v);
	};
	t.s2d = function(s){
		var sa = s.split('-');
		var d =  new Date(sa[0],(sa[1]-1),sa[2]);
		return d;
	};
	t.d2s = function(d,b){
		var ye = d.getFullYear();
		var me = (parseInt(d.getMonth())+1).toString()
		var de = d.getDate();
		if(me.length==1&&b)me='0'+me;
		if(de.length==1&&b)de='0'+de;
		return ye+me+de;
	};
	return t;
})();

_jsc.mgr = (function(){
	var t = {};
	t.s = [];
	t.addC = function(o){
		this.s.push(o);
	};
	t.getC = function(bid){
		for(var i=0;i<this.s.length;i++){
			if(this.s[i].bid==bid){
				return this.s[i];
			}
		}
		return null;
	};
	return t;
})();

_jsc.ajax = (function(){
	t={};
	t.getAjax = function(){
		try{
			return new XMLHttpRequest();
		}catch(e){
			try{
				return new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				return new ActiveXObject('Microsoft.XMLHTTP')
			}
		}
		return null;
	};
	return t;
})();

_jsc.dom = (function(){
	var t = {};
	t.gNxtSib = function(o){
		var co = o;
		do{
			if(co.nextSibling==null || co.nextSibling.nodeType==1){
				return co.nextSibling;
			}else{
				co = co.nextSibling;
			}			
		}while(true)
	};
	
	return t;
})();

_jsc.evt = (function(){
	var t = {};
	t.gTar = function(oe){
		if(_jsc.client.isIE){
			return oe.srcElement;
		}else{
			return oe.target;
		}
	};
	t.gJsc = function(o){
		var ot = o
		do{
			if(ot.getAttribute("c_type")){
				return ot;
			}
			if(ot.parentNode){
				ot = ot.parentNode;
			}else{
				return null;
			}
		}while(true);
	};
	t.evtHandler = function(){
		var eo = window.event?window.event:arguments[0];
		var tar = _jsc.evt.gTar(eo);
		var jsc = _jsc.evt.gJsc(tar).jsc;
		et = eo.type;
		eval("var h = jsc.jsc"+et);
		h(tar,jsc);
	};
	t.fire = function(jsc,etype,evt){
		eval("var h = jsc.c_on"+etype);
		eval("var t = typeof "+h);
		if(t == "function"){
			eval(h+"(evt)");
		}
	};
	return t;
})();

_jsc.his = (function(){
	var t={};
	t.srvPath = _jschome+'htm/hisSrv.html';
	t.srvFrame = $i("hisSrvFrame");
	t.ahMap = {};
	t.setAH = function(act,handler){
		var m = this.ahMap;
		eval('m.'+act+'="'+handler+'";');
	};
	t.doGet = function(act,para){
	    var appSch = $n("jscAppendSearch");
	    var as = "";
	    for(var i=0;i<appSch.length;i++){
	        var appAct = appSch[i].getAttribute("act");
	        if(appAct == act){
	            as += appSch[i].value;
	        }
	    }
		if(!this.srvFrame)this.srvFrame = $i("hisSrvFrame");
		this.srvFrame.src = this.srvPath+'?act='+act+as+para;
	};
	t.actionSwitch = function(act,para){
		var m = this.ahMap;
		eval('var h = this.ahMap.'+act+';');
		eval(h+'(para);');
	};

	t.setRefCookie = function(pagename){
	    try{
	        var refCookie = []; 
			refCookie.push(pagename);
            refCookie.push($i("hisSrvFrame").contentWindow.location.search);
            if(typeof addRefCookie == "function"){
                addRefCookie(refCookie);
            }
            var refreshCookie = refCookie.join("@jsc@");
            _jsc.cookies.setCookie("jscref",refreshCookie,6/60/60/24);
        }catch(e){}
	};
	t.getRefCookie = function(){
	    var refCookie = []; 
	    try{
	       var refreshCookie = _jsc.cookies.getCookie("jscref");
	       refCookie = refreshCookie.split("@jsc@");
	    }catch(e){}
	    return refCookie;
	};
	return t;
})();

_jsc.state = (function(){
	var t = {};
	t.eleList = [];
	t.chkList = [];
	t.loaded = false;
	t.addEle = function(o){
		if(o instanceof JscStateElement){
			this.eleList.push(o);
			if(o.check==true){
				this.chkList.push(o);
			}
		}
	};	
	t.setState = function(para){
		var u = para;
		for(var i = 0;i < this.eleList.length;i++){
			var ele = this.eleList[i];
			var ukey = ele.urlKey;
			var uvalue = this.getUrlValue(para,ukey);
			ele.setState(uvalue);
		}
	};
	t.getUrlValue = function(para,ukey){
		var andpara = '&'+para;
		var lowerpara = andpara.toLowerCase();
		if(lowerpara.indexOf('&'+ukey+'=')!=-1){
			var s = andpara.substr(lowerpara.indexOf('&'+ukey+'=')+1);
			var sa = s.split('&');
			var sav = sa[0].split('=');
			if(sav.length==2){
				return sav[1];
			}
		}
		return '';
	};
	t.getState = function(ukey){
		var u='';
		for(var i = 0;i < this.eleList.length;i++){
			var ele = this.eleList[i];
			if(ele.urlKey==ukey||ele.check==true){
				ele.getState();
			}
		}
		for(var i = 0;i < this.eleList.length;i++){
			var ele = this.eleList[i];
			u+='&'+ele.urlKey+'='+ele.currentState;
		}
		_jsc.his.doGet('sch',u);
	};
	t.chgPage = function(pgno){
		var u = '&p='+pgno;
		for(var i = 0;i < this.eleList.length;i++){
			var ele = this.eleList[i];
			ele.getState();
			u+='&'+ele.urlKey+'='+ele.currentState;
		}
		_jsc.his.doGet('sch',u);
		return false;
	};
	t.toDefaultState = function(){
		
	};
	return t;
})();

_jsc.pos = (function(){
	var t = {};
	t.getX = function (obj){
        var curleft = 0;
        if (obj.offsetParent)
        {
          while (obj.offsetParent)
        {
             curleft += obj.offsetLeft;
             obj = obj.offsetParent;
          }
        }
        else if (obj.x) {
          curleft += obj.x;
        }
        return curleft;
    };
    t.getY = function (obj){
    var curtop = 0;
        if (obj.offsetParent)
        {
          while (obj.offsetParent)
          {
             curtop += obj.offsetTop;
             obj = obj.offsetParent;
          }
        }
        else if (obj.y)
          curtop += obj.y;
        return curtop;
    };
	return t;
})();

_jsc.cookies = (function(){
	var t = {};
	t.setCookie = function(name,value,days)
	{
		if(days){
	  	var exp  = new Date(); 
	  	exp.setTime(exp.getTime() + days*24*60*60*1000);
	  	document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString()+";path=/;";
		}else{
			document.cookie = name + "="+ escape(value)+";path=/;";
		}
	};
	
	t.getCookie = function(name)
	{
	  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	  if(arr != null) return unescape(arr[2]); return null;
	};
	
	t.setCookie2 = function(name,value,days)
	{
		if(days){
	  	var exp  = new Date(); 
	  	exp.setTime(exp.getTime() + days*24*60*60*1000);
	  	document.cookie = name + "="+ encodeURIComponent(value) +";expires="+ exp.toGMTString()+";path=/;";
		}else{
			document.cookie = name + "="+ encodeURIComponent(value)+";path=/;";
		}
	};
	
	t.getCookie2 = function(name)
	{
	  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	  if(arr != null) return decodeURIComponent(arr[2]); return null;
	};
	
	t.delCookie = function(name)
	{
	  var exp = new Date();
	  exp.setTime(exp.getTime() - 1);
	  var cval=getCookie(name);
	  if(cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();
	};
	
	t.delCookie2 = function(name)
	{
	  var exp = new Date();
	  exp.setTime(exp.getTime() - 1);
	  var cval=getCookie2(name);
	  if(cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();
	};
	
	return t;
})();

_jsc.jscload = (function(){
	var t = function(){
	    if(!_jsc.quickload){
    		var cs = $t('label');
    		for(var i=0;i<cs.length;i++){		
    			var ct = _jsc.util.ga(cs[i],'c_type');
    			if(ct){
    				var pe = _jsc.dom.gNxtSib(cs[i]);
    				if(pe){
    					eval("new "+ct+"(pe)");
    				}
    			}
    		}
		}
		if(typeof jsconload == 'function'){
			jsconload();
		}
		_jsc.loaded = true;
	};
	return t;
})();

_jsc.jscunload = (function(){
	var t = function(){
		if(true){
		    try{
				if(typeof jsconload == 'function'){
					jsconunload();
				}		                       		
            }catch(e){}
		}
	};
	return t;
})();

_jsc.init = (function(){
	_jsc.util.addEvent(window,'load',_jsc.jscload);
	_jsc.util.addEvent(window,'unload',_jsc.jscunload);
	return true;
})();

function Jsc(){
	this.chkPropName = function(s){
		if(s == 'c_type'){
			return false;
		}
		return true;
	};		
	
	this.getAttr = function(k){
		return eval("this."+k);
	};
	
	this.setAttr = function(k,v,n){
		if(!n){
			if(typeof v == "string"){
				eval("this."+k+" = \""+v+"\"");
			}else{
				eval("this."+k+" = "+v);
			}
		}
	};
	
	this.initBase = function(){
		_jsc.mgr.addC(this);
		for(var i = 0;i<this.doc.attributes.length;i++){
			var nn = this.doc.attributes[i].nodeName;
			if(nn.indexOf("c_") == 0){
				if(this.chkPropName(nn)){
					var nv = this.doc.attributes[i].nodeValue;
					eval("this."+nn+" = '"+nv+"'");
				}
			}
		}
	};
}

function JscStateElement(ele,dft,ukey){
	this.getState = null;//y
	this.setState = null;//y
	this.defaultState = dft;
	this.currentState = dft;
	this.ele = ele;
	this.eid = ele.id;
	this.must = true;	
	this.ischanged = false;
	this.check = false;//o
	this.urlKey = ukey;
}

function JscSet(){
	this.arr = [];
	this.idx = {};
	this.cp = -1;
	this.al = 0;
	this.add = function(oid,obj){
		this.arr.push([oid,obj]);
		this.cp++;
		this.idx[oid] = this.cp;
		this.al++;
	};
	this.del = function(oid){
		var add = this.idx[oid];
		delete this.arr[add];
		this.al--;
		delete this.idx[oid];
	};
		
	this.getFirst = function(){
		if(this.al<1)return null;
		for(var i=0;i<this.arr.length;i++){
			if(this.arr[i]){
				return this.arr[i][1];
			}
		}
		return null;
	};
}


// JavaScript Document
// JavaScript Document

// 横着滚动
function simpleSideScroll(c,ul,config,direction){
    this.config = config ? config : {start_delay:3000, speed: 23, delay:4000, scrollItemCount:1};
	this.c = $i(c);
	this.ul = $i(ul);
	this.direction = direction ? direction : "left";
	this.pause = false;
	this.buttonlist= new Object();
	this.delayTimeId=null;
	
	var _this = this;



	this.c.onmouseover=function(){_this.pause = true;}
	this.c.onmouseout=function(){_this.pause = false;}
	
	this.init = function() {
		_this.scrollTimeId = null;
		setTimeout(_this.start,_this.config.start_delay);
	}
	
	this.start = function() {
		var d = _this.c;
		var width = d.getElementsByTagName('li')[0].offsetWidth;
		if(d.scrollWidth-d.offsetLeft>=width) _this.scrollTimeId = setInterval(_this.scroll,_this.config.speed)
	};
	
	this.scroll = function() {
		if(_this.pause)return;
		var ul= _this.ul;
		var d = _this.c;
		var width = d.getElementsByTagName('li')[0].offsetWidth;
		if(_this.direction == 'left'){
	        d.scrollLeft += 2;
	        if(d.scrollLeft%(width*_this.config.scrollItemCount)<=1){
		        if(_this.config.movecount != undefined)
			        for(var i=0;i<_this.config.movecount;i++){ul.appendChild(ul.getElementsByTagName('li')[0]);}
		        else for(var i=0;i<_this.config.scrollItemCount;i++){ul.appendChild(ul.getElementsByTagName('li')[0]);}
		        d.scrollLeft=0;
		        clearInterval(_this.scrollTimeId);
		        
		        _this.delayTimeId=setTimeout(_this.start,_this.config.delay);
	        }
		}
		else {
		    if(d.scrollLeft==0)
		    {
		        var lis=ul.getElementsByTagName('li');
		        for(var i=0;i<_this.config.scrollItemCount;i++){
		            ul.insertBefore(lis[lis.length-1],lis[0]);
		        }
		        d.scrollLeft = width;
		    }
		    d.scrollLeft -= 2;
		    if(d.scrollLeft%(width*_this.config.scrollItemCount)<=1){
		        d.scrollLeft=0;
		        clearInterval(_this.scrollTimeId);
		        _this.delayTimeId=setTimeout(_this.start,_this.config.delay);
		    }
		}
	}
	
	this.setButton=function(id,direction){
	    if($i(id)){
	        var c=$i(id);
	        var buttonlist =_this.buttonlist;
	        if(buttonlist[id] == undefined){
	            buttonlist[id] =new Object();
	            _this.buttonlist[id][0]=c;
	            _this.buttonlist[id][1]=direction;
	            
	            c.onclick=function(){
	                 clearInterval(_this.scrollTimeId);
	                 
	                var dir=_this.buttonlist[this.id][1];
	                var d = _this.c;
	                var ul= _this.ul;
	                d.scrollLeft=0;
	                if(dir =="left")
	                {
	                    for(var i=0;i<_this.config.scrollItemCount;i++){ul.appendChild(ul.getElementsByTagName('li')[0]);}
	                }
	                else{
	                    var lis=ul.getElementsByTagName('li');
		                for(var i=0;i<_this.config.scrollItemCount;i++){
		                    ul.insertBefore(lis[lis.length-1],lis[0]);
		                }
	                }
	                    
	                _this.direction= dir;
	                clearTimeout(_this.delayTimeId);
	                _this.delayTimeId=setTimeout(_this.start,_this.config.delay);
	                return false;
	            }
	        }
	    }
	}
}
// tab切换
function tabswitch(c, config){
	this.config = config ? config : {start_delay:3000, delay:1500};
	this.container = $i(c);
	this.pause = false;
	this.nexttb = 1;
	this.tabs = this.container.getElementsByTagName('dt');
	var _this = this;
	if(this.tabs.length<1)this.tabs = this.container.getElementsByTagName('li');
	for(var i = 0; i < this.tabs.length; i++){
		var _ec = this.tabs[i].getElementsByTagName('span');
		if(_ec.length<1)_ec = this.tabs[i].getElementsByTagName('a');
		if(_ec.length<1){
			_ec = this.tabs[i]
		}else{
			_ec = _ec[0];
		}
		_ec.onmouseover = function(e) {
			_this.pause = true;
			var ev = !e ? window.event : e;
			_this.start(ev, false, null);
		};
		
		_ec.onmouseout = function() {
			_this.pause = false;
		};
		
		try{
			$i(this.tabs[i].id + '_body_1').onmouseover = function(){
				_this.pause = true;
			};
			
			$i(this.tabs[i].id + '_body_1').onmouseout = function(){
				_this.pause = false;
			};
		}catch(e){}
	}

	if ($i(c + '_sts')) {
		var _sts = $i(c + '_sts');
		var _step = _sts.getElementsByTagName('li');
		if(_step.length<1)_step = _sts.getElementsByTagName('div');
		_step[0].onclick = function() {
			if (_this.tabs[_this.tabs.length-1].className.indexOf('current') > -1) {
				_this.nexttb = _this.tabs.length + 1;
			};
			_this.nexttb = _this.nexttb - 2 < 1 ? _this.tabs.length : _this.nexttb - 2;
			//alert(_this.nexttb);
			_this.start(null, null, _this.nexttb);
		};
		
		_step[1].onclick = function() {
			_this.nexttb = _this.nexttb < 1 ? 1 : _this.nexttb;
			_this.start(null, null, _this.nexttb);
		};
	};
	
	this.start = function(e, r, n){
		if(_this.pause && !e)return;
		if(r){
			curr_tab = $i(_this.container.id + '_' + rand(4));
		}else{
			if(n){
				//alert(_this.container.id + '_' + _this.nexttb);
				curr_tab = $i(_this.container.id + '_' + _this.nexttb);
			}else{
				curr_tab = _jsc.evt.gTar(e);
				if(curr_tab.id=="")curr_tab = curr_tab.parentNode;
			}
		}
		
		var tb = curr_tab.id.split("_");
		for(var i = 0; i < _this.tabs.length; i++){
			if(_this.tabs[i]==curr_tab){
				_this.tabs[i].className="hot Selected current";
				try{
					//alert(_this.tabs[i].id);
					$i(_this.tabs[i].id + '_body_1').style.display = "block";
				}catch(e){}
			}else{
				_this.tabs[i].className="";
				try{
					$i(_this.tabs[i].id + '_body_1').style.display = "none";
				}catch(e){}
			}
		}
		_this.nexttb = parseInt(tb[tb.length-1]) >= _this.tabs.length ? 1 : parseInt(tb[tb.length-1]) + 1;
	};
}



function init_imh () {
	var _ul = document.getElementsByTagName('ul');
	for (var i=0;i<_ul.length;i++) {
		if (_ul[i].getAttribute('jpe') == 'imh:hover') {
			var _lis = _ul[i].getElementsByTagName('li');
			for (var j=0;j<_lis.length;j++) {
				_lis[j].onmouseover = function(e) {
					var ev = !e ? window.event : e;
					var _target = _jsc.evt.gTar(ev);
					while (_target.tagName.toLowerCase() != 'li') {
						_target = _target.parentNode;
					}
					_target.className = 'hover';
				};
				
				_lis[j].onmouseout = function(e) {
					var ev = !e ? window.event : e;
					var _target = _jsc.evt.gTar(ev);
					while (_target.tagName.toLowerCase() != 'li') {
						_target = _target.parentNode;
					}
					_target.className = '';
				};
			}
		}
	}
	
	var _lis = document.getElementsByTagName('li');
	for (var i=0;i<_lis.length;i++) {
		if (_lis[i].getAttribute('jpe') == 'linkto:a') {
			_lis[i].onclick = function(e) {
				var ev = !e ? window.event : e;
				var _target = _jsc.evt.gTar(ev);
				while (_target.tagName.toLowerCase() != 'li') {
					_target = _target.parentNode;
				}
				location.href = _target.getElementsByTagName('a')[0].getAttribute('href');
				return false;
			};
		}
	}
}
var mm_select=function(c){
	this.c=document.getElementById(c); //整体下拉框
	this.selecttext={};  //选中后显示的内容
	this.select={};  //下拉框内容
	this.hidetimer=null;  //移出时的隐藏
	var _this=this;
	this.addonclick=null;
	this.iframe=null;

	this.returnvalue=function(){
        return this.c.getAttribute("val");
    }

	this.c.onmouseover=function(){
        var th=_this;
        if(th.hidetimer)
            window.clearTimeout(th.hidetimer);
        th.c.className="mm_select1";
    }

	this.c.onmouseout=function(){
        _this.select_none();
    }


	this.c.onmousedown=function(){
	    _this.c.className="mm_select2";
	}

	this.c.onmouseup=function(){
       var th=_this;
        if(th.hidetimer)
            window.clearTimeout(th.hidetimer);
        th.c.className="mm_select1";    
        
        th.iframe.style.top=_jsc.pos.getY(th.c)+24+"px";
        th.iframe.style.left=_jsc.pos.getX(th.c)+"px"; 
        th.iframe.style.display="block";
        
        th.select.style.top=th.iframe.style.top;
        th.select.style.left=th.iframe.style.left;
        th.select.style.display="block";
        
        if(th.iframe.style.height=="0px")
        {
            th.iframe.style.height=th.select.offsetHeight+"px";
            th.iframe.style.width=th.select.offsetWidth+"px";
        }
    }
 


	this.init=function(){
        var c=this.c;var divs=new Array();var childs=c.childNodes;
        for(var i=0;i<childs.length;i++)
        { 
            if(childs[i].tagName && childs[i].tagName.toLowerCase() =="div") divs[divs.length]=childs[i];
        }
        this.selecttext=divs[0];
        this.select=divs[1];
        this.iframe=document.createElement("iframe");
        this.iframe.style.cssText="position:absolute;display:none;filter:alpha(opacity=0);opacity:0;border-width:0;height:0px;";
        this.iframe.src="#";
        c.insertBefore(this.iframe,this.select);
        
        this.select.onclick=function(event){
            var tar =event?event.target:window.event.srcElement;
            if(tar.tagName.toLowerCase() =="a")
            {_this.c.setAttribute("val",tar.getAttribute("val"));
            _this.selecttext.innerHTML=tar.innerHTML; }
            this.style.display="none";
            _this.iframe.style.display="none";
            return false;
        }
        if(this.addonclick)
        {
            _jsc.util.addEvent(this.select,"click",this.addonclick);
        }
        this.select.onmouseover=function(){
            var th=_this;
            if(th.hidetimer)
                window.clearTimeout(th.hidetimer);
        }
        this.select.onmousedown=function(event){
            if(_jsc.client.isIE)
            {
                event=window.event;
                event.cancelBubble=true;
            }
            else
                event.stopPropagation();
        }
    }
}
var banners, super_rec, star,bargain_scroll,buy_ok_div;
var select_pr,select_pc,select_cpk;
_jsc.util.addEvent(window, 'load', function() {
		if ($i('banners')) {	
			banners = new tabswitch('banners', {});
			setInterval("banners.start(null, null, 1);", 6000);
		}
		
		if ($i('super_rec')) {	
			super_rec = new tabswitch('super_rec', {});
			setInterval("super_rec.start(null, null, 1);", 5000);
		}
		
		if ($i('star')) {	
			star = new tabswitch('star', {});
			setInterval("star.start(null, null, 1);", 6000);
		}
		
				
				
		if($i('bargain_scroll')){
		    bargain_scroll=new simpleSideScroll('bargain_scroll','bargain_scroll_ul',{start_delay:3000, speed: 23, delay:3000, scrollItemCount:1},'left')
		    bargain_scroll.setButton('bargain_scroll_left','left');
		    bargain_scroll.setButton('bargain_scroll_right','right');
		    bargain_scroll.init();
		}
		
		if($i('buy_ok_div')){
		    buy_ok_div=new simpleSideScroll('buy_ok_div','buy_ok_ul',{start_delay:3000, speed: 23, delay:3000, scrollItemCount:1},'left')
		    buy_ok_div.setButton('buy_ok_scroll_left','left');
		    buy_ok_div.setButton('buy_ok_scroll_right','right');
		    buy_ok_div.init();
		}
		
		
		if($i('category')){
		    var category_lis = $i('category').getElementsByTagName("li");
		    for(var i=0;i<category_lis.length;i++){
		        category_lis[i].onmouseover=function(){
		            this.className +=" onmouse";
		        }
		        category_lis[i].onmouseout=function(){
		            this.className = this.className.replace(" onmouse","").replace("onmouse","")
		        }
		    }
		}
		
		init_imh();
		
		if($i("select_arp")){
		    init_arp();
            select_pr=new mm_select("select_arp");select_pr.addonclick=change_city; select_pr.init();

        
            select_pc=new mm_select("select_arc"); select_pc.init();
            select_cpk=new mm_select("batch_schCPK");select_cpk.init();
        }
});



  function switchmodTag(modtag,modcontent,modk) {
    for(i=1; i <14; i++) {
      if (i==modk) {
        document.getElementById(modtag+i).className="menuOn";document.getElementById(modcontent+i).className="slidingList";}
      else {
        document.getElementById(modtag+i).className="menuNo";document.getElementById(modcontent+i).className="slidingList_none";}
    }
  }
  
  
  
  	function SwitchNewsTag(id,num,count)
	{
		ClearTagClass(id,count);
		document.getElementById("tagname_" + id + num).className = "tagf";
		document.getElementById(id + num).style.display = "";
	}
	function ClearTagClass(id,count)
	{
		for(i=1;i<=count;i++)
		{
			document.getElementById("tagname_" + id + i).className = "tagn";
			document.getElementById(id + i).style.display = "none";
		}
	}
	
window.onload=function()
{
 var o=document.getElementById('NewBoxtopr');
 window.setInterval(function(){scrollup(o,20,0);},2000);
 changeSearch();
}

var pause = false;
function scrollup(o,d,c)
{
 if(pause) {return;}
 if(d==c){
  var t=o.firstChild.cloneNode(true);
  o.removeChild(o.firstChild);
  o.appendChild(t);
  t.style.marginTop=o.firstChild.style.marginTop='0px';
 }
 else{
  var s=3,c=c+s,l=(c>=d?c-d:0);
  o.firstChild.style.marginTop=-c+l+'px';
  o.onmouseover=function(){pause=true;}
  o.onmouseout=function(){pause=false;}
  window.setTimeout(function(){scrollup(o,d,c-l)},100);
 }
}