window.onload=function(){
//调整图片大小
$("#list img").each(function(i){
	var w=this.width;
	var h=this.height;
	if(w/h>=1.66){
		this.height="150";
		var l=150/h*w;
		l=-(l-250)/2;
		this.style.left=l+"px";
	}else{
		this.width="250";
		this.style.left=0;
	}
});
}

/*
//随机事件
function gather(url){
  $.ajax({
    url:"gather/"+url,
    cache:false,
    success:function(html){
      $("#tips").html(url).fadeIn();
    }
  });
  setTimeout(function(){$("#tips").fadeOut();},10000);
}
function showtips(tips){
  $("#tips").html(tips).fadeIn();
  setTimeout(function(){$("#tips").fadeOut();},10000);
}

//onload
$(function(){

//随机事件
var randID=parseInt(Math.random()*10+1);
switch(randID){
  case 1:
  setTimeout(function(){gather("cssmania.com.asp");},2000);
  break;
  case 2:
  setTimeout(function(){gather("wpinspiration.com.asp");},2000);
  break;
  case 3:
  setTimeout(function(){gather("bestwebgallery.com.asp");},2000);
  break;
  case 4:
  setTimeout(function(){gather("cssincolor.com");},2000);
  break;
  default:
  setTimeout(function(){showtips("Welcome.");},2000);
}

//浏览计数
$("#list a").click(function(){
	alert($(this).text());
});

});

*/