var n=1;
$(window).load(function(){
		//修改.content下图片大小
		$(".content p img").each(function(i){
																		$(this).load(function(){
																				var tt=$(this);
																				w=tt.width();
																				h=tt.height();
																				if(w>670){
																					tt.width(670);
																					}
																			});
																		});	
});
$(document).ready(function() {
		var s=$(".scroll");
		s.append(s.html());
		$(".kuang").append("<div class='sd'></div>");//添加阴影
		//调整h1_1中更多的位置
		$(".h1_1 span").css("marginTop","-1px").css("color","#888");
		$(".h1_1 span:last-child").css("marginTop","5px");
		$(".h1_1 span:first-child").css("marginTop","0px");
		//添加BANEL动画
		$(".fla").load("fla2.html",function(){swfobject.registerObject("FlashID");swfobject.registerObject("FlashID2");});
		$(".b1").hover(function(){
								$(this).removeClass("b3");
								},function(){
								$(this).addClass("b3");
								});		
		//b1按钮效果
		$(".rel").prepend("<div style='height:20px; width:20px; overflow:hidden; position:absolute; right:-10px; top:-3px; background:url(../images/ico.png) no-repeat 0px 0px;'>");
		$(".rel2").prepend("<div style='height:40px; width:40px; overflow:hidden; position:absolute; left:-10px; bottom:-10px; background:url(../images/ico.png) no-repeat 0px -60px;'>");	
	
		
		sc();
});
function sc(){
	var s=$(".scroll div");
	var height=-s.height()*n+5;
	$(".scroll").delay(2000).animate({top:height},{ duration: 2000,complete:gg});
	}
function gg(){
	var w,h;
	w=Math.abs($(".scroll").position().top-n*5);
	h=Math.abs($(".scroll").height()/2);
	if (w>=h){
		n=1;
		$(".scroll").delay(2000).css("top","5px");
		}else{
			n++;
		}
	sc();
}
