/*pub-1|2012-11-26 10:07:02*/
(function(L, I, J, G) {
	var C = navigator.userAgent.toLowerCase(),
		K = Object.prototype.toString,
		B = (function() {
			var D = (!/opera/i.test(C) && C.match(/msie\s(\d+)\.\d+;/i)) || null;
			return (D && parseInt(D[1], 10)) || 0
		}());
	var H = {
		isU: function(D) {
			return D === void 0
		},
		isS: function(D) {
			return K.call(D) === "[object String]"
		},
		isN: function(D) {
			return K.call(D) === "[object Number]"
		},
		isO: function(D) {
			return !!D && K.call(D) === "[object Object]"
		},
		isF: function(D) {
			return K.call(D) === "[object Function]"
		},
		isA: function(D) {
			return K.call(D) === "[object Array]"
		},
		isE: function(D) {
			return !!(D && D.nodeType && D.nodeType === 1)
		},
		isDOM: function(D) {
			return D === J || D === L || D === I || H.isE()
		},
		isStrict: L.compatMode === "CSS1Compat",
		each: function(D, P) {
			if (!H.isA(D) || !H.isF(P)) {
				return
			}
			var O = 0,
				E = D.length;
			while (O < E) {
				P.call(null, D[O++])
			}
		},
		trim: function(D) {
			return D.replace(/^\s+/, "").replace(/\s+$/, "")
		},
		ss: function(D, E) {
			return D.replace(/{{([^}{2}]+)}}/g, function(P, O) {
				return (O && E[O]) || ""
			})
		},
		ua: {
			ie: B,
			ie6: B === 6
		},
		mix: function(O, E, P) {
			if ((!H.isO(O) && !H.isF(O)) || !H.isO(E)) {
				return
			}
			var D;
			for (D in E) { !! P ? O[D] = E[D] : (H.isU(O[D]) && (O[D] = E[D]))
			}
		}
	}, A = {
			c: function(E, D) {
				if (!H.isS(E)) {
					return
				}
				var P = L.createElement(E);
				if (H.isO(D)) {
					var O;
					for (O in D) {
						switch (O.toLowerCase()) {
							case "class":
								P.className = D[O];
								break;
							default:
								P.setAttribute(O, D[O]);
								break
						}
					}
				}
				return P
			},
			as: function(D) {
				var E = A.c("style", {
					type: "text/css"
				});
				(L.head || L.getElementsByTagName("head")[0]).appendChild(E);
				if (E.styleSheet) {
					E.styleSheet.cssText = D
				} else {
					E.appendChild(L.createTextNode(D))
				}
				return E
			},
			ac: function(O, D) {
				var E = new RegExp("\\b" + D + "\\b", "g");
				if (E.test(O.className)) {
					return
				}
				O.className = H.trim(O.className) + ( !! H.trim(O.className) ? " " + D : D)
			},
			rc: function(O, D) {
				var E = new RegExp("\\b" + D + "\\b", "g");
				O.className = O.className.replace(E, "")
			},
			vs: function() {
				return H.ua.ie ? (H.isStrict ? {
					width: I.clientWidth,
					height: I.clientHeight
				} : {
					width: L.body.clientWidth,
					height: L.body.clientHeight
				}) : {
					width: I.clientWidth,
					height: I.clientHeight
				}
			},
			ws: function() {
				return {
					width: Math.max(L.body.clientWidth, L.body.scrollWidth, I.scrollWidth, I.clientWidth),
					height: Math.max(L.body.clientHeight, L.body.scrollHeight, I.scrollHeight, I.clientHeight)
				}
			},
			st: function() {
				return J.pageYOffset || I.scrollTop || L.body.scrollTop
			}
		}, N = {
			on: function(P, E, O) {
				var E = /^(on)/.test(E) ? E.substr(2) : E;
				if (P.addEListener) {
					P.addEListener(E, function() {
						O.call(P)
					}, false)
				} else {
					if (P.attachEvent) {
						P.attachEvent("on" + E, function() {
							O.call(P)
						})
					} else {
						var D = P["on" + E];
						P["on" + E] = function() {
							if (D) {
								D.call(P)
							}
							O.call(P)
						}
					}
				}
			},
			fire: function(D, E) {
				H.each(D, function(O) {
					O.call(E)
				})
			}
		}, F = {
			mask: null,
			style: {}
		}, M = function(D) {
			var E = this;
			if (!(E instanceof M)) {
				return new M(D)
			}
			E._pop, E._close, E._iframe, E._mask, E._style, E._rendered, E._styleChanged;
			E.maskable = E.closable = true;
			E.evt = {
				close: [],
				show: []
			};
			M.pop = this;
			E._cfg(D)
		};
	M.prototype = {
		css: {
			def: [".aq_def_overlay{", "display:none;", "border:3px solid #aaa;position:{{position}};width:{{width}}px;height:{{height}}px;", "z-index:100000;", "overflow:hidden;", "}", ".aq_def_overlay_x{", "position:absolute;top:8px;right:8px;z-index:2;", "display:block;", "width:18px;height:18px;", "background:url(http://img04.taobaocdn.com/tps/i4/T1xQeMXX4lXXXXXXXX-18-72.png) no-repeat 0 0", "}", ".aq_def_overlay_x:hover{", "background-position:0 -18px", "}", ".aq_def_overlay_hd{", "height:36px;padding:0 8px;", "line-height:36px;font-size:14px;font-weight:bold;color:#404040;", "background:#CCC url(http://img04.taobaocdn.com/tps/i4/T1xQeMXX4lXXXXXXXX-18-72.png) repeat-x 0 -36px", "}"],
			durex: [".aq_durex_overlay{", "display:none;", "position:{{position}};width:{{width}}px;height:{{height}}px;", 'box-shadow: 2px 2px 3px #aaa;-moz-box-shadow:2px 2px 3px #aaa;-webkit-box-shadow:2px 2px 3px #aaa;_filter:progid:DXImageTransform.Microsoft.Shadow(color="#969696",Direction=135,Strength=3);', "background:#D4E8EF;", "border:1px solid #B2D1FF;", "z-index:100000;", "overflow:hidden;", "}", ".aq_durex_overlay_x{", "position:absolute;top:5px;right:5px;z-index:2;", "display:block;", "width:18px;height:18px;", "background:url(http://img04.taobaocdn.com/tps/i4/T1SzJ8XX8oXXXXXXXX-9-9.png) no-repeat 50% 50%", "}", ".aq_durex_overlay_x:hover{", "background-color:#C3D5DB", "}", ".aq_durex_overlay_hd{", "height:27px;padding:0 8px;", "line-height:27px;font-size:12px;font-weight:bold;color:#404040;", "background:#D4E8EF;", "}", ".aq_durex_overlay_bd{", "margin:0 2px;", "border:1px solid #DADCDD;", "background:#FFF;", "}"],
			mask: ".aq_overlay_mask{display:none;position:absolute;left:0;top:0;width:0;height:0;background:#AAA;opacity:0.5;filter:alpha(opacity=50);z-index:99999}",
			data: {
				def: {
					hdheight: 36,
					bdpadding: 0
				},
				durex: {
					hdheight: 27,
					bdpadding: 4
				}
			}
		},
		render: function(D) {
			var E = this; !! D && E._cfg(D);
			E._styleChanged ? E.destroy() : E.destroy(true);
			var O = L.createDocumentFragment();
			F.style[E.style] = E._style = F.style[E.style] || (A.as(H.ss(E.css[E.style].join("").replace(/\.(aq_)/g, "." + E.prefixCls + "$1"), {
				width: E.width,
				height: E.height,
				position: H.ua.ie6 ? "absolute" : "fixed"
			}) + E.css.mask.replace(/\.(aq_)/g, "." + E.prefixCls + "$1")));
			E._pop = A.c("div", {
				"class": E.prefixCls + "aq_" + E.style + "_overlay"
			});
			var P = E.d ? E.height - E.css.data[E.style].hdheight - E.css.data[E.style].bdpadding : E.height;
			E.url && (E._iframe = A.c("iframe", {
				src: E.url,
				width: "100%",
				height: P,
				scrolling: E.scroll,
				application: 'yes',
				frameBorder: "0",
				allowtransparency: false,
				style: "display:block;"
			}));
			E._hd = E.d && A.c("div", {
				"class": E.prefixCls + "aq_" + E.style + "_overlay_hd"
			}) || null;
			E._hd && (E._hd.innerHTML = E.title);
			E._bd = E.d && A.c("div", {
				"class": E.prefixCls + "aq_" + E.style + "_overlay_bd"
			}) || null;
			E.closable && (E._close = A.c("a", {
				href: "#nogo",
				"class": E.prefixCls + "aq_" + E.style + "_overlay_x"
			}));
			F.mask = E.maskable && (F.mask || A.c("div", {
				"class": E.prefixCls + "aq_overlay_mask"
			})) || null;
			E._mask = E.maskable && F.mask || null;
			var Q = null;
			if (H.ua.ie6) {
				Q = A.c("iframe", {
					src: "about:blank",
					width: "100%",
					height: "100%",
					frameBorder: "0",
					scrolling: "no"
				})
			}
			Q && E._mask && E._mask.appendChild(Q);
			E._mask && O.appendChild(E._mask);
			E._iframe && (E._bd ? E._bd.appendChild(E._iframe) : E._pop && E._pop.appendChild(E._iframe));
			E._hd && E._pop && E._pop.appendChild(E._hd);
			E._bd && E._pop && E._pop.appendChild(E._bd);
			E._close && E._pop && E._pop.appendChild(E._close);
			E._pop && O.appendChild(E._pop);
			L.body.appendChild(O);
			E._bind();
			E._rendered = true;
			return E
		},
		_cfg: function(D) {
			var E = this;
			E.cfg = D = D && D || {};
			E._styleChanged = E._checkStyleChanged(D);
			E.type = H.isS(D.type) && D.type.toLowerCase() || E.type || "";
			E.style = H.isS(D.style) && D.style.toLowerCase() || E.style || "def";
			E.style = E.css[E.style] && E.style || "def";
			E.d = E.type === "dialog";
			E.position = H.isO(D.position) && D.position || E.position || null;
			E.offset = H.isO(D.offset) && D.offset || E.offset || {
				x: 0,
				y: 0
			};
			E.offset.x = E.offset.x || 0;
			E.offset.y = E.offset.y || 0;
			E.title = H.isS(D.title) && D.title || E.title || "";
			E.url = H.isS(D.url) && D.url || E.url || "";
			E.redirectURL = D.redirectURL && H.isS(D.redirectURL) && D.redirectURL || E.redirectURL || "";
			E.url = E.url + (E.redirectURL ? (E.url.indexOf("?") >= 0 ? "&redirecturl=" + J.encodeURIComponent(E.redirectURL) : "?redirecturl=" + J.encodeURIComponent(E.redirectURL)) : "");
			E.width = Number(D.width) || E.width || 0;
			E.height = Number(D.height) || E.height || 0;
			E.scroll = D.scroll && "yes" || E.scroll || "no";
			E.trigger = H.isE(D.trigger) && D.trigger || E.trigger || null;
			E.triggerEvent = H.isS(D.triggerEvent) && D.triggerEvent || E.triggerEvent || "click";
			E.maskable = H.isU(D.maskable) ? E.maskable : !! D.maskable;
			E.closable = H.isU(D.closable) ? E.closable : !! D.closable;
			E.prefixCls = D.prefixCls && H.isS(D.prefixCls) && D.prefixCls || E.prefixCls || "";
			if (E.style === "durex") {
				E.width = 325;
				E.height = 273;
				E.type = "dialog";
				E.d = true
			}
			H.mix(M, D.method, true)
		},
		_bind: function() {
			var D = this;
			N.on(J, "resize", function() {
				D.fixed()
			});
			N.on(J, "scroll", function() {
				D.fixed()
			});
			D.closable && D._close && (N.on(D._close, "click", function() {
				D.hide();
				N.fire(D.evt.close, D)
			}));
			D.trigger && D.triggerEvent && N.on(D.trigger, D.triggerEvent, function() {
				!D._rendered && D.render().show() || D.show()
			});
			return D
		},
		_checkStyleChanged: function(D) {
			var E = this,
				D = D || {};
			return (H.isU(D.width) && D.width !== E.width) || (H.isU(D.height) && D.height !== E.height) || (H.isU(D.type) && D.type !== E.type)
		},
		fixed: function() {
			var E = this;
			var P = A.vs(),
				D = A.ws();
			var O = (P.height - E.height) / 2;
			if (E._pop) {
				if (E.position) {
					if (H.isN(E.position.x)) {
						E._pop.style.left = E.position.x + E.offset.x + "px"
					} else {
						E._pop.style.left = (P.width - E.width) / 2 + E.offset.x + "px"
					} if (H.isN(E.position.y)) {
						E._pop.style.top = E.position.y + E.offset.y + "px"
					} else {
						E._pop.style.top = O + E.offset.y + "px";
						H.ua.ie6 && (E._pop.style.top = A.st() + O + E.offset.y + "px")
					}
				} else {
					E._pop.style.left = (P.width - E.width) / 2 + E.offset.x + "px";
					E._pop.style.top = O + E.offset.y + "px";
					H.ua.ie6 && (E._pop.style.top = A.st() + O + E.offset.y + "px")
				}
			}
			if (E._mask) {
				E._mask.style.width = D.width + "px";
				E._mask.style.height = D.height + "px"
			}
			return E
		},
		show: function(E) {
			var D = this;
			if (H.isS(E)) {
				D._iframe && (D._iframe.src = E) || (D._iframe = A.c("iframe", {
					src: E,
					width: "100%",
					height: D.d ? D.height - D.css.data[D.style].hdheight - D.css.data[D.style].bdpadding : D.height,
					scrolling: D.scroll,
					frameBorder: "0",
					allowtransparency: false
				})) && D._pop && D._pop.appendChild(D._iframe)
			}
			D.fixed();
			D._pop && (D._pop.style.display = "block");
			//D._mask && (D._mask.style.display = "block");
			N.fire(D.evt.show, D);
			return D
		},
		hide: function() {
			var D = this;
			D._pop && (D._pop.style.display = "none");
			D._mask && (D._mask.style.display = "none");
			return D
		},
		destroy: function(D) {
			var E = this;
			E._pop && E._pop.parentNode.removeChild(E._pop);
			E._close && E._close.parentNode.removeChild(E._close);
			if (!D) {
				E._mask && E._mask.parentNode.removeChild(E._mask);
				E._style && E._style.parentNode.removeChild(E._style);
				F.mask = F.style[E.style] = E._mask = E._style = null
			}
			E._rendered = false;
			return E
		},
		on: function(D, O) {
			if (!H.isS(D) || !H.isF(O)) {
				return this
			}
			var E = this,
				D = D.toLowerCase();
			E.evt[D] && E.evt[D].push(O);
			return E
		}
	};
	M.pop = null;
	H.mix(M, {
		addMethod: function(E, O) {
			if ((!H.isU(O) && !H.isF(O)) || (H.isF(O) && !H.isS(E))) {
				return
			}
			var D = {};
			if (H.isO(E)) {
				D = E
			} else {
				if (H.isS(E) && H.isF(O)) {
					D[E] = O
				}
			}
			H.mix(M, D, true);
			return M
		},
		success: function() {
			M.pop && M.pop.hide && M.pop.hide()
		},
		cancel: function() {
			M.pop && M.pop.hide && M.pop.hide()
		},
		close: function() {
			M.pop && M.pop.hide && M.pop.hide();
			M.pop && M.pop.evt && N.fire(M.pop.evt.close, M.pop)
		}
	});
	J.AQPop = M
}(document, document.documentElement, window));

var durexPop = AQPop({
	url: "", //加载的iframe地址，先不填，等用的时候再渲染
	width: 320, //推荐使用320x280的长宽，跟上图一致
	height: 280,
	title: '', //验证框左上角的标题名
	type: 'dialog',
	style: 'def' //弹出框的样式，有大量的弹框风格供选择
});


//注册X函数
durexPop.on('close', function() //这个方法是控制右上角弹窗的X按钮
	{
		durexPop.hide();
	});

//注册属性方法，后边验证成功会用到这个的
AQPop.addMethod({
	'success': function() //这个方法是控制验证成功后的逻辑，即点击【确定】后
	{
		durexPop.hide();
		auther('true'); //你可执行你的业务逻辑，例如提交表单
	},
	'cancel': function() //这个方法是控制点击取消执行的逻辑，即点击【取消】后
	{
		durexPop.hide();
	}
});

function secondVerifyRender(url) {

	durexPop.render({
		title: '二次验证',
		width: 320,
		height: 280,
		url: url
	}).show();
}