;
(function($) {
	var h;
	$('script').each(function(a, b) {
		miuScript = $(b).get(0).src.match(/(.*)jquery\.popImage(\.mini)?\.js$/);
		if (miuScript !== null) {
			h = miuScript[1]
		}
	});
	var i = h + '../css/popImage.css';
	var j = document.createElement("link");
	j.setAttribute('type', 'text/css');
	j.setAttribute('rel', 'stylesheet');
	j.setAttribute('href', i);
	$("head")[0].appendChild(j);
	$.fn.popImage = function(f) {
		var s = $.extend({}, $.fn.popImage.defaultSettings, f || {});
		if ($("#popImage_cache").length == 0) {
			$("<div  id='popImage_cache'></div><div  class='popImage_close'></div>").appendTo("body")
		}
		var g = $("#popImage_cache  img").length;
		return this.each(function(c) {
			var d = $(this),
				iw = d.outerWidth(),
				ih = d.outerHeight(),
				imgUrl = this[s.tagName],
				c = g + c,
				this_id = "slide" + c;
			$('<img  src="' + imgUrl + '"  class="popImage_cached  ' + this_id + '"  title="click  to  close"/>').appendTo("#popImage_cache").hide();
			d.click(function(e) {
				var b = $('#popImage_cache  .' + this_id),
					w_w = $(window).width(),
					w_h = $(window).height(),
					st = $(window).scrollTop();
				$('.popImage_close').hide();
				e.preventDefault();
				position = d.offset(), o_h = b.height(), o_w = b.width();
				var t = st + (w_h - o_h) / 2,
					l = (w_w - o_w) / 2;
				b.css({
					'left': position.left,
					'top': position.top,
					'height': ih,
					'width': iw
				});
				$('.popImage_cached').hide();
				b.show().fadeTo(0, 0.9);
				b.animate({
					'left': l,
					'top': t,
					'height': o_h,
					'width': o_w,
					'opacity': 1
				}, s.timeOut, function() {
					var a = b.offset();
					$('.popImage_close').css({
						'left': a.left + o_w - 6,
						'top': a.top - 15
					}).show()
				})
			});
			$('.popImage_close,.popImage_cached').bind('click', function(a) {
				$('.popImage_close').hide();
				$('.popImage_cached').fadeOut(400);
				a.preventDefault()
			})
		})
	};
	$.fn.popImage.defaultSettings = {
		"tagName": "href",
		"timeOut": "600"
	}
})(jQuery);