var currentIndex=0;
	var liCount,pageSize,sizeCount,width;
	function goLeft(){
		if(currentIndex+1<3 && liCount>4){
			$("#rightBt").bind("mouseover",function(){
				$("#rightBt").addClass("i_case_right_over");
			})
		
			currentIndex=currentIndex+1
			liCount=document.getElementById("items").getElementsByTagName("li").length;
			pageSize=currentIndex*4
			if(pageSize+4<=liCount)
				width=pageSize*229;
			else
				width=(pageSize*229)-((pageSize+4-liCount)*229);
				
			if(currentIndex<3){
				$(".i_case_list").animate({
					"margin-left":"-"+width
					}, 
					2000,
					function(){
						if(currentIndex==2){
							$("#leftBt").bind("mouseover",function(){
								$("#leftBt").removeClass("i_case_left_over");
							})
						}
					}
				)
			}
		}
	}
	
	function goRight(){
		if(currentIndex>0){
			$("#leftBt").bind("mouseover",function(){
				$("#leftBt").addClass("i_case_left_over");
			})
			
			currentIndex=currentIndex-1
			liCount=document.getElementById("items").getElementsByTagName("li").length;
			sizeCount=liCount*229-916;
			pageSize=currentIndex*4
			if(currentIndex==0){
				width=0;
			}else{
				width="-"+(sizeCount- pageSize*229);
			}
			
			if(currentIndex<3){
				$(".i_case_list").animate({
					"margin-left":width
					}, 
					2000,
					function(){
						if(currentIndex<=0){
							$("#rightBt").bind("mouseover",function(){
								$("#rightBt").removeClass("i_case_right_over");
							})
						}
					}
				)
			}
		}
	}
	
	function page_load(){
	    liCount=document.getElementById("items").getElementsByTagName("li").length;
	    if(liCount>4) {
		    $("#leftBt").bind("mouseover",function(){
			    $("#leftBt").addClass("i_case_left_over");
		    })
		    $("#leftBt").bind("mouseout",function(){
			    $("#leftBt").removeClass("i_case_left_over");
		    })
    		
		    $("#rightBt").bind("mouseout",function(){
			    $("#rightBt").removeClass("i_case_right_over");
		    })
		}
	}
