window.onload = function(){

	$.getScript("http://88.gaosu.com/script/tooltip.js");


	var $img = new Image();
	var $picture,$src;
	var $width,$height;
	var $a;
	
	$(".preview").each(function(i){
		$a = $(this).children("a");
		$picture = $a.children("img");
		$src = $picture.attr("src");
		
		$img.src = $src;
		$width = $img.width;
		$height = $img.height;
		
		var $resize = 1;
	
		if(($width / 95) > 1)
		{
			$resize = ($width / 95)
			$width = parseInt($width / $resize)
			$height = parseInt($height / $resize)
		}
		if(($height / 95) > 1)
		{
			$resize = ($height / 95)
			$width = parseInt($width / $resize)
			$height = parseInt($height / $resize)
		}
	
		if (($width != $img.width) || ($height != $img.height)) {$picture.addClass("qq");};	

		if ($width > 0) {
		
			$picture.attr("width",$width);
			
			if ($width < 95) {
				$picture.css("left",parseInt((95 - $width) / 2));
			}
		
		};
		if ($height > 0) {
		
			$picture.attr("height",$height);
			
			if ($height < 95) {
				$picture.css("bottom",parseInt((95 - $height) / 2));
			}
		} 

	});

	$(".festival tr:nth-child(even)").css("background-color","#FAFAFA");
	$(".festival tr:nth-child(odd)").css("background-color","#FFFFFF");

	$.getScript("http://88.gaosu.com/script/special.js");
	$.getScript("http://88.gaosu.com/script/qq.js");

};
