// JavaScript Document

//左右滑动块 
$(function(){
         var dangqian = 0;
		 var kuandu= $(".sliding_main").width();
		 var page=Math.ceil(parseFloat($("#numberOfElements").val())/6);
		 var total = kuandu*page;
		 
		 if(dangqian==0){
			 $(".sliding_left").hide();
		 }
		 if(dangqian==page){
			 $(".sliding_right").hide();
		 }
		 $(".sliding_con").css({"width":total});
		 $(".sliding_blo").css({"float":"left","width":kuandu});
		 
		$(".sliding_right").click(function(){
			alert(dangqian);
			if(kuandu*(dangqian+1)<total){
				dangqian++;
				$(".sliding_con").animate({right:kuandu*dangqian});
				}
	    });
		
		$(".sliding_left").click(function(){
			if(dangqian>0){
				dangqian--;
				$(".sliding_con").animate({right:kuandu*dangqian});
				}
	    });
 /*
		 $("#sliding_right").click(function(){
				if( parseFloat($("#totalPages").val())==0 || parseFloat($("#page").val())==parseFloat($("#totalPages").val()-1)  ){
					return false;
				}
				$("#page").val(parseFloat($("#page").val())+1);
				submitPageForm();
			}); 
			
			
			$("#sliding_left").click(function(){
				if($("#page").val()=='0'){
					return false;
				}
				$("#page").val(parseFloat($("#page").val())-1);
				submitPageForm();
				});
				*/
}
);