mfImage();
function mfImage() {
	var j = document,
	p = [100, 100],
	b = "www.mobanbus.cn",                             // 域名
	o = "http://www.mobanbus.cn/caiji", // publish页面的地址
	r = function(f) {
		return j.getElementById(f)
	},
	q = function(f, g) {
		return f.getElementsByTagName(g)
	},
	s = j.documentElement.scrollTop || j.body.scrollTop;
	if (location.href.indexOf(b) > -1) {
		confirm("禁止采集本站图片");
		return false
	}
	if (r("mflay")) {
		return false
	}
	var a = j.createElement("div"),
	c = j.createElement("div"),
	d = j.createElement("a");
	c.innerHTML = '<style type="text/css">#' + (a.id = "mflay") + "{width: 100%;height: 100%;background-color:#fafafa;position: fixed;top: 0;left: 0;z-index: 9999998;_position: absolute;_height: expression(body.offsetHeight);}#" + (c.id = "mfWrap") + "{position: absolute;top:" + s + "px;left:0;z-index:9999999;}#mfWrap img{border:1px solid #d9d9d9;background-color:#fff;max-height: 200px;max-width: 200px;width: auto !important;height: auto !important;padding:0 !important;margin:0 10px 10px 0!important;}#mfWrap a:hover img{opacity:0.5;-moz-opacity:0.5;filter: alpha(opacity=50);}#" + (d.id = "mfClose") + "{position: fixed;top: 0;right: 0;z-index: 9999999;width:50px!important;height:50px!important;font-size:32px;}</style>",
	c.appendChild(d);
	d.href = "#";
	d.innerHTML = "x";
	(p = p.filter.call(j.images,
	function(f) {
		return f.width >= p[0] && f.height >= p[1] && f.src
	}))[0] ? (p.forEach(function(f) {
		c.innerHTML += '<img src="' + f.cloneNode(0).src + '">'
	}), (p = j.body).appendChild(a), p.appendChild(c)) : confirm("没找到足够大的图片");
	r("mfClose").onclick = function() {
		p.removeChild(a);
		p.removeChild(c);
		return false
	};
	d = q(r("mfWrap"), "img");
	var e, i = d.length;
	for (e = 0; e < i; e++) {
		d[e].onclick = function() {
			var g = this.src,
			f = j.title;
			g = (g.indexOf("timthumb.php") > -1) ? (g = g.match(/src=(http(s)?\:\/\/)?.*?(jpg|jpeg|bmp|png|gif)/gi)) : ("src=" + g),
			jj = (o.indexOf("?") > -1) ? "&action=new&": "/?action=new&";
			yy = o + jj + g + "&title=" + f;
			window.open(yy, null, "height=400, width=600, top=100, left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no");
			p.removeChild(a);
			p.removeChild(c)
		}
	}
};