jQuery.fn.phg = function(settings){
	var selects = jQuery(this);
	
	var options = jQuery.extend({
		prefix_small: "trumb_",
		prefix_normal: "image_"
	}, settings);
	
	selects.each(function(i){
		var ths = jQuery(this);
		ths.children(".phg-misc").children("a").each(function(){
			jQuery(this).click(function(){
				var src = jQuery(this).children("img").attr("src");
				if(src.replace(options.prefix_small,options.prefix_normal)!=ths.children(".phg-main").children("img").attr("src")){
					ths
						.children(".phg-main")
						.children("img")
						.fadeOut(250,function(){
							jQuery(this)
								.one("load",function(){
									var h = parseInt(jQuery(this).height());
									var hh = parseInt(ths.children(".phg-main").height());
									jQuery(this)
										.css("margin-top",((hh-h)/2)+"px")
										.fadeIn(250)
								})
								.attr("src",src.replace(options.prefix_small,options.prefix_normal));
						});
				}
				return false;
			});
		});
	});
	
	return this;
}




