eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$.34({E:{N:{1D:o(){7 17=33.35();17=17.1B().36(2,17.1B().T);Y 17},29:o(K){7 f=K.37==32?1G:1H;v(!f){Y{w:20,h:15}}1n{7 1T=31 2X(\'<[/]?[a-2W-2Y-9"\\\'= :/.()%\\d;]+[/]?>\',\'1P\');K=K.1R(/<1F>|<1F \\/>|<1F\\/>/1P,\'+++\');K=K.1R(1T,\'\');7 1a=K.30(\'+++\');7 l=0;2l(7 i=0;i<1a.T;i++){l=1a[i].T>l?1a[i].T:l}Y{w:l,h:1a.T}}}},23:o(){7 t=\'<n r="1g">\';t+=\'<1o r="2a" P="38:39"></1o>\';t+=\'<n r="1U"><q I="3i"></q><q I="3h"></q><q I="3j"></q><q I="3k"></q></n>\';t+=\'<n r="2c">\';t+=\'<a r="2d" 26="3l:3g(0)" C="关闭" 1A=$.E.1e()>X</a>\';t+=\'<2b r="1l"></2b>\';t+=\'</n>\';t+=\'</n>\';$(\'U\').M(t);4.m={G:$(\'#1g\'),2g:$(\'#2a\'),2f:$(\'#1U\'),11:$(\'#2c\'),1h:$(\'#1l\'),1e:$(\'#2d\')}},d:{},1w:o(){7 R=$(A).j();7 S=$(A).g();4.d.3.j=4.d.3.j>R?R:4.d.3.j;4.d.3.g=4.d.3.g>S?S:4.d.3.g;4.m.G.z({g:4.d.3.g,j:4.d.3.j});4.m.2g.z({g:4.d.3.g,j:4.d.3.j});4.m.2f.z({g:4.d.3.g,j:4.d.3.j});4.m.11.z({g:4.d.3.g-16,j:4.d.3.j-16,3c:\'3d\',2e:\'3e 3m #2O\'});$(\'#\'+4.d.3.f+\'Q\').z({2e:0,g:4.d.3.g-16,j:4.d.3.j-46})},V:o(){7 R=$(A).j();7 S=$(A).g();7 1p=$(A.U).1p();7 1i=$(A.U).1i();7 H=(R-4.d.3.j)/2+1p;7 O=(S-4.d.3.g)/2+1i;7 1X=(R-4.d.3.j)/2;7 24=(S-4.d.3.g)/2;v(A.2D.2C.2I("2B 6.0")>-1){4.m.G.z({H:H,O:O})}1n{4.m.G.z({2z:\'2H\',H:1X,O:24})}},1v:o(3){v(!B.1f(\'1g\')){4.23()};v(3.1z){4.m.11.M(\'<n r="\'+3.f+\'" L="1c:W"><1o r="\'+3.f+\'Q" P="\'+3.1z+\'" L="1c:W" 2T="1M"></1o></n>\');$(\'#\'+3.f).2K(\'<p r="\'+3.f+\'22" L="1Q:#2M; 1N:2N; 2Q-10:2p; 2L:#2P; 2S-2A:2v;"><2G P="/1Z/1V/3n.2E" g="20" I="3a" />&3y;您请求的页面正在加载,请稍候...</p>\');7 1d=B.1f(3.f+\'Q\');7 3S=B.27?1d:1d.3T;1d[B.27?"3U":"3V"]=o(){$(1d).1b();$(\'#\'+3.f+\'22\').J()}};v(3.1j){4.m.11.M(\'<n r="\'+3.f+\'" L="1c:W"><n r="\'+3.f+\'Q">\'+3.1j+\'</n></n>\')};v(3.m){4.m.11.M(\'<n r="\'+3.f+\'" L="1c:W"></n>\');$(\'#\'+3.f).M(3.m);3.m.1E(\'r\',3.f+\'Q\')}},1b:o(3){4.d.3=3;4.d.3.f=4.d.3.f==u?\'2h\'+4.N.1D():4.d.3.f;4.d.3.12=4.d.3.12==u?1G:1H;B.1f(3.f)?1x:4.1v(4.d.3);4.1w();4.V();$(\'#\'+4.d.3.f).1b();4.m.G.J().1b();$(\'#\'+4.d.3.f).2k(\'n\').J();7 C=3.C==u?\'\':3.C;4.m.1h.t(C);A.2j=o(){$.E.V()};4.m.G.12(\'#1l\');v(4.d.3.12){4.m.1h.z({3M:\'3N\'});4.m.G.12(\'#1l\')}},3W:o(3){7 1s=3.1j;7 P=3.P==u?\'/1Z/1V/43.45\':3.P;7 1r=3.2r==u?1H:1G;7 D=3.D==u?1x:3.D;7 C=3.C==u?\'友情提示：\':3.C;D=D==\'1W\'?\'H.25.1W()\':D;7 1k=$.1Y(\'1k\')==1x?\'41.3P?3K=3u\':$.1Y(\'1k\');D=D==\'3s\'?(\'H.25.26 = \'+1k+\'\'):D;7 s=4.N.29(1s);7 f=\'2h\'+4.N.1D().1B();4.d.3={g:s.w*14+20+3H,j:s.h*28+2m+3F,f:f,C:C,1j:1s};4.d.3.g=4.d.3.g>2i?4.d.3.g:2i;4.d.3.j=4.d.3.j>1J?4.d.3.j:1J;4.1v(4.d.3);4.1w();4.V();4.m.1h.t(4.d.3.C);4.m.1e.J();4.m.G.J().2n(1L);$(\'#\'+4.d.3.f).1b();$(\'#\'+4.d.3.f+\'Q\').z({g:4.d.3.g-1L,j:4.d.3.j-3z,1Q:\'1z(\'+P+\') 1M-3w 3L 3v\',1N:\'1O 1O 21 21\',2F:\'1.8\',3Z:\'2v\'});4.N.1t=o(){$.E.1e();3x(D);v(1r)(1K($.E.d.1C))};$(\'#\'+4.d.3.f+\'Q\').M(\'<n I="3q c" L="3G:3I 0 0 -3J;"><3E 3D="3C" I="3B" 3A=" 关闭 " 1A="$.E.N.1t ()" /></n>\');$(\'#\'+4.d.3.f).2k(\'n\').J();A.2j=o(){$.E.V()};A.3r=o(){$.E.V()};v(1r){4.d.1C=3p(\'$.E.N.1t ()\',3.2r)}},1e:o(){v(2q.B.1f(\'1g\')){2q.B.1f(\'1g\').L.1c=\'W\'}1n{4.m.G.J()}}}});$.3o.F=o(3){3=3||{};3.1m=3.1m==u?0:3.1m;3.10=3.10==u?\'O\':3.10;3.1q=3.1q==u?0:3.1q;3.19=3.19==u?5:3.19;3.13=3.13==u?5:3.13;v(3t $(\'#F\').1u(0)==\'u\'){$(\'U\').M(\'<n r="F"><b r="3Y"></b><b r="40"></b><b r="44"></b><b r="42"></b><n r="2t"></n></n>\')};7 18=o(e){e=e||A.3O;7 x=e.2w?(B.2x.1i+e.2w-B.U.3Q):e.3R;7 y=e.2u?(B.2x.1p+e.2u-B.U.2J):e.2U;Y{\'x\':x,\'y\':y}};7 1I=o(){7 l=0;v(3.10===\'2p\'){l=$(\'#F\').g()/2}Y l};$(4).2V(o(){7 Z=$(4);v(3.t==u&&Z.1E(\'2o\')==u){3.t=\'<2s I="3b">暂无帮助信息。</2s>\'}1n{3.t=3.t==u?Z.1E(\'2o\'):3.t}4.3f=o(e){$(\'#F\').z({O:18(e).x+3.19-1I(),H:18(e).y-$(\'#F\').2y()-3.13}).2n(2m);$(\'#2t\').t(3.t);v(3.1m){Z.1u(0).2Z=o(e){$(\'#F\').z({O:18(e).x+3.19-1I(),H:18(e).y-$(\'#F\').2y()-3.13})}}};o 1S(){1K(3.1C);$(\'#F\').J(0)}7 1y=[\'2R\',\'1A\',\'3X\'];2l(7 k=0;k<1y.T;k++){Z.1u(0)[1y[k]]=1S}})};',62,255,'|||opt|this|||var||||||||flag|width|||height|||el|div|function|||id||html|undefined|if||||css|window|document|title|func|popup|show_info|box|top|class|hide|stri|style|append|method|left|src|_d|winH|winW|length|body|setpos|none||return|_this|align|dbox|drag|offsetY||||num|m_pos|offsetX|strArr|show|display|pop_iframe|close|getElementById|pop_box|dtit|scrollLeft|word|backurl|pop_dTitle|pos|else|iframe|scrollTop|delay|auto|str|callBack|get|init|resize|null|ev|url|onclick|toString|timer|rand|attr|br|true|false|g_pos|200|clearTimeout|100|no|padding|20px|ig|background|replace|s_hide|re|pop_shadow2|ico|reload|mid|cookie|image||60px|_loading|create|cent|location|href|all||gWH|pop_shadow1|h3|pop_dBox|pop_dclose|border|bg2|bg1|flag_|300|onscroll|siblings|for|50|fadeIn|info|center|parent|time|span|show_info_box|clientY|14px|clientX|documentElement|outerHeight|position|size|MSIE|userAgent|navigator|gif|lineHeight|img|fixed|indexOf|clientTop|prepend|color|f0f0f0|1em|ccc|888|text|onmouseout|font|frameborder|pageY|each|zA|RegExp|Z0|onmousemove|split|new|String|Math|extend|random|substr|constructor|about|blank|middle|red|overflow|hidden|1px|onmouseover|void|a_2|a_1|a_3|a_4|javascript|solid|loading|fn|setTimeout|clear|onresize|back|typeof|control_home_index|18px|repeat|eval|nbsp|90|value|commBtn|button|type|input|60|margin|80|15px|25px|do|13px|cursor|move|event|php|clientLeft|pageX|doc|contentWindow|onreadystatechange|onload|alert|onfocus|lt|fontSize|lb|index|rb|alert2|rt|jpg|'.split('|'),0,{}))

/* drag */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$.M.j=4(s){8(a.K()>1){l a.O(4(i,o){$(o).j(s)})};N t=a,h=s?t.H(s):t,m={},n=D,d=4(v){v.E();m={f:v.c,r:v.q,x:t.3("5")=="z"?t.5().7:A(t.3("7")),y:t.3("5")=="z"?t.5().9:A(t.3("9")),G:t.F(0).I.p,w:t.p()};8(t.3("5")=="L")n={"7":m.x,"9":m.y};$(2).g(b).u(e);8(2.6.k){2.6.k()}},b=4(v){t.3({"7":v.c-m.f+m.x,"9":v.q-m.r+m.y})},e=4(v){8(2.6.B){2.6.B()};$(2).C("g").C("u")};h.J(d);l t};',51,51,'||document|css|function|position|body|left|if|top|this||clientX|||ex|mousemove|||drag|setCapture|return||to||width|clientY|ey|||mouseup|||||absolute|parseInt|releaseCapture|unbind|false|stopPropagation|get|fw|find|style|mousedown|size|static|fn|var|each'.split('|'),0,{}))

/* new sliderScroll */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('$.1W.1X=8(b,p){7 1j={17:\'e\',13:1Y};p=p||1j;7 d={};d.q=p.17==\'q\'?1r:1l;d.e=p.17==\'e\'?1r:1l;7 R=C;7 W=16.1T().1U();7 c=W.1V(2,W.s-2);7 1s=\'<t G="1a\'+c+\'"><1b G="1e\'+c+\'"></1b><r G="1g\'+c+\'"></r><t G="1f\'+c+\'"></t><t G="19\'+c+\'"></t></t>\';7 n=B=12=\'\';7 w=R.k(),h=R.m();R.N(1s);7 1p=$(\'#1a\'+c);7 g=$(\'#1e\'+c);7 y=$(\'#1g\'+c);7 E=$(\'#1f\'+c);7 1o=$(\'#19\'+c);1p.f({k:w,m:h,z:\'1L\',1M:\'1Q\'});g.f({k:d.q?w:b.s*w,m:d.q?b.s*h:h,z:\'L\'});y.f({z:\'L\',1R:\'0\',M:\'1S\'});E.f({z:\'L\',M:\'0\',u:\'#P\',k:\'X%\',1m:5,1N:\'1h\'});1o.f({z:\'L\',M:\'0\',O:\'#1P\',l:\'.3\',I:\'H(l=2i)\',u:\'#P\',k:\'X%\',m:20,1m:4});7 1i=d.e?\'2j:e\':\'\';2q(7 i=0;i<b.s;i++){n+=\'<18 Z="k:\'+w+\'1k; m:\'+h+\'1k;\'+1i+\';K:1q">\';n+=\'<a 1G="\'+b[i].1H+\'" v="\'+b[i].v+\'" 1I="1F">\';n+=\'<2n 1n="\'+b[i].1n+\'" 2p="\'+b[i].v+\'" k="\'+w+\'" m="\'+h+\'" />\';n+=\'</a>\';n+=\'</18>\';B+=\'<r Z="K:1q-1E; 2a:1; k:Y; m:Y; 26-m:28; 11-1d:1h; 2f:2g 2h #2d; O:#1v; u:#1u; 2e:0 2c 0 0; 2l-2k:Y; l:.6; I:H(l=27);2r-1d:M; 1K:22">\';B+=i+1;B+=\'</r>\';12+=\'<a Z="u:#P;11-25:1c;\'+(i===0?\'K:1c;"\':\'K:1E;\')+\'" 1G="\'+b[i].1H+\'" v="\'+b[i].v+\'" 1I="1F">\'+b[i].v+\'</a>\'};g.N(n);y.N(B);E.N(12);8 x(S){A(d.e){g.1w({e:S},1x)}U{g.1w({q:S},1x)}}8 j(15){y.D(\'r\').1C(15).f({O:\'#2b\',1t:\'29\',u:\'#P\',l:\'1\',I:\'H(l=X)\',1y:\'2o\'}).1D().f({O:\'#1v\',1t:\'2m\',u:\'#1u\',l:\'.5\',I:\'H(l=1O)\',1y:\'1J\'});E.D(\'a\').1C(15).21().1D().1Z()};7 Q,9=0;8 F(){j(9);A(d.q){Q=1B(8(){A(16.1z(10(g.f(\'q\')))<h*(b.s-1)){j(9+1);x(-h*(9+1));9+=1}U{9=0;j(9);x(0)}},p.13)};A(d.e){j(9);Q=1B(8(){A(16.1z(10(g.f(\'e\')))<w*(b.s-1)){j(9+1);x(-w*(9+1));9+=1}U{9=0;j(0);x(0)}},p.13)}}8 J(){24(Q)}(8(){F();y.D(\'r\').V(8(){$(C).T(8(){g.23();J();7 1A=10($(C).11());9=1A-1;j(9);7 o=d.e?w:h;x(-o*(9))}).14(8(){F()})});g.D(\'18\').V(8(){$(C).T(8(){J()}).14(8(){F()})});E.D(\'a\').V(8(){$(C).T(8(){J()}).14(8(){F()})})})()};',62,152,'|||||||var|function|c_num||data|rnd|argSet|left|css|_ul|||signCurr|width|opacity|height|frame_inner||opt|top|span|length|div|color|title||scroll|_num|position|if|frame_serial|this|find|_title|start|id|alpha|filter|stp|display|absolute|bottom|append|background|fff|timer|_this|tPos|mouseover|else|each|temRnd|100|12px|style|parseInt|text|frame_title|time|mouseout|num|Math|driect|li|title_bg|box_|ul|none|align|ul_|title_|num_|center|styleLi|option|px|false|zIndex|src|_titleBg|_box|inline|true|frame|padding|333|ffcda4|animate|500|fontWeight|abs|curN|setInterval|eq|siblings|block|_blank|href|url|target|200|cursor|relative|overflow|textAlign|50|000|hidden|right|20px|random|toString|substr|fn|slideScroll|3000|hide||show|pointer|stop|clearTimeout|decoration|line|60|14px|4px|zoom|f7994d|10px|ff6600|margin|border|1px|solid|30|float|size|font|2px|img|800|alt|for|vertiacl'.split('|'),0,{}))
/* plug_part2 */

/* old plug */
$.extend({
	pop : {
		isOk : false,
		refresh : false,

		onOk : function() {},

		create : function() {
			var that = this;
			$(document.body).prepend('<div id="shadowDiv" style="display:none;width:100%;height:100%;position:absolute;top:0px;left:0px;background-color:#000;filter:alpha(opacity=40);opacity:0.4;z-index:65534"><iframe style="width:100%;height:100%;border:0;position:absolute;filter:alpha(opacity=0);opacity:0;z-index:65533" frameborder="0" scrolling="no" id="shadowIframe"></iframe></div>');
			$(document.body).prepend('<div id="popDiv" style="display:none;position:absolute;width:500px;height:300px;background-color:#fff;border:4px solid #e4e4e4;z-index:65535"><div style="text-align:left;background-color:#efefef;height:25px;font-size:14px;cursor:_move_"><span style="display:block;float:left;line-height:25px;padding-left:10px;font-weight:bold" id="popDivTitle"></span><input type="button" id="dialogBoxClose" onclick="$.pop.hide();return false" title="关闭" style="display:block;float:right;width:3.5em; font-size:12px;height:16px;float:right;background:#efefef;0background:url(image/ico/popclose.gif) no-repeat 0 0;border:0;margin:3px 1em 0 0;*margin:5px 0.3em 0 0;padding:0;" onmouseover="this.style.color=\'#ff6600\'" onmouseout="this.style.color=\'#000\'" value=\"X 关闭\" /></div><div id="popBody" style="display:none;text-align:center;padding:5px 10px 10px 10px;font-size:14px;height:auto;overflow:hidden;"></div><div id="popIframeDiv" style="margin:auto;"><iframe id="popIframe" name="popIframe" frameborder="0" scrolling="auto" src="about:blank" width="100%" style=""></div></div>');
		},

		resize : function(width,height) {
			var winH = $(window).height();
			var scrollTop = $(window.body).scrollTop();
			var  top = winH > height ? ((winH-height)/2 + scrollTop) : 50;
			var left = ($(window).width() - width ) / 2 + $(window.body).scrollLeft();
			$('#popDiv').css({'top': top, 'left': left});
			var w = document.documentElement.clientWidth; 
			$('#shadowDiv').css({'height': height, 'width': width,'top': top, 'left': left });
			$('#shadowIframe').css({'width' : width, 'height' :  height,'top': top, 'left': left});
			$('#popIframeDiv').css({'width' : width, 'height' : height-25, margin : 'auto', marginTop : '5px'});
			$('#popIframe').css({'width' :  width, 'height' :  (height-25) });
			$('#popBody').css({'width' : width-10, 'height' : height-25, overflow : 'hidden'});
			$('#popDiv').css({'width' : width+10, 'height' : height+10});
		},

		show : function(str, json) {
			this.create();
			if (str) {
				$('#popDivTitle').html(str);
			}
			if (json) {
				this.resize(json.width,json.height);
				if (json.url) {
					$('#popIframe').attr('src', json.url);

					if (json.refresh) {//给每个form插入input，父页面是否刷新。
						this.refresh = json.refresh;
					}			
					
					$('#popBody').hide();
					$('#popIframeDiv').show();
					window.isForbidGo = 'yes';//forbidGo表示运行php端的alertGo函数，还是exit函数
				}
				if (json.info) {
					$('#popBody').html(json.info);
					$('#popBody').show();
					$('#popIframeDiv').hide();
				}
			}
			$('#shadowDiv').show();
			$('#popDiv').show();
			/*
			$('#shadowIframe').css({
				width : '100%',
				height: '100%'
			})
			*/
			/* 屏蔽移动
			$(window).resize(function(){
			  $.pop.resize(json.width, json.height);
			});
			$(window).scroll(function(){
			  $.pop.resize(json.width, json.height);
			});
			*/
			if (json.drag) {
				$('#popDivTitle').parents('div').eq(0).css('cursor','move')
				$("#popDiv").draggable();
			}
			
		},

		hide : function() { 

			if (document.getElementById('popDiv_del')) {
				$('#popDiv_del').remove();
			}
			if (document.getElementById('shadowDiv_del')) {
				$('#shadowDiv_del').remove();
			}
			$('#shadowDiv').css('display','none');
			$('#popDiv').css('display','none');
			$('#shadowIframe').css('display','none');
			$('#shadowDiv').attr('id','shadowDiv_del');
			$('#popDiv').attr('id','popDiv_del');
			if (this.refresh) {
				window.parent.location.reload();
			}
		},

		confirm : function(i,func) {
			var that = this;
			func = func || this.onOk();
			if (typeof i == 'undefined') {
				i = '此操作';
			}
			var arr = i.split('<br>');
			var max = 0;
			for (var k in arr) {
				max = arr[k].byteLength() > max ? arr[k].byteLength() : max; 
			}
			var width  = max * 7 + 70;
			width = width > 400 ? width : 400;
			var height = arr.length * 20 + 100;
			var info = '<p style="width:100%;padding:10px;padding-left:40px;text-align:left;font-size:14px;line-height:1.4;">'+ i +'</p>';
			info += '<p style="text-align:center;padding:10px;"><input type="button" value="确定" id="confirm_true" class="btnOk" onclick="$.pop.hide();">&nbsp;&nbsp;';
			info += '<input type="button" value="取消" class="btnCancel" onclick="$.pop.hide()">';
			info += '</p>';
			info += '<img src="image/helper/confirm.gif" style="float:left;position:absolute; top:50px; left:5px; width:40px;height:40px;" />';
			this.show('提示：',{info: info,width:width,height:height});
			$('#confirm_true').click(function(){
				that.hide();
				eval('window.parent.' + func)
			})
		},
		loading : function() { 
			var that = this;
			this.create();
			this.resize(250,32);
			$('#popDiv').html('<p class="f14 pt10 gray">正在处理中，请稍候... ...</p>');			
			$('#shadowDiv').hide();
			$('#popDiv').show();
			/*setTimeout(function(){
				$('#popDiv').html('<p class="f14 pt10 gray">处理超时，请重新操作。</p>')
				setTimeout(function(){that.hide()},3000)
			},30000)*/
		},
		alert : function(i,url) {
			var that = this;
			if (typeof i == 'undefined') {
				i = '';
			}			
			var arr = i.split('<br>');
			var max = 0;
			for (var k in arr) {
				max = arr[k].byteLength() > max ? arr[k].byteLength() : max; 
			}
			var width  = max * 8 + 70;
			width = width > 300 ? width : 300;
			var height = arr.length * 20 + 100;
			//height = height > 150 ? height : 150;
			var info = '<p id="info" style="width:100%;padding:15px 10px 10px 0;text-align:left;font-size:14px;line-height:2em;"><img src="/image/helper/alert.gif" style="float:left;margin-left:10px;margin-right:10px;" />'+ i +'</p>';
			info += '<p style="width:100%;text-align:center;padding:10px;*padding-top:0;"><input type="button" value="确定" id="alert_true" class="btnOk" onclick="$.pop.hide();"></p>';		
			this.show('提示：',{info: info,width:300,height:130});
			this.resize(width, height);
			if (url) {
				if (url.indexOf('(') > -1 && url.indexOf(')') > -1) {
					that.onOk = function(){eval('window.' + url);}
				} else {
					if (url == 'reload') {
						this.onOk = function(){window.parent.location.reload();}					
					} else {
						this.onOk = function(){window.parent.location.href = url;}
					}
				}
				$('#alert_true').click(function(){
					that.onOk();
				});
			}
		}
	}
});

$.extend({
	win : $.pop
})
/*
$.extend({
	win123 : {
		create : function() {
			$(document.body).prepend('<div id="shadowDivWin" style="display:none;width:100%;height:100%;position:absolute;top:0px;left:0px;background-color:#000;filter:alpha(opacity=30);opacity:.3;z-index:65534"><iframe style="width:100%;height:100%;border:0;position:absolute;filter:alpha(opacity=0);opacity:0;z-index:65533" frameborder="0" scrolling="no" id="shadowIframeWin"></iframe></div>');
			$(document.body).prepend('<div id="popDivWin" style="display:none;position:absolute;background-color:#fff;border:4px solid #e4e4e4;z-index:65535;text-align:center"></div>');
		},
		resize : function(width,height) {
			var top = ($(window).height() -  height ) / 2 + $(window.body).scrollTop();
			var left = ($(window).width() - width ) / 2 + $(window.body).scrollLeft();
			$('#popDivWin').css({'top': top, 'left': left});	
			var w = document.documentElement.clientWidth;
			$('#shadowDiv').css({'height': height, 'width': width,'top': top, 'left': left });
			$('#shadowIframe').css({'width' : width, 'height' :  height,'top': top, 'left': left});
		},
		loading : function() { 
			this.create();
			this.resize(250,32);
			$('#popDivWin').html('<p class="f14 pt10 gray">正在处理中，请稍候... ...</p>');			
			$('#shadowDivWin').hide();
			$('#popDivWin').show();
			setTimeout(function(){
				$('#popDivWin').html('<p class="f14 pt10 gray">处理超时，请重新操作。</p>')
				setTimeout(function(){$.win.hide()},3000)
			},30000)
		},
		alert : function(msg, url) {
			this.hide();
			this.create();


			var arr = msg.split('<br>');
			var max = 0;
			for (var k in arr) {
				max = arr[k].byteLength() > max ? arr[k].byteLength() : max; 
			};
			var width  = max * 7 + 70;
			width = width > 300 ? width : 300;
			var height = arr.length * 20 + 100;
			this.resize(width, height);

			var html = "";
			html += '<img src="image/helper/alert.gif" align="absmiddle" />' + msg;
			html += "<br>";
			html += "<center><input type=\"button\" class=\"tplbtn btnOk\" value='确定' id='popDivBtnWin'></center>";
			$('#popDivWin').html(html).css({'line-height':'50px','font-size':'14px','padding':'2em','font-family':'verdana'});
			setTimeout("$('#popDivBtnWin').focus()",0);
			$('#popDivBtnWin').click(function(){
//				$('#shadowDivWin').css('display','none');
				$('#popDivWin').css('display','none');
				$('#shadowIframeWin').css('display','none');
			});
			if (url) {
				$('#popDivBtnWin').click(function(){
					if (url.indexOf('(') > -1 && url.indexOf(')') > -1) {
						eval('window.' + url);
					} else {
						if (url == 'reload') {
							window.parent.location.reload();
						} else {
							window.parent.location.href = url;
						}
					}
				});
			}
			$('#shadowDivWin').hide();
			$('#popDivWin').show();			
		},
		confirm : function(msg, func) {
			this.hide();
			this.create();
			this.resize(300,120);
			var html = "";
			html += msg;
			html += "<br>";
			html += "<center><input type=button class=\"btnOk\" value='确定' id='popDivBtnWin'>&nbsp;&nbsp;&nbsp;&nbsp;<input type=button class=\"btnCancel\" value='取消' id='popDivBtnCanncelWin'></center>";
			$('#popDivWin').html(html).css({'line-height':'50px','font-size':'14px','padding-top':'30px'});
			$('#popDivBtnWin').click(function(){
				$('#shadowDivWin').remove()
				$('#popDivWin').remove();
				$('#shadowIframeWin').remove()
				if (func) {
					eval('window.parent.' + func);
				} else {
					window.parent.location.href = url;
				}
			});
			$('#popDivBtnCanncelWin').click(function(){
				$('#shadowDivWin').remove();
				$('#popDivWin').remove();
				$('#shadowIframeWin').remove();
			});
			$('#shadowDivWin').show();
			$('#popDivWin').show();			
		},
		hide : function() { 
			$('#shadowDivWin').remove();
			$('#popDivWin').remove();
			$('#shadowIframeWin').remove();
		}
	}
});
*/
$.extend({
	validRule : function(rule,jqForm) {
			if(rule == '') return true;
			for (var i in rule) {
				/* 检查必填项 */
				if (rule[i].must != 0) {
					if ( rule[i].must == 1) { 
						if(jqForm.find(":input[id="+i+"]").attr('disabled') == true ||  jqForm.find('*[id=^' + i + ']').eq(0).get(0) == undefined) { // disabled或此id的表单不存在将不验证	
							continue;//以上两个情况不满足，就continue
						}
					};
					if(jqForm.find(":input[name='"+i+"']").size() < 1) {
						$.win.alert('对不起,' + rule[i].msg + '不能为空！');
						jqForm.find(":input[name="+i+"]")[0].focus();
						return false;
					} else {
						var type = jqForm.find(":input[name='"+i+"']").attr('type');
						var isOk = true;
						switch(type){
							case 'hidden' : if(jqForm.find(":input[name="+i+"]").val() == '') isOk = false;break;
							case 'checkbox' : if(jqForm.find(":input[name='"+i+"'][checked]").val() == undefined) isOk = false;break;
							case 'radio' : if(jqForm.find(":input[name='"+i+"'][checked]").val() == undefined) isOk = false;break;
							default : if(jqForm.find(":input[name="+i+"]").val() == '') isOk = false;break;
						}
					};
					if(!isOk){						
						$.pop.alert('对不起,' + rule[i].msg + '不能为空！');
						jqForm.find(":input[name="+i+"]")[0].focus();
						return false;
					}					
				};
				
				if(jqForm.find(":input[name="+i+"]").val() == '') { //非必填写项，不为空才需要进行下面的检测。
					continue;
				};
				

				/* 检查正则 */
				if (rule[i].reg) {					
					var reg = rule[i].reg.replace(/\/u$/,'/').replace(/\\x\{(.{4})\}/g,"\\u$1");//后一个是子模式匹配，php中文正则和替换成js的
					reg = eval(reg);
					if (!(reg.test($("#"+i).val()))) {
						$.win.alert('对不起,' + rule[i].msg + '不符合验证规则，请按要求的正确格式填写');
						jqForm.find("#"+i).focus();
						return false;
					}
				};
				
				if (rule[i].type) {
					var reg;
					switch (rule[i].type) {
						case 'email' : 
							reg = /^([a-zA-Z0-9_\-\.])+@([a-zA-Z0-9\-])+\.[a-zA-Z0-9\-\.]+$/; 
							if (!(reg.test($("#"+i).val()))) {
								$.win.alert('对不起，email不合法！');
								jqForm.find("#"+i).focus();
								return false;
							}
							break;
						case 'tel'   :
							reg = /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/; 
							if (!(reg.test($("#"+i).val()))) {
								$.win.alert('对不起，电话号码不符合要求！');
								jqForm.find("#"+i).focus();
								return false;
							}
							break;
						case 'cn'   :
							reg = /^[\u4e00-\u9fa5]+$/; 
							if (!(reg.test($("#"+i).val()))) {
								$.win.alert('对不起，' + rule[i].msg + '要求是纯中文字符');
								jqForm.find("#"+i).focus();
								return false;
							}
							break;
					};
					/*
					reg = eval(reg);
					if (!(reg.test(jqForm.find("#"+i).val()))) {
						$.win.alert('对不起' + rule[i].msg + '不符合要求！');
						jqForm.find("#"+i).focus();
						return false;
					}
					*/
				};

				if (rule[i].min) {
					if ( jqForm.find("#"+i).val().byteLength() < rule[i].min) {
						$.win.alert('对不起,' + rule[i].msg + '太短！');
						jqForm.find("#"+i).focus(); 
						return false;
					}
				};

				if (rule[i].max) {
					if (jqForm.find("#"+i).val().byteLength() > rule[i].max) {
						$.win.alert('对不起,' + rule[i].msg + '太长！');
						jqForm.find("#"+i).focus();
						return false;
					}
				}				
			};
			return true;
		}
})


$.extend({
	checkRule : function(rule,jqForm) {
			for (var i in rule) {
				/* 上传表单 */
				if (document.getElementById(i) == null || $("#"+i).attr('disabled') == true) { // 可以对动态添加的表单和表单属性为disabled的进行验证，没有时不验证
					continue;
				};
				if (i == 'path[]') {
					if (rule[i].must == 1) {
						if (jqForm.find("input[name='path[]']").size() == 0) {
							$.win.alert('对不起，' + rule[i].msg + '！');
							return false;
						}
					}
					continue; // 检测下一个。
				};
				/* 检查必填项 */
				if (rule[i].must == 1) {
					if($.trim($("#"+i).val()) == ''){//要求每个表单元素的id必须和name一样的才能被这里顺利验证
						$.win.alert('对不起，' + rule[i].msg + '！');
						$("#"+i).focus();
						return false;
					}
				};

				if($("#"+i).val() == '') { //非必填写项，不为空才需要进行下面的检测。
					continue;
				};

				/* 检查正则 */
				if (rule[i].reg) {					
					var reg = rule[i].reg.replace(/\/u$/,'/').replace(/\\x\{(.{4})\}/g,"\\u$1");//后一个是子模式匹配，php中文正则和替换成js的
					reg = eval(reg);
					if (!(reg.test($("#"+i).val()))) {
						alert('对不起' + rule[i].msg + '不符合要求！');
						$("#"+i).focus();
						return false;
					}
				};

				if (rule[i].type) {
					var reg;
					switch (rule[i].type) {
						case 'email' : 
							reg = /^([a-zA-Z0-9_\-\.])+@([a-zA-Z0-9\-])+\.[a-zA-Z0-9\-\.]+$/; 
							if (!(reg.test($("#"+i).val()))) {
								alert('对不起，email不合法！');
								$("#"+i).focus();
								return false;
							}
							break;
						case 'tel'   :
							reg = /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/; 
							if (!(reg.test($("#"+i).val()))) {
								alert('对不起，电话号码不符合要求！');
								$("#"+i).focus();
								return false;
							}
							break;
						case 'cn'   :
							reg = /^[\u4e00-\u9fa5]+$/; 
							if (!(reg.test($("#"+i).val()))) {
								alert('对不起，' + rule[i].msg + '要求是纯中文字符');
								$("#"+i).focus();
								return false;
							}
							break;
					};
					reg = eval(reg);
					if (!(reg.test($("#"+i).val()))) {
						alert('对不起' + rule[i].msg + '不符合要求！');
						$("#"+i).focus();
						return false;
					}
				};

				if (rule[i].min) {
					if ( $("#"+i).val().byteLength() < rule[i].min) {
						alert('对不起' + rule[i].msg + '太短！');
						$("#"+i).focus(); 
						return false;
					}
				};

				if (rule[i].max) {
					if ($("#"+i).val().byteLength() > rule[i].max) {
						alert('对不起' + rule[i].msg + '太长！');
						$("#"+i).focus();
						return false;
					}
				}				
			};
			return true;
		}
})

jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            };
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

jQuery.btnCancelClick = function() {
	if (top.document.getElementById('popDiv')) {
		top.$.pop.hide();
	} else {
		top.history.go(-1);
	}
}
$.fn.slide = function(data) {
	//var _this = this;
	this.css('position','relative');

	//alert($(this).parent().width());

	var pid = this.attr('id');
	var $body = $('<div id="' + pid + 'body"></div>');
	var $foot = $('<div id="' + pid + 'foot"></div>');
	var $num  = $('<ul id="' + pid + 'num" style="position:absolute;bottom:21px;right:0;z-index:10;margin:0"></ul>');
	var $height = this.innerHeight();
	var $width = this.innerWidth();
	$body.css({width: $width, height: $height - 21,position: 'relative'});
	$foot.css({width: $width, height: 21,background: '#f7f7f7',filter: 'alpha(opacity=80)',opacity: '0.8',textAlign: 'center',lineHeight: '21px',position:'absolute',bottom:0,whiteSpace:'nowrap',overflow:'hidden'});
	this.append($body).append($foot).append($num);
	slide = (typeof slide == 'undefined') ? {} : slide;
	slide[pid] = {};
	slide[pid].point  = 0;
	slide[pid].timer  = '';
	slide[pid].data   = data;
	slide[pid].total  = data.length,
	slide[pid].change = function() {
		this.point = this.point % this.total;
		var h  = '<a href="'  + this.data[this.point].url  + '" target="_blank" onmouseover="slide[\'' + pid + '\'].stop()" onmouseout="slide[\'' + pid + '\'].start()" ';
		
			//var traffic_url = 'index.php?do=sys_traffic_click&id='+this.data[this.point].traffic_id;

			if(this.data[this.point].traffic_id != ''){ //有流量统计时，添加onclick事件
				h += " id=\"link-"+this.data[this.point].traffic_id+"\"";
				//h += " onclick=traffic('" + traffic_url + "')";
			};

		    h += '><img src="' + this.data[this.point].path + '" width="' + ($width) + '" height="' + ($height-21) + '" style="border:0"></a>';
		$body.html(h).show()//hide().fadeIn(500);
		    h  = '<a href="'  + this.data[this.point].url  + '" target="_blank" onmouseover="slide[\'' + pid + '\'].stop()" onmouseout="slide[\'' + pid + '\'].start()" style="font-size:12px;font-weight:700;color:#000;text-decoration:none;font-family:verdana,tahoma,arial;line-height:21px;"';
			
			if(this.data[this.point].traffic_id != ''){ //有流量统计时，添加onclick事件
				h += " id=\"link-"+this.data[this.point].traffic_id+"\"";
				//h += "onclick=traffic('" + traffic_url + "')";
			};			
			
			h += '>'+this.data[this.point].title + '</a>';
		$foot.html(h);

		/* 数字导航 */
		var v  = '';
		for (var i = 0; i < slide[pid].data.length ; i++ ) {			
		    v += '<li style="float:left;background:#ffddee;margin-left:2px;padding:0px 10px;line-height:14px;cursor:pointer;list-style:none">'+(i+1)+'</li>';
		}
		$('#'+pid + 'num').html(v);
		$('#'+pid + 'num li').eq(this.point).attr('style','float:left;margin-left:2px;color:#fff;background:#66aaff;font-weight:bold;cursor:pointer;list-style:none;filter:alpha(opacity=90);opacity:.9;font-size:12px;width:20px;height:20px;line-height:20px;text-align:center;')
		.siblings('li').attr('style','float:left;background:#ffccaa;margin-left:2px;cursor:pointer;list-style:none;filter:alpha(opacity=50);opacity:.5;font-size:12px;width:20px;height:20px;line-height:20px;text-align:center;')

		/* 点击数字导航 */
		$('#'+pid+' li').each(function(){
			$(this).mousedown(function(){
				slide[pid].point = parseInt($(this).html())-1;
				slide[pid].change();
				slide[pid].stop();
			}).mouseup(function(){
				slide[pid].start();
			})
		})

		this.point ++;
	},
	slide[pid].start  = function() {
		this.timer = setInterval("slide['" + pid + "'].change()",10000);
	},
	slide[pid].stop   = function() {
		clearInterval(this.timer);
	}
	slide[pid].change();
	slide[pid].start();
};

