// JavaScript Document
Club.plugin = {
	FastTrack: function(){
		this.ly = 0;
		this.rc = 0;
		this[0].style.top = -40;
		
		for(this.i=0; this.i < Club("#RightSuspend h1").len(); this.i++){
			Club("#RightSuspend h1").get(this.i).i=this.i;
			Club("#RightSuspend h1").get(this.i).innerHTML=Club("#RightSuspend h1").get(this.i).innerHTML+"("+Club("#RightSuspend  .c_list:div").get(this.i).getElementsByTagName("li").length+")";
			
			for(this.l=0; this.l < Club("#RightSuspend  .c_list:div").get(this.i).getElementsByTagName("li").length; this.l++){
				if(Club("#RightSuspend  .c_list:div").get(this.i).getElementsByTagName("li").length > 3 && this.l>2) Club("#RightSuspend  .c_list:div").get(this.i).getElementsByTagName("li")[this.l].style.display="none";
			}
			
			Club("#RightSuspend h1").get(this.i).onclick = function(){
				for(this.j=0; this.j < 3; this.j++){
					Club("#RightSuspend .c_list:div").get(this.j).style.display="none";
				}
				Club("#RightSuspend .c_list:div").get(this.i).style.display="block";
			}
			Club("#RightSuspend h2").get(this.i).val=this.i;
			Club("#RightSuspend h2").get(this.i).jl=2;
			Club("#RightSuspend h2").get(this.i).onclick=function(){
				for(this.ls=0; this.ls < Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li").length; this.ls++){
					Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li")[this.ls].style.display="none";
				}
				for(this.ls=this.jl; this.ls < this.jl+3; this.ls++){
					try{
					Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li")[this.ls].style.display="block";
					}catch(e){}
				}
				if(Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li").length-1>=this.jl){
					this.jl= this.jl+3>Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li").length-1?Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li").length-1:this.jl+3;
					Club("#RightSuspend h3").get(this.val).jl=this.jl-3<0?0:this.jl-3;
				}
			}
			Club("#RightSuspend h3").get(this.i).val=this.i;
			Club("#RightSuspend h3").get(this.i).jl=0;
			Club("#RightSuspend h3").get(this.i).onclick=function(){
				for(this.ls=0; this.ls < Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li").length; this.ls++){
					Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li")[this.ls].style.display="none";
				}
				for(this.ls=this.jl; this.ls < this.jl+3; this.ls++){
					try{
					Club("#RightSuspend  .c_list:div").get(this.val).getElementsByTagName("li")[this.ls].style.display="block";
					}catch(e){}
				}
				if(this.jl>0){
					this.jl= this.jl-3<0?0:this.jl-3;
					Club("#RightSuspend h2").get(this.val).jl=this.jl+3;
				}
			}
		}
		
		this.finit = function(){
			if(document.documentElement.scrollTop > document.body.scrollTop)
				this.diffY = document.documentElement.scrollTop;
			else
				this.diffY = document.body.scrollTop;
				
			this.percent = 0.1*(this.diffY-this.ly); 
			if(this.percent > 0) this.percent = Math.ceil(this.percent); 
			if(this.percent < 0) this.percent = Math.floor(this.percent);
			this.rc = this.rc + this.percent;
			if(this.rc > 100)
				this[0].style.top = parseInt(this[0].style.top) + this.percent + "px";
			else
				this[0].style.top = -40;
			
			this.ly += this.percent; 	
		}
		this.fnUnLock = this.bind(this, this.finit);
		this.timerLock = setInterval(this.fnUnLock,10);
	},
	FInfoCategor: function(){
		this.ly = 0;
		this.rc = 0;
		this[0].style.top = -40;
		
		var h1 = Club("#InfoCategor h1"), ul = Club("#InfoCategor ul");
		
		ul.get(0).style.display = "block";
		
		for(var i=0; i < h1.len(); i++){
			h1.get(i).i = i;
			h1.get(i).onmousemove = function(){
				for(var z=0; z < h1.len(); z++){
					ul.get(z).style.display = "none";
				}
				ul.get(this.i).style.display = "block";
			};
		}
		
		this.finit = function(){
			if(document.documentElement.scrollTop > document.body.scrollTop)
				this.diffY = document.documentElement.scrollTop;
			else
				this.diffY = document.body.scrollTop;
				
			this.percent = 0.1*(this.diffY-this.ly); 
			if(this.percent > 0) this.percent = Math.ceil(this.percent); 
			if(this.percent < 0) this.percent = Math.floor(this.percent);
			this.rc = this.rc + this.percent;
			if(this.rc > 100)
				this[0].style.top = parseInt(this[0].style.top) + this.percent + "px";
			else
				this[0].style.top = -40;
			
			this.ly += this.percent; 	
		}
		this.fnUnLock = this.bind(this, this.finit);
		this.timerLock = setInterval(this.fnUnLock,10);
	}
};

Club.fn.extend(Club.plugin);
