jQuery.fn.initWhatsHot = function(){
	return this.each(function(){
		//make this object
			var selfWhatsHot = jQuery(this);
		//callback function
			callback = function(){
				selfWhatsHot.initWhatsHot();
			}
		//count child divs... and remove if limit is reached
			var divnum = 0;
			selfWhatsHot.find(".whatsHotData").each(function(){
				divnum = divnum+1;
			});
			if(divnum>5){
				selfWhatsHot.find(".whatsHotData:last").remove();
			}
		
		jQuery.post("/whatsHotData.asp", function(data){
			if (data != null && data != false && data != ""){
				selfWhatsHot.prepend("<div class='whatsHotData'></div>");
				selfWhatsHot.find(".whatsHotData:first").html(data);
				selfWhatsHot.find(".whatsHotData:first").slideDown(500, function(){
					selfWhatsHot.find("a.thumb img").each(function(){
						imgH = jQuery(this).height();
						parentH = jQuery(this).parent().height();
						
						if(imgH < parentH){
							bottomSpace = parentH - imgH;
							jQuery(this).animate({
								top: bottomSpace / 2
							});
						}else{
							overSpace = imgH - parentH;
							jQuery(this).animate({
								
								top: -(overSpace / 2)
							});
						}
					});
				});
				setTimeout("callback()", 4000);
			}else{
			setTimeout("callback()", 4000);
			}//end if
		});
	});
}
