﻿


jQuery(function(){
	jQuery("img").each(function(i){
		var p = jQuery(this);
		var strbp = p.attr("smartsbigpic");
		if(strbp)
		{
			var bp = jQuery("<div class='bigpic'></div>").appendTo("body").hide();
			var w = this.width;
			p.mouseover(function(){
				bp.fadeIn();
				var offset = p.offset();
				
				px = offset.left+w+5;
				py = offset.top-10;
				
				if (px+300>document.body.clientWidth){px=px-w-20-300;}
				if (py+300>document.body.clientHeight){py=py-145;}

				bp.css("top", py);
				bp.css("left", px);

				if(bp.html()=="")
				{
					bp.html("<img src='"+p.attr("smartsbigpic")+"'>");
				}
			}).mouseout(function(){
				bp.fadeOut();
			});
		}
	});
});
