$(document).ready(function(){
	$("img.home_pimg").load(function(){
		tmp_w = $(this).css("width");
		tmp_h = $(this).css("height");
		w = tmp_w.replace("px","");
		h = tmp_h.replace("px","");

		if(w*1>=h*1){
			$(this).css("width",110);
			$(this).css("height","auto");
		}else{
			$(this).css("height",110);
			$(this).css("width","auto");
		}
		$(this).wrap("<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr height=100%><td align=center height=100%></td></tr></table>");


	});
	$("img.home_pimg").error(function(){
		$(this).attr("src","assets/images/items/s_1266555225_1.jpg");
	});
});