function newWin(path,w,h,r) {
		window.open(path,"",'height='+h+',width='+w+',left='+((screen.width - w) / 2)+',top='+((screen.height - h) / 2)+',resizable='+r+',location=no,scrollbars=no,menubars=no,toolbars=no');
}
var init = function() {
	//thickbox
	//tb_init("a.thickbox");
	//tooltip
	$('.tooltip').tooltip({
			delay: 0,
			showURL: false,
			bodyHandler: function() {
				//var id = this.id.split('_')[2];
				var img = $(this).attr("src").split('thumbnails').join('');
				return $("<img/>").attr("src", img).attr("width", 320).attr("height", 256);
			}
		}
	);
  $("a.ad_popup")
	.click(function(e){
		e.preventDefault();
		newWin('/?req=ad_popup&image='+$(this).attr("href"), 320, 240, 0);
	});
}
$(document).ready(init);