$(document).ready(function(){	
	$(".span-12 img").each(function(){
		$(this).bind("load",function(){
			if($(this).width()>450){$(this).width(450);}
		});
		if($(this).width()>450){$(this).width(450);}
	});

//====
	$("a").bind("focus",function(){
		$(this).blur();
	});
//==
	
	
    var moveStep=1;
    //滚动初始值
    var step=0;
    //是否需要滚动
    var canScroll=true;
    var $scroll=$("#scroll");
    //滚动框高度
    var containerHeight=$("#scroll").height();
    var actualHeight=0;
    var $li=$("#scroll >ul:first >li");
    var totalItems=$li.length;    
    var itemHeight=$li.eq(0).height();
    //滚动内容总高
    var actualHeight=totalItems*itemHeight;
    //内容框高度和滚动框高度的差值，用于重定位滚动内容
    var diff=actualHeight-containerHeight;
    //不需要滚动
    if(diff<=0){
        canScroll=false;
    }
    function scroll(){
        if(step>actualHeight){
            step=1;    
        }
        step+=moveStep;    
        if(step<=0){
            step=actualHeight;
        }    
        $scroll.scrollTop(step);//jQuery1.2以上才支持scrollTop方法
    }
    var interval;
    if(canScroll){
        $("#scroll >ul:first").clone().appendTo("#scroll");
        interval=setInterval(scroll,50);
    }
    $scroll.hover(function(){
        clearInterval(interval);
    },function(){
        interval=setInterval(scroll,50);
    });
    $("#up").mousedown(function(){
        moveStep=5;        
    }).mouseup(function(){
        moveStep=1;
    });
    
    $("#down").mousedown(function(){
        moveStep=-5;
    }).mouseup(function(){
        moveStep=1;
    });

	
	
});