/**!
 * @license jQuery JavaScript Library v1.3.2_6246
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js (v0.9.3)
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Jul 28 17:19:01 2010 +0200
 */
(function(){function Y(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function G(a,b){return a[0]&&parseInt(c.curCSS(a[0],b,true),10)||0}function L(){return false}function M(){return true}function O(a){var b=RegExp("(^|\\.)"+a.type+"(\\.|$)"),d=true,f=[];c.each(c.data(this,"events").live||[],function(h,i){if(b.test(i.type)){var n=c(a.target).closest(i.data)[0];n&&f.push({elem:n,fn:i})}});f.sort(function(h,i){return c.data(h.elem,"closest")-c.data(i.elem,"closest")});c.each(f,function(){if(this.fn.call(this.elem,a,this.fn.data)===false)return d=false});return d}function P(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}function Q(){if(!R){R=true;if(document.addEventListener)document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);c.ready()},false);else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);c.ready()}});document.documentElement.doScroll&&u==u.top&&function(){if(!c.isReady){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}c.ready()}}()}c.event.add(u,"load",c.ready)}}function E(a,b){var d={};c.each(S.concat.apply([],S.slice(0,b)),function(){d[this]=a});return d}var u=this,Z=u.jQuery,$=u.$,c=u.jQuery=u.$=function(a,b){return new c.fn.init(a,b)},aa=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ba=/^.[^:#\[\.,]*$/;c.fn=c.prototype={init:function(a,b){a=a||document;if(a.nodeType){this[0]=a;this.length=1;this.context=a;return this}if(typeof a==="string"){var d=aa.exec(a);if(d&&(d[1]||!b))if(d[1])a=c.clean([d[1]],b);else{var f=document.getElementById(d[3]);if(f&&f.id!=d[3])return c().find(a);d=c(f||[]);d.context=document;d.selector=a;return d}else return c(b).find(a)}else if(c.isFunction(a))return c(document).ready(a);if(a.selector&&a.context){this.selector=a.selector;this.context=a.context}return this.setArray(c.isArray(a)?a:c.makeArray(a))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===void 0?Array.prototype.slice.call(this):this[a]},pushStack:function(a,b,d){a=c(a);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},index:function(a){return c.inArray(a&&a.jquery?a[0]:a,this)},attr:function(a,b,d){var f=a;if(typeof a==="string")if(b===void 0)return this[0]&&c[d||"attr"](this[0],a);else{f={};f[a]=b}return this.each(function(h){for(a in f)c.attr(d?this.style:this,a,c.prop(this,f[a],d,h,a))})},css:function(a,b){if((a=="width"||a=="height")&&parseFloat(b)<0)b=void 0;return this.attr(a,b,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a));var b="";c.each(a||this,function(){c.each(this.childNodes,function(){if(this.nodeType!=8)b+=this.nodeType!=1?this.nodeValue:c.fn.text([this])})});return b},wrapAll:function(a){if(this[0]){a=c(a,this[0].ownerDocument).clone();this[0].parentNode&&a.insertBefore(this[0]);a.map(function(){for(var b=this;b.firstChild;)b=b.firstChild;return b}).append(this)}return this},wrapInner:function(a){return this.each(function(){c(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){this.nodeType==1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType==1&&this.insertBefore(a,this.firstChild)})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||c([])},push:[].push,sort:[].sort,splice:[].splice,find:function(a){if(this.length===1){var b=this.pushStack([],"find",a);b.length=0;c.find(a,this[0],b);return b}else return this.pushStack(c.unique(c.map(this,function(d){return c.find(a,d)})),"find",a)},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var h=this.outerHTML;if(!h){h=this.ownerDocument.createElement("div");h.appendChild(this.cloneNode(true));h=h.innerHTML}return c.clean([h.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else return this.cloneNode(true)});if(a===true){var d=this.find("*").andSelf(),f=0;b.find("*").andSelf().each(function(){if(this.nodeName===d[f].nodeName){var h=c.data(d[f],"events");for(var i in h)for(var n in h[i])c.event.add(this,i,h[i][n],h[i][n].data);f++}})}return b},filter:function(a){return this.pushStack(c.isFunction(a)&&c.grep(this,function(b,d){return a.call(b,d)})||c.multiFilter(a,c.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(a){var b=c.expr.match.POS.test(a)?c(a):null,d=0;return this.map(function(){for(var f=this;f&&f.ownerDocument;){if(b?b.index(f)>-1:c(f).is(a)){c.data(f,"closest",d);return f}f=f.parentNode;d++}})},not:function(a){if(typeof a==="string")if(ba.test(a))return this.pushStack(c.multiFilter(a,this,true),"not",a);else a=c.multiFilter(a,this);var b=a.length&&a[a.length-1]!==void 0&&!a.nodeType;return this.filter(function(){return b?c.inArray(this,a)<0:this!=a})},add:function(a){return this.pushStack(c.unique(c.merge(this.get(),typeof a==="string"?c(a):c.makeArray(a))))},is:function(a){return!!a&&c.multiFilter(a,this).length>0},hasClass:function(a){return!!a&&this.is("."+a)},val:function(a){if(a===void 0){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],h=b.options;b=b.type=="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:h.length;i<d;i++){var n=h[i];if(n.selected){a=c(n).val();if(b)return a;f.push(a)}}return f}return(b.value||"").replace(/\r/g,"")}}else{if(typeof a==="number")a+="";return this.each(function(){if(this.nodeType==1)if(c.isArray(a)&&/radio|checkbox/.test(this.type))this.checked=c.inArray(this.value,a)>=0||c.inArray(this.name,a)>=0;else if(c.nodeName(this,"select")){var o=c.makeArray(a);c("option",this).each(function(){this.selected=c.inArray(this.value,o)>=0||c.inArray(this.text,o)>=0});if(!o.length)this.selectedIndex=-1}else this.value=a})}},html:function(a){return a===void 0?this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null:this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(a,b,d){if(this[0]){var f=(this[0].ownerDocument||this[0]).createDocumentFragment();a=c.clean(a,this[0].ownerDocument||this[0],f);var h=f.firstChild;if(h)for(var i=0,n=this.length;i<n;i++)d.call(b&&c.nodeName(this[i],"table")&&c.nodeName(h,"tr")?this[i].getElementsByTagName("tbody")[0]||this[i].appendChild(this[i].ownerDocument.createElement("tbody")):this[i],this.length>1||i>0?f.cloneNode(true):f);a&&c.each(a,Y)}return this}};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,h;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d==b){a=this;--b}for(;b<d;b++)if((h=arguments[b])!=null)for(var i in h){var n=a[i],o=h[i];if(a!==o)if(f&&o&&typeof o==="object"&&!o.nodeType)a[i]=c.extend(f,n||(o.length!=null?[]:{}),o);else if(o!==void 0)a[i]=o}return a};var ca=/z-?index|font-?weight|opacity|zoom|line-?height/i,T=document.defaultView||{},U=Object.prototype.toString;c.extend({noConflict:function(a){u.$=$;if(a)u.jQuery=Z;return c},isFunction:function(a){return U.call(a)==="[object Function]"},isArray:function(a){return U.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&c.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,d=document.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(document.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(a,b,d){var f,h=0,i=a.length;if(d)if(i===void 0)for(f in a){if(b.apply(a[f],d)===false)break}else for(;h<i;){if(b.apply(a[h++],d)===false)break}else if(i===void 0)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];h<i&&b.call(d,h,d)!==false;d=a[++h]);return a},prop:function(a,b,d,f,h){if(c.isFunction(b))b=b.call(a,f);return typeof b==="number"&&d=="curCSS"&&!ca.test(h)?b+"px":b},className:{add:function(a,b){c.each((b||"").split(/\s+/),function(d,f){if(a.nodeType==1&&!c.className.has(a.className,f))a.className+=(a.className?" ":"")+f})},remove:function(a,b){if(a.nodeType==1)a.className=b!==void 0?c.grep(a.className.split(/\s+/),function(d){return!c.className.has(b,d)}).join(" "):""},has:function(a,b){return a&&c.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(a,b,d){var f={};for(var h in b){f[h]=a.style[h];a.style[h]=b[h]}d.call(a);for(h in b)a.style[h]=f[h]},css:function(a,b,d,f){if(b=="width"||b=="height"){var h;d={position:"absolute",visibility:"hidden",display:"block"};var i=b=="width"?["Left","Right"]:["Top","Bottom"],n=function(){h=b=="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(h-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")h+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else h-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})};a.offsetWidth!==0?n():c.swap(a,d,n);return Math.max(0,Math.round(h))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,h=a.style;if(b=="opacity"&&!c.support.opacity){f=c.attr(h,"opacity");return f==""?"1":f}if(b.match(/float/i))b=H;if(!d&&h&&h[b])f=h[b];else if(T.getComputedStyle){if(b.match(/float/i))b="float";b=b.replace(/([A-Z])/g,"-$1").toLowerCase();if(a=T.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b=="opacity"&&f=="")f="1"}else if(a.currentStyle){f=b.replace(/\-(\w)/g,function(i,n){return n.toUpperCase()});f=a.currentStyle[b]||a.currentStyle[f];if(!/^\d+(px)?$/i.test(f)&&/^\d/.test(f)){b=h.left;d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=f||0;f=h.pixelLeft+"px";h.left=b;a.runtimeStyle.left=d}}return f},clean:function(a,b,d){b=b||document;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||document;if(!d&&a.length===1&&typeof a[0]==="string"){var f=/^<(\w+)\s*\/?>$/.exec(a[0]);if(f)return[b.createElement(f[1])]}var h=[];f=[];var i=b.createElement("div");c.each(a,function(n,o){if(typeof o==="number")o+="";if(o){if(typeof o==="string"){o=o.replace(/(<(\w+)[^>]*?)\/>/g,function(x,z,r){return r.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?x:z+"></"+r+">"});var s=o.replace(/^\s+/,"").substring(0,10).toLowerCase(),t=!s.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!c.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];for(i.innerHTML=t[1]+o+t[2];t[0]--;)i=i.lastChild;if(!c.support.tbody){var v=/<tbody/i.test(o);s=!s.indexOf("<table")&&!v?i.firstChild&&i.firstChild.childNodes:t[1]=="<table>"&&!v?i.childNodes:[];for(t=s.length-1;t>=0;--t)c.nodeName(s[t],"tbody")&&!s[t].childNodes.length&&s[t].parentNode.removeChild(s[t])}!c.support.leadingWhitespace&&/^\s/.test(o)&&i.insertBefore(b.createTextNode(o.match(/^\s*/)[0]),i.firstChild);o=c.makeArray(i.childNodes)}if(o.nodeType)h.push(o);else h=c.merge(h,o)}});if(d){for(a=0;h[a];a++)if(c.nodeName(h[a],"script")&&(!h[a].type||h[a].type.toLowerCase()==="text/javascript"))f.push(h[a].parentNode?h[a].parentNode.removeChild(h[a]):h[a]);else{h[a].nodeType===1&&h.splice.apply(h,[a+1,0].concat(c.makeArray(h[a].getElementsByTagName("script"))));d.appendChild(h[a])}return f}return h},attr:function(a,b,d){if(!(!a||a.nodeType==3||a.nodeType==8)){var f=!c.isXMLDoc(a),h=d!==void 0;b=f&&c.props[b]||b;if(a.tagName){var i=/href|src|style/.test(b);if(b in a&&f&&!i){if(h){if(b=="type"&&c.nodeName(a,"input")&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b=="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:a.nodeName.match(/(button|input|object|select|textarea)/i)?0:a.nodeName.match(/^(a|area)$/i)&&a.href?0:void 0;return a[b]}if(!c.support.style&&f&&b=="style")return c.attr(a.style,"cssText",d);h&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?void 0:a}if(!c.support.opacity&&b=="opacity"){if(h){a.zoom=1;a.filter=(a.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(d)+""=="NaN"?"":"alpha(opacity="+d*100+")")}return a.filter&&a.filter.indexOf("opacity=")>=0?parseFloat(a.filter.match(/opacity=([^)]*)/)[1])/100+"":""}b=b.replace(/-([a-z])/ig,function(n,o){return o.toUpperCase()});if(h)a[b]=d;return a[b]}},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var b=[];if(a!=null){var d=a.length;if(d==null||typeof a==="string"||c.isFunction(a)||a.setInterval)b[0]=a;else for(;d;)b[--d]=a[d]}return b},inArray:function(a,b){for(var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=0,f,h=a.length;if(c.support.getAll)for(;(f=b[d++])!=null;)a[h++]=f;else for(;(f=b[d++])!=null;)if(f.nodeType!=8)a[h++]=f;return a},unique:function(a){var b=[],d={};try{for(var f=0,h=a.length;f<h;f++){var i=c.data(a[f]);if(!d[i]){d[i]=true;b.push(a[f])}}}catch(n){b=a}return b},grep:function(a,b,d){for(var f=[],h=0,i=a.length;h<i;h++)!d!=!b(a[h],h)&&f.push(a[h]);return f},map:function(a,b){for(var d=[],f=0,h=a.length;f<h;f++){var i=b(a[f],f);if(i!=null)d[d.length]=i}return d.concat.apply([],d)}});var D=navigator.userAgent.toLowerCase();c.browser={version:(D.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(D),opera:/opera/.test(D),msie:/msie/.test(D)&&!/opera/.test(D),mozilla:/mozilla/.test(D)&&!/(compatible|webkit)/.test(D)};c.each({parent:function(a){return a.parentNode},parents:function(a){return c.dir(a,"parentNode")},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d){var f=c.map(this,b);if(d&&typeof d=="string")f=c.multiFilter(d,f);return this.pushStack(c.unique(f),a,d)}});c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){for(var f=[],h=c(d),i=0,n=h.length;i<n;i++){var o=(i>0?this.clone(true):this).get();c.fn[b].apply(c(h[i]),o);f=f.concat(o)}return this.pushStack(f,a,d)}});c.each({removeAttr:function(a){c.attr(this,a,"");this.nodeType==1&&this.removeAttribute(a)},addClass:function(a){c.className.add(this,a)},removeClass:function(a){c.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean")b=!c.className.has(this,a);c.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||c.filter(a,[this]).length){c("*",this).add([this]).each(function(){c.event.remove(this);c.removeData(this)});this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(c(this).children().remove();this.firstChild;)this.removeChild(this.firstChild)}},function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});var C="jQuery"+ +new Date,da=0,V={};c.extend({cache:{},data:function(a,b,d){a=a==u?V:a;var f=a[C];f||(f=a[C]=++da);if(b&&!c.cache[f])c.cache[f]={};if(d!==void 0)c.cache[f][b]=d;return b?c.cache[f][b]:f},removeData:function(a,b){a=a==u?V:a;var d=a[C];if(b){if(c.cache[d]){delete c.cache[d][b];b="";for(b in c.cache[d])break;b||c.removeData(a)}}else{try{delete a[C]}catch(f){a.removeAttribute&&a.removeAttribute(C)}delete c.cache[d]}},queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else d&&f.push(d)}return f},dequeue:function(a,b){var d=c.queue(a,b),f=d.shift();if(!b||b==="fx")f=d[0];f!==void 0&&f.call(a)}});c.fn.extend({data:function(a,b){var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===void 0){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===void 0&&this.length)f=c.data(this[0],a);return f===void 0&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})},queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===void 0)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a=="fx"&&d.length==1&&d[0].call(this)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})}});(function(){function a(e,g,j,k,l,m){l=e=="previousSibling"&&!m;for(var p=0,w=k.length;p<w;p++){var q=k[p];if(q){if(l&&q.nodeType===1){q.sizcache=j;q.sizset=p}q=q[e];for(var y=false;q;){if(q.sizcache===j){y=k[q.sizset];break}if(q.nodeType===1&&!m){q.sizcache=j;q.sizset=p}if(q.nodeName===g){y=q;break}q=q[e]}k[p]=y}}}function b(e,g,j,k,l,m){l=e=="previousSibling"&&!m;for(var p=0,w=k.length;p<w;p++){var q=k[p];if(q){if(l&&q.nodeType===1){q.sizcache=j;q.sizset=p}q=q[e];for(var y=false;q;){if(q.sizcache===j){y=k[q.sizset];break}if(q.nodeType===1){if(!m){q.sizcache=j;q.sizset=p}if(typeof g!=="string"){if(q===g){y=true;break}}else if(i.filter(g,[q]).length>0){y=q;break}}q=q[e]}k[p]=y}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,f=0,h=Object.prototype.toString,i=function(e,g,j,k){j=j||[];g=g||document;if(g.nodeType!==1&&g.nodeType!==9)return[];if(!e||typeof e!=="string")return j;var l=[],m,p,w,q=true;for(d.lastIndex=0;(m=d.exec(e))!==null;){l.push(m[1]);if(m[2]){w=RegExp.rightContext;break}}if(l.length>1&&o.exec(e))if(l.length===2&&n.relative[l[0]])m=B(l[0]+l[1],g);else for(m=n.relative[l[0]]?[g]:i(l.shift(),g);l.length;){e=l.shift();if(n.relative[e])e+=l.shift();m=B(e,m)}else{m=k?{expr:l.pop(),set:t(k)}:i.find(l.pop(),l.length===1&&g.parentNode?g.parentNode:g,r(g));m=i.filter(m.expr,m.set);if(l.length>0)p=t(m);else q=false;for(;l.length;){var y=l.pop(),A=y;if(n.relative[y])A=l.pop();else y="";if(A==null)A=g;n.relative[y](p,A,r(g))}}p||(p=m);if(!p)throw"Syntax error, unrecognized expression: "+(y||e);if(h.call(p)==="[object Array]")if(q)if(g.nodeType===1)for(e=0;p[e]!=null;e++){if(p[e]&&(p[e]===true||p[e].nodeType===1&&z(g,p[e])))j.push(m[e])}else for(e=0;p[e]!=null;e++)p[e]&&p[e].nodeType===1&&j.push(m[e]);else j.push.apply(j,p);else t(p,j);if(w){i(w,g,j,k);if(x){hasDuplicate=false;j.sort(x);if(hasDuplicate)for(e=1;e<j.length;e++)j[e]===j[e-1]&&j.splice(e--,1)}}return j};i.matches=function(e,g){return i(e,null,null,g)};i.find=function(e,g,j){var k,l;if(!e)return[];for(var m=0,p=n.order.length;m<p;m++){var w=n.order[m];if(l=n.match[w].exec(e)){var q=RegExp.leftContext;if(q.substr(q.length-1)!=="\\"){l[1]=(l[1]||"").replace(/\\/g,"");k=n.find[w](l,g,j);if(k!=null){e=e.replace(n.match[w],"");break}}}}k||(k=g.getElementsByTagName("*"));return{set:k,expr:e}};i.filter=function(e,g,j,k){for(var l=e,m=[],p=g,w,q,y=g&&g[0]&&r(g[0]);e&&g.length;){for(var A in n.filter)if((w=n.match[A].exec(e))!=null){var ea=n.filter[A],F,I;q=false;if(p==m)m=[];if(n.preFilter[A])if(w=n.preFilter[A](w,p,j,m,k,y)){if(w===true)continue}else q=F=true;if(w)for(var J=0;(I=p[J])!=null;J++)if(I){F=ea(I,w,J,p);var W=k^!!F;if(j&&F!=null)if(W)q=true;else p[J]=false;else if(W){m.push(I);q=true}}if(F!==void 0){j||(p=m);e=e.replace(n.match[A],"");if(!q)return[];break}}if(e==l)if(q==null)throw"Syntax error, unrecognized expression: "+e;else break;l=e}return p};var n=i.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(e,g,j){var k=typeof g==="string",l=k&&!/\W/.test(g);k=k&&!l;if(l&&!j)g=g.toUpperCase();j=0;l=e.length;for(var m;j<l;j++)if(m=e[j]){for(;(m=m.previousSibling)&&m.nodeType!==1;);e[j]=k||m&&m.nodeName===g?m||false:m===g}k&&i.filter(g,e,true)},">":function(e,g,j){var k=typeof g==="string";if(k&&!/\W/.test(g)){g=j?g:g.toUpperCase();j=0;for(var l=e.length;j<l;j++){var m=e[j];if(m){k=m.parentNode;e[j]=k.nodeName===g?k:false}}}else{j=0;for(l=e.length;j<l;j++)if(m=e[j])e[j]=k?m.parentNode:m.parentNode===g;k&&i.filter(g,e,true)}},"":function(e,g,j){var k=f++,l=b;if(!g.match(/\W/)){var m=g=j?g:g.toUpperCase();l=a}l("parentNode",g,k,e,m,j)},"~":function(e,g,j){var k=f++,l=b;if(typeof g==="string"&&!g.match(/\W/)){var m=g=j?g:g.toUpperCase();l=a}l("previousSibling",g,k,e,m,j)}},find:{ID:function(e,g,j){if(typeof g.getElementById!=="undefined"&&!j)return(e=g.getElementById(e[1]))?[e]:[]},NAME:function(e,g){if(typeof g.getElementsByName!=="undefined"){for(var j=[],k=g.getElementsByName(e[1]),l=0,m=k.length;l<m;l++)k[l].getAttribute("name")===e[1]&&j.push(k[l]);return j.length===0?null:j}},TAG:function(e,g){return g.getElementsByTagName(e[1])}},preFilter:{CLASS:function(e,g,j,k,l,m){e=" "+e[1].replace(/\\/g,"")+" ";if(m)return e;m=0;for(var p;(p=g[m])!=null;m++)if(p)if(l^(p.className&&(" "+p.className+" ").indexOf(e)>=0))j||k.push(p);else if(j)g[m]=false;return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(e,g){for(var j=0;g[j]===false;j++);return g[j]&&r(g[j])?e[1]:e[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var g=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=g[1]+(g[2]||1)-0;e[3]=g[3]-0}e[0]=f++;return e},ATTR:function(e,g,j,k,l,m){g=e[1].replace(/\\/g,"");if(!m&&n.attrMap[g])e[1]=n.attrMap[g];if(e[2]==="~=")e[4]=" "+e[4]+" ";return e},PSEUDO:function(e,g,j,k,l){if(e[1]==="not")if(e[3].match(d).length>1||/^\w/.test(e[3]))e[3]=i(e[3],null,null,g);else{e=i.filter(e[3],g,j,true^l);j||k.push.apply(k,e);return false}else if(n.match.POS.test(e[0])||n.match.CHILD.test(e[0]))return true;return e},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){return e.selected===true},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,g,j){return!!i(j[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(e,g){return g===0},last:function(e,g,j,k){return g===k.length-1},even:function(e,g){return g%2===0},odd:function(e,g){return g%2===1},lt:function(e,g,j){return g<j[3]-0},gt:function(e,g,j){return g>j[3]-0},nth:function(e,g,j){return j[3]-0==g},eq:function(e,g,j){return j[3]-0==g}},filter:{PSEUDO:function(e,g,j,k){var l=g[1],m=n.filters[l];if(m)return m(e,j,g,k);else if(l==="contains")return(e.textContent||e.innerText||"").indexOf(g[3])>=0;else if(l==="not"){g=g[3];j=0;for(k=g.length;j<k;j++)if(g[j]===e)return false;return true}},CHILD:function(e,g){var j=g[1],k=e;switch(j){case "only":case "first":for(;k=k.previousSibling;)if(k.nodeType===1)return false;if(j=="first")return true;k=e;case "last":for(;k=k.nextSibling;)if(k.nodeType===1)return false;return true;case "nth":j=g[2];var l=g[3];if(j==1&&l==0)return true;var m=g[0],p=e.parentNode;if(p&&(p.sizcache!==m||!e.nodeIndex)){var w=0;for(k=p.firstChild;k;k=k.nextSibling)if(k.nodeType===1)k.nodeIndex=++w;p.sizcache=m}k=e.nodeIndex-l;return j==0?k==0:k%j==0&&k/j>=0}},ID:function(e,g){return e.nodeType===1&&e.getAttribute("id")===g},TAG:function(e,g){return g==="*"&&e.nodeType===1||e.nodeName===g},CLASS:function(e,g){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(g)>-1},ATTR:function(e,g){var j=g[1];j=n.attrHandle[j]?n.attrHandle[j](e):e[j]!=null?e[j]:e.getAttribute(j);var k=j+"",l=g[2],m=g[4];return j==null?l==="!=":l==="="?k===m:l==="*="?k.indexOf(m)>=0:l==="~="?(" "+k+" ").indexOf(m)>=0:!m?k&&j!==false:l==="!="?k!=m:l==="^="?k.indexOf(m)===0:l==="$="?k.substr(k.length-m.length)===m:l==="|="?k===m||k.substr(0,m.length+1)===m+"-":false},POS:function(e,g,j,k){var l=n.setFilters[g[2]];if(l)return l(e,j,g,k)}}},o=n.match.POS;for(var s in n.match)n.match[s]=RegExp(n.match[s].source+/(?![^\[]*\])(?![^\(]*\))/.source);var t=function(e,g){e=Array.prototype.slice.call(e);if(g){g.push.apply(g,e);return g}return e};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(v){t=function(e,g){var j=g||[];if(h.call(e)==="[object Array]")Array.prototype.push.apply(j,e);else if(typeof e.length==="number")for(var k=0,l=e.length;k<l;k++)j.push(e[k]);else for(k=0;e[k];k++)j.push(e[k]);return j}}var x;if(document.documentElement.compareDocumentPosition)x=function(e,g){var j=e.compareDocumentPosition(g)&4?-1:e===g?0:1;if(j===0)hasDuplicate=true;return j};else if("sourceIndex"in document.documentElement)x=function(e,g){var j=e.sourceIndex-g.sourceIndex;if(j===0)hasDuplicate=true;return j};else if(document.createRange)x=function(e,g){var j=e.ownerDocument.createRange(),k=g.ownerDocument.createRange();j.selectNode(e);j.collapse(true);k.selectNode(g);k.collapse(true);j=j.compareBoundaryPoints(Range.START_TO_END,k);if(j===0)hasDuplicate=true;return j};(function(){var e=document.createElement("form"),g="script"+(new Date).getTime();e.innerHTML="<input name='"+g+"'/>";var j=document.documentElement;j.insertBefore(e,j.firstChild);if(document.getElementById(g)){n.find.ID=function(k,l,m){if(typeof l.getElementById!=="undefined"&&!m)return(l=l.getElementById(k[1]))?l.id===k[1]||typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id").nodeValue===k[1]?[l]:void 0:[]};n.filter.ID=function(k,l){var m=typeof k.getAttributeNode!=="undefined"&&k.getAttributeNode("id");return k.nodeType===1&&m&&m.nodeValue===l}}j.removeChild(e)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0)n.find.TAG=function(g,j){var k=j.getElementsByTagName(g[1]);if(g[1]==="*"){for(var l=[],m=0;k[m];m++)k[m].nodeType===1&&l.push(k[m]);k=l}return k};e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(g){return g.getAttribute("href",2)}})();document.querySelectorAll&&function(){var e=i,g=document.createElement("div");g.innerHTML="<p class='TEST'></p>";if(!(g.querySelectorAll&&g.querySelectorAll(".TEST").length===0)){i=function(j,k,l,m){k=k||document;if(!m&&k.nodeType===9&&!r(k))try{return t(k.querySelectorAll(j),l)}catch(p){}return e(j,k,l,m)};i.find=e.find;i.filter=e.filter;i.selectors=e.selectors;i.matches=e.matches}}();document.getElementsByClassName&&document.documentElement.getElementsByClassName&&function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length!==0){e.lastChild.className="e";if(e.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(g,j,k){if(typeof j.getElementsByClassName!=="undefined"&&!k)return j.getElementsByClassName(g[1])}}}}();var z=document.compareDocumentPosition?function(e,g){return e.compareDocumentPosition(g)&16}:function(e,g){return e!==g&&(e.contains?e.contains(g):true)},r=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&r(e.ownerDocument)},B=function(e,g){for(var j=[],k="",l,m=g.nodeType?[g]:g;l=n.match.PSEUDO.exec(e);){k+=l[0];e=e.replace(n.match.PSEUDO,"")}e=n.relative[e]?e+"*":e;l=0;for(var p=m.length;l<p;l++)i(e,m[l],j);return i.filter(k,j)};c.find=i;c.filter=i.filter;c.expr=i.selectors;c.expr[":"]=c.expr.filters;i.selectors.filters.hidden=function(e){return e.offsetWidth===0||e.offsetHeight===0};i.selectors.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0};i.selectors.filters.animated=function(e){return c.grep(c.timers,function(g){return e===g.elem}).length};c.multiFilter=function(e,g,j){if(j)e=":not("+e+")";return i.matches(e,g)};c.dir=function(e,g){for(var j=[],k=e[g];k&&k!=document;){k.nodeType==1&&j.push(k);k=k[g]}return j};c.nth=function(e,g,j){g=g||1;for(var k=0;e;e=e[j])if(e.nodeType==1&&++k==g)break;return e};c.sibling=function(e,g){for(var j=[];e;e=e.nextSibling)e.nodeType==1&&e!=g&&j.push(e);return j}})();c.event={add:function(a,b,d,f){if(!(a.nodeType==3||a.nodeType==8)){if(a.setInterval&&a!=u)a=u;if(!d.guid)d.guid=this.guid++;if(f!==void 0){d=this.proxy(d);d.data=f}var h=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle")||c.data(a,"handle",function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(arguments.callee.elem,arguments):void 0});i.elem=a;c.each(b.split(/\s+/),function(n,o){var s=o.split(".");o=s.shift();d.type=s.slice().sort().join(".");var t=h[o];c.event.specialAll[o]&&c.event.specialAll[o].setup.call(a,f,s);if(!t){t=h[o]={};if(!c.event.special[o]||c.event.special[o].setup.call(a,f,s)===false)if(a.addEventListener)a.addEventListener(o,i,false);else a.attachEvent&&a.attachEvent("on"+o,i)}t[d.guid]=d;c.event.global[o]=true});a=null}},guid:1,global:{},remove:function(a,b,d){if(!(a.nodeType==3||a.nodeType==8)){var f=c.data(a,"events"),h;if(f){if(b===void 0||typeof b==="string"&&b.charAt(0)==".")for(var i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}c.each(b.split(/\s+/),function(n,o){var s=o.split(".");o=s.shift();var t=RegExp("(^|\\.)"+s.slice().sort().join(".*\\.")+"(\\.|$)");if(f[o]){if(d)delete f[o][d.guid];else for(var v in f[o])t.test(f[o][v].type)&&delete f[o][v];c.event.specialAll[o]&&c.event.specialAll[o].teardown.call(a,s);for(h in f[o])break;if(!h){if(!c.event.special[o]||c.event.special[o].teardown.call(a,s)===false)if(a.removeEventListener)a.removeEventListener(o,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+o,c.data(a,"handle"));h=null;delete f[o]}}})}for(h in f)break;if(!h){if(b=c.data(a,"handle"))b.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var h=a.type||a;if(!f){a=typeof a==="object"?a[C]?a:c.extend(c.Event(h),a):c.Event(h);if(h.indexOf("!")>=0){a.type=h=h.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[h]&&c.each(c.cache,function(){this.events&&this.events[h]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType==3||d.nodeType==8)return;a.result=void 0;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;var i=c.data(d,"handle");i&&i.apply(d,b);if((!d[h]||c.nodeName(d,"a")&&h=="click")&&d["on"+h]&&d["on"+h].apply(d,b)===false)a.result=false;if(!f&&d[h]&&!a.isDefaultPrevented()&&!(c.nodeName(d,"a")&&h=="click")){this.triggered=true;try{d[h]()}catch(n){}}this.triggered=false;if(!a.isPropagationStopped())(d=d.parentNode||d.ownerDocument)&&c.event.trigger(a,b,d,true)},handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||u.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=RegExp("(^|\\.)"+d.slice().sort().join(".*\\.")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var h in d){var i=d[h];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==void 0){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[C])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||document;if(a.target.nodeType==3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement==a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=document.documentElement;d=document.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:Q,teardown:function(){}}},specialAll:{live:{setup:function(a,b){c.event.add(this,b[0],O)},teardown:function(a){if(a.length){var b=0,d=RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],O)}}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=+new Date;this[C]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=M;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=M;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=M;this.stopPropagation()},isDefaultPrevented:L,isPropagationStopped:L,isImmediatePropagationStopped:L};var X=function(a){for(var b=a.relatedTarget;b&&b!=this;)try{b=b.parentNode}catch(d){b=this}if(b!=this){a.type=a.data;c.event.handle.apply(this,arguments)}};c.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){c.event.special[b]={setup:function(){c.event.add(this,a,X,b)},teardown:function(){c.event.remove(this,a,X)}}});c.fn.extend({bind:function(a,b,d){return a=="unload"?this.one(a,b,d):this.each(function(){c.event.add(this,a,d||b,d&&b)})},one:function(a,b,d){var f=c.event.proxy(d||b,function(h){c(this).unbind(h,f);return(d||b).apply(this,arguments)});return this.each(function(){c.event.add(this,a,f,d&&b)})},unbind:function(a,b){return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.event.proxy(a,b[d++]);return this.click(c.event.proxy(a,function(f){this.lastToggle=(this.lastToggle||0)%d;f.preventDefault();return b[this.lastToggle++].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b)},ready:function(a){Q();c.isReady?a.call(document,c):c.readyList.push(a);return this},live:function(a,b){var d=c.event.proxy(b);d.guid+=this.selector+a;c(document).bind(P(a,this.selector),this.selector,d);return this},die:function(a,b){c(document).unbind(P(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.extend({isReady:false,readyList:[],ready:function(){if(!c.isReady){c.isReady=true;if(c.readyList){c.each(c.readyList,function(){this.call(document,c)});c.readyList=null}c(document).triggerHandler("ready")}}});var R=false;c.each("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error".split(","),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)}});c(u).bind("unload",function(){for(var a in c.cache)a!=1&&c.cache[a].handle&&c.event.remove(c.cache[a].handle.elem)});(function(){c.support={};var a=document.documentElement,b=document.createElement("script"),d=document.createElement("div"),f="script"+(new Date).getTime();d.style.display="none";d.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var h=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!h||!h.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType==3,tbody:!d.getElementsByTagName("tbody").length,objectAll:!!d.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:i.style.opacity==="0.5",cssFloat:!!i.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(document.createTextNode("window."+f+"=1;"))}catch(n){}a.insertBefore(b,a.firstChild);if(u[f]){c.support.scriptEval=true;delete u[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function(){c.support.noCloneEvent=false;d.detachEvent("onclick",arguments.callee)});d.cloneNode(true).fireEvent("onclick")}c(function(){var o=document.createElement("div");o.style.width=o.style.paddingLeft="1px";document.body.appendChild(o);c.boxModel=c.support.boxModel=o.offsetWidth===2;document.body.removeChild(o).style.display="none"})}})();var H=c.support.cssFloat?"cssFloat":"styleFloat";c.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);var f=a.indexOf(" ");if(f>=0){var h=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b);f="POST"}var i=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(n,o){if(o=="success"||o=="notmodified")i.html(h?c("<div/>").append(n.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(h):n.responseText);d&&i.each(d,[n.responseText,o,n])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(f){return{name:b.name,value:f}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});var fa=+new Date;c.extend({get:function(a,b,d,f){if(c.isFunction(b)){d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return createHttpRequestObj()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(a){function b(){a.success&&a.success(n,i);a.global&&c.event.trigger("ajaxSuccess",[r,a])}function d(){a.complete&&a.complete(r,i);a.global&&c.event.trigger("ajaxComplete",[r,a]);a.global&&!--c.active&&c.event.trigger("ajaxStop")}a=c.extend(true,a,c.extend(true,{},c.ajaxSettings,a));var f,h=/=\?(&|$)/g,i,n,o=a.type.toUpperCase();if(a.data&&a.processData&&typeof a.data!=="string")a.data=c.param(a.data);if(a.dataType=="jsonp"){if(o=="GET")a.url.match(h)||(a.url+=(a.url.match(/\?/)?"&":"?")+(a.jsonp||"callback")+"=?");else if(!a.data||!a.data.match(h))a.data=(a.data?a.data+"&":"")+(a.jsonp||"callback")+"=?";a.dataType="json"}if(a.dataType=="json"&&(a.data&&a.data.match(h)||a.url.match(h))){f="jsonp"+fa++;if(a.data)a.data=(a.data+"").replace(h,"="+f+"$1");a.url=a.url.replace(h,"="+f+"$1");a.dataType="script";u[f]=function(k){n=k;b();d();u[f]=void 0;try{delete u[f]}catch(l){}t&&t.removeChild(v)}}if(a.dataType=="script"&&a.cache==null)a.cache=false;if(a.cache===false&&o=="GET"){h=+new Date;var s=a.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+h+"$2");a.url=s+(s==a.url?(a.url.match(/\?/)?"&":"?")+"_="+h:"")}if(a.data&&o=="GET"){a.url+=(a.url.match(/\?/)?"&":"?")+a.data;a.data=null}a.global&&!c.active++&&c.event.trigger("ajaxStart");h=/^(\w+:)?\/\/([^\/?#]+)/.exec(a.url);if(a.dataType=="script"&&o=="GET"&&h&&(h[1]&&h[1]!=location.protocol||h[2]!=location.host)){var t=document.getElementsByTagName("head")[0],v=document.createElement("script");v.src=a.url;if(a.scriptCharset)v.charset=a.scriptCharset;if(!f){var x=false;v.onload=v.onreadystatechange=function(){if(!x&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){x=true;b();d();v.onload=v.onreadystatechange=null;t.removeChild(v)}}}t.appendChild(v)}else{var z=false,r=a.xhr();a.username?r.open(o,a.url,a.async,a.username,a.password):r.open(o,a.url,a.async);try{a.data&&r.setRequestHeader("Content-Type",a.contentType);if(a.ifModified)r.setRequestHeader("If-Modified-Since",c.lastModified[a.url]||"Thu, 01 Jan 1970 00:00:00 GMT");r.setRequestHeader("X-Requested-With","XMLHttpRequest");r.setRequestHeader("Accept",a.dataType&&a.accepts[a.dataType]?a.accepts[a.dataType]+", */*":a.accepts._default)}catch(B){}if(a.beforeSend&&a.beforeSend(r,a)===false){a.global&&!--c.active&&c.event.trigger("ajaxStop");r.abort();return false}a.global&&c.event.trigger("ajaxSend",[r,a]);var e=function(k){if(r.readyState==0){if(g){clearInterval(g);g=null;a.global&&!--c.active&&c.event.trigger("ajaxStop")}}else if(!z&&r&&(r.readyState==4||k=="timeout")){z=true;if(g){clearInterval(g);g=null}i=k=="timeout"?"timeout":!c.httpSuccess(r)?"error":a.ifModified&&c.httpNotModified(r,a.url)?"notmodified":"success";if(i=="success")try{n=c.httpData(r,a.dataType,a)}catch(l){i="parsererror"}if(i=="success"){var m;try{m=r.getResponseHeader("Last-Modified")}catch(p){}if(a.ifModified&&m)c.lastModified[a.url]=m;f||b()}else c.handleError(a,r,i);d();k&&r.abort();if(a.async)r=null}};if(a.async){var g=setInterval(e,13);a.timeout>0&&setTimeout(function(){r&&!z&&e("timeout")},a.timeout)}try{r.send(a.data)}catch(j){c.handleError(a,r,null,j)}a.async||e();return r}},handleError:function(a,b,d,f){a.error&&a.error(b,d,f);a.global&&c.event.trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol=="file:"||a.status>=200&&a.status<300||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(a,b){try{var d=a.getResponseHeader("Last-Modified");return a.status==304||d==c.lastModified[b]}catch(f){}return false},httpData:function(a,b,d){var f=a.getResponseHeader("content-type");a=(f=b=="xml"||!b&&f&&f.indexOf("xml")>=0)?a.responseXML:a.responseText;if(f&&a.documentElement.tagName=="parsererror")throw"parsererror";if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string"){b=="script"&&c.globalEval(a);if(b=="json")a=u.eval("("+a+")")}return a},param:function(a){function b(h,i){d[d.length]=encodeURIComponent(h)+"="+encodeURIComponent(i)}var d=[];if(c.isArray(a)||a.jquery)c.each(a,function(){b(this.name,this.value)});else for(var f in a)c.isArray(a[f])?c.each(a[f],function(){b(f,this)}):b(f,c.isFunction(a[f])?a[f]():a[f]);return d.join("&").replace(/%20/g,"+")}});var N={},K,S=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a)return this.animate(E("show",3),a,b);else{for(var d=0,f=this.length;d<f;d++){var h=c.data(this[d],"olddisplay");this[d].style.display=h||"";if(c.css(this[d],"display")==="none"){h=this[d].tagName;var i;if(N[h])i=N[h];else{var n=c("<"+h+" />").appendTo("body");i=n.css("display");if(i==="none")i="block";n.remove();N[h]=i}c.data(this[d],"olddisplay",i)}}d=0;for(f=this.length;d<f;d++)this[d].style.display=c.data(this[d],"olddisplay")||"";return this}},hide:function(a,b){if(a)return this.animate(E("hide",3),a,b);else{for(var d=0,f=this.length;d<f;d++){var h=c.data(this[d],"olddisplay");!h&&h!=="none"&&c.data(this[d],"olddisplay",c.css(this[d],"display"))}d=0;for(f=this.length;d<f;d++)this[d].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";return c.isFunction(a)&&c.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(E("toggle",3),a,b)},fadeTo:function(a,b,d){return this.animate({opacity:b},a,d)},animate:function(a,b,d,f){var h=c.speed(b,d,f);return this[h.queue===false?"each":"queue"](function(){var i=c.extend({},h),n,o=this.nodeType==1&&c(this).is(":hidden"),s=this;for(n in a){if(a[n]=="hide"&&o||a[n]=="show"&&!o)return i.complete.call(this);if((n=="height"||n=="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(t,v){var x=new c.fx(s,i,t);if(/toggle|show|hide/.test(v))x[v=="toggle"?o?"show":"hide":v](a);else{var z=v.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),r=x.cur(true)||0;if(z){var B=parseFloat(z[2]),e=z[3]||"px";if(e!="px"){s.style[t]=(B||1)+e;r=(B||1)/x.cur(true)*r;s.style[t]=r+e}if(z[1])B=(z[1]=="-="?-1:1)*B+r;x.custom(r,B,e)}else x.custom(r,v,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem==this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:E("show",1),slideUp:E("hide",1),slideToggle:E("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return h.step(i)}this.startTime=+new Date;this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var h=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!K)K=setInterval(function(){for(var i=c.timers,n=0;n<i.length;n++)i[n]()||i.splice(n--,1);if(!i.length){clearInterval(K);K=void 0}},13)},show:function(){this.options.orig[this.prop]=c.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=+new Date;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]=true;for(var d in this.options.curAnim)if(this.options.curAnim[d]!==true)a=false;if(a){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(c.css(this.elem,"display")=="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var f in this.options.curAnim)c.attr(this.elem.style,f,this.options.orig[f]);this.options.complete.call(this.elem)}return false}else{d=b-this.startTime;this.state=d/this.options.duration;this.pos=c.easing[this.options.easing||(c.easing.swing?"swing":"linear")](this.state,d,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=a.now+a.unit;else a.elem[a.prop]=a.now}}});c.fn.offset=document.documentElement.getBoundingClientRect?function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return c.offset.bodyOffset(this[0]);var a=this[0].getBoundingClientRect(),b=this[0].ownerDocument,d=b.body;b=b.documentElement;return{top:a.top+(self.pageYOffset||c.boxModel&&b.scrollTop||d.scrollTop)-(b.clientTop||d.clientTop||0),left:a.left+(self.pageXOffset||c.boxModel&&b.scrollLeft||d.scrollLeft)-(b.clientLeft||d.clientLeft||0)}}:function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return c.offset.bodyOffset(this[0]);c.offset.initialized||c.offset.initialize();var a=this[0],b=a.offsetParent,d=a.ownerDocument,f,h=d.documentElement,i=d.body;d=d.defaultView;f=d.getComputedStyle(a,null);for(var n=a.offsetTop,o=a.offsetLeft;(a=a.parentNode)&&a!==i&&a!==h;){f=d.getComputedStyle(a,null);n-=a.scrollTop;o-=a.scrollLeft;if(a===b){n+=a.offsetTop;o+=a.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a.tagName))){n+=parseInt(f.borderTopWidth,10)||0;o+=parseInt(f.borderLeftWidth,10)||0}b=a.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&f.overflow!=="visible"){n+=parseInt(f.borderTopWidth,10)||0;o+=parseInt(f.borderLeftWidth,10)||0}f=f}if(f.position==="relative"||f.position==="static"){n+=i.offsetTop;o+=i.offsetLeft}if(f.position==="fixed"){n+=Math.max(h.scrollTop,i.scrollTop);o+=Math.max(h.scrollLeft,i.scrollLeft)}return{top:n,left:o}};c.offset={initialize:function(){if(!this.initialized){var a=document.body,b=document.createElement("div"),d,f,h,i=a.style.marginTop;d={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(f in d)b.style[f]=d[f];b.innerHTML='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;h=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=h.offsetTop===5;d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;a.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=a.offsetTop===0;a.style.marginTop=i;a.removeChild(b);this.initialized=true}},bodyOffset:function(a){c.offset.initialized||c.offset.initialize();var b=a.offsetTop,d=a.offsetLeft;if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseInt(c.curCSS(a,"marginTop",true),10)||0;d+=parseInt(c.curCSS(a,"marginLeft",true),10)||0}return{top:b,left:d}}};c.fn.extend({position:function(){var a;if(this[0]){a=this.offsetParent();var b=this.offset(),d=/^body|html$/i.test(a[0].tagName)?{top:0,left:0}:a.offset();b.top-=G(this,"marginTop");b.left-=G(this,"marginLeft");d.top+=G(a,"borderTopWidth");d.left+=G(a,"borderLeftWidth");a={top:b.top-d.top,left:b.left-d.left}}return a},offsetParent:function(){for(var a=this[0].offsetParent||document.body;a&&!/^body|html$/i.test(a.tagName)&&c.css(a,"position")=="static";)a=a.offsetParent;return c(a)}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){if(!this[0])return null;return f!==void 0?this.each(function(){this==u||this==document?u.scrollTo(!a?f:c(u).scrollLeft(),a?f:c(u).scrollTop()):this[d]=f}):this[0]==u||this[0]==document?self[a?"pageYOffset":"pageXOffset"]||c.boxModel&&document.documentElement[d]||document.body[d]:this[0][d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(h){return this[0]?c.css(this[0],d,false,h?"margin":"border"):null};var f=b.toLowerCase();c.fn[f]=function(h){return this[0]==u?document.compatMode=="CSS1Compat"&&document.documentElement["client"+b]||document.body["client"+b]:this[0]==document?Math.max(document.documentElement["client"+b],document.body["scroll"+b],document.documentElement["scroll"+b],document.body["offset"+b],document.documentElement["offset"+b]):h===void 0?this.length?c.css(this[0],f):null:this.css(f,typeof h==="string"?h:h+"px")}})})();

/*
 * Summary:Ϊ��$����ӷ���
 * 1. $.replaceAll(source, searchText,replaceText)
 * 2. $.format('{0}{1}{2}...', arg0,arg1,arg2,...)
 */
$.extend({ replaceAll: function (b, a, c) { return b.replace(RegExp(a, "gm"), c) }, format: function () { if (arguments.length == 0) return null; if (arguments.length == 1) return arguments[0]; for (var b = arguments[0], a = 1; a < arguments.length; a++) { var c = RegExp("\\{" + (a - 1) + "\\}", "gm"); b = b.replace(c, arguments[a]) } return b } });window._pre_defined_height_ = false;
function mynetShowDelay(n) {
    var a = document.getElementById('mynetcndelay' + n);
    document.getElementById('mynetdiv' + n).insertBefore(a, null);
    a.style.display = 'inline'; 
}

//以前老的弹出窗口函数
function Old_ShowModalDialogInFrame(Url, arg, post) {
    if (mynet_GetNavigator() == 'MSIE') {
        var ret;
        var parameter = "unadorned:1; dialogWidth:1px; dialogHeight:1px; status:0; resizable:1";
        if (arg != null) {
            var now = new Date();
            Url = UrlEncode(Url);
            var isPost = (post != null && post == true) ? '&postdialogarguments=1' : '';
            ret = window.showModalDialog(
                "/web/modaldialoginframe.aspx?t=" + now.toTimeString() + isPost + "&url=" + Url,
                arg, parameter);
        }
        else {
            var dialog = "/web/modaldialoginframe2.aspx?15";
            ret = window.showModalDialog(dialog,
                Url, parameter);
        }
        try {
            if (ret != null && ret == "____mynet_closeforlogin") {
                Url = window.location.href;
                window.navigate("/web/login.aspx?ReturnUrl=" + Url);
                ret = null;
            }
        }
        catch (e) {
        }

        return ret;
    }
    else {
        var openurl = Url;
        var ffarg = "menubar=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes";
        if (arg != null) {
            ffarg = ffarg + ',' + arg.replace(":", "=").replace(";", ",");
        }
        window.open(openurl, "", ffarg);
        return "";

    }
}
//windows对象操作函数

//Mynet弹出窗口
//para0:Url,弹出窗口Url;
//para1:arg,参数(eg:dialogHeight:440px;dialogWidth:600px;location=no;toolbar=no;status=no;resizable=no;scrollbars=no)
//para2:post,传递方法post=true时通过post方法传递到页面
//080522 createBy Mynet|signBy ls
function ShowModalDialogInFrame(Url, arg, post) {
    return mynet_ShowModalDialog(Url, '', 300, 150);
}

//Mynet弹出窗口  登录框
//para0:登录完成后是否关闭当前登录窗口 是请传递 true,否则传false.
//chengfeng.sue
function ShowLoginDialog(closeCurrent) {
    var url = "/web/login.aspx?closeCurrent=" + closeCurrent + "&ReturnUrl=/web/closedivdialog.htm";
    return mynet_ShowModalDialog(url, '', 300, 150);
}

function isParentInSameHostIframe(win) {
    try {
        if (win.parent != null &&
        win.parent.location.host == win.location.host &&
        win != win.parent
        ) {
            return true;
        }
    }
    catch (ex) {
        return false;
    }
    return false;
}
function isTop() {
    var currentWin = window;
    if (currentWin != mynet_getTopWindow()) {
        return false;
    }
    return true;
}

function mynet_GetTopWin() {
    var topWinManager = null;
    var win = window;
    //表示已经在Iframe里了，此时必须调用父窗口打开对话框
    while (win != null &&
    isParentInSameHostIframe(win)
     ) {
        win = win.parent;
    }
    if (win != null) {
        topWinManager = win._window;
    }
    else {
        topWinManager = _window;
    }
    topWinManager.ClassName = "VISTA";
    topWinManager.Timer = 0;

    return topWinManager;
}
//chengfeng.sue add for mynet run in the iframe
//please don't delete it
//function mynet_GetTopParentWindow() {
//    var win = window;
//    //表示已经在Iframe里了，此时必须调用父窗口打开对话框
//    while (win != null &&
//    isParentInSameHostIframe(win)
//     ) {
//        win = win.parent;
//    }
//    return win;
//}
//用来弹出DIV模拟对话框的函数。url,title,width,height参数和名称同义。buttons指窗口下方的按钮，可以定义上一步，下一步，确定，取消等
function mynet_ShowModalDialog(urlOrElementId, title, width, height, buttons, isIframeWin) {
    var topWinManager = mynet_GetTopWin();
    var content;
    //默认是带Ｉｆｒａｍｅ的弹出窗
    if (isIframeWin == true || isIframeWin == null) {
        content = "[url]" + urlOrElementId;
    }
    else {
        content = "[id]" + urlOrElementId; //将页面某个元素的内容弹出
    }
    width = width == null ? 300 : width;
    height = height == null ? 150 : height;

    var winbuttons = buttons;
    var features = "isModal=yea,width=" + width + ",height=" + height + ",button=" + winbuttons;
    var win = topWinManager.Open(content, title, features);
    var position = mynet_GetCenterPosition(width, height);
    if (win.isReady) {
        win.MoveTo(position.Left, position.Top);
    }
    return win;
}

function mynet_GetCenterPosition(w, h) {

    w = w == null ? 400 : w;
    h = h == null ? 1000 : h;
    var topWin = mynet_getTopWindow();
    var doc = topWin.document;
    var clientwidth = (topWin.innerWidth) ? topWin.innerWidth : (doc.documentElement && doc.documentElement.clientWidth) ? doc.documentElement.clientWidth : doc.body.offsetWidth;
    var clientheight = (topWin.parent.innerHeight) ? topWin.innerHeight : (doc.documentElement && doc.documentElement.clientHeight) ? doc.documentElement.clientHeight : doc.body.offsetHeight;


    var sLeft = (clientwidth - w) / 2;
    sLeft = sLeft < 0 ? 0 : sLeft;

    var sTop = (clientheight - h) / 2;
    sTop = sTop < 0 ? 0 : sTop;

    var scrollTop = doc.documentElement.scrollTop > doc.body.scrollTop ? doc.documentElement.scrollTop : doc.body.scrollTop;
    return { Left: sLeft, Top: sTop + scrollTop };
}

//用DIV来模拟Confirm的对话框
function mynet_Confirm(title, caption, content, width, height) {
    var topWinManager = mynet_GetTopWin();
    return mynet_BuildWinMsg(topWinManager, false, title, caption, content, width, height);
}

function mynet_BuildWinMsg(topWinManager, isAlert, title, caption, content, width, height, iconurl) {
    width = width == null ? 400 : width;
    height = height == null ? 140 : height;

    if (typeof (content) == "undefined") {
        content = "";
    }
    var icon = isAlert ? "http://res.mynet.cn/res/css/img/Viopenwindowicon_dui.gif" : "http://res.mynet.cn/res/css/img/Viopenwindowicon_1.gif";
    if (iconurl && iconurl != "") {
        icon = iconurl;
    }
    var message = "<div style='margin-left:20px;text-align:left;'><table cellpadding=0><tr><td width='63' valign='top'>";
    message = message + "<img src='" + icon + "' style='float:left;' /></td><td>";
    message = message + "<div style='float:left;margin-top:3px;'>";
    message = message + "<div class='VITitleText' style='text-align:left;margin-bottom:10px; margin-left:10px;font-family:Arial;'>";
    message = message + caption;
    message = message + "</div><div class='VIExplainText' style='margin-left:10px; color:#FF6600;'>"
    message = message + content;
    message = message + "</div></div></td></tr></table></div>";
    var features = "isModal=yea,width=" + width + ",height=" + height;

    var win = isAlert ? topWinManager.Alert(message, "信息提示", features) : topWinManager.Confirm(message, title, features);
    return win;
}

//用DIV来模拟ALert对话框   //huangsq 2010-12-14 注册时检测邮箱是否存在，如果存在，改换提示图片 加参数  content, width, height,state
/*
function mynet_Alert(caption, content, width, height,state) {
var topWinManager = mynet_GetTopWin();
if (content == null) {
content = ''; //注册时，检测邮箱，不判断的话，会出现null
}
if (!state) {
return mynet_BuildWinMsg(topWinManager, true, null, caption, content, width, height);
}
else {
return mynet_BuildWinMsg(topWinManager, false, null, caption, content, width, height);
}
}
*/
//iconurl：图标的url,可选参数
//iconurl add by huangjs 
function mynet_Alert(caption, content, width, height, state,iconurl) {
    return mynet_Alert_language(caption, content, width, height, state, "cn", iconurl)
}
function mynet_Alert_language(caption, content, width, height, state, language, iconurl) {
    var topWinManager = mynet_GetTopWin();
    switch (language) {
        case "en":
            topWinManager.Language = "en"; break;
        default:
            topWinManager.Language = "cn"; break;
    }
    if (content == null) {
        content = '';
    }
    if (!state) {
        return mynet_BuildWinMsg(topWinManager, true, null, caption, content, width, height, iconurl);
    }
    else {
        return mynet_BuildWinMsg(topWinManager, false, null, caption, content, width, height, iconurl);
    }
}

//DIV模拟对话框用来回调的函数。对话框里的网页，做完某件事情后，将结果传递回打开对话框的窗口
//winid: 窗口的唯一id,打开窗口时通过Url传递给iframe
//retObj，返回的javascript对象，可以是字符串，数组等
function mynet_ModalDialogCallBack(retObj) {
    var winid = getUrlParameter("winid");
    var topWinManager = mynet_GetTopWin();
    if (topWinManager.windows[winid] == null) {
        alert("错误：窗口已经被关闭，无法找到该窗口对象");
        return;
    }
    topWinManager.windows[winid].OnOKCallBack(retObj)
    topWinManager.windows[winid].Close();
}

//在弹出对话框内部网页，调用关闭DIV模拟弹出窗口的javascript
function mynet_ModalDialogClose() {
    if (window.dialogWidth) {
        window.close();
    }
    else {
        var winId = getUrlParameter("winid");
        var topWinManager = mynet_GetTopWin();
        var win = topWinManager.windows[winId];
        win.OnCloseCallBack();
        win.Close();
    }
}


function mynet_getTopWindow() {
    //     var topWinManager;
    //     //表示已经在Iframe里了，此时必须调用父窗口打开对话框
    //     if (window.parent != null) {
    //         topWinManager = window.parent;
    //     }
    //     else {
    //         topWinManager = window;
    //     }
    //     return topWinManager;
    var win = window;
    //表示已经在Iframe里了，此时必须调用父窗口打开对话框
    while (win != null &&
    isParentInSameHostIframe(win)
     ) {
        win = win.parent;
    }
    return win;
}

//总在顶层窗口打开链接
function mynet_openLinkTop(url) {
    mynet_getTopWindow().location.href = url;
}
//刷新页面
function mynet_refreshPageTop() {
    mynet_getTopWindow().location.reload();
}
//设置弹出窗口时大小
//para0:w,弹出窗宽度;
//para1:h,弹出窗高度;
//080522 createBy Mynet|signBy ls
function centerSize(w, h) {
    //证明是模式对话框
    if (window.dialogWidth) {
        if (window.location.href.indexOf("noresize") != -1) return;
        var sLeft = (window.screen.availWidth - w) / 2 + "px";
        var sTop = (window.screen.availHeight - h) / 2 + "px";
        var sWidth = w + "px";
        var sHeight = h + "px";

        dialogLeft = sLeft + "px";
        dialogWidth = sWidth;
        dialogTop = sTop + "px";
        dialogHeight = sHeight;

    }
    else { //否则是DIV模拟对话框
        var winId = getUrlParameter("winid");
        var topWinManager = mynet_GetTopWin();
        var win;
        if (winId != "") { //参数里有winid
            win = topWinManager.windows[winId];
        }
        else { //尝试找最后一个
            win = topWinManager.windows[topWinManager.Ids[topWinManager.Ids.length - 1]];
        }

        // Fix by allex, skip when page not being opened in dialog.
        if (win) {
            var widthDiff = w - win.width, heightDiff = h - win.height, position = mynet_GetCenterPosition(w, h);
            win.MoveTo(position.Left, position.Top);
            win.ResizeBy(widthDiff, heightDiff);
        }
    }
}
//获取下拉框的值
function getDropDownListValue(obj) {
    return obj.options[obj.selectedIndex].value;
}
//设置下拉框的值
function setDropDownListValue(obj, value) {
    for (var i = 0; i < obj.options.length; i++) {
        if (obj.options[i].value == value) {
            obj.options[i].selected = true;
            break;
        }
    }
}
//构造changedData

function mynet_buildChangedData() {
    var designData = "<r>";
    var objs = document.getElementsByTagName("input");
    var obj, previewfield;
    //解决IE9不支持.previewfield属性，造成不能预览。
    for (var i = 0; i < objs.length; i++) {
        obj = objs[i];
        previewfield = obj.getAttribute("previewfield");
        //if(typeof(previewfield)!="undefined"){
        if (previewfield != null) {
            designData = designData + "<" + previewfield + "><![CDATA[" + obj.value + "]]></" + previewfield + ">";
        }
    }
    objs = document.getElementsByTagName("select")
    //解决IE9不支持.previewfield属性，造成不能预览。;
    for (var i = 0; i < objs.length; i++) {
        //var obj=objs[i];
        obj = objs[i];
        previewfield = obj.getAttribute("previewfield");
        //if(typeof(obj.previewfield)!="undefined"){
        if (previewfield != null) {
            designData = designData + "<" + previewfield + "><![CDATA[" + getDropDownListValue(obj) + "]]></" + previewfield + ">";
        }
    }
    designData = designData + "</r>";
    return designData;
}

//这个是在预览的情况下使用的，避免重复调用服务器
var mynet_oldDesignData;
//预览控件 参数1：控件名称 参数2：预览区的DIV对象参数3：是否强制预览，也就是不检验两次预览的数据是否一致
function mynet_previewAspect(aspectTypeName, previewAreaDiv, force) {
    var designData = mynet_buildChangedData();
    mynet_previewAspect1(aspectTypeName, previewAreaDiv, focus, designData);
}

//预览控件 参数1：控件名称 参数2：预览区的DIV,对象参数3：是否强制预览，也就是不检验两次预览的数据是否一致
function mynet_previewAspect1(aspectTypeName, previewAreaDiv, force, designData) {
    var url = "/admin/previewaspect.aspx";
    if (designData != mynet_oldDesignData || force == true)//如果数据不一样，才调用
    {
        var formPost = new mynet_FormDataPoster(url);
        formPost.AddFormKeyValue("data", designData);
        formPost.AddFormKeyValue("typename", aspectTypeName);
        var retvalue = formPost.Post();
        mynet_SetInnerHTML(previewAreaDiv, retvalue);
    }
    mynet_oldDesignData = designData;
}
function mynet_AddSession(k, v) {
    var url = "/admin/sessionmanager.aspx";
    var formPost = new mynet_FormDataPoster(url);
    if (k != "") {
        formPost.AddFormKeyValue("o", "a");
        formPost.AddFormKeyValue("k", k);
        formPost.AddFormKeyValue("v", v);
        formPost.Post();
    }
}
function mynet_RemoveSession(k) {
    var url = "/admin/sessionmanager.aspx";
    var formPost = new mynet_FormDataPoster(url);
    if (k != "") {
        formPost.AddFormKeyValue("o", "r");
        formPost.AddFormKeyValue("k", k);
        formPost.Post();
    }

}

//设定checkboxList的值，多字段搜索使用的
function mynet_setCheckBoxListValue(hiddenFieldID, chkBox) {
    var hiddenField = document.getElementById(hiddenFieldID);
    var arr = hiddenField.value.split(",");
    if (chkBox.checked) {
        arr.push(chkBox.value);
    } else {
        removeElementInArray(chkBox.value, arr);
    }
    hiddenField.value = arr.join(",");
};
//从数组里移除一个元素
function removeElementInArray(element, sourceArray) {
    for (var i = 0; i < sourceArray.length; i++) {
        if (sourceArray[i] == element) {
            sourceArray.splice(i, 1);
            break;
        }
    }
}


function getElementIndexOfArray(element, sourceArray) {
    for (var i = 0; i < sourceArray.length; i++) {
        if (sourceArray[i] == element) {
            return i;
        }
    }
    return -1;
}
//将商品加入购物车
function shopbuy(pid, mode) {
    var skuList = [];
    var skuQuantityList = [];
    if (typeof (mynet_sku_displayControlList) != "undefined") {
        for (var i = 0; i < mynet_sku_displayControlList.length; i++) {
            skuList.push(mynet_sku_displayControlList[i].skuId);
            skuQuantityList.push(mynet_sku_displayControlList[i].quantity);
            if (mynet_sku_displayControlList[i].mynet_checkBuyerChoose() == false) {
                return;
            }
        }
    }
    if (skuList.length > 0) {
        mode = "@@sku||" + skuList.join(',') + "@@quantity||" + skuQuantityList.join(',');
    } else {
        mode = "";
        var modelNames = new Array();
        var inputs = document.getElementsByTagName("input");
        for (var i = 0; i < inputs.length; i++) {
            var input = inputs[i];
            if (typeof (input.isModelValue) != "undifined" && input.isModelValue == "true" && input.ownerID == pid) {
                var isExist = false;
                for (var j = 0; j < modelNames.length; j++) {
                    if (modelNames[j] == input.filedname) {
                        isExist = true;
                        break;
                    }
                }
                if (isExist == false) {
                    modelNames.push(input.filedname);
                    mode += "@@" + input.modelName + "||" + input.value;
                }
            }
        }
    }
    if (mode.length > 2) {
        mode = mode.substr(2, mode.length);
    }
    mode = escape(mode);
    //chengfeng.sue 如产品无SKU设置，mode也为空，此处多一次判断。
    //目前暂无其他方案
    if (mode == "") {

        $.get("/plugin/Purchase/method.ashx", { method: "checkproduct_sku", productId: pid, tmp: Math.random() },
      function (result) {

          result = eval('(' + result + ')');

          if (result.IsSussess == false) {
              alert(result.Message);
          }
          else {
              if (result.Result == "YES") {
                  mynet_openLinkTop("_d" + pid + ".htm");
              }
              else {
                  var url = '/plugin/Purchase/shoppingsolution.aspx?id=' + pid + '&specstring=' + mode + '&type=add&tmp=' + Math.random();
                  httpRequestFunc(url,
                    function () {
                        var returnurl = window.location.href;

                        if (returnurl.toLowerCase().indexOf("design2.aspx") > 0) {
                            returnurl = returnurl.replace(/design2.aspx/, "design.aspx")
                        }
                        mynet_openLinkTop("/_d50.htm" + "?retUrl=" + escape(returnurl))
                    });
              }
          }
      });
    }
    else {
        var url = '/plugin/Purchase/shoppingsolution.aspx?id=' + pid + '&specstring=' + mode + '&type=add&tmp=' + Math.random();
        httpRequestFunc(url,
                    function (data) {
                        var result = eval('(' + data + ')');
                        if (result.IsSuccess) {
                            mynet_openLinkTop("/_d50.htm" + "?retUrl=" + escape(window.location.href));
                        }
                        else {
                            alert(result.Message);
                        }
                    });

    }
}

//删除评论和文章
function onDeleteDoc(id, doctypename) {

    var win = ShowModalDialogInFrame('/plugin/doc/docdelete.aspx?docid=' + id + "&doctypename=" + doctypename);
    win.OnOKCallBack = function (ret) {
        if (ret != null) {
            window.location.href = window.location.href;
        }
    }

}
//编辑DOC
function onEditDocument(id) {
    var win = ShowModalDialogInFrame('/plugin/doc/docedit.aspx?docid=' + id);
    win.OnOKCallBack = function (ret) {
        if (ret != null) {
            refreshDocList();
        }
    }
}

//商品图片分类控件使用的函数
function postDocImageCategory(categoryID, categoryName, siteUrl, aspectUID, curDocUID, mergedDocId, isPublishMod, hiddenid) {
    //更改显示的分类名称
    var categoryNameDiv = document.getElementById("docCategoryName");
    categoryNameDiv.innerHTML = categoryName;

    //更改隐藏规格值
    var hiddenInput = document.getElementById(hiddenid);
    if (hiddenInput != null) {
        hiddenInput.value = categoryName;
    }

    var selectImage = document.getElementById("docCategoryImage_" + categoryID);
    clearDocImageBorder();
    selectImage.border = 1;

    var subjectDate = new mynet_SubjectDataPoster(siteUrl, aspectUID, curDocUID, mergedDocId, isPublishMod, "docImageList");
    subjectDate.AddFormKeyValue("categoryID", categoryID);

    subjectDate.Post();
}
//选择图片更改
function clearDocImageBorder() {
    var images = document.getElementsByName("selectDocCategoryImage");
    for (var i = 0; i < images.length; i++) {
        var imgae = images[i];
        imgae.border = 0;
    }
}

//多字段搜索使用的函数
function postSearchConditions(siteUrl, aspectUID, curDocUID, isPublishMod) {
    var subjectData = new mynet_SubjectDataPoster(siteUrl, aspectUID, curDocUID, '0', isPublishMod, "onAdvanceSearch");
    var aspectContainer = document.getElementById("mynetcndelay" + aspectUID);
    if (aspectContainer == null) {
        alert("当前页面的预览状态才支持高级搜索！");
        return;
    }
    var formInputs = aspectContainer.getElementsByTagName("INPUT");
    var index = 0;
    for (var i = 0; i < formInputs.length; i++) {
        var inputItem = formInputs[i];
        //只处理文本框以及hidden的表单控件
        if (typeof (inputItem.attributes['isvaluefield']) != "undefined" && inputItem.attributes['isvaluefield'].nodeValue == "true") {
            subjectData.AddFormKeyValue("advanceSearchParam" + index, inputItem.value);
            index++;
        }
    }
    //再将搜索的字段名以及字段类型传过去
    _pre_defined_height_ = false;
    subjectData.Post();
}

function propertyListCondition(siteUrl, aspectUID, curDocUID, isPublishMod, searchValue) {
    var subjectData = new mynet_SubjectDataPoster(siteUrl, aspectUID, curDocUID, 0, isPublishMod, "onClickPropertyList");
    var aspectContainer = document.getElementById("mynetcndelay" + aspectUID);
    if (aspectContainer == null) {
        alert("当前页面的预览状态才支持属性列表！");
        return;
    }
    subjectData.AddFormKeyValue("listparam1", searchValue);
    subjectData.Post();
}

//设定window.onload
//para0:func,传入函数，想要在window.onload执行的函数
//080522 createBy Mynet|signBy ls
function addWindowOnload(func) {
    var prev = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    }
    else {
        window.onload = function () {
            if (prev) prev();
            func();
        }
    }
}

//获取QueryString 使用方法：http://xxx.mynet.cn/xxx.aspx?x=abc 获取 QueryString()["x"]=abc
//080526 createBy lisi|signBy lisi
function QueryString() {//构造参数对象并初始化
    return new QueryStringParser(window.location.href);
}
function QueryStringParser(url) {
    var num = url.indexOf("?")
    url = url.substr(num + 1); //截取“?”后面的参数串
    var arrtmp = url.split("&"); //将各参数分离形成参数数组 

    for (i = 0; i < arrtmp.length; i++) {
        num = arrtmp[i].indexOf("=");
        if (num > 0) {
            name = arrtmp[i].substring(0, num); //取得参数名称 
            value = arrtmp[i].substr(num + 1); //取得参数值 
            this[name] = value; //定义对象属性并初始化 
        }
    }
    this.RemoveKey = function (key) {
        var newStr = "";
        for (i = 0; i < arrtmp.length; i++) {
            num = arrtmp[i].indexOf("=");
            if (num > 0) {
                name = arrtmp[i].substring(0, num); //取得参数名称
                if (name != key) {
                    value = arrtmp[i].substr(num + 1); //取得参数值 
                    newStr += name + "=" + value + "&";
                }
            }
        }
        if (newStr != "") {
            newStr = newStr.substring(0, newStr.length - 1);
        }
        return newStr;
    }
}

function createHttpRequestObj() {
    var objHttpRequest = null;
    try {
        objHttpRequest = new ActiveXObject('Msxml2.XMLHTTP');
    } catch (e) {
        try {
            objHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        } catch (E) {
            try {
                objHttpRequest = new XMLHttpRequest();
            } catch (ex)
                { }
        }
    }
    return objHttpRequest;
}

//获取httpRequest
//para0:url,获取httprequest的Url
//para1:func,传入函数，想要在objHttpRequest.readyState == 4 && objHttpRequest.status == 200执行的函数，不传入的话return responseText
//080603 createBy lisi|signBy lisi
function httpRequestFunc(url, func) {
    var objHttpRequest = createHttpRequestObj();
    this.action = 'GET';
    this.formData = null;
    if (objHttpRequest == null)
        return null;
    if (objHttpRequest) {
        objHttpRequest.open(this.action, url, true);
        var lastModify = new Date();
        lastModify.setFullYear(1900, 1, 1);
        objHttpRequest.setRequestHeader("If-Modified-Since", lastModify);
        objHttpRequest.onreadystatechange = function () {
            if (objHttpRequest.readyState == 4 &&
            objHttpRequest.status == 200) {
                if (typeof (func) == "function")
                    func(objHttpRequest.responseText);
                else
                    return objHttpRequest.responseText;
            }
        };
    }
    objHttpRequest.send(this.formData);
}

//获取httpRequest
//para0:url,获取httprequest的Url
//080603 createBy mynet|signBy lisi
function httpRequest(url) {
    var objHttpRequest = createHttpRequestObj();
    this.action = 'GET';
    this.formData = null;

    if (objHttpRequest == null)
        return null;

    objHttpRequest.open(this.action, url, false);
    var lastModify = new Date();
    lastModify.setFullYear(1900, 1, 1);
    objHttpRequest.setRequestHeader("If-Modified-Since", lastModify);
    objHttpRequest.send(this.formData);
    var retvalue = objHttpRequest.responseText;
    return retvalue;
}

function UrlEncode(str) {
    str = escape(str);
    return str;
}



String.prototype.getBytes = function () {
    var cArr = this.match(/[^\x00-\xff]/ig);
    return this.length + (cArr == null ? 0 : cArr.length);
}

// Initializes a new instance of the StringBuilder class
// and appends the given value if supplied
function StringBuilder(value) {
    this.strings = new Array("");
    this.Append(value);
}
// Appends the given value to the end of this instance.
StringBuilder.prototype.Append = function (value) {
    if (value) {
        this.strings.push(value);
    }
}
// Clears the string buffer
StringBuilder.prototype.clear = function () {
    this.strings.length = 1;
}
// Converts this instance to a String.
StringBuilder.prototype.ToString = function () {
    return this.strings.join("");
}

// see http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/23ddbc2448fef853/4a0123c93965eef5?lnk=st&q=XHTML+scrollTOP&rnum=7&hl=zh-CN#4a0123c93965eef5
function getScrollTop(target) {
    return getScrollPos(target, false);
}
//获取某个元素的
function getScrollPos(target, isLeft) {
    if (target == null)
        target = window;
    var doc = target.document;

    var scrollPos = 0;
    try {
        if (typeof target.pageYOffset != 'undefined') {
            scrollPos = isLeft ? target.pageXOffset : target.pageYOffset;
        }
        if (scrollPos == 0 && typeof doc.compatMode != 'undefined' && doc.compatMode != 'BackCompat') {
            scrollPos = isLeft ? doc.documentElement.scrollLeft : doc.documentElement.scrollTop;
        }
        if (scrollPos == 0 && typeof doc.body != 'undefined') {
            scrollPos = isLeft ? doc.body.scrollLeft : doc.body.scrollTop;
        }
    }
    catch (e) {
    }
    return scrollPos;
}

function getScrollLeft(target) {
    return getScrollPos(target, true);
}

/*
* mynetResizeTheme ，mynetResizeTheme2 页面调用 次数，时机：
* 1. mynetResizeTheme  在window_onload 前后都会掉用。 
* 2. 以前的机制是mynetResizeTheme调用后直接调用 mynetResizeTheme2，在 mynetResizeTheme2中判断 “当前” 与 “上一次” 时间差是否小于500ms，若条件满足则不调用
*    这样在页面一次加载时 会调用很多次mynetResizeTheme2  
* 3. 现在是在页面完全加载后按次调用 mynetResizeTheme2，页面加载前，都不会调用。减少了调用次数。
*/

var watcherRunning = false;
function mynetResizeTheme() {
    if (typeof resetBackgroundHeight == 'function' &&
                mynetResizeTheme.caller == resetBackgroundHeight) {
        mynetResizeTheme2(); return;

    }
    if (watcherRunning) { return; }
   
    watcherRunning = true;
    mynet.utils.dom.watcher(function () {
       mynetResizeTheme2();
        if (mynet.utils.browser.quirks) {
            setTimeout(function () {
                mynetResizeTheme2();
            }, 5000);
        }
        watcherRunning = false;
    });
}


function setAspectColumnHeight(height) {
    try {
        if (Mynet_AspectColumnId != null) {
            var a = $('#' + Mynet_AspectColumnId);
            var oldHeight = a.css('min-height');
            height = Math.max(height, oldHeight.substr(0, oldHeight.length - 2));
            a.children().css('min-height', height + 'px');
        }
    }
    catch (e) {
    }
}


var Mynet_AspectColumnId = null; // 用来标记排版中使用的AspectColumn.AspectID, 在mynetResizeTheme2()中动态调整它的尺寸。
// 根据URL判断是否是在设计模式下
var _designMode_ = window.location.href.indexOf("design2.aspx") > -1;
/*
* 由于此函数计算内容区高度比较慢（多次调用并操作DOM），在页面较长时会导致页面底部先显示，
* 所以在设计时把页面高度先保存起来，浏览时直接使用
*/
function mynetResizeTheme2() {
  //  debugger;
    //使用预先定义的高度 ,并且不是设计模式时 , 并且是IE时 无需计算内容区高度直接返回
    if ( _pre_defined_height_ && !_designMode_ && mynet.utils.browser.msie) { return; }


	var panel = document.getElementById('mynetAspectPanel');
    if (panel == null) {
        panel = document.getElementById('mynetAspectPanelResize');
        if (panel == null)
            return;
    }
    //对于<span id="mynetAspectPanel" style="position:relative">elements</span>
    //在IE8 标准模式下elements 不会相对于 这个span 定位,因为 span 是行内元素。
    //所以要解决这个问题应该把span display属性修改成block
    if(mynet.utils.browser.msie8 && !mynet.utils.browser.quirks){
        $(panel).css("display","block");
    }

    var aspects = panel.childNodes;

    var div = document.getElementById('mynetAspectPanelDiv');
    if (div == null)
        div = panel;

    var divHeight = document.getElementById('mynetAspectPanelHeight');
    if (divHeight == null) {
        divHeight = panel.parentNode;
        divHeight.id = 'mynetAspectPanelHeight';
    } 
    //divHeight.style.height = '0px';初始为0px时，会造成页面滚动条跳动问题，divHeight高度在会下面赋值。所以注释掉词句；
    divHeight.vAlign = "top";

    // 防止控件高度太高，在浏览器的上面。
    var minTop = null;
    if (document.readyState == 'complete') { // 只在页面完成时调用
        try { minTop = Mynet_ObjectTop(document.getElementById('spanThemeBegin')) - Mynet_ObjectTop(panel); } catch (e) { }
    }

    var height = 200, t = 0; //panel.offsetHeight;   
    var minLeft = 0;

    setAspectColumnHeight(0); // 先把排版控件高度设为0，否则高度只会大，不会小。
   
    for (var i = 0; i < aspects.length; i++) {
        var one = aspects[i];
        if (one.style && one.tagName.toLowerCase()!="script") {
            try {
                if (minTop != null && minTop < 0 && one.style.pixelTop < minTop) one.style.top = minTop;
            }
            catch (e) { }

            //var offHeight = one.offsetHeight;
            //IE9出现offHeight与实际高度不符，所以使用scrollHeight
            var offHeight = one.scrollHeight;
              //alert('h:' + one.scrollHeight + '----ch:'+ mynet.utils.dom.getCurrentStyle(one, 'height',true) + '\nt:' + one.offsetTop + '----ct:' + mynet.utils.dom.getCurrentStyle(one, 'top',true));          

            var overflow = one.style.overflow;
            if (!$.browser.msie && (overflow.toLowerCase() == 'visible' || overflow == '')) { // 计算底部高度

                one.style.overflow = 'auto';
                offHeight = one.scrollHeight;
                one.style.overflow = overflow;
            }
            //fix opera 下计算top不正确
            t = !mynet.utils.browser.opera ? one.offsetTop : mynet.utils.dom.getCurrentStyle(one, 'top', true);

            if (t + offHeight + 0 > height) {
                height = t + offHeight + 0;
            }

            try {
                if (one.style.pixelLeft < minLeft) minLeft = one.style.pixelLeft
            }
            catch (e) { }
        }
    }

    var oldOverFlow = divHeight.style.overflow;
    if (!$.browser.msie && (oldOverFlow.toLowerCase() == 'visible' || oldOverFlow == '')) { // 计算底部高度
        divHeight.style.overflow = 'auto';
        if (divHeight.scrollHeight > height)
            height = divHeight.scrollHeight;
        divHeight.style.overflow = oldOverFlow;
    }

    // 修改内容区的高度
    divHeight.style.height = height + 'px';

 
    //设计模式下保存当前页面高度 
    if (_designMode_) {
        var publishPage = $(window.parent.document.getElementById("toolBarConver")).is(":visible");
        $.ajax({
          type: "GET",
          url: "/admin/BodyHeight.aspx" ,
          data: { 'docid': _docUID, 'h': height, 'pub':publishPage }
        });
    }
    setAspectColumnHeight(height);

    if (document.getElementById('spanMasterTemplateBackgroundBody') != null) {
        var spanBg = document.getElementById('spanMasterRepeat');
        var bkImage = spanBg.style.backgroundImage;
        if (!(bkImage == "initial" || bkImage == "none")) {
            var index1 = bkImage.lastIndexOf('.');
            var index2 = bkImage.lastIndexOf(')');
            var extName = bkImage.substr(index1 + 1, index2 - index1 - 1);

            // 获取原来的themeid
            var themeid = bkImage.split('_')[3];

            // 获得新背景url
            var backgroundBody = document.getElementById('tdMasterTemplateBackgroundBody');

            var bodyHeight = 0;
            if (backgroundBody) {
                //由于ie 解释 height 是按 min-height解释的，height可以被撑开 ，但其他浏览器 height 就是height ，影响布局，所以去掉height属性
                if (!mynet.utils.browser.msie) {
                    var h = $(backgroundBody).height();
                    var sl = ";" + $(backgroundBody).attr("style") + ";";
                    sl = sl.replace("height:", "min-height:");
                    $(backgroundBody).attr("style", sl);
                    $(divHeight).css("min-height", h);
                }
                bodyHeight = backgroundBody.offsetHeight;
            }
            var url = 'url(_m_masterpagebackground_' + themeid + '_Repeat_' + bodyHeight + "." + extName + ')';
            if (bkImage != url) {
                spanBg.style.backgroundImage = url;
            }
        }
    }
    mynetCheckAspectPosition();  
}

function mynetCheckAspectPosition() {
    if (document.readyState != 'complete') // 只有在loaded是才判断，否则有可能当时对象位置不对，错误把它内容下移了。
        return;
    var s = document.getElementsByTagName('DIV');
    for (var i = 0; i < s.length; i++) {
        var e = s[i];
        if (e.style.position == 'absolute' && e.id.length > 7 && e.id.substr(0, 7) == 'aspect_') {

            var t = Mynet_ObjectTop(e);
            if (t < 0)
                e.style.top = e.style.pixelTop - t;
        }
    }
}

function removeOptions(obj) {
    var len = obj.options.length;
    for (var i = 0; i < len; i++) {
        obj.options.remove(0);
    }
}
function AddToCar(SiteId, PageId, StandardInputName) {
    ShowOrderCar(SiteId);
}

function ShowOrderCar() {
    window.alert("点击这里，将显示购物车。");
}

function XmlDoc() {
    var tXmlDoc = false;
    if (window.ActiveXObject) {
        var tMsXmlDomType = [/*"Msxml2.DOMDocument.5.0",*/"MSXML2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"];
        for (var i = 0; i < tMsXmlDomType.length; i++) {
            try {
                tXmlDoc = new ActiveXObject(tMsXmlDomType[i]);

                var pi = xmldoc.createProcessingInstruction(xml, version = "1.0", encoding = "ISO-8859-1");
                tXmlDoc.appendChild(pi);
                tXmlDoc.setProperty("SelectionLanguage", "XPath");
                break;
            } catch (ex) { }
        }
    } else if (document.implementation && document.implementation.createDocument) {
        tXmlDoc = document.implementation.createDocument("", "", null);
        if (!tXmlDoc.load) {  // for safari
            tXmlDoc.hp = new XMLHttpRequest();
            tXmlDoc.hp.hpOwner = tXmlDoc;
            tXmlDoc.hp.load = function (sUrl) {
                try {
                    this.open("GET", sUrl, this.async);
                    this.send(null);
                } catch (ex) {
                    throw "you can't connect the page using different domain,if you not config the Server-Side code";
                }
                if (this.readyState == 4) {
                    var _result = this.responseXML;
                    while (this.hpOwner.hasChildNodes())
                        this.hpOwner.removeChild(this.hpOwner.lastChild);
                    for (var i = 0; i < _result.childNodes.length; i++) {
                        this.hpOwner.appendChild(this.hpOwner.importNode(_result.childNodes[i], true));
                    }
                }
            }
            tXmlDoc.load = function (sUrl) {
                tXmlDoc.hp.load(sUrl);
            }
            tXmlDoc.selectNodes = function (sXPath) {// tagName/[@]
                //var _all = sXPath.split("//")
                this.getElementsByTagName();
            }
        }
    }
    if (!tXmlDoc) {
        throw ("Can not create xml doc object!");
    }
    return tXmlDoc;
}
function reloadPage() {
    window.location.reload();
}

function reloadDialog() {
    var url = window.location.href;
    if (url.indexOf("noresize=1") < 0) {
        if (url.indexOf('?') == -1)
            url = url + '?';
        else
            url = url + '&';
        url = url + "noresize=1";
    }
    window.navigate(url);
}

var windowLoadedFuncArray = new Array();

function addWindowLoadedFunc(func) {
    windowLoadedFuncArray[windowLoadedFuncArray.length] = func;
}

function windowLoaded() {
   // $("img").attr("src", "http://res.mynet.cn/res/plugin/bbs/images/nophoto.gif");
   // alert(1);
    //window.alert('windowLoadedFuncArray.length=' + windowLoadedFuncArray.length);
    for (var i = 0; i < windowLoadedFuncArray.length; i++) {
        var func = windowLoadedFuncArray[i];
        func();
    }

    annimations();
}

function Mynet_ObjectDim(el) {
    for (var lx = 0, ly = 0; el != null; lx += el.offsetLeft, ly += el.offsetTop, el = el.offsetParent) {
        if (el.tagName.toLowerCase() == 'div' && el.style.position == 'relative') {
            ly = ly - el.offsetTop;
            var top = el.offsetTop;
            ly = ly + (el.offsetTop - el.scrollTop);
        }
        else if (el.tagName != 'BODY') {
            ly -= el.scrollTop;
        }
    }
    return { x: lx, y: ly }
}

// 计算指定对象在document中的位置，考虑滚动条的情况。
function Mynet_ObjectLeft(o) {
    return getElementPos(o).x;
}

// 计算指定对象在document中的位置，考虑滚动条的情况。
function Mynet_ObjectTop(o) {
    return getElementPos(o).y;
}

function getElementPos(el) {
    var ua = navigator.userAgent.toLowerCase();
    var isOpera = (ua.indexOf('opera') != -1);
    var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof      
    // var el = document.getElementById(elementId);      
    if (el.parentNode == null || el.style.display == 'none') {
        return false;
    }
    var parent = null;
    var pos = [];
    var box;
    if (el.getBoundingClientRect)    //IE     
    {
        box = el.getBoundingClientRect();
        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
        return { x: box.left + scrollLeft, y: box.top + scrollTop };
    }
    else if (document.getBoxObjectFor)    // gecko     
    {
        box = document.getBoxObjectFor(el);
        var borderLeft = (el.style.borderLeftWidth) ? parseInt(el.style.borderLeftWidth) : 0;
        var borderTop = (el.style.borderTopWidth) ? parseInt(el.style.borderTopWidth) : 0;
        pos = [box.x - borderLeft, box.y - borderTop];
    }
    else    // safari & opera     
    {
        pos = [el.offsetLeft, el.offsetTop];
        parent = el.offsetParent;
        if (parent != el) {
            while (parent) {
                pos[0] += parent.offsetLeft;
                pos[1] += parent.offsetTop;
                parent = parent.offsetParent;
            }
        }
        if (ua.indexOf('opera') != -1 || (ua.indexOf('safari') != -1 && el.style.position == 'absolute')) {
            pos[0] -= document.body.offsetLeft; pos[1] -= document.body.offsetTop;
        }
    }
    if (el.parentNode) {
        parent = el.parentNode;
    }
    else {
        parent = null;
    }

    while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors         
        pos[0] -= parent.scrollLeft;
        pos[1] -= parent.scrollTop;
        if (parent.parentNode)
        { parent = parent.parentNode; }
        else { parent = null; }
    }
    return { x: pos[0], y: pos[1] };
}
//justify a string is integer or not
function IsInt(objStr, sign, zero) {
    var reg;
    var bolzero;
    if (Trim(objStr) == "") {
        return false;
    }
    else {
        objStr = objStr.toString();
    }
    if ((sign == null) || (Trim(sign) == "")) {
        sign = "+-";
    }
    if ((zero == null) || (Trim(zero) == "")) {
        bolzero = false;
    }
    else {
        zero = zero.toString();
        if (zero == "0") {
            bolzero = true;
        }
        else {
            alert("检查是否包含0参数，只可为(空、0)");
        }
    }
    switch (sign) {
        case "+-":
            //整数
            reg = /(^-?|^\+?)\d+$/;
            break;
        case "+":
            if (!bolzero) {
                //正整数

                reg = /^\+?[0-9]*[1-9][0-9]*$/;
            }
            else {
                //正整数+0
                //reg=/^\+?\d+$/;
                reg = /^\+?[0-9]*[0-9][0-9]*$/;
            }
            break;
        case "-":
            if (!bolzero) {
                //负整数

                reg = /^-[0-9]*[1-9][0-9]*$/;
            }
            else {
                //负整数+0
                //reg=/^-\d+$/;
                reg = /^-[0-9]*[0-9][0-9]*$/;
            }
            break;
        default:
            alert("检查符号参数，只可为(空、+、-)");
            return false;
            break;
    }

    var r = objStr.match(reg);
    if (r == null) {
        return false;
    }
    else {
        return true;
    }
}

// Sets cookie values. Expiration date is optional 
// 
function setCookie(name, value, expire) {
    document.cookie = name + "=" + escape(value)
  + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}


function getCookie(Name) {
    var search = Name + "="
    if (document.cookie.length > 0) { // if there are any cookies 
        offset = document.cookie.indexOf(search)
        if (offset != -1) { // if cookie exists 
            offset += search.length
            // set index of beginning of value 
            end = document.cookie.indexOf(";", offset)
            // set index of end of cookie value 
            if (end == -1)
                end = document.cookie.length
            return unescape(document.cookie.substring(offset, end))
        }
    }
}


function deleteCookie(name, path, domain) {
    if (getCookie(name)) document.cookie = name + "=" +
      ((path) ? ";path=" + path : "") +
      ((domain) ? ";domain=" + domain : "") +
      ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function LTrim(str) {
    var whitespace = new String(" \t\n\r");
    var s = new String(str);

    if (whitespace.indexOf(s.charAt(0)) != -1) {
        var j = 0, i = s.length;
        while (j < i && whitespace.indexOf(s.charAt(j)) != -1) {
            j++;
        }
        s = s.substring(j, i);
    }
    return s;
}


function RTrim(str) {
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(s.length - 1)) != -1) {
        var i = s.length - 1;
        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) {
            i--;
        }
        s = s.substring(0, i + 1);
    }
    return s;
}


function Trim(str) {
    return RTrim(LTrim(str));
}


function mynetVoteOpenWin(opertype, openpath, voteguid, msgWhenNoSelected) {

    var frmvote = document.getElementById('frmvote_' + voteguid);

    if (frmvote == null) return;

    var radios = frmvote.getElementsByTagName("input");
    var selecvalue = "";
    if (radios != null && radios.length > 0) {
        for (var i = 0; i < radios.length; i++) {
            if ((radios[i].type == "radio" || radios[i].type == "checkbox") && radios[i].checked) {
                selecvalue = selecvalue + radios[i].value + "|";
                if (opertype == 1)
                    radios[i].checked = false;
            }
        }
        if (selecvalue != "")
            selecvalue = selecvalue.substr(0, selecvalue.length - 1);
    }
    if (opertype == 1 && selecvalue == "") {
        alert(msgWhenNoSelected);
        return false;
    }
    window.open(openpath + "?t=" + opertype + "&auid=" + voteguid + "&svalue=" + selecvalue, "kk", "top=200,left=300,width=450,height=300;toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
    return false;

}

function setMynetCopyrightYear(item) {
    setCopyrightYear(item, "2005");
}

function setCopyrightYear(item, startYear) {
    if (item == null) return;
    if (item.constructor == String) {
        item = document.getElementById(item);
    }
    if (item == null) return;
    var thisYear = new Date();
    thisYear = thisYear.getYear().toString();
    if (thisYear == startYear) {
        item.innerHTML = startYear;
    }
    else {
        item.innerHTML = startYear + "-" + thisYear;
    }
}

function mynetAddBookmarkByUrl(title, Url) {
    if (title == null)
        title = "Mynet.cn我的空间";

    if (window.sidebar) {
        window.sidebar.addPanel(title, Url, "");
    }
    else if (document.all) {
        window.external.AddFavorite(Url, title);
    }
    else if (window.opera && window.print) {
        return true;
    }
}

function mynetAddBookmark(title) {
    if (title == null)
        title = "Mynet.cn我的空间";

    var url = document.location.href;
    if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    }
    else if (document.all) {
        window.external.AddFavorite(url, title);
    }
    else if (window.opera && window.print) {
        return true;
    }
}

function mynetSetCopy(_sTxt) {
    try {
        clipboardData.setData('Text', _sTxt)
        window.alert('您已经把该网址（' + _sTxt + '）复制到系统剪贴板，您可以使用（Ctrl+V或鼠标右键）粘贴功能，通过QQ、MSN或其他聊天工具发送给您的朋友。');
    }
    catch (e) {
    }
}

//通用函数将某个字符，从通过逗号分割的字符串中移出
function RemoveStrFromIds(strIds, strCategoryId) {
    if (strIds.indexOf("," + strCategoryId + ",") != -1) {
        strIds = strIds.replace("," + strCategoryId + ",", ",");

    }
    else if (strIds.indexOf(strCategoryId + ",") == 0)//第一个栏目
    {
        strIds = strIds.replace(strCategoryId + ",", "");
    }
    else if (strIds.indexOf("," + strCategoryId) == (strIds.length - strCategoryId.length - 1) && (strIds.length - strCategoryId.length - 1) > -1)//最后一个
    {
        strIds = strIds.replace("," + strCategoryId, "");

    }
    else if (strIds.indexOf(strCategoryId) == 0 && strCategoryId.length == strIds.length)//只有一个
    {

        strIds = "";
    }

    return strIds;
}

function AddIdToStrIds(id, strIds) {
    if (IsIdInStrIds(id, strIds) == false) {
        if (strIds != null && strIds != "") {
            strIds += ",";
        }
        strIds += id;
    }
    return strIds;
}

//判断一个字符串是否在另外一个字符串中
function IsIdInStrIds(id, strIds) {
    var IsAuto = false;
    var arrIntAuto = strIds.split(",");
    var arrIntAutoLen = arrIntAuto.length;
    for (var i = 0; i < arrIntAutoLen; i++) {

        if (arrIntAuto[i] == id) {
            IsAuto = true;
            break;
        }
    }
    return IsAuto;
}

//替换字符串中的某个Id
function ReplaceId(strIds, newId, oldId) {
    var arrIntAuto = strIds.split(",");
    var arrIntAutoLen = arrIntAuto.length;
    for (var i = 0; i < arrIntAutoLen; i++) {

        if (arrIntAuto[i] == oldId) {
            arrIntAuto[i] = newId;
            break;
        }
    }
    var newStrIds = "";
    for (var k = 0; k < arrIntAutoLen; k++) {
        if (newStrIds != "") {
            newStrIds += ",";
        }
        newStrIds += arrIntAuto[k];
    }
    return newStrIds;
}


var DS_x, DS_y;
function TextToJson(txt) {  //将JSON文本转为JSON对象
    var func = new Function("return " + txt);
    var json = func();
    return json;
}
function dsMove(obj)  //实现层的拖移
{
    if (event.button == 1) {
        var X = obj.clientLeft;
        var Y = obj.clientTop;
        obj.style.pixelLeft = X + (event.x - DS_x);
        obj.style.pixelTop = Y + (event.y - DS_y);
    }
}
function mynetSelectAllCheckBox(boxName, isChecked) {
    var chkFeedCates = document.getElementsByName(boxName);
    var len = chkFeedCates.length;
    for (var i = 0; i < len; i++) {
        chkFeedCates[i].checked = isChecked;
    }
}



// 显示更多颜色的对话框
// 如果按取消按钮，返回null
// 如果清空，则返回''
// 否则返回指定颜色。返回值和defColor都带前面的'#', 例如红色为'#ff0000'
function showColorDlg(defColorOrColorElement, hiddenField) {
    var isOldVersion = (defColorOrColorElement != null && typeof (defColorOrColorElement) == 'object');
    var defColor = isOldVersion
        ? defColorOrColorElement.style.backgroundColor // 旧版本，给出一个显示颜色的object
        : defColorOrColorElement; // 新版本，就是颜色。
    var win = ShowModalDialogInFrame("http://res.mynet.cn/res/ColorSelector.htm", defColor);
    win.OnOKCallBack = function (ret) {
        if (isOldVersion && ret != null) {
            defColorOrColorElement.style.backgroundColor = "";
            if (hiddenField != null)
                hiddenField.value = "";
        }
    }

    return ret;
}

var arrFloats = new Array();
function annimations() {
    var len = arrFloats.length;
    //首先全部停止，避免多次调用
    for (var i = 0; i < len; i++) {
        arrFloats[i].stopFlow();
    }
    //然后再全部开始
    for (var i = 0; i < len; i++) {
        arrFloats[i].mynetFlow();
    }
}

function getFirstParent(obj, tagName) {
    if (obj == null)
        return null;
    var objtmp = obj.parentNode;
    while (objtmp != null) {
        if (objtmp.tagName == tagName) {
            return objtmp;
        }
        else {
            objtmp = objtmp.parentNode;
        }
    }
}

// 悬浮对象 {{{ 
function pensileElement(id, oTarget, delay, position, showClose,closeText) {

    var me = this;
    this.oHtml = null;
    this.oTarget = oTarget;
    this.x = Mynet_ObjectLeft(oTarget);
    this.y = Mynet_ObjectTop(oTarget);
    this.position = position;
    this.id = id;
    this.__closeHook = null;
    this.mynetFlow = function () {
        var obj = this;
        if (!this.oHtml) {
            var oHtml = this.oTarget, pos = $(oHtml).offset();
            document.body.insertBefore(oHtml, document.body.childNodes[0]);
            var bodyOffWidth = document.body.offsetWidth;
            var bodyOffHeight = document.body.offsetHeight;
            this.height = parseInt(oHtml.offsetHeight);
            switch (obj.position) {
                case "fromtop":
                    this.x = pos.left;
                    this.y = pos.top;
                    break;
                case "rightbottom":
                    this.x = bodyOffWidth - oHtml.offsetWidth - 20;
                    this.y = bodyOffHeight - oHtml.offsetHeight;
                    break;
                case "righttop":
                    this.x = bodyOffWidth - oHtml.offsetWidth - 20;
                    this.y = 0;
                    break;
                case "lefttop":
                    {
                        this.x = 0;
                        this.y = 0;
                        break;
                    }
                case "leftbottom":
                    {
                        this.x = 0;
                        this.y = bodyOffHeight - oHtml.offsetHeight;
                    }
            }
            this.oHtml = oHtml;
            this.oHtml.refFloatElement = this;
            this.oHtml.style.left = this.x;
            this.oHtml.style.top = this.y;
            this.oHtml.style.display = "inline";
            this.startY = this.y;
            //悬浮层初始时，被遮挡的高度。
            this.startOverHeight = oHtml.offsetHeight - (bodyOffHeight - this.startY);
            this.startOverHeight = this.startOverHeight > 0 ? this.startOverHeight : 0;

        }
        this.IntervalObj = setInterval(function () {
            var ns = (navigator.appName.indexOf("Netscape") != -1);
            var bodyHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
            var pY = parseInt(ns ? pageYOffset : getScrollTop(obj.oHtml));
            /// 减去初始被遮挡的高度startOverHeight
            obj.y += parseInt((pY + obj.startY - obj.y - obj.startOverHeight) / 4);
            if (obj.y > bodyHeight - obj.height) {
                obj.y = bodyHeight - obj.height;
            }
            //防止超过启示位置
            obj.y = obj.y > obj.startY ? obj.y : obj.startY;
            obj.oHtml.style.top = obj.y + "px";
        }, delay);
        if (showClose) {
            this.oHtml.onmouseover = function () {
                showCloseSign(this, closeText);
            }
            this.oHtml.onmouseout = function () {
                var closeSign = me.__closeHook;
                if (closeSign) {
                    closeSign.style.display = "none";
                }
            }
        }
    }
    this.stopFlow = function () {
        clearInterval(this.IntervalObj);
    }
} // }}} 

// 让某个对象由小变大 {{{
function smallToLargeElement(id, oTarget, delay, speed, showClose,closeText) {
    var me = this;
    this.oHtml = oTarget;
    this.oHtml.refFloatElement = me;
    this.width = parseInt(this.oHtml.width);
    this.height = parseInt(this.oHtml.height);
    this.id = id;
    this.__closeHook = null;

    this.mynetFlow = function () {
        var obj = this, x = 0, y = 0;
        this.IntervalObj = setInterval(function () {
            x += speed;
            y += speed;
            if (x < obj.width) {
                obj.oHtml.style.width = x + "px";
            }
            if (y < obj.height) {
                obj.oHtml.style.height = y + "px";
            }
            if (y > obj.height && x > obj.width) {
                obj.stopFlow();
            }
        }, delay)
    }
    this.stopFlow = function () {
        clearInterval(this.IntervalObj);
    }
    if (showClose) {
        this.oHtml.onmouseover = function () {
            showCloseSign(this,closeText);
        }
        this.oHtml.onmouseout = function () {
            var closeSign = me.__closeHook;
            if (closeSign) closeSign.style.display = "none";
        }
    }
} // }}}

function showCloseSign(obj,closeText) {// {{{
    if (!obj.refFloatElement) throw Error('Can not find the reference of target element');

    var target = obj.refFloatElement, closeSign = target.__closeHook;
    if (!closeSign) {
        closeSign = document.createElement("div");
        closeSign.style.backgroundColor = 'silver';
        closeSign.style.display = "none";
        closeSign.innerHTML = "<span style='cursor:pointer;'>"+closeText+"</span>";
        closeSign.style.position = "absolute";
        target.__closeHook = document.body.appendChild(closeSign);
    }
    closeSign.onmouseover = function () {
        closeSign.style.display = "inline";
        target.stopFlow();
    }
    closeSign.onmouseout = function () {
        closeSign.style.display = "none";
        target.mynetFlow();
    }

    var offset = $(target.oHtml).offset();
    var x = offset.left + $(obj).width() - 25;
    var y = offset.top + $(obj).height() - 5;

    if (x > 0) {
        closeSign.style.left = x + "px";
    }
    if (y > 0) {
        closeSign.style.top = y + "px";
    }
    closeSign.style.zIndex = 15;
    closeSign.style.display = "inline";
    closeSign.onclick = function () {
        obj.style.display = "none";
        closeSign.style.display = "none";
    };
} // }}}

function pushMyentFlowElement(flowElement) {
    var len = arrFloats.length;
    var exist = false;
    for (var i = 0; i < len; i++) {
        if (arrFloats[i].id == flowElement.id) {
            arrFloats[i] = flowElement;
            exist = true;
            break;
        }
    }

    if (exist == false) {
        arrFloats.push(flowElement);
    }
}

// 漂浮对象 @ horizontal, vertical {{{
function floatElement(id, oTarget, delay, speed, flagX, flagY, showClose,closeText) {
    var me = this;
    this.oHtml = oTarget;
    this.id = id;
    this.oHtml.refFloatElement = me;
    this.delay = delay;
    this.flagX = flagX;
    this.flagY = flagY;
    this.speed = speed;
    this.IntervalObj = null;
    this.__closeHook = null;

    this.mynetFlow = function () { 
        var obj = this;
        var pos1 = getElementPos(obj.oHtml);
        var iStartLeft = parseInt(obj.oHtml.style.left) - pos1.x;
        var iStartTop = parseInt(obj.oHtml.style.top) - pos1.y;
        var bWidth = Math.max(document.documentElement.clientWidth, document.body.clientWidth) - 10;
        var bHeight = Math.max(document.documentElement.clientHeight, document.body.clientHeight);
        var iWidth = obj.oHtml.offsetWidth;
        var iHeight = obj.oHtml.offsetHeight;

        // 由于控件莫明其秒的变大 变小，加入此行代码设置一下控件的宽度，浮动时大小便不再变化
        obj.oHtml.style.width = iWidth + "px";
        this.IntervalObj = setInterval(function () {
            var iLeft = parseInt(obj.oHtml.style.left);
            var iTop = parseInt(obj.oHtml.style.top);

            // 下面一段控制横向移
            if (iLeft - iStartLeft <= (bWidth - iWidth) && obj.flagX == 0) {
                obj.oHtml.style.left = (iLeft + obj.speed) + "px";
            }
            else if (iLeft - iStartLeft > (bWidth - iWidth) && obj.flagX == 0) {
                obj.flagX = 1;
            }
            else if (iLeft >= iStartLeft && obj.flagX == 1) {
                obj.oHtml.style.left = (iLeft - obj.speed) + "px";
            }
            else if (iStartLeft > iLeft && obj.flagX == 1) {
                obj.flagX = 0;
            }

            // 下面一段控制纵向移
            if (iTop - iStartTop <= (bHeight - iHeight) && obj.flagY == 0) {
                obj.oHtml.style.top = (iTop + obj.speed) + "px";
            }
            else if (iTop - iStartTop > (bHeight - iHeight) && obj.flagY == 0) {
                obj.flagY = 1;
            }
            else if (iTop >= iStartTop && obj.flagY == 1) {
                obj.oHtml.style.top = (iTop - obj.speed) + "px";
            }
            else if (iStartTop > iTop && obj.flagY == 1) {
                obj.flagY = 0;
            }
        }, delay);
    }
    this.stopFlow = function () {
        clearInterval(this.IntervalObj)
    }
    this.oHtml.onmouseover = function () {
        this.refFloatElement.stopFlow();
        if (showClose) showCloseSign(this,closeText);
    }
    this.oHtml.onmouseout = function () {
        var closeSign;
        this.refFloatElement.mynetFlow();
        if (showClose && (closeSign = me.__closeHook)) {
            closeSign.style.display = "none";
        }
    }
} // }}}

function filenameWithoutExtension(path) {
    var index = path.lastIndexOf("/");
    if (index < 0) {
        index = path.lastIndexOf("\\");
    }
    var filename = path.substr(index + 1);
    index = filename.lastIndexOf(".");
    if (index < 0) {
        return filename;
    }
    else {
        return filename.substr(0, index);
    }
}

//function for aspect turn page

function GetPageAspectContent(aspUID, docUID, curPage, parameter) {

    parameter = '' + parameter;
    var frmId = aspUID.replace(/-/g, '_');
    var strUrl = "/Aspect/GetAspectPageContent.aspx";
    strUrl += '?auid=' + aspUID + '&docuid=' + docUID + '&curPid=' + curPage;
    var divContent = document.getElementsByName('divContent_' + aspUID);
    //没有设置滚动时dicContent.length==0;此时FireFox下是得不到的
    if (divContent.length == 0) {
        divContent = document.getElementById('divContent_' + aspUID);
    }
    if (divContent != null) {
        divContent.innerHTML = "<img src='http://res.mynet.cn/res/loading.gif\' border='0' />正在读取数据...";
    }
    if (parameter.indexOf('=') > 0 && parameter.indexOf('p=') == -1) {
        strUrl += '&' + parameter;
    }
    else if (parameter != '') {
        strUrl += '&p=' + parameter;
    }

    //before 2008-6-26, using iframe to implement turn page.
    //now,using XmlHttpRequest to turn page
    var mynetPoster = new mynet_FormDataPoster(strUrl);
    var postedData = document.getElementById("mynet_CSubjectParameter_" + frmId);
    if (postedData != null) {
        mynetPoster.AddFormKeyValue("mynet_CSubjectParameter", postedData.value);
    }
    var retData = mynetPoster.Post();
    setTimeout(function showdata() { mynet_dealTurnPageData(retData, divContent) }, 10);
}



function mynet_FormDataPoster(postUrl) {
    var formDatas = new Array;
    var formKeys = new Array;
    //构造Form对象
    this.AddFormKeyValue = function (key, value) {
        formDatas[key] = value;
        formKeys.push(key);
    }

    this.GetFormDatas = function () {
        return formDatas;
    }

    this.builderDatas = function () {
        var len = formKeys.length;
        var postStr = "";
        for (var i = 0; i < len; i++) {
            if (postStr != "") {
                postStr += "&";
            }
            postStr += escape(formKeys[i]) + "=" + escape(formDatas[formKeys[i]]);
        }
        return postStr;
    }

    this.Post = function () {
        var objHttpRequest = createHttpRequestObj();
        postUrl = postUrl.replace(/([^=&?]+)=([^=&?]+)/ig, function (m, k, v) { return k + "=" + encodeURIComponent(v); });
        objHttpRequest.open("POST", postUrl, false);
        objHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
        objHttpRequest.send(this.builderDatas());
        var retvalue = objHttpRequest.responseText;
        return retvalue;
    }
}

//联动数据客户端发送器
function mynet_SubjectDataPoster(siteUrl, aspectUID, docUID, mergedDocId, isPublishMode, eventName) {
    this.SiteUrl = siteUrl;
    this.AspectUID = aspectUID;
    this.DocUID = docUID;
    this.IsPublishMode = isPublishMode;
    this.EventName = eventName;
    this.MergedDocId = mergedDocId;

    var formDatas = new Array;
    var formKeys = new Array;
    //构造Form对象
    this.AddFormKeyValue = function (key, value) {
        formDatas[key] = value;
        formKeys.push(key);
    }

    this.GetFormDatas = function () {
        return formDatas;
    }

    this.builderDatas = function () {
        var len = formKeys.length;
        var postStr = "";
        for (var i = 0; i < len; i++) {
            if (postStr != "") {
                postStr += "&";
            }
            postStr += escape(formKeys[i]) + "=" + escape(formDatas[formKeys[i]]);
        }
        return postStr;
    }

    this.Post = function () {
        var postKey = [];
        var postData = [];
        //在Post之前，可能当前控件自己已经有联动参数，也需要一起传到服务器做合并处理
        $('input[id^=mynet_CSubjectParameter_]').each(function () {
            if (jQuery.inArray(this.id, postKey) < 0) {
                postKey.push(this.id);
                postData.push(this.value);
            }
        });
        if (postKey.length > 0) {
            for (var i = 0; i < postKey.length; i++) {
                this.AddFormKeyValue(postKey[i], postData[i]);
            }
        }
        var url = this.SiteUrl + "/aspect/aspectCascading.aspx?aspectuid=" + aspectUID + "&docuid=" + docUID + "&mdocuid=" + mergedDocId + "&ev=" + eventName + "&m=" + isPublishMode;
        var currentUrl = location.href;
        var parameters = currentUrl.substring(currentUrl.indexOf('?') + 1);
        if (parameters != '') {
            var parametersList = parameters.split('&');
            for (var i = 0; i < parametersList.length; i++) {
                if (parametersList[i].indexOf('c') == 0 && parametersList[i].indexOf('=') == 1 && parametersList[i].split('=').length == 2) {
                    url = url + "&c=" + parametersList[i].split('=')[1];
                }
                if (parametersList[i].indexOf('k') == 0 && parametersList[i].indexOf('=') == 1 && parametersList[i].split('=').length == 2) {
                    url = url + "&k=" + parametersList[i].split('=')[1];
                }
            }
        }


        $.post(url, this.builderDatas(), function (result) {
            mynet_dealCascadingData(result);
        }, "text");
    }
}

function mynet_dealTurnPageData(xmlDocString, divContent) {

    var docDom = new mynet_XmlDom();
    var isIE = mynet_GetNavigator() == "MSIE";
    if (isIE) {
        docDom.loadXML(xmlDocString);
    }
    else if (document.implementation && document.implementation.createDocument) {
        var xmlObj = new DOMParser();
        var docRoot = xmlObj.parseFromString(xmlDocString, "text/xml");
        docDom = docRoot;
    }

    var nodeList = docDom.documentElement.childNodes;
    var len = nodeList.length;
    for (var i = 0; i < len; i++) {
        var aspectUID = nodeList[i].getAttribute("uid");
        var strHtml = isIE ? nodeList[i].text : nodeList[i].textContent;
        if (strHtml != "") {

            if (divContent.tagName)//得到单一DIV
            {
                mynet_SetInnerHTML(divContent, strHtml);
            }
            else {//when scroll cloned serval content doms
                var len = divContent.length; //多个滚动对象
                for (var i = 0; i < len; i++) {
                    mynet_SetInnerHTML(divContent[i], strHtml);
                }
            }
        }
    }
    _pre_defined_height_ = false;
    mynetResizeTheme();
}

//处理从服务器端返回 
function mynet_dealCascadingData(xmlDocString) {
    var docDom = new mynet_XmlDom();
    // alert(xmlDocString);
    docDom.loadXML(xmlDocString);
    var nodeList = docDom.documentElement.childNodes;
    var len = nodeList.length;
    var isIE = mynet_GetNavigator() == "MSIE";
    for (var i = 0; i < len; i++) {
        var aspectUID = nodeList[i].getAttribute("uid");

        var conetentElement = mynet_GetAspectContentElement(aspectUID)
        if (conetentElement == null)
        { continue; }

        var contentElementParentNode = conetentElement.parentNode;
        var strInnerHTTML = isIE ? nodeList[i].text : nodeList[i].textContent;
        mynet_SetInnerHTML(conetentElement, strInnerHTTML);
    }
    mynetResizeTheme();
}

function mynet_GetAspectContentElement(aspectUID) {
    var contentElement = document.getElementById("divCascading_" + aspectUID);
    return contentElement;
}

function mynet_SetInnerHTML(el, htmlCode) {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0) {
        htmlCode = '<div style="display:none">for IE</div>' + htmlCode;
        htmlCode = htmlCode.replace(/<script([^>]*)>/gi,
                                 '<script$1 defer>');
        el.innerHTML = '';
        el.innerHTML = htmlCode;
        el.removeChild(el.firstChild);
    }
    else {
        $(el).empty();
        $(el).html(htmlCode);
    }
}


//XMLDOM 相关开始=====================
//浏览器兼容的XmlDom模型
function mynet_XmlDom() {
    return XmlDoc();
}

function mynet_GetNavigator() {
    var OsObject = "";
    if (navigator.userAgent.indexOf("MSIE") > 0) {
        return "MSIE";
    }
    if (navigator.userAgent.indexOf("Firefox") > 0) {
        return "Firefox";
    }
    if (navigator.userAgent.indexOf("Safari") > 0) {
        return "Safari";
    }
    if (navigator.userAgent.indexOf("Camino") > 0) {
        return "Camino";
    }
    if (navigator.userAgent.indexOf("Gecko") > 0) {
        return "Gecko";
    }

}

function mynet_GetIeVersion() {
    var reg = new RegExp("MSIE ([^;]*);", "i");
    if (reg.test(navigator.appVersion)) return parseInt(RegExp.$1);
    return 0;
}
//兼容chrome by cuiyekang
if ((navigator.userAgent.indexOf("Firefox") > 0 || navigator.userAgent.indexOf("Mozilla") >= 0) && !$.browser.msie) {
    Document.prototype.readyState = 0;
    Document.prototype.onreadystatechange = null;
    Document.prototype.__changeReadyState__ = function (iReadyState) {
        this.readyState = iReadyState;
        if (typeof this.onreadystatechange == "function") {
            this.onreadystatechange();
        }
    };
    //初始化parseError对象
    Document.prototype.__initError__ = function () {
        this.parseError.errorCode = 0;
        this.parseError.filepos = -1;
        this.parseError.line = -1;
        this.parseError.linepos = -1;
        this.parseError.reason = null;
        this.parseError.srcText = null;
        this.parseError.url = null;
    };

    Document.prototype.__checkForErrors__ = function () {
        if (this.documentElement.tagName == "parsererror") {
            var reError = "/>([\s\S]*?)Location:([\s\S]*?)Line Number (\d+),Column (\d+):<sourcetext>([\s\S]*?)(?:\-*\^)/";
            var regular = new RegExp(reError);
            regular.test(this.xml);
            this.parseError.errorCode = -999999;
            this.parseError.reason = RegExp.$1;
            this.parseError.url = RegExp.$2;
            this.parseError.line = parseInt(RegExp.$3);
            this.parseError.linepos = parseInt(RegExp.$4);
            this.parseError.srcText = RegExp.$5;
        };
    };

    //定义Mozilla的loadXML方法   
    Document.prototype.loadXML = function (sXml) {

        //兼容ff和chrome by cuiyekang
        if (sXml.indexOf("<datas>") < 0) {
            this.__initError__();
        }
        //this.__changeReadyState__(1);
        var oParser = new DOMParser();
        var oXmlDom = oParser.parseFromString(sXml, "text/xml");
        while (this.firstChild) {
            this.removeChild(this.firstChild);
        }
        for (var i = 0; i < oXmlDom.childNodes.length; i++) {
            var oNewNode = this.importNode(oXmlDom.childNodes[i], true);
            this.appendChild(oNewNode);
        }
        //载入后检查错误
        this.__checkForErrors__();
        //没有问题，设置readyState属性为4
        //this.__changeReadyState__(4);

    };
    Document.prototype.__load__ = Document.prototype.load;
    Document.prototype.load = function (sURL) {
        this.__initError__();
        this.__changeReadyState__(1);
        this.__load__(sURL);
    };
    Node.prototype.__defineGetter__("xml", function () {
        var oSerializer = new XMLSerializer();
        return oSerializer.serializeToString(this, "text/xml");
    });
}
//XMLDOM 相关结束==========
// window.attachEvent("onload",correctPNG); 
//end funtion for aspect turn page

//add a remote javascript file dynamicly
function mynet_LoadRemoteJs(id, url) {
    var script = document.getElementById(id);
    var head = document.getElementsByTagName('head').item(0);
    if (script == null) {
        script = document.createElement('script');
        script.src = url;
        script.type = 'text/javascript';
        script.id = id;
        head.appendChild(script);
    }
    return script;
}

//页面载入时调用
function mynet_pageonload(pagename) {
    var mynet_productdocpageCount = eval('pageCount_' + pagename);
    var mynet_productdocpageCurrent = eval('pageCurrent_' + pagename);

    //mynet_productdocpageCount=document.getElementById("pagenation_"+pagename).innerHTML;
    mynet_productdocpageCurrent = 1;
    var r = /^\+?[1-9][0-9]*$/;
    if (!r.test(mynet_productdocpageCurrent) || parseInt(mynet_productdocpageCurrent) > parseInt(mynet_productdocpageCount)) {
        mynet_productdocpageCurrent = 1;
    }
    if (mynet_productdocpageCount > 0) {
        document.getElementById('page_' + pagename + '1').style.display = 'none';
        document.getElementById('page_' + pagename + mynet_productdocpageCurrent).style.display = 'block';

        mynet_pageSet(pagename);
        document.getElementById('pagenation_' + pagename).style.display = 'block';
    }
}
function mynet_pageSet(pagename) {

    var mynet_productdocpageCount = eval('pageCount_' + pagename);
    var mynet_productdocpageCurrent = eval('pageCurrent_' + pagename);

    var pagehtml = "";
    var pagesize = 10;
    pagehtml = "<div style='text-align:center;word-break: break-all; line-height:20px;'>";
    pagehtml = pagehtml + mynet_pageModel1(pagesize, mynet_productdocpageCurrent, mynet_productdocpageCount, pagename);
    pagehtml = pagehtml + "</div>";
    document.getElementById("pagenation_" + pagename).innerHTML = pagehtml;
}
function mynet_pageModel1(pagesize, crrentPage, pageCount, pagename) {
    var mynet_productdocpageCount = eval('pageCount_' + pagename);
    var mynet_productdocpageCurrent = eval('pageCurrent_' + pagename);
    var pagenavigation = "";
    var i = 0;
    if (crrentPage > 1)
        pagenavigation += '<a href=\'javascript:void(0);\' onclick=\'javascript:mynet_pagenation(' + 'pageCurrent_' + pagename + '-1,"' + pagename + '")\'><<</a>';
    for (i = 1; i <= pageCount; i++) {
        if (i == crrentPage) {
            pagenavigation += "<span class='current' >" + i + "</span>";
        }
        else {
            pagenavigation += '<a href=\'javascript:void(0);\'  onclick=\'javascript:mynet_pagenation(' + i + ',"' + pagename + '")\'>' + i + '</a>';
        }
    }
    if (parseInt(crrentPage) < parseInt(pageCount))
        pagenavigation += '<a href=\'javascript:void(0);\'  onclick=\'javascript:mynet_pagenation(' + 'pageCurrent_' + pagename + '+1,"' + pagename + '")\'>>></a>';
    return pagenavigation;
}
function mynet_pageModel2(pagesize, crrentPage, pageCount, pagename) {
    var mynet_productdocpageCount = eval('pageCount_' + pagename);
    var mynet_productdocpageCurrent = eval('pageCurrent_' + pagename);

    var pagenavigation = "";
    var i = 0;
    var tmp = Div(pagesize, 2);
    var startpage;
    var endpage;
    startpage = crrentPage - tmp;
    if (startpage < 1) {
        startpage = 1;
    }
    endpage = startpage + pagesize - 1;
    if (endpage > pageCount) {
        endpage = pageCount;
        tmp = endpage - startpage + 1;
        if (tmp < pagesize) {
            startpage -= pagesize - tmp;
            if (startpage < 1) {
                startpage = 1;
            }
        }
    }


    if (crrentPage > 1)
        pagenavigation += '<a href=\'javascript:void(0);\' onclick=\'javascript:mynet_pagenation(' + 'pageCurrent_' + pagename + '-1,"' + pagename + '")\'><<</a>';
    for (i = startpage; i <= endpage; i++) {
        if (i == crrentPage) {
            pagenavigation += "<span class='current'>" + i + "</span>";
        }
        else {
            pagenavigation += '<a href=\'javascript:void(0);\' onclick=\'javascript:mynet_pagenation(' + i + ',"' + pagename + '")\'>' + i + '</a>';
        }
    }
    if (parseInt(crrentPage) < parseInt(pageCount))
        pagenavigation += '<a href=\'javascript:void(0);\' onclick=\'javascript:mynet_pagenation(' + 'pageCurrent_' + pagename + '+1,"' + pagename + '")\'>>></a>';
    return pagenavigation;
}
function mynet_pagenation(pageid, pagename) {

    var mynet_productdocpageCount = eval('pageCount_' + pagename);
    var mynet_productdocpageCurrent = eval('pageCurrent_' + pagename);
    if (pageid > 0 && pageid <= mynet_productdocpageCount) {
        document.getElementById('page_' + pagename + pageid).style.display = 'block';
        document.getElementById('page_' + pagename + mynet_productdocpageCurrent).style.display = 'none';
        mynet_productdocpageCurrent = pageid;
        eval('pageCurrent_' + pagename + "=" + pageid);
    }
    mynet_pageSet(pagename);
    mynetResizeTheme2();
}

//获取URL中的参数
function getUrlParameter(seekParameter) {
    var url = location.href;

    // 删除url后面#之后的内容
    var index = url.indexOf('#');
    if (index >= 0) {
        url = url.substr(0, index);
    }

    var parameters = url.substr(url.indexOf("?") + 1);
    var parameterItems = parameters.split("&");
    var parameterName;
    var parameterVar = "";
    for (i in parameterItems) {
        parameterName = parameterItems[i].split("=")[0];
        parameterVar = parameterItems[i].split("=")[1];
        if (parameterName == seekParameter) {
            return (parameterVar);
        }
    }
    return "";
}



//整除
function Div(exp1, exp2) {
    var n1 = Math.round(exp1);
    var n2 = Math.round(exp2);
    var rslt = n1 / n2;
    if (rslt >= 0)
        rslt = Math.floor(rslt);
    else
        rslt = Math.ceil(rslt);
    return rslt;
}
//CaseCading DropDownList Begin
function commonCategoryInit(clientId, selectedValue, width, noticeMsg) {
    var data = eval('commonCategoryData_' + clientId);
    var span = document.getElementById('commonCategorySpan_' + clientId);

    var ctrl = commonCategoryCreateDropDownList(data, 1, 10000, span, 0, width, noticeMsg);

    if (selectedValue == null)
        return;

    var indexArray = commonCategoryGetIndex(data, selectedValue); // 选择所有选择框
    if (indexArray.length <= 0)
        return;

    var itemLength = data[0];
    for (var i = 0; i < indexArray.length; i++) {
        var selectedIndex = indexArray[i];
        ctrl.value = data[selectedIndex + 1];
        var listCount = data[selectedIndex];
        if (listCount > 0) {
            var listIndex = selectedIndex + itemLength;
            ctrl = commonCategoryCreateDropDownList(data, listIndex, listCount, span, 0, width, noticeMsg);
        }
    }
}

function commonCategoryOnChange(noticeMsg, obj) {
    var span = obj.parentNode;
    var clientId = span.id.substr('commonCategorySpan_'.length);
    var data = eval('commonCategoryData_' + clientId);
    var selectedValue = obj.value;
    var selectedText = obj.options[obj.selectedIndex].text;
    var indexOfParent = selectedText.indexOf("-->");

    // set selected value
    document.getElementById(clientId + "_hfSelectedValue").value = selectedValue;

    if (selectedValue == '')
        return;
    var dataIndexArray = commonCategoryGetIndex(data, selectedValue);
    var dataIndex = dataIndexArray[dataIndexArray.length - 1];


    var debugCount = 1000;
    while (span.childNodes.length > 0 && debugCount-- > 0) {
        var spanChild = span.childNodes[span.childNodes.length - 1];
        if (spanChild == obj)
            break;
        span.removeChild(spanChild);
    }


    var childrenCount = data[dataIndex];
    if (childrenCount <= 0)
        return;


    var itemLength = data[0];
    var childSelect = commonCategoryCreateDropDownList(data, dataIndex + itemLength, childrenCount, span, 0, parseInt(obj.style.width), noticeMsg);
}

function commonCategoryGetIndex(data, categoryId) {
    var itemLength = data[0];
    var returnIndexArray = new Array;
    for (var index = 1; index < data.length; ) {
        var ret = commonCategoryGetIndex2(data, index, categoryId, returnIndexArray);
        if (ret == -1)
            break;
        index += ret * itemLength;
    }
    return returnIndexArray;
}

function commonCategoryGetIndex2(data, index, categoryId, returnIndexArray) {
    returnIndexArray[returnIndexArray.length] = index; // add my index
    if (data[index + 1] == categoryId) // found
    {
        return -1;
    }

    // search children
    var itemLength = data[0];
    var count = data[index];
    var total = 1; // 包括子目录本身
    index += itemLength;
    while (count-- > 0) {
        var ret = commonCategoryGetIndex2(data, index, categoryId, returnIndexArray);
        if (ret == -1) // found at children
            return -1;
        total += ret;
        index += ret * itemLength;
    }

    // Not Found
    returnIndexArray.length--;
    return total;
}

// 返回指定目录下所有层次子目录数量，包括自身目录．
function commonCategoryGetTotalChildren(data, index) {
    var itemLength = data[0];
    var count = data[index];
    var total = 1; // 包括子目录本身
    index += itemLength;
    while (count-- > 0) {
        var ret = commonCategoryGetTotalChildren(data, index);
        total += ret;
        index += ret * itemLength;
    }
    return total;
}

function commonCategoryCreateDropDownList(data, index, count, span, selectedIndex, width, noticeMsg) {
    if (selectedIndex == null)
        selectedIndex = -1;
    var select = document.createElement('SELECT');
    if (width != "0" && !isNaN(width)) {
        select.style.width = width + "px";
    }

    //为二级分类的Select添加float属性让其折行
    if (mynet_GetNavigator() != 'MSIE') {
        select.style.cssFloat = "left";
    } else {
        select.style.styleFloat = "left";
    }

    if (span.childNodes.length > 0) {
        span.insertBefore(select, null);
    }
    else {
        select.style.marginRight = "10px"; //确保二级分类和一级分类中间有间隙
        span.appendChild(select);
    }


    select.onchange = function () { commonCategoryOnChange(noticeMsg, select) };

    var option = document.createElement('OPTION');
    option.value = '';
    if (noticeMsg == null || noticeMsg == '') {
        noticeMsg = "--请选择--";
    }
    option.text = noticeMsg;
    if (mynet_GetNavigator() != 'MSIE') {
        select.appendChild(option);
    }
    else {
        select.options.add(option);
    }

    var itemLength = data[0];
    while (index < data.length && count > 0) {
        option = document.createElement('OPTION');
        option.value = data[index + 1];
        option.text = cutTitleInfo(data[index + 2].toString(), 18);
        option.setAttribute("title", data[index + 2].toString());

        option.selected = (selectedIndex == index);
        if (data[index] > 0) // 有子栏目
        {
            //处理二级分类标识添加问题
            if (option.text.getBytesLength() >= 17) {
                if (option.text.charCodeAt(option.text.length - 2) > 255) {
                    option.text = option.text.substr(0, option.text.length - 2) + "…->";
                }
                else {
                    option.text = option.text.substr(0, option.text.length - 3) + "…->";
                }
            }
            else {
                option.text = option.text + "->"; //小于17个字符的直接添加
            }
        }

        if (mynet_GetNavigator() != 'MSIE') {
            select.appendChild(option);
        }
        else {
            select.options.add(option);
        }

        index += itemLength * (commonCategoryGetTotalChildren(data, index));
        count--;
    }

    return select;
}
//End CaseCading DropDownList

//按字符数截取下拉列表信息
function cutTitleInfo(title, len) {
    if (!title || !len)
    { return ''; }

    //长度大于限定字符数
    if (title.getBytesLength() > len) {
        var charByte = 0; //预期计数：中文2字节，英文1字节
        var i = 0;  //循环计数
        var temp = ''; //临时字串

        for (i = 0; i < title.length; i++) {
            if (title.charCodeAt(i) > 255) {
                charByte += 2; //按照预期计数增加2
            }
            else {
                charByte++;
            }
            //如果增加计数后长度大于限定长度，就直接返回临时字符串
            if (charByte > len) {
                temp += "…";
                return temp;
            }
            else if (charByte == len) {
                temp += "…";
                return temp;
            }
            temp += title.charAt(i); //将当前内容加到临时字符串
        }
    }
    else {
        return title;
    }
}

String.prototype.getBytesLength = function () {
    return this.replace(/[^\x00-\xff]/gi, "--").length;
}

function mynet_TabOnClick(obj, aspectUID) {
    var tabHeaderDiv = document.getElementById("tabHeaders_" + aspectUID);
    var tabHeaders = tabHeaderDiv.getElementsByTagName("a");
    var tabHeaderLen = tabHeaders.length;
    var tabIndex = 0;
    for (var i = 0; i < tabHeaderLen; i++) {
        if (tabHeaders[i] == obj) {
            tabHeaders[i].className = "selected";
            tabIndex = i;
        }
        else {
            tabHeaders[i].className = "";
        }
    }

    var parentSpan = document.getElementById("tabParent_" + aspectUID);
    var tabs = parentSpan.childNodes;
    var len = tabs.length;
    for (var i = 0; i < len; i++) {
        if (i != tabIndex) {
            tabs[i].style.display = "none";
        }
        else {
            tabs[i].style.display = "inline";

        }
    }
}
//刷新验证码
//改为使用SETTIMEOUT 是为了避免IE6的弱智BUG
function refreshValidateCode(codeid) {
    var imgValidate = document.getElementById(codeid);
    if (codeid != null) {
        //imgValidate.src="http://qc2008.alpha.mynet.cn/web/VCodeImg.aspx?id="+1

        setTimeout('document.getElementById("' + codeid + '").src="/web/VCodeImg.aspx?isCreate=true&dt="+new Date()', 10);
    }
}
//加入收藏夹
function addMynetFavorite(keystring, type, title, usermark, userloged) {
    if (userloged) {
        var strUrl = "/plugin/mynetsite/AddFavorite.aspx?keystring=" + keystring + "&usermark=" + usermark + "&type=" + type + "&title=" + escape(title);
        var win = ShowModalDialogInFrame(strUrl);
        win.OnOKCallBack = function (ret) {
            if (ret == "true") {
                mynet_Alert("恭喜您，成功加入收藏!", "你可以在控件中心的收藏夹，找到此控件");
            }
            else if (ret == "false") {
                mynet_Alert("加入收藏失败！", "可能是您之前已经加入过该收藏");
            }
        }
    }
    else {
        window.location.href = '/web/login.aspx?returnurl=' + escape(window.location.href);
    }
}

function removeMynetFavorite(keystring) {
    var win = mynet_Confirm("移出收藏", "您是否确定要移出该收藏？", "收藏移出后，在控件中心收藏夹将不再显示此控件");
    win.OnOK = function () {
        win.Close();
        var strUrl = "/plugin/mynetsite/removeFavorite.aspx?keystring=" + keystring;
        var ret = httpRequest(strUrl);
        if (ret == "true") {
            var win2 = mynet_Alert("恭喜您，该收藏已经成功移出！", "控件中心收藏夹将不再显示此控件");
            win2.OnOK = function () {
                win2.Close();
                window.location.href = window.location.href;
            }
        }
        else {
            mynet_Alert("移出收藏失败。", "可能是您没有登录或者该收藏之前已经被移出了");
        }
    }

}

//修正png图片在ie6下有灰背景的问题
function fixPNG(myImage) {
    var arVersion = navigator.appVersion.split("MSIE");
    var version = parseFloat(arVersion[1]);

    if ((version >= 5.5) && (version < 7) && (document.body.filters)) {
        var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
        var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
        var imgTitle = (myImage.title) ?
                     "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
        var imgStyle = "display:inline-block;" + myImage.style.cssText
        var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width
                  + "px; height:" + myImage.height
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
        myImage.outerHTML = strNewHTML;

    }
}
//用来控制元素鼠标移动过的效果。要求className 分别以Normal和Over结尾
function SetElementsHover(className) {
    $("." + className + "Normal").hover
      (
        function () { $(this).addClass(className + "Over"); },
        function () { $(this).removeClass(className + "Over"); }
      );
}
//消除超过32个style的IEbug
$(function Mynet_FixIEStyleBug() {
    //只有IE 且 style长度大于32才执行
    try {
        if ($.browser.msie && $("style").length > 32) {
            var newStyle = "";
            //遍历style并且把所有style放到newstyle字串中
            $("style").each(function gatherStyle() {
                newStyle += $(this).html();
                //把原来的style带标签一并删除
                $(this).remove();
            }
                                         );
            //加到head里
            $("head").append("<style type='text/css'>" + newStyle + "</style>");
        }
    }
    catch (e) {
    }
}
);

//客户端浏览器不支持提示，如果用户的浏览器不是IE则提示
function mynet_AgentNotSupportAlert() {
    if (mynet_GetIeVersion() < 6.0) {
        mynet_Alert("系统不支持您当前使用的浏览器。", "在设计状态和管理后台，系统推荐使用<a href='http://www.microsoft.com/china/windows/internet-explorer/' target='_blank'>IE8.0</a>,IE7.0,IE6.0这三款浏览器。在其他浏览器下如腾讯TT、遨游、FireFox、Safari等，系统的某些功能可能无法正常使用。谢谢合作！", 400, 150);
        return;
    }
    //    //如果是ie9,则提示用ie9的兼容模式 huangsq 2011-3-14
    //    if (mynet_GetIeVersion() >= 9.0) {
    //        mynet_Alert("系统不支持您当前使用的浏览器。", "您现在使用的浏览器为IE 9.0版本，请将IE 9.0浏览器设置为“兼容性视图”，即可正常浏览。<a href='http://help.mynet.cn/_d271368813.htm' target='_blank'>详细帮助</a>。谢谢合作！", 400, 150);
    //        return;
    //    }
    try {
        XmlDoc(); //如果无法初始化一个XMLDO就可以认为不支持ActiveX
    }
    catch (e) {
        mynet_Alert("您当前浏览器不支持ActiveX控件", "<div style='line-height:20px'>系统的某些功能将无法正常使用。可能是浏览器的“运行ActiveX控件和插件”选项没有打开．<br/>请参考<a href='http://121.199.64.253/_d269918402.htm' target='_blank'>如何让浏览器支持ActiveX控件和插件</a>。</div>", 400, 150);
    }
}
/****************************百度搜索**************************************/
function gowhere1(formname) {
    var url;
    if (formname.myselectvalue.value == "0") {
        url = "http://www.baidu.com/baidu";
        document.search_form1.tn.value = "baidu";
        formname.method = "get";
    }
    if (formname.myselectvalue.value == "1") {
        url = "http://mp3.baidu.com/m";
        document.search_form1.tn.value = "baidump3";
        document.search_form1.ct.value = "134217728";
        document.search_form1.lm.value = "-1";
    }

    if (formname.myselectvalue.value == "4") {
        document.search_form1.tn.value = "news";
        document.search_form1.cl.value = "2";
        document.search_form1.rn.value = "20";
        url = "http://news.baidu.com/ns";
    }
    if (formname.myselectvalue.value == "5") {
        document.search_form1.tn.value = "baiduiamge";
        document.search_form1.ct.value = "201326592";
        document.search_form1.cl.value = "2";
        document.search_form1.lm.value = "-1";
        url = "http://image.baidu.com/i";
    }
    if (formname.myselectvalue.value == "6") {
        url = "http://post.baidu.com/f";
        document.search_form1.tn.value = "baiduPostSearch";
        document.search_form1.ct.value = "352321536";
        document.search_form1.rn.value = "10";
        document.search_form1.lm.value = "65536";
    }

    formname.action = url;
    return true;
}
function g_baidu(formname) {
    var url = "http://www.baidu.com/baidu";
    if (formname.s[1].checked) {
        formname.ct.value = "2097152";
    }
    else {
        formname.ct.value = "0";
    }
    formname.action = url;
    return true;
}
/****************************end 百度搜索**************************************/


var fleXenv = {

    fleXcrollInit: function() { this.addTrggr(window, 'load', this.globalInit); },

    fleXcrollMain: function(dDv) {
        //Main code beg
        var dC = document, wD = window, nV = navigator;
        if (!dC.getElementById || !dC.createElement) return;
        if (typeof (dDv) == 'string') dDv = document.getElementById(dDv);
        if (dDv == null || nV.userAgent.indexOf('OmniWeb') != -1 || ((nV.userAgent.indexOf('AppleWebKit') != -1 || nV.userAgent.indexOf('Safari') != -1) && !(typeof (HTMLElement) != "undefined" && HTMLElement.prototype)) || nV.vendor == 'KDE' || (nV.platform.indexOf('Mac') != -1 && nV.userAgent.indexOf('MSIE') != -1)) return;
        if (dDv.scrollUpdate) { dDv.scrollUpdate(); return; };
        if (!dDv.id || dDv.id == '') { var sTid = "flex__", c = 1; while (document.getElementById(sTid + c) != null) { c++ }; dDv.id = sTid + c; }
        var targetId = dDv.id;
        dDv.fleXdata = new Object(); var sC = dDv.fleXdata;
        sC.keyAct = { _37: ['-1s', 0], _38: [0, '-1s'], _39: ['1s', 0], _40: [0, '1s'], _33: [0, '-1p'], _34: [0, '1p'], _36: [0, '-100p'], _35: [0, '+100p'] };
        sC.wheelAct = ["-2s", "2s"];
        sC.baseAct = ["-2s", "2s"];
        var cDv = createDiv('contentwrapper', true), mDv = createDiv('mcontentwrapper', true), tDv = createDiv('scrollwrapper', true), pDv = createDiv('copyholder', true);
        var iDv = createDiv('domfixdiv', true), fDv = createDiv('zoomdetectdiv', true), stdMode = false;
        pDv.sY.border = '1px solid blue'; pDv.fHide();
        dDv.style.overflow = 'hidden';
        fDv.sY.fontSize = "12px"; fDv.sY.height = "1em"; fDv.sY.width = "1em"; fDv.sY.position = "absolute"; fDv.sY.zIndex = "-999"; fDv.fHide();
        var brdHeight = dDv.offsetHeight, brdWidth = dDv.offsetWidth;
        copyStyles(dDv, pDv, '0px', ['border-left-width', 'border-right-width', 'border-top-width', 'border-bottom-width']);
        var intlHeight = dDv.offsetHeight, intlWidth = dDv.offsetWidth, brdWidthLoss = brdWidth - intlWidth, brdHeightLoss = brdHeight - intlHeight;
        var oScrollY = (dDv.scrollTop) ? dDv.scrollTop : 0, oScrollX = (dDv.scrollLeft) ? dDv.scrollLeft : 0;
        var urlBase = document.location.href, uReg = /#([^#.]*)$/;
        var focusProtectList = ['textarea', 'input', 'select'];
        sC.scroller = []; sC.forcedBar = []; sC.containerSize = sC.cntRSize = []; sC.contentSize = sC.cntSize = []; sC.edge = [false, false];
        sC.reqS = []; sC.barSpace = [0, 0]; sC.forcedHide = []; sC.forcedPos = []; sC.paddings = [];
        while (dDv.firstChild) { cDv.appendChild(dDv.firstChild) };
        cDv.appendChild(iDv); dDv.appendChild(mDv); dDv.appendChild(pDv);
        if (getStyle(dDv, 'position') != 'absolute') dDv.style.position = "relative";

        var dAlign = getStyle(dDv, 'text-align'); dDv.style.textAlign = 'left';
        mDv.sY.width = "100px"; mDv.sY.height = "100px"; mDv.sY.top = "0px"; mDv.sY.left = "0px";
        copyStyles(dDv, pDv, "0px", ['padding-left', 'padding-top', 'padding-right', 'padding-bottom']);
        var postWidth = dDv.offsetWidth, postHeight = dDv.offsetHeight, mHeight;
        mHeight = mDv.offsetHeight; mDv.sY.borderBottom = "2px solid black";
        if (mDv.offsetHeight > mHeight) stdMode = true; mDv.sY.borderBottomWidth = "0px";
        copyStyles(pDv, dDv, false, ['padding-left', 'padding-top', 'padding-right', 'padding-bottom']);
        findPos(mDv); findPos(dDv);
        sC.paddings[0] = mDv.yPos - dDv.yPos; sC.paddings[2] = mDv.xPos - dDv.xPos;
        dDv.style.paddingTop = getStyle(dDv, "padding-bottom"); dDv.style.paddingLeft = getStyle(dDv, "padding-right");
        findPos(mDv); findPos(dDv);
        sC.paddings[1] = mDv.yPos - dDv.yPos; sC.paddings[3] = mDv.xPos - dDv.xPos;
        dDv.style.paddingTop = getStyle(pDv, "padding-top"); dDv.style.paddingLeft = getStyle(pDv, "padding-left");
        var padWidthComp = sC.paddings[2] + sC.paddings[3], padHeightComp = sC.paddings[0] + sC.paddings[1];

        mDv.style.textAlign = dAlign;
        copyStyles(dDv, mDv, false, ['padding-left', 'padding-right', 'padding-top', 'padding-bottom']);
        tDv.sY.width = dDv.offsetWidth + 'px'; tDv.sY.height = dDv.offsetHeight + 'px';
        mDv.sY.width = postWidth + 'px'; mDv.sY.height = postHeight + 'px';
        tDv.sY.position = 'absolute'; tDv.sY.top = '0px'; tDv.sY.left = '0px';
        tDv.fHide();

        mDv.appendChild(cDv); dDv.appendChild(tDv); tDv.appendChild(fDv);

        cDv.sY.position = 'relative'; mDv.sY.position = 'relative';
        cDv.sY.top = "0"; cDv.sY.width = "100%"; //fix IE7
        mDv.sY.overflow = 'hidden';
        mDv.sY.left = "-" + sC.paddings[2] + "px";
        mDv.sY.top = "-" + sC.paddings[0] + "px";
        sC.zTHeight = fDv.offsetHeight;

        sC.getContentWidth = function() {
            var cChilds = cDv.childNodes, maxCWidth = compPad = 0;
            for (var i = 0; i < cChilds.length; i++) { if (cChilds[i].offsetWidth) { maxCWidth = Math.max(cChilds[i].offsetWidth, maxCWidth) } };
            sC.cntRSize[0] = ((sC.reqS[1] && !sC.forcedHide[1]) || sC.forcedBar[1]) ? dDv.offsetWidth - sC.barSpace[0] : dDv.offsetWidth;
            sC.cntSize[0] = maxCWidth + padWidthComp;
            return sC.cntSize[0];
        };
        sC.getContentHeight = function() {
            sC.cntRSize[1] = ((sC.reqS[0] && !sC.forcedHide[0]) || sC.forcedBar[0]) ? dDv.offsetHeight - sC.barSpace[1] : dDv.offsetHeight;
            sC.cntSize[1] = Math.max(cDv.offsetHeight,cDv.scrollHeight) + padHeightComp - 2;
            return sC.cntSize[1];
        };

        sC.fixIEDispBug = function() { cDv.sY.display = 'none'; cDv.sY.display = 'block'; };
        sC.setWidth = function() { mDv.sY.width = (stdMode) ? (sC.cntRSize[0] - padWidthComp - brdWidthLoss) + 'px' : sC.cntRSize[0] + 'px'; };
        sC.setHeight = function() { mDv.sY.height = (stdMode) ? (sC.cntRSize[1] - padHeightComp - brdHeightLoss) + 'px' : sC.cntRSize[1] + 'px'; };

        sC.createScrollBars = function() {
            sC.getContentWidth(); sC.getContentHeight();
            //vert
            tDv.vrt = new Array(); var vrT = tDv.vrt;
            createScrollBars(vrT, 'vscroller');
            vrT.barPadding = [parseInt(getStyle(vrT.sBr, 'padding-top')), parseInt(getStyle(vrT.sBr, 'padding-bottom'))];
            vrT.sBr.sY.padding = '0px'; vrT.sBr.curPos = 0; vrT.sBr.vertical = true;
            vrT.sBr.indx = 1; cDv.vBar = vrT.sBr;
            prepareScroll(vrT, 0); sC.barSpace[0] = vrT.sDv.offsetWidth; sC.setWidth();
            //horiz
            tDv.hrz = new Array(); var hrZ = tDv.hrz;
            createScrollBars(hrZ, 'hscroller');
            hrZ.barPadding = [parseInt(getStyle(hrZ.sBr, 'padding-left')), parseInt(getStyle(hrZ.sBr, 'padding-right'))];
            hrZ.sBr.sY.padding = '0px'; hrZ.sBr.curPos = 0; hrZ.sBr.vertical = false;
            hrZ.sBr.indx = 0; cDv.hBar = hrZ.sBr;
            if (wD.opera) hrZ.sBr.sY.position = 'relative';
            prepareScroll(hrZ, 0);
            sC.barSpace[1] = hrZ.sDv.offsetHeight; sC.setHeight();
            tDv.sY.height = dDv.offsetHeight + 'px';

            hrZ.jBox = createDiv('scrollerjogbox');
            tDv.appendChild(hrZ.jBox); hrZ.jBox.onmousedown = function() {
                hrZ.sBr.scrollBoth = true; sC.goScroll = hrZ.sBr; hrZ.sBr.clicked = true;
                hrZ.sBr.moved = false; tDv.vrt.sBr.moved = false;
                fleXenv.addTrggr(dC, 'selectstart', retFalse); fleXenv.addTrggr(dC, 'mousemove', mMoveBar); fleXenv.addTrggr(dC, 'mouseup', mMouseUp);
                return false;
            };
            if (dDv.style.overflowX == "hidden") {
                hrZ.sDv.style.height = "1px";
                hrZ.sDv.style.overflow = "hidden";
                hrZ.sDv.style.filter = "alpha(opacity=0)";
            }
        };

        sC.goScroll = null;
        sC.createScrollBars();
        cDv.removeChild(iDv);

        if (!this.addChckTrggr(dDv, 'mousewheel', mWheelProc) || !this.addChckTrggr(dDv, 'DOMMouseScroll', mWheelProc)) { dDv.onmousewheel = mWheelProc; };
        this.addChckTrggr(dDv, 'mousewheel', mWheelProc);
        this.addChckTrggr(dDv, 'DOMMouseScroll', mWheelProc);
        dDv.setAttribute('tabIndex', '0');

        this.addTrggr(dDv, 'keydown', function(e) {
            if (dDv.focusProtect) return;
            if (!e) { var e = wD.event; }; var pK = e.keyCode; sC.pkeY = pK;
            sC.mDPosFix();
            if (sC.keyAct['_' + pK] && !window.opera) { dDv.contentScroll(sC.keyAct['_' + pK][0], sC.keyAct['_' + pK][1], true); if (e.preventDefault) e.preventDefault(); return false; };
        });
        this.addTrggr(dDv, 'keypress', function(e) {//make Opera Happy
            if (dDv.focusProtect) return;
            if (!e) { var e = wD.event; }; var pK = e.keyCode;
            if (sC.keyAct['_' + pK]) { dDv.contentScroll(sC.keyAct['_' + pK][0], sC.keyAct['_' + pK][1], true); if (e.preventDefault) e.preventDefault(); return false; };
        });

        this.addTrggr(dDv, 'keyup', function() { sC.pkeY = false });

        this.addTrggr(dC, 'mouseup', intClear);
        this.addTrggr(dDv, 'mousedown', function(e) {
            if (!e) e = wD.event;
            var cTrgt = (e.target) ? e.target : (e.srcElement) ? e.srcElement : false;
            if (!cTrgt || (cTrgt.className && cTrgt.className.match(RegExp("\\bscrollgeneric\\b")))) return;
            sC.inMposX = e.clientX; sC.inMposY = e.clientY;
            pageScrolled(); findPos(dDv); intClear();
            fleXenv.addTrggr(dC, 'mousemove', tSelectMouse);
            sC.mTBox = [dDv.xPos + 10, dDv.xPos + sC.cntRSize[0] - 10, dDv.yPos + 10, dDv.yPos + sC.cntRSize[1] - 10];
        });

        function tSelectMouse(e) {
            if (!e) e = wD.event;
            var mX = e.clientX, mY = e.clientY, mdX = mX + sC.xScrld, mdY = mY + sC.yScrld;
            sC.mOnXEdge = (mdX < sC.mTBox[0] || mdX > sC.mTBox[1]) ? 1 : 0;
            sC.mOnYEdge = (mdY < sC.mTBox[2] || mdY > sC.mTBox[3]) ? 1 : 0;
            sC.xAw = mX - sC.inMposX; sC.yAw = mY - sC.inMposY;
            sC.sXdir = (sC.xAw > 40) ? 1 : (sC.xAw < -40) ? -1 : 0; sC.sYdir = (sC.yAw > 40) ? 1 : (sC.yAw < -40) ? -1 : 0;
            if ((sC.sXdir != 0 || sC.sYdir != 0) && !sC.tSelectFunc) sC.tSelectFunc = wD.setInterval(function() {
                if (sC.sXdir == 0 && sC.sYdir == 0) { wD.clearInterval(sC.tSelectFunc); sC.tSelectFunc = false; return; }; pageScrolled();
                if (sC.mOnXEdge == 1 || sC.mOnYEdge == 1) dDv.contentScroll((sC.sXdir * sC.mOnXEdge) + "s", (sC.sYdir * sC.mOnYEdge) + "s", true);
            }, 45)
        }
        function intClear() {
            fleXenv.remTrggr(dC, 'mousemove', tSelectMouse); if (sC.tSelectFunc) wD.clearInterval(sC.tSelectFunc); sC.tSelectFunc = false;
            if (sC.barClickRetard) wD.clearTimeout(sC.barClickRetard); if (sC.barClickScroll) wD.clearInterval(sC.barClickScroll);
        }
        function pageScrolled() {
            sC.xScrld = (wD.pageXOffset) ? wD.pageXOffset : (dC.documentElement && dC.documentElement.scrollLeft) ? dC.documentElement.scrollLeft : 0;
            sC.yScrld = (wD.pageYOffset) ? wD.pageYOffset : (dC.documentElement && dC.documentElement.scrollTop) ? dC.documentElement.scrollTop : 0;
        }

        dDv.scrollUpdate = function(recurse) {
            if (tDv.getSize[1]() === 0 || tDv.getSize[0]() === 0) return;
            cDv.sY.padding = '1px'; var reqH = sC.reqS[0], reqV = sC.reqS[1], vBr = tDv.vrt, hBr = tDv.hrz, vUpReq, hUpReq, cPSize = [];
            tDv.sY.width = dDv.offsetWidth - brdWidthLoss + 'px'; tDv.sY.height = dDv.offsetHeight - brdHeightLoss + 'px';
            cPSize[0] = sC.cntRSize[0]; cPSize[1] = sC.cntRSize[1];
            sC.reqS[0] = sC.getContentWidth() > sC.cntRSize[0];
            sC.reqS[1] = sC.getContentHeight() > sC.cntRSize[1];
            var stateChange = (reqH != sC.reqS[0] || reqV != sC.reqS[1] || cPSize[0] != sC.cntRSize[0] || cPSize[1] != sC.cntRSize[1]) ? true : false;
            vBr.sDv.setVisibility(sC.reqS[1]); hBr.sDv.setVisibility(sC.reqS[0]);
            vUpReq = (sC.reqS[1] || sC.forcedBar[1]); hUpReq = (sC.reqS[0] || sC.forcedBar[0]);
            sC.getContentWidth(); sC.getContentHeight(); sC.setHeight(); sC.setWidth();
            if (!sC.reqS[0] || !sC.reqS[1] || sC.forcedHide[0] || sC.forcedHide[1]) hBr.jBox.fHide();
            else hBr.jBox.fShow();
            if (vUpReq) updateScroll(vBr, (hUpReq && !sC.forcedHide[0]) ? sC.barSpace[1] : 0); else cDv.sY.top = "0";
            if (hUpReq) updateScroll(hBr, (vUpReq && !sC.forcedHide[1]) ? sC.barSpace[0] : 0); else cDv.sY.left = "0";
            if (stateChange && !recurse) dDv.scrollUpdate(true);
            cDv.sY.padding = '0px';
            sC.edge[0] = sC.edge[1] = false;
        };

        dDv.commitScroll = dDv.contentScroll = function(xPos, yPos, relative) {
            var reT = [[false, false], [false, false]], Bar;
            if ((xPos || xPos === 0) && sC.scroller[0]) { xPos = calcCScrollVal(xPos, 0); Bar = tDv.hrz.sBr; Bar.trgtScrll = (relative) ? Math.min(Math.max(Bar.mxScroll, Bar.trgtScrll - xPos), 0) : -xPos; Bar.contentScrollPos(); reT[0] = [-Bar.trgtScrll - Bar.targetSkew, -Bar.mxScroll] }
            if ((yPos || yPos === 0) && sC.scroller[1]) { yPos = calcCScrollVal(yPos, 1); Bar = tDv.vrt.sBr; Bar.trgtScrll = (relative) ? Math.min(Math.max(Bar.mxScroll, Bar.trgtScrll - yPos), 0) : -yPos; Bar.contentScrollPos(); reT[1] = [-Bar.trgtScrll - Bar.targetSkew, -Bar.mxScroll] }
            if (!relative) sC.edge[0] = sC.edge[1] = false;
            return reT;
        };

        dDv.scrollToElement = function(tEM) {
            if (tEM == null || !isddvChild(tEM)) return;
            var sPos = findRCpos(tEM);
            dDv.contentScroll(sPos[0] + sC.paddings[2], sPos[1] + sC.paddings[0], false);
            dDv.contentScroll(0, 0, true);
        };

        copyStyles(pDv, dDv, '0px', ['border-left-width', 'border-right-width', 'border-top-width', 'border-bottom-width']);

        dDv.removeChild(pDv);
        dDv.scrollTop = 0; dDv.scrollLeft = 0;
        dDv.fleXcroll = true;
        classChange(dDv, 'flexcrollactive', false);
        dDv.scrollUpdate();
        dDv.contentScroll(oScrollX, oScrollY, true);
        if (urlBase.match(uReg)) { dDv.scrollToElement(dC.getElementById(urlBase.match(uReg)[1])); }
        tDv.fShow();

        sC.sizeChangeDetect = wD.setInterval(function() {
            var n = fDv.offsetHeight; if (n != sC.zTHeight) { dDv.scrollUpdate(); sC.zTHeight = n };
        }, 2500);

        function calcCScrollVal(v, i) {
            var stR = v.toString(); v = parseFloat(stR);
            return parseInt((stR.match(/p$/)) ? v * sC.cntRSize[i] * 0.9 : (stR.match(/s$/)) ? v * sC.cntRSize[i] * 0.1 : v);
        }
        function camelConv(spL) {
            var spL = spL.split('-'), reT = spL[0], i;
            for (i = 1; parT = spL[i]; i++) { reT += parT.charAt(0).toUpperCase() + parT.substr(1); }
            return reT;
        }
        function getStyle(elem, style) {
            if (wD.getComputedStyle) return wD.getComputedStyle(elem, null).getPropertyValue(style);
            if (elem.currentStyle) return elem.currentStyle[camelConv(style)];
            return false;
        };

        function copyStyles(src, dest, replaceStr, sList) {
            var camelList = new Array();
            for (var i = 0; i < sList.length; i++) {
                camelList[i] = camelConv(sList[i]);
                dest.style[camelList[i]] = getStyle(src, sList[i], camelList[i]);
                if (replaceStr) src.style[camelList[i]] = replaceStr;
            }
        };
        function createDiv(typeName, noGenericClass) {
            var nDiv = dC.createElement('div')//,pTx=dC.createTextNode('\u00a0');
            nDiv.id = targetId + '_' + typeName;
            nDiv.className = (noGenericClass) ? typeName : typeName + ' scrollgeneric';
            nDiv.getSize = [function() { return nDiv.offsetWidth; }, function() { return nDiv.offsetHeight; } ];
            nDiv.setSize = [function(sVal) { nDiv.sY.width = sVal; }, function(sVal) { nDiv.sY.height = sVal; } ];
            nDiv.getPos = [function() { return getStyle(nDiv, "left"); }, function() { return getStyle(nDiv, "top"); } ];
            nDiv.setPos = [function(sVal) { nDiv.sY.left = sVal; }, function(sVal) { nDiv.sY.top = sVal; } ];
            nDiv.fHide = function() { nDiv.sY.visibility = "hidden" };
            nDiv.fShow = function(coPy) { nDiv.sY.visibility = (coPy) ? getStyle(coPy, 'visibility') : "visible"; };
            nDiv.sY = nDiv.style;
            //	if(!noGenericClass) nDiv.appendChild(pTx);
            return nDiv;

        };
        function createScrollBars(ary, bse) {
            ary.sDv = createDiv(bse + 'base'); ary.sFDv = createDiv(bse + 'basebeg');
            ary.sSDv = createDiv(bse + 'baseend'); ary.sBr = createDiv(bse + 'bar');
            ary.sFBr = createDiv(bse + 'barbeg'); ary.sSBr = createDiv(bse + 'barend');
            tDv.appendChild(ary.sDv); ary.sDv.appendChild(ary.sBr);
            ary.sDv.appendChild(ary.sFDv); ary.sDv.appendChild(ary.sSDv);
            ary.sBr.appendChild(ary.sFBr); ary.sBr.appendChild(ary.sSBr);
        };
        function prepareScroll(bAr, reqSpace) {
            var sDv = bAr.sDv, sBr = bAr.sBr, i = sBr.indx;
            sBr.minPos = bAr.barPadding[0];
            sBr.ofstParent = sDv;
            sBr.mDv = mDv;
            sBr.scrlTrgt = cDv;
            sBr.targetSkew = 0;
            updateScroll(bAr, reqSpace, true);

            sBr.doScrollPos = function() {
                sBr.curPos = (Math.min(Math.max(sBr.curPos, 0), sBr.maxPos));
                sBr.trgtScrll = parseInt((sBr.curPos / sBr.sRange) * sBr.mxScroll);
                sBr.targetSkew = (sBr.curPos == 0) ? 0 : (sBr.curPos == sBr.maxPos) ? 0 : sBr.targetSkew;
                sBr.setPos[i](sBr.curPos + sBr.minPos + "px");
                cDv.setPos[i](sBr.trgtScrll + sBr.targetSkew + "px");
            };

            sBr.contentScrollPos = function() {
                sBr.curPos = parseInt((sBr.trgtScrll * sBr.sRange) / sBr.mxScroll);
                sBr.targetSkew = sBr.trgtScrll - parseInt((sBr.curPos / sBr.sRange) * sBr.mxScroll);
                sBr.curPos = (Math.min(Math.max(sBr.curPos, 0), sBr.maxPos));
                sBr.setPos[i](sBr.curPos + sBr.minPos + "px");
                sBr.setPos[i](sBr.curPos + sBr.minPos + "px");
                cDv.setPos[i](sBr.trgtScrll + "px");
            };

            sC.barZ = getStyle(sBr, 'z-index');
            sBr.sY.zIndex = (sC.barZ == "auto" || sC.barZ == "0" || sC.barZ == 'normal') ? 2 : sC.barZ;
            mDv.sY.zIndex = getStyle(sBr, 'z-index');

            sBr.onmousedown = function() {
                sBr.clicked = true; sC.goScroll = sBr; sBr.scrollBoth = false; sBr.moved = false;
                fleXenv.addTrggr(dC, 'selectstart', retFalse);
                fleXenv.addTrggr(dC, 'mousemove', mMoveBar);
                fleXenv.addTrggr(dC, 'mouseup', mMouseUp);
                return false;
            };

            sBr.onmouseover = intClear;

            sDv.onmousedown = sDv.ondblclick = function(e) {
                if (!e) { var e = wD.event; }
                if (e.target && (e.target == bAr.sFBr || e.target == bAr.sSBr || e.target == bAr.sBr)) return;
                if (e.srcElement && (e.srcElement == bAr.sFBr || e.srcElement == bAr.sSBr || e.srcElement == bAr.sBr)) return;
                var relPos, mV = []; pageScrolled();
                sC.mDPosFix();
                findPos(sBr);
                relPos = (sBr.vertical) ? e.clientY + sC.yScrld - sBr.yPos : e.clientX + sC.xScrld - sBr.xPos;
                mV[sBr.indx] = (relPos < 0) ? sC.baseAct[0] : sC.baseAct[1]; mV[1 - sBr.indx] = 0;
                dDv.contentScroll(mV[0], mV[1], true);
                if (e.type != "dblclick") {
                    intClear();
                    sC.barClickRetard = wD.setTimeout(function() {
                        sC.barClickScroll = wD.setInterval(function() {
                            dDv.contentScroll(mV[0], mV[1], true);
                        }, 80)
                    }, 425);
                }
                return false;
            };
            sDv.setVisibility = function(r) {
                if (r) {
                    sDv.fShow(dDv);
                    sC.forcedHide[i] = (getStyle(sDv, "visibility") == "hidden") ? true : false;
                    if (!sC.forcedHide[i]) sBr.fShow(dDv); else sBr.fHide();
                    sC.scroller[i] = true; classChange(sDv, "", "flexinactive");
                }
                else {
                    sDv.fHide(); sBr.fHide();
                    sC.forcedBar[i] = (getStyle(sDv, "visibility") != "hidden") ? true : false;
                    sC.scroller[i] = false; sBr.curPos = 0; cDv.setPos[i]('0px');
                    classChange(sDv, "flexinactive", "");
                }
                mDv.setPos[1 - i]((sC.forcedPos[i] && (r || sC.forcedBar[i]) && !sC.forcedHide[i]) ? sC.barSpace[1 - i] - sC.paddings[i * 2] + "px" : "-" + sC.paddings[i * 2] + "px");
            };
            sDv.onmouseclick = retFalse;
        };

        function updateScroll(bAr, reqSpace, firstRun) {
            var sDv = bAr.sDv, sBr = bAr.sBr, sFDv = bAr.sFDv, sFBr = bAr.sFBr, sSDv = bAr.sSDv, sSBr = bAr.sSBr, i = sBr.indx;
            sDv.setSize[i](tDv.getSize[i]() - reqSpace + 'px'); sDv.setPos[1 - i](tDv.getSize[1 - i]() - sDv.getSize[1 - i]() + 'px');
            sC.forcedPos[i] = (parseInt(sDv.getPos[1 - i]()) === 0) ? true : false;
            bAr.padLoss = bAr.barPadding[0] + bAr.barPadding[1]; bAr.baseProp = parseInt((sDv.getSize[i]() - bAr.padLoss) * 0.75);
            sBr.aSize = Math.min(Math.max(Math.min(parseInt(sC.cntRSize[i] / sC.cntSize[i] * sDv.getSize[i]()), bAr.baseProp), 45), bAr.baseProp);
            sBr.setSize[i](sBr.aSize + 'px'); sBr.maxPos = sDv.getSize[i]() - sBr.getSize[i]() - bAr.padLoss;
            sBr.curPos = Math.min(Math.max(0, sBr.curPos), sBr.maxPos);
            sBr.setPos[i](sBr.curPos + sBr.minPos + 'px'); sBr.mxScroll = mDv.getSize[i]() - sC.cntSize[i];
            sBr.sRange = sBr.maxPos;
            sFDv.setSize[i](sDv.getSize[i]() - sSDv.getSize[i]() + 'px');
            sFBr.setSize[i](sBr.getSize[i]() - sSBr.getSize[i]() + 'px');
            sSBr.setPos[i](sBr.getSize[i]() - sSBr.getSize[i]() + 'px');
            sSDv.setPos[i](sDv.getSize[i]() - sSDv.getSize[i]() + 'px');
            if (!firstRun) sBr.doScrollPos();
            sC.fixIEDispBug();
        };

        sC.mDPosFix = function() { mDv.scrollTop = 0; mDv.scrollLeft = 0; dDv.scrollTop = 0; dDv.scrollLeft = 0; };

        this.addTrggr(wD, 'load', function() { if (dDv.fleXcroll) dDv.scrollUpdate(); });
        this.addTrggr(wD, 'resize', function() {
            if (dDv.refreshTimeout) wD.clearTimeout(dDv.refreshTimeout);
            dDv.refreshTimeout = wD.setTimeout(function() { if (dDv.fleXcroll) dDv.scrollUpdate(); }, 80);
        });

        for (var j = 0, inputName; inputName = focusProtectList[j]; j++) {
            var inputList = dDv.getElementsByTagName(inputName);
            for (var i = 0, formItem; formItem = inputList[i]; i++) {
                fleXenv.addTrggr(formItem, 'focus', function() { dDv.focusProtect = true; });
                fleXenv.addTrggr(formItem, 'blur', onblur = function() { dDv.focusProtect = false; });
            }
        };

        function retFalse() { return false; };
        function mMoveBar(e) {
            if (!e) { var e = wD.event; };
            var FCBar = sC.goScroll, movBr, maxx, xScroll, yScroll;
            if (FCBar == null) return;
            if (!fleXenv.w3events && !e.button) mMouseUp();
            maxx = (FCBar.scrollBoth) ? 2 : 1;
            for (var i = 0; i < maxx; i++) {
                movBr = (i == 1) ? FCBar.scrlTrgt.vBar : FCBar;
                if (FCBar.clicked) {
                    if (!movBr.moved) {
                        sC.mDPosFix();
                        findPos(movBr); findPos(movBr.ofstParent); movBr.pointerOffsetY = e.clientY - movBr.yPos;
                        movBr.pointerOffsetX = e.clientX - movBr.xPos; movBr.inCurPos = movBr.curPos; movBr.moved = true;
                    };
                    movBr.curPos = (movBr.vertical) ? e.clientY - movBr.pointerOffsetY - movBr.ofstParent.yPos - movBr.minPos : e.clientX - movBr.pointerOffsetX - movBr.ofstParent.xPos - movBr.minPos;
                    if (FCBar.scrollBoth) movBr.curPos = movBr.curPos + (movBr.curPos - movBr.inCurPos);
                    movBr.doScrollPos();
                } else movBr.moved = false;
            };
        };

        function mMouseUp() {
            if (sC.goScroll != null) { sC.goScroll.clicked = false; }
            sC.goScroll = null;
            fleXenv.remTrggr(dC, 'selectstart', retFalse);
            fleXenv.remTrggr(dC, 'mousemove', mMoveBar);
            fleXenv.remTrggr(dC, 'mouseup', mMouseUp);
        };

        function mWheelProc(e) {
            if (!e) e = wD.event;
            if (!this.fleXcroll) return;
            var scrDv = this, vEdge, hEdge, hoverH = false, delta = 0, iNDx;
            sC.mDPosFix();
            hElem = (e.target) ? e.target : (e.srcElement) ? e.srcElement : this;
            if (hElem.id && hElem.id.match(/_hscroller/)) hoverH = true;
            if (e.wheelDelta) delta = -e.wheelDelta; if (e.detail) delta = e.detail;
            delta = (delta < 0) ? -1 : +1; iNDx = (delta < 0) ? 0 : 1; sC.edge[1 - iNDx] = false;
            if ((sC.edge[iNDx] && !hoverH) || (!sC.scroller[0] && !sC.scroller[1])) return;
            if (sC.scroller[1] && !hoverH) scrollState = dDv.contentScroll(false, sC.wheelAct[iNDx], true);
            vEdge = !sC.scroller[1] || hoverH || (sC.scroller[1] && ((scrollState[1][0] == scrollState[1][1] && delta > 0) || (scrollState[1][0] == 0 && delta < 0)));
            if (sC.scroller[0] && (!sC.scroller[1] || hoverH)) scrollState = dDv.contentScroll(sC.wheelAct[iNDx], false, true);
            hEdge = !sC.scroller[0] || (sC.scroller[0] && sC.scroller[1] && vEdge && !hoverH) || (sC.scroller[0] && ((scrollState[0][0] == scrollState[0][1] && delta > 0) || (scrollState[0][0] == 0 && delta < 0)));
            if (vEdge && hEdge && !hoverH) sC.edge[iNDx] = true; else sC.edge[iNDx] = false;
            if (e.preventDefault) e.preventDefault();
            return false;
        };

        function isddvChild(elem) { while (elem.parentNode) { elem = elem.parentNode; if (elem == dDv) return true; } return false; };

        function findPos(elem) {
            //modified from firetree.net
            var obj = elem, curleft = curtop = 0;
            var monc = "";
            if (obj.offsetParent) { while (obj) { curleft += obj.offsetLeft; curtop += obj.offsetTop; obj = obj.offsetParent; monc += curtop + " "; } }
            else if (obj.x) { curleft += obj.x; curtop += obj.y; }
            elem.xPos = curleft; elem.yPos = curtop;
        };

        function findRCpos(elem) {
            var obj = elem; curleft = curtop = 0;
            while (!obj.offsetHeight && obj.parentNode && obj != cDv && getStyle(obj, 'display') == "inline") { obj = obj.parentNode; }
            if (obj.offsetParent) { while (obj != cDv) { curleft += obj.offsetLeft; curtop += obj.offsetTop; obj = obj.offsetParent; } }
            return [curleft, curtop];
        };

        function classChange(elem, addClass, remClass) {
            if (!elem.className) elem.className = '';
            var clsnm = elem.className;
            if (addClass && !clsnm.match(RegExp("(^|\\s)" + addClass + "($|\\s)"))) clsnm = clsnm.replace(/(\S$)/, '$1 ') + addClass;
            if (remClass) clsnm = clsnm.replace(RegExp("((^|\\s)+" + remClass + ")+($|\\s)", "g"), '$2').replace(/\s$/, '');
            elem.className = clsnm;
        };
    },
    //main code end
    globalInit: function() {
        if (fleXenv.catchFastInit) window.clearInterval(fleXenv.catchFastInit);
        var regg = /#([^#.]*)$/, urlExt = /(.*)#.*$/, matcH, i, anchoR, anchorList = document.getElementsByTagName("a"), urlBase = document.location.href;
        if (urlBase.match(urlExt)) urlBase = urlBase.match(urlExt)[1];
        for (i = 0; anchoR = anchorList[i]; i++) {
            if (anchoR.href && anchoR.href.match(regg) && anchoR.href.match(urlExt) && urlBase === anchoR.href.match(urlExt)[1]) {
                anchoR.fleXanchor = true;
                fleXenv.addTrggr(anchoR, 'click', function(e) {
                    if (!e) e = window.event;
                    var clickeD = (e.srcElement) ? e.srcElement : this;
                    while (!clickeD.fleXanchor && clickeD.parentNode) { clickeD = clickeD.parentNode };
                    if (!clickeD.fleXanchor) return;
                    var tEL = document.getElementById(clickeD.href.match(regg)[1]), eScroll = false;
                    if (tEL == null) tEL = (tEL = document.getElementsByName(clickeD.href.match(regg)[1])[0]) ? tEL : null;
                    if (tEL != null) {
                        var elem = tEL;
                        while (elem.parentNode) {
                            elem = elem.parentNode; if (elem.scrollToElement) {
                                elem.scrollToElement(tEL); eScroll = elem;
                            };
                        };
                        if (eScroll) { if (e.preventDefault) e.preventDefault(); document.location.href = "#" + clickeD.href.match(regg)[1]; eScroll.fleXdata.mDPosFix(); return false; }
                    };
                });
            };
        };
        fleXenv.initByClass();
        if (window.onfleXcrollRun) window.onfleXcrollRun();
    },

    initByClass: function() {
        if (fleXenv.initialized) return;
        fleXenv.initialized = true;
        var fleXlist = fleXenv.getByClassName(document.getElementsByTagName("body")[0], "div", 'flexcroll');
        for (var i = 0, tgDiv; tgDiv = fleXlist[i]; i++) fleXenv.fleXcrollMain(tgDiv);
    },

    getByClassName: function(elem, elType, classString) {
        //v1.1fleX
        if (typeof (elem) == 'string') elem = document.getElementById(elem);
        if (elem == null) return false;
        var regExer = new RegExp("(^|\\s)" + classString + "($|\\s)"), clsnm, retArray = [], key = 0;
        var elems = elem.getElementsByTagName(elType);
        for (var i = 0, pusher; pusher = elems[i]; i++) {
            if (pusher.className && pusher.className.match(regExer)) {
                retArray[key] = pusher; key++;
            }
        }
        return retArray;
    },

    catchFastInit: window.setInterval(function() {
        var dElem = document.getElementById('flexcroll-init');
        if (dElem != null) { fleXenv.initByClass(); window.clearInterval(fleXenv.catchFastInit); }
    }, 100),

    addTrggr: function(elm, eventname, func) { if (!fleXenv.addChckTrggr(elm, eventname, func) && elm.attachEvent) { elm.attachEvent('on' + eventname, func); } },

    addChckTrggr: function(elm, eventname, func) { if (elm.addEventListener) { elm.addEventListener(eventname, func, false); fleXenv.w3events = true; window.addEventListener("unload", function() { fleXenv.remTrggr(elm, eventname, func) }, false); return true; } else return false; },

    remTrggr: function(elm, eventname, func) { if (!fleXenv.remChckTrggr(elm, eventname, func) && elm.detachEvent) elm.detachEvent('on' + eventname, func); },

    remChckTrggr: function(elm, eventname, func) { if (elm.removeEventListener) { elm.removeEventListener(eventname, func, false); return true; } else return false; }

};

function CSBfleXcroll(targetId){fleXenv.fleXcrollMain(targetId)};
fleXenv.fleXcrollInit();//用于检查输入框的内容并且返回正确的值

//检查输入的是否小数，返回正确的位数的小数
//para0:obj,输入框 为页面上某个element
//para1:digitmount,小数位数（数字）
//080828 createBy ls|signBy ls
function Mynetcn_chkInputDecimal(obj,digitmount)
{
    while (!(/^[\d]+\.?\d*$/.test(obj.value))&&obj.value!="")
    {
        obj.value=obj.value.substring(0,obj.value.length-1);  
    }
    if(obj.value.split('.').length>=2)
    {
        while(obj.value.split('.')[1].length>digitmount && obj.value!="")
            obj.value=obj.value.substring(0,obj.value.length-1);
    }
}

//检查输入的是否数字
//para0:obj,输入框 为页面上某个element
//para1:length,数字长度（数字）
//080828 createBy ls|signBy ls
function Mynetcn_chkInputNumber(obj,length)
{
    if(obj.value!="")
    {
       obj.value= obj.value.replace(/\D+/g,''); 
       if(length!=null)
        Mynetcn_chkInputLength(obj,length);     
    }
}

//检查限制输入的长度,超长的自动截取
//para0:obj,输入框 为页面上某个element
//080828 createBy ls|signBy ls
function Mynetcn_chkInputLength(obj,length)
{
    while(obj.value.length>length)
    {
        obj.value=obj.value.substring(0,obj.value.length-1);
    }
}

//截取数字
function NumDecimal(num, pos) {
    if (parseFloat(num) == num)
        return Math.round(num * Math.pow(10, pos)) / Math.pow(10, pos);
    else
        return 0;
} 

//页面管理修改网页属性js
function coEdit(docId) {
    var win = (docId != 0)
        ? ShowModalDialogInFrame('/admin/CategoryEdit.aspx?portaltype=2&docuid=' + docId) // Edit
        : ShowModalDialogInFrame('/admin/CategoryEdit.aspx?portaltype=2&caninsert=1'); // New
    win.OnOKCallBack = function(ret){
        if (ret != null) {
            if (docId == 0) {//新建一个网页
                window.parent.location.href = ret[0].url;
            }
            else {
                window.parent.location.href = "/admin/design.aspx?docuid=" + docId;
            }
        }
    }
}

function siteEdit() {
    location.href = "/admin/siteedit.aspx?returnurl=" + window.location.href;
}

//修改文章最终页属性
function onEditDocDetailTemplate(docId, doctypeName) {
    var win = ShowModalDialogInFrame("/mod/docTemplate/NewDocDetailPage.aspx?docid=" + docId + "&doctypename=" + doctypeName);
    win.OnOKCallBack = function(ret){
        if (ret != null) {
            document.location.href = document.location.href;
        }
    }
}

//修改调查表属性
function setFormProperty(docId) {
    var win = ShowModalDialogInFrame('../q/EditDocQuestionDialog.aspx?id=' + docId);
    win.OnOKCallBack = function(ret){
        if (ret != null && ret != '') {
            document.location.href = document.location.href;
        }
    }
}

function coDelete(docId) {
        if (confirm("您是否真的要删除此栏目?")) {
            var docId = httpRequest("/admin/categorydelete.aspx?categoryuid=" + docId);
            if (docId != null) {
                window.location.href = "/admin/design.aspx?docuid=" + docId; //如果删除页面则刷新页面
            }
            else {
                alert("删除失败！");
            }
        }
}

//老版本栏目导航的新建栏目
function categoryOrder() {
    var win = mynet_ShowModalDialog("/admin/categoryorder.aspx?portaltype=2", "管理栏目", 600, 500);
    win.OnOKCallBack = function(newCategoryId)
    {
        if (newCategoryId == null) {
            return;
        }
        if (newCategoryId == "0" || newCategoryId == "true") {
            //_docUID = newCategoryId;
            reloadPage();
        }
        else {
            //有新建立的栏目
            window.parent.location.href = "/admin/design.aspx?docuid=" + newCategoryId;
        }
    }
}



function themeSelect(curDocId) {
    if (curDocId == null) {
        curDocId = _docUID
    }
    var win = mynet_ShowModalDialog("/admin/categoryedit.aspx?panel=theme&docuid=" + curDocId, "更换模板");
    win.OnOKCallBack = function(ret) {
        if (ret != null) {
            if (window.location.href.indexOf('design') > -1) {//在设计状态
                mynet_openLinkTop("/admin/design.aspx?docuid=" + curDocId); //保证在顶层窗口打开设计页面
            }
            else {
               searchResult(curDocId); //在后台管理
            }
        }
    }
}

//从工具箱删除文章/商品
function onDeleteDocument(id) {
    var win = ShowModalDialogInFrame('/plugin/doc/docdelete.aspx?docid=' + id);
    win.OnOKCallBack = function(ret)
    {
        if (ret != null) {
            window.location.href = "/";
        }
    }
}
//设置预制内容
function setContent(_docUID, _docParameter) {
    var win = ShowModalDialogInFrame('/admin/AutoCategoryContent.aspx' +
        '?docuid=' + _docUID +
        '&p=' + _docParameter);
    win.OnOKCallBack = function(ret){
        if (ret != null && ret != '') {
            var obj = document.getElementById('mynetAspectPanel');
            obj.outerHTML = ret;
            mynetResizeTheme();
        }
    }
}
function bgSelect() {
    var win = ShowModalDialogInFrame("/admin/SiteBgImage.aspx");
    win.OnOKCallBack = function(ret) {
        if (ret == null || ret == "") {
            return;
        }
        var designFrame = document.getElementById("designFrame");
        if (ret.indexOf("#") == 0 || ret == "transparent")//颜色
        {
            designFrame.contentWindow.document.body.style.backgroundColor = ret;
            designFrame.contentWindow.document.body.style.backgroundImage = "";
        }
        else {
            designFrame.contentWindow.document.body.style.backgroundColor = "";
            designFrame.contentWindow.document.body.style.backgroundImage = "url(" + ret + ")";
        }
    }
    //其实可以通过javascript改变背景颜色，而不需要刷新
}

function NewOrEditDocDetailPage(doctypename) {
    if (doctypename == "product_productdoc" || doctypename == "article_articledoc") {
        var win = ShowModalDialogInFrame("/plugin/doc/setPageStyle.aspx?doctypename=" + doctypename);
            win.OnOKCallBack = function(ret){
            if (ret != null && ret != "true") {
                mynet_openLinkTop("/admin/design.aspx?docuid=" + ret);
            }
            else if (ret == "true") {
                alert("设置成功！");
            }
        }
        return;
    }
}


//重置页面内容
function resetCategoryContent(docId) {

    var confirm = mynet_Confirm('重置页面', '您是否确定要重置该页面的内容？', '页面重置后将不能被恢复！');
    confirm.OnOK = function() {
        confirm.Close();
        var title = '重置页面';
        var url = '/admin/CategoryNewOrReset.aspx?isreset=1&docuid=' + docId;
        var win = mynet_ShowModalDialog(url, title, 660, 480);
        //Iframe里的页面执行完页面本身的逻辑后，回调该函数。
        win.OnOKCallBack = function(retValue) {
            if (mynet_IsDesignWin()) {
                var frameSrc = "design2.aspx?docuid=" + retValue
                var designFrame = document.getElementById("designFrame");
                designFrame.src = frameSrc;
            }
            else {
                mynet_Alert('页面内容已经重置！');
                searchResult(retValue);
            }
        }
    }
}

// 页面发布
function publishCategory() {
    var curDocId = document.getElementById("hfCurDocId").value;
    var win = mynet_ShowModalDialog('/admin/publishCategory.aspx?docid=' + curDocId, '页面发布', 600, 480, 'OK|CANCEL');
    win.OnOKCallBack = function(ret) {
    if (ret != null && ret != '' && ret!='0') {
            mynet_Alert('页面发布成功！');
        }
    }
}

//新建页面的函数，在工具箱和design.aspx均用到
function coNewCategory() {

    var title = '新建页面';
    var url = '/admin/CategoryNewOrReset.aspx';
    var buttons = null; //窗口要显示的按钮
    var win = mynet_ShowModalDialog(url, title, 660, 480);
    
    //Iframe里的页面执行完页面本身的逻辑后，回调该函数。
    win.OnOKCallBack = function(retValue) {
        if (mynet_IsDesignWin()) {
            mynet_openLinkTop('/admin/design.aspx?docuid=' + retValue);
        }
        else {
            // 新建页面总是属于普通栏目
            window.location.href = "/plugin/siteAdmin/pageMgrCenter.aspx?docid=" + retValue + "&folderName=CommonCategory"; 
        }
    }
}

function mynet_IsDesignWin() {
    return window.location.href.indexOf('design.aspx') != -1 || window.parent.window.location.href.indexOf('design.aspx')!=-1;
}

//更多网页对话框
function onSearchPages() {
    var title = '网页搜索';
    var url = '/plugin/siteAdmin/searchPages.aspx';
  
    var win = mynet_ShowModalDialog(url, title,580,450,'');
    //回调提交后的事件
    win.OnOKCallBack = function(retValue) {
        if (retValue != null) {
            if (mynet_IsDesignWin()) {//设计状态窗口
                window.location.href = "/admin/design.aspx?docuid=" + retValue;
            }
            else //后台管理
            {
                searchResult(retValue);
            }
        }
    }
}

//编辑模板属性
function onEditThemeProperty(themeId, imgTemplateId) {
    var docId = (typeof(curPageDocId)=="undefined") ? '' : curPageDocId;
    var win = ShowModalDialogInFrame("/mod/masterpage/masterpageproperty.aspx?themeid=" + themeId + "&docuid=" + docId + "&date=" + new Date());
    win.OnOKCallBack = function(ret){
        if (ret != null) {
            if(typeof(curPageDocId)=="undefined"){
                mynet_refreshPageTop();
            }else
            {
                mynet_openLinkTop("/admin/design.aspx?docuid="+curPageDocId);
            }
        }
    }
}

//设计模板跳转的函数
function onDesignThemeDoc(themeId) {
    if (themeId.indexOf("-") == 0) {
        themeId = themeId.substring(1);

    }
   
    if (mynet_IsDesignWin()) {// in design window
        var frameSrc = "design2.aspx?docuid=" + themeId;
        document.getElementById("designFrame").src = frameSrc;
        currentPageNode = document.getElementById("mynetPageNode_x");
    }
    else //in manage window
    {
        window.location.href = "/admin/design.aspx?docuid=" + themeId;
    }
}
function onSetSmartDisplayShowNameInToolBar(context, designPanel) {
    var designData = context.designData;
    var indexPos = designData.indexOf("^|");
    if (indexPos >= -1) {
        var smartDisplayName = designData.substring(0, indexPos);
        designPanel.previousSibling.childNodes[0].childNodes[0].innerHTML = smartDisplayName;
    }
}
(function ($) {
    // txt , cmb , chk  ,rdo ,  pwd  ,validator
    var _defaultRules = {
        checkNull: "default",
        checkEmail: "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\.\\w+([-.]\\w+)*",
        checkEN: "^[a-zA-Z]+$",
        checkDate: "^\\d{4}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}$",
        checkCH: "^[\\u4E00-\\u9FFF]+$",
        checkWebAddr: "[a-zA-z]+:\\/\\/[^\\s]*"
    };
    var _defaultErrorMessage = {
        checkNull: "不能为空",
        checkEmail: "Email格式不合法",
        checkNumber: "不是数字",
        checkEN: "不是字母",
        checkPredict: "不能一致",
        checkDate: "不是日期",
        checkCH: "不是汉字",
        checkWebAddr: "不是网址",
        checkNeeded: "必须选中",
        checkLength: "文本过长",
        checkDBLength: "数据库一个汉字占两个长度",
        checkLimitUpper: "超过上限",
        checkLimitLower: "超过下限",
        checkLimit: "不在范围之内",
        checkStartDate: "开始日期不能大于结束日期",
        checkEndDate: "结束日期不能小于开始日期",
        checkCustomize: "自定义校验失败",
        checkBigger: "大数应该大于小数",
        checkSmaller: "小数应该小于大数",
        checkBigger2: "大数应该大于等于小数",
        checkSmaller2: "小数应该小于等于大数"
    };
    var _isChecked = true;
    var _messageMode = {};
    var _messageBoardContent = "";
    var _messagePos = ["behind", "forward", "left-top", "right-top", "left-bottom", "right-bottom"];
    var _unCheckTag = ["select", "checkbox", "radio"];
    var _messageStyle = "";
    var _isUsedCheckingStyle = false;
    var _checkingStyle = {
        focus: "border:dashed 1px black",
        invalidate: "border:dashed 1px red",
        validate: "border:solid 1px green"
    };
    var _eventMode = true;
    var _scrollEle;
    function isHitRect(pt) {
        if (_scrollEle && _scrollEle.get(0)) {
            var cPos = _scrollEle.offset();
            var cwidth = _scrollEle.width();
            var cheight = _scrollEle.height();
            var cleft = cPos.left;
            var cright = cPos.left + cwidth;
            var ctop = cPos.top;
            var cbottom = cPos.top + cheight;

            if ((pt.leftNumber > cleft && pt.leftNumber < cright) &&
            (pt.topNumber > ctop && pt.topNumber < cbottom)) {
                return true;
            } else {
                return false;
            }
        }
        return false;
    }
    function bindScrollContainer(containerID) {
        _scrollEle = $("#" + containerID);
        _scrollEle.scroll(function () {
            var ids = getCheckModeIDS();
            var j_ids = "#" + $.replaceAll(ids, ",", ",#");

            $(j_ids).each(function () {
                var id = $(this).attr("id");
                var curMM = _messageMode[id];
                var jerr = $("#" + id + "ErrorMessage");
                if (jerr.get(0)) {
                    var ismatch = $("#" + id).attr("ismatch");

                    var messMode = (curMM.indexOf("umode") != -1) ? "relative:10,15" : curMM;
                    var pos = getMessagePos(id, jerr.height(), jerr.width(), messMode);
                    jerr.css({ top: pos.top, left: pos.left });
                    /*
                    添加判断矩形 pos 定点落入矩形内就显示 cleft , cleft + width , ctop ,ctop + height
                    */
                    if (isHitRect(pos)) {
                        if (ismatch.toString() == "false") {
                            jerr.show();
                        }
                    } else {
                        jerr.hide();
                    }

                }
                var sign = $("#" + id + "SuccessSign");
                if (sign.get(0)) {
                    var pos = getMessagePos(id, sign.height(), sign.width(), "behind");
                    if (isHitRect(pos)) {
                        sign.show();
                    } else {
                        sign.hide();
                    }
                }
            });
        });
    }


    function useCheckingStyle(id, chkStyleKey) { // chkStyleKey: focus,invalidate,validate
        if (_isUsedCheckingStyle == true) {
            var strCss = _checkingStyle[chkStyleKey];
            useStyle(id, strCss);
        }
    }
    function useStyle(id, styleText) {
        if (!styleText) return;
        var strCss = styleText.toLowerCase();
        if (strCss.indexOf(":") == -1) { //此时用className
            $("#" + id).addClass(strCss); return;
        } else { // 用style 字符串
            var arrCss = [];
            if (strCss.indexOf(";") == -1) { //此时就一个css属性
                arrCss = strCss.split(":");
                $("#" + id).css($.trim(arrCss[0]), $.trim(arrCss[1]));
            } else {
                arrCss = strCss.split(";");
                for (var i = 0; i < arrCss.length; i++) {
                    var arrCssItem = arrCss[i].split(":");
                    $("#" + id).css($.trim(arrCssItem[0]), $.trim(arrCssItem[1]));
                }
            }
        }
    }
    function isEleInArray(el, ar) {
        if (ar.length == 0) { return false; }
        else {
            var ret = false;
            for (var i = 0; i < ar.length; i++) {
                if (ar[i] == el) { ret = true; break; }
            }
            return ret;
        }
    }
    function isUnCheckTag(tag, attrType) {
        return isEleInArray(tag.toLowerCase(), _unCheckTag) |
              isEleInArray(attrType.toLowerCase(), _unCheckTag);
    }

    function getMessagePos(id, errHeight, errWidth, messageMode) {
        var retPos = { left: 0, top: 0, leftNumber: 0, topNumber: 0 };
        var ctlPos = $("#" + id).offset();  //得到控件的位置信息
        var ctlHeight = $("#" + id).height(); //得到控件的高度
        var ctlWidth = $("#" + id).width();   //得到控件的宽度
        var strMessHeight = errHeight, strMessWidth = errWidth, str = "";
        var l, t, offset = 6, micoffset = 2;

        var messWidth = parseInt(strMessWidth);
        var messHeight = parseInt(strMessHeight);

        // 先判断messageMode 为 absolute 和 relative
        if (messageMode.indexOf("absolute") != -1) {
            var posStr = messageMode.split(":")[1];
            var posArr = posStr.split(",");
            retPos = { left: posArr[0] + "px", top: posArr[1] + "px", leftNumber: posArr[0], topNumber: posArr[1] };
        } else if (messageMode.indexOf("relative") != -1) {
            var posControl = ctlPos;
            var posStr = messageMode.split(":")[1];
            var posArr = posStr.split(",");
            var le = AddNumber(posControl.left, posArr[0]);
            var to = AddNumber(posControl.top, posArr[1]);
            retPos = { left: le + "px", top: to + "px", leftNumber: le, topNumber: to };
        } else {
            switch (messageMode) {
                case "behind": l = ctlPos.left + ctlWidth + offset + micoffset;
                    t = ctlPos.top;
                    break;
                case "forward": l = ctlPos.left - messWidth - offset;
                    t = ctlPos.top;
                    break;
                case "left-top": l = ctlPos.left;
                    t = ctlPos.top - messHeight - offset;
                    break;
                case "right-top": l = ctlPos.left + ctlWidth - messWidth;
                    t = ctlPos.top - messHeight - offset;
                    break;
                case "left-bottom": l = ctlPos.left;
                    t = ctlPos.top + ctlHeight + offset + micoffset;
                    break;
                case "right-bottom": l = ctlPos.left + ctlWidth - messWidth;
                    t = ctlPos.top + ctlHeight + offset + micoffset;
                    break;
            }
            retPos.left = l + "px"; retPos.leftNumber = l;
            retPos.top = t + "px"; retPos.topNumber = t;
        }
        return retPos;
    }

    function AddNumber(n1, n2) {
        var _n1 = parseInt(n1);
        var _n2 = parseInt(n2);
        if (!isNaN(_n1) && !isNaN(_n2)) {
            return _n1 + _n2;
        } else {
            return 0;
        }
    }

    function showControlMessageUMode(id, curMM, result) {
        var mmArr = curMM.split(':');
        var umode = mmArr[0];
        var usign = mmArr[1];
        if (!result.match) { //match = false
            $("#" + id + "SuccessSign").remove();
            $("#" + id + "ErrorMessage").remove();
            var div = "<div id='{0}ErrorMessage' class='{1}'><div class='right'></div><div class='content'>{2}</div><div style='clear:both'></div></div>";
            var classnm = "";
            if (umode == "umode-blue") { classnm = "validator_messageBlue"; }
            if (umode == "umode-pink") { classnm = "validator_messagePink"; }
            var content = $.format(div, id, classnm, result.message);
            $("body").append(content);

            $("#" + id + "ErrorMessage").css("position", "absolute");
            var h = $("#" + id + "ErrorMessage").height();
            var w = $("#" + id + "ErrorMessage").width();
            var pos = getMessagePos(id, h, w, "relative:10,15");

            if (_scrollEle) {
                if (isHitRect(pos) == false) {
                    return;
                }
            }
            $("#" + id + "ErrorMessage").css({ top: pos.top, left: pos.left }).hide().fadeIn("slow");

        } else { // match = true
            $("#" + id + "SuccessSign").remove();
            if (usign) {
                var div = "<div id='{0}SuccessSign'><img src='/res/validatorImage/xzaj.gif' width='17' height='13'/></div>";
                var content = $.format(div, id, result.message);
                $("body").append(content);
                $("#" + id + "SuccessSign").css("position", "absolute");
                var h = $("#" + id + "SuccessSign").height();
                var w = $("#" + id + "SuccessSign").width();
                pos = getMessagePos(id, h, w, "behind");
                if (_scrollEle) {
                    if (isHitRect(pos) == false) {
                        return;
                    }
                }
                $("#" + id + "SuccessSign").css({ top: pos.top, left: pos.left }).hide().fadeIn("fast");
            }
        }

    }
    function showControlMessage(id, curMM, result) {

        if (!curMM) {
            if (_messageStyle.indexOf("umode") != -1) {
                curMM = _messageStyle;
            } else {
                curMM = "behind";
            }
            _messageMode[id] = curMM;
        } // 默认在控件后面显示

        if (curMM.indexOf("umode") != -1) { // show umodeMessage
            showControlMessageUMode(id, curMM, result);
            return;
        }

        var isPos = isEleInArray(curMM, _messagePos), pos;
        var isErrID = false;
        if (!isPos && curMM.indexOf("absolute") == -1 && curMM.indexOf("relative") == -1) {
            isErrID = true;
        }
        if (!result.match) { //match = false
            if (isErrID) {   //{ctrID: errMessageID 
                $("#" + curMM).text(result.message);
                $("#" + curMM).show();
                return;
            }
            $("#" + id + "ErrorMessage").remove();
            /////////////////////////////////////////////////////////////////////////////////
            var div = "<div id=\"{0}ErrorMessage\">{1}</div>";

            var content = $.format(div, id, result.message);
            $("body").append(content);
            useStyle(id + "ErrorMessage", _messageStyle);
            $("#" + id + "ErrorMessage").css("position", "absolute");
            var h = $("#" + id + "ErrorMessage").height();
            var w = $("#" + id + "ErrorMessage").width();
            pos = getMessagePos(id, h, w, curMM);
            if (_scrollEle) {
                if (isHitRect(pos) == false) {
                    return;
                }
            }
            $("#" + id + "ErrorMessage").css({ top: pos.top, left: pos.left }).hide().fadeIn("slow");
            ///////////////////////////////////////////////////////////////////////////////////

        } else { // match = true
            if (isErrID) {//{ctrID: errMessageID
                $("#" + curMM).hide();
                return;
            }
            if ($("#" + id + "ErrorMessage").length == 0) { return; }
            else {
                $("#" + id + "ErrorMessage").hide();
            }

        }
    }
    function dealingCheckResult(id, result) {
        /*******设置边框校验成功失败时的样式**********/
        if (!result.match) { //如果结果不满足 设置 invalidate 否则 validate
            useCheckingStyle(id, "invalidate");
        } else {
            useCheckingStyle(id, "validate");
        }

        $("#" + id).attr("ismatch", result.match);

        /********************设置提示信息模式**********/

        if (_messageMode["uniqueBoard"]) {        // 判断是否是 uniqueBoard 模式
            if (!result.match) { _messageBoardContent += result.message + "<br>"; }
            return;
        } else if (_messageMode["checkResult"]) { // 判断是否是 自定义函数模式
            result.ctrID = id;
            _messageMode["checkResult"](result);
            return;
        } else {                                  // 控件ID 加位置模式                        
            var curMM = _messageMode[id];
            showControlMessage(id, curMM, result);
            return;
        }
        /***********************************************/
    }

    function getchkModeAttr(str) { //[message] (checkParams)
        var startIndex = 1;
        var endIndex = str.length - 1;
        return str.substring(startIndex, endIndex);
    }

    function parseCheckMode(checkMode, ruleName) {//如果有ruleName 则返回 ruleName 所在的对象，否则返回数组

        if (ruleName && checkMode.indexOf(ruleName) == -1) { return null; }
        //checkMode = $.replaceAll(checkMode, " ", "");
        var modes = checkMode.split("|");
        var patten = /\[.*\]|\(.*\)/g;
        var patten1 = /\[.*\]/;  // [messageItem]
        var patten2 = /\(.*\)/;  // (checkParam)
        var tempArr = [];
        var retCheckMode = [];
        for (var i = 0; i < modes.length; i++) {
            var str = modes[i];
            var checkItemName = str.replace(patten, "");
            var attrObject = { checkItem: "", messageItem: "", checkParams: "" };
            attrObject["checkItem"] = checkItemName;
            tempArr = str.match(patten2);
            if (tempArr && tempArr.length > 0) { attrObject["checkParams"] = tempArr[0]; }
            var tempstr = str.replace(patten2, "");
            tempArr = tempstr.match(patten1);
            if (tempArr && tempArr.length > 0) { attrObject["messageItem"] = tempArr[0]; }
            if (ruleName && ruleName == checkItemName) { return attrObject };
            retCheckMode.push(attrObject);
        }
        return retCheckMode;
    }



    function saveInitialStyle(ele, id, style) {
        var _jid = id;
        var _jdata = $.data(ele, _jid + "_style");
        if (!_jdata) { _jdata = style; $.data(ele, _jid + "_style", _jdata); }

    }
    function hideSuccessSign() {
        var ids = getCheckModeIDS();
        var j_signids = "#" + $.replaceAll(ids, ",", "SuccessSign,#") + "SuccessSign";
        $(j_signids).hide();
    }

    function hideMode() {

        if (_messageMode["uniqueBoard"]) {   // 判断是否是 uniqueBoard 模式
            var boardID = _messageMode["uniqueBoard"];
            if (_messageMode["showBoard"] == "always") { return; }
            if (_messageMode["showBoard"] == "checking") { $("#" + boardID).hide(); }
            return;
        }
        if (!_messageMode["checkResult"]) { // 判断是控件ID +left top 模式
            var ids = getCheckModeIDS();
            var j_errids = "#" + $.replaceAll(ids, ",", "ErrorMessage,#") + "ErrorMessage";
            $(j_errids).hide();
        }
    }

    function onCheck(id) {
        var ele = $("#" + id)[0];
        if (!ele) { return { match: false, message: "element null" }; }
        var _jid = ele.id;
        var _result = checkChain(ele, _jid);
        dealingCheckResult(_jid, _result);
        return _result;
    }

    var checker = {
        isNotNull: function (v, key) {
            v = $.trim(v);
            var ret = { match: true, message: "" };
            if (v == "" || v == undefined) {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
            }
            return ret;
        },
        isEmail: function (v, key) {
            var ret = { match: true, message: "", isLocalMessage: false };
            if (v.indexOf(".") == -1) {
                ret.match = false;
                ret.message = "email中没有字符.";
                ret.isLocalMessage = true;
                return ret;
            }
            if (v.indexOf("@") == -1) {
                ret.match = false;
                ret.message = "email中没有字符@";
                ret.isLocalMessage = true;
                return ret;
            }
            var reg = new RegExp(_defaultRules[key]);
            if (!reg.test(v)) {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
                return ret;
            }
            return ret;
        },
        isNumber: function (v, key) {
            var ret = { match: true, message: "" };
            if (!isNaN(v)) {
                var strv = v.toString();
                strv = strv.charAt(strv.length - 1);
                if (strv == ".") {
                    ret.match = false;
                    ret.message = "小数点后面没有数字";
                }
            } else {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
            }
            return ret;
        },
        isEN: function (v, key) {
            var ret = { match: true, message: "" };
            var reg = new RegExp(_defaultRules[key]);
            if (!reg.test(v)) {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
                return ret;
            }
            return ret;
        },
        isDate: function (v, key) {
            var ret = { match: true, message: "" };
            var reg = new RegExp(_defaultRules[key]);
            if (!reg.test(v)) {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
                return ret;
            }
            return ret;
        },
        isCH: function (v, key) {
            var ret = { match: true, message: "" };
            var reg = new RegExp(_defaultRules[key]);
            if (!reg.test(v)) {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
                return ret;
            }
            return ret;
        },
        isWebAddr: function (v, key) {
            var ret = { match: true, message: "" };
            var reg = new RegExp(_defaultRules[key]);
            if (!reg.test(v)) {
                ret.match = false;
                ret.message = _defaultErrorMessage[key];
                return ret;
            }
            return ret;
        },
        check2Date: function (start, end) {
            var dstart = new Date(start);
            var dend = new Date(end);
            return dend >= dstart;
        }
    };

    function checkChain() { //这里处理ERROR MESSAGE 
        var ele = arguments[0];
        var _jid = arguments[1];
        var checkMode = $("#" + _jid).attr("checkMode");
        var checkItems = parseCheckMode(checkMode);

        var _key, _obj = { match: true, message: "", uncheck: false }, _ismatch = true;

        for (var i = 0; i < checkItems.length; i++) {
            var checkItem = checkItems[i];
            var _key = checkItem["checkItem"];
            var _mess = getchkModeAttr(checkItem["messageItem"]);
            var _param = getchkModeAttr(checkItem["checkParams"]);
            if ((!$(ele).val()) && _key != "checkNull") { _obj.uncheck = true; break; } //没值，并且不是checknull当成布尔真处理
            switch (_key) {
                case "checkNull":
                    if (!_param) {
                        _obj = checker.isNotNull(ele.value, _key);
                        _ismatch = _obj.match;
                        _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    } else {
                        var groupName = _param;
                        var ids = getCheckModeIDS();
                        var j_ids = "#" + $.replaceAll(ids, ",", ",#");
                        var j_obj = $(j_ids).filter("[checkMode^=checkNull(" + groupName + ")]");
                        _ismatch = false;
                        j_obj.each(function () {
                            var _locmatch = $(this).val() ? true : false;
                            _ismatch = _ismatch | _locmatch;
                        });
                        _obj.message = _mess ? _mess : _obj.message;
                        _obj.match = _ismatch;
                    }
                    break;
                case "checkEmail":
                    _obj = checker.isEmail(ele.value, _key);
                    _ismatch = _obj.match;
                    _obj.message = !_ismatch && _mess && !_obj.isLocalMessage ? _mess : _obj.message;
                    break;
                case "checkNumber":
                    _obj = checker.isNumber(ele.value, _key);
                    _ismatch = _obj.match;
                    _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    break;
                case "checkMoney":
                    _obj = checker.isNumber(ele.value, _key);
                    _ismatch = _obj.match;
                    if (_ismatch) {
                        var vlen = _param;
                        var numv = ele.value;
                        var v = numv.split('.')[1];
                        if (v) { 
                            if ( v.length > vlen) {
                                _obj.match = _ismatch = false;
                            }
                        }
                    }
                    _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    break;

                case "checkEN":
                    _obj = checker.isEN(ele.value, _key);
                    _ismatch = _obj.match;
                    _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    break;
                case "checkDate":
                    _obj = checker.isDate(ele.value, _key);
                    _ismatch = _obj.match;
                    _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    break;
                case "checkCH":
                    _obj = checker.isCH(ele.value, _key);
                    _ismatch = _obj.match;
                    _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    break;
                case "checkWebAddr":
                    _obj = checker.isWebAddr(ele.value, _key);
                    _ismatch = _obj.match;
                    _obj.message = !_ismatch && _mess ? _mess : _obj.message;
                    break;
                case "checkPredict":
                    var preText = $.trim($("#" + _jid).attr("predicttext"));
                    var val = $.trim($("#" + _jid).val());
                    var arrt = preText.split(',');
                    if (isEleInArray(val, arrt)) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkNeeded":
                    var checked = $("#" + _jid).attr("checked");
                    _ismatch = _obj.match = checked;
                    _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    break;
                case "checkLength":
                    var val = $("#" + _jid).val();
                    var maxLenStr = _param;
                    if (val.length > parseInt(maxLenStr)) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkDBLength":
                    var val = $("#" + _jid).val();
                    var maxLenStr = _param;
                    var objdb = checkDBLength(val, maxLenStr);
                    if (objdb.isMatchLen == false) {
                        _ismatch = obj.match = objdb.isMatchLen;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkLimitUpper":
                    var val = $("#" + _jid).val();
                    var limitParamUpper = _param;
                    var _obj = checker.isNumber(val, "checkNumber");
                    if (_obj.match) {
                        var n = parseFloat(val);
                        var nupper = parseFloat(limitParamUpper);
                        if (n > nupper) {
                            _ismatch = _obj.match = false;
                            _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                        }
                    }
                    break;
                case "checkLimitLower":
                    var val = $("#" + _jid).val();
                    var limitParamLower = _param;
                    var _obj = checker.isNumber(val, "checkNumber");
                    if (_obj.match) {
                        var n = parseFloat(val);
                        var nlower = parseFloat(limitParamLower);
                        if (n < nlower) {
                            _ismatch = _obj.match = false;
                            _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                        }
                    }
                    break;
                case "checkLimit":
                    var val = $("#" + _jid).val();
                    var limitParam = _param;
                    var _obj = checker.isNumber(val, "checkNumber");
                    if (_obj.match) {
                        var n = parseFloat(val);
                        var arrLimit = limitParam.split(",");
                        var arrLimisMess = _mess.split(",");
                        var nlower = parseFloat(arrLimit[0]);
                        var nupper = parseFloat(arrLimit[1]);
                        if (n < nlower) { _ismatch = _obj.match = false; _obj.message = arrLimisMess[0] ? arrLimisMess[0] : _defaultErrorMessage[_key]; }
                        if (n > nupper) { _ismatch = _obj.match = false; _obj.message = arrLimisMess[1] ? arrLimisMess[1] : _defaultErrorMessage[_key]; }
                    }
                    break;
                case "checkStartDate":
                    var val = $("#" + _jid).val();
                    var dateResult = checker.isDate(val, "checkDate");  //判断当前value是日期格式
                    if (dateResult.match == false) { _obj = dateResult; _ismatch = false; _obj.message = "start date" + _obj.message; break; }
                    var dateParam = _param;  //判断参数为空
                    if (!dateParam) { _ismatch = _obj.match = false; _obj.message = "start date param is null"; break; }
                    dateResult = checker.isDate(dateParam, "checkDate"); //判断参数是日期格式
                    if (dateResult.match == true) {
                        var bstartend = checker.check2Date(dateParam, val); //判断当前日期比参数日期大
                        if (bstartend == false) {
                            _ismatch = _obj.match = false; _obj.message = _mess ? _mess : _defaultErrorMessage[_key]; break;
                        }
                    } else {
                        var isele = $("#" + dateParam).length > 0; //判断参数是end date 控件ID
                        if (isele == false) {
                            _ismatch = _obj.match = false;
                            _obj.message = "can not find end date control";
                            break;
                        } else {  // find end date control
                            var _vv = $("#" + dateParam).val();
                            if (_vv) {
                                dateResult = checker.isDate(_vv, "checkDate"); //判断end date 控件的值是日期格式
                                if (dateResult.match == false) {
                                    _obj = dateResult; _ismatch = false; _obj.message = "end date" + _obj.message; break; //end date不是日期
                                } else {
                                    var bs_e = checker.check2Date(val, _vv);
                                    if (bs_e == false) {
                                        _ismatch = _obj.match = false; _obj.message = _mess ? _mess : _defaultErrorMessage[_key]; break;
                                    }
                                }
                            }
                        }
                    }
                    break;
                case "checkEndDate":
                    var val = $("#" + _jid).val();
                    var dateResult = checker.isDate(val, "checkDate");  //判断当前value是日期格式
                    if (dateResult.match == false) { _obj = dateResult; _ismatch = false; _obj.message = "end date" + _obj.message; break; }
                    var dateParam = _param;  //判断参数为空
                    if (!dateParam) { _ismatch = _obj.match = false; _obj.message = "end date param is null"; break; }
                    dateResult = checker.isDate(dateParam, "checkDate"); //判断参数是日期格式
                    if (dateResult.match == true) {
                        var bstartend = checker.check2Date(val, dateParam); //判断当前日期比参数日期小
                        if (bstartend == false) {
                            _ismatch = _obj.match = false; _obj.message = _mess ? _mess : _defaultErrorMessage[_key]; break;
                        }
                    } else {
                        var isele = $("#" + dateParam).length > 0; //判断参数是start date 控件ID
                        if (isele == false) {
                            _ismatch = _obj.match = false;
                            _obj.message = "can not find start date control";
                            break;
                        } else {  // find start date control
                            var _vv = $("#" + dateParam).val();
                            if (_vv) {
                                dateResult = checker.isDate(_vv, "checkDate"); //判断start date 控件的值是日期格式
                                if (dateResult.match == false) {
                                    _obj = dateResult; _ismatch = false; _obj.message = "start date" + _obj.message; break; //end date不是日期
                                } else {
                                    var bs_e = checker.check2Date(_vv, val);
                                    if (bs_e == false) {
                                        _ismatch = _obj.match = false; _obj.message = _mess ? _mess : _defaultErrorMessage[_key]; break;
                                    }
                                }
                            }
                        }
                    }
                    break;
                case "checkCustomize":
                    var val = $("#" + _jid).val();
                    var cparam = getchkModeAttr(_param);
                    var reg = new RegExp(cparam);
                    if (!reg.test(val)) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkBigger":
                    var v_bigger = $("#" + _jid).val(); //Bigger v
                    var csmallId = _param;
                    var v_smaller = $("#" + csmallId).val();
                    if (isNaN(v_bigger) || isNaN(v_smaller)) {
                        //  _ismatch = _obj.match = true;
                        break;
                    }
                    var bigger = parseFloat(v_bigger);
                    var smaller = parseFloat(v_smaller);
                    if (smaller > bigger) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkSmaller":
                    var v_smaller = $("#" + _jid).val();
                    var cbiggerId = _param;
                    var v_bigger = $("#" + cbiggerId).val();

                    if (isNaN(v_bigger) || isNaN(v_smaller)) {
                        //  _ismatch = _obj.match = true;
                        break;
                    }
                    var bigger = parseFloat(v_bigger);
                    var smaller = parseFloat(v_smaller);
                    if (smaller > bigger) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkBigger2":
                    var v_bigger = $("#" + _jid).val(); //Bigger v
                    var csmallId = _param;
                    var v_smaller = $("#" + csmallId).val();
                    if (isNaN(v_bigger) || isNaN(v_smaller)) {
                        //  _ismatch = _obj.match = true;
                        break;
                    }
                    var bigger = parseFloat(v_bigger);
                    var smaller = parseFloat(v_smaller);
                    if (smaller >= bigger) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;
                case "checkSmaller2":
                    var v_smaller = $("#" + _jid).val();
                    var cbiggerId = _param;
                    var v_bigger = $("#" + cbiggerId).val();

                    if (isNaN(v_bigger) || isNaN(v_smaller)) {
                        //  _ismatch = _obj.match = true;
                        break;
                    }
                    var bigger = parseFloat(v_bigger);
                    var smaller = parseFloat(v_smaller);
                    if (smaller >= bigger) {
                        _ismatch = _obj.match = false;
                        _obj.message = _mess ? _mess : _defaultErrorMessage[_key];
                    }
                    break;

            } // end switch
            if (_ismatch == false) { break; }

        }
        return _obj;
    }
    function getDBLength(str) {
        var re = /[\u4E00-\u9FFF]/g;
        var len = str.length;
        var splitStr = str.replace(re, "");
        var splitlen = splitStr.length;
        var dblen = (len - splitlen) * 2 + splitlen;
        return dblen;
    }
    function checkDBLength(str, maxlen) { //returnval = {isMatchLen, newStr }
        var obj = { isMatchLen: true, newStr: str };
        var dblen = getDBLength(str);

        if (dblen > maxlen) {

            obj.isMatchLen = false;
            var slength = str.length;
            var tempStr = str;
            do {
                --slength;
                tempStr = str.substr(0, slength);
                dblen = getDBLength(tempStr);
            }
            while (dblen > maxlen)
            obj.newStr = tempStr;
        }
        return obj;
    }
    function bindCheckDBLength(ele, chkDBLengthItem) {
        var lengthparam = chkDBLengthItem["checkParams"];
        var maxLength = getchkModeAttr(lengthparam);
        $(ele).attr("realmaxlength", maxLength);
        var _message = chkDBLengthItem["messageItem"];
        if (!_message) { _message = _defaultErrorMessage["checkDBLength"]; };
        $(ele).keydown(function (event) {
            if (event.metaKey) { return; } // 如果按下ctrl 键不做处理
            var v = $(this).val();
            var vlength = getDBLength(v);
            var len = parseInt($(this).attr("realmaxlength"));
            if (vlength == len) {
                dealingCheckResult(ele.id, { match: false, message: _message });
            }
        });
        if ($.browser.msie) {  // ie
            $(ele).keyup(function (event) {
                var v = $(this).val();
                var vlength = getDBLength(v);
                var len = parseInt($(this).attr("realmaxlength"));
                if (vlength >= len) {
                    var obj = checkDBLength(v, len);
                    $(this).val(obj.newStr);
                } else {
                    hideMode();
                }
            }).bind("beforepaste", function (event) { //dblength   not written
                var v_clip = window.clipboardData.getData("Text");
                var v_this = $(this).val();
                var maxlen = parseInt($(this).attr("realmaxlength"));
                var v_clip_length = getDBLength(v_clip);
                var v_this_length = getDBLength(v_this);
                var vlength = v_clip_length + v_this_length;
                if (v_this > maxlen) {
                    var obj = checkDBLength(v_this, maxlen);
                    $(this).val(obj.newStr);
                    window.clipboardData.setData("Text", "");
                } else if (v_this_length == maxlen) {
                    window.clipboardData.setData("Text", "");
                    dealingCheckResult(ele.id, { match: false, message: _message });
                } else if (v_this_length < maxlen && vlength > maxlen) {
                    var obj = checkDBLength(v_this + v_clip, maxlen);
                    var newStr = obj.newStr.replace(v_this, "");
                    window.clipboardData.setData("Text", newStr);
                }
            }).bind("propertychange", function () {
                var v = $(this).val();
                var len = parseInt($(this).attr("realmaxlength"));
                var obj = checkDBLength(v, len);
                if (!obj.isMatchLen) {
                    dealingCheckResult(ele.id, { match: false, message: _message });
                }
            });
        } //end is ie
        else if ($.browser.mozilla) { //firefox
            $(ele).bind("input", function () {

                var v = $(this).val();
                var len = parseInt($(this).attr("realmaxlength"));
                var obj = checkDBLength(v, len);
                if (obj.isMatchLen) { hideMode(); }
                else {
                    dealingCheckResult(ele.id, { match: false, message: _message });
                    $(this).val(obj.newStr);
                }
            });
        } // end is firefox
    }
    function bindCheckLength(ele, chkLengthItem) {
        var lengthparam = chkLengthItem["checkParams"];
        var maxLength = getchkModeAttr(lengthparam);
        $(ele).attr("realmaxlength", maxLength);
        var _message = chkLengthItem["messageItem"];
        if (!_message) { _message = _defaultErrorMessage["checkLength"]; };
        $(ele).keydown(function (event) {
            if (event.metaKey) { return; } // 如果按下ctrl 键不做处理
            var v = $(this).val();
            var vlength = v.length;
            var len = parseInt($(this).attr("realmaxlength"));
            if (vlength == len) {
                dealingCheckResult(ele.id, { match: false, message: _message });
            }
        });
        if ($.browser.msie) {  // ie
            $(ele).keyup(function (event) {
                var v = $(this).val();
                var vlength = v.length;
                var len = parseInt($(this).attr("realmaxlength"));
                if (vlength >= len) {
                    var splitV = v.substr(0, len);
                    $(this).val(splitV);
                } else {
                    hideMode();
                }
            }).bind("beforepaste", function (event) {
                var v1 = window.clipboardData.getData("Text");
                var v2 = $(this).val();
                var maxlen = parseInt($(this).attr("realmaxlength"));
                var vlength = v1.length + v2.length;
                if (v2.length > maxlen) {
                    var vv = v2.substr(0, maxlen);
                    $(this).val(vv);
                    window.clipboardData.setData("Text", "");
                } else if (v2.length == maxlen) {
                    window.clipboardData.setData("Text", "");
                    dealingCheckResult(ele.id, { match: false, message: _message });
                } else if (v2.length < maxlen && vlength > maxlen) {
                    var llen = maxlen - v2.length;
                    var clipStr = v1.substr(0, llen);
                    window.clipboardData.setData("Text", clipStr);
                }
            }).bind("propertychange", function () {
                var v = $(this).val();
                var vlength = v.length;
                var maxlen = parseInt($(this).attr("realmaxlength"));
                if (vlength > maxlen) {  //提示消息代码
                    dealingCheckResult(ele.id, { match: false, message: _message });
                }
            });
        } //end is ie
        else if ($.browser.mozilla) { //firefox
            $(ele).bind("input", function () {
                var v = $(this).val();
                var vlength = v.length;
                var maxlen = parseInt($(this).attr("realmaxlength"));
                if (vlength > maxlen) {
                    //提示消息代码
                    dealingCheckResult(ele.id, { match: false, message: _message });
                    $(this).val(v.substr(0, maxlen));
                } else {
                    hideMode();
                }
            });
        } // end is firefox
    }
    function setPredictText(ele, chkPredictItem) {
        if (chkPredictItem) {
            var predictparma = chkPredictItem["checkParams"];
            var predictText = getchkModeAttr(predictparma);
            var pptext = "";
            var val = $(ele).val();
            if (predictText) { pptext = predictText; }
            if (val) { pptext = val; }
            if (predictText && val) { pptext = predictText + "," + val; }
            $(ele).attr("predicttext", pptext);
        }
    }
    function getCheckModeIDS() {
        var j_ids = "";
        $("input[checkMode],select[checkMode],textarea[checkMode]").each(function () {
            j_ids += $(this).attr("id") + ",";
        });
        j_ids = j_ids.substr(0, j_ids.length - 1);
        return j_ids;
    }
    $.replaceAll = function (source, searchText, replaceWith) {
        return source.replace(new RegExp(searchText, "gm"), replaceWith);
    };
    $.format = function () {
        if (arguments.length == 0) { return null; }
        if (arguments.length == 1) { return arguments[0]; }
        var str = arguments[0];
        for (var i = 1; i < arguments.length; i++) {
            var re = new RegExp('\\{' + (i - 1) + '\\}', 'gm');
            str = str.replace(re, arguments[i]);
        }
        return str;
    }
    $.validator = function () { };
    $.extend($.validator, {
        setEventMode: function (isEventMode) {
            hideMode();
            if (isEventMode == false) {
                var ids = getCheckModeIDS();
                var j_ids = "#" + $.replaceAll(ids, ",", ",#");
                $(j_ids).each(function () {
                    var strMode = $(this).attr("checkMode");
                    if (strMode.indexOf("useEventMode") != -1) {
                        return true;
                    }
                    //$(this).unbind("focus");
                    $(this).unbind("blur");
                    $(this).unbind("keydown");
                    $(this).unbind("keyup");
                    $(this).unbind("beforepaste");
                    $(this).unbind("propertychange");
                    $(this).unbind("input");
                });
            } else {
                this.initialize();
            }
        },
        getMessageMode: function () {
            return _messageMode;
        },
        setMessageMode: function (mode) {
            hideMode();
            _messageMode = mode;
            //初始化时隐藏 模式1或模式3

        },
        setMessageStyle: function (messStyle) { //每个控件的style 或 统一的style ??
            _messageStyle = messStyle;
        },
        setCheckingStyle: function (isUsed, checkingStyle) {
            hideMode();
            _isUsedCheckingStyle = isUsed;
            if (isUsed == true && checkingStyle) { _checkingStyle = checkingStyle; }
        },
        initialize: function () { // 查找页面 带checkMode 的元素
            var ids = getCheckModeIDS();
            var j_ids = "#" + $.replaceAll(ids, ",", ",#");
            $(j_ids).each(function () {
                var ele = $(this)[0]; if (!ele) { return; }
                var _jid = ele.id;
                var chkModeStr = $(this).attr("checkMode");
                if (ele.tagName.toLowerCase() == "textarea" || ele.tagName.toLowerCase() == "select") {  //textarea,select

                    var chkPredictItem = parseCheckMode(chkModeStr, "checkPredict"); //  bind predict
                    if (chkPredictItem) { setPredictText(ele, chkPredictItem); }
                    var chkLengthItem = parseCheckMode(chkModeStr, "checkLength"); // bind checkLength
                    if (chkLengthItem) { bindCheckLength(ele, chkLengthItem); }
                    var chkDBlengthItem = parseCheckMode(chkModeStr, "checkDBLength"); // bind checkdblength
                    if (chkDBlengthItem) { bindCheckDBLength(ele, chkDBlengthItem); }
                }
                else if (ele.tagName.toLowerCase() == "input" && ele.type.toLowerCase() == "text") {
                    var chkPredictItem = parseCheckMode(chkModeStr, "checkPredict"); // if checkPredict predict
                    if (chkPredictItem) { setPredictText(ele, chkPredictItem); }
                    var chkLengthItem = parseCheckMode(chkModeStr, "checkLength");
                    if (chkLengthItem) {
                        var lengthparam = chkLengthItem["checkParams"];
                        var maxLength = parseInt(getchkModeAttr(lengthparam));
                        var _message = chkLengthItem["messageItem"];
                        if (!_message) { $(ele).attr("maxlength", maxLength); } //如果没有message 直接使用 maxlenth="maxlen" 属性  不会弹出 错误消息
                        else { bindCheckLength(ele, chkLengthItem); }                // 用 弹出错误消息模式
                    } //end chkLengthItem
                    var chkDBlengthItem = parseCheckMode(chkModeStr, "checkDBLength"); // bind checkdblength
                    if (chkDBlengthItem) { bindCheckDBLength(ele, chkDBlengthItem); }
                } // end input text
            });
            $(j_ids).click(function () { // bind element event  onfous,onblur,keydown
                useCheckingStyle($(this).attr("id"), "focus");
                hideMode();
                if (isUnCheckTag($(this)[0].tagName, $(this)[0].type)) { return; }
                var chkItem = $(this).attr("checkMode");
                var tag = $(this)[0].tagName.toLowerCase();
                if (chkItem.indexOf("checkPredict") != -1 && tag != "select") {
                    var v = $(this).val();
                    var preText = $(this).attr("predicttext");
                    var arrtxt = preText.split(',');
                    if (isEleInArray($.trim(v), arrtxt)) { $(this).val(""); }
                }
            }).blur(function () {
                if (isUnCheckTag($(this)[0].tagName, $(this)[0].type)) { return; }
                var ele = $(this)[0]; if (!ele) { return; }
                var _jid = ele.id;
                var chkItem = $(this).attr("checkMode");
                var tag = $(this)[0].tagName.toLowerCase();
                if (chkItem.indexOf("checkPredict") != -1 && tag != "select") {
                    var v = $(this).val();
                    var preText = $(this).attr("predicttext");
                    if ($.trim(v) == "") {
                        $(this).val(preText.split(',')[0]);
                    }
                }
                onCheck(_jid);
            }).keydown(function (event) {
                if (isUnCheckTag($(this)[0].tagName, $(this)[0].type)) { return; }
                if (event.keyCode == 13) {
                    var ele = $(this)[0]; if (!ele) { return; }
                    var _jid = ele.id;
                    onCheck(_jid);
                    return false; // <=> event.preventDefault() 当页面只有一个元素时按回车提交的问题
                }
            }); //是否加回车验证？
        },
        setScrollContainer: function (containerID) {

            bindScrollContainer(containerID);

        },
        setCheckMode: function (id, checkMode, message) {
            if ($("#" + id).length > 0) {
                if (checkMode) {
                    $("#" + id).attr("checkMode", checkMode);
                    this.setValidateIDS(id);
                }
                if (message) { $("#" + id).attr("message", message); }
            }
        },
        check: function (id, checkMode) {
            if ($("#" + id).length > 0) {
                if (checkMode) {
                    $("#" + id).attr("checkMode", checkMode);
                }
            }
            var _result = onCheck(id);
            _isChecked = _isChecked & _result.match;
            return _result.match;
        },
        checkStart: function () {
            _messageBoardContent = "";
            _isChecked = false;
        },
        checkEnd: function () {
            var boardID = _messageMode["uniqueBoard"];
            if (boardID) {
                if (_isChecked == false) {
                    var mode = _messageMode["showMessage"];
                    if (mode == "multiline") { $("#" + boardID).html(_messageBoardContent).fadeIn("fast"); }
                    if (mode == "singleline") { _messageBoardContent = _messageBoardContent.split("<br>")[0]; $("#" + boardID).html(_messageBoardContent).fadeIn("fast"); }
                } else {
                    if (_messageMode["showBoard"] == "always") { return; }
                    if (_messageMode["showBoard"] == "checking") { $("#" + boardID).hide(); }

                }
            }
        },
        checkAll: function () {
            var ids = getCheckModeIDS();
            var arr = ids.split(",");
            this.checkStart();
            var _checkAll = true;
            for (var i = 0; i < arr.length; i++) {
                _checkAll = _checkAll & this.check(arr[i]);
            }
            this.checkEnd();
            return _checkAll;
        },
        hideMessage: function (signMode) {
            if (signMode == "error") {
                hideMode();
            }
            if (signMode == "umode-sign") {
                hideSuccessSign();
            }
        }
    });
})(jQuery);
// ----------------------------------------------------------
// ******************  ?风声 JS 窗口 V1.00  ******************
// 作者：风声
// 版本?.00
// 网站：http://www.fonshen.com
// 邮件：webmaster@fonshen.com
// 版权：版权全体,源代码公开,各种用途均可免费使用
// **********************************************************
// ----------------------------------------------------------
function UseVistaInIE6(obj) {
    var s = obj.button ? "_BY_BUTTON" : "";
    var filter = ""
    obj.sides[0].style.cssText += BuildVistaFilerStr("LEFT_TOP.png");
    obj.sides[1].style.cssText += BuildVistaFilerStr("TOP.png");
    obj.sides[2].style.cssText += BuildVistaFilerStr("RIGHT_TOP.png");
    obj.sides[3].style.cssText += BuildVistaFilerStr("RIGHT.png");
    obj.sides[4].style.cssText += BuildVistaFilerStr("RIGHT_BOTTOM.png");
    obj.sides[5].style.cssText += BuildVistaFilerStr("BOTTOM.png");
    obj.sides[6].style.cssText += BuildVistaFilerStr("LEFT_BOTTOM.png");
    obj.sides[7].style.cssText += BuildVistaFilerStr("LEFT.png");
}
function BuildVistaFilerStr(imgName) {
    return ";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://res.mynet.cn/res/images/vista/" + imgName + "', sizingMethod='scale');background-image:url('http://res.mynet.cn/res/images/vista/" + imgName + "') !important;background-image:none;";
}

function _window(features) {
    this.id = this.name = "_W_" + (++_window.wIndex);
    this.string = "_window.windows." + this.id;
    this.zIndex = ++_window.zIndex;
    this.className = _window.getFeature(features, "class") || _window.ClassName;
    this.bodyWidth = parseInt(_window.getFeature(features, "width")) || _window.Width;
    this.bodyHeight = parseInt(_window.getFeature(features, "height")) || _window.Height;
    this.left = _window.getFeature(features, "left");
    this.top = _window.getFeature(features, "top");
    this.right = _window.getFeature(features, "right");
    this.bottom = _window.getFeature(features, "bottom");
    this.move = _window.getFeature(features, "move").toLowerCase() || "move";
    this.isModal = _window.getFeature(features, "ismodal") ? true : false;
    this.button = _window.getFeature(features, "button").toUpperCase();
    this.resize = _window.getFeature(features, "resize").toLowerCase() || "resize";
    this.buttons = {};
    this.frameUrl = "";
    this.isReady = false;
    transparentLowerWindow();
    _window.windows[this.id] = this;
    _window.Ids.push(this.id);
}

function transparentLowerWindow() {
    for (var i = 0; i < _window.Ids.length; i++) {
        //解决点击"编辑"控件时，报className"undefined"错误
        if (typeof(_window.windows[_window.Ids[i]].modal) != "undefined")
            _window.windows[_window.Ids[i]].modal.className = "MODAL_Tran";
    }
}

_window.Version = "Fonshen JS Window V1.00.08.01.03";
_window.ClassName = "VISTA";
_window.Width = 400;
_window.Height = -1;
_window.Timer = 10;
_window.windows = {};
_window.wIndex = 0;
_window.zIndex = 19820120;
_window.clientWidth = 0;
_window.clientHeight = 0;
_window.onmousemove = null;
_window.onmouseup = null;
_window.onselectstart = null;
//增加语言版本判断
_window.Language = "cn";
_window.Ids = new Array();
_window.Frames = new Array(); //缓存Iframe，避免创建过多占用内存

_window.getFeature = function (source, name) {
    var reg = new RegExp("(^|,|\\s)" + name + "\\s*=\\s*([^,]*)(\\s|,|$)", "i");
    if (reg.test(source)) return RegExp.$2;
    return "";
};
_window.getMaxNumber = function () {
    var num = 0;
    for (var i = 0; i < arguments.length; i++) if (arguments[i] > num) num = arguments[i];
    return num;
};

_window.Open = function (content, title, features) {
    var obj = new _window(features);
    obj.Creat(content, title);
    return obj;
};
_window.Alert = function (content, title, features) {
    var obj = new _window(features);
    obj.button = "OK";
    obj.isModal = true;
    obj.Creat(content, title || "Alert");
    return obj;
};
_window.Confirm = function (content, title, features) {
    var obj = new _window(features);
    obj.button = "OK|CANCEL";
    obj.isModal = true;
    obj.Creat(content, title || "Confirm");
    return obj;
};


_window.prototype.Creat = function (content, title) {
    var obj = this;
    var IsIE = mynet_GetNavigator() == "MSIE";
    if (IsIE && (document.body.readyState != "loaded" ||
             (document.forms.length > 0 && document.forms[0].readyState != "loaded")
    ))//延迟创建避免报错
    {
        var interObj = setInterval(
                   function () {
                       if ((document.forms.length > 0 && document.forms[0].readyState == "complete")
             || document.body.readyState != "loaded") {
                           obj.InternalCreate(content, title);
                           obj.isReady = true;
                           clearInterval(interObj);
                       }
                   }, 30);
    }
    else {
        obj.InternalCreate(content, title);
        obj.isReady = true;
    }
}
_window.prototype.InternalCreate = function (content, title) {
    if (this.isModal) {
        this.modal = document.createElement("div");
        this.modal.className = "MODAL";
        this.modal.style.position = "absolute";
        this.modal.style.zIndex = this.zIndex;
        this.modal.style.width = $().width() + "px";
        this.modal.style.height = $().height() + "px";
        this.modal.style.left = "0px";
        this.modal.style.top = "0px";
        document.body.insertBefore(this.modal, null);
        var ieVersion = mynet_GetIeVersion();
        if (ieVersion > 0 && ieVersion < 7) {//IE 6挡不住Iframe
            var iframeMask = this.GetFrame(this.id, "", true);
            this.modal.appendChild(iframeMask);
            this.iframeMask = iframeMask;
            iframeMask.width = $().width() + "px";
            iframeMask.height = $().height() + "px";
        }
        this.zIndex = ++_window.zIndex;
    }
    this.board = document.createElement("div");
    this.board.className = this.className;
    this.board.style.position = "absolute";
    this.board.style.zIndex = this.zIndex;
    this.board.style.visibility = "hidden";
    document.body.insertBefore(this.board, null);
    if (!_window.clientHeight) {
        this.board.style.left = "100%";
        this.board.style.top = "100%";
        _window.clientWidth = this.board.offsetLeft;
        _window.clientHeight = this.board.offsetTop;
    }
    var styles = new Array("LEFT_TOP", "TOP", "RIGHT_TOP", "RIGHT", "RIGHT_BOTTOM", "BOTTOM", "LEFT_BOTTOM", "LEFT", "CONTENT", "TITLE");
    this.sides = new Array();
    if (this.button) {
        styles[4] = "RIGHT_BOTTOM_BY_BUTTON";
        styles[5] = "BOTTOM_BY_BUTTON";
        styles[6] = "LEFT_BOTTOM_BY_BUTTON";
        styles[styles.length] = "BUTTON";
    }
    if (this.resize != "no") styles[styles.length] = "RESIZE";
    styles[styles.length] = "CLOSE";
    for (var i = 0; i < styles.length; i++) {
        var obj = document.createElement("div");
        obj.className = styles[i];
        obj.style.position = "absolute";
        $(obj).attr("winId", this.id);
        this.board.appendChild(obj);
        switch (styles[i]) {
            case "CONTENT":
                if (content.slice(0, 5) == "[url]") {
                    var loadingBar = document.createElement("div");
                    loadingBar.className = "winLoadingBar";
                    loadingBar.innerHTML = "<img src='http://res.mynet.cn/res/images/loader.gif'/>  请稍候...";
                    loadingBar.style.left = (this.bodyWidth / 2 - 40) + "px";
                    loadingBar.style.top = this.bodyHeight / 2 + "px";
                    loadingBar.style.zIndex = this.zIndex + 1;
                    loadingBar.style.position = "absolute";
                    this.board.appendChild(loadingBar);
                    this.loadingBar = loadingBar;
                }

                this.contentCase = obj;
                obj.style.width = this.bodyWidth + "px";
                this.SetContent(content);
                obj.style.height = this.bodyHeight + "px";
                obj.style.left = (this.sides[7].width + obj.offsetLeft) + "px";

                obj.style.top = (this.sides[1].height + obj.offsetTop) + "px";

                obj.onmousedown = function () { _window.windows[$(this).attr("winId")].Focus(); };
                this.width = this.bodyWidth + this.sides[3].width + this.sides[7].width;
                this.height = this.bodyHeight + this.sides[1].height + this.sides[5].height;
                this.board.style.height = this.height + "px";
                this.board.style.width = this.width + "px";
                this.minWidth = _window.getMaxNumber(this.sides[0].width + this.sides[2].width, this.sides[3].width + this.sides[7].width, this.sides[4].width + this.sides[6].width) + 20;
                this.minHeight = _window.getMaxNumber(this.sides[0].height + this.sides[6].height, this.sides[1].height + this.sides[5].height, this.sides[2].height + this.sides[4].height) + 2;
                break;

            case "TITLE":
                this.titleCase = obj;
                obj.style.width = this.width + "px";
                this.titleCase.dx = obj.offsetWidth - this.width;
                if (this.minWidth < this.titleCase.dx) this.minWidth = this.titleCase.dx;
                if (this.width > this.titleCase.dx) obj.style.width = (this.width - this.titleCase.dx) + "px";
                this.SetTitle(title);
                if (this.move == "no") {
                    obj.onmousedown = function (e) {
                        _window.windows[$(this).attr("winId")].Focus();
                    }
                } else {
                    obj.onmousedown = function (e) {
                        _window.windows[$(this).attr("winId")].PreMove(e ? e : window.event);
                    }
                }
                break;

            case "BUTTON":
                this.buttonCase = obj;
                obj.style.width = this.width + "px";
                obj.style.bottom = "0px";
                this.buttonCase.dx = obj.offsetWidth - this.width;
                if (this.minWidth < this.buttonCase.dx) this.minWidth = this.buttonCase.dx;
                if (this.width > this.buttonCase.dx) obj.style.width = (this.width - this.buttonCase.dx) + "px";
                var buttons = this.button != "UNDEFINED" ? this.button.split("|") : new Array();
                if (buttons.length == 0) {
                    obj.style.display = 'none'; //there is no buttons then hidden the banner
                    obj.disabled = true;
                }
                else {
                    obj.style.backgroundColor = "#CCCCCC";
                }

                for (var j = 0; j < buttons.length; j++) {
                    var o = document.createElement("button");
                    o.className = buttons[j];

                    //chengfeng.sue 2009-07-09 Title 与按钮文字一致无需提示。
                    //o.title = buttons[j];
                    //判断语言版
                    if (_window.Language == "en")
                        o.innerHTML = buttons[j] == "OK" ? "OK" : "Cancel";
                    else
                        o.innerHTML = buttons[j] == "OK" ? "确定" : "取消";
                    obj.appendChild(o);
                    $(o).attr("buttonFunc", buttons[j]);
                    o.onclick = function (e) { eval("_window.windows[$(this).parent().attr('winId')].On" + $(this).attr("buttonFunc") + "();"); };
                    this.buttons[buttons[j]] = o;
                }
                break;

            case "RESIZE":
                obj.style.cursor = "se-resize";
                obj.onmousedown = function (e) { _window.windows[$(this).attr("winId")].PreResize(e ? e : window.event); };
                break;

            case "CLOSE":
                obj.onclick = function (e) { _window.windows[$(this).attr("winId")].OnClose(); };
                break;

            default:
                this.sides[i] = obj;
                this.sides[i].width = obj.offsetWidth;
                this.sides[i].height = obj.offsetHeight;
                if (this.move == "no") {
                    obj.onmousedown = function (e) {
                        _window.windows[$(this).attr("winId")].Focus();
                    }
                } else {
                    obj.onmousedown = function (e) {
                        _window.windows[$(this).attr("winId")].PreMove(e ? e : window.event);
                    }
                }
                break;
        }
    }
    this.sides[1].dx = this.sides[0].width + this.sides[2].width;
    if (this.width > this.sides[1].dx) this.sides[1].style.width = (this.width - this.sides[1].dx) + "px";
    this.sides[3].dy = this.sides[2].height + this.sides[4].height;
    if (this.height > this.sides[3].dy) this.sides[3].style.height = (this.height - this.sides[3].dy) + "px";
    this.sides[5].dx = this.sides[4].width + this.sides[6].width;
    if (this.width > this.sides[5].dx) this.sides[5].style.width = (this.width - this.sides[5].dx) + "px";
    this.sides[7].dy = this.sides[6].height + this.sides[0].height;
    if (this.height > this.sides[7].dy) this.sides[7].style.height = (this.height - this.sides[7].dy) + "px";

    this.sides[0].style.left = "0px";
    this.sides[0].style.top = "0px";
    this.sides[1].style.left = this.sides[0].width + "px";
    this.sides[1].style.top = "0px";
    this.sides[2].style.right = "0px";
    this.sides[2].style.top = "0px";
    this.sides[3].style.right = "0px";
    this.sides[3].style.top = this.sides[2].height + "px";
    this.sides[4].style.right = "0px";
    this.sides[4].style.bottom = "0px";
    this.sides[5].style.left = this.sides[6].width + "px";
    this.sides[5].style.bottom = "0px";
    this.sides[6].style.left = "0px";
    this.sides[6].style.bottom = "0px";
    this.sides[7].style.left = "0px";
    this.sides[7].style.top = this.sides[0].height + "px";

    var ieVersion = mynet_GetIeVersion();
    if (_window.ClassName == "VISTA") {
        if (ieVersion > 0 && ieVersion < 7) UseVistaInIE6(this);
        this.SetTitle(title);
    }

    this.left = this.left ? parseInt(this.left) : (this.right ? _window.clientWidth - this.width - parseInt(this.right) : parseInt((_window.clientWidth - this.width) / 2));
    this.top = this.top ? parseInt(this.top) : (this.bottom ? _window.clientHeight - this.height - parseInt(this.bottom) : parseInt((_window.clientHeight - this.height) / 2));
    if (this.left < 0) this.left = 0;
    if (this.top < 0) this.top = 0;
    this.left += document.documentElement.scrollLeft;
    this.top += document.documentElement.scrollTop;
    this.board.style.left = this.left + "px";
    this.board.style.top = this.top + "px";
    this.board.style.visibility = "visible";
    this.board.focus();
    this.status = 1;
};


_window.prototype.OnFrameLoad = function () {
    if (this.iframe == null)
        return;
    if (this.buttons["OK"] != null && this.buttons["OK"].disabled == true) {
        this.EnableButton("OK");
    }
    if (this.bodyHeight < 0) {
        if (this.bh < 2) {
            this.ResizeBy(0, frames[frames.length - 1].document.documentElement.scrollHeight);
        }
    }
    if (this.title == null || this.title == "") {
        if (this.IsCrossingDomain()) { //如果跨域，则设置title 为空
            this.SetTitle("");
        } else {
            this.SetTitle(this.iframe.contentWindow.document.title);
        }
    }
    this.ResizeBy(2, 2);
    this.loadingBar.style.display = 'none';

    var buttonPanel = !this.IsCrossingDomain() ? this.iframe.contentWindow.document.getElementById("VIOpenWindowDivFootDiv") : null;
    if (buttonPanel != null) {
        //buttonPanel.style.top = (this.iframe.contentWindow.document.body.clientHeight - 32) + "px";
        buttonPanel.focus();
    }

}
_window.prototype.GetFrame = function (id, url, isMask) {
    //类似存储_window.Frames["1-used"];_window.Frames["2"];最多允许弹出4层
    //找到一个没有被用过的Iframe
    var frame = null;
    var frameCount = 0;
    for (var i = 0; i < _window.Frames.length; i++) {
        if (_window.Frames[i] != null && _window.Frames[i].src == "javascript:''")//释放过的窗口
        {
            frame = _window.Frames[i];
            break;
        }
    }

    if (frame == null) {
        frame = document.createElement("iframe");
        _window.Frames.push(frame);
    }
    if (isMask == true) {
        frame.id = id + "mask";
        frame.name = id + "mask";
        frame.style.cssText = 'visibility:visible;moz-opacity:0.0;filter:alpha(opacity=0);position:absolute;';
    }
    else {
        frame.id = id;
        frame.name = id;
        frame.frameBorder = '0';
        frame.marginHeight = '0'; frame.marginWidth = '0'; frame.width = '100%'; frame.height = '100%';
        var tempString = this.id;
        if (mynet_GetNavigator() == "MSIE") {
            /*弹出层加载完页面加载focue事件，focus校验层z-index值，由于部分页面加载过慢，使得弹出层顺序混乱。在IE7以上版本屏蔽此功能。*/
            var _ieVer = mynet_GetIeVersion();
            if (_ieVer < 8 && _ieVer > 0)
                frame.attachEvent("onfocus", function () { _window.windows[tempString].Focus(); });
            frame.attachEvent("onload", function () { _window.windows[tempString].OnFrameLoad(); });
        }
        else {
            frame.onfocus = function () { _window.windows[tempString].Focus(); };
            frame.onload = function () { _window.windows[tempString].OnFrameLoad(); };
        }
    }
    frame.src = url;
    frame.style.visibility = "visible";
    return frame;
}

_window.prototype.SetContent = function (content) {
    var type = content.slice(0, 5), tent = content.slice(5);
    if (this.oldcase) {
        this.oldcase.appendChild(this.oldcontent);
        this.oldcase = null;
    }

    if (type == "[url]") {
        if (tent.indexOf('?') != -1) {
            tent += "&winid=" + this.id;
        }
        else {
            tent += "?winid=" + this.id;
        }
        this.frameUrl = tent;
        if (this.iframe) {
            if (this.contentCase.firstChild != this.iframe) this.contentCase.replaceChild(this.iframe, this.contentCase.firstChild);
            this.iframe.src = tent;
        }
        else {

            var id = "_F" + this.id;
            var contentIframe = this.GetFrame(id, tent);
            this.contentCase.appendChild(contentIframe);
            this.iframe = contentIframe;
            if (this.bodyHeight < 0) this.bodyHeight = 1;

        }
    }
    else {
        if (this.form) {
            if (this.contentCase.firstChild != this.form) this.contentCase.replaceChild(this.form, this.contentCase.firstChild);
        }
        else {
            this.form = document.createElement("form");
            this.form.className = "FORM";
            this.form.method = "post";
            this.form.onsubmit = function (e) { return false; };
            if (this.contentCase.hasChildNodes()) this.contentCase.replaceChild(this.form, this.contentCase.firstChild);
            else this.contentCase.appendChild(this.form);
        }
        if (type == "[obj]" || content.slice(0, 4) == "[id]") {
            if (type == "[obj]") this.oldcontent = eval(tent);
            else this.oldcontent = document.getElementById(content.slice(4));
            this.oldcase = this.oldcontent.parentNode;
            this.form.appendChild(this.oldcontent);
        }
        else {
            this.form.innerHTML = content;
        }
        if (this.bodyHeight < 0) this.bodyHeight = this.contentCase.offsetHeight + 1;
        this.contentCase.style.overflow = "auto";
    }
    this.content = content;
};


_window.prototype.SetTitle = function (title) {
    title = title || "";
    if (this.title == title) return false;
    this.titleCase.innerHTML = title;
    this.title = title;
};

//判断iframe 是否跨域
_window.prototype.IsCrossingDomain = function () {
    var pattern = "http\:\/\/.*?\/";
    var reg = new RegExp(pattern,"ig");
    var mainUrl = document.location.href.toLowerCase();
    var frameurl = this.iframe.src.toLowerCase();
    if (mainUrl == frameurl) { return false; }
    var domain1 = mainUrl.match(reg);
    var domain2 = frameurl.match(reg);
    if (domain1 && domain2 && domain1[0] && domain2[0]) {
        if (domain1[0].toLowerCase() == domain2[0].toLowerCase()) {
            return false;
        } else {
            return true;
        }
    } else {
        return true;
    }
};

_window.prototype.Focus = function () {
    if (this.zIndex < _window.zIndex) this.board.style.zIndex = this.zIndex = ++_window.zIndex;
};
_window.prototype.Close = function () {
    try {
        if (this.iframe != null) {            
          this.iframe.src = "'about:blank'";
            this.iframe.style.visibility = "hidden";
        }
        if (this.iframeMask != null) {
          this.iframeMask.src = "'about:blank'";
            this.iframeMask.style.visibility = "hidden";
        }
        this.Hidden();
        _window.Ids.splice(_window.Ids.length - 1, 1); //移出当前窗口ＩＤ
        if (_window.Ids.length > 0) {//最后一个窗口设置透明度
            _window.windows[_window.Ids[_window.Ids.length - 1]].modal.className = "MODAL";
        }
        for (var key in this) delete this[key];
        delete _window.windows[this.id];
        CollectGarbage();

    }
    catch (e) {
    }
};
_window.prototype.Hidden = function () {
    if (typeof (this.MoveTimer) != "undefined") clearTimeout(this.MoveTimer);
    if (typeof (this.ResizeTimer) != "undefined") clearTimeout(this.ResizeTimer);
    document.body.removeChild(this.board);
    if (this.isModal) document.body.removeChild(this.modal);
    if (this.oldcase) this.oldcase.appendChild(this.oldcontent);
    this.status = 0;
};
_window.prototype.Show = function () {
    if (this.oldcase) this.form.appendChild(this.oldcontent);
    if (this.isModal) document.body.appendChild(this.modal);
    document.body.appendChild(this.board);
    this.status = 1;
};

_window.prototype.Duplicate = function () {
    this.copy = document.createElement("DIV");
    document.body.appendChild(this.copy);
    this.copy.style.cssText = "position:absolute;left:" + (this.left - 2) + "px;top:" + (this.top - 2) + "px;width:" + this.width + "px;height:" + this.height + "px;border:2px dotted #000000;";
    this.copy.style.zIndex = this.zIndex + 1;
};
_window.prototype.DetachEvent = function (e) {
    document.body.style.cursor = "default";
    document.onmousemove = _window.onmousemove;
    document.onmouseup = _window.onmouseup;
    document.onselectstart = _window.onselectstart;
    if (this.board.releaseCapture) this.board.releaseCapture();
};
_window.prototype.AttachEvent = function (e) {
    _window.onmousemove = document.onmousemove;
    _window.onmouseup = document.onmouseup;
    _window.onselectstart = document.onselectstart;
    if (e.preventDefault) e.preventDefault();
    else {
        document.onselectstart = function () { return false; };
        if (this.board.setCapture) this.board.setCapture();
    }
};

_window.prototype.PreResize = function (e) {
    if (typeof (this.ResizeTimer) != "undefined") clearTimeout(this.ResizeTimer);
    this.Focus();
    this.Duplicate();
    this.resizeX = e.clientX - this.width - 4;
    this.resizeY = e.clientY - this.height - 4;
    document.body.style.cursor = "se-resize";
    this.AttachEvent(e);
    eval("document.onmousemove=function(e){" + this.string + ".Resize(e?e:window.event);};");
    eval("document.onmouseup=function(e){" + this.string + ".Resized(e?e:window.event);};");
};
_window.prototype.Resize = function (e) {
    if (this.resize != "resize-y") {
        var w = e.clientX - this.resizeX;
        if (w >= this.minWidth) this.copy.style.width = w + "px";
    }
    if (this.resize != "resize-x") {
        var h = e.clientY - this.resizeY;
        if (h >= this.minHeight) this.copy.style.height = h + "px";
    }
};
_window.prototype.Resized = function (e) {
    this.DetachEvent(e);
    var dx = 0, dy = 0;
    if (this.resize != "resize-y") {
        var w = e.clientX - this.resizeX - 4;
        w = (w > this.minWidth) ? w : this.minWidth;
        dx = w - this.width;
    }
    if (this.resize != "resize-x") {
        var h = e.clientY - this.resizeY - 4;
        var h = (h > this.minHeight) ? h : this.minHeight;
        dy = h - this.height;
    }
    if (_window.Timer > 0 && this.width >= this.minWidth && this.height >= this.minHeight) this.ActResizeBy(dx, dy);
    else this.ResizeBy(dx, dy);
    document.body.removeChild(this.copy);
    this.copy = null;

};
_window.prototype.ResizeBy = function (dx, dy) {
    if (dx) {
        this.width += dx;
        this.board.style.width = this.width + "px";
        this.sides[1].style.width = (this.width - this.sides[1].dx) + "px";
        this.sides[5].style.width = (this.width - this.sides[5].dx) + "px";
        this.titleCase.style.width = (this.width - this.titleCase.dx) + "px";
        if (this.buttonCase) this.buttonCase.style.width = (this.width - this.buttonCase.dx) + "px";
        this.bodyWidth += dx;
        this.contentCase.style.width = this.bodyWidth + "px";

    }
    if (dy) {
        this.height += dy;
        this.board.style.height = this.height + "px";
        this.sides[3].style.height = (this.height - this.sides[3].dy) + "px";
        this.sides[7].style.height = (this.height - this.sides[7].dy) + "px";
        this.bodyHeight += dy;
        this.contentCase.style.height = this.bodyHeight + "px";

    }
};
_window.prototype.ActResizeBy = function (dx, dy) {
    if (dx || dy) {
        var x = dx / 10;
        x = (x > 0) ? Math.ceil(x) : Math.floor(x);
        var y = dy / 10;
        y = (y > 0) ? Math.ceil(y) : Math.floor(y);
        this.ResizeBy(x, y);
        dx -= x;
        dy -= y;
        this.ResizeTimer = window.setTimeout(this.string + ".ActResizeBy(" + dx + "," + dy + ")", _window.Timer);
    }
};

_window.prototype.PreMove = function (e) {
    if (typeof (this.MoveTimer) != "undefined") clearTimeout(this.MoveTimer);
    this.Focus();
    this.Duplicate();
    this.moveX = e.clientX - this.left + 2;
    this.moveY = e.clientY - this.top + 2;
    document.body.style.cursor = "move";
    this.AttachEvent(e);
    eval("document.onmousemove=function(e){" + this.string + ".Move(e?e:window.event);};");
    eval("document.onmouseup=function(e){" + this.string + ".Moved(e?e:window.event);};");
};
_window.prototype.Move = function (e) {
    if (this.move != "move-y") this.copy.style.left = (e.clientX - this.moveX) + "px";
    if (this.move != "move-x") this.copy.style.top = (e.clientY - this.moveY) + "px";
};
_window.prototype.Moved = function (e) {
    this.DetachEvent(e);
    var tx = (this.move == "move-y") ? null : (e.clientX - this.moveX + 2);
    var ty = (this.move == "move-x") ? null : (e.clientY - this.moveY + 2);
    if (_window.Timer > 0) this.ActMoveTo(tx, ty);
    else this.MoveTo(tx, ty);
    document.body.removeChild(this.copy);
    this.copy = null;
};
_window.prototype.MoveTo = function (tx, ty) {
    if (tx != null) {
        this.left = tx;
        this.board.style.left = tx + "px";
    }
    if (ty != null) {
        this.top = ty;
        this.board.style.top = ty + "px";
    }
};
_window.prototype.ActMoveTo = function (tx, ty) {
    if ((tx == null || tx == this.left) && (ty == null || ty == this.top)) return;
    if (tx != null) {
        var dx = (tx - this.left) / 10;
        dx = (dx > 0) ? Math.ceil(dx) : Math.floor(dx);
        this.left += dx;
    } if (ty != null) {
        var dy = (ty - this.top) / 10;
        dy = (dy > 0) ? Math.ceil(dy) : Math.floor(dy);
        this.top += dy;
    }
    this.MoveTo(this.left, this.top);
    this.MoveTimer = window.setTimeout(this.string + ".ActMoveTo(" + tx + "," + ty + ")", _window.Timer);
};

_window.prototype.DisableButton = function (name, style) {
    name = name.toUpperCase();
    this.buttons[name].disabled = true;
    this.buttons[name].className = (style ? style : "DISABLED") + " " + name;
};
_window.prototype.HiddenButton = function (name) {
    name = name.toUpperCase();
    this.buttons[name].style.display = "none";
};

_window.prototype.ShowButton = function (name) {
    name = name.toUpperCase();
    this.buttons[name].style.display = "inline";
};

_window.prototype.EnableButton = function (name) {
    name = name.toUpperCase();
    this.buttons[name].disabled = false;
    this.buttons[name].className = name;
};

_window.prototype.OnBACK = function () {
    if (!this.step) this.step = 0;
    if (this.OnBACKS) { if (this.step > 0) this.OnBACKS[--this.step](); }
};
_window.prototype.OnNEXT = function () {
    if (!this.step) this.step = 0;
    if (this.OnNEXTS) { if (this.step < this.OnNEXTS.length) this.OnNEXTS[this.step](); }
};
_window.prototype.OnOK = function () {
    if (this.iframe != null && this.iframe.contentWindow != null && typeof (this.iframe.contentWindow.OnSubmitButtonClick) == "function") // 如果对话框存在SubmitButtonClick函数，则调用
        this.iframe.contentWindow.OnSubmitButtonClick();
    else
        this.Close(); // 默认关闭
};
_window.prototype.OnClose = function () {
    this.OnCANCEL();
};

_window.prototype.OnOKCallBack = function (retValue) {

};

_window.prototype.OnCloseCallBack = function () {

};
_window.prototype.OnCANCEL = function () {
    this.Close();
};
/*
* Summary : 带命名空间的mynet functions , 从func.js中分离出来 
* Time    : 2012/02/07
* Editor  : 陆扬
*/
;(function () {
    var mynet = {};
    if (window['mynet']) {
        mynet = window['mynet'];
    } else {
        window['mynet'] = mynet;
    }
    /*
    * Summary : javascript命名空间
    * Usage   : namespace("mynet.spacename1.spacename2");
    *           mynet.spacename1.spacename2.funcName = function(){ ... ...}
    * Email   : zlybright@gmail.com 
    * Time    : 2011/09/22
    * Editor  : 陆扬
    */
    function namespace(str) {
        var arr = str.split("."), o = mynet;
        for (var i = (arr[0] == "mynet") ? 1 : 0; i < arr.length; i++) {
            o[arr[i]] = o[arr[i]] || {};
            o = o[arr[i]];
        }
    }

    /*
    * Summary : mynet is 函数
    * Usage   : 见函数名
    * Email   : zlybright@gmail.com 
    * Time    : 2011/11/25
    * Editor  : 陆扬
    */
    mynet.is_num = function (s) { return !isNaN(s); }
    mynet.is_str = function (s) { return typeof s == "string"; }
    mynet.is_bool = function (s) { return typeof s == "boolean"; }
    mynet.is_func = function (s) { return typeof s == "function"; }
    mynet.is_null = function (s) { return s == null; }
    mynet.is_empty = function (s) { return /^\s*$/.test(s); }
    mynet.is_array = function (s) { return s instanceof Array; }
    mynet.is_undefined = function (s) { return typeof s == "undefined"; }


    /*
    * Summary : 图片自适应方法（此方法建议放在img中的onload事件中）
    * Usage   : <img onload="ImageAdaption(this,width,height)">
    * Email   : liming1@hichina.com 
    * Time    : 2011/09/22
    * Editor  : 李明
    */
    namespace("mynet.utils.image");
    mynet.utils.image.ImageAdaption = function (image, width, height) {
        if (image.width < width && image.height < height) {
            return;
        }
        image.removeAttribute('width');
        image.removeAttribute('height');
        var w = image.width, h = image.height;
        var scaling = w / h;
        if (width != null) {
            if (w > width) {
                image.width = width;
                image.height = width / scaling;
            }
        }
        if (height != null) {
            h = image.height;
            if (h > height) {
                image.width = height * scaling;
                image.height = height;
            }
        }
    };

    /*
    * Summary : ie6 图片 pngfix
    * Usage   :  <img src='' onload='mynet.utils.image.pngfix(this)'/>
    * Email   : zlybright@gmail.com 
    * Time    : 2011/10/28
    * Editor  : 陆扬
    */
    mynet.utils.image.pngfix = function (ele) {
        if (!mynet.utils.browser.msie6) { return; }
        if (!$(ele).is("img")) { return; } // 此处不能写做 if(ele.tagName!="IMG"){ return; } 不知为何 ，若有知情者请告知....谢谢!
        var src = $(ele).attr("src");
        if (!src.match(/.*\.png([?].*)?$/i)) { return; }
        var w = $(ele).width(), h = $(ele).height();
        if (w < 10) { return; } // 图片过小，没有做透明处理的必要
        $(ele).css({ filter: $.format("progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='{0}'", src), width: w, height: h })
       	  .attr({ src: "http://res.mynet.cn/res/plugin/htmleditor/editor/blank.gif" });
    };


    /*
    * Summary : 判断浏览器类型 
    * Usage   : mynet.utils.browser.(msie,msie6,msie7,msie8,msie9,firefox,chrome,maxthon,opera,[quirks怪异模式]）
    * Time    : 2011/10/27 
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    namespace("mynet.utils.browser");
    (function () {
        var ua = navigator.userAgent.toLowerCase();
        var pattern = "(msie) ([\\w.]+)";
        var rmsie = new RegExp(pattern);
        var match = rmsie.exec(ua);
        $.extend(mynet.utils.browser, {
            quirks: !(document.compatMode === "CSS1Compat"),
            msie: match && match[1],
            msie6: match && match[1] && match[2] === "6.0",
            msie7: match && match[1] && match[2] === "7.0",
            msie8: match && match[1] && match[2] === "8.0",
            msie9: match && match[1] && match[2] === "9.0",
            opera: ua.indexOf("opera") > -1,
            chrome: ua.indexOf("chrome") > -1,
            firefox: ua.indexOf("firefox") > -1,
            maxthon: ua.indexOf("maxthon") > -1,
            safari: ua.indexOf("safari") > -1
        });
    })();

    /*
    * Summary : Dom元素是否已经加载完毕,若加载完毕则回调callback函数 
    * Usage   :  mynet.utils.dom.watcher（afunction,{'img':'tag'}）
    * Time    : 2011/10/28 
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    namespace("mynet.utils.dom");
    mynet.utils.dom.watcher = function (callback, a_object) {

        var invokeFlag = true;
        var invokeCount = 0;
        var timerId = setInterval(function () {
            invokeCount++;
            if (typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null)) {
                invokeFlag = false;
                if (typeof a_object == 'object') {
                    for (var key in a_object) {
                        if ((a_object[key] == 'id' && document.getElementById(key) == null) ||
                            (a_object[key] == 'tag' && document.getElementsByTagName(key).length < 1)) {
                            invokeFlag = true; break;
                        }
                    }
                }
                //加载完毕后 调用callback  
                if (!invokeFlag) { clearInterval(timerId); callback(); return; }

            }
            //如果6秒后还没执行callback 则立即执行callback
            if (invokeCount >= 20) { clearInterval(timerId); callback(); }
        }, 300);
    };

    /*
    * Summary : 获取Dom元素compute style ,或者style 数值
    * Usage   :  mynet.utils.dom.getCurrentStylea（domEle , 'height' , true）  c2v: convertToValue
    * Time    : 2011/11/1 
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    mynet.utils.dom.getCurrentStyle = function (element, attrName, c2v) {
        var cstyle;
        if (element.currentStyle) {
            cstyle = element.currentStyle;
        } else {
            cstyle = window.getComputedStyle(element, null)
        }

        if (c2v) {
            var reg = /(\d+)/;
            var match = reg.exec(cstyle[attrName]);
            if (!match) {
                return 0;
            }
            else {
                return match[0] * 1;
            }
        }
        return cstyle[attrName];
    }
    /*json2.js*/
    var JSON; JSON || (JSON = {}); (function () { function k(a) { return a < 10 ? "0" + a : a } function n(a) { o.lastIndex = 0; return o.test(a) ? '"' + a.replace(o, function (c) { var d = q[c]; return typeof d === "string" ? d : "\\u" + ("0000" + c.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + a + '"' } function l(a, c) { var d, f, j = g, e, b = c[a]; if (b && typeof b === "object" && typeof b.toJSON === "function") b = b.toJSON(a); if (typeof h === "function") b = h.call(c, a, b); switch (typeof b) { case "string": return n(b); case "number": return isFinite(b) ? String(b) : "null"; case "boolean": case "null": return String(b); case "object": if (!b) return "null"; g += m; e = []; if (Object.prototype.toString.apply(b) === "[object Array]") { f = b.length; for (a = 0; a < f; a += 1) e[a] = l(a, b) || "null"; c = e.length === 0 ? "[]" : g ? "[\n" + g + e.join(",\n" + g) + "\n" + j + "]" : "[" + e.join(",") + "]"; g = j; return c } if (h && typeof h === "object") { f = h.length; for (a = 0; a < f; a += 1) if (typeof h[a] === "string") { d = h[a]; if (c = l(d, b)) e.push(n(d) + (g ? ": " : ":") + c) } } else for (d in b) if (Object.prototype.hasOwnProperty.call(b, d)) if (c = l(d, b)) e.push(n(d) + (g ? ": " : ":") + c); c = e.length === 0 ? "{}" : g ? "{\n" + g + e.join(",\n" + g) + "\n" + j + "}" : "{" + e.join(",") + "}"; g = j; return c } } if (typeof Date.prototype.toJSON !== "function") { Date.prototype.toJSON = function () { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + k(this.getUTCMonth() + 1) + "-" + k(this.getUTCDate()) + "T" + k(this.getUTCHours()) + ":" + k(this.getUTCMinutes()) + ":" + k(this.getUTCSeconds()) + "Z" : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () { return this.valueOf() } } var p = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, o = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, g, m, q = { "\u0008": "\\b", "\t": "\\t", "\n": "\\n", "\u000c": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, h; if (typeof JSON.stringify !== "function") JSON.stringify = function (a, c, d) { var f; m = g = ""; if (typeof d === "number") for (f = 0; f < d; f += 1) m += " "; else if (typeof d === "string") m = d; if ((h = c) && typeof c !== "function" && (typeof c !== "object" || typeof c.length !== "number")) throw new Error("JSON.stringify"); return l("", { "": a }) }; if (typeof JSON.parse !== "function") JSON.parse = function (a, c) { function d(f, j) { var e, b, i = f[j]; if (i && typeof i === "object") for (e in i) if (Object.prototype.hasOwnProperty.call(i, e)) { b = d(i, e); if (b !== undefined) i[e] = b; else delete i[e] } return c.call(f, j, i) } a = String(a); p.lastIndex = 0; if (p.test(a)) a = a.replace(p, function (f) { return "\\u" + ("0000" + f.charCodeAt(0).toString(16)).slice(-4) }); if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { a = eval("(" + a + ")"); return typeof c === "function" ? d({ "": a }, "") : a } throw new SyntaxError("JSON.parse"); } })();
    namespace("mynet.utils.json");
    mynet.utils.json.parse_obj = JSON.stringify;
    mynet.utils.json.parse_str = JSON.parse;




    /*
    * Summary : 获取中英文数字等混合文本长度   （注）：汉子、全角算长度1 ，英文、数字长度算0.5 
    * Usage   : var len = mynet.utils.text.getMixedTextLen("字符串1"); //len=3.5
    * Time    : 2011/11/25
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    namespace("mynet.utils.text");
    var reg_text = new RegExp("[\u4e00-\u9fa5/～！＠＃￥％……＆（）＋１２３４５６７８９０－＝ｑｗｅｒｔｙｕｉｏｐａｓｄｆｇｈｊｋｌｚｘｃｖｂｎｍＱＷＥＲＴＹＵＩＯＰＡＳＤＦＧＨＪＫＬＺＸＣＶＢＮＭ【】＼｛｝｜；：，。、《》？]", "g");
    mynet.utils.text.getMixedTextLen = function (strInput) {
        strInput = $.trim(strInput);
        if ("string" !== typeof strInput) return -1;
        else {
            var strInputEn = strInput.replace(reg_text, "");
            var totalLength = strInput.length;
            if (!strInputEn)
                return totalLength;
            else
                return totalLength - strInputEn.length / 2;
        }
    }


    /*
    * Summary : 获取中英文数字等混合文本宽度  
    * Usage   : var width = mynet.utils.text.getTextWidth("字符串1","12px"); 
    * Time    : 2011/11/25
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    mynet.utils.text.getTextWidth = function (text, fontsize) {
        var len = mynet.utils.text.getMixedTextLen(text);
        if (mynet.is_str(fontsize)) {
            var fz = fontsize.replace(/px/ig, "");
            if (mynet.is_num(fz)) { return Math.ceil(len * parseInt(fz)); }
            else { return -1; }
        } else if (mynet.is_num(fontsize)) {
            return Math.ceil(len * fontsize);
        } else {
            return -1;
        }
    }

    /*
    * Summary : 获取混合文本子文本 (从开头） 
    * Usage   : var s = mynet.utils.text.mixedSubstr("字23符串1", 2);  //s="字23"
    * Time    : 2011/11/25
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    mynet.utils.text.mixedSubstr = function (text, mixedLength) {
        var tmlen = mynet.utils.text.getMixedTextLen(text);
        if (Math.ceil(tmlen) <= mixedLength) { return text; }

        var result = [], remain = text, mlength = mixedLength, tempText;
        while (mlength > 0 && tempText) {
            tempText = remain.substr(0, Math.ceil(mlength));
            remain = remain.replace(tempText, "");
            result.push(tempText);
            mlength = mlength - mynet.utils.text.getMixedTextLen(tempText);
        }
        return result.join('');
    }

    /*
    * Summary : 按长度截取混合文本  
    * Usage   : var s = mynet.utils.text.splitByWidth("字23符串1",12 ,12);  //s=["字","23","符","串","1"]
    *           var s = mynet.utils.text.splitByWidth("字23符串1",12 ,24);  //s=["字23","符串","1"]
    * Time    : 2011/12/12
    * Editor  : 陆扬
    * Email   : zlybright@gmail.com 
    */
    mynet.utils.text.splitByWidth = function (text, fontSize, width) {

       if (width < fontSize) { throw new Error("width must be great than fontSize"); }
        var txtLen = mynet.utils.text.getMixedTextLen(text);
        var wLen = Math.floor(width / fontSize);
        var result = [];
        if (wLen > txtLen) { return result.push(text); }
        else {
            var strTemp;
            while (txtLen > wLen) {
                strTemp = mynet.utils.text.mixedSubstr(text, wLen);
                result.push(strTemp);
                txtLen -= wLen;
                text = text.replace(strTemp, "");
            }
            result.push(text);
            return result;
        }
    }
})();
if (typeof (mynetMenuData) != 'object') {
    mynetMenuData = new Array; // 存放菜单数据
    mynetMenuTimeout = null; // 存放超时数据
    mynetMenuTarget = window; // 存放显示的窗口
    mynetMenuSource = window; // 存放当前在本窗口显示的菜单数据存放窗口
    mynetMenuObjects = new Array; // 存放菜单对应的对象, array of mynetMenuObject
    mynetMenuTopDiv = null; // the parent of all menu div
    MenuStyle = "border:solid 1px #B9B9B9;background-color:#FFFFFF;";
    MenuItemStyle = "cursor:pointer;height:20px;font-size:12px;background-color:#FFFFFF;color:#000000;";
    MenuItemOverStyle = "cursor:pointer;height:20px;font-size:12px;background-color:silver;color:#000000;";
    BtnBgImg = "btn_black.gif,btn_black_blue.gif";
    ArrImg = "arr_black.gif,arr_white.gif";
    CellPadding = 4;
    MynetcssToJsMap = new Array;
    MynetcssToJsMap["background"] = "background";
    MynetcssToJsMap["background-attachment"] = "backgroundAttachment";
    MynetcssToJsMap["background-color"] = "backgroundColor";
    MynetcssToJsMap["background-image"] = "backgroundImage";
    MynetcssToJsMap["background-position"] = "backgroundPosition";
    MynetcssToJsMap["background-position-x"] = "backgroundPositionX";
    MynetcssToJsMap["background-position-y"] = "backgroundPositionY";
    MynetcssToJsMap["background-repeat"] = "backgroundRepeat";
    MynetcssToJsMap["behavior"] = "behavior";
    MynetcssToJsMap["border"] = "border";
    MynetcssToJsMap["border-bottom"] = "borderBottom";
    MynetcssToJsMap["border-bottom-color"] = "borderBottomColor";
    MynetcssToJsMap["border-bottom-style"] = "borderBottomStyle";
    MynetcssToJsMap["border-bottom-width"] = "borderBottomWidth";
    MynetcssToJsMap["border-color"] = "borderColor";
    MynetcssToJsMap["border-left"] = "borderLeft";
    MynetcssToJsMap["border-left-color"] = "borderLeftColor";
    MynetcssToJsMap["border-left-style"] = "borderLeftStyle";
    MynetcssToJsMap["border-left-width"] = "borderLeftWidth";
    MynetcssToJsMap["border-right"] = "borderRight";
    MynetcssToJsMap["border-right-color"] = "borderRightColor";
    MynetcssToJsMap["border-right-style"] = "borderRightStyle";
    MynetcssToJsMap["border-right-width"] = "borderRightWidth";
    MynetcssToJsMap["border-style"] = "borderStyle";
    MynetcssToJsMap["border-top"] = "borderTop";
    MynetcssToJsMap["border-top-color"] = "borderTopColor";
    MynetcssToJsMap["border-top-style"] = "borderTopStyle";
    MynetcssToJsMap["border-top-width"] = "borderTopWidth";
    MynetcssToJsMap["border-width"] = "borderWidth";
    MynetcssToJsMap["bottom"] = "bottom";
    MynetcssToJsMap["clear"] = "clear";
    MynetcssToJsMap["clip"] = "clip";
    MynetcssToJsMap["color"] = "color";
    MynetcssToJsMap["cursor"] = "cursor";
    MynetcssToJsMap["direction"] = "direction";
    MynetcssToJsMap["display"] = "display";
    MynetcssToJsMap["filter"] = "filter";
    MynetcssToJsMap["font"] = "font";
    MynetcssToJsMap["font-family"] = "fontFamily";
    MynetcssToJsMap["font-size"] = "fontSize";
    MynetcssToJsMap["font-style"] = "fontStyle";
    MynetcssToJsMap["font-variant"] = "fontVariant";
    MynetcssToJsMap["font-weight"] = "fontWeight";
    MynetcssToJsMap["height"] = "height";
    MynetcssToJsMap["layout-flow"] = "layoutFlow";
    MynetcssToJsMap["layout-grid"] = "layoutGrid";
    MynetcssToJsMap["layout-grid-char"] = "layoutGridChar";
    MynetcssToJsMap["layout-grid-line"] = "layoutGridLine";
    MynetcssToJsMap["layout-grid-mode"] = "layoutGridMode";
    MynetcssToJsMap["layout-grid-type"] = "layoutGridType";
    MynetcssToJsMap["left"] = "left";
    MynetcssToJsMap["letter-spacing"] = "letterSpacing";
    MynetcssToJsMap["line-break"] = "lineBreak";
    MynetcssToJsMap["line-height"] = "lineHeight";
    MynetcssToJsMap["overflow"] = "overflow";
    MynetcssToJsMap["overflow-x"] = "overflowX";
    MynetcssToJsMap["overflow-y"] = "overflowY";
    MynetcssToJsMap["padding"] = "padding";
    MynetcssToJsMap["padding-bottom"] = "paddingBottom";
    MynetcssToJsMap["padding-left"] = "paddingLeft";
    MynetcssToJsMap["padding-right"] = "paddingRight";
    MynetcssToJsMap["padding-top"] = "paddingTop";
    MynetcssToJsMap["right"] = "right";
    MynetcssToJsMap["scrollbar-3dlight-color"] = "scrollbar3dLightColor";
    MynetcssToJsMap["scrollbar-arrow-color"] = "scrollbarArrowColor";
    MynetcssToJsMap["scrollbar-base-color"] = "scrollbarBaseColor";
    MynetcssToJsMap["scrollbar-darkshadow-color"] = "scrollbarDarkShadowColor";
    MynetcssToJsMap["scrollbar-face-color"] = "scrollbarFaceColor";
    MynetcssToJsMap["scrollbar-highlight-color"] = "scrollbarHighlightColor";
    MynetcssToJsMap["scrollbar-shadow-color"] = "scrollbarShadowColor";
    MynetcssToJsMap["scrollbar-track-color"] = "scrollbarTrackColor";
    MynetcssToJsMap["float"] = "styleFloat";
    MynetcssToJsMap["text-align"] = "textAlign";
    MynetcssToJsMap["text-align-last"] = "textAlignLast";
    MynetcssToJsMap["text-autospace"] = "textAutospace";
    MynetcssToJsMap["text-decoration"] = "textDecoration";
    MynetcssToJsMap["text-indent"] = "textIndent";
    MynetcssToJsMap["text-justify"] = "textJustify";
    MynetcssToJsMap["text-kashida-space"] = "textKashidaSpace";
    MynetcssToJsMap["text-overflow"] = "";
    MynetcssToJsMap["text-transform"] = "textTransform";
    MynetcssToJsMap["text-underline-position"] = "textUnderlinePosition";
    MynetcssToJsMap["top"] = "top";
    MynetcssToJsMap["unicode-bidi"] = "unicodeBidi";
    MynetcssToJsMap["visibility"] = "visibility";
    MynetcssToJsMap["white-space"] = "whiteSpace";
    MynetcssToJsMap["width"] = "width";
    MynetcssToJsMap["z-index"] = "zIndex";
    MynetcssToJsMap["zoom"] = "zoom";

    var MynetMenuCurrentButtonId = '';

    var mynetMenuOnBlurFunc;
    var menu_load_flag = false;
    function setDivPaddingTop(obj) {

        try {
            var fontSizePx = parseInt(obj.style.fontSize);
            var height = parseInt(obj.clientHeight);
            if (height <= 0) {
                try {
                    height = parseInt(obj.style.height);
                }
                catch (ex) {
                    height = 22;
                }
            }
            var paddingTop = (height - fontSizePx) / 2;
            if (paddingTop < 0)
                paddingTop = 5;
            var menuText = obj.getElementsByTagName("nobr")[0];
            menuText.style.paddingTop = paddingTop + "px";
            menuText.style.display = "inline-block";
            //huangsq 将宽度减2  横向导航
            obj.getElementsByTagName("img")[0].width = obj.clientWidth - 2; // 不要修改style.width, 否则会引起导航条初次访问时变成白底
            if ($.browser.mozilla) {
                var scount = $(obj).siblings().size();
                if (scount == 0) { //如果多导航排列，那么td宽度98%，
                    //$(obj).css("width","98%");//huangsq 2011-2-11
                }
                obj.getElementsByTagName("img")[0].style.height = (height - 2) + "px"; //火狐下图片高度减少2像素,浏览器差异
            }
            //           firefox 宽度自适应  不能这样处理，影响比较大, 不仅仅是横排的导航 竖排也受影响 
            //            if ($.browser.mozilla && menu_load_flag == false) {
            //                var lastchild = $(obj).parent().children(':last');
            //                if (obj == lastchild.get(0)) {
            //                    menu_load_flag = true; 
            //                    var w = 0;
            //                    $(obj).siblings().each(function() {
            //                        w += $(this).width();
            //                    });
            //                    w += $(obj).width();

            //                    var marginw = $(obj).parents('div').parents('div').width() - $(obj).parent().width();

            //                    var n_offset = $(obj).parent().width() - w - marginw;
            //                    lastw = $(obj).width();
            //                    $(obj).width(lastw + n_offset);  //设置最后menuitem 宽度占满容器宽度
            //                    setDivPaddingTop(obj);
            //                }
            //            }               

        }
        catch (e) {
            //alert(e);
        }
    }

    function setTargetCss(oTarget, cssStr) {
        if (!cssStr) return;
        var fontSize = "";
        var reg = new RegExp(";{2,}","g");
        var s = cssStr.replace(reg, ';');        
        var arrCss = s.split(';');
        var len = arrCss.length;
        for (var i = 0; i < len; i++) {
            var cssName = arrCss[i].split(':')[0];
            var cssValue = arrCss[i].substring(cssName.length + 1);
            if (cssName != '' && cssValue != '') oTarget.style[MynetcssToJsMap[cssName]] = cssValue;
            if (cssName == "font-size") {
                fontSize = cssValue;
            }
        }
        var browser = navigator.appName.toLowerCase();
        var isChrome = false;
        if (browser.indexOf("netscape") > -1) {
            isChrome = true;
        }
        if (($.browser.msie && $.browser.version == "6.0") || isChrome) {
            setTargetCssWhenIE6(oTarget, fontSize, isChrome);
        }
    }
    function setTargetCssWhenIE6(targetObj, fontsize, ischrome) {
        if (ischrome) {
            if ($(targetObj).find("font").length > 0) {
                $(targetObj).find("font").each(function () {
                    $(this).css("font-size", fontsize);
                });
            }
        } else {
            if ($(targetObj).find("span").length > 0) {
                $(targetObj).find("span").each(function () {
                    $(this).css("font-size", fontsize);
                });
            }
        }
    }

    function mynetMenuGetRootObjId(rootObj) {
        //id如果为空则从rootObj的Id中取"_"之前的部分
        var rootObjId = rootObj.id;
        return rootObjId.substring(0, rootObjId.indexOf("_"));
    }

    function mynetMenuRootOver(id, rootObj) {
         
        if (id == null) {
            //id如果为空则从rootObj的Id中取"_"之前的部分
            id = mynetMenuGetRootObjId(rootObj);
        }
        var menuImgs = null;
        if (mynetMenuData[id]["btnBgImg"] != null && mynetMenuData[id]["btnBgImg"].length > 1) {
            menuImgs = mynetMenuData[id]["btnBgImg"].split(',');
            var img = rootObj.getElementsByTagName('img');
            if (img.length > 0) {
                if (menuImgs[1].length > 0) {
                    img[0].src = menuImgs[1];
                    img[0].style.visibility = 'visible';
                }
                else {
                    img[0].style.visibility = 'hidden';
                }
            }
        }

        var menuStyle = '';
        if (mynetMenuData[id]["menuRootItemOverStyle"] != null && mynetMenuData[id]["menuRootItemOverStyle"] != '')
            menuStyle = mynetMenuData[id]["menuRootItemOverStyle"];
        if (menuStyle != '') {
            //huangsq 2011-2-14 横向导航
            if (menuStyle.concat("padding:4px;")) {
                menuStyle = menuStyle.replace("padding:4px;", "padding:4px 0px 4px 0px;");
            }
            if (menuStyle.concat("padding:4px 10px 4px 10px;")) {
                menuStyle = menuStyle.replace("padding:4px 10px 4px 10px;", "padding:4px 0px 4px 0px;");
            }
            if (menuStyle.concat("padding:2px 10px 2px 3px;")) {
                menuStyle = menuStyle.replace("padding:2px 10px 2px 3px;", "padding:2px 0px 2px 0px;");
            }
            if (menuStyle.concat("padding: 0 5 5 6px;")) {
                menuStyle = menuStyle.replace("padding: 0 5 5 6px;", "padding:0px 0px 5px 0px;");
            }
            if (menuStyle.concat("padding:2px;")) {
                menuStyle = menuStyle.replace("padding:2px;", "padding:2px 0px 2px 0px;");
            }
            if (menuStyle.concat("margin:2px;")) {
                menuStyle = menuStyle.replace("margin:2px;", "margin:2px 0px 2px 0px;");
            }
            if (menuStyle.concat("width:100%;")) {
                if ($.browser.mozilla) //firefox
                {
                    menuStyle = menuStyle.replace("width:100%;", "");
                }
                else {
                    menuStyle = menuStyle.replace("width:100%;", "width:50%;");
                }
            }
            if (menuStyle.concat("height:100%;")) {
                if ($.browser.mozilla) //firefox
                {
                    menuStyle = menuStyle.replace("height:100%;", "");
                }
            }
            setTargetCss(rootObj, menuStyle);
            $(rootObj).find("div[class^='" + id + "']").css(GetMenuItemFontStyle(menuStyle));
        }
    }

    function mynetMenuSetCurrent(id, rootObj) {
        var data = mynetMenuData[id];
        if (data != null && data["CurrentSelectRootItem"] != null) {
            mynetMenuRootOut(id, data["CurrentSelectRootItem"], true);
        }

        mynetMenuRootOver(id, rootObj);
        if (data != null) {
            data["CurrentSelectRootItem"] = rootObj;
        }
    }

    function mynetMenuRegisterData(id, width, menuStyle, menuItemStyle, menuItemOverStyle, btnBgImg,
                                   menuRootItemStyle, menuRottItemOverStyle, zIndex, cellpadding, menuChildItemStyle,
                                   menuChildItemOverStyle, menuChildBgImg, height, isUseScroll) {

        var a = new Array();
        mynetMenuData[id] = a;

        a["width"] = width;
        a["menuStyle"] = menuStyle;
        a["menuItemStyle"] = menuItemStyle;
        a["menuItemOverStyle"] = menuItemOverStyle;
        a["btnBgImg"] = btnBgImg;
        a["menuRootItemStyle"] = menuRootItemStyle;
        a["menuRootItemOverStyle"] = menuRottItemOverStyle;
        a["menuChildItemStyle"] = menuChildItemStyle;
        a["menuChildItemOverStyle"] = menuChildItemOverStyle;
        a["menuChildBgImg"] = menuChildBgImg;
        a["zIndex"] = zIndex;
        if (cellpadding == null) {
            a["cellpadding"] = 4;
        }
        else {
            a["cellpadding"] = cellpadding;
        }


        a["menuPopHeight"] = height;
        a["menuIsScoll"] = isUseScroll;

    }



    function mynetMenuRootOut(id, rootObj, forceToDo) {
   
        if (id == null) {
            //id如果为空则从rootObj的Id中取"_"之前的部分
            id = mynetMenuGetRootObjId(rootObj);
        }
        //if the rootObj is current selected menu item then not apply mouse out event;
        var data = mynetMenuData[id];
        if (data != null && data["CurrentSelectRootItem"] != null && data["CurrentSelectRootItem"] == rootObj && !forceToDo) {
            return;
        }
        if ($(rootObj).attr("class").indexOf("mynetMenuSelected") > -1) {
            return;
        }    
        var menuImgs = null;
        if (mynetMenuData[id]["btnBgImg"] != null && mynetMenuData[id]["btnBgImg"].length > 1) {
            menuImgs = mynetMenuData[id]["btnBgImg"].split(',');
            var img = rootObj.getElementsByTagName('img');
            if (img.length > 0) {
                if (menuImgs[0].length > 0) {
                    img[0].src = menuImgs[0];
                    img[0].style.visibility = 'visible';
                }
                else {
                    img[0].style.visibility = 'hidden';
                }
            }
        }

        var menuStyle = '';
        if (mynetMenuData[id]["menuRootItemStyle"] != null && mynetMenuData[id]["menuRootItemStyle"] != '')
            menuStyle = mynetMenuData[id]["menuRootItemStyle"];
        if (menuStyle != '') {
            //huangsq  2011-2-22 导航兼容
            if (menuStyle.concat("padding:4px;")) {
                menuStyle = menuStyle.replace("padding:4px;", "padding:4px 0px 4px 0px;");
            }
            if (menuStyle.concat("padding:4px 10px 4px 10px;")) {
                menuStyle = menuStyle.replace("padding:4px 10px 4px 10px;", "padding:4px 0px 4px 0px;");
            }
            if (menuStyle.concat("padding:2px 10px 2px 3px;")) {
                menuStyle = menuStyle.replace("padding:2px 10px 2px 3px;", "padding:2px 0px 2px 0px;");
            }
            if (menuStyle.concat("padding:2px;")) {
                menuStyle = menuStyle.replace("padding:2px;", "padding:2px 0px 2px 0px;");
            }
            if (menuStyle.concat("margin:2px;")) {
                menuStyle = menuStyle.replace("margin:2px;", "margin:2px 0px 2px 0px;");
            }
            if (menuStyle.concat("padding:0 5 5 6px;")) {
                menuStyle = menuStyle.replace("padding:0 5 5 6px;", "padding:0px 0px 5px 0px;");
            }
            if (menuStyle.concat("width:100%;")) {
                if ($.browser.mozilla) //firefox
                {
                    menuStyle = menuStyle.replace("width:100%;", "");
                }
                else {
                    menuStyle = menuStyle.replace("width:100%;", "width:50%;");
                }
            }
            setTargetCss(rootObj, menuStyle);

            $(rootObj).find("div[class^='" + id + "']").css(GetMenuItemFontStyle(menuStyle));
           
        }
    }

    function GetMenuItemFontStyle(menuStyle) { 

        if (!menuStyle) return {};
        var result = { 
             color: "#000",
             fontSize: 12,
             fontWeight:"normal",
             fontStyle:"normal"
          };
       
        var reg = new RegExp(";{2,}","g");
        var s = menuStyle.replace(reg, ';');        
        var arrCss = s.split(';');
        var len = arrCss.length;
        for (var i = 0; i < len; i++) {
            var cssName = arrCss[i].split(':')[0]; 
            var cssValue = arrCss[i].substring(cssName.length + 1);
          
            if (cssName == "font-size") {
               result.fontSize = cssValue;
            }
            if (cssName == "color") {
               result.color = cssValue;
            }
            if (cssName == "font-weight") {
               result.fontWeight = cssValue;
            }
            if (cssName == "font-style") {
               result.fontStyle = cssValue;
            }
        }
        return result;    
    }

    //by 张凯 解决纵向栏目过长超过浏览器高度时，不触发事件的bug 2011-2-28
    function mynetMenuOnClick(obj) {
        for (var i = 0; i < mynetMenuObjects.length; i++) {
            if (mynetMenuObjects[i].table == obj) {
                var data = mynetMenuData[mynetMenuObjects[i].id];
                var curItem = getMenueItemById(data, mynetMenuObjects[i].selectedItemId);
                if (curItem.url.toLowerCase().indexOf("onclick") >= 0) {
                    $('<a ' + curItem.url + '></a>').click();
                }
                break;
            }
        }
    }

    // 菜单对象，保存类似菜单id, 菜单table等信息
    function mynetMenuObject(id, target) {

        if (target == null)
            target = window;

        var body = target.document.body;
        this.borderStyle = '';
        if (mynetMenuTopDiv == null) {
            mynetMenuTopDiv = document.createElement('DIV');

            if (body.childNodes.length <= 0)
                body.insertBefore(mynetMenuTopDiv, null);
            else
                body.insertBefore(mynetMenuTopDiv, body.childNodes[0]);
        }

        // 获得菜单数据
        var data = mynetMenuData[id];

        var div = target.document.createElement('DIV');
        mynetMenuTopDiv.insertBefore(div, null);
        var menuStyle = MenuStyle;
        var menuWidthHtml = '';
        if (data != null) {
            if (data["menuStyle"] != null && data["menuStyle"] != '')
                menuStyle = data["menuStyle"];
            var menuWidth = data["width"];
            menuWidthHtml = (menuWidth == null || menuWidth == '') ? '' : ('width=' + menuWidth);
        }
        var zindex = (data != null && data["zIndex"] != null) ? data["zIndex"] : 10000000;
        var cellpadding = (data != null && data["cellpadding"] != null) ? data["cellpadding"] : "4";
        div.innerHTML =
            "<table onmousemove='mynetMenuSetTimeout(100000)' onmouseout='mynetMenuSetTimeout(1000)' onblur='mynetMenuBlur()'" + menuWidthHtml +
            " style='" + menuStyle + ";visibility:hidden;position:absolute;left:0px;top:0px;z-index:" + zindex + ";border-collapse:collapse;' cellpadding='" + cellpadding + "'>" +
            "<tr valign=top><td width='100%'>" +
            "</td></tr>" +
            "</table>";
        if (!(id.length > 18 && id.substr(0, 18) == "mynetToolBoxFolder")) // 工具箱时，id类似 "mynetToolBoxFolder_menu_addControl"， 此时不要出iframe
            div.innerHTML = "<iframe FRAMEBORDER='no' scrolling='no' style='visibility:hidden;moz-opacity:0.0;filter:alpha(opacity=0);position:absolute;z-index:" + zindex + "'></iframe>" + div.innerHTML;

        // 返回内容
        this.id = id;
        this.div = div;
        this.data = data;
        this.table = this.div.getElementsByTagName('TABLE')[0];
        this.td = this.table.rows[0].cells[0];
        this.selectedItemId = null;

        var s = this.div.getElementsByTagName('IFRAME');
        this.iframe = s.length > 0 ? s[0] : null;
    }

    function mynetMenuSetTimeout(millisecond) {
        mynetMenuSource.mynetMenuTimeout = new Date();
        mynetMenuSource.mynetMenuTimeout.setTime(mynetMenuSource.mynetMenuTimeout.getTime() + millisecond);

    }

    function mynetMenuEnter(tr, menuId, itemId) {

        mynetMenuSetTimeout(100000);

        var data = mynetMenuData[menuId];

        // Get current table 
        var table = tr.offsetParent;
        while (table != null && !mynetMenuTableInArray(table))
            table = table.offsetParent;

        // 获得当前菜单的mynetMenuObject
        var obj, objIndex;
        for (objIndex = 0; objIndex < mynetMenuObjects.length; objIndex++) {
            obj = mynetMenuObjects[objIndex];
            if (obj.table == table) // 寻找当前级别的table
                break;
        }

        // 检查当前是否已经被选中了
        if (obj.selectedItemId == itemId)
            return;
        obj.selectedItemId = itemId;

        // set all other tr color
        var menuItemStyle = MenuItemStyle;
        if (data["menuItemStyle"] != '' && data["menuItemStyle"] != null)
            menuItemStyle = data["menuItemStyle"];

        var childItemTextSize = "font-size:12px;";
        var imgSrc = "";
        if (data["menuChildItemStyle"] != null && data["menuChildItemStyle"] != "") {
            menuItemStyle = data["menuChildItemStyle"];
            childItemTextSize = GetChildMenuFontSize(menuItemStyle);
            imgSrc = GetChildBgImg(data["menuChildBgImg"])[0];
        }

        for (var i = 0; i < tr.offsetParent.rows.length; i++) {
            var a = tr.offsetParent.rows[i];
            if (a.style.display != 'none' && a.innerText != '') {
                setTargetCss(a.getElementsByTagName("table")[0], menuItemStyle);
                setTargetCss(a.getElementsByTagName("nobr")[1], childItemTextSize);
                var img = a.getElementsByTagName("img");
                if (img != null && img.length > 0) {
                    if (imgSrc != null && imgSrc != "") {
                        img[0].style.visibility = "visible";
                        img[0].src = imgSrc;
                    }
                    else {
                        img[0].style.visibility = "hidden";
                    }
                }
            }
        }

        // set current selected tr color
        var curItem = getMenueItemById(data, itemId);
        var menuItemOverStyle = MenuItemOverStyle;
        if (data["menuItemOverStyle"] != null && data["menuItemOverStyle"] != '')
            menuItemOverStyle = data["menuItemOverStyle"];

        var childItemOverTextSize = "font-size:12px;";
        var imgOverSrc = "";
        if (data["menuChildItemOverStyle"] != null && data["menuChildItemOverStyle"] != "") {
            menuItemOverStyle = data["menuChildItemOverStyle"];
            childItemOverTextSize = GetChildMenuFontSize(menuItemOverStyle);
            imgOverSrc = GetChildBgImg(data["menuChildBgImg"])[1];
        }

        if (tr.style.display != 'none' && tr.innerText != '' && (curItem.url != '' || curItem.hasChild != false)) {
            setTargetCss(tr.getElementsByTagName("table")[0], menuItemOverStyle);
            setTargetCss(tr.getElementsByTagName("nobr")[1], childItemOverTextSize);
            var img = tr.getElementsByTagName("img");
            if (img != null && img.length > 0) {
                if (imgOverSrc != "") {
                    //由于网速或其他原因第一次加载时，图片会出现X现象；所以添加以下逻辑；
                    img[0].style.visibility = "hidden";
                    img[0].src = imgOverSrc;
                    img[0].onreadystatechange = function () {
                        if (img[0].readyState == "complate") {
                            img[0].style.visibility = "visible";
                            img[0].onreadystatechange = null;
                        }
                    }

                }
                else {
                    img[0].style.visibility = "hidden";
                }
            }
        }

        //二级导航横向时，鼠标移除后二级栏目的样式不变 huangsq 2011-4-6 
        if (tr.tagName == "TD") {
            for (var j = 0; j < tr.offsetParent.rows[0].cells.length; j++) {
                var nowTd = tr.offsetParent.rows[0].cells[j];
                if (nowTd != tr) { setTargetCss(nowTd.getElementsByTagName("table")[0], menuItemStyle); }
            }
        }

        // 隐藏子菜单
        while (mynetMenuObjects.length > objIndex + 1) {
            mynetMenuObjects.pop().div.removeNode(true);
        }


        // 判断是否有子菜单
        if (curItem.hasChild) // has sub menu
        {
            obj = mynetMenuGenerateTable2(menuId, curItem.id, window);
            if (obj == null)
                return;
            var x = mynetMenuObjectLeft(tr) + tr.offsetWidth + 4; // 准确距离是5, 用4使二级菜单压在一级菜单一个像数
            var y = mynetMenuObjectTop(tr);

            // 如果菜单太靠右，则显示在左边
            if (x > document.body.offsetWidth - obj.table.offsetWidth - 20)
                x = mynetMenuObjectLeft(tr) - obj.table.offsetWidth - 5;
            mynetMenuSetPos(obj, x, y, window);
        }
    }

    function mynetMenuRemoveItemById(data, itemId) {
        var index = mynetMenuGetItemIndexById(data, itemId);
        if (index >= 0)
            data.splice(index, 1);
    }

    function mynetMenuGetItemIndexById(data, itemId) {
        var len = data.length;
        for (var i = 0; i < len; i++) {
            if (data[i].id == itemId) {
                return i;
            }
        }
        return -1;
    }

    function getMenueItemById(data, itemId) {
        var index = mynetMenuGetItemIndexById(data, itemId);
        if (index >= 0)
            return data[index];
        return null;
    }

    /*
    * menuObjectTD : td
    * objMID       : mynetMenuStyle id
    * mItemID      : mynetMenuItem  id
    */
    function mynetMenuLeave(menuObjectTD, objMID, mItemID) {
        //找到menuStyle 并设置成默认样式
        var data = mynetMenuData[objMID];
        if (data) {
            var menuItemStyle = data["menuChildItemStyle"],
            childItemTextSize = GetChildMenuFontSize(menuItemStyle),
            imgSrc = GetChildBgImg(data["menuChildBgImg"])[0];

            if (menuItemStyle && childItemTextSize && imgSrc) {
                setTargetCss(menuObjectTD.getElementsByTagName("table")[0], menuItemStyle);
                setTargetCss(menuObjectTD.getElementsByTagName("nobr")[1], childItemTextSize);
                $(menuObjectTD).find("img.childBgImg").attr("src", imgSrc);
            }
            //移除 selectedItemId  因为在mynetMenuEnter 中  
            //    if (obj.selectedItemId == itemId)
            //      return;           
            for (var idx = 0; idx < mynetMenuObjects.length; idx++) {
                var obj = mynetMenuObjects[idx];
                if (obj.selectedItemId == mItemID) {
                    obj.selectedItemId = '';
                    break;
                }
            }

        }

        mynetMenuSetTimeout(200);
    }
    function mynetMenuStartsWith(str, word) {
        if (str != null && word != null && str.length >= word.length && str.substr(0, word.length) == word)
            return true;
        return false;
    }
    function mynetMenuTableInArray(table) {
        for (var i = 0; i < mynetMenuObjects.length; i++) {
            var obj = mynetMenuObjects[i];
            if (obj.table == table) {
                return true;
            }
        }
        return false;
    }
    function mynetMenuBlur() {

        var obj = document.activeElement;

        //此正则是为了解决在IE下,当菜单导航的子导航长度过长时,无法点击的BUG,子菜单的输出时会生成符合该要求的NOBR  

        var re = new RegExp('^<NOBR id=.*>.*</NOBR>$');
        if (re.test(obj.innerHTML) == true) { return; }

        if (typeof mynetMenuOnBlurFunc == 'function') {
            mynetMenuOnBlurFunc();
            return;
        }

        obj = document.activeElement;

        while (obj != null && !mynetMenuTableInArray(obj))
            obj = obj.offsetParent;
        if (obj == null) {
            mynetMenuHide();
        }
        else {
            obj.focus();
        }
    }




    // 生成菜单，返回mynetMenuObject对象
    function mynetMenuGenerateTable(id, target, srcElement, parentId, direction) {
        if (parentId != null && parentId != '') // 有指定父菜单
        {
            var data = mynetMenuData[id]; // 获得指定菜单数据
            if (data == null)
                return null;
            var menuItem = getMenueItemById(data, parentId);
            if (menuItem == null || !menuItem.hasChild) // 没有找到指定的子菜单
                return null;
        }

        var obj = mynetMenuGenerateTable2(id, parentId, target, direction, srcElement);
        //huangsq 2011-3-18加上参数srcElement，把srcElement的字体样式给二级导航，已有客户因二级导航的字体和一级的字体不一致而退款

        /**
        *   由于原来的事件绑定方式(onmouseover,onmouseout)没有考虑到事件冒泡的影响，mynetMenuEnter，mynetMenuLeave执行多次。导致二级导航底图不能切换
        *   现移除原有绑定事件方式，重新绑定导航二级菜单事件 jquery hover 
        */
        $(obj.td).find("td.m_item")
				   .removeAttr("onmouseover")
				   .removeAttr("onmouseout")
				   .hover(function () {
				       var tdmenuid = $(this).attr('tdmenuitemid');
				       mynetMenuEnter(this, id, tdmenuid);
				   }, function () {
				       var tdmenuid = $(this).attr('tdmenuitemid');
				       mynetMenuLeave(this, id, tdmenuid)
				   });

        return obj;
    }
    function mynetMenuGenerateTable2(id, parentId, target, direction, srcElement) {
        // Get the document of target window
        if (target == null)
            target = window;

        var doc = target.document;
        mynetMenuTarget = target;
        target.mynetMenuSource = window;

        // create the object
        var obj = new mynetMenuObject(id);
        mynetMenuObjects[mynetMenuObjects.length] = obj; // 记录当前生产的菜单

        // get the element of table
        var data = obj.data;
        if (data == null) // not found the menu data define
            return obj;

        // 创建html
        var html = '';
        if (null != srcElement && null != srcElement.id && null != ($(srcElement).css("font-family"))) {
            //huangsq 2011-3-18 给二级导航的table加上字体样式
            html += '<table width=100% cellpadding=0 cellspacing=0 style="font-family:' + $(srcElement).css("font-family") + ';">';
        }
        else {
            html += '<table width=100% cellpadding=0 cellspacing=0 >';
        }
        //*********************************
        if (direction == "1") {
            html += "<tr>";
        }
        for (var i = 0; i < data.length; i++) {
            if (data[i].parentId == parentId) {
                html += data[i].getHtml(obj, direction);
            }

        }
        if (direction == "1") {
            html += "</tr>";  //*********************************
        }
        html += '</table>';

        obj.td.innerHTML = html;

        return obj;
    }
    function mynetMenuSkip(data, index, subItemCount) {
        while (subItemCount-- > 0) {
            index += 5;
            index = mynetMenuSkip(data, index, data[index - 1]);
        }
        return index;
    }

    // 在指定控件相对位置显示菜单mynetMenuPopup(td的父层div后面的id,this,二级菜单显示（居左、中、右）,0,window,null,'td的id',二级横向还是竖向)
    function mynetMenuPopup(id, srcElement, elementPoint, menuAlign, target, hide, menuItemId, direction) {
        if (id == null && menuItemId == null) {
            //栏目导航优化，id和menuitemid都可以从SrcElement中算出来，所以不用传
            id = mynetMenuGetRootObjId(srcElement);
            menuItemId = srcElement.id;
        }
        //alert(direction);

        var x = mynetMenuObjectLeft(srcElement);
        var y = mynetMenuObjectTop(srcElement);

        if (elementPoint == 0) // RightBottom 即 left
        { x += srcElement.offsetWidth; y += srcElement.offsetHeight - 2; }
        else if (elementPoint == 1) // LeftBottom
        { y += srcElement.offsetHeight - 2; }
        else if (elementPoint == 2) // RightTop
        { x += srcElement.offsetWidth; }
        else if (elementPoint == 3) // LeftTop
        { }
        //huangsq 2011-6-24 导航二期改进 二级菜单与一级菜单的对齐方式（居左、中、右）
        else if (elementPoint == 4)  //center
        { }
        else if (elementPoint == 5) //right
        { }

        return mynetMenuPopupXY(id, x, y, srcElement, menuAlign, target, hide, menuItemId, srcElement.offsetWidth, direction);
    }

    // 在指定的位置显示菜单
    function mynetMenuPopupXY(id, x, y, srcElement, align, target, hide, menuItemId, srcElementWidth, direction) {

        //debugger;
        if (hide == null || hide)
            mynetMenuHide();
        mynetMenuSetTimeout(3000);
        if (menuItemId == null)
            menuItemId = '';
        var obj = mynetMenuGenerateTable(id, target, srcElement, menuItemId, direction);
        if (obj == null)
            return null;

        if (align == null || align == 0) // RightBottom
        { }
        else if (align == 1) // LeftBottom
            x -= obj.table.offsetWidth;
        else if (align == 2) // RightTop
            y -= obj.table.offsetHeight;
        else if (align == 3) // LeftTop
        { x -= obj.table.offsetWidth; y -= obj.table.offsetHeight; }
        //huangsq 2011-6-24 导航二期改进 二级菜单与一级菜单的对齐方式（居左、中、右）
        else if (align == 4) //center
        { x = x - (obj.table.offsetWidth - srcElement.offsetWidth) / 2; }
        else if (align == 5) //right
        {
            x = x + srcElement.offsetWidth - obj.table.offsetWidth; //x:当前一级菜单距浏览器左边的距离；
        }

        if (srcElementWidth == null) {
            srcElementWidth = 0;
        }

        // 如果超出屏幕，尝试修改方向
        /*
        var body = document.body;
        var bodyScrollLeft = body.scrollLeft;
        if (window.frameElement != null) // 在IFRAME中
        {
        bodyScrollLeft -= Math.min(0, getElementPos(window.frameElement).x);
        }
        if ((align == 1 || align == 3) && x - bodyScrollLeft < 0)
        {
        x += obj.table.offsetWidth + srcElementWidth;
        }
        
        if((align==0 || align==2) && eval(x) - body.scrollLeft > body.offsetWidth - obj.table.offsetWidth - 10)
        {
        x -= obj.table.offsetWidth + eval(srcElementWidth);
        }
        */

        mynetMenuSetPos(obj, x, y, target);
        //obj.div.style.display = 'inline';
        obj = BulildScroleDiv(obj);

        return obj;
    }
    function mynetMenuSetPos(obj, x, y, target) {
        if (target == null)
            target = window;
        var doc = target.document;
        var table = obj.table;

        var bodyWidth = doc.body.offsetWidth;
        var bodyHeight = doc.body.offsetHeight;
        var scrollLeft = getScrollLeft(target);
        var scrollTop = getScrollTop(target);

        x = Math.max(x, scrollLeft + 5);
        y = Math.max(y, scrollTop + 5);

        if (x + table.offsetWidth + 20 > bodyWidth + scrollLeft)
            x = bodyWidth + scrollLeft - table.offsetWidth - 20;
        if (x < 0)
            x = 0;

        if (y + table.offsetHeight + 20 > bodyHeight + scrollTop)
            y = bodyHeight + scrollTop - table.offsetHeight - 20;
        if (y < 0)
            y = 0;

        table.style.left = x + 'px';
        table.style.top = y + 'px';

        table.style.visibility = 'visible';
        table.focus();

        var iframe = obj.iframe;
        if (iframe != null) {
            iframe.style.pixelLeft = table.style.pixelLeft;
            iframe.style.pixelTop = table.style.pixelTop;
            iframe.width = table.offsetWidth;
            iframe.height = table.offsetHeight;
            iframe.style.visibility = 'visible';
        }
    }
    function mynetMenuHide() {
        while (mynetMenuObjects.length > 0) {
            var obj = mynetMenuObjects.pop();
            var objId = obj.id;
            obj.div.parentNode.removeChild(obj.div);
            if (typeof mynetMenuAfterHideFunc == 'function') {
                mynetMenuAfterHideFunc(objId);
                return;
            }
        }
    }

    function mynetMenuHideExcept(id) {
        //var len = mynetMenuObjects.length;
        for (var i = 0; i < mynetMenuObjects.length; i++) {
            if (mynetMenuObjects[i].id != id) {
                mynetMenuObjects[i].div.parentNode.removeChild(mynetMenuObjects[i].div);
                mynetMenuObjects.splice(i, 1);
            }
        }
    }

    function mynetMenuIsShowing() {
        return mynetMenuObjects.length > 0;
    }

    function mynetMenuGetShowingId() {
        if (mynetMenuObjects.length > 0)
            return mynetMenuObjects[mynetMenuObjects.length - 1].id;
        return null;
    }

    // 返回指定对象相对于document的位置，考虑了滚动条的情况
    function mynetMenuObjectLeft(o) {
        return Mynet_ObjectLeft(o);
        /*
        var x = 0;
        while (o != null)
        {
        x += o.offsetLeft;
        o = o.offsetParent;
        }
        return x;
        */
    }

    // 返回指定对象相对于document的位置，考虑了滚动条的情况
    function mynetMenuObjectTop(o) {
        return Mynet_ObjectTop(o);
        /*
        var y = 0;
        while (o != null)
        {
        y += o.offsetTop;
        o = o.offsetParent;
        }
        return y;
        */
    }
    function mynetMenuInterval() {
        var now = new Date();
        if (mynetMenuTimeout != null && now.getTime() > mynetMenuTimeout.getTime()) {
            mynetMenuTimeout = null;
            mynetMenuHide();
        }

        //        if(MynetPopHeight!=null && MynetIsUseScoll==true) {
        MynetPopOnScrollInterval();
        //        }
    }

    // 单个菜单条目  huangsq 2011-6-22 加上参数childStyle，For 二期导航改进中二级菜单的宽度
    function mynetMenueItem(id, parentId, leftText, text, url, rightText, hasChild, childStyle) {
        this.id = id;
        this.leftText = leftText;
        this.text = text;
        this.url = url;
        this.rightText = rightText;
        this.hasChild = hasChild;
        this.parentId = parentId;
        this.getHtml = function (objM, direction) {

            var html = "";
            //如果是1 即横向显示二级菜单，就是用<td></td>来显示
            if (direction == "1") {
                // 加menuitem 标示
                html += "<td class='m_item'  tdmenuitemid='" + this.id + "' ";
                html += " onmouseover=mynetMenuEnter(this,'" + objM.id + "','" + this.id + "') onmouseout=mynetMenuLeave() ";
                if (url != '') {
                    html += this.url;
                }
                html += ">";
            } else {
                //如果是2 即纵向显示二级菜单，就是使用多个<tr></tr>来显示
                html += "<tr ";
                html += " onmouseover=mynetMenuEnter(this,'" + objM.id + "','" + this.id + "') onmouseout=mynetMenuLeave() ";
                if (url != '') {
                    html += this.url;
                }
                html += "><td width='100%'>";
            }
            var style = mynetMenuData[objM.id]["menuItemStyle"];
            var textSize = "font-size:12px;";
            var imgSrc = "";
            var imgHtml = "";
            if (mynetMenuData[objM.id]["menuChildItemStyle"] != null && mynetMenuData[objM.id]["menuChildItemStyle"] != "") {
                style = mynetMenuData[objM.id]["menuChildItemStyle"];
                textSize = GetChildMenuFontSize(style);
                imgSrc = GetChildBgImg(mynetMenuData[objM.id]["menuChildBgImg"])[0];
            }
            var visibility = "visibility:hidden;";
            // 原来 id='childBgImg' 不对
            //img width为100% firefox会出现滚动条，所以此属性使用hack
            imgHtml = "<img class='childBgImg' src='" + imgSrc + "' onload='javascript:resetImg(this)' style='position:absolute;z-index:10; width:100%\9;" + visibility + "'  align='middle'/>"
            html += imgHtml;
            html += "<table width='100%' style='cursor:pointer;" + style + "' cellpadding='" + ((mynetMenuData[objM.id]["cellpadding"] == null) ? "4" : mynetMenuData[objM.id]["cellpadding"]) + "' cellspacing=0><tr>";

            if (text == '---') {
                html += "<td colspan=3 height=5><table width=100% height=1 cellpadding=0 cellspacing=0 bgcolor=gray><tr><td></td></tr></table></td>";
            }
            else {
                html += "<td style='width:1px;z-index:100;'><nobr >" + this.leftText + "</nobr></td>";
                html += "<td width=100% style='" + textSize + "'><nobr style='display:inline-block;position:relative;z-index:100;" + childStyle + " ' id='" + "_ii_" + this.id + "' >" + this.text + '</nobr></td>';
                html += "<td width=1 style='width:1px;z-index:100;'align=right><nobr>" + this.rightText;
                if (this.hasChild) {
                    html += "<img style='z-index:100;display:inline-block;position:relative;' src='http://res.mynet.cn/res/menu_expand.gif' width=15 height=15 border='0'/>";
                }
                html += '</nobr></td>';
            }
            if (direction == "1") {  //如果是1 横向显示 ，是用一个</tr>来结尾 表示一行
                html += '</tr></table></td>';
            } else {  //如果不是1 ，使用多个</tr>来表示多个行 即纵向
                html += '</tr></table></td></tr>';
            }

            return html;
        }
    }


    //单独获取二级菜单字体大小
    function GetChildMenuFontSize(style) {
        var textSize = "";
        if (style != null && style != "") {
            var styleArray = style.split(';');
            for (var i = 0; i < styleArray.length; i++) {
                if (styleArray[i].indexOf("font-size") > -1) {
                    textSize = styleArray[i];
                    break;
                }
            }

        }
        return textSize;
    }

    function GetChildBgImg(styleImg) {
        var imgs = [];
        if (styleImg != null && styleImg != "") {
            imgs = styleImg.split(',');
        }
        return imgs;
    }

    function resetImg(img) {
        var parent = img.parentNode;
        var height = Math.max($(parent).height(), parent.clientHeight, $(img).next().height());
        img.height = height;
        img.style.height = height;
        img.style.visibility = "visible";

        //火狐浏览器下，在有图片的情况下网站的导航条会出现拉长的问题
        var width = parent.childNodes[1].offsetWidth;
        img.style.width = width + 'px';
    }


    function BulildScroleDiv(obj) {

        if (obj != null && obj.div != null && mynetMenuData[obj.id] != undefined) {
            if (mynetMenuData[obj.id]["menuPopHeight"] != null && mynetMenuData[obj.id]["menuIsScoll"].toLowerCase() == "true") {
                var tempHtml = obj.td.innerHTML;
                var height = mynetMenuData[obj.id]["menuPopHeight"];
                obj.td.innerHTML = "<div align=center style='cursor:hand;z-index:10000;height:20px' id='MenuButtonUp'  onmouseenter='MynetMenuCurrentButtonId=this.id' onmouseleave='MynetMenuCurrentButtonId=1'>▲</div>" +
                   "<div style='width:100%;height:" + height + "px;overflow:hidden;position:relative;'id='divPopList'>" + tempHtml + "</div>" +
                  "<div align=center style='cursor:hand;z-index:100;height:20px' id='MenuButtonDown' onmouseenter='MynetMenuCurrentButtonId=this.id'onmouseleave='MynetMenuCurrentButtonId=1'>▼</div>";

                //obj.div.style.left = obj.table.style.left;
                //obj.div.style.top = obj.table.style.top;
            }
        }

        return obj;
    }

    function MynetPopOnScrollInterval() {

        try {
            var objPop = document.getElementById('divPopList');
            if (MynetMenuCurrentButtonId == "MenuButtonUp") {
                objPop.scrollTop -= 16;
            }
            else if (MynetMenuCurrentButtonId == "MenuButtonDown") {
                objPop.scrollTop += 16;
            }
        }
        catch (e) {
        }
    }

    window.setInterval(mynetMenuInterval, 200);
}

//非IE浏览器里的contains方法扩展
if (typeof (HTMLElement) != "undefined") {
    HTMLElement.prototype.contains = function (obj) {
        while (obj != null && typeof (obj.tagName) != "undefind") {
            if (obj == this)
                return true;
            obj = obj.parentNode;
        }
        return false;
    };
}
//检查某个功能是否可以使用
function mynet_CheckFunctionCanUse(checkKey) {
    var url = "/admin/CheckFunction.aspx?key=" + checkKey;
    var returnValue = httpRequest(url);//返回True或者SponsorName
    if (returnValue == "True") {
        return "true";
    }
    else {
        return returnValue;
     }
}
//改变当前页面上的按钮的onclick事件
function mynet_AttachClientClick() {
    //只处理Aspx页面
    if (document.location.pathname.indexOf(".aspx") == -1) {
        return;
    }
    var inputButtons = document.getElementsByTagName("input");
    var buttons = document.getElementsByTagName("button");
    for (var i = 0; i < inputButtons.length; i++) {
        var btn = inputButtons[i];
        mynet_AttachOneButtonClick(btn);
    }

    for (var i = 0; i < buttons.length; i++) {
        var btn = buttons[i];
        mynet_AttachOneButtonClick(btn);
    }
}
//输出版本升级提示信息
function mynet_checkFunctionAlert(sponsorName) {
    var title = "对不起！您所使用的功能超出了版本限制，请尽快升级到更高版本。"; ;
    var content;
    var isHichina = sponsorName.toLowerCase() == "default" || sponsorName == "hichina" || sponsorName == "oinsite" || sponsorName == "hichinafree";
    if (isHichina) {
        content = "请登录http://www.net.cn 付费升级或与您的销售代表联系。<br/><br/>";
        content += "<font color='red'>全国统一服务热线：400-600-8500</font>";
    }
    else {
        content = "请与您的服务提供商联系升级。";
    }
    mynet_Alert(title, content, 450, 160);
}

function mynet_AttachOneButtonClick(btn) {
    var checkFunction = btn.getAttribute("CheckFunction");
    if (checkFunction != null && checkFunction != "") {
        var strOnclick = btn.getAttribute("onclick");
        btn.onclick = function() {
            var returnValue = mynet_CheckFunctionCanUse(checkFunction);
            if (returnValue == "true") {
                if (btn.type == "submit" && strOnclick != null && strOnclick != "")//代表该按钮会引发验证
                {
                    if (typeof (Page_ClientValidate) == "function" && Page_ClientValidate() == false &&
                         typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
                        return false;
                    }
                }

                if (strOnclick != null && strOnclick != "") {
                    var IsIE = mynet_GetNavigator() == "MSIE";
                    if (IsIE == false) {//FF和ＩＥ８不一样
                        eval(strOnclick);
                    }
                    else {//IE 7及以下对该字符串的解析不一样,IE 7下被解析成function onclick
                        var tempStr = strOnclick + ""; //变成字符串
                        if (tempStr.indexOf("function onclick()") == 0) {
                            tempStr = tempStr.replace("function onclick()\n{", "");
                            tempStr = tempStr.substring(0, tempStr.length - 2);
                        }
                        else if (tempStr.indexOf("function anonymous()") == 0) {
                            tempStr = tempStr.replace("function anonymous()\n{", "");
                            tempStr = tempStr.substring(0, tempStr.length - 2);
                        }
                        
                        eval(tempStr);
                    }
                  
                }
                return true;
            }
            else {
                mynet_checkFunctionAlert(returnValue);
                return false;
            }
        }
    }
}

$(function() { mynet_AttachClientClick() });
//帮助popmenu相关script Start

//帮助popmenu
var helpPopObj;

//帮助数组
var helpelements3=new Array();


//添加帮助数组
function AddhelpElement3(content,URL)
{
    var widthStyle="";
    if(helpelements3.length!=0)
    {
        widthStyle="width:100%;";
    }
    helpelements3.push( "&nbsp;&nbsp;<span onclick=\"mynetCnShowHelpWin('"+URL+"');\"style='cursor:pointer;"+widthStyle+"'>"+
                        "<a href='#' class='toolbox_helpcontent' ><nobr>"+content+"</nobr></a></span>");
}
//读取帮助内容
function ShowhelpElement3()
{   
    var ShownContent="";
    
	for(i=1;i<helpelements3.length;i++)
	{
	    ShownContent+="<tr><td height='20' width='100%'  style='background-color:#FFFFFF'"+ 
	                    "onmouseover='onselecthelp(this,true)'onmouseout='onselecthelp(this,false)' align='left'>";
	    ShownContent+=helpelements3[i];
	    ShownContent+="</td></tr>";
	}
	return ShownContent;
}

//选择帮助内容背景设置
function onselecthelp(obj,isSelect)
{
    if (isSelect)
    {
        obj.style.backgroundColor="#D9D9D9";
    }
    else 
    {
        obj.style.backgroundColor="#FFFFFF";
    }
}

var maxHeight=0;
//页面显示帮助
function showhelp3()
{  
    helpPopObj=document.getElementById("helpLayer");
    var helpInner="";
    //帮助数组有元素时，读取帮助数组并显示
    if(helpelements3.length<=1)
    {
       maxHeight=20;       
       helpInner="<tr><td height='"+maxHeight+"' style='background-color:#FFFFFF'></td></tr>";
    } 
    else
    {
        helpInner=ShowhelpElement3();
        maxHeight=20*(helpelements3.length-1)+2;
    }
    var content ='<table style="FILTER:alpha(opacity=90) shadow(color=#ffffff,direction=135);" id="toolTipTable" width="100%" cellspacing="0" cellpadding="0" border="0" >'+
                helpInner+'</table>';
    helpPopObj.innerHTML=content;
    speadDiv(helpPopObj,maxHeight);
    
}
//页面隐藏帮助
function hidehelp3()
{
    if(helpPopObj!=null)
    {
        shrinkDiv(helpPopObj,maxHeight);
    }
}
//展开div
function speadDiv(obj,maxh)
{
    var h=obj.offsetHeight;
    if(obj.style.display=='none')
    {
        function dmove()
        {
            h+=5; //设置层展开的速度
            if(h>=maxh)
            {
                obj.style.height=maxh+'px';
                clearInterval(iIntervalId);
                obj.focus();
            }
            else
            {
                obj.style.display='block';
                obj.style.height=h+'px';
                
            }
        }
    }
    iIntervalId=setInterval(dmove,10);
}
//收缩div
function shrinkDiv(obj,maxh)
{
    var h=parseInt(obj.style.height.substring(0,obj.style.height.length-2));
    if (h==maxh)
    {
    
        function dmove()
        {
            h-=5;//设置层收缩的速度
            if(h<=0)
            {
                obj.style.display='none';
                clearInterval(iIntervalId);
                helpPopObj=null;
            }
            else
            {
                obj.style.height=h+'px';
            }
        }
        iIntervalId=setInterval(dmove,10);
    }
}
var helpTimer;
//显示/隐藏帮助
function activehelp()
{
    var target=document.getElementById("helpTopElement");
    var helpobj=document.getElementById("helpLayer");
    if (helpobj.style.top=="")
    {
        helpobj.style.top=getoffset(target).offsetTop+target.offsetHeight+3;
    }
    if (helpobj.style.left=="")
    {
        helpobj.style.left=getoffset(target).offsetLeft-2;
    }
    if(helpPopObj==null)
    {
        showhelp3();
        helpTimer=setTimeout('hidehelp3()',3000);
    }
    else
    {
        if(helpTimer!=null)
            clearTimeout(helpTimer);
        hidehelp3();
    }
}

function  mynetCnShowHelpWin(url)
{
    var parameter="";
    if(url!=""&&url!=null)
      parameter="?contenturl="+url;
  ShowModalDialogInFrame("~/plugin/HelpCenter/HelpCentermain.aspx"+parameter);
  return false;
}

//获取控件的绝对位置   
function getoffset(e) 
{  
    this.offsetTop=Mynet_ObjectTop(e);
    this.offsetLeft=Mynet_ObjectLeft(e);
    return this; 
}  function showitem(id, name, iscurrent) {
    var bgcolor = iscurrent ? 'orange' : 'transparent';
    return ("<span style='text-align:left; border:solid 1px " + bgcolor+ "; padding:2px 4px 2px 4px;'><img src='http://res.mynet.cn/res/images/cpwoutlookbar_arrow.gif'/> <a href='" + id + "' target=_self>" + name + "</a></span><br>")
}

//number 为一数字，根据其选定合适的DOM 元素
function switchoutlookBar(number) {
    var i = outlookbar.opentitle;
    outlookbar.opentitle = number;
    var id1, id2, id1b, id2b;
    if (number != i && outlooksmoothstat == 0) {
        if (number != -1) {
            if (i == -1) {
                id2 = "blankdiv";
                id2b = "blankdiv";
            }
            else {
                id2 = "outlookdiv" + i;
                id2b = "outlookdivin" + i;
                var outlookTitle = document.getElementById("outlooktitle" + i);
                outlookTitle.className = 'mynetoutlookbar_open';
            }
            id1 = "outlookdiv" + number;
            id1b = "outlookdivin" + number;
            //var curOutLookTitle = document.all("outlooktitle" + number);
            var curOutLookTitle = document.getElementById("outlooktitle" + number);
            curOutLookTitle.className = 'mynetoutlookbar_close';
            smoothout(id1, id2, id1b, id2b, 0);
        }
        else {
            var blankDiv = document.getElementById("blankdiv");
            blankDiv.style.display = "";
            blankDiv.style.height = "100%";
            blankDiv.style.display = "none";
            blankDiv.style.height = "0%";
            blankDiv.style.border = "1px none navy";
            blankDiv.style.background = "white";
            blankDiv.style.color = "#ffffff";
            blankDiv.style.textalign = "center";
        }
    }
}
function smoothout(id1, id2, id1b, id2b, stat) {
    if (stat == 0) {
        var id1bObj = document.getElementById(id1b);
        var id2bObj = document.getElementById(id2b);
        tempinnertext1 = id1bObj.innerHTML;
        tempinnertext2 = id2bObj.innerHTML;
        id1bObj.innerHTML = "";
        id2bObj.innerHTML = "";
        outlooksmoothstat = 1;
        id1bObj.style.overflow = "hidden";
        id2bObj.style.overflow = "hidden";
        document.getElementById(id1).style.height = "0%";
        document.getElementById(id1).style.display = "";
        setTimeout("smoothout('" + id1 + "','" + id2 + "','" + id1b + "','" + id2b + "'," + outlookbar.inc + ")", outlookbar.timedalay);
    }
    else {
        stat += outlookbar.inc;
        if (stat > 100)
            stat = 100;
        document.getElementById(id1).style.height = stat + "%";
        document.getElementById(id2).style.height = (100 - stat) + "%";
        if (stat < 100)
            setTimeout("smoothout('" + id1 + "','" + id2 + "','" + id1b + "','" + id2b + "'," + stat + ")", outlookbar.timedalay);
        else {
            document.getElementById(id1b).innerHTML = tempinnertext1;
            document.getElementById(id2b).innerHTML = tempinnertext2;
            outlooksmoothstat = 0;
            document.getElementById(id1b).style.overflow = "auto";
            document.getElementById(id2).style.display = "none";
        }
    }
}
function getOutLine() {
    outline = "<table " + outlookbar.otherclass + ">";
    for (i = 0; i < (outlookbar.titlelist.length); i++) {
        outline += "<tr><td name=outlooktitle" + i + " id=outlooktitle" + i + " ";
        if (i != outlookbar.opentitle) {
            outline += " nowrap class='mynetoutlookbar_close'";
        }
        else {
            outline += " nowrap  class='mynetoutlookbar_open'";
        }
        outline += outlookbar.titlelist[i].otherclass
        outline += " onclick='switchoutlookBar(" + i + ")'>";
        if (i != outlookbar.opentitle) {
            outline += "<img src='http://res.mynet.cn/res/images/cpwoutlookbar_sign.jpg' style='vertical-align:middle;'/>";
        }
        else {
            outline += "<img src='http://res.mynet.cn/res/images/cpwoutlookbar_sign2.jpg' style='vertical-align:middle;'/>"; 
        }
        outline += outlookbar.titlelist[i].title + "</td></tr>";
        outline += "<tr><td name=outlookdiv" + i + " valign=top align=left id=outlookdiv" + i + " style='width:100%"
        if (i != outlookbar.opentitle)
            outline += ";display:none;height:0%;";
        else
            outline += ";display:;height:100%;";
        outline += "'><div name=outlookdivin" + i + " id=outlookdivin" + i + " style='overflow:auto;width:100%;height:100%;line-height:22px;padding:4px 0px 0px 18px;text-align:left;'>";
        for (j = 0; j < outlookbar.itemlist[i].length; j++)
            outline += showitem(outlookbar.itemlist[i][j].key, outlookbar.itemlist[i][j].title, outlookbar.itemlist[i][j].isCurrent);
        outline += "</div></td></tr>"
    }
    outline += "</table>"
    return outline
}
function showOutlookItem() {
    var outline;
    outline = "<div id='outLookBarDiv' name='outLookBarDiv' style='width=100%;height:100%'>"
    outline += outlookbar.getOutLine();
    outline += "</div>"
    document.write(outline);
}
function theitem(intitle, instate, inkey,iscurrent) {
    this.state = instate;
    this.otherclass = " nowrap ";
    this.key = inkey;
    this.title = intitle;
    this.isCurrent = iscurrent;
}
function addtitle(intitle) {
    outlookbar.itemlist[outlookbar.titlelist.length] = new Array();
    outlookbar.titlelist[outlookbar.titlelist.length] = new theitem(intitle, 1, 0);
    return (outlookbar.titlelist.length - 1);
}
function additem(intitle, parentid, inkey,iscurrent) {
    if (parentid >= 0 && parentid <= outlookbar.titlelist.length) {
        outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length] = new theitem(intitle, 2, inkey, iscurrent);
        outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length - 1].otherclass = " nowrap align=left style='height:5' ";
        return (outlookbar.itemlist[parentid].length - 1);
    }
    else
        additem = -1;
}
function outlook() {
    this.titlelist = new Array();
    this.itemlist = new Array();
    this.divstyle = "style='height:100%;width:100%;overflow:auto' align=center";
    this.otherclass = "border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";
    this.addtitle = addtitle;
    this.additem = additem;
    this.starttitle = -1;
    this.show = showOutlookItem;
    this.getOutLine = getOutLine;
    this.opentitle = this.starttitle;
    this.reflesh = outreflesh;
    this.timedelay = 50;
    this.inc = 10;
}
function outreflesh() {
    document.getElementById("outLookBarDiv").innerHTML = outlookbar.getOutLine();
}
function locatefold(foldname) {
    for (var i = 0; i < outlookbar.titlelist.length; i++) {
        if (foldname == outlookbar.titlelist[i].title) {
            outlookbar.starttitle = i;
            outlookbar.opentitle = i;
        }
    }
}


//页面管理修改网页属性js
function coEdit(docId) {
    var win = (docId != 0)
        ? ShowModalDialogInFrame('/admin/CategoryEdit.aspx?portaltype=2&docuid=' + docId) // Edit
        : ShowModalDialogInFrame('/admin/CategoryEdit.aspx?portaltype=2&caninsert=1'); // New
    win.OnOKCallBack = function(ret){
        if (ret != null) {
            if (docId == 0) {//新建一个网页
                window.parent.location.href = ret[0].url;
            }
            else {
                window.parent.location.href = "/admin/design.aspx?docuid=" + docId;
            }
        }
    }
}

function siteEdit() {
    location.href = "/admin/siteedit.aspx?returnurl=" + window.location.href;
}

//修改文章最终页属性
function onEditDocDetailTemplate(docId, doctypeName) {
    var win = ShowModalDialogInFrame("/mod/docTemplate/NewDocDetailPage.aspx?docid=" + docId + "&doctypename=" + doctypeName);
    win.OnOKCallBack = function(ret){
        if (ret != null) {
            document.location.href = document.location.href;
        }
    }
}

//老版本栏目导航的新建栏目
function categoryOrder() {
    var win = mynet_ShowModalDialog("/admin/categoryorder.aspx?portaltype=2", "管理栏目", 600, 500);
    win.OnOKCallBack = function(newCategoryId)
    {
        if (newCategoryId == null) {
            return;
        }
        if (newCategoryId == "0" || newCategoryId == "true") {
            //_docUID = newCategoryId;
            reloadPage();
        }
        else {
            //有新建立的栏目
            window.parent.location.href = "/admin/design.aspx?docuid=" + newCategoryId;
        }
    }
}



function themeSelect(curDocId) {
    if (curDocId == null) {
        curDocId = _docUID
    }
    var win = mynet_ShowModalDialog("/admin/categoryedit.aspx?panel=theme&docuid=" + curDocId, "更换模板");
    win.OnOKCallBack = function(ret) {
        if (ret != null) {
            if (window.location.href.indexOf('design') > -1) {//在设计状态
                mynet_openLinkTop("/admin/design.aspx?docuid=" + curDocId); //保证在顶层窗口打开设计页面
            }
            else {
               searchResult(curDocId); //在后台管理
            }
        }
    }
}

//设置预制内容
function setContent(_docUID, _docParameter) {
    var win = ShowModalDialogInFrame('/admin/AutoCategoryContent.aspx' +
        '?docuid=' + _docUID +
        '&p=' + _docParameter);
    win.OnOKCallBack = function(ret){
        if (ret != null && ret != '') {
            var obj = document.getElementById('mynetAspectPanel');
            obj.outerHTML = ret;
            mynetResizeTheme();
        }
    }
}


function NewOrEditDocDetailPage(doctypename) {
    if (doctypename == "product_productdoc" || doctypename == "article_articledoc") {
        var win = ShowModalDialogInFrame("/plugin/doc/setPageStyle.aspx?doctypename=" + doctypename);
            win.OnOKCallBack = function(ret){
            if (ret != null && ret != "true") {
                mynet_openLinkTop("/admin/design.aspx?docuid=" + ret);
            }
            else if (ret == "true") {
                alert("设置成功！");
            }
        }
        return;
    }
}


//重置页面内容
function resetCategoryContent(docId) {

    var confirm = mynet_Confirm('重置页面', '您是否确定要重置该页面的内容？', '页面重置后将不能被恢复！');
    confirm.OnOK = function() {
        confirm.Close();
        var title = '重置页面';
        var url = '/admin/CategoryNewOrReset.aspx?isreset=1&docuid=' + docId;
        var win = mynet_ShowModalDialog(url, title, 660, 480);
        //Iframe里的页面执行完页面本身的逻辑后，回调该函数。
        win.OnOKCallBack = function(retValue) {
            if (mynet_IsDesignWin()) {
                var frameSrc = "design2.aspx?docuid=" + retValue
                var designFrame = document.getElementById("designFrame");
                designFrame.src = frameSrc;
            }
            else {
                mynet_Alert('页面内容已经重置！');
                searchResult(retValue);
            }
        }
    }
}

// 页面发布
function publishCategory() {
    var curDocId = document.getElementById("hfCurDocId").value;
    var win = mynet_ShowModalDialog('/admin/publishCategory.aspx?docid=' + curDocId, '页面发布', 600, 480, 'OK|CANCEL');
    win.OnOKCallBack = function(ret) {
    if (ret != null && ret != '' && ret!='0') {
            mynet_Alert('页面发布成功！');
        }
    }
}

//新建页面的函数，在工具箱和design.aspx均用到
function coNewCategory(portalType) {

    var title = '新建页面';
    var url = '/admin/CategoryNewOrReset.aspx?portaltype='+portalType;
    var buttons = null; //窗口要显示的按钮
    var win = mynet_ShowModalDialog(url, title, 660, 480);
    
    //Iframe里的页面执行完页面本身的逻辑后，回调该函数。
    win.OnOKCallBack = function(retValue) {
        if (mynet_IsDesignWin()) {
            if (portalType == "1") {
                mynet_openLinkTop('/admin/designwap.aspx?docuid=' + retValue);
            }
            else {
                mynet_openLinkTop('/admin/design.aspx?docuid=' + retValue);
            }
        }
        else {
            // 新建页面总是属于普通栏目
            window.location.href = "/plugin/siteAdmin/pageMgrCenter.aspx?docid=" + retValue + "&folderName=CommonCategory";
        }
    }
}

function mynet_IsDesignWin() {
    var fileNames = new Array("design.aspx", "designwap.aspx");
    for (var i = 0; i < fileNames.length; i++) {
        if (window.location.href.toLocaleLowerCase().indexOf(fileNames[i]) != -1 || window.parent.window.location.href.toLowerCase().indexOf(fileNames[i]) != -1) {
            return true;
        }
    }
    return false;
}

//更多网页对话框
function onSearchPages() {
    var title = '网页搜索';
    var url = '/plugin/siteAdmin/searchPages.aspx';
  
    var win = mynet_ShowModalDialog(url, title,580,450,'');
    //回调提交后的事件
    win.OnOKCallBack = function(retValue) {
        if (retValue != null) {
            if (mynet_IsDesignWin()) {//设计状态窗口
                window.location.href = "/admin/design.aspx?docuid=" + retValue;
            }
            else //后台管理
            {
                searchResult(retValue);
            }
        }
    }
}

//编辑模板属性
function onEditThemeProperty(themeId, imgTemplateId) {
    var docId = (typeof(curPageDocId)=="undefined") ? '' : curPageDocId;
    var win = ShowModalDialogInFrame("/mod/masterpage/masterpageproperty.aspx?themeid=" + themeId + "&docuid=" + docId + "&date=" + new Date());
    win.OnOKCallBack = function(ret){
        if (ret != null) {
            if(typeof(curPageDocId)=="undefined"){
                mynet_refreshPageTop();
            }else
            {
                mynet_openLinkTop("/admin/design.aspx?docuid="+curPageDocId);
            }
        }
    }
}

//设计模板跳转的函数
function onDesignThemeDoc(themeId) {
    if (themeId.indexOf("-") == 0) {
        themeId = themeId.substring(1);

    }
   
    if (mynet_IsDesignWin()) {// in design window
        var frameSrc = "design2.aspx?docuid=" + themeId;
        document.getElementById("designFrame").src = frameSrc;
        currentPageNode = document.getElementById("mynetPageNode_x");
    }
    else //in manage window
    {
        window.location.href = "/admin/design.aspx?docuid=" + themeId;
    }
}
function onSetSmartDisplayShowNameInToolBar(context, designPanel) {
    var designData = context.designData;
    var indexPos = designData.indexOf("^|");
    if (indexPos > -1) { //huangsq 2011-10-20 将 '>=' 改成了'>' fix 图片控件设置状态下在toolbar不显示name
        var smartDisplayName = designData.substring(0, indexPos);
        designPanel.previousSibling.childNodes[0].childNodes[0].innerHTML = smartDisplayName;
    }
}

//-----------6PhotosAlbumJS.js------------------
function JSAlbum(prefix,picarry,lnkarry,ttlarry)
{
    this.prefix = prefix;
    this.picarry = picarry;
    this.lnkarry = lnkarry;
    this.ttlarry = ttlarry; 
    var obj = this; 
    this.currslid = 0;
    this.setfoc = function (id) {
        var focpic = document.getElementById(prefix + "_focpic");
        if (focpic == null)
            return;
        focpic.src = picarry[id];
        document.getElementById(prefix + "_foclnk").href = lnkarry[id];
        document.getElementById(prefix + "_fttltxt").innerHTML = '<a href="' + lnkarry[id] + '" target="_blank" style="color:#FFF;text-decoration:none">' + ttlarry[id] + '</a>';
        obj.currslid = id;
        for (i = 0; i < ttlarry.length; i++) {
            try {
                document.getElementById(prefix + "_tmb" + i).className = "thubpic";
            }
            catch (e) { }
        };
        document.getElementById(prefix + "_tmb" + id).className += " thubpiccur";
       
        if ($.browser.msie) {
            focpic.style.visibility = "hidden";
            focpic.filters[0].Apply();
            if (focpic.style.visibility == "visible") {
                focpic.style.visibility = "hidden";
                focpic.filters.revealTrans.transition = 23;
            }
            else {
                focpic.style.visibility = "visible";
                focpic.filters[0].transition = 23;
            }
            obj.stopit();
            focpic.filters[0].Play();
        }
    }
    this.stopit = function(){
        if(typeof(timerId)!='undefined' && timerId + "" != "")
        {
	        clearInterval(timerId);
	    }
    }
    
    this.playit = function(){
        this.stopit();
	    timerId = setInterval(this.playnext,4500);
    }

    this.playnext = function (){
	    if(obj.currslid<obj.ttlarry.length-1){
		    obj.currslid++;
	    }
	    else{
		    obj.currslid = 0;
	    };
	    obj.setfoc(obj.currslid);
	    obj.playit();
    }
}
//-----------AnimateFadein.js------------------


//隐藏table元素,该方法不同于其名称,实际只是隐藏掉传入的元素
function hiddenParentTable(table)
{
  //var table = obj.parentNode.parentNode.parentNode.parentNode;
  table.style.visibility ="hidden";
}
//播放滤镜效果,参数将被修改的元素 和滤镜ID
function playParentFilter(table,transitionId)
{  
   //var table = obj.parentNode.parentNode.parentNode.parentNode;
   try
   {
    if(transitionId>=0)
    {
      table.filters.item(0).transition = transitionId;
    }
   
     table.filters(0).apply();
     table.style.visibility ="visible";
     table.filters(0).play(2.0);
   }
   catch(e)
   {
      table.style.visibility ="visible";
   }
}
//-----------AspectPhotoAlbum.js------------------
//var photoalbum_upnum =0 ;
//点击显示的层，隐藏
function photoalbum_selectDiv(uid)
{
    var slder = document.getElementById('divContrl_'+uid);
    slder.style.pixelTop = slder.style.pixelTop + 20;
    slder.style.display = 'none';
    slder.style.visibility = 'hidden'; // 兼容旧版本，万一脚本不更新
}

function photoalbum_overPic(uid, ctrlLeft, ctrlTop)
{ 
    var divLarge = document.getElementById('divContrl_'+uid);       
    if(divLarge.style.display=='' && divLarge.style.visibility == 'visible') // 已经显示 // visibility兼容旧版本
    {
        return;
    }
    
    //if(photoalbum_upnum!= 0) return;
    var slder = document.getElementById('slider_'+uid);  
    var pos = photoalbum_getPosition(slder);        
    var top  = pos[1];
    var left = pos[0];           
    
    divLarge.style.left = ctrlLeft + 'px';
    divLarge.style.top = (ctrlTop - 20) + 'px';
    curAlpha = 0;
    divLarge.style.filter ='alpha(opacity=80)';
    divLarge.style.visibility = 'visible'; // 兼容旧版本，万一脚本不更新
    divLarge.style.display = '';
    //photoalbum_slowup(uid, 0);
}

function photoalbum_getPosition(elt) 
{
    var pos = new Object;
    pos.x = 0;
    pos.y = 0;
    //一直找到body，如果相等就不加
    while (elt&& elt.tagName.toUpperCase()!='BODY')
    {	
	    if (pos.y!=elt.offsetTop && elt.style.position !='absolute')	
	    {  
	        pos.x += elt.offsetLeft;
	        pos.y += elt.offsetTop;
	        if(elt.tagName.toUpperCase()!='HTML')
	        {
	         pos.x = pos.x -elt.scrollLeft;
		     pos.y = pos.y -elt.scrollTop;
		    }
	    }	
	    elt = elt.offsetParent;
    }
    return ([pos.x,pos.y]);
}

function photoalbum_slowup(uid, upnum)
{
    if ( upnum < 20   )
    {  
        var divLarge = document.getElementById('divContrl_'+uid);
        upnum++;
        divLarge.style.pixelTop = divLarge.style.pixelTop -1;           
        setTimeout('photoalbum_slowup(\''+uid+'\','+upnum+')',40);
    }
}

//-----------calendar2008.js------------------
Date.prototype.getTheDate=function(){
		return {Y:this.getFullYear(),M:this.getMonth()+1,D:this.getDate()};
	}
Date.prototype.beforeTheDate=function(Y,M,D){
		if(Y<this.getFullYear()||(Y==this.getFullYear()&&M<this.getMonth()+1)||(Y==this.getFullYear()&&M==this.getMonth()+1&&D<this.getDate()))
		{
			return true;
		}
		else
		{
			return false;
		}
}
Date.prototype.afterTheDate=function(Y,M,D){
		if(Y>this.getFullYear()||(Y==this.getFullYear()&&M>this.getMonth()+1)||(Y==this.getFullYear()&&M==this.getMonth()+1&&D>this.getDate()))
		{
			return true;
		}
		else
		{
			return false;
		}
}
Date.prototype.getThePreDate=function(dateObj,minYear){
		var M=dateObj.M;
		var Y=dateObj.Y;
		var D=dateObj.D;
		M--;
		if(M<1)
		{
			M=12;
			Y--;
		}
		if(Y<minYear)
		{
			Y=minYear;
		}
		
		
		this.selDate=Y+'-'+M+'-'+D; 	
		return "{Y:"+Y+",M:"+M+",D:"+D+"}";
		
}


Date.prototype.getTheNextDate=function(dateObj,maxYear){
		var M=dateObj.M;
		var Y=dateObj.Y;
		var D=dateObj.D;
		M++;
		if(M>12)
		{
			M=1;
			Y++;
		}
		if(Y>maxYear)
		{
			Y=maxYear;
		}
		return "{Y:"+Y+",M:"+M+",D:"+D+"}";
}
function MarcianCalendar2(calendarObjName,display,minYear,maxYear,afterNotUsed,beforeNotUsed)
{
        this.calendarName=calendarObjName;//create 
		this.display=display?"block":"none";//
		this.minYear=minYear?minYear:1900;//
		this.maxYear=maxYear?maxYear:2900;//
		this.afterNotUsed=afterNotUsed?afterNotUsed:false;
		this.beforeNotUsed=beforeNotUsed?beforeNotUsed:false;
		this.calendarContainer=null;//calendar block
		this.calendarMenuContainer=null;//list
		this.calendarDateContainer=null;//date
		this.calendarWeekContainer=null;//
		this.calendarCloseContainer=null;//
		this.weekAry=["S","M","T","W","T","F","S"];//
		this.date=new Date();//
		this.moveObjAry=new Array();//
		this.fillObjAry=new Array();//
		this.id=0;//
		
        this.getObjOffset=function(obj){
			var x=obj.offsetWidth;
			var y=0;
			while(obj.offsetParent)
			{
				x+=obj.offsetLeft;
				y+=obj.offsetTop;
				obj=obj.offsetParent;
			}
			return{x:x,y:y};
		}
		
				//fill date
		this.fillDate=function(dateStr){
		
		      var selDateArr=dateStr.split('-');
		      this.setSelStyle(this.currentDateId,false);
		      this.currentDateId=selDateArr[2];
		      this.selDate=dateStr;
		      this.setSelStyle(selDateArr[2],true);
		}

		//
		this.$=function(id)
		{
			return document.getElementById(id);
		}
		
       this.showCalendar=function(showIDAry,fillIDAry){
		    /******************************
			*����˵��
			*showIDAry:�����ʾ������Ԫ�ص�ID����
			*fillIDAry:Ҫ����������ݵ�Ԫ�ص�ID����
			******************************/
			this.moveObjAry=showIDAry;
			this.fillObjAry=fillIDAry;
			this.moveCalendar(0);
		}
		
		this.setDate=function(dateObj){
			if(this.calendarDateContainer.childNodes)
			{
				for(var j=this.calendarDateContainer.childNodes.length-1;j>=0;j--)
				{
					this.calendarDateContainer.removeChild(this.calendarDateContainer.childNodes[j]);
				}
			}
		    var W=1;
			var Y=dateObj.Y;
			var M=dateObj.M;
			var D=dateObj.D;
			var dayAry=[31,28,31,30,31,30,31,31,30,31,30,31];
			var r=[0,3,3,6,1,4,6,2,5,0,3,5];
			var c=6;
			if(Y%400==0||(Y%4==0&&Y%100!=0))
			{
				dayAry[1]=29;
			}
			if((Y%400==0||(Y%4==0&&Y%100!=0))&&M<3)
			{
				c=5;
			}
			var y=Y%400;
			w=(y+Math.floor(y/4)-Math.floor(y/100)+r[M-1]+1+c)%7;
			//alert(w);
			var R=1;
		    R=(dayAry[M-1]-7+w)%7==0?R+(dayAry[M-1]-7+w)/7:R+Math.floor((dayAry[M-1]-7+w)/7)+2;
			
			
			 var w2 = new Date(Y, M-1, 1).getDay();
            var prevDays = M==1  ? dayAry[11] : dayAry[M-2];
            var preDaysArr=new Array();//����֮ǰ���ڵ�����
			
			var preDaysAdd=0;//ͨ�����������ȫ֮ǰ������
			if(w<8) //Ϊ��֤����������������� ����ʱ��Ȳ���������
			{
			 preDaysAdd =8;
			}
			
			if(w>12)
			{
			 preDaysAdd =-3;
			}
			
	for(var i=(w2-1+preDaysAdd); i>=0; i--) //��� for ѭ��Ϊ����������Դ������ WebCalendar.day����ʽ�� d/m/yyyy
    {
          preDaysArr.push(prevDays-i);
    }
			
			var nextIndex=1;
			var lastIndex=0;
			var start=0;
			var d=1;
			
			w=w+preDaysAdd;
			
			for(var i=0;i<7;i++)
			{
				var div=document.createElement("div");
				div.style.cssText="width:175px;height:23px;margin-bottom:2px;background:#fff;";
				for(var k=0;k<7;k++)
				{
					var p=document.createElement("p");
					p.style.cssText="width:25px;height:20px;float:left;text-align:center;padding-top:3px;margin:0px;color:#ccc;";
					if(start>=w&&d<=dayAry[M-1])
					{
					
//						if(this.beforeNotUsed&&this.date.beforeTheDate(Y,M,d))
//						{
//							p.innerHTML=d;
//						}
//						else if(this.afterNotUsed&&this.date.afterTheDate(Y,M,d))
//						{
//							p.innerHTML=d;
//						}
//						else
//						{
                          var selStyle='';
                            if((this.currentDate.D==d)&&(this.currentDate.M==dateObj.M)&&(this.currentDate.Y==dateObj.Y))
                            {//�ж��ǽ���
                             selStyle='background-color:#99aabb;';
                       
                            }
                            else{
                               'background-color:#000000;';
                            }
							
                            p.innerHTML="<a style='"+selStyle+"' id='"+this.calendarName+'_ti_'+d+"' href='javascript:"+this.calendarName+".fillDate(\""+Y+"-"+M+"-"+d+"\");void(0);'>"+d+"</a>";
							
//						}
						d++;
					}else{
                        if(d==1)
                        {
                          // p.innerHTML=preDaysArr[k];
                          p.innerHTML="<a style='color:gray;' href='javascript:"+this.calendarName+".setMenu("+this.date.getThePreDate(dateObj,this.minYear)+");void(0)'>"+preDaysArr[lastIndex++]+"</a>";
                        }
                        else
                        {
                          p.innerHTML="<a style='color:gray;' href='javascript:"+this.calendarName+".setMenu("+this.date.getTheNextDate(dateObj,this.maxYear)+");void(0)'>"+(nextIndex++)+"</a>";
                        }
					}
					
					start>w?start=w:start++;
					div.appendChild(p);
					
				}
			  this.calendarDateContainer.appendChild(div);
			}
		}
		
		this.setSelStyle=function(id,isSel)
		{
		var currentDate=this.selDate.split('-');
		var toDay=this.date.getTheDate();
		  if(isSel)
		  {
		    if((currentDate[2]==toDay.D)&&(currentDate[1]==toDay.M)&&(currentDate[0]==toDay.Y))
		    {
		        document.getElementById(this.calendarName+'_ti_'+id).style.backgroundColor='#557799';
		    }
		    else
		    {
		       document.getElementById(this.calendarName+'_ti_'+id).style.backgroundColor='#aaccee';
		    }
		   
		  }
		  else
		  {
		    if(id==0)
		    {
               return;	
		    }
		    if((currentDate[2]==toDay.D)&&(currentDate[1]==toDay.M)&&(currentDate[0]==toDay.Y))
		    {
		        document.getElementById(this.calendarName+'_ti_'+id).style.backgroundColor='#99aabb';
		    }
		    else
		    {
		      document.getElementById(this.calendarName+'_ti_'+id).style.backgroundColor='#ffffff';
		    }
		  }		
		}

				/*�����������Ʋ˵�*/
		this.setMenu=function(dateObj){
			this.calendarMenuContainer.innerHTML="<a href='javascript:"+this.calendarName+".setMenu("+this.date.getThePreDate(dateObj,this.minYear)+");void(0)'><<</a>  "+dateObj.Y+"-"+(dateObj.M>9?dateObj.M:"0"+dateObj.M)+"  <a href='javascript:"+this.calendarName+".setMenu("+this.date.getTheNextDate(dateObj,this.maxYear)+");void(0)'>>></a>";
			this.setDate(dateObj);
	
		}

		/*��ʼ��*/
		this.initial=function(){
	        
			this.calendarContainer=document.createElement("div");
			this.calendarContainer.style.cssText="width:175px;border-left:8px solid #c3d9ff;border-right:8px solid #c3d9ff;padding:0px;background:#c3d9ff;font:12px Arial;margin-bottom:1px;display:"+this.display+";";
			this.calendarContainer.setAttribute("css",this.calendarContainer.style.cssText);
			this.calendarMenuContainer=document.createElement("div");
			this.calendarMenuContainer.style.cssText="width:175x;height:25px;background:#c3d9ff;color:#fff;text-align:center;padding-top:3px;";
			this.calendarWeekContainer=document.createElement("div");
			this.calendarWeekContainer.style.cssText="width:175px;height:25px;margin-bottom:1px;";
			for(i=0;i<7;i++)
			{
				var p=document.createElement("p");
				p.style.cssText="width:25px;height:20px;float:left;text-align:center;padding-top:3px;border-bottom:1px solid #666;margin:0px;background:#c3d9ff;";
				p.innerHTML=this.weekAry[i];
				this.calendarWeekContainer.appendChild(p);
			}
			
			this.calendarDateContainer=document.createElement("div");
		    this.calendarDateContainer.style.cssText="width:175px;background:#fff;";
			this.calendarCloseContainer=document.createElement("div");
			this.calendarCloseContainer.style.cssText=this.calendarMenuContainer.style.cssText;
			//this.calendarCloseContainer.innerHTML="<a href='javascript:"+this.calendarName+".calendarContainer.style.display=\"none\";void(0);'>�ر�����</a>";
			this.calendarContainer.appendChild(this.calendarMenuContainer);
			this.calendarContainer.appendChild(this.calendarWeekContainer); 
			this.calendarContainer.appendChild(this.calendarDateContainer); 
			this.calendarContainer.appendChild(this.calendarCloseContainer);
			//alert('1');
		
			document.getElementById(this.calendarName+'_div').appendChild(this.calendarContainer);
		  //  setTimeout(new Function( document.body.appendChild(this.calendarContainer)),50);
				
             this.currentDate=this.date.getTheDate();
			this.setMenu(this.date.getTheDate());
			this.currentDateId=0;
			this.selDate='';
		}
		
		this.checkYear=function(){
	
			if(!this.minYear.toString().match(/\d\d\d\d/))
			{
				alert("���������벻��ȷ����������");
			}
			else if(!this.maxYear.toString().match(/\d\d\d\d/))
			{
				alert("���������벻��ȷ����������");
			}
			else if(eval("0+"+this.maxYear)<=eval("0+"+this.minYear))
			{
				alert("�����ݱ������������,��������");
			}
			else if(eval("0+"+this.maxYear)<this.date.getFullYear())
			{
				alert("�����ݱ�����ڻ��ߵ��ڵ�ǰ���");
			}
			else
			{
			 this.initial();
			}
		}
		this.checkYear();
//		alert('2');

}
	
function calendarOpenMonthEvent(eventStr,timeStr)
{
    if(eventStr=="<Time></Time>")
    {
      return;
    }
    var url = "/plugin/BasicPluginAspects/calendar/CalendarMonthOpenWindow.aspx?eventStr=" + escape(eventStr) + "&timeStr=" + escape(timeStr);

    ShowModalDialogInFrame(url);
}  
//-----------cn_mynet_context.js------------------
cn_mynet_Context = function(container,topContainer,aspectUID,renderMode)
{
   //当前控件被包含的容器，一般来说是对应一个HTML的对象，一个DIV或者一个TD。
   //控件的内容直接输出到这个容器里
   this.container = container;
   //当前控件被包含的顶级容器，是mynet里边一个控件的最外围的HTML元素，通常是一个控件的边框。对应HTML对象是DIV或者Table
   this.topContainer = topContainer;
   //页面引擎分配给当前控件的唯一ID，该变量可以用来作为HTML元素，javascript变量等的唯一标识
   this.aspectUID = aspectUID;
   //当前控件的输出模式，包括设计状态和预览状态.design 和 preview两种状态
   this.renderMode = renderMode;
   //当前控件的width
   this.width = 0;
   //当前控件的高度
   this.height =0;
   //所有匿名数据的集合
   var allAnonymousData = null;
   //当前Site的Url
   this.curSiteHomeUrl = "http://"+ window.location.hostname;
  
   
   
   //获取保存在狼烟服务器的数据，目前一个控件在狼烟保存的数据限定在10K
   //参数：数据名称
   //返回：字符串
   this.loadAnonymousData = function(dataName)
   {
   
   }
   
   //释放内存
   this.dispose = function()
   {
     this.container = null;
     this.topContainer = null;
     allAnonymousData = null;
   }
}

//用来请求远程数据的Request
//支持跨域请求，支持Post和Get方式
//url: 数据来源，如http://www.baidu.com
//method: post 或者 get
//remoteEncoding: 远程服务器的数据编码格式，gb2312 或者 utf-8
//Sample:
/*
var request = new cn_mynet_RequestClient("http://www.baidu.com","get","http://mynet.cn/,"gb2312");
alert(request.getResponseData())
*/
function cn_mynet_RequestClient(url,method,proxySiteUrl,remoteEncoding)
{
  if(url.indexOf("http://")!=0)
  {
    alert("url参数不对，必须以http://开头");
    return;
  }
  var encoding = remoteEncoding =="" ? "utf-8":remoteEncoding;
  var formDatas = new Array;
  var formKeys = new Array;
  //构造Form对象
  this.AddFormKeyValue = function(key,value)
  {
     formDatas[key] =value;
     formKeys.push(key);
  }
  
  this.GetFormDatas = function()
  {
     return formDatas;
  }
  
  //私有方法
  this.builderDatas = function()
  {
    var len = formKeys.length;
    var postStr ="";
    for(var i=0;i<len;i++)
    {
       if(postStr !="")
       {
         postStr +="&";
       }
       postStr += escape(formKeys[i])+"="+escape(formDatas[formKeys[i]]);
    }
    return postStr;
  }
  
  this.getResponseData = function()
  {
    var realUrl = "";
    //证明没有垮域，否则认为是跨域
    if(url.indexOf("http://"+window.location.hostname)==0)
    {
      //可以直接请求，无须服务器端代理
      realUrl = url;
    }
    else
    {
       //要走服务器代理
       realUrl = proxySiteUrl +"plugin/proxy/proxy.aspx?encode="+encoding+"&remoteurl="+escape(url);
    }
    
    var objHttpRequest=null;
    try 
    {
        objHttpRequest = new ActiveXObject('Msxml2.XMLHTTP');
    } 
    catch (e) 
    {
        try 
        {
            objHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        } 
        catch (E) 
        {
            objHttpRequest = new XMLHttpRequest();
        }
    }
    
    objHttpRequest.open(method,realUrl, false);
    if(method.toLowerCase()=="post")
    {
      objHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      objHttpRequest.setRequestHeader("char-set","utf-8");
      objHttpRequest.send(this.builderDatas());
    }
    else
    {
      objHttpRequest.send(null);
    }
    return objHttpRequest.responseText;
  }
}
//-----------colorfulPhotosAlbumJS.js------------------
//��������Ϊ��
//prefix ǰ׺��
//num ����
//time �л�ʱ��
function Colorful(prefix,num,time)
{
    var currentPic = document.getElementById(prefix + "pic_1"); //ȡ��DIVԪ������
    this.prefix = prefix; //ǰ׺
    this.count = num; //����
    this.currentIndex;  //��ǰѡ����
    if(!this.currentIndex)
        this.currentIndex = 1; 
    var self = this; //Ϊ�˱��ⶨʱ������THIS�ؼ��� 
    this.time = time; //ʱ�����
    this.Show = function(index)
    {
        try {
        //�л�չʾ������
            var cPic = document.getElementById(prefix + "pic_" + index);
            for(var i=1;i<=this.count;i++)
            {
                document.getElementById(prefix+"pic_"+i).style.display="none";
            }
            cPic.style.display = "inline-block";
            this.currentPic = cPic;
            this.currentIndex = index;
            this.Play();
        }
        catch(e){}
    }
    //ֹͣ   
    this.Stop = function()
    {
        if(typeof(timerId)!='undefined' && timerId + "" != "")
        {
            clearInterval(timerId);
        }
    }
    //���Ų������ʱ
    this.Play = function()
    {
        this.Stop();
        timerId = setInterval(this.PlayNext,time);
    } 
    //������һ��
    this.PlayNext = function()
    {
        var index = self.currentIndex + 1;
        if(index > self.count)
            index = 1;
        self.Show(index);         
    }   
}
//-----------d_checkSiteType.js------------------

//-----------d_helpPopMenu.js------------------

//-----------d_OutlookBar.js------------------

//-----------d_toolbox.js------------------

//-----------FadeTextSwitch.js------------------
var FadeTextSwitchEffect=new Object();
//构造函数
FadeTextSwitchEffect=function(textArray,targetId,times,clientTimeId)
{
  this.textArray=textArray; //需切换的文本数组
  this.targetId=targetId;//标志前缀
  this.times=times;//切换时间
  this.currentIndex=0;//初始当前选中项
  this.timeId="";//时间的ID
  

var self=this;  //为了避免THIS关键字作用域不同
//if(this.clientTimeId!=null)
//clearInterval(this.clientTimeId);
  this.clientTimeId=""; //时间ID
  var tempF=function (){ self.Switch(); };   
  this.clientTimeId=setInterval(tempF,3500);

};
//切换文字
FadeTextSwitchEffect.prototype.Switch=function()
{

  var self=this;
  if(this.currentIndex<this.textArray.length)
  {
    self.SwitchText(this.textArray[this.currentIndex]); 
	
	this.currentIndex++;
	if(this.currentIndex==this.textArray.length)
	{
	   this.currentIndex=0;
	}
	
  };


}
//切换文字时,播放特效
FadeTextSwitchEffect.prototype.SwitchText = function(switchValue) {
    var tId = this.targetId + "__sdf__f3";
    if (document.getElementById(tId) != null) {
        var tempDiv = document.getElementById(this.targetId);
        if (tempDiv.filters && tempDiv.filters.length > 0) {
            tempDiv.filters[0].Apply();
            tempDiv.filters[0].Play();
        }
    }
    if (document.getElementById(this.targetId) != null) {
        document.getElementById(this.targetId).innerHTML = "<div id='" + tId + "' class='" + this.targetId + "_cssFade'>" + switchValue + "</div>"; 
    }
}
//此程序是为了避免程序在酷炫工具中重复RENDER时定时器出错的问题.
FadeTextSwitchEffect.prototype.ChangeArray=function(newArray)
{
  this.currentIndex=0;
  this.textArray=newArray;
}
//-----------Func.js------------------

//-----------GraySidePhotoGallery.js------------------
var GraySiderPhotoGallery = new Object();
GraySiderPhotoGallery = function (prefix, jsonPhotos, currentPhotoIndex, photoWidth, photoHeight, currentPageIndex, currentPageSize, currentPageListCount) {
    /*
    prefix=前缀名,通过前缀名+定义好的名字寻找属于该控件的HTML元素
    jsonPhotos=用JSON构建一个PHOTO对象,其中包括,大图片链接,小图片链接,图片名,图片说明,
    currentPhotoIndex:当前图片索引
    photoWidth,PhotoHeight:容器宽高
    */
    this.prefix = prefix;
    this.jsonPhotos = jsonPhotos;
    this.currentPhotoIndex = currentPhotoIndex; //当前默认选中的图片索引
    this.photoWidth = photoWidth;
    this.photoHeight = photoHeight;
    this.delayCount = 0;

    this.fadeTimeId = '';
    this.tranLeftId = '';
    this.tranRightId = '';

    this.photoSpace = 30; //间隔
    this.currentPageIndex = currentPageIndex; //当前页面
    this.currentPageSize = currentPageSize; //当前页面图片数量
    this.currentPageListCount = currentPageListCount; //当前页面列表数
    this.currentPageListIndex = 0; //当前分页列表
    //this.currentPageListTotal = (jsonPhotos.length % this.currentPageListCount) > 0 ? (jsonPhotos.length / this.currentPageListCount) + 1 : (jsonPhotos.length / this.currentPageListCount);
    this.currentPageListTotal = parseInt(currentPageListCount); //取整,避免出现小数
}

//展示其边框
GraySiderPhotoGallery.prototype.ShowSider = function (event, target) {

    var self = this;

    self.clearTime(this.tranLeftId);
    var obj = event.toElement ? event.toElement : event.target;

    if (typeof obj == 'undefined') {
        return;
    }
    self.SetTranStyle(document.getElementById(self.prefix + 'TranBackgroundLeft'), 0);
    self.SetTranStyle(document.getElementById(self.prefix + 'TranBackgroundRight'), 0);

    //判读其边框是左还是右
    if (obj.id.indexOf("Right") != -1) {
        document.getElementById(self.prefix + 'ArrowImgRight').style.display = '';
    }
    else {
        document.getElementById(self.prefix + 'ArrowImgLeft').style.display = '';
    }

    //     // debugger;
    // self.DoFade(target.id,7,0,50,4,'',this.tranRightId);
    self.SetTranStyle(target, 50);
}
//关闭侧边栏
GraySiderPhotoGallery.prototype.CloseSider = function (event, target) {

    var self = this;
    var obj = event.toElement ? event.toElement : event.relatedTarget;

    if (typeof obj != 'undefined' && obj != null) {
        var testString = obj.id + "";
        if (testString.indexOf("rrow") != -1) {
            return;
        }
    }
    document.getElementById(self.prefix + 'ArrowImgRight').style.display = 'none';
    document.getElementById(self.prefix + 'ArrowImgLeft').style.display = 'none';

    self.SetTranStyle(target, 0);
    ////     //阻止图片激发此事件     
}
//自适应宽和高
GraySiderPhotoGallery.prototype.imgResize = function (oimg, maxWidth, maxHeight) {
    var width = oimg.width;
    var height = oimg.height;
    //当宽度超过固定区域时，对高度进行缩放
    if (maxWidth && width > maxWidth) {
        height = maxWidth / width * height;
        width = maxWidth;
    }
    //当高度超过固定区域时，对宽度进行缩放
    if (maxHeight && height > maxHeight) {
        width = maxHeight / height * width;
        height = maxHeight;
    }
    return [Math.floor(width), Math.floor(height)];
};

//更换图片
GraySiderPhotoGallery.prototype.ChangPic = function (imgIndex) {
    var self = this;
    //如果点击当前的图片，则无需切换
    if (self.currentPhotoIndex == imgIndex) { return; }
    self.clearTime(this.fadeTimeId);
    self.clearTime(this.tranLeftId);
    self.clearTime(this.tranRightId);
    //document.getElementById(self.prefix+'OverLoadingTran').filters.alpha.opacity=100;
    self.SetTranStyle(document.getElementById(self.prefix + 'OverLoadingTran'), 100);
    document.getElementById(self.prefix + 'OverLoadingTran').style.display = '';
    self.currentPhotoIndex = (imgIndex);
    var currentIndex = self.currentPageIndex + (this.currentPageListCount * this.currentPageListIndex);
    var src = self.jsonPhotos[currentIndex][imgIndex].bigPhotoSrc;
    //通过RECT属性，制作渐渐剪切出现的效果 
    var rect = "rect(0," + self.photoWidth + "," + self.photoHeight + "," + "0)";
    document.getElementById(self.prefix + 'OverLoading').width = self.photoWidth + 'px';
    document.getElementById(self.prefix + 'OverLoading').height = self.photoHeight + 'px';
    document.getElementById(self.prefix + 'OverLoading').style.clip = rect;
    document.getElementById(self.prefix + 'OverLoading').style.display = '';
    document.getElementById(self.prefix + 'mainPic').src = src;

    document.getElementById(self.prefix + 'ImgTitle').innerHTML = self.jsonPhotos[currentIndex][imgIndex].title;
    document.getElementById(self.prefix + 'ImgText').innerHTML = self.jsonPhotos[currentIndex][imgIndex].content;

}
GraySiderPhotoGallery.prototype.showImg = function (Img, self) {
   
    if (($(Img).attr("height") == 0) || ($(Img).attr("width") == 0)) {
        $(Img).attr("height", self.photoHeight);
        $(Img).attr("width", self.photoWidth);
    }

    var leftVar = self.getLeft(document.getElementById(self.prefix + 'TranBackgroundLeft'));
    var ctrlid = self.prefix + 'OverLoadingTran';
    var ctrl = document.getElementById(ctrlid);
    ctrl.style.height = $(Img).attr("height") == 0 ? self.photoHeight : $(Img).attr("height");
    ctrl.style.width = $(Img).attr("width") == 0 ? self.photoWidth : $(Img).attr("width");

    var pLeft;
    var pTop;
    //如果此时刻没有加载width or height 为保证显示样式好看特作如下位置处理，但好像这里pLeft,pTop怎么处理都是0.
    if ($(Img).attr("width") == 0 || $(Img).attr("height") == 0) {
        pLeft = 0;
        pTop = 0;
    }
    else {
        var imgW = $(Img).width();
        var imgH = $(Img).height();    
        if (parseInt(self.photoWidth) > imgW) {
            pLeft = (parseInt(self.photoWidth) - imgW) / 2;
        }
        else {
            pLeft = 0;
        }
        if (parseInt(self.photoHeight) - imgH) {
            pTop = (parseInt(self.photoHeight) - imgH) / 2;
        }
        else {
            pTop = 0;
        }
    }
    pLeft = Math.floor(pLeft) + 'px';
    pTop = Math.floor(pTop) + 'px';
    document.getElementById(self.prefix + 'mainPic').style.marginLeft = pLeft;
    document.getElementById(self.prefix + 'mainPic').style.marginTop = pTop;

    ctrl.style.marginLeft = pLeft;
    ctrl.style.marginTop = pTop;

    self.transitionCurtain(document.getElementById(self.prefix + 'OverLoading'), self.photoWidth, 50);
    //   var es=self.antiEnd;
    self.DoFade(self.prefix + "OverLoadingTran", 18, 100, 0, -4, "", this.fadeTimeId);
    //0.5 秒内隐藏overLoading(无视是否在loading)，因为靠 this.clearTime中的隐藏overloading 很不靠谱，
    //特别是第一次图片onload的时候overloading不会隐藏。
    setTimeout(function () {
        $(document.getElementById(self.prefix + 'OverLoading')).hide();
    }, 500);
}
GraySiderPhotoGallery.prototype.ImageLoad = function (Img) {
    var self = this;
    $(Img).load(function () {
        self.showImg(Img, self);
    })
    //兼容ff
    if (Img.complete) {
        self.showImg(Img, self);
    }
}

//修改小图片的样式
GraySiderPhotoGallery.prototype.ChangePicBox = function (imgNum) {
    var self = this;
    var box = document.getElementById(self.prefix + 'overSmallImg' + imgNum);
    var tImg = document.getElementById(self.prefix + 'smallImg' + imgNum);
    box.style.display = "";
    box.style.height = tImg.height + 1 + "px";
    box.style.width = tImg.width + 1 + "px";
    box.style.clip = "rect(0," + parseInt(tImg.width + 1) + "px," + parseInt(tImg.height + 1) + "px,0)";
}
//获得TOP
GraySiderPhotoGallery.prototype.getTop = function (e) {
    var self = this;
    var offset = e.offsetTop;
    if (e.offsetParent != null) offset += self.getTop(e.offsetParent);
    return offset;
}
//获得LEFT
GraySiderPhotoGallery.prototype.getLeft = function (e) {
    var self = this;
    var offset = e.offsetLeft;
    if (e.offsetParent != null) offset += self.getLeft(e.offsetParent);
    return offset;
}
//小图片弹出时 将覆盖其上的透明白框去掉
GraySiderPhotoGallery.prototype.smallImageOut = function (event, imgNum) {
    var self = this;
    var obj = event.toElement ? event.toElement : event.relatedTarget;

    if (typeof obj != 'undefined') {
        if (obj.id.indexOf('Sider') == -1) {
            return;
        }
    }
    var currentId = self.prefix + 'overSmallImg' + imgNum;
    self.transitionCurtainCenter(document.getElementById(currentId), 0, 50);
}
//获取当前CSS
GraySiderPhotoGallery.prototype.retrieveComputedStyle = function (element, styleProperty) {

    var self = this;
    var computedStyle = null;
    if (typeof element.currentStyle != "undefined") {
        computedStyle = element.currentStyle;
    }
    else {
        computedStyle = document.defaultView.getComputedStyle(element, null);
    }
    return computedStyle[styleProperty];
}
//透明的应用
GraySiderPhotoGallery.prototype.GoFade = function (img, value, step, myfun, timeId) {
    // IE6
    var self = this;
    var im = document.getElementById(img);
    if (typeof im.filters == 'object') {
        if ((step > 0) ? im.filters.alpha.opacity < value : im.filters.alpha.opacity > value) {
            im.filters.alpha.opacity += step;
        }
        else {
            self.clearTime(timeId);
            if (typeof myfun == 'function') {

                myfun();
            }
        }
    }
    else if (typeof im.style.MozOpacity != 'undefined') {
        value = value / 100;
        step = step / 100;
        if ((step > 0) ? im.style.MozOpacity < value : im.style.MozOpacity > value) {
            im.style.MozOpacity = Number(im.style.MozOpacity) + step;
        }
        else {
            self.clearTime(timeId);
            if (typeof myfun == 'function') {
                myfun();
            }
        }
    }
    else if (typeof im.style.KhtmlOpacity != 'undefined') {
        value = value / 100;
        step = step / 100;
        if ((step > 0) ? im.style.KhtmlOpacity < value : im.style.KhtmlOpacity > value) {
            im.style.KhtmlOpacity = Number(im.style.KhtmlOpacity) + step;
        }
        else {
            self.clearTime(timeId);
            if (typeof myfun == 'function') {
                myfun();
            }
        }
    }
    else {
        value = value / 100;
        step = step / 100;
        if ((step > 0) ? im.style.Opacity < value : im.style.Opacity > value) {
            im.style.Opacity = Number(im.style.Opacity) + step;
        }
        else {
            self.clearTime(timeId);
            if (typeof myfun == 'function') {
                myfun();
            }

        }
    }
}
//定时执行FADE 方法 
GraySiderPhotoGallery.prototype.DoFade = function (imgId, times, start, end, step, myfun, timeId) {
    var self = this;

    //  self.clearTime();

    var im = document.getElementById(imgId);

    self.SetTranStyle(im, start);
    //  var fun="self.GoFade('"+imgId+"',"+end+","+step+","+myfun+")";
    timeId = setInterval(function () { self.GoFade(imgId, end, step, myfun, timeId) }, times);  //
}

//清除定时器,特别是FADE时的定时器
GraySiderPhotoGallery.prototype.clearTime = function (timeId) {

    var self = this;


    if (timeId) clearInterval(timeId);

    document.getElementById(self.prefix + 'OverLoading').style.display = 'none';
    document.getElementById(self.prefix + 'OverLoadingTran').style.display = 'none';
}

//剪切功能实现
GraySiderPhotoGallery.prototype.transitionCurtainCenter = function (target, endSize, increment, myfun) {
    var self = this;
    var increment = 3;
    var width = target.offsetWidth;
    var height = target.offsetHeight;

    if (target.style.clip.indexOf("rect") == -1) {
        target.style.clip = "rect(0," + (width - increment) + "px," + height +
      "px," + increment + "px)";
    }
    else {
        var clipDimensions = self.getClipDimensions(target.style.clip);

        if ((clipDimensions[1] > 0) || (clipDimensions[2] > 0)) {
            clipDimensions[0] = clipDimensions[0] + increment;
            clipDimensions[1] = clipDimensions[1] - increment;
            clipDimensions[2] = clipDimensions[2] - increment;
            clipDimensions[3] = clipDimensions[3] + increment;
            target.style.clip = "rect(" + clipDimensions[0] + "px," + clipDimensions[1] + "px," + clipDimensions[2] + "px," + clipDimensions[3] + "px )";
            setTimeout(function () { self.transitionCurtainCenter(target, endSize, increment, myfun) }, 50);
        }
        else {
            if (typeof myfun == 'function') {
                myfun();
            }
        }
    }
    return true;
}

//该方法对相应的元素施用剪辑
GraySiderPhotoGallery.prototype.transitionCurtain = function (target, endSize, increment) {
  
    var self = this;
    var increment = 50;
    var width = target.offsetWidth;
    var height = target.offsetHeight;
    if (target.style.clip.indexOf("rect") == -1) {
        target.style.clip = "rect(0," + (width - increment) + "px," + height +
      "px," + increment + "px)";
    }
    else {
        var clipDimensions = self.getClipDimensions(target.style.clip);

        if (clipDimensions[0] < parseInt(endSize)) {
            clipDimensions[0] = clipDimensions[0] + increment;
            target.style.clip = "rect(" + clipDimensions[0] + "px," + clipDimensions[1] + "px," + clipDimensions[2] + "px," + clipDimensions[3] + "px )";
            setTimeout(function () { self.transitionCurtain(target, endSize, increment) }, 50);
        }
        else {

        }

    }

    return true;
}

//动画停止时,某些元素关闭
GraySiderPhotoGallery.prototype.antiEnd = function () {

    var self = this;

    document.getElementById(self.prefix + 'OverLoading').style.display = 'none';
    document.getElementById(self.prefix + 'OverLoadingTran').style.display = 'none';

}

//获取CSS CLIP属性中的特定元素内容
GraySiderPhotoGallery.prototype.getClipDimensions = function (clipString) {
    var clipValue = clipString.replace(/rect\((.*)\)/, "$1");
    if (/,/.test(clipValue)) {
        var clipDimensions = clipValue.split(",");
    }
    else {
        var clipDimensions = clipValue.split(" ");
    }

    for (var i = 0; i < clipDimensions.length; i++) {
        clipDimensions[i] = parseInt(clipDimensions[i]);
    }

    return clipDimensions;
}
//播放下一张
GraySiderPhotoGallery.prototype.GoNext = function () {
    var self = this;

    //边界判断
    var currentIndex = self.currentPageIndex + (this.currentPageListCount * this.currentPageListIndex);
    if (this.currentPhotoIndex < (this.jsonPhotos[currentIndex].length - 1)) {
        var _currentSelectedIndex = this.currentPhotoIndex + 1;
        this.ChangPic(_currentSelectedIndex);
        //this.currentPhotoIndex++;
    }

}
//播放上一张
GraySiderPhotoGallery.prototype.GoPre = function () {
    //边界判断
    if (this.currentPhotoIndex > (0)) {
        var _currentSelectedIndex = this.currentPhotoIndex - 1;
        this.ChangPic(_currentSelectedIndex);
        //this.currentPhotoIndex--;
    }
}
//按索引切换图片
GraySiderPhotoGallery.prototype.ChangePageIndex = function (pageIndex, IsChangePageList) {
    var self = this;
  
    if (typeof IsChangePageList == 'undefined') {
        if (pageIndex == self.currentPageIndex) {
            return;
        } else {
            self.SetCurrentPageStyle(self.currentPageIndex, false); // chang old style 
            self.currentPageIndex = pageIndex;
        }
    }
    self.SetCurrentPageStyle(pageIndex, false); // chang old style 
    var currentIndex = self.currentPageIndex;
    var arrSize = self.jsonPhotos[currentIndex].length;
    for (var i = 0; i < self.currentPageSize; i++) {
        if (i < arrSize) {
            document.getElementById(self.prefix + 'smallImg' + i).src = self.jsonPhotos[currentIndex][i].smallPhotoSrc;
            document.getElementById(self.prefix + 'imageBox' + i).style.display = '';
        }
        else {
            document.getElementById(self.prefix + 'imageBox' + i).style.display = 'none';
        }
    }
    self.SetCurrentPageStyle(self.currentPageIndex, true); //set new style 

    //切换页码时的处理：先把 currentPhotoIndex 设置为-1 ，
    //再切换到这一页的第一张图片, this.currentPhotoIndex只在图片切换时有关系, 
    //这样当点击第一张时就不会产生LOADING 但不显示图片的问题了
    this.currentPhotoIndex = -1; 
    this.ChangPic(0);

}
//选择透明的样式
GraySiderPhotoGallery.prototype.SetTranStyle = function (target, degreen) {

    if (typeof target.filters == 'object') {
        target.filters.alpha.opacity = degreen;
    }
    else if (typeof target.style.MozOpacity != 'undefined') {
        target.style.MozOpacity = degreen / 100;
    }
    else if (typeof target.style.KhtmlOpacity != 'undefined') {
        target.style.KhtmlOpacity = degreen / 100;
    }
    else {
        target.style.Opacity = degreen / 100;
    }

}
//加粗选中的页面数字
GraySiderPhotoGallery.prototype.SetCurrentPageStyle = function (id, isCurrentPage) {
    if (id == -1) {
        return;
    }

    //  id=(id-this.currentPageListIndex);

    var tempId = this.prefix + "Page" + id;

    var temp = document.getElementById(tempId);

    if (isCurrentPage == true) {
        temp.style.fontWeight = 'bold';
        temp.style.textDecoration = 'none';
    }
    else {
        temp.style.fontWeight = 'normal';
        temp.style.textDecoration = 'underline';
    }
}
//切换数据
GraySiderPhotoGallery.prototype.ChangePageList = function (pageListIndex) {
    var self = this;
    var arrSize = self.jsonPhotos.length;
    for (var i = 0; i < self.currentPageListCount; i++) {

        var temp = document.getElementById(self.prefix + 'Page' + i);
        var pageIndex = (self.currentPageListIndex * this.currentPageListCount) + i;
        if (pageIndex < arrSize) {

            temp.innerHTML = pageIndex + 1;
            var tpageIndex = pageIndex;

            temp.style.display = '';
        }
        else {
            temp.style.display = 'none';
        }
    }

    this.ChangePageIndex(pageListIndex,true);

}
//下一页数据
GraySiderPhotoGallery.prototype.GoNextPageList = function () {

    var self = this;
    if (self.currentPageIndex < (this.currentPageListTotal - 1)) {
        self.currentPageIndex++;
        //记录上一次点击的页码，下页-1
        this.ChangePageList(self.currentPageIndex-1);
    }
}
//上一页数据
GraySiderPhotoGallery.prototype.GoPrePageList = function () {
    var self = this;
    if (self.currentPageIndex > (0)) {
        self.currentPageIndex--;
        //记录上一次点击的页码，上页+1
        this.ChangePageList(self.currentPageIndex+1);
    }
}
//转入特定的URL
GraySiderPhotoGallery.prototype.GoUrl = function (isBlank) {
    var self = this;
    var imgIndex = self.currentPhotoIndex;
    var currentIndex = self.currentPageIndex;
    var src = self.jsonPhotos[currentIndex][imgIndex].url;
    if (src + '' == '') {
        src = '#';
    }
    if (src == '#') {
        return;
    }

    if (isBlank == 'False') {

        window.open(src);
    }
    else {
        location.href = src;
    }

}
//-----------helpPopMenu.js------------------
//����popmenu���script Start

//����popmenu
var helpPopObj;

//��������
var helpelements3=new Array();


//��Ӱ�������
function AddhelpElement3(content,URL)
{
    var widthStyle="";
    if(helpelements3.length!=0)
    {
        widthStyle="width:100%;";
    }
    helpelements3.push( "&nbsp;&nbsp;<span onclick=\"mynetCnShowHelpWin('"+URL+"');\"style='cursor:pointer;"+widthStyle+"'>"+
                        "<a href='#' class='toolbox_helpcontent' ><nobr>"+content+"</nobr></a></span>");
}
//��ȡ��������
function ShowhelpElement3()
{   
    var ShownContent="";
    
	for(i=1;i<helpelements3.length;i++)
	{
	    ShownContent+="<tr><td height='20' width='100%'  style='background-color:#FFFFFF'"+ 
	                    "onmouseover='onselecthelp(this,true)'onmouseout='onselecthelp(this,false)' align='left'>";
	    ShownContent+=helpelements3[i];
	    ShownContent+="</td></tr>";
	}
	return ShownContent;
}

//ѡ��������ݱ�������
function onselecthelp(obj,isSelect)
{
    if (isSelect)
    {
        obj.style.backgroundColor="#D9D9D9";
    }
    else 
    {
        obj.style.backgroundColor="#FFFFFF";
    }
}

var maxHeight=0;
//ҳ����ʾ����
function showhelp3()
{  
    helpPopObj=document.getElementById("helpLayer");
    var helpInner="";
    //����������Ԫ��ʱ����ȡ�������鲢��ʾ
    if(helpelements3.length<=1)
    {
       maxHeight=20;       
       helpInner="<tr><td height='"+maxHeight+"' style='background-color:#FFFFFF'></td></tr>";
    } 
    else
    {
        helpInner=ShowhelpElement3();
        maxHeight=20*(helpelements3.length-1)+2;
    }
    var content ='<table style="FILTER:alpha(opacity=90) shadow(color=#ffffff,direction=135);" id="toolTipTable" width="100%" cellspacing="0" cellpadding="0" border="0" >'+
                helpInner+'</table>';
    helpPopObj.innerHTML=content;
    speadDiv(helpPopObj,maxHeight);
    
}
//ҳ�����ذ���
function hidehelp3()
{
    if(helpPopObj!=null)
    {
        shrinkDiv(helpPopObj,maxHeight);
    }
}
//չ��div
function speadDiv(obj,maxh)
{
    var h=obj.offsetHeight;
    if(obj.style.display=='none')
    {
        function dmove()
        {
            h+=5; //���ò�չ�����ٶ�
            if(h>=maxh)
            {
                obj.style.height=maxh+'px';
                clearInterval(iIntervalId);
                obj.focus();
            }
            else
            {
                obj.style.display='block';
                obj.style.height=h+'px';
                
            }
        }
    }
    iIntervalId=setInterval(dmove,10);
}
//����div
function shrinkDiv(obj,maxh)
{
    var h=parseInt(obj.style.height.substring(0,obj.style.height.length-2));
    if (h==maxh)
    {
    
        function dmove()
        {
            h-=5;//���ò��������ٶ�
            if(h<=0)
            {
                obj.style.display='none';
                clearInterval(iIntervalId);
                helpPopObj=null;
            }
            else
            {
                obj.style.height=h+'px';
            }
        }
        iIntervalId=setInterval(dmove,10);
    }
}
var helpTimer;
//��ʾ/���ذ���
function activehelp()
{
    var target=document.getElementById("helpTopElement");
    var helpobj=document.getElementById("helpLayer");
    if (helpobj.style.top=="")
    {
        helpobj.style.top=getoffset(target).offsetTop+target.offsetHeight+3;
    }
    if (helpobj.style.left=="")
    {
        helpobj.style.left=getoffset(target).offsetLeft-2;
    }
    if(helpPopObj==null)
    {
        showhelp3();
        helpTimer=setTimeout('hidehelp3()',3000);
    }
    else
    {
        if(helpTimer!=null)
            clearTimeout(helpTimer);
        hidehelp3();
    }
}

function  mynetCnShowHelpWin(url)
{
    var parameter="";
    if(url!=""&&url!=null)
      parameter="?contenturl="+url;
  ShowModalDialogInFrame("~/plugin/HelpCenter/HelpCentermain.aspx"+parameter);
  return false;
}

//��ȡ�ؼ��ľ���λ��   
function getoffset(e) 
{  
    this.offsetTop=Mynet_ObjectTop(e);
    this.offsetLeft=Mynet_ObjectLeft(e);
    return this; 
}  

//����popmenu���script End
//-----------jquery.pngFix.pack.js------------------
/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *Something altered by zhangxinxu for supporting that the images can be located at HTML
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'http://www.zhangxinxu.com/study/image/pixel.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|widows|inherit|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))
//-----------JumpTextEffect.js------------------
var JumpTextEffect=new Object();
JumpTextEffect=function(jumpText,targetId,fontsize)
{
this.message=jumpText;
this.mes=new Array();
this.mes[0]=-1;
this.mes[1]=-4;
this.mes[2]=-7;
this.mes[3]=-10;
this.mes[4]=-7;
this.mes[5]=-4;
this.mes[6]=-1;
this.num=0;
this.num2=0;
this.txt="";
this.fontsize=fontsize;
this.jumpId=targetId;

}
JumpTextEffect.prototype.JumpInit=function()
{
//add __uhgnb8s_032 it mark identity
    if(this.message.length > 1){
    for(var i=0; i !=this.message.length;i++){       
        this.txt=this.txt+"<span style='position:relative;' class='"+this.jumpId+"_cssJump' id='"+this.jumpId+""+i+"__uhgnb8s_032'>"+this.message.charAt(i)+"</span>"};     
        document.getElementById(this.jumpId).innerHTML=this.txt;
        this.txt="";
        this.JumpTopCharToLeft();
    }
    else{
      //Error Do NoThing
    }
}
JumpTextEffect.prototype.JumpTopCharToLeft=function()
{
    var self=this;
    var nfinal=document.getElementById(this.jumpId+"0__uhgnb8s_032");
    if(nfinal==null)
    {
      return;
    }
           
    nfinal.style.left=-this.num2;
    if(this.num2 != 9)
    {
    this.num2=this.num2+3;
    var tempF=function (){  self.JumpTopCharToLeft(); };
    setTimeout(tempF,50);
   }
   else
   {
     this.JumpTopCharToRight();
   }
}

JumpTextEffect.prototype.JumpTopCharToRight=function()
{ 
    var self=this;
    var nfinal=document.getElementById(this.jumpId+"0__uhgnb8s_032");
    if(nfinal==null)
    {
      return;
    }
    
    nfinal.style.left=-this.num2;
    if(this.num2 != 0)
    {
     this.num2=this.num2-3;
      var tempF=function (){  self.JumpTopCharToRight(); };
      setTimeout(tempF,50);
     }
    else
    {
        self.AllJump();
    }
}

JumpTextEffect.prototype.AllJump=function()
{

   var self=this;
   this.txt="";
   for(var i=0;i !=this.message.length;i++)
   {
     if(i+this.num > -1 && i+this.num < 7)
     {
       this.txt=this.txt+"<span class='"+this.jumpId+"_cssJump' style='position:relative;top:"+this.mes[i+this.num]+"'>"+this.message.charAt(i)+"</span>";
     }
      else
      {
        this.txt=this.txt+"<span class='"+this.jumpId+"_cssJump'>"+this.message.charAt(i)+"</span>";
      }
   }
   if(document.getElementById(this.jumpId)==null)
   {
      return;
   }
    document.getElementById(this.jumpId).innerHTML=this.txt;
    this.txt="";
    if(this.num != (-this.message.length))
    {
       this.num--;
       var tempF=function (){  self.AllJump(); };
       setTimeout(tempF,50);
    }
    else
    {
       this.num=0;
       var tempF=function (){  self.JumpInit(); };
       setTimeout(tempF,50);
    }

}


//-----------liquidADJS.js------------------
//����ͼƬJS�ļ�
//id ����ID
//width ���
//longwidth �䳤��Ŀ��
//avgwidth ƽ�����

function Liquids(id,width,longwidth,avgwidth){
    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}('n 19=l(1W){n 4h=l(){m(9.1n&&15[0]!=\'6d\')k 9.1n.2K(9,15);T k 9};P(n C 14 9)4h[C]=9[C];4h.Y=1W;k 4h};19.1H=l(){};19.Y={V:l(1W){n 4g=Q 9(\'6d\');n 6c=l(2C,1x){m(!2C.2K||!1x.2K)k U;k l(){9.1A=2C;k 1x.2K(9,15)}};P(n C 14 1W){n 2C=4g[C];n 1x=1W[C];m(2C&&2C!=1x)1x=6c(2C,1x)||1x;4g[C]=1x}k Q 19(4g)},26:l(1W){P(n C 14 1W)9.Y[C]=1W[C]}};2a.V=l(){n 12=15;12=(12[1])?[12[0],12[1]]:[9,12[0]];P(n C 14 12[1])12[0][C]=12[1][C];k 12[0]};2a.5f=l(){P(n i=0;i<15.11;i++)15[i].V=19.Y.26};Q 2a.5f(51,1t,5E,6h,19);m(5u 3L==\'2R\'){n 3L=19.1H;3L.Y={}}T{3L.Y.5c=1h}1a.V=L.V=2a.V;n 8x=1a;l $B(J){m(J===22||J===2R)k U;n B=5u J;m(B==\'4U\'){m(J.5c)k\'G\';m(J.1o)k\'1P\';m(J.8w){23(J.6m){18 1:k\'G\';18 3:k J.8v.1d(/\\S/)?\'8t\':\'4H\'}}}k B};l $2t(J){k!!(J||J===0)};l $8u(J,6b){k($B(J))?J:6b};l $69(2s,1e){k I.7u(I.69()*(1e-2s+1)+2s)};l $4c(1q){8z(1q);8D(1q);k 22};m(1a.8C)1a.34=1a[1a.8B?\'8A\':\'5A\']=1h;T m(L.6I&&!L.8s&&!8r.8j)1a.31=1h;T m(L.8i!=22)1a.5h=1h;m(1a.5A)68{L.8h("8f",U,1h)}67(e){};1t.Y.48=1t.Y.48||l(R,K){P(n i=0;i<9.11;i++)R.1v(K,9[i],i,9)};1t.Y.2g=1t.Y.2g||l(R,K){n 3s=[];P(n i=0;i<9.11;i++){m(R.1v(K,9[i],i,9))3s.1o(9[i])}k 3s};1t.Y.4v=1t.Y.4v||l(R,K){n 3s=[];P(n i=0;i<9.11;i++)3s[i]=R.1v(K,9[i],i,9);k 3s};1t.Y.3W=1t.Y.3W||l(R,K){P(n i=0;i<9.11;i++){m(!R.1v(K,9[i],i,9))k U}k 1h};1t.Y.6a=1t.Y.6a||l(R,K){P(n i=0;i<9.11;i++){m(R.1v(K,9[i],i,9))k 1h}k U};1t.Y.4x=1t.Y.4x||l(3t,N){N=N||0;m(N<0)N=I.1e(0,9.11+N);35(N<9.11){m(9[N]===3t)k N;N++}k-1};1t.V({1u:1t.Y.48,5k:l(1c,11){1c=1c||0;m(1c<0)1c=9.11+1c;11=11||(9.11-1c);n 3v=[];P(n i=0;i<11;i++)3v[i]=9[1c++];k 3v},4E:l(3t){n i=0;35(i<9.11){m(9[i]===3t)9.4R(i,1);T i++}k 9},1d:l(3t,N){k 9.4x(3t,N)!=-1},V:l(3v){P(n i=0;i<3v.11;i++)9.1o(3v[i]);k 9},8g:l(1z){n J={},11=I.2s(9.11,1z.11);P(n i=0;i<11;i++)J[1z[i]]=9[i];k J}});l $A(1P,1c,11){k 1t.Y.5k.1v(1P,1c,11)};l $1u(6e,R,K){k 1t.Y.48.1v(6e,R,K)};5E.V({1d:l(4M,6f){k((5u 4M==\'3Q\')?Q 64(4M,6f):4M).1d(9)},2L:l(){k 5L(9)},6g:l(){k 3J(9)},53:l(){k 9.3i(/-\\D/g,l(2j){k 2j.5z(1).6j()})},6B:l(){k 9.3i(/\\w[A-Z]/g,l(2j){k(2j.5z(0)+\'-\'+2j.5z(1).3F())})},6z:l(){k 9.3F().3i(/\\b[a-z]/g,l(2j){k 2j.6j()})},6i:l(){k 9.3i(/^\\s+|\\s+$/g,\'\')},4k:l(){k 9.3i(/\\s{2,}/g,\' \').6i()},4L:l(1P){n 1f=9.2j(/\\d{1,3}/g);k(1f)?1f.4L(1P):U},3K:l(1P){n 2z=9.2j(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);k(2z)?2z.8q(1).3K(1P):U}});1t.V({4L:l(1P){m(9.11<3)k U;m(9[3]&&(9[3]==0)&&!1P)k\'8p\';n 2z=[];P(n i=0;i<3;i++){n 4y=(9[i]-0).8o(16);2z.1o((4y.11==1)?\'0\'+4y:4y)}k 1P?2z:\'#\'+2z.2V(\'\')},3K:l(1P){m(9.11!=3)k U;n 1f=[];P(n i=0;i<3;i++){1f.1o(5L((9[i].11==1)?9[i]+9[i]:9[i],16))}k 1P?1f:\'1f(\'+1f.2V(\',\')+\')\'}});6h.V({2L:l(){k 5L(9)},6g:l(){k 3J(9)}});51.V({2q:l(u){n R=9;u=2a.V({\'K\':R,\'F\':U,\'15\':22,\'2l\':U,\'2E\':U,\'4A\':U},u||{});m($2t(u.15)&&$B(u.15)!=\'1P\')u.15=[u.15];k l(F){n 12;m(u.F){F=F||1a.F;12=[(u.F===1h)?F:Q u.F(F)];m(u.15)12=12.8m(u.15)}T 12=u.15||15;n 2y=l(){k R.2K(u.K,12)};m(u.2l)k 8n(2y,u.2l);m(u.2E)k 8E(2y,u.2E);m(u.4A){68{k 2y()}67(5Y){k 5Y}}k 2y()}},8F:l(12,K){k 9.2q({\'15\':12,\'K\':K})},4A:l(12,K){k 9.2q({\'15\':12,\'K\':K,\'4A\':1h})()},K:l(K,12){k 9.2q({\'K\':K,\'15\':12})},8X:l(K,12){k 9.2q({\'K\':K,\'F\':1h,\'15\':12})},2l:l(4G,K,12){k 9.2q({\'2l\':4G,\'K\':K,\'15\':12})()},2E:l(4G,K,12){k 9.2q({\'2E\':4G,\'K\':K,\'15\':12})()}});n 1k=Q 19({1n:l(o){m($B(o)==\'3Q\')o=L.6G(o);k $(o)}});l $(o){m(!o)k U;m(o.5X||[1a,L].1d(o))k o;m($B(o)==\'3Q\')o=L.4d(o);m($B(o)!=\'G\')k U;m([\'4U\',\'8W\'].1d(o.4I.3F())||o.V)k o;o.5X=1h;2P.4w(o);o.V=2a.V;m(!(o.5c))o.V(1k.Y);k o};n 2o=Q 19({});Q 2a.5f(2o);L.2M=L.3x;l $$(){m(!15)k U;m(15.11==1){m(!15[0])k U;m(15[0].5W)k 15[0]}n 1b=[];$1u(15,l(1j){23($B(1j)){18\'G\':1b.1o($(1j));1X;18\'3Q\':1j=L.2M(1j);5J:m(1j.11){$1u(1j,l(o){m($(o))1b.1o(o)})}}});1b.5W=1h;k 2a.V(1b,Q 2o)};2o.4q=l(C){k l(){n 12=15;n 3O=[];n 1b=1h;$1u(9,l(o){n 2y=o[C].2K(o,12);m($B(2y)!=\'G\')1b=U;3O.1o(2y)});m(1b)3O=$$(3O);k 3O}};1k.V=l(1W){P(n C 14 1W){3L.Y[C]=1W[C];1k.Y[C]=1W[C];2o.Y[C]=2o.4q(C)}};1k.V({4p:l(o,5U){o=$(o)||Q 1k(o);23(5U){18"5Z":$(o.2h).5V(9,o);1X;18"61":m(!o.5R())$(o.2h).4r(9);T $(o.2h).5V(9,o.5R());1X;18"66":o.4r(9)}k 9},8Z:l(o){k 9.4p(o,\'5Z\')},7r:l(o){k 9.4p(o,\'61\')},92:l(o){k 9.4p(o,\'66\')},7c:l(o){9.4r($(o)||Q 1k(o));k 9},4E:l(){9.2h.8S(9);k 9},8R:l(65){n o=9.8K(65!==U);k $(o)},6y:l(o){o=$(o)||Q 1k(o);9.2h.8e(o,9);k o},8J:l(2X){m(1a.34){23(9.3Y()){18\'1p\':9.8I.6k=2X;k 9;18\'4X\':9.4K(\'2X\',2X);k 9}}9.4r(L.8G(2X));k 9},4J:l(1m){k 9.1m.1d(\'(?:^|\\\\s)\'+1m+\'(?:\\\\s|$)\')},63:l(1m){m(!9.4J(1m))9.1m=(9.1m+\' \'+1m).4k();k 9},62:l(1m){9.1m=9.1m.3i(Q 64(\'(^|\\\\s)\'+1m+\'(?:\\\\s|$)\'),\'$1\').4k();k 9},8H:l(1m){k 9.4J(1m)?9.62(1m):9.63(1m)},1O:l(C,O){m(C==\'2c\')9.6l(3J(O));T 9.1p[C.53()]=(O.1o)?\'1f(\'+O.2V(\',\')+\')\':O;k 9},6H:l(1Y){23($B(1Y)){18\'4U\':P(n C 14 1Y)9.1O(C,1Y[C]);1X;18\'3Q\':9.1p.6k=1Y}k 9},6l:l(2c){m(2c==0){m(9.1p.4N!="4z")9.1p.4N="4z"}T{m(9.1p.4N!="6D")9.1p.4N="6D"}m(!9.4O||!9.4O.7N)9.1p.7M=1;m(1a.34)9.1p.2g="4D(2c="+2c*2p+")";9.1p.2c=9.2c=2c;k 9},2d:l(C){C=C.53();n 1p=9.1p[C]||U;m(!$2t(1p)){m(C==\'2c\')k $2t(9.2c)?9.2c:1;m([\'2u\',\'7J\'].1d(C)){k[9.2d(C+\'-28\')||0,9.2d(C+\'-4Y\')||0,9.2d(C+\'-6p\')||0,9.2d(C+\'-21\')||0].2V(\' \')}m(L.6C)1p=L.6C.7H(9,22).7D(C.6B());T m(9.4O)1p=9.4O[C]}m(1p==\'7G\'&&[\'3l\',\'3m\'].1d(C))k 9[\'2J\'+C.6z()]+\'47\';k(1p&&C.1d(/1F/i)&&1p.1d(/1f/))?1p.4L():1p},1i:l(B,R){9.W=9.W||{};9.W[B]=9.W[B]||{\'1z\':[],\'1E\':[]};m(!9.W[B].1z.1d(R)){9.W[B].1z.1o(R);m(9.6A){9.6A((B==\'3p\'&&1a.5h)?\'5O\':B,R,U)}T{R=R.K(9);9.85(\'59\'+B,R);9.W[B].1E.1o(R)}}k 9},84:l(1Y){m(1Y){P(n B 14 1Y)9.1i(B,1Y[B])}k 9},1R:l(B,R){m(9.W&&9.W[B]){n 1I=9.W[B].1z.4x(R);m(1I==-1)k 9;n 1D=9.W[B].1z.4R(1I,1)[0];m(9.6E){9.6E((B==\'3p\'&&1a.5h)?\'5O\':B,1D,U)}T{9.88(\'59\'+B,9.W[B].1E.4R(1I,1)[0])}}k 9},3b:l(B){m(9.W){m(B){m(9.W[B]){9.W[B].1z.1u(l(R){9.1R(B,R)},9);9.W[B]=22}}T{P(n 6F 14 9.W)9.3b(6F);9.W=22}}k 9},1C:l(B,12){m(9.W&&9.W[B]){9.W[B].1z.1u(l(R){R.K(9,12)()},9)}},5i:l(52){n o=9[52+\'5T\'];35($B(o)==\'4H\')o=o[52+\'5T\'];k $(o)},82:l(){k 9.5i(\'2C\')},5R:l(){k 9.5i(\'81\')},7U:l(){n o=9.7T;35($B(o)==\'4H\')o=o.7S;k $(o)},7R:l(){n o=9.7V;35($B(o)==\'4H\')o=o.80;k $(o)},7Z:l(){k $(9.2h)},7Y:l(){k $$(9.6I)},4K:l(C,O){23(C){18\'6x\':9.1m=O;1X;18\'1p\':9.6H(O);1X;18\'2v\':m(1a.5A){n o=$(L.6G(\'<\'+9.3Y()+\' 2v="\'+O+\'" />\'));$1u(9.a1,l(3h){m(3h.2v!=\'2v\')o.4K(3h.2v,3h.O)});m(9.2h)9.6y(o);k o}5J:9.a0(C,O)}k 9},9Z:l(1Y){P(n C 14 1Y)9.4K(C,1Y[C]);k 9},a2:l(){9.a3=$A(15).2V(\'\');k 9},a6:l(C){k(C==\'6x\')?9.1m:9.5S(C)},3Y:l(){k 9.4I.3F()},2n:l(x,y){9.3C=x;9.3D=y},2W:l(){23(9.3Y()){18\'3c\':m(9.6q!=-1){n 5s=9.u[9.6q];k 5s.O||5s.2X}1X;18\'9X\':m(!(9.9W&&[\'9Q\',\'9P\'].1d(9.B))&&![\'4z\',\'2X\',\'9N\'].1d(9.B))1X;18\'9R\':k 9.O}k U},4a:l(){k{\'2b\':{\'x\':9.3C,\'y\':9.3D},\'2N\':{\'x\':9.2x,\'y\':9.2w},\'49\':{\'x\':9.4f,\'y\':9.4m}}},3k:l(3g){3g=3g||[];n o=9,21=0,28=0;9S{21+=o.9V||0;28+=o.9U||0;o=o.9T}35(o);3g.1u(l(G){21-=G.3C||0;28-=G.3D||0});k{\'x\':21,\'y\':28}},5K:l(){k 9.3k().y},5M:l(){k 9.3k().x},ap:l(3g){n 1Q=9.3k(3g);n J={\'3m\':9.2x,\'3l\':9.2w,\'21\':1Q.x,\'28\':1Q.y};J.4Y=J.21+J.3m;J.6p=J.28+J.3l;k J}});1a.1i=L.1i=1k.Y.1i;1a.1R=L.1R=1k.Y.1R;1a.3b=L.3b=1k.Y.3b;n 2P={1b:[],4w:l(G){2P.1b.1o(G)},6o:l(){2P.4w(1a);2P.4w(L);2P.1b.1u(l(o){o.3b();P(n p 14 1k.Y)o[p]=22;o.V=22})}};1a.1i(\'ak\',2P.6o);n 3A=Q 19({1n:l(F){9.F=F||1a.F;9.B=9.F.B;9.3H=9.F.3H||9.F.al;m(9.3H.6m==3)9.3H=9.3H.2h;9.6u=9.F.ar;9.ai=9.F.aj;9.ac=9.F.ab;9.aa=9.F.a9;m([\'5O\',\'3p\'].1d(9.B)){9.3N=9.F.6n?(9.F.6n/(1a.55?-6r:6r)):-(9.F.ae||0)/ 3} T m (9.B.1d(/1D/)){9.5D=9.F.6v||9.F.ah;P(n 2v 14 3A.1z){m(3A.1z[2v]==9.5D){9.1D=2v;1X}}9.1D=9.1D||5E.af(9.5D).3F()}T m(9.B.1d(/2m/)||(9.B==\'9L\')){9.1J={\'x\':9.F.5C||9.F.6s+L.1Z.3C,\'y\':9.F.5H||9.F.6w+L.1Z.3D};9.7C={\'x\':9.F.5C?9.F.5C-1a.70:9.F.6s,\'y\':9.F.5H?9.F.5H-1a.7a:9.F.6w};9.9k=(9.F.6v==3)||(9.F.9M==2);23(9.B){18\'9i\':9.4u=9.F.4u||9.F.9h;1X;18\'9l\':9.4u=9.F.4u||9.F.7m}}},1B:l(){9.4t();9.4n();k 9},4t:l(){m(9.F.4t)9.F.4t();T 9.F.9n=1h;k 9},4n:l(){m(9.F.4n)9.F.4n();T 9.F.9f=U;k 9}});3A.1z={\'99\':13,\'97\':38,\'9a\':40,\'21\':37,\'4Y\':39,\'9c\':27,\'9q\':32,\'9G\':8,\'9J\':46};51.V({2Q:l(K,12){k 9.2q({\'K\':K,\'15\':12,\'F\':3A})}});n 6V=Q 19({9B:l(R){9.2S=9.2S||[];9.2S.1o(R);k 9},7j:l(){m(9.2S&&9.2S.11)9.2S.6u().2l(10,9)},9v:l(){9.2S=[]}});n 3z=Q 19({1i:l(B,R){m(R!=19.1H){9.W=9.W||{};9.W[B]=9.W[B]||[];m(!9.W[B].1d(R))9.W[B].1o(R)}k 9},1C:l(B,12,2l){m(9.W&&9.W[B]){9.W[B].1u(l(R){R.2q({\'K\':9,\'2l\':2l,\'15\':12})()},9)}k 9},1R:l(B,R){m(9.W&&9.W[B])9.W[B].4E(R);k 9}});n 3E=Q 19({3o:l(6t,u){9.u=2a.V(6t,u);m(9.1i){P(n 41 14 9.u){m(($B(9.u[41])==\'l\')&&41.1d(/^59[A-Z]/))9.1i(41,9.u[41])}}k 9}});n 9A=Q 19({1n:l(){9.3S=$A(15);9.W={};9.33={}},1i:l(B,R){9.33[B]=9.33[B]||{};9.W[B]=9.W[B]||[];m(9.W[B].1d(R))k U;T 9.W[B].1o(R);9.3S.1u(l(3U,i){3U.1i(B,9.6K.K(9,[B,3U,i]))},9);k 9},6K:l(B,3U,i){9.33[B][i]=1h;n 3W=9.3S.3W(l(1x,j){k 9.33[B][j]||U},9);m(!3W)k;9.3S.1u(l(1x,j){9.33[B][j]=U},9);9.W[B].1u(l(F){F.1v(9,9.3S,3U)},9)}});l $E(1j,2g){k($(2g)||L).4C(1j)};l $9I(1j,2g){k($(2g)||L).2M(1j)};1k.V({3B:l(1j){n 1b=[];1j.4k().5N(\' \').1u(l(4b,i){n 1K=4b.2j(/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/);m(!1K)k;2i.1j=1K;1K[1]=1K[1]||\'*\';m(i==0){m(1K[2]){n o=9.4d(1K[2]);m(!o||((1K[1]!=\'*\')&&(1k.Y.3Y.1v(o)!=1K[1])))k;1b=[o]}T{1b=$A(9.3x(1K[1]))}}T{1b=2o.Y.3x.1v(1b,1K[1],1h);m(1K[2])1b=1b.2g(2i.2Y)}m(1K[3])1b=1b.2g(2i.1m);m(1K[4])1b=1b.2g(2i.3h)},9);k $$(1b)},4d:l(2Y){n o=L.4d(2Y);m(!o)k U;P(n 1A=o.2h;1A!=9;1A=1A.2h){m(!1A)k U}k o},4C:l(1j){k 9.2M(1j)[0]},2M:l(1j){n 5l=[];1j.5N(\',\').1u(l(4b){5l.V(9.3B(4b))},9);k $$(5l)}});L.V({9w:l(1m){k L.3B(\'.\'+1m)},4C:1k.Y.4C,3B:1k.Y.3B,2M:1k.Y.2M});n 2i={1j:[],2Y:l(o){k(o.2Y==2i.1j[2])},1m:l(o){k(1k.Y.4J.1v(o,2i.1j[3]))},3h:l(o){n 1x=o.5S(2i.1j[4]);m(!1x)k U;n 5w=2i.1j[5];m(!5w)k 1h;n O=2i.1j[6];23(5w){18\'*=\':k(1x.1d(O));18\'=\':k(1x==O);18\'^=\':k(1x.1d(\'^\'+O));18\'$=\':k(1x.1d(O+\'$\'))}k U}};2o.V({3x:l(4I){n 5P=[];9.1u(l(o){5P.V(o.3x(4I))});k 5P}});n 6J=Q 19({11:0,J:{},1n:l(J){9.V(J)},9d:l(1D){k 9.J[1D]},9e:l(1D){k 9.J[1D]!==2R},24:l(1D,O){m(O===2R)k U;m(9.J[1D]===2R)9.11++;9.J[1D]=O;k 9},4E:l(1D){m(9.J[1D]===2R)k 9;n J={};9.11--;P(n C 14 9.J){m(C!=1D)J[C]=9.J[C]}9.J=J;k 9},1u:l(R,K){P(n C 14 9.J)R.1v(K||9,C,9.J[C])},V:l(J){P(n C 14 J){m(9.J[C]===2R)9.11++;9.J[C]=J[C]}k 9},1H:l(){k(9.11==0)},1z:l(){n 1z=[];P(n C 14 9.J)1z.1o(C);k 1z},1E:l(){n 1E=[];P(n C 14 9.J)1E.1o(9.J[C]);k 1E}});l $H(J){k Q 6J(J)};n 1V=Q 19({1n:l(1F,B){m(1F.7n)k 1F;1F.7n=1h;B=B||(1F.1o?\'1f\':\'2z\');n 1f,1y;23(B){18\'1f\':1f=1F;1y=1f.5r();1X;18\'1y\':1f=1F.7k();1y=1F;1X;5J:1f=1F.3K(1h);1y=1f.5r()}1f.1y=1y;k 2a.V(1f,1V.Y)},9g:l(){n 3I=$A(15);n 4D=($B(3I[3I.11-1])==\'79\')?3I.98():50;n 1f=9.5k();3I.1u(l(1F){1F=Q 1V(1F);P(n i=0;i<3;i++)1f[i]=I.1T((1f[i]/ 2p * (2p - 4D)) + (1F[i] /2p*4D))});k Q 1V(1f,\'1f\')},96:l(){k Q 1V(9.4v(l(O){k 30-O}))},9F:l(O){k Q 1V([O,9.1y[1],9.1y[2]],\'1y\')},9E:l(4F){k Q 1V([9.1y[0],4F,9.1y[2]],\'1y\')},9D:l(4F){k Q 1V([9.1y[0],9.1y[1],4F],\'1y\')}});l $9H(r,g,b){k Q 1V([r,g,b],\'1f\')};l $9C(h,s,b){k Q 1V([h,s,b],\'1y\')};1t.V({5r:l(){n 3T=9[0],3V=9[1],4P=9[2];n 1S,4B,5g;n 1e=I.1e(3T,3V,4P),2s=I.2s(3T,3V,4P);n 3P=1e-2s;5g=1e/30;4B=(1e!=0)?3P/1e:0;m(4B==0){1S=0}T{n 56=(1e-3T)/3P;n 5b=(1e-3V)/3P;n 1N=(1e-4P)/3P;m(3T==1e)1S=1N-5b;T m(3V==1e)1S=2+56-1N;T 1S=4+5b-56;1S/=6;m(1S<0)1S++}k[I.1T(1S*6L),I.1T(4B*2p),I.1T(5g*2p)]},7k:l(){n 1N=I.1T(9[2]/2p*30);m(9[1]==0){k[1N,1N,1N]}T{n 1S=9[0]%6L;n f=1S%60;n p=I.1T((9[2]*(2p-9[1]))/9s*30);n q=I.1T((9[2]*(7A-9[1]*f))/7y*30);n t=I.1T((9[2]*(7A-9[1]*(60-f)))/7y*30);23(I.7u(1S/60)){18 0:k[1N,t,p];18 1:k[q,1N,p];18 2:k[p,1N,t];18 3:k[p,q,1N];18 4:k[t,p,1N];18 5:k[1N,p,q]}}k U}});1a.V({1i:l(B,R){m(B==\'42\'){m(9.4o)R();T m(!9.W||!9.W.42){n 3X=l(){m(9.4o)k;9.4o=1h;m(9.1q)9.1q=$4c(9.1q);1k.Y.1C.1v(9,\'42\');9.W.42=22}.K(9);m(L.4l&&9.31){9.1q=l(){m([\'4o\',\'6Y\'].1d(L.4l))3X()}.2E(50)}T m(L.4l&&9.34){L.9o("<4X 2Y=7f ao 9p=9b:9K(0)><\\/4X>");$(\'7f\').9u=l(){m(9.4l==\'6Y\')3X()}}T{9.1i("9j",3X);L.1i("9y",3X)}}}1k.Y.1i.1v(9,B,R);k 9},9z:l(6P){k 9.1i(\'42\',6P)}});1a.V({7b:l(){m(9.31)k 9.9x;m(9.55)k L.43.6Q;k L.1Z.6Q},7d:l(){m(9.31)k 9.9t;m(9.55)k L.43.6Z;k L.1Z.6Z},78:l(){m(9.34)k I.1e(L.1Z.2x,L.1Z.4f);m(9.31)k L.43.4f;k L.1Z.4f},76:l(){m(9.34)k I.1e(L.1Z.2w,L.1Z.4m);m(9.31)k L.43.4m;k L.1Z.4m},6O:l(){k 9.70||L.1Z.3C},6X:l(){k 9.7a||L.1Z.3D},4a:l(){k{\'2N\':{\'x\':9.7b(),\'y\':9.7d()},\'49\':{\'x\':9.78(),\'y\':9.76()},\'2b\':{\'x\':9.6O(),\'y\':9.6X()}}},3k:l(){k{\'x\':0,\'y\':0}}});n 17={};17.1L=Q 19({2D:l(){k{3q:19.1H,2G:19.1H,7o:19.1H,7h:17.3u.5e,5I:9m,1M:\'47\',3a:1h,6R:50}},1n:l(u){9.G=9.G||22;9.3o(9.2D(),u);m(9.u.1n)9.u.1n.1v(9)},1l:l(){n 2Z=Q 7q().7p();m(2Z<9.2Z+9.u.5I){9.7l=2Z-9.2Z;9.2O();9.2F()}T{9.1B(1h);9.X=9.M;9.2F();9.1C(\'2G\',9.G,10);9.7j()}},24:l(M){9.X=M;9.2F();k 9},2O:l(){9.X=9.2I(9.N,9.M)},2I:l(N,M){k 9.u.7h(9.7l,N,(M-N),9.u.5I)},1c:l(N,M){m(!9.u.3a)9.1B();T m(9.1q)k 9;9.N=N;9.M=M;9.2Z=Q 7q().7p();9.1q=9.1l.2E(I.1T(a7/9.u.6R),9);9.1C(\'3q\',9.G);k 9},1B:l(2B){m(!9.1q)k 9;9.1q=$4c(9.1q);m(!2B)9.1C(\'7o\',9.G);k 9},ag:l(N,M){k 9.1c(N,M)},ad:l(2B){k 9.1B(2B)}});17.1L.26(Q 6V);17.1L.26(Q 3z);17.1L.26(Q 3E);17.3u={7i:l(t,b,c,d){k c*t/d+b},5e:l(t,b,c,d){k-c/2*(I.5d(I.29*t/d)-1)+b}};17.2k={3c:l(C,M){m(C.1d(/1F/i))k 9.1V;m(M.1d&&M.1d(\' \'))k 9.4q;k 9.6W},1U:l(o,C,36){m(!36.1o)36=[36];n N=36[0],M=36[1];m(!M&&M!=0){M=N;N=o.2d(C)}n 1g=9.3c(C,M);k{N:1g.1U(N),M:1g.1U(M),1g:1g}}};17.2k.6W={1U:l(O){k 3J(O)},3f:l(N,M,3e){k 3e.2I(N,M)},2W:l(O,1M){k O+1M}};17.2k.4q={1U:l(O){k O.1o?O:O.5N(\' \').4v(l(v){k 3J(v)})},3f:l(N,M,3e){n X=[];P(n i=0;i<N.11;i++)X[i]=3e.2I(N[i],M[i]);k X},2W:l(O,1M){k O.2V(1M+\' \')+1M}};17.2k.1V={1U:l(O){k O.1o?O:O.3K(1h)},3f:l(N,M,3e){n X=[];P(n i=0;i<N.11;i++)X[i]=I.1T(3e.2I(N[i],M[i]));k X},2W:l(O){k\'1f(\'+O.2V(\',\')+\')\'}};17.73=17.1L.V({1n:l(o,C,u){9.G=$(o);9.C=C;9.1A(u)},7s:l(){k 9.24(0)},2O:l(){9.X=9.1g.3f(9.N,9.M,9)},24:l(M){9.1g=17.2k.3c(9.C,M);k 9.1A(9.1g.1U(M))},1c:l(N,M){m(9.1q&&9.u.3a)k 9;n 1w=17.2k.1U(9.G,9.C,[N,M]);9.1g=1w.1g;k 9.1A(1w.N,1w.M)},2F:l(){9.G.1O(9.C,9.1g.2W(9.X,9.u.1M))}});1k.V({an:l(C,u){k Q 17.73(9,C,u)}});17.71=17.1L.V({1n:l(o,u){9.G=$(o);9.1A(u)},2O:l(){P(n p 14 9.N)9.X[p]=9.1g[p].3f(9.N[p],9.M[p],9)},24:l(M){n 1w={};9.1g={};P(n p 14 M){9.1g[p]=17.2k.3c(p,M[p]);1w[p]=9.1g[p].1U(M[p])}k 9.1A(1w)},1c:l(J){m(9.1q&&9.u.3a)k 9;9.X={};9.1g={};n N={},M={};P(n p 14 J){n 1w=17.2k.1U(9.G,p,J[p]);N[p]=1w.N;M[p]=1w.M;9.1g[p]=1w.1g}k 9.1A(N,M)},2F:l(){P(n p 14 9.X)9.G.1O(p,9.1g[p].2W(9.X[p],9.u.1M))}});1k.V({am:l(u){k Q 17.71(9,u)}});17.2o=17.1L.V({1n:l(1b,u){9.1b=$$(1b);9.1A(u)},2O:l(){P(n i 14 9.N){n 3Z=9.N[i],2H=9.M[i],2r=9.1g[i],44=9.X[i]={};P(n p 14 3Z)44[p]=2r[p].3f(3Z[p],2H[p],9)}},24:l(M){n 1w={};9.1g={};P(n i 14 M){n 2H=M[i],2r=9.1g[i]={},72=1w[i]={};P(n p 14 2H){2r[p]=17.2k.3c(p,2H[p]);72[p]=2r[p].1U(2H[p])}}k 9.1A(1w)},1c:l(J){m(9.1q&&9.u.3a)k 9;9.X={};9.1g={};n N={},M={};P(n i 14 J){n 5x=J[i],3Z=N[i]={},2H=M[i]={},2r=9.1g[i]={};P(n p 14 5x){n 1w=17.2k.1U(9.1b[i],p,5x[p]);3Z[p]=1w.N;2H[p]=1w.M;2r[p]=1w.1g}}k 9.1A(N,M)},2F:l(){P(n i 14 9.X){n 44=9.X[i],2r=9.1g[i];P(n p 14 44)9.1b[i].1O(p,2r[p].2W(44[p],9.u.1M))}}});17.aq=17.1L.V({1n:l(G,u){9.X=[];9.G=$(G);9.1i(\'3q\',l(){9.G.1i(\'3p\',9.1B.K(9,U))}.K(9));9.1R(\'2G\',l(){9.G.1R(\'3p\',9.1B.K(9,U))}.K(9));9.1A(u)},2O:l(){P(n i=0;i<2;i++)9.X[i]=9.2I(9.N[i],9.M[i])},2n:l(x,y){m(9.1q&&9.u.3a)k 9;n o=9.G.4a();n 1E={\'x\':x,\'y\':y};P(n z 14 o.2N){n 1e=o.49[z]-o.2N[z];m($2t(1E[z]))1E[z]=($B(1E[z])==\'79\')?I.1e(I.2s(1E[z],1e),0):1e;T 1E[z]=o.2b[z]}k 9.1c([o.2b.x,o.2b.y],[1E.x,1E.y])},a8:l(){k 9.2n(U,0)},9O:l(){k 9.2n(U,\'7g\')},a4:l(){k 9.2n(0,U)},a5:l(){k 9.2n(\'7g\',U)},7m:l(o){k 9.2n($(o).5M(),$(o).5K())},2F:l(){9.G.2n(9.X[0],9.X[1])}});17.9Y=17.1L.V({1n:l(o,u){9.G=$(o).1O(\'2u\',0);9.3d=Q 1k(\'95\').7r(9.G).1O(\'9r\',\'4z\').7c(9.G);9.3o({\'1s\':\'5Q\'},u);9.X=[];9.1A(9.u)},2O:l(){P(n i=0;i<2;i++)9.X[i]=9.2I(9.N[i],9.M[i])},5Q:l(){9.2u=\'28\';9.4W=\'3l\';9.2J=9.G.2w;k[9.G.2d(\'2u-28\').2L(),9.3d.2d(\'3l\').2L()]},5B:l(){9.2u=\'21\';9.4W=\'3m\';9.2J=9.G.2x;k[9.G.2d(\'2u-21\').2L(),9.3d.2d(\'3m\').2L()]},7x:l(1s){k 9.1c(9[1s||9.u.1s](),[0,9.2J])},7w:l(1s){k 9.1c(9[1s||9.u.1s](),[-9.2J,0])},7s:l(1s){9[1s||9.u.1s]();k 9.24([-9.2J,0])},7X:l(1s){9[1s||9.u.1s]();k 9.24([0,9.2J])},7W:l(1s){m(9.3d.2w==0||9.3d.2x==0)k 9.7x(1s);T k 9.7w(1s)},2F:l(){9.G.1O(\'2u-\'+9.2u,9.X[0]+9.u.1M);9.3d.1O(9.4W,9.X[1]+9.u.1M)}});17.3u={7i:l(t,b,c,d){k c*t/d+b},89:l(t,b,c,d){k c*(t/=d)*t+b},8a:l(t,b,c,d){k-c*(t/=d)*(t-2)+b},8b:l(t,b,c,d){m((t/=d/2)<1)k c/2*t*t+b;k-c/2*((--t)*(t-2)-1)+b},8c:l(t,b,c,d){k c*(t/=d)*t*t+b},7Q:l(t,b,c,d){k c*((t=t/d-1)*t*t+1)+b},87:l(t,b,c,d){m((t/=d/2)<1)k c/2*t*t*t+b;k c/2*((t-=2)*t*t+2)+b},83:l(t,b,c,d){k c*(t/=d)*t*t*t+b},86:l(t,b,c,d){k-c*((t=t/d-1)*t*t*t-1)+b},8d:l(t,b,c,d){m((t/=d/2)<1)k c/2*t*t*t*t+b;k-c/2*((t-=2)*t*t*t-2)+b},7K:l(t,b,c,d){k c*(t/=d)*t*t*t*t+b},7F:l(t,b,c,d){k c*((t=t/d-1)*t*t*t*t+1)+b},7E:l(t,b,c,d){m((t/=d/2)<1)k c/2*t*t*t*t*t+b;k c/2*((t-=2)*t*t*t*t+2)+b},7O:l(t,b,c,d){k-c*I.5d(t/d*(I.29/2))+c+b},7I:l(t,b,c,d){k c*I.3M(t/d*(I.29/2))+b},5e:l(t,b,c,d){k-c/2*(I.5d(I.29*t/d)-1)+b},7L:l(t,b,c,d){k(t==0)?b:c*I.2f(2,10*(t/d-1))+b},7P:l(t,b,c,d){k(t==d)?b+c:c*(-I.2f(2,-10*t/d)+1)+b},94:l(t,b,c,d){m(t==0)k b;m(t==d)k b+c;m((t/=d/2)<1)k c/2*I.2f(2,10*(t-1))+b;k c/2*(-I.2f(2,-10*--t)+2)+b},8N:l(t,b,c,d){k-c*(I.3G(1-(t/=d)*t)-1)+b},8O:l(t,b,c,d){k c*I.3G(1-(t=t/d-1)*t)+b},8P:l(t,b,c,d){m((t/=d/2)<1)k-c/2*(I.3G(1-t*t)-1)+b;k c/2*(I.3G(1-(t-=2)*t)+1)+b},8Q:l(t,b,c,d,a,p){m(t==0)k b;m((t/=d)==1)k b+c;m(!p)p=d*.3;m(!a)a=1;m(a<I.5y(c)){a=c;n s=p/4}T n s=p/(2*I.29)*I.5t(c/a);k-(a*I.2f(2,10*(t-=1))*I.3M((t*d-s)*(2*I.29)/p))+b},8M:l(t,b,c,d,a,p){m(t==0)k b;m((t/=d)==1)k b+c;m(!p)p=d*.3;m(!a)a=1;m(a<I.5y(c)){a=c;n s=p/4}T n s=p/(2*I.29)*I.5t(c/a);k a*I.2f(2,-10*t)*I.3M((t*d-s)*(2*I.29)/p)+c+b},8L:l(t,b,c,d,a,p){m(t==0)k b;m((t/=d/2)==2)k b+c;m(!p)p=d*(.3*1.5);m(!a)a=1;m(a<I.5y(c)){a=c;n s=p/4}T n s=p/(2*I.29)*I.5t(c/a);m(t<1)k-.5*(a*I.2f(2,10*(t-=1))*I.3M((t*d-s)*(2*I.29)/p))+b;k a*I.2f(2,-10*(t-=1))*I.3M((t*d-s)*(2*I.29)/p)*.5+c+b},90:l(t,b,c,d,s){m(!s)s=1.4Q;k c*(t/=d)*t*((s+1)*t-s)+b},91:l(t,b,c,d,s){m(!s)s=1.4Q;k c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},93:l(t,b,c,d,s){m(!s)s=1.4Q;m((t/=d/2)<1)k c/2*(t*t*(((s*=(1.74))+1)*t-s))+b;k c/2*((t-=2)*t*(((s*=(1.74))+1)*t+s)+2)+b},77:l(t,b,c,d){k c-17.3u.4V(d-t,0,c,d)+b},4V:l(t,b,c,d){m((t/=d)<(1/2.75)){k c*(7.45*t*t)+b}T m(t<(2/2.75)){k c*(7.45*(t-=(1.5/2.75))*t+.75)+b}T m(t<(2.5/2.75)){k c*(7.45*(t-=(2.25/2.75))*t+.8Y)+b}T{k c*(7.45*(t-=(2.8U/2.75))*t+.8T)+b}},8V:l(t,b,c,d){m(t<d/2)k 17.3u.77(t*2,0,c,d)*.5+b;k 17.3u.4V(t*2-d,0,c,d)*.5+c*.5+b}};n 3r={};3r.1L=Q 19({2D:l(){k{3w:U,1M:\'47\',3q:19.1H,6N:19.1H,2G:19.1H,6U:19.1H,4T:19.1H,1r:U,2T:{x:\'21\',y:\'28\'},4s:6}},1n:l(o,u){9.3o(9.2D(),u);9.G=$(o);9.3w=$(9.u.3w)||9.G;9.2m={\'X\':{},\'1I\':{}};9.O={\'1c\':{},\'X\':{}};9.1G={\'1c\':9.1c.2Q(9)};9.6M();m(9.u.1n)9.u.1n.1v(9)},6M:l(){9.3w.1i(\'5o\',9.1G.1c)},1c:l(F){9.1C(\'6N\',9.G);9.2m.1c=F.1J;n 1r=9.u.1r;9.1r={\'x\':[],\'y\':[]};P(n z 14 9.u.2T){9.O.X[z]=9.G.2d(9.u.2T[z]).2L();9.2m.1I[z]=F.1J[z]-9.O.X[z];m(1r&&1r[z]){P(n i=0;i<2;i++){m($2t(1r[z][i]))9.1r[z][i]=1r[z][i].2K?1r[z][i].1v(9):1r[z][i]}}}9.1G.2A=9.2A.2Q(9);9.1G.1B=9.1B.K(9);9.1G.3n=9.u.4s?9.6S.2Q(9):9.1G.2A;L.1i(\'3j\',9.1G.3n);L.1i(\'7e\',9.1G.1B);9.1C(\'3q\',9.G);F.1B()},6S:l(F){n 6T=I.1T(I.3G(I.2f(F.1J.x-9.2m.1c.x,2)+I.2f(F.1J.y-9.2m.1c.y,2)));m(6T>9.u.4s){L.1R(\'3j\',9.1G.3n);9.1G.3n=9.1G.2A;L.1i(\'3j\',9.1G.3n);9.2A(F);9.1C(\'6U\',9.G)}F.1B()},2A:l(F){9.5q=U;9.2m.X=F.1J;P(n z 14 9.u.2T){9.O.X[z]=9.2m.X[z]-9.2m.1I[z];m(9.1r[z]){m($2t(9.1r[z][1])&&(9.O.X[z]>9.1r[z][1])){9.O.X[z]=9.1r[z][1];9.5q=1h}T m($2t(9.1r[z][0])&&(9.O.X[z]<9.1r[z][0])){9.O.X[z]=9.1r[z][0];9.5q=1h}}9.G.1O(9.u.2T[z],9.O.X[z]+9.u.1M)}9.1C(\'4T\',9.G);F.1B()},8l:l(){9.3w.1R(\'5o\',9.1G.1c)},1B:l(){L.1R(\'3j\',9.1G.3n);L.1R(\'7e\',9.1G.1B);9.1C(\'2G\',9.G)}});3r.1L.26(Q 3z);3r.1L.26(Q 3E);1k.V({8k:l(u){k Q 3r.1L(9,2a.V(u||{},{2T:{x:\'3m\',y:\'3l\'}}))}});n 5m=Q 19({2D:l(){k{3y:20,5j:1,4e:l(x,y){9.G.2n(x,y)}}},1n:l(G,u){9.3o(9.2D(),u);9.G=$(G);9.5F=([1a,L].1d(G))?$(L.43):9.G},1c:l(){9.5v=9.7B.2Q(9);9.5F.1i(\'3j\',9.5v)},1B:l(){9.5F.1R(\'3j\',9.5v);9.1q=$4c(9.1q)},7B:l(F){9.1J=(9.G==1a)?F.7C:F.1J;m(!9.1q)9.1q=9.2b.2E(50,9)},2b:l(){n o=9.G.4a();n 1I=9.G.3k();n 2U={\'x\':0,\'y\':0};P(n z 14 9.1J){m(9.1J[z]<(9.u.3y+1I[z])&&o.2b[z]!=0)2U[z]=(9.1J[z]-9.u.3y-1I[z])*9.u.5j;T m(9.1J[z]+9.u.3y>(o.2N[z]+1I[z])&&o.2b[z]+o.2N[z]!=o.49[z])2U[z]=(9.1J[z]-o.2N[z]+9.u.3y-1I[z])*9.u.5j}m(2U.y||2U.x)9.1C(\'4e\',[o.2b.x+2U.x,o.2b.y+2U.y])}});5m.26(Q 3z);5m.26(Q 3E);n 5n=Q 19({2D:l(){k{4e:19.1H,2G:19.1H,5a:l(1I){9.2e.1O(9.p,1I+\'47\')},3R:2p,1s:\'5B\',3N:U}},1n:l(o,2e,u){9.G=$(o);9.2e=$(2e);9.3o(9.2D(),u);9.58=-1;9.4Z=-1;9.1l=-1;9.G.1i(\'5o\',9.7v.2Q(9));m(9.u.3N)9.G.1i(\'3p\',9.7t.2Q(9));m(9.u.1s==\'5B\'){9.z=\'x\';9.p=\'21\';9.1e=9.G.2x-9.2e.2x;9.57=9.2e.2x/2;9.54=9.G.5M.K(9.G)}T m(9.u.1s==\'5Q\'){9.z=\'y\';9.p=\'28\';9.1e=9.G.2w-9.2e.2w;9.57=9.2e.2w/2;9.54=9.G.5K.K(9.G)}9.2e.1O(\'1Q\',\'8y\').1O(9.p,0);n 4S={},5G={};5G[9.z]=[0,9.1e];4S[9.z]=9.p;9.2A=Q 3r.1L(9.2e,{1r:5G,4s:0,2T:4S,3q:l(){9.4i()}.K(9),4T:l(){9.4i()}.K(9),2G:l(){9.4i();9.2B()}.K(9)});m(9.u.1n)9.u.1n.1v(9)},24:l(1l){m(1l>9.u.3R)1l=9.u.3R;T m(1l<0)1l=0;9.1l=1l;9.4j();9.2B();9.1C(\'5a\',9.7z(9.1l)+\'\');k 9},7t:l(F){m(F.3N<0)9.24(9.1l+1);T m(F.3N>0)9.24(9.1l-1);F.1B()},7v:l(F){n 1Q=F.1J[9.z]-9.54()-9.57;m(1Q>9.1e)1Q=9.1e;T m(1Q<0)1Q=0;9.1l=9.5p(1Q);9.4j();9.2B();9.1C(\'5a\',1Q+\'\')},4i:l(){9.1l=9.5p(9.2A.O.X[9.z]);9.4j()},4j:l(){m(9.58!=9.1l){9.58=9.1l;9.1C(\'4e\',9.1l)}},2B:l(){m(9.4Z!==9.1l){9.4Z=9.1l;9.1C(\'2G\',9.1l+\'\')}},5p:l(1Q){k I.1T(1Q/9.1e*9.u.3R)},7z:l(1l){k(9.1e)*1l/9.u.3R}});5n.26(Q 3z);5n.26(Q 3E);',62,648,'|||||||||this|||||||||||return|function|if|var|el||||||options|||||||type|property|||event|element||Math|obj|bind|document|to|from|value|for|new|fn||else|false|extend|events|now|prototype|||length|args||in|arguments||Fx|case|Class|window|elements|start|test|max|rgb|css|true|addEvent|selector|Element|step|className|initialize|push|style|timer|limit|mode|Array|each|call|parsed|current|hsb|keys|parent|stop|fireEvent|key|values|color|bound|empty|pos|page|param|Base|unit|br|setStyle|array|position|removeEvent|hue|round|parse|Color|properties|break|source|documentElement||left|null|switch|set||implement||top|PI|Object|scroll|opacity|getStyle|knob|pow|filter|parentNode|Filters|match|CSS|delay|mouse|scrollTo|Elements|100|create|iCss|min|chk|margin|name|offsetHeight|offsetWidth|returns|hex|drag|end|previous|getOptions|periodical|increase|onComplete|iTo|compute|offset|apply|toInt|getElementsBySelector|size|setNow|Garbage|bindWithEvent|undefined|chains|modifiers|change|join|getValue|text|id|time|255|khtml||checker|ie|while|fromTo||||wait|removeEvents|select|wrapper|fx|getNow|overflown|attribute|replace|mousemove|getPosition|height|width|move|setOptions|mousewheel|onStart|Drag|results|item|Transitions|newArray|handle|getElementsByTagName|area|Events|Event|getElements|scrollLeft|scrollTop|Options|toLowerCase|sqrt|target|colors|parseFloat|hexToRgb|HTMLElement|sin|wheel|items|delta|string|steps|instances|red|instance|green|every|domReady|getTag|iFrom||option|domready|body|iNow|5625||px|forEach|scrollSize|getSize|sel|clear|getElementById|onChange|scrollWidth|pr0t0typ3|klass|draggedKnob|checkStep|clean|readyState|scrollHeight|preventDefault|loaded|inject|Multi|appendChild|snap|stopPropagation|relatedTarget|map|collect|indexOf|bit|hidden|attempt|saturation|getElement|alpha|remove|percent|ms|whitespace|tagName|hasClass|setProperty|rgbToHex|regex|visibility|currentStyle|blue|70158|splice|modSlide|onDrag|object|bounceOut|layout|script|right|previousEnd||Function|what|camelCase|getPos|opera|rr|half|previousChange|on|onTick|gr|htmlElement|cos|sineInOut|Native|brightness|gecko|getBrother|velocity|copy|els|Scroller|Slider|mousedown|toStep|out|rgbToHsb|opt|asin|typeof|coord|operator|iProps|abs|charAt|ie6|horizontal|pageX|code|String|mousemover|limSlide|pageY|duration|default|getTop|parseInt|getLeft|split|DOMMouseScroll|found|vertical|getNext|getAttribute|Sibling|where|insertBefore|_elements_extended_|_element_extended_|err|before||after|removeClass|addClass|RegExp|contents|inside|catch|try|random|some|picked|parentize|noinit|iterable|params|toFloat|Number|trim|toUpperCase|cssText|setOpacity|nodeType|wheelDelta|trash|bottom|selectedIndex|120|clientX|defaults|shift|which|clientY|class|replaceWith|capitalize|addEventListener|hyphenate|defaultView|visible|removeEventListener|evType|createElement|setStyles|childNodes|Hash|check|360|attach|onBeforeStart|liquidADJSgetScrollLeft|init|clientWidth|fps|checkAndDrag|distance|onSnap|Chain|Single|liquidADJSgetScrollTop|complete|clientHeight|pageXOffset|Styles|iParsed|Style|525||getScrollHeight|bounceIn|getScrollWidth|number|pageYOffset|getWidth|adopt|getHeight|mouseup|ie_ready|full|transition|linear|callChain|hsbToRgb|cTime|toElement|isColor|onCancel|getTime|Date|injectAfter|hide|scrolledElement|floor|clickedElement|slideOut|slideIn|600000|toPosition|6000|getCoords|client|getPropertyValue|quintInOut|quintOut|auto|getComputedStyle|sineOut|padding|quintIn|expoIn|zoom|hasLayout|sineIn|expoOut|cubicOut|getLast|nextSibling|firstChild|getFirst|lastChild|toggle|show|getChildren|getParent|previousSibling|next|getPrevious|quartIn|addEvents|attachEvent|quartOut|cubicInOut|detachEvent|quadIn|quadOut|quadInOut|cubicIn|quartInOut|replaceChild|BackgroundImageCache|associate|execCommand|getBoxObjectFor|taintEnabled|makeResizable|detach|concat|setTimeout|toString|transparent|slice|navigator|all|textnode|pick|nodeValue|nodeName|Window|relative|clearTimeout|ie7|XMLHttpRequest|ActiveXObject|clearInterval|setInterval|pass|createTextNode|toggleClass|styleSheet|appendText|cloneNode|elasticInOut|elasticOut|circIn|circOut|circInOut|elasticIn|clone|removeChild|984375|625|bounceInOut|embed|bindAsEventListener|9375|injectBefore|backIn|backOut|injectInside|backInOut|expoInOut|div|invert|up|pop|enter|down|javascript|esc|get|hasKey|returnValue|mix|fromElement|mouseover|load|rightClick|mouseout|500|cancelBubble|write|src|space|overflow|10000|innerHeight|onreadystatechange|clearChain|getElementsByClassName|innerWidth|DOMContentLoaded|onDomReady|Group|chain|HSB|setBrightness|setSaturation|setHue|backspace|RGB|ES|delete|void|click|button|password|toBottom|radio|checkbox|textarea|do|offsetParent|offsetTop|offsetLeft|checked|input|Slide|setProperties|setAttribute|attributes|setHTML|innerHTML|toLeft|toRight|getProperty|1000|toTop|metaKey|meta|altKey|alt|clearTimer|detail|fromCharCode|custom|keyCode|control|ctrlKey|unload|srcElement|effects|effect|defer|getCoordinates|Scroll|shiftKey'.split('|'),0,{}))
    this.id = id;
    this.width = width;
    this.longwidth = longwidth;
   
    this.parseLiquids=function(){
    var liquids = $$('#' + id + ' .liquid');
	    //��δ����ƺ�������ĳ�ּܹ�
	    var fx = new Fx.Elements(liquids, {wait: false, duration: 800, transition: Fx.Transitions.elasticOut});
	    liquids.each(function(liquid, i)
	    {
	        try
	        {
		        liquid.addEvent('mouseover', function(e)
		        {
			        e = new Event(e).stop();
			        var obj = {};
			        obj[i] = { 'width': [liquid.getStyle('width').toInt(), longwidth] };

			        liquids.each(function(other, j)
			        {
				        if (other != liquid)
				        {
					        var w = other.getStyle('width').toInt();
					        if (w != width) obj[j] = {'width': [w, width]};
				        }
			        });
			        fx.start(obj);
		        });
		    }
		    catch(e){}
	    });

	    document.addEvent('mouseover', function(e){
		    e = new Event(e);
		    var rel = e.relatedTarget;
		    if (!rel) return;
		    if (rel.hasClass && (rel.hasClass('liquids') || rel.hasClass('liquid') || rel.id == 'liquid')){
		        var obj = {};
			    //�������ϵ�Ԫ��,���趨����
			    liquids.each(function(other, j){
				    obj[j] = {'width': [other.getStyle('width').toInt(), avgwidth]};
			    });
			    fx.start(obj);
		    };
	    });
    }
}
//-----------l_flexcroll.js------------------

//-----------l_InputValueCheck.js------------------

//-----------l_jq1.3.2.js------------------

//-----------l_toolbox.js------------------

//-----------l_validator.js------------------

//-----------l_Window.js------------------

//-----------mqv1.js------------------
function OnMarquee(item) {
    try {
        if (item.parentNode == null) {//如果不可见了，则自动停掉这个跑马灯
            window.clearInterval(item.il);
            item = null;
        }
        var value = item.getScroll(item);
        value += item.scrollAmount;
        //跑马灯不在从父级边缘滚出来，所以要总宽度减去父级元素的宽度
        var test = item.clFix < 0 ? (item.mqSize - item.getThisParentSize) - value : value;
        
        if (test <= 0) {//当滚动的距离超过了走马灯的边界时，要跳转到倒数第二个走马灯去，走马灯实际上有3到n个相同内容的TD 
            value += item.clFix;
        }
        
        item.setScroll(item, value);
    }
    catch (e)
  { }
}

function EnsureMarqueeManaged(item, speed) {
    if (item.getThisSize == null) {
        InitFunctions(item);
        item.asyncStartMarquee = setInterval(function () { start_marquee(item.id, speed); }, 50);
        if (item.getThisSize(item) == 0) {
            return;
        }
    } 

    if (item.asyncStartMarquee != null) {
        if (item.getThisSize(item) == 0) {
            return;
        }

        clearInterval(item.asyncStartMarquee);
        item.asyncStartMarquee = null;
        BuildMarquee(item);
        InitValues(item);
        CloneWhileNotFullFilled(item);
        InitScroll(item.direction, item, item.getThisSize(item));
        item.style.visibility = '';
        item.onmouseover = function () { StopMarquee(item); };
        item.onmouseout = function () { ResumeMarquee(item); };
    }

}



function BuildMarquee(item) {
    item.style.height = item.parentNode.offsetHeight + "px"; //此举是为了解决如果内容过多，从遥远的地方滚过来会很慢
    item.style.width = item.parentNode.offsetWidth + "px"; //此举是为了解决如果内容过多，从遥远的地方滚过来会很慢
    var container = document.createElement("div"); //放置一个Div作为容器，以免table类型在不同浏览器下会有不同的展示
    container.style.border = "none";
    container.style.margin = "0px";
    container.style.padding = "0px";
    var table = document.createElement("table");
    table.cellSpacing = 0;
    table.cellPadding = 0;
    table.border = 0;
    var row = table.insertRow(0);
    var cell = row.insertCell(0);
    var chtm = item.innerHTML;
    item.hasNoBr = (item.getElementsByTagName.length > 0);

    if (item.hasNoBr == false) {
        chtm = item.innerHTML;
    }
    //让左右滚动在一行显示
    if (item.direction == "right" || item.direction == "left") {
        chtm = "<div   style= 'white-space:nowrap;overflow:hidden;'>" + item.innerHTML + '</div>';
    }
    cell.innerHTML = chtm;

    if (item.getThisSize == GetThisWidth) {
        RemoveLayoutFix(cell.childNodes[0]);
    }

    item.innerHTML = '';
    item.insertBefore(container, null);
    container.insertBefore(table, null);
    item.mq = table;
    item.rw = row;
    item.cl = cell;
    table = item.mq;
    item.cl.style.width = item.cl.childNodes[0].offsetWidth + "px"; //以单元格内部元素的宽度作为单元格宽度，避免出现空白
    item.cl.style.height = item.cl.childNodes[0].offsetHeight + "px"; //以单元格内部元素的高度作为单元格高度，避免出现空白
    table.style.position = 'relative';
    //IE6 ,7 需要把item 本身的position 设置成relative 才会滚动
    if ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0")) {
        item.style.position = "relative";
    }

    //水平滚动，使用fixed属性。计算正确宽度，纵向不适应此属性。因为行高超100%会造成遮挡现象。
    if (item.direction == "right" || item.direction == "left") {
        table.style.tableLayout = 'fixed';
        var oldHeight = item.clientHeight;
        item.style.height = table.offsetHeight + "px";
        //如果控件显示是自动调整显示区尺寸，横向则需要将高度调节
        var newHeight = item.clientHeight;
        if (oldHeight != newHeight)//如果高度有变化，则需要重新计算地板
        {
            mynetResizeTheme();
        }
    }
    else {
        table.style.tableLayout = 'auto';
        table.style.width = item.parentNode.offsetWidth + "px";  //如果控件显示是自动调整显示区尺寸，纵向则需要将宽度调节
    }

}



function RemoveLayoutFix(item) {
    for (var i = 0; i < item.childNodes.length; i++) {
        var child = item.childNodes[i];
        if (child != null && child.tagName != null && child.tagName.toLowerCase() == 'table') {
            child.style.tableLayout = '';
            child.style.height = '';
            child.style.width = '';
            child.width = '';
            child.height = '';
        }
    }
}



function InitValues(item) {
    item.scrollAmount = Math.abs(parseInt(item.getAttribute("scrollAmount"))); //Dom元素非官方属性，需要通过这种方式获取
    if (isNaN(item.scrollAmount)) {
        item.scrollAmount = 6;
    }
    item.scrollDelay = Math.abs(parseInt(item.scrollDelay));
    if (isNaN(item.scrollDelay)) {
        item.scrollDelay = 85;
    }
    switch (item.direction) {
        case "right":
            item.clFix = item.cl.offsetWidth;
            break;

        case "up":
            item.clFix = -item.cl.offsetHeight;
            break;

        case "down":
            item.clFix = item.cl.offsetHeight;
            break;

        case "left":
        default:
            item.clFix = -item.cl.offsetWidth;
            break;

    }


}



function InitFunctions(item) {

    try {
        item.direction = item.getAttribute("direction").toLowerCase();
    }
    catch (e) {
        item.direction = "left";
    }

    switch (item.direction) {

        case "up":
        case "down":
            //不知为什么，offsetHeight取不到所以做个判断，获取height；
            if (item.parentNode.offsetHeight)
                item.getThisParentSize = item.parentNode.offsetHeight;
            else
                item.getThisParentSize = item.parentNode.style.Height.toString().replace("px", "");
            item.getThisSize = GetThisHeight;
            item.getMqSize = GetMqHeight;
            item.cloneOne = CloneOneVertical;
            item.setScroll = SetScrollTop;
            item.getScroll = GetScrollTop;
            break;

        case "left":
        case "right":
        default:
            //和上下滚动用一个逻辑；
            item.getThisParentSize = item.parentNode.offsetWidth;
            if (item.parentNode.offsetWidth)
                item.getThisParentSize = item.parentNode.offsetWidth;
            else
                item.getThisParentSize = item.parentNode.style.Width.toString().replace("px", "");
            item.getThisSize = GetThisWidth;
            item.getMqSize = GetMqWidth;
            item.cloneOne = CloneOneHorizontal;
            item.setScroll = SetScrollLeft;
            item.getScroll = GetScrollLeft;
            break;

    }

} 



function InitScroll(direction, item, size) {
    var table = item.mq;
    var cell;
    var cellCount = item.rw.childNodes.length; //列数
    var rowCount = item.rw.parentNode.childNodes.length; //行数
    var mqSize =0;//走马灯大小
    //往右滚和往下滚，需要添加一个空白的占位符，因为scrollLeft属性不能大于scrollWidth,scrollTop不能大于scrollHeight
    switch (direction) {
        case "right":
            cell = item.rw.insertCell(cellCount);
            mqSize = item.parentNode.offsetWidth;
            cell.style.width = mqSize + "px";
            //因为添加了一个白板的td,它的宽度是走马灯的宽度，需要设置宽度，不然谷歌或者其他浏览器会计算错误
            item.mq.parentNode.style.width = (cellCount * item.clFix) + mqSize + "px";
            item.scrollAmount = -item.scrollAmount;
            break;

        case "up":
            item.scrollTop = 0;
            break;

        case "down":
            cell = table.insertRow(rowCount).insertCell(0);
             //因为添加了一个白板的tr，他得高度是走马灯的高度，需要设置高度，不然谷歌或者其他浏览器会计算错误
            item.mq.parentNode.style.height = (rowCount * item.clFix) + mqSize + "px";
            item.scrollAmount = -item.scrollAmount;
            item.scrollTop = item.scrollHeight - 20;
            break;

        case "left":
        default:
            mqSize = item.parentNode.offsetWidth;
            item.scrollLeft = 20;
            break;
    }
}



function SetScrollLeft(item, value) {
    item.scrollLeft = value;
}
function SetScrollTop(item, value) {
    item.scrollTop = value;
}
function GetScrollLeft(item) {
    return item.scrollLeft;
}
function GetScrollTop(item) {
    return item.scrollTop;
}
function GetMqWidth(item) {
    return item.mq.offsetWidth;
}

function GetMqHeight(item) {
    return item.mq.offsetHeight;
}

function GetThisWidth(item) {
    return item.offsetWidth;
}
function GetThisHeight(item) {
    return item.offsetHeight;
}
function CloneWhileNotFullFilled(item) {
    var lastSize = 0;
    var size = item.getMqSize(item);
    while (size != lastSize && size <= item.getThisSize(item) + Math.abs(item.scrollAmount) + Math.abs(item.clFix)) {
        item.cloneOne(item);
        lastSize = size;
        size = item.getMqSize(item);
    }
    item.mqSize = size;
}

function CloneOneHorizontal(item) {
    var cell = CloneCell(item, item.rw);
    cell.style.width = Math.abs(item.clFix) + "px"; //横向复制时一定要设置一下宽度，不然不同的浏览器会有不同的算法
    item.cl.style.width = Math.abs(item.clFix) + "px";
    item.mq.style.width = "100%";
    item.mq.parentNode.style.width = item.rw.childNodes.length * Math.abs(item.clFix) + "px"; //改变容器的宽度使其自适应
    return cell;
}

function CloneCell(item, row) {
    var cell = row.insertCell(0);
    cell.innerHTML = item.cl.innerHTML;
    return cell;
}

function CloneOneVertical(item) {
    var row = item.mq.insertRow(0);
    var cell = CloneCell(item, row);
    cell.style.height = Math.abs(item.clFix) + "px"; //高度也是如此，复制后一定要设置一下
    item.cl.style.height = Math.abs(item.clFix) + "px"
    item.mq.style.height = "100%";
    item.mq.parentNode.style.height = item.rw.parentNode.childNodes.length * Math.abs(item.clFix) + "px"; //设置容器的高度
    return cell;
}

function StopMarquee(item) {
    if (item.il != null) {
        clearInterval(item.il);
        item.il = null;
    }
}

function ResumeMarquee(item) {
    StopMarquee(item);
    //alert(item.il);
    //if (item.il == null || item.il == undefined) {
    item.il = setInterval(function () { OnMarquee(item); }, item.scrollDelay);
    //alert(item.il);
    //}
}

function start_marquee(name, speed) {
    try {      
        
        var item = document.getElementById(name);
        if (typeof (speed) != "undefined") {
            item.scrollDelay = parseInt(speed, 10) || 85;
        } else {
            item.scrollDelay = parseInt(item.getAttribute("scrollDelay"), 10) || 85; //非标准属性，需要用这种方式获取
        }
        if (item != null) {

            if (item.childNodes.length == 0) {
                return;
            }
            EnsureMarqueeManaged(item, item.scrollDelay);
            if (item.getThisSize(item) == 0) {
                return;
            }

            ResumeMarquee(item);

            //ie下零时调整边框像素
            var itemWidth = item.style.posWidth - 2;
            item.style.width = itemWidth + 'px';

            // luyang modified: 20100709 此句导致IE8下子容器与父容器宽度一致，滚动位置不正确的问题
            //            if (item.parentNode != undefined) {
            //                item.parentNode.style.width = itemWidth + 'px';
            //            }
        }
    }
    catch (e) {
        window.setTimeout(function () { start_marquee(name, speed); }, 1000);
    }
}

function StartMarquee(name, speed) {
    //fix 拖拽后图片加载不正确 
   
    var checker = new MarqueeImageChecker(name);
    //此判断是为了避免图片没加载完成时，占位大小和加载之后有偏差，所以等所有图片加载完成后再开始走马灯
    if (!checker.isChecked()) {
        setTimeout(function () {
            StartMarquee(name, speed);
        }, 2000);
        return;
    }

    var isIE = mynet_GetNavigator() == "MSIE";
    if (isIE) {
        start_marquee(name, speed);
    }
    else {
        $(document).ready(function () {
            start_marquee(name, speed);
        });
    }

}

function RebuildMarquee(name) {
    try {
        var item = document.getElementById(name);
        if (item != null && item.mq != null) {
            var scrollFix = item.getScroll(item); // v3
            if (item.clFix > 0) {
                if (item.getScroll == GetScrollLeft) {
                    scrollFix -= item.scrollWidth;
                }
                else {
                    scrollFix -= item.scrollHeight;
                }
                scrollFix += item.getThisSize(item);
            }

            StopMarquee(item);
            var chtm = item.cl.innerHTML; // v2
            if (item.hasNoBr == false) {
                chtm = chtm.substr(6, chtm.length - 13);
            }

            item.innerHTML = chtm;
            item.getThisSize = null;
            item.style.width = '100%';
            item.style.height = '100%';
            StartMarquee(name);
            item.setScroll(item, item.getScroll(item) + scrollFix);
        }
    }
    catch (e) { }
}


function MarqueeImageChecker(containerName) {
    this.containerName = containerName; 
}
//此判断是为了避免图片没加载完成时，占位大小和加载之后有偏差，所以等所有图片加载完成后再开始走马灯
MarqueeImageChecker.prototype.isChecked = function () {
    //fix 第一次加载时 页面上没有 容器 ，导致 find(img).length =0 -> return true
    if ($("#" + this.containerName).length == 0) { return false; }
    var imgs = $("#" + this.containerName).find("img");
    var len = imgs.length;
    if (len == 0) {
        return true;
    } else {
        for (var i = 0; i < len; i++) {
            if (!imgs.eq(i).attr("complete")) {//有一张图片没有加载完，则返回false。如果图片不存在，这个属性也会是complete
                return false;
            }
        }
        return true;
    }
} 
//-----------mynetFunc.js------------------

//-----------mynetMenu.js------------------

//-----------newmenustyle.js------------------
var tagNavigation=new Object();

//标签导航JS文件
//prefix 前缀
//classprefix CSS前缀
//该程序中所有的样式变化,都是根据

tagNavigation=function(prefix,classPrefix)
{
   this.currentId=0;
   this.currentSubId=0;
   this.prefix=prefix;
   this.menuName="M";//固定的命名前缀,服务端生成类似的DIV
   this.subMenuName="subM"
   this.selectId=0;
   this.selectSubId=0;
          this.classPrefix = classPrefix;
   
   
}

//切换当前样式 //huangsq 2011-9-8 加个参数tagObj,用于区分标签导航和标签布局。tagObj不为空，表明是标签导航，最后就不需要调用mynetResizeTheme了
tagNavigation.prototype.ChangeMenuIndex = function (index, tagObj) {
    // 关闭之前的子菜单层

    var temp = document.getElementById(this.prefix + this.subMenuName + "T" + this.currentId);
    if (temp != null) {
        this.SetSubMenu(temp, false);

    }

    if (this.selectId != this.currentId) {

        //假如不是选中项目,清掉上个菜单的样式
        var oldmenu = document.getElementById(this.prefix + this.menuName + this.currentId);
        if (oldmenu != null)
            this.SetMenuStyle(oldmenu, "N");
    }

    this.currentId = index;
    temp = document.getElementById(this.prefix + this.subMenuName + "T" + this.currentId);

    if (temp != null) {
        this.SetSubMenu(temp, true);
    }

    var menu = document.getElementById(this.prefix + this.menuName + this.currentId);

    this.SetMenuStyle(menu, "O", false);
    if (tagObj == null) {
        _pre_defined_height_ = false;
        mynetResizeTheme(); //huangsq 2011-3-31 标签布局控件切换内容时，背景高度自适应  
    }
}
//设置二级菜单的样式
//obj 二级菜单的元素引用
//isOpen 是否打开该元素
tagNavigation.prototype.SetSubMenu=function(obj,isOpen)
{
    if(isOpen)
    {
       obj.style.display='';
    }
    else
    {       
       obj.style.display='none';
    }
}

tagNavigation.prototype.SetMenuStyle = function(obj, styleMode, isSubMenu) {
    try {
        //根据styleMode改变样式
        var menuName = (isSubMenu == true) ? this.subMenuName : this.menuName;
        //var menuSideName=
        //求出两个边来  为了做成圆角,所以放了两个边

        var leftSide = document.getElementById(obj.id + "L");
        var rightSide = document.getElementById(obj.id + "R");
        obj.className = this.classPrefix + menuName + styleMode;

        if (leftSide != null) {
            leftSide.className = this.classPrefix + menuName + "L" + styleMode;
        }
        if (rightSide != null) {
            rightSide.className = this.classPrefix + menuName + "R" + styleMode;
        }
    }
    catch (er) {
               //donothing
     }

}

//选定一个项目,该项目的样式不受MOUSEOVER的影响
tagNavigation.prototype.SelMenu=function(index,isSubMenu)
{
     if(this.selectId==index)
     {
       return;
     }
     if(this.selectId!=0)
     {
        var oldmenu=document.getElementById(this.prefix+menuName+this.selectId);
        this.SetMenuStyle(oldmenu,"N");
    }
    this.selectId=index;
    this.currentId=index;
    var menuName=(isSubMenu==true)?this.subMenuName:this.menuName; 
    var menu=document.getElementById(this.prefix+menuName+this.selectId);
    this.SetMenuStyle(menu,"O");
    
    //如果存在子菜单的话
   var subItem=document.getElementById(this.prefix+this.subMenuName+"T"+this.currentId);

   if (subItem != null)
   {
       this.SetSubMenu(subItem, true);
   }   
            
}

//选中子菜单时,将样式设置为选中时的状态
tagNavigation.prototype.ChangeSubMenuIndex=function(index)
{
   this.currentSubId=index;
       
   var  temp=document.getElementById(this.prefix+this.menuName+this.currentId+this.currentSubId);
 // alert(this.prefix+this.menuName+this.currentId+this.currentSubId);
   if(temp!=null)
   {
       this.SetMenuStyle(temp,"O",true);
   }

}

//将子菜单设定为未选中的样式
tagNavigation.prototype.UnChangeSubMenuIndex=function(index)
{
//修改子菜单样式
    this.currentSubId = index;
   //获取子菜单的引用      
   var  temp=document.getElementById(this.prefix+this.menuName+this.currentId+this.currentSubId);
   if(temp!=null)
   {
       this.SetMenuStyle(temp,"N",true);
   }

}

var titleNavigation=new Object();
//标题式导航
//prefix 前缀
titleNavigation=function(prefix)
{
   this.currentId=0;
   this.prefix=prefix;
   this.menuName="titleM";
   this.selectId=0;  
}

//鼠标移动上时更改当前样式，传this为此处参数
titleNavigation.prototype.ChangeMenuIndex=function(obj)
{
//    this.currentSubId=index;       
//   var  temp=document.getElementById(this.prefix+this.menuName+this.currentId);
   if(obj!=null)
   {
      obj.className=this.prefix+this.menuName+'O';  
   }
}

//撤销当前样式
titleNavigation.prototype.UnChangeMenuIndex=function(obj) {


   if(obj!=null)
   {
       obj.className=this.prefix+this.menuName+'N';  
   }
}



//-----------newsplayer.js------------------
var NewsPlayer = new Object()
//新闻播放器
//prefix 前缀
//totalwidth 总宽度
//datajson 用JSON格式记录的数据
//vitemwidth 单元宽度
//totalHeight 总高度
NewsPlayer = function (prefix, totalwidth, dataJson, itemWidth, totalHeight) {

    this.prefix = prefix;
    this.totalWidth = totalwidth;
    this.totalHeight = totalHeight;
    this.dataJson = dataJson;
    this.currentIndex = 1;//解决开始时第一张图片出现两次的情况(挤压效果)
    this.urlIndex = 0;
    this.timeid = '';
    var self = this;
    this.mainImg = document.getElementById(this.prefix + 'imgMain');
    this.normalBar = document.getElementById(this.prefix + 'NormalSelected'); //普通红块
    this.mouseIndex = 0;
    this.mainDiv = document.getElementById(this.prefix + 'content');

    this.normalText = document.getElementById(this.prefix + 'NormalSelected_Text');

    this.selectBar = document.getElementById(this.prefix + 'CurrentSelected'); //当前选择的红块
    this.normalSelectText = document.getElementById(this.prefix + 'CurrentSelected_Text');
    this.clientTimeId = "";
    //定时切换
    var tempF = function () { self.Switch(); };
    this.clientTimeId = setTimeout(tempF, 4500);
    this.itemWidth = itemWidth;
    this.barWidth = this.totalWidth - this.itemWidth * this.dataJson.length;
    if (this.selectBar) {
        this.selectBar.style.left = this.barWidth + 0 * this.itemWidth + 2 + 'px';
    }

}
//切换
NewsPlayer.prototype.Switch = function() {
    //this.urlIndex = this.currentIndex;

    var self = this;
    if (this.currentIndex < this.dataJson.length) {
        self.SwitchPic(this.currentIndex);
        this.currentIndex++; //维护当前的选中项
        if (this.currentIndex == this.dataJson.length) {
            this.currentIndex = 0;
        }

    }
}
//切换图片
NewsPlayer.prototype.SwitchPic = function(switchValue) {
    //    if (window.event) {
    //        window.event.cancelBubble = true;
    //    }
    var self = this;
    if (this.mainImg != null) {
        this.mainImg.src = this.dataJson[switchValue].smallPhotoSrc; //切换图片
        this.urlIndex = this.currentIndex = switchValue;
        this.selectBar.style.left = this.barWidth + switchValue * (this.itemWidth) + 2 + 'px';
        //alert(this.selectBar.style.left);
        this.normalSelectText.innerHTML = switchValue + 1;
        var tempDiv = this.mainImg;
        try {
            if (tempDiv.filters) {
                //启动滤镜效果
                tempDiv.filters[0].Stop();
                tempDiv.filters[0].Apply();
                tempDiv.filters[0].Play();

            }
            clearTimeout(this.clientTimeId);
            var tempF = function() { self.Switch(); };
            this.clientTimeId = setTimeout(tempF, 4500);
            //再次启动定时器

        }
        catch (e)
        { }
    }
}

NewsPlayer.prototype.OverBar = function(index) {
  //当鼠标移动到某个按钮之上
    index--;
    this.mouseIndex = index;
    this.normalBar.style.left = this.barWidth + index * this.itemWidth + 2 + 'px';
  
    index++;
    this.normalText.innerHTML = index;
    this.normalBar.style.visibility = 'visible';

}
//当鼠标离开后,将其恢复
NewsPlayer.prototype.UnOverBar = function(event) {
    this.normalBar.style.visibility = 'hidden';
}

NewsPlayer.prototype.SelectBar = function () {
    this.currentIndex = this.mouseIndex;
    this.SwitchPic(this.currentIndex);
    //解决点击第一张图片出现两次的情况(挤压效果)
    if (this.mouseIndex == this.dataJson.length) {
        this.currentIndex = 0;
    }
    else {
        this.currentIndex = this.mouseIndex + 1;
    }
}
//获取随机数值
NewsPlayer.prototype.Ran = function(seed) {
    return Math.floor((seed + 1) * Math.random());
}
//当图片读取的时候
NewsPlayer.prototype.ImgLoad = function (img) {
    if (img.complete) {//加载完成再居中
        var tmpHeight = this.totalHeight - parseInt(img.height);
        // alert(img.height);
        //    if (tmpHeight > 0) {
        var addHeight = parseInt((tmpHeight / 2));  //set it on center
        img.style.marginTop = addHeight + 'px';
        // }
    }
}
//前往当前的URL
NewsPlayer.prototype.GoUrl = function(isNewWin) {

    if (!isNewWin) {
        window.location.href = this.dataJson[this.urlIndex].url;
    }
    else {
        window.open(this.dataJson[this.urlIndex].url);
    }
}
//-----------OnOffMenu.js------------------
var OnOffMenu = new Object()

OnOffMenu = function(prefix, menuArr, imgArr, itemName, itemTitleName, itemImgName) {
    this.prefix = prefix; //前缀
    this.currentIndex = 0; //当前项
    this.menuArr = menuArr; //菜单数组,存0者打开,存1者关闭
    this.imgArr = imgArr; //图片数组
    this.itemName = itemName; // 名称内容
    this.itemTitleName = itemTitleName; //标题
    this.itemImgName = itemImgName; //关闭打开按钮
}


//切换显示样式,根据传入的INDEX
OnOffMenu.prototype.ChangeMode = function(index) {
    if (this.menuArr[index] != null) {
        var item = document.getElementById(this.prefix + this.itemName + index);
        var title = document.getElementById(this.prefix + this.itemTitleName + index);
        var img = document.getElementById(this.prefix + this.itemImgName + index);
        // 代表这UL已经打开
        if (this.menuArr[index] == true) {
            if (item != null) {
                item.style.display = 'none';
                img.src = this.imgArr[1]; //切换箭头图片
            }
            this.menuArr[index] = false;

        }
        else {
            if (item != null) {
                item.style.display = '';
                img.src = this.imgArr[0];
            }
            this.menuArr[index] = true;
        }
    }
}
//这个方法关闭所有的标签,只打开INDEX中传入的项
OnOffMenu.prototype.SetOnlyMenuOpen = function(index) {
    for (var i = 0; i < this.menuArr.length; i++) {
        this.menuArr[i] = false;
    }

    if ((index > -1) && (index < menuArr.lenght)) {
        this.menuArr[index] = true;
    }   

    for (var i = 0; i < this.menuArr.length; i++) {
        this.ChangeMode(i);
    }

}



//-----------OutlookBar.js------------------
function showitem(id, name, iscurrent) {
    var bgcolor = iscurrent ? 'orange' : 'transparent';
    return ("<span style='text-align:left; border:solid 1px " + bgcolor+ "; padding:2px 4px 2px 4px;'><img src='/res/images/cpwoutlookbar_arrow.gif'/> <a href='" + id + "' target=_self>" + name + "</a></span><br>")
}

//number 为一数字，根据其选定合适的DOM 元素
function switchoutlookBar(number) {
    var i = outlookbar.opentitle;
    outlookbar.opentitle = number;
    var id1, id2, id1b, id2b;
    if (number != i && outlooksmoothstat == 0) {
        if (number != -1) {
            if (i == -1) {
                id2 = "blankdiv";
                id2b = "blankdiv";
            }
            else {
                id2 = "outlookdiv" + i;
                id2b = "outlookdivin" + i;
                var outlookTitle = document.getElementById("outlooktitle" + i);
                outlookTitle.className = 'mynetoutlookbar_open';
            }
            id1 = "outlookdiv" + number;
            id1b = "outlookdivin" + number;
            //var curOutLookTitle = document.all("outlooktitle" + number);
            var curOutLookTitle = document.getElementById("outlooktitle" + number);
            curOutLookTitle.className = 'mynetoutlookbar_close';
            smoothout(id1, id2, id1b, id2b, 0);
        }
        else {
            var blankDiv = document.getElementById("blankdiv");
            blankDiv.style.display = "";
            blankDiv.style.height = "100%";
            blankDiv.style.display = "none";
            blankDiv.style.height = "0%";
            blankDiv.style.border = "1px none navy";
            blankDiv.style.background = "white";
            blankDiv.style.color = "#ffffff";
            blankDiv.style.textalign = "center";
        }
    }
}
function smoothout(id1, id2, id1b, id2b, stat) {
    if (stat == 0) {
        var id1bObj = document.getElementById(id1b);
        var id2bObj = document.getElementById(id2b);
        tempinnertext1 = id1bObj.innerHTML;
        tempinnertext2 = id2bObj.innerHTML;
        id1bObj.innerHTML = "";
        id2bObj.innerHTML = "";
        outlooksmoothstat = 1;
        id1bObj.style.overflow = "hidden";
        id2bObj.style.overflow = "hidden";
        document.getElementById(id1).style.height = "0%";
        document.getElementById(id1).style.display = "";
        setTimeout("smoothout('" + id1 + "','" + id2 + "','" + id1b + "','" + id2b + "'," + outlookbar.inc + ")", outlookbar.timedalay);
    }
    else {
        stat += outlookbar.inc;
        if (stat > 100)
            stat = 100;
        document.getElementById(id1).style.height = stat + "%";
        document.getElementById(id2).style.height = (100 - stat) + "%";
        if (stat < 100)
            setTimeout("smoothout('" + id1 + "','" + id2 + "','" + id1b + "','" + id2b + "'," + stat + ")", outlookbar.timedalay);
        else {
            document.getElementById(id1b).innerHTML = tempinnertext1;
            document.getElementById(id2b).innerHTML = tempinnertext2;
            outlooksmoothstat = 0;
            document.getElementById(id1b).style.overflow = "auto";
            document.getElementById(id2).style.display = "none";
        }
    }
}
function getOutLine() {
    outline = "<table " + outlookbar.otherclass + ">";
    for (i = 0; i < (outlookbar.titlelist.length); i++) {
        outline += "<tr><td name=outlooktitle" + i + " id=outlooktitle" + i + " ";
        if (i != outlookbar.opentitle) {
            outline += " nowrap class='mynetoutlookbar_close'";
        }
        else {
            outline += " nowrap  class='mynetoutlookbar_open'";
        }
        outline += outlookbar.titlelist[i].otherclass
        outline += " onclick='switchoutlookBar(" + i + ")'>";
        if (i != outlookbar.opentitle) {
            outline += "<img src='/res/images/cpwoutlookbar_sign.jpg' style='vertical-align:middle;'/>";
        }
        else {
            outline += "<img src='/res/images/cpwoutlookbar_sign2.jpg' style='vertical-align:middle;'/>"; 
        }
        outline += outlookbar.titlelist[i].title + "</td></tr>";
        outline += "<tr><td name=outlookdiv" + i + " valign=top align=left id=outlookdiv" + i + " style='width:100%"
        if (i != outlookbar.opentitle)
            outline += ";display:none;height:0%;";
        else
            outline += ";display:;height:100%;";
        outline += "'><div name=outlookdivin" + i + " id=outlookdivin" + i + " style='overflow:auto;width:100%;height:100%;line-height:22px;padding:4px 0px 0px 18px;text-align:left;'>";
        for (j = 0; j < outlookbar.itemlist[i].length; j++)
            outline += showitem(outlookbar.itemlist[i][j].key, outlookbar.itemlist[i][j].title, outlookbar.itemlist[i][j].isCurrent);
        outline += "</div></td></tr>"
    }
    outline += "</table>"
    return outline
}
function showOutlookItem() {
    var outline;
    outline = "<div id='outLookBarDiv' name='outLookBarDiv' style='width=100%;height:100%'>"
    outline += outlookbar.getOutLine();
    outline += "</div>"
    document.write(outline);
}
function theitem(intitle, instate, inkey,iscurrent) {
    this.state = instate;
    this.otherclass = " nowrap ";
    this.key = inkey;
    this.title = intitle;
    this.isCurrent = iscurrent;
}
function addtitle(intitle) {
    outlookbar.itemlist[outlookbar.titlelist.length] = new Array();
    outlookbar.titlelist[outlookbar.titlelist.length] = new theitem(intitle, 1, 0);
    return (outlookbar.titlelist.length - 1);
}
function additem(intitle, parentid, inkey,iscurrent) {
    if (parentid >= 0 && parentid <= outlookbar.titlelist.length) {
        outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length] = new theitem(intitle, 2, inkey, iscurrent);
        outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length - 1].otherclass = " nowrap align=left style='height:5' ";
        return (outlookbar.itemlist[parentid].length - 1);
    }
    else
        additem = -1;
}
function outlook() {
    this.titlelist = new Array();
    this.itemlist = new Array();
    this.divstyle = "style='height:100%;width:100%;overflow:auto' align=center";
    this.otherclass = "border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";
    this.addtitle = addtitle;
    this.additem = additem;
    this.starttitle = -1;
    this.show = showOutlookItem;
    this.getOutLine = getOutLine;
    this.opentitle = this.starttitle;
    this.reflesh = outreflesh;
    this.timedelay = 50;
    this.inc = 10;
}
function outreflesh() {
    document.getElementById("outLookBarDiv").innerHTML = outlookbar.getOutLine();
}
function locatefold(foldname) {
    for (var i = 0; i < outlookbar.titlelist.length; i++) {
        if (foldname == outlookbar.titlelist[i].title) {
            outlookbar.starttitle = i;
            outlookbar.opentitle = i;
        }
    }
}

//-----------questionnairy.js------------------

function ValidatePassword(frmId,strBaseUrl)
{
  var oPasswordList = document.getElementsByTagName('input');
  var len = oPasswordList.length;
  for(var i=0;i<len;i++)
  {
    if(oPasswordList[i].getAttribute('typename')=='AspectInvitationalCodeQuestion')
    {
      var password = oPasswordList[i].value;
      var aspectUID = oPasswordList[i].getAttribute('aspectuid');
      var randomNum =  parseInt(100000 * Math.random()); 
      var strUrl = strBaseUrl +'q/IsPasswordUsed.aspx?password='+escape(password)+'&aspectUID='+aspectUID+"&dt="+randomNum;
      var questionairyForm = document.getElementById(frmId);
      //同时需要改变表单Action的url,让密码提交后做保存处理，避免密码重复使用
      if(questionairyForm.action.indexOf('&aspectUID')==-1)
      {
        questionairyForm.action =questionairyForm.action+"&aspectUID="+aspectUID;
      }
      var pos = questionairyForm.action.indexOf('&password=')
      if(pos!=-1)
      {
        questionairyForm.action = questionairyForm.action.substring(0,pos);
      }
      questionairyForm.action += "&password="+escape(password);
      var retValue = httpRequest(strUrl);
      return retValue =='true';
    }
  }
  //证明没有密码验证域
  return true;
}

function ValidateVerifyCode(qaId,strBaseUrl)
{
  var oTxtVeryCode = document.getElementById('txtValidCode_'+qaId);
  var strUrl = strBaseUrl + 'web/VidateVeryCode.aspx?strCode='+ oTxtVeryCode.value;
  var retValue = httpRequest(strUrl);
  if(retValue== "false")
  {
    return false;
  }
  else
  {
    return true;
  }
}

function ValidateEmail(email,qaId,strBaseUrl)
{
   var strUrl = strBaseUrl+'q/IsQuestionEmailUsed.aspx?qid='+qaId+'&email='+email;
   var retValue = httpRequest(strUrl);
   if(retValue== "false")
   {
     return false;
   }
   else
   {
     return true;
   }
   
}
//-----------RandomFilterText.js------------------
var RandomFilterText=new Object();
//随机特效文字
//targetId 目标ID
//textArray 带有文字的字符串
//colorArray  颜色字符串
RandomFilterText=function(targetId,textArray,colorArray)
{
clearTimeout(this.timer); //首先初始化清除时间ID,为了避免控件RENDER时候的错误
this.textArray=textArray;
this.targetId=targetId;
this.colorArray=colorArray;
this.timer="";
}
RandomFilterText.prototype.Ran=function(seed) {
//求随机数
   return Math.floor((seed+1)*Math.random());
}
RandomFilterText.prototype.Play=function() {	 
//执行
if(this.timer+""!="")
{
    clearTimeout(this.timer);
}

    //获取当前目标
    var targetDiv=document.getElementById(this.targetId);
    if(targetDiv==null)
    {
      return;
  }
    //获得随机滤镜 
	targetDiv.style.filter="revealTrans(Duration=1.5,Transition=" + this.Ran(22) + ")";
    targetDiv.filters.revealTrans.apply();
	targetDiv.style.background=this.colorArray[this.Ran(this.colorArray.length-1)];
	targetDiv.innerHTML=this.textArray[this.Ran(this.textArray.length-1)];
    targetDiv.filters.revealTrans.play();
    var self = this;
    //使用为了解决SELF的作用域的问题
    var tempTimeFun=function(){self.Play();};
    this.timer = setTimeout(tempTimeFun,3500);
}
//切换数组,让用户数据可以RENDER时切换
RandomFilterText.prototype.ChangeArray=function(newArray)
{
this.textArray=newArray;
}
//-----------rollingPhotosAlbumJS.js------------------
//speed �ٶ�
//prefix ǰ׺
//width ���
RollingImage = function (speed, prefix, width) {
  
    if (speed > 90)
        speed = 90;
    if (speed < 0)
        speed = 0;
    this.tick = 100 - speed;
    this.width = width;
    this.obj1 = document.getElementById(prefix + "_RollingImg_1");
    this.obj2 = document.getElementById(prefix + "_RollingImg_2");
    this.obj3 = document.getElementById(prefix + "_RollingImg_3");
    this.obj3.innerHTML = this.obj2.innerHTML;
    var obj = this;
    var totalWidth = obj.obj2.offsetWidth * 2;
    this.count = 0;
    //���� 
    this.Marquee = function () {
        if (obj.obj2.offsetWidth > 0 && 2 * obj.width > totalWidth) {
            obj.AddCells();
        }
        try {
            if (obj.obj1.scrollLeft >= obj.obj2.offsetWidth)
                obj.obj1.scrollLeft = 0;
            else
                obj.obj1.scrollLeft++;
        }
        catch (e) { 
       
        }
    }
    //��ʱִ��
    var MyMar = setInterval(this.Marquee, this.tick)
    this.obj1.onmouseover = function () {
        clearInterval(MyMar);
    }
    this.obj1.onmouseout = function () {
        MyMar = setInterval(obj.Marquee, obj.tick);
    }
    //������������
    this.AddCells = function () {
        while (2 * obj.width > totalWidth) {

            var newCell = obj.obj3.parentNode.insertCell(-1);
            newCell.innerHTML = obj.obj2.innerHTML;
            totalWidth += obj.obj2.offsetWidth;
        }

    }
}
//-----------rotatingBoxPhotosAlbumJS.js------------------
//��ת���ӿؼ���JS����
//prefix ǰ׺
//width ������
//imgs ����ͼƬ���ӵ�����
//urls �����������ӵ�����
//titles ���Ƶ�����
//speed �ؼ����е��ٶ�
RotatingBox = function(prefix,width,imgs,urls,titles,speed) {
var speed = 20;
    //��Ҫ����ͼƬ��������
    var originalImg = document.getElementById(prefix+"_RotatingBox_1");
    var alternantlImg = document.getElementById(prefix+"_RotatingBox_2"); 
    var timer;
    var currentIndex = 0;
    //���Ʋ��Ų���
    var step = 3;
    if(speed < 1)
        step = 1;
    else if(speed > 10)
        step = 10;
    else
        step = speed;
    var obj = this;
    
    //����
    this.Play = function()
    {
        if(originalImg.clientWidth <= 0)
        {
            var nextIndex;
            currentIndex += 1;
            nextIndex = currentIndex + 1;
            if(currentIndex == imgs.length -1)
            {
                nextIndex = 0;
            }
            else if(currentIndex >= imgs.length)
            {
                currentIndex = 0;
                nextIndex = 1;
            }
            try {
            //�л�Ϊ��ǰ��ֵ
                originalImg.style.width = width;
                alternantlImg.style.width = 0;
                originalImg.title=titles[currentIndex];
                alternantlImg.title=titles[nextIndex];
                originalImg.childNodes[0].src=imgs[currentIndex];
                alternantlImg.childNodes[0].src=imgs[nextIndex];
            }catch(e){}
        }
        if(originalImg.clientWidth>0)
        {
            var finalStep = step;
            if(originalImg.clientWidth <= step || alternantlImg.clientWidth <= step)
                finalStep = 1;
            originalImg.style.width = originalImg.clientWidth - finalStep;
            alternantlImg.style.width = alternantlImg.clientWidth + finalStep;
        }
        clearTimeout(timer);
        timer=setTimeout(obj.Play,speed);
    }
    
    this.Stop = function() {
    //�رն�ʱ��
        clearTimeout(timer);
    }
    
    originalImg.onmouseout=obj.Play;
    alternantlImg.onmouseout=obj.Play;
    originalImg.onmouseover=obj.Stop;
    alternantlImg.onmouseover=obj.Stop;
}
//-----------rotatingPhotosAlbumJS.js------------------
RotatingImages = function(prefix,Car_Image_Sources,size)
{
	var Car_Image_Width=size; 
	var Car_Image_Height=size;
	var Car_Border=true;
	var Car_Border_Color="white";
	var Car_Speed=4;
	var Car_Direction=true;
	var Car_NoOfSides=12;	
	var obj = this;

	var CW_I=new Array(Car_NoOfSides/2+1);
	var C_ClcW=new Array(Car_NoOfSides/2);
	var C_Coef=new Array(3*Math.PI/2,0,3*Math.PI/2,11*Math.PI/6,Math.PI/6,3*Math.PI/2,7*Math.PI/4,0,Math.PI/4,3*Math.PI/2,5*Math.PI/3,11*Math.PI/6,0,Math.PI/6,Math.PI/3);
	var C_CoefOf=Car_NoOfSides==4?0:Car_NoOfSides==6?2:Car_NoOfSides==8?5:9;
	var C_Pre_Img=new Array(Car_Image_Sources.length);
	var C_Angle=Car_Direction?Math.PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW,C_Stppd=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSides/2;

	this.Play = function()
	{
		if(document.getElementById)
		{
			for(i=0;i<Car_Image_Sources.length;i+=2)
			{
				C_Pre_Img[i]=new Image();
				C_Pre_Img[i].src=Car_Image_Sources[i];
			}
			C_MaxW=Car_Image_Width/Math.sin(Math.PI/Car_NoOfSides)+C_HalfNo+1;
			Car_Div=document.getElementById(prefix+"_rotatingImgsDiv");
			for(i=0;i<C_HalfNo;i++)
			{
				CW_I[i]=document.createElement("img");
				Car_Div.appendChild(CW_I[i]);	
				CW_I[i].style.position="absolute";
				CW_I[i].style.top=0+"px";
				CW_I[i].style.height=Car_Image_Height+"px";
				if(Car_Border)
				{
					CW_I[i].style.borderStyle="solid";
					CW_I[i].style.borderWidth=1+"px";
					CW_I[i].style.borderColor=Car_Border_Color;
				}
				CW_I[i].src=Car_Image_Sources[2*i];
				CW_I[i].lnk=Car_Image_Sources[2*i+1];
				CW_I[i].onclick=obj.C_LdLnk;
				CW_I[i].onmouseover=obj.C_Stp;
				CW_I[i].onmouseout=obj.C_Rstrt;
			}
			obj.CarImages();
		}
	}

	this.CarImages = function()
	{
		if(!C_Stppd)
		{
			C_TotalW=0;
			for(i=0;i<C_HalfNo;i++)
			{
				C_ClcW[i]=Math.round(Math.cos(Math.abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width);
				C_TotalW+=C_ClcW[i];
			}
			C_LeftOffset=(C_MaxW-C_TotalW)/2;
			for(i=0;i<C_HalfNo;i++)
			{
				CW_I[i].style.left=C_LeftOffset+"px";
				CW_I[i].style.width=C_ClcW[i]+"px";
				C_LeftOffset+=C_ClcW[i];
			}
			C_Angle+=Car_Speed/720*Math.PI*(Car_Direction?-1:1);
			if((Car_Direction&&C_Angle<=0)||(!Car_Direction&&C_Angle>=Math.PI/C_HalfNo))
			{
			    if(C_CrImg==Car_Image_Sources.length)
			        C_CrImg=0;
				if(Car_Direction)
				{
					CW_I[C_HalfNo]=CW_I[0];
					for(i=0;i<C_HalfNo;i++)
					{
					    CW_I[i]=CW_I[i+1];
					}
					CW_I[C_HalfNo-1].src=Car_Image_Sources[C_CrImg];
					CW_I[C_HalfNo-1].lnk=Car_Image_Sources[C_CrImg+1];
				}
				else
				{	
				    for(i=C_HalfNo;i>0;i--)
				    {
				        CW_I[i]=CW_I[i-1];
				    }
					CW_I[0]=CW_I[C_HalfNo];
					CW_I[0].src=Car_Image_Sources[C_CrImg];
					CW_I[0].lnk=Car_Image_Sources[C_CrImg+1]
				}
				C_Angle=Car_Direction?Math.PI/C_HalfNo:0;
				C_CrImg+=2
			}
		}
		setTimeout(obj.CarImages,50);
	}

	this.C_LdLnk=function()
	{
	    if(this.lnk)
	    {
	        window.location.href=this.lnk;
        }
	}
	this.C_Stp=function()
	{
	    this.style.cursor=this.lnk?"pointer":"default";
	    C_Stppd=true;
	}
	this.C_Rstrt=function ()
	{
	    C_Stppd=false
	}
}
//-----------SliderObject.js------------------
SliderObject = new Object();
//本对象用来控制'实用标签'控件
//targetId 目标ID
//maxItems 最大数量
//itemsWidth 单元宽度
SliderObject=function(targetId,maxItems,itemsWidth)
{

    this.targetX=0; 
    this.targetY=0;
    this.targetId=targetId;
    this.currentTarget=0;
    this.targetSpeed=30;
    this.maxTarget=maxItems;
    this.slowSpeed=70; //移动速度最小值
    this.quickSpeed=170; //移动速度最大值
    this.timed="";
    this.itemsWidth=itemsWidth;
}
SliderObject.prototype.retrieveComputedStyle=function(element, styleProperty)
{
//获取CSS设置 
  var computedStyle = null;
  if (typeof element.currentStyle != "undefined")
  {
    computedStyle = element.currentStyle;
  }
  else
  {
    computedStyle = document.defaultView.getComputedStyle(element, null);
  }

  return computedStyle[styleProperty];
}
//移动当前标签
SliderObject.prototype.moveObject=function(target, destinationLeft, destinationTop, maxSpeed)
{

  var currentLeft = parseInt(this.retrieveComputedStyle(target, "left"));
  var currentTop = parseInt(this.retrieveComputedStyle(target, "top"));

  if (isNaN(currentLeft))
  {
    currentLeft = 0;
  }

  if (isNaN(currentTop))
  {
    currentTop = 0;
  }
//控制左右移动
  if (currentLeft < destinationLeft)
  {
    currentLeft += maxSpeed;

    if (currentLeft > destinationLeft)
    {
      currentLeft = destinationLeft;
    }
  }
  else
  {
    currentLeft -= maxSpeed;

    if (currentLeft < destinationLeft)
    {
      currentLeft = destinationLeft;
    }
  }
//控制上下移动
  if (currentTop < destinationTop)
  {
    currentTop += maxSpeed;

    if (currentTop > destinationTop)
    {
      currentTop = destinationTop;
    }
  }
  else
  {
    currentTop -= maxSpeed;
    if (currentTop < destinationTop)
    {
      currentTop = destinationTop;
    }
  }
  target.style.left = currentLeft + "px";
  target.style.top = currentTop + "px";
  var self = this;
//一旦条件达成,清空定时器
  if (currentLeft == destinationLeft && currentTop == destinationTop)
  {      
     if(typeof this.timed != undefined)
     {  
       clearTimeout(this.timed);
     }
  }
  else //启动新的定时器
  {
    //   var tempF=function(){self.moveIt();}
    
     var tempF=function(){self.moveObject(target, destinationLeft, destinationTop, maxSpeed);};
      this.timed =setTimeout(tempF,50);   
  }
  
  
}
SliderObject.prototype.moveIt=function()
{

    this.targetX =this.currentTarget *(-(this.itemsWidth));
    this.clearAllClickStyle();
        
    this.setClickStyle(document.getElementById(this.targetId+'_title_'+(this.currentTarget)));
    
    if(this.currentTarget==0)
    {
        //左边界
      this.endSideStyle(document.getElementById(this.targetId+"SiderLeft"));
      this.clearSideStyle(document.getElementById(this.targetId+"SiderRight"));
    }
    else if(this.currentTarget==this.maxTarget-1)
    {//右边界
       this.endSideStyle(document.getElementById(this.targetId+"SiderRight"));
       this.clearSideStyle(document.getElementById(this.targetId+"SiderLeft"));
    }
    else{       
         if(document.getElementById(this.targetId+"SiderLeft").className+""!=this.targetId+"SideOnMouseOver")
         {    
             this.clearSideStyle(document.getElementById(this.targetId+"SiderLeft"));               
         }   
          if(document.getElementById(this.targetId+"SiderRight").className+""!=this.targetId+"SideOnMouseOver")
         {  
             this.clearSideStyle(document.getElementById(this.targetId+"SiderRight"));  
         } 
    }

    this.moveObject(document.getElementById(this.targetId),this.targetX, this.targetY, this.targetSpeed);   
 
}
//移动到下一个
SliderObject.prototype.moveNext =function()
{

     this.targetSpeed=this.slowSpeed;
      if(this.currentTarget<this.maxTarget-1)
      {

        this.currentTarget++;
        this.moveIt();
      }
  }
//移动到前一个
SliderObject.prototype.movePre=function()
{
        this.targetSpeed=this.slowSpeed;
        if(this.currentTarget>0)
        {
            this.currentTarget--;
            this.moveIt();        
        }
    } 
//移动到首项
SliderObject.prototype.moveFirst=function()
{
      this.targetSpeed=this.quickSpeed;
      this.currentTarget=0;
      this.moveIt();      
}
SliderObject.prototype.moveLast=function()
{
      this.targetSpeed=this.quickSpeed;
      this.currentTarget=this.maxTarget-1;
      this.moveIt();    
}
//移动到某INDEX的位置
SliderObject.prototype.moveHere=function(index)
{      
      this.targetSpeed=this.quickSpeed;
      if((index>this.maxTarget-1)&&(index<0))
      {
        return;
      }
      if(((index)-this.currentTarget==1)||(this.currentTarget-(index)==1))
      {    
      //如果是相邻的项目，则速度减慢
        this.targetSpeed=this.slowSpeed;
      }
      this.currentTarget=index;
      this.moveIt();  
 }
 SliderObject.prototype.setClickStyle=function(target)
 {
 //
 var tid=this.targetId;
      if(target.className+""==tid+"TitleOnSelected")
    {    
       return;
    }
    target.className=this.targetId+"TitleOnSelected";

 }
 SliderObject.prototype.clearClickStyle=function(target)
 { 
 var tid=this.targetId;
      if(target.className+""==tid+"TitleNormal")
    {    
       return;
    }
    target.className=this.targetId+"TitleNormal";
}
 //鼠标移开后改变样式
 SliderObject.prototype.mouseOutChange=function(target)
 {
    var tid=this.targetId;
    
     if(target.className+""==tid+"TitleNormal")
    {    
       return;
    }
   
    if(target.className+""==tid+"TitleOnSelected")
    {    
       return;
    }
    
    
    target.className=this.targetId+"TitleNormal"; 
 }
 //鼠标覆盖时样式的变化
 SliderObject.prototype.mouseMoveChang=function(target)
 {
    var tid=this.targetId;
    if(target.className+""==tid+"TitleOnMouseOver")
    {    
       return;
    }
   
    if(target.className+""==tid+"TitleOnSelected")
    {    
       return;
    }
    target.className=this.targetId+"TitleOnMouseOver";
 }
 
 SliderObject.prototype.sideMoveChange=function(target)
 {
         var tid=this.targetId;

        if(target.className+""==tid+"SideEnd")
        {    
           return;
        }

 
    target.className=this.targetId+"SideOnMouseOver";
 }
 
 SliderObject.prototype.clearSideMoveStyle=function(target)
 {
     var tid=this.targetId;
     if(target.className+""==tid+"SideEnd")
     {    
        return;
     }
     this.clearSideStyle(target);
 
 }
 
 SliderObject.prototype.clearSideStyle=function(target)
 {
    var tid=this.targetId;
    if(target.className+""==tid+"SideNormal")
    {
       return;
    }
    
   if(((this.currentTarget==0)&&(target.id==this.TargetId+"SiderLeft"))||((this.currentTarget==this.maxTarget-1)&&(target.id==this.TargetId+"SiderRight")))
   {
   //防止最到末端时，被修改
        if(target.className+""==tid+"SideEnd")
        {    
           return;
        }
    }
    
    target.className=this.targetId+"SideNormal";
}
 //设置结尾处
 SliderObject.prototype.endSideStyle=function(target)
 {
    target.className=this.targetId+"SideEnd";
 }
 //这个方法负责现有图片的样式为普通状态
 SliderObject.prototype.clearAllClickStyle=function()
 {
   for(var i=0,j=this.maxTarget;i<j;i++)
   {
      this.clearClickStyle(document.getElementById(this.targetId+'_title_'+(i)));         
   }
}


//-----------sloshingImageADJS.js------------------
//prefix ǰ׺
//length ����
// speed �ٶ�
// imgwvidth ͼƬ���
//����ͼƬ��JS�ļ�
SloshingImage = function(prefix, length, speed, imgWidth)
{
    this.prefix = prefix;
    if(speed > 90)
        speed = 90;
    if(speed < 0)
        speed = 0;
    this.tick = 100 - speed;
    this.step = 0;
    this.img = document.images[this.prefix + '_SlosingImg']; 
    this.imgWidth = imgWidth;
    this.length = length;
    this.x_max = this.length - this.imgWidth;
    this.x = 0;
    var obj = this;  
    var timeId;
    clearTimeout(timeId); 
    
    this.Run = function ()
    {
        obj.img.style.marginLeft = obj.x;
        //����ͼƬ���򣬸����ܿ�Ƚ����л�
        if (obj.x >= obj.x_max / 2) 
        {
            obj.step--;
            if(obj.x < obj.x_max && obj.step == 0)
                obj.step = 1;
        }
        else  //��������趨�Ĳ���
        {
            obj.step++;
            if(obj.x > 0 && obj.step == 0)
                obj.step = -1;
        }
        obj.x += obj.step;
        if (obj.x >= obj.x_max) 
            obj.x = obj.x_max;
        if (obj.x <= 0) 
            obj.x = 0;
        timeId = setTimeout(obj.Run, obj.tick);
    }
}
//-----------SnakeTextEffect.js------------------
var SnakeTextEffect=new Object();
SnakeTextEffect=function(textArray,pathArray,fontSize,fontColor,identityId,maxLength)
{

    this.mes =textArray;
    this.maxtextlength=maxLength;
    this.path=pathArray;

    // 第二个信息间隔多久出现
    this.stoptime=5;

    // 字体的属性
    this.textfont="宋体";
    this.textsize=fontSize;
    this.textcolor=fontColor;

    // 字符的间距，如果你改变字体的大小也要改变这里
    this.letterspace=fontSize;

    this.tickerleft=this.path[this.path.length-2];
    this.tickertop=this.path[this.path.length-1];
    this.timer;
    this.finalxpos=this.tickerleft;
    this.i_mes=0;
    this.message="";
    this.i_path=0;
    this.stoptimemilli=this.stoptime*this.stoptime+1000;
    this.pathx= new Array();
    this.identityId=identityId;
    this.timer="";

    if (document.layers) {
    //other explorer
	    if (this.textsize>20) {this.textsize=6;}
	    else if (this.textsize>20) {this.textsize=5;}
	    else if (this.textsize>14) {this.textsize=4;} 
	    else if (this.textsize>10) {this.textsize=3;}
	    else if (this.textsize>8) {this.textsize=2;}
	    else if (this.textsize<=7) {this.textsize=1;}
    }
    
    this.ii=0;
    for (var i=0;i<=this.path.length-1;i=i+2) {
	    this.pathx[this.ii]=this.path[i];
	    this.ii++;
    }

    this.ii=0;

    this.pathy= new Array();
    for (var i=1;i<=this.path.length-1;i=i+2) {
	    this.pathy[this.ii]=this.path[i];
	    this.ii++;
    }
        
    this.xpos=new Array();
    for (i=0;i<=this.maxtextlength;i++) {
	    this.xpos[i]=5000;
    }

    this.ypos=new Array();
    for (i=0;i<=this.maxtextlength;i++) {
	    this.ypos[i]=5000;
    }

}
SnakeTextEffect.prototype.MakeSnake=function()
{
	if (this.i_path<=this.pathx.length-1) {
		for (i=this.message.length-1; i>=1; i--) {
   			this.xpos[i]=this.xpos[i-1];
			this.ypos[i]=this.ypos[i-1];
    	}
    	
		this.xpos[0]=this.pathx[this.i_path];
		this.ypos[0]=this.pathy[this.i_path];

        for(var i=0;i<this.message.length-1;i++)
        {
           if(document.getElementById(this.identityId+i)!=null)
           {
            var thisspan=document.getElementById(this.identityId+i).style;
                thisspan.posLeft=this.xpos[i];
				thisspan.posTop=this.ypos[i];
		   }
        }
		this.i_path++;
		var self=this;
        var tempF=function (){  self.MakeSnake(); };
		this.timer=setTimeout(tempF,20);
	}
	else {
		clearTimeout(this.timer);
		this.EndPosition();
	}
}

SnakeTextEffect.prototype.EndPosition=function()
{
         for(var i=0;i<this.message.length-1;i++)
         {
            if(document.getElementById(this.identityId+i)!=null)
           {
            var thisspan=document.getElementById(this.identityId+i).style;          
                thisspan.left=this.tickerleft+this.finalxpos;
                thisspan.top=this.tickertop;
                this.finalxpos=this.finalxpos+this.letterspace;     
            }
                                                  
         }
         var self=this;
         var tempF=function (){self.ClearMessage();};
	   	timer=setTimeout(tempF,this.stoptimemilli);
}

SnakeTextEffect.prototype.ClearMessage=function()
{
        this.finalxpos=this.tickertop;
		this.i_path=0;
		
		for (var i=0;i<this.maxtextlength;i++) {
			this.xpos[i]=5000;
		}
		
		for (i=0;i<this.maxtextlength;i++) {
		       
				var thisspan = document.getElementById(this.identityId+i)
				if(thisspan!=null)
				{
    			    thisspan.innerHTML=" ";
				    var thisspanStyle = thisspan.style;
    			    thisspanStyle.posLeft=this.xpos[i]=5000;
    			}
			}
		var self=this;
		var tempF=function (){self.ChangeMessage();};	
		timer=setTimeout(tempF,2000);
}
SnakeTextEffect.prototype.ChangeMessage=function()
{
        
        var messa=this.mes[this.i_mes];
	    this.message=messa.split("");
	    for(var i=0;i<this.message.length-1;i++)
	    {	    
	     if(document.getElementById(this.identityId+i)!=null)
           {
	      var thisspan=document.getElementById(this.identityId+i);
	          thisspan.innerHTML="<p>"+this.message[i]+"</p>";
	          }
	    }	    
	   this.i_mes++ ;
	   if (this.i_mes>=this.mes.length) {this.i_mes=0;}
	   this.finalxpos=this.tickertop;
	   this.i_path=0;
	   var self=this;
	   var tempF=function (){self.MakeSnake();};   
	  timer=setTimeout(tempF,10);
}
SnakeTextEffect.prototype.Start=function()
{
      
  for (var i=0;i<=this.maxtextlength;i++) {
    	document.write("<span id='"+(this.identityId+i)+"' class='spanstyle'>");
		document.write(this.message);
    	document.write("</span>");
	}
	
	this.ChangeMessage();

}

//-----------TransitColor.js------------------
function enHex(aDigit)
{
    return("0123456789ABCDEF".substring(aDigit, aDigit+1));
}
function deHex(aDigit)
{
    return("0123456789ABCDEF".indexOf(aDigit));
}

function toHex(n)
{
    return (enHex((0xf00000 & n) >> 20) +
            enHex((0x0f0000 & n) >> 16) +
            enHex((0x00f000 & n) >> 12) +
            enHex((0x000f00 & n) >>  8) +
            enHex((0x0000f0 & n) >>  4) +
            enHex((0x00000f & n) >>  0));
}
function toDecimal(hexNum)
{
   	var tmp = ""+hexNum.toUpperCase();
    while (tmp.length < 6) tmp = "0"+tmp
   	return ((deHex(tmp.substring(0,1)) << 20) +
       	    (deHex(tmp.substring(1,2)) << 16) + 
            (deHex(tmp.substring(2,3)) << 12) +
            (deHex(tmp.substring(3,4)) << 8) +
            (deHex(tmp.substring(4,5)) << 4) +
   	        (deHex(tmp.substring(5,6))));
}
function initArray(theArray, length, val)
	{
		for(i=0;i<length;i++)
		{
			theArray[i] = val;
		}       
	}
	
/* Main Class */
var TransitColorEffect=new Object();
TransitColorEffect=function(linkname,mouseOverColour, numberOfLinks, fadeOutColour)
{

   this.name="TransitColorEffect"; 
   this.linkname=linkname;
   this.rate = 1;
   this.numFadeLevels = 30; //The Color Fade number
   this.hoverColour = mouseOverColour;
   this.numLinks = numberOfLinks;
   this.bgR = '0000' + fadeOutColour.substring(1,3);
   this.bgG = '0000' + fadeOutColour.substring(3,5);
   this.bgB = '0000' + fadeOutColour.substring(5,7);
   this.currR = new Array(this.numLinks);
   this.currG = new Array(this.numLinks);
   this.currB = new Array(this.numLinks);
   this.count = new Array(this.numLinks);
   this.fadeOut = new Array(this.numLinks);
   this.continuous = new Array(this.numLinks);
   this.newColour = new Array(this.numLinks);
   this.tID = new Array(this.numLinks);
   this.redInterval = this.toDecimal(this.bgR) /this.numFadeLevels;
   this.greenInterval = this.toDecimal(this.bgG) / this.numFadeLevels;
   this.blueInterval = this.toDecimal(this.bgB) /this.numFadeLevels;
   this.initArray(this.currR,this.numLinks,0);
   this.initArray(this.currG,this.numLinks,0);
   this.initArray(this.currB,this.numLinks,0);
   this.initArray(this.count,this.numLinks,0);
   this.initArray(this.fadeOut,this.numLinks,true);
   this.initArray(this.continuous,this.numLinks,true);
   this.timeId="";
   
      
}
TransitColorEffect.prototype.enHex=enHex;
TransitColorEffect.prototype.deHex=deHex;
TransitColorEffect.prototype.toHex=toHex;
TransitColorEffect.prototype.toDecimal=toDecimal;
TransitColorEffect.prototype.initArray=initArray;

TransitColorEffect.prototype.startFade=function (id)
{

    var self = this;
	if(this.fadeOut[id] == true)
	{ /*by www.qpsh.com*/
	
		this.currR[id] += this.redInterval;
		this.currG[id] += this.greenInterval;
		this.currB[id] += this.blueInterval;
		this.newColour[id] = '#' + (this.toHex(this.currR[id])).substring(4,6) + (this.toHex(this.currG[id])).substring(4,6) + (this.toHex(this.currB[id])).substring(4,6);
		if(++this.count[id] == this.numFadeLevels)
		{
			this.fadeOut[id] = false;
		}
	}
	else
	{
		this.currR[id] -= this.redInterval;
		this.currG[id] -= this.greenInterval;
		this.currB[id] -= this.blueInterval;
		this.newColour[id] = '#' + (this.toHex(this.currR[id])).substring(4,6) + (this.toHex(this.currG[id])).substring(4,6) + (this.toHex(this.currB[id])).substring(4,6);

		if(--this.count[id] == 0)
		{
			this.fadeOut[id] = true;
		}
	}
	
	var linkid=this.linkname+id;	
	if(document.getElementById(linkid) == null)
	{
	   return;
	}
		
	if(linkid!=TranColorwhichCheck___)
	{   
		document.getElementById(linkid).style.color = this.newColour[id];		
	}
	else
	{
    	document.getElementById(linkid).style.color = this.hoverColour;
    	
	}  
	//alert(this.tID[id]); 
	//clearTimeout(this.tID[id]);	
	var tempF=function (){  self.startFade(id);  }; 
	if(this.tID[id]==null )
	{
       	
	}
	this.tID[id]=setTimeout(tempF,self.rate);
}

TransitColorEffect.prototype.Start=function()
{
    var self=this;
    if(this.timeId+""!="")
    {
       clearTimeout(this.timeId);
       for(var i=0,j=this.tID.length;i<j;i++)
       {
         clearTimeout(self.tID[i]);
       }
    //return;

    }
   var tempFa;
   for(var i=0;i<self.numLinks;i++)
   {       
  // clearTimeout(this.tID[i]);
   	 self.SetTimeStart(i,i*120);
   }
}
TransitColorEffect.prototype.SetTimeStart=function (index,rate)
{

    var self=this; 
  var tempF=function (){  self.startFade(index); };
  this.timeId= setTimeout(tempF,rate);
  
   //alert(this.timeId);
}
TransitColorEffect.prototype.ChangeState=function(mouseOverColour, numberOfLinks, fadeOutColour)
{

   // this.rate = 1;
  // this.numFadeLevels = 30; //The Color Fade number
//   for(var i=0;i<self.numLinks;i++)
//   {       
//     clearTimeout(this.tID[i]);
//   }
   this.hoverColour = mouseOverColour;
   this.numLinks = numberOfLinks;
   this.bgR = '0000' + fadeOutColour.substring(1,3);
   this.bgG = '0000' + fadeOutColour.substring(3,5);
   this.bgB = '0000' + fadeOutColour.substring(5,7);
   this.currR = new Array(this.numLinks);
   this.currG = new Array(this.numLinks);
   this.currB = new Array(this.numLinks);
   this.count = new Array(this.numLinks);
   this.fadeOut = new Array(this.numLinks);
   this.continuous = new Array(this.numLinks);
   this.newColour = new Array(this.numLinks);
   this.tID.length=this.numLinks;//修改时间ID数组容器的长度
//   this.tID = new Array(this.numLinks);
   this.redInterval = this.toDecimal(this.bgR) /this.numFadeLevels;
   this.greenInterval = this.toDecimal(this.bgG) / this.numFadeLevels;
   this.blueInterval = this.toDecimal(this.bgB) /this.numFadeLevels;
   this.initArray(this.currR,this.numLinks,0);
   this.initArray(this.currG,this.numLinks,0);
   this.initArray(this.currB,this.numLinks,0);
   this.initArray(this.count,this.numLinks,0);
   this.initArray(this.fadeOut,this.numLinks,true);
   this.initArray(this.continuous,this.numLinks,true);
   //this.timeId="";

}

TransitColorEffect.prototype.ClearTimeOut=function()
{

   for(var i=0,j=this.tID.length;i<j;i++)
   {

     if(this.tID[i]!=null)
     {
    
        clearTimeout(this.tID[i]);
     }
     else{
          alert(this.tID[i]);
     }
   
   }

}

    var TranColorwhichCheck___="";  // use it cnat find who it's under the mouse and set it color
    function stopFade(id)
    {
      TranColorwhichCheck___=id;
    }
    function continueFade(Trs,id)
    {
      TranColorwhichCheck___="";
    }
//-----------zoomImg.js------------------
var zoomImg = new Object();

zoomImg = function(prefix, picJson, showW, showH, sW, sH, bW, bH, zoomCoff, imgArr) {

    this.picbox = document.getElementById(prefix + 'picbox');
    this.view = document.getElementById(prefix + 'view');
    this.spic = document.getElementById(prefix + 'spic');
    this.picJson = picJson;
    this.imgArr = imgArr;


    this.sW = sW; //小图宽高
    this.sH = sH;
    this.bW = bW; //大图宽高
    this.bH = bH;
    this.zoomCoff = zoomCoff; //预览框与实际图片放大倍数比

    var pshow = document.createElement("div");
    pshow.style.cssText = "background-color:white;text-align:center;position:absolute;border:1px red solid;width:200;height:150;overflow:hidden;margin:0 auto;visibility:hidden;z-index:80000;";
    pshow.id = prefix + 'picshow2';
    var pimg = document.createElement("img");
    pimg.id = prefix + 'bpic2'
    pimg.src = this.picJson[0].bigPhotoSrc;
    pimg.style.cssText = "display:none";
    //pimg.onload=eval('z').ImgLoad;
    pshow.appendChild(pimg);

    //alert(document.body.firstChild);
    document.body.insertBefore(pshow, document.body.firstChild);

    this.picshow = document.getElementById(prefix + 'picshow2'); //大预览图div
    this.bpic = document.getElementById(prefix + 'bpic2'); //大图
    this.loading = document.getElementById(prefix + 'loading');


    this.dshowW = 450; //默认预览图宽度(可由小图的showW,showH动态指定)
    this.dshowH = 300; //默认预览图高度
    this.bborder = 1; //大图边框
    this.sborder = 1; //小图边框
    this.vborder = 1; //小预览图边框
    this.prefix = prefix;
    this.showW = showW;
    this.showH = showH;
    this.nflag = '';
    this.picstatus = null;
    this.tempo = null;
    this.abox = null;

    this.sload = false;
    this.bload = false;

    this.currentIndex = 0;
    this.pageSize = 4;
    this.pageIndex = 0;

    var sAgent = navigator.userAgent.toLowerCase();
    this.isIE = (sAgent.indexOf("msie") != -1) ? 1 : 0;

    this.bpic.style.display = "block";
    this.nview = this.view;

    this.spic.onload = new Function(this.SLoaded());
    this.bpic.onload = new Function(this.BLoaded());

    this.bpicMarginTop = 0;

    this.ChangeIndex(0);
}
zoomImg.prototype.SLoaded = function() {
    this.sload = true;
    this.ImgLoad();
}
zoomImg.prototype.BLoaded = function() {
    this.bload = true;
    this.ImgLoad();
}

zoomImg.prototype.loadpic = function(o) {
    // var view=getview(o);
    // var img=getimg(o);
    this.bpic.style.display = "none";
    this.nview = this.view; //标记活动小预览窗
    this.picstatus = "loading";
}

zoomImg.prototype.ChangeIndex = function(index) {
    if ((index > -1) && (index < this.picJson.length)) {

        if (this.picJson.length < 2) {
            return;  //避免单一内容时,无法切换内容
        }

        this.sload = false;
        this.bload = false;
        // this.bpic.style.display="none";
        document.getElementById(this.prefix + 'sitem' + this.currentIndex).style.border = "1px solid gray";
        this.currentIndex = index;
        this.spic.src = this.picJson[this.currentIndex + this.pageIndex].smallPhotoSrc;
        this.bpic.src = this.picJson[this.currentIndex + this.pageIndex].bigPhotoSrc;
        document.getElementById(this.prefix + 'sitem' + this.currentIndex).style.border = "2px solid gray";
        this.ImgLoad();


    }

}
zoomImg.prototype.ImgLoad = function() {

    //alert(this.spic.width);
    var self = this;
    if ((this.bpic.width == 0) || (this.spic.width == 0)) {
        //setTimeout(new Function(self.ImgLoad()), 300);
        //return;
    }

    //    if ((Img.height == 0) || (Img.width == 0)) {
    //        //延迟
    //        setTimeout(new Function(self.ImageLoad(Img)), 210);
    //        return;
    //    }
    //   this.smallW=this.spic.width;
    //   this.smallH=this.spic.height;
    //   this.bigW=this.bpic.width;
    //   this.bigH=this.bpic.height;
    //   var sImage=new Image();
    //   sImage.src=this.spic.src;
    var bImage = new Image();
    bImage.src = this.bpic.src;

    //   alert("old: "+this.smallH+"  "+this.bigH);
    //   alert("new width: "+sImage.width+"  "+bImage.width);
    //   this.smallW=sImage.width;
    //   this.smallH=sImage.height;
    //   this.bigW=bImage.width;
    //   this.bigH=bImage.height;   
    //     alert(bImage.height);

    this.smallW = this.sW;
    this.smallH = this.sH;
    //this.bigW = (bImage.width == 0) ? this.bW : bImage.width;
    //this.bigH = (bImage.height == 0) ? this.bH : bImage.height;
    this.bigW = this.bW;
    this.bigH = this.bH;

    //   alert("old: "+this.smallH+"  "+this.smallH;
    //   alert("new: "+sImage.width+"  "+sImage.height);


    if (this.showW > this.bigW) {//如果预览图比大图大,则等于大图
        this.showW = this.bigW;
        this.picshow.style.width = this.showW + this.isIE * this.bborder * 2;
    }
    if (this.showH > this.bigH) {
        this.showH = this.bigH;
        this.picshow.style.height = this.showH + this.isIE * this.bborder * 2;
    }
    this.zoomX = this.bigW / this.smallW;
    this.zoomY = this.bigH / this.smallH;

    this.viewW = this.showW * this.smallW / this.bigW;
    this.viewH = this.showH * this.smallH / this.bigH;
    this.nview.style.width = this.viewW - this.vborder * 2 * !this.isIE;
    this.nview.style.height = this.viewH - this.vborder * 2 * !this.isIE;
    this.nview.style.display = "block";
    // alert(this.sH);
    // alert(this.view.offsetHeight);
    //alert(this.zoomCoff);
    this.spic.style.top = -this.view.offsetHeight;
    // alert(this.spic.style.top);
    if (this.spic.style.top == '0px') {
        this.spic.style.top = -(this.showH / this.zoomCoff) + 'px';
        //  alert(this.showH / this.zoomCoff);
    }
    if (!this.view.style.left) this.view.style.left = 0;
    if (!this.view.style.top) this.view.style.top = 0;
    this.picstatus = "done";

    this.picshow.style.width = this.showW + this.isIE * this.bborder * 2;
    this.picshow.style.height = this.showH + this.isIE * this.bborder * 2;




    //alert( this.nview.style.width+" "+this.nview.style.height);

}


zoomImg.prototype.move = function(e, o, flag) {
    if ((this.sload == false) || (this.bload == false)) {
        //有图没有读取出来
    }

    this.nview.style.visibility = 'visible';
    this.picshow.style.visibility = 'visible';

    var vX;
    var vY;
    o = this.isIE ? o.parentElement : o.parentNode;

    var pleft = parseInt(this.getLeft(this.spic)) + parseInt(this.spic.width);
    var ptop = this.getTop(this.spic);



    this.picshow.style.left = pleft + 'px';
    this.picshow.style.top = ptop + 'px';

    if (picstatus = "done") { //如果大图载入完毕 
        if (this.nview.style.visibility = "hidden") this.nview.style.visibility = "visible";
        var e = this.isIE ? window.event : e;

        if (!this.isIE) { //分别获取FF或IE的view位置
            if (flag == 1) { //由于o的来源不同,使用不同的算法定位
                vX = e.layerX + parseInt(this.nview.style.left) - this.nview.offsetWidth / 2 - this.vborder;
                vY = e.layerY + parseInt(this.nview.style.top) - this.nview.offsetHeight / 2 - this.vborder;
            } else {
                vX = 1 - this.nview.offsetWidth / 2 - this.vborder;
                vY = 1 - this.nview.offsetHeight / 2 - this.vborder;
            }
        }
        else {
            vX = e.offsetX - this.nview.offsetWidth / 2;
            vY = e.offsetY - this.nview.offsetHeight / 2;
        }

        if (vX < 0) vX = 0; //边界判断,不能超出缩略图的范围
        if (vY < 0) vY = 0;
        if (vX > this.smallW - this.viewW) { vX = this.smallW - this.viewW; mX = this.bigW - this.showW } else { mX = vX * this.zoomX; }
        if (vY > this.smallH - this.viewH)
        { vY = this.smallH - this.viewH; mY = this.bigH - this.showH }
        else { mY = vY * this.zoomY; }

        this.nview.style.left = vX;
        this.nview.style.top = vY;

        this.bpic.style.marginLeft = -mX; //刷新预览窗口
        this.bpic.style.marginTop = -mY;



        //debugger;
    }

}
zoomImg.prototype.outPicBox = function() {
    this.nview.style.visibility = 'hidden';
    this.picshow.style.visibility = 'hidden';
}


zoomImg.prototype.getTop = function(e) {
    var self = this;
    var offset = e.offsetTop;
    if (e.offsetParent != null) offset += self.getTop(e.offsetParent);
    return offset;
}

zoomImg.prototype.getLeft = function(e) {
    var self = this;
    var offset = e.offsetLeft;
    if (e.offsetParent != null) offset += self.getLeft(e.offsetParent);
    return offset;
}
zoomImg.prototype.GoUrl = function(e) {
    //查看大图 4000
    if (this.picJson[this.currentIndex + this.pageIndex].realPhotoSrc + '' != '')
        window.open(this.picJson[this.currentIndex + this.pageIndex].realPhotoSrc);
}

zoomImg.prototype.PageUp = function() {
    if (this.pageIndex > 0) {
        this.pageIndex--;
        this.SetPageImg(this.pageIndex);

    }

}

zoomImg.prototype.PageDown = function() {

    if ((this.pageIndex + this.pageSize) < this.picJson.length) {
        this.pageIndex++;
        this.SetPageImg(this.pageIndex);
    }
}
zoomImg.prototype.SetPageImg = function(startIndex) {
    //更改底部小图片
    var strName = '';
    var tmpIndex = 0;
    for (var i = 0; i < this.pageSize; i++) {
        strName = this.prefix + 'simg' + i;
        tmpIndex = startIndex + i;
        document.getElementById(strName).src = this.picJson[tmpIndex].itemPhotoSrc;
    }

    if (this.pageIndex == 0) {
        this.ChangArrowPic('left', true);
    }
    else {
        this.ChangArrowPic('left', false);
    }

    if ((this.pageIndex + this.pageSize) == this.picJson.length) {
        this.ChangArrowPic('right', true);
    }
    else {
        this.ChangArrowPic('right', false);
    }

}

zoomImg.prototype.ChangArrowPic = function(direction, isEnd) {
    //根据参数，更改箭头图片 
    var picName = this.prefix + direction + 'Img';
    var arrowUrl = '';

    if (direction == 'left') {
        arrowUrl = (isEnd == true) ? this.imgArr[0] : this.imgArr[2];
    }
    else {
        arrowUrl = (isEnd == true) ? this.imgArr[1] : this.imgArr[3];
    }
    document.getElementById(picName).src = arrowUrl;

}



//-----------zoomImgAspect.js------------------
var zoomImgAspect = new Object();

zoomImgAspect = function(prefix, picJson, showW, showH, sW, sH, bW, bH, zoomCoff, imgArr, xmlDoc) {


    //  alert('1');

    this.picbox = document.getElementById(prefix + 'picbox');
    this.view = document.getElementById(prefix + 'view');
    this.spic = document.getElementById(prefix + 'spic');
    this.picJson = picJson;
    this.imgArr = imgArr;
    this.picshow = document.getElementById(prefix + 'picshow2'); //大预览图div
    this.bpic = document.getElementById(prefix + 'bpic2'); //大图
    this.loading = document.getElementById(prefix + 'loading');
    this.xmlDoc = xmlDoc;
    this.delaycount = 0;

    this.sW = sW; //小图宽高
    this.sH = sH;

    this.bW = bW; //大图宽高
    this.bH = bH;
    this.zoomCoff = zoomCoff; //预览框与实际图片放大倍数比

    //    var pshow = document.createElement("div");
    //    pshow.style.cssText = "background-color:white;text-align:center;position:absolute;border:1px red solid;width:200;height:150;overflow:hidden;margin:0 auto;visibility:hidden;z-index:80000;";
    //    pshow.id = prefix + 'picshow2';
    //    var pimg = document.createElement("img");
    //    pimg.id = prefix + 'bpic2'
    //    pimg.src = this.picJson[0].bigPhotoSrc;
    //    pimg.style.cssText = "display:none";
    //    //pimg.onload=eval('z').ImgLoad;
    //    pshow.appendChild(pimg);

    //alert(document.body.firstChild);
    //  document.body.insertBefore(pshow, document.body.firstChild);

    this.dshowW = 450; //默认预览图宽度(可由小图的showW,showH动态指定)
    this.dshowH = 300; //默认预览图高度
    this.bborder = 1; //大图边框
    this.sborder = 1; //小图边框
    this.vborder = 1; //小预览图边框
    this.prefix = prefix;
    this.showW = showW;
    this.showH = showH;
    this.nflag = '';
    this.picstatus = null;
    this.tempo = null;
    this.abox = null;

    this.sload = false;
    this.bload = false;

    this.currentIndex = 0;
    this.pageSize = 4;
    this.pageIndex = 0;

    var sAgent = navigator.userAgent.toLowerCase();
    this.isIE = (sAgent.indexOf("msie") != -1) ? 1 : 0;

    this.bpic.style.display = "block";
    this.nview = this.view;

    //  this.spic.onload = new Function(this.SLoaded());
    //  this.bpic.onload = new Function(this.BLoaded());

    this.bpicMarginTop = 0;

    //  setTimeout(new Function(this.ChangeIndex(0)), 3000);
}
zoomImgAspect.prototype.SLoaded = function() {
    this.sload = true;
    // this.ImgLoad();
}
zoomImgAspect.prototype.BLoaded = function(img) {
    //  alert(img.width);
    this.bload = true;
    this.ImgLoad();
}

zoomImgAspect.prototype.loadpic = function(o) {
    // var view=getview(o);
    // var img=getimg(o);
    this.bpic.style.display = "none";
    this.nview = this.view; //标记活动小预览窗
    this.picstatus = "loading";
}

zoomImgAspect.prototype.ChangeIndex = function(index) {
    if ((index > -1) && (index < this.picJson.length)) {

        if (this.picJson.length < 2) {
            return;  //避免单一内容时,无法切换内容
        }

        this.sload = false;
        this.bload = false;
        // this.bpic.style.display="none";
        // document.getElementById(this.prefix + 'sitem' + this.currentIndex).style.border = "1px solid gray";
        document.getElementById(this.prefix + 'sitem' + this.currentIndex).style.color = 'Gray';
        this.currentIndex = index;
        this.spic.src = this.picJson[this.currentIndex + this.pageIndex].smallPhotoSrc;
        this.bpic.src = this.picJson[this.currentIndex + this.pageIndex].bigPhotoSrc;
        document.getElementById(this.prefix + 'sitem' + this.currentIndex).style.color = '#000000';
        // document.getElementById(this.prefix + 'sitem' + this.currentIndex).style.border = "2px solid gray";
        //   this.ImgLoad();


    }

}
zoomImgAspect.prototype.ImgLoad = function() {

    //alert(this.spic.width);
    var self = this;

    //   this.smallW=this.spic.width;
    //   this.smallH=this.spic.height;
    //   this.bigW=this.bpic.width;
    //   this.bigH=this.bpic.height;
    var sImage = new Image();
    sImage.src = this.spic.src;
    var bImage = new Image();
    bImage.src = this.bpic.src;



    //   alert("old: "+this.smallH+"  "+this.bigH);
    //   alert("new width: "+sImage.width+"  "+bImage.width);

    //   this.bigW=bImage.width;
    //   this.bigH=bImage.height;   
    //     alert(bImage.height);

    // this.smallW = this.sW;
    // this.smallH = this.sH;
    this.smallW = (sImage.width == 0) ? this.sW : sImage.width;
    this.smallH = (sImage.height == 0) ? this.sH : sImage.height;

    this.bigW = (bImage.width == 0) ? this.bW : bImage.width;
    this.bigH = (bImage.height == 0) ? this.bH : bImage.height;


    // this.bigW = this.bW;
    // this.bigH = this.bH;

    //   alert("old: "+this.smallH+"  "+this.smallH;
    //   alert("new: "+sImage.width+"  "+sImage.height);


    if (this.showW > this.bigW) {//如果预览图比大图大,则等于大图
        this.showW = this.bigW;
        this.picshow.style.width = this.showW + this.isIE * this.bborder * 2;
    }
    if (this.showH > this.bigH) {
        this.showH = this.bigH;
        this.picshow.style.height = this.showH + this.isIE * this.bborder * 2;
    }
    this.zoomX = this.bigW / this.smallW;
    this.zoomY = this.bigH / this.smallH;

    this.viewW = parseInt(this.showW * this.smallW / this.bigW);
    this.viewH = parseInt(this.showH * this.smallH / this.bigH);
    //alert("w " + this.bpic.width + " h: " + this.bpic.height);
    // alert("bw " + this.bigW + " h: " + this.bigH);
    // alert("vw " + this.viewW + " h: " + this.viewH);


    this.nview.style.width = this.viewW - this.vborder * 2 * !this.isIE;
    this.nview.style.height = this.viewH - this.vborder * 2 * !this.isIE;
    this.nview.style.display = "block";
    // alert(this.sH);
    // alert(this.view.offsetHeight);
    //alert(this.zoomCoff);
    this.spic.style.top = -this.view.offsetHeight;
    // alert(this.spic.style.top);
    if (this.spic.style.top == '0px') {
        this.spic.style.top = -(this.showH / (this.bigH / this.smallH)) + 'px';
        //  alert(this.showH / this.zoomCoff);
    }
    if (!this.view.style.left) this.view.style.left = 0;
    if (!this.view.style.top) this.view.style.top = 0;
    this.picstatus = "done";

    this.picshow.style.width = this.showW + this.isIE * this.bborder * 2;
    this.picshow.style.height = this.showH + this.isIE * this.bborder * 2;

    //alert( this.nview.style.width+" "+this.nview.style.height);

}


zoomImgAspect.prototype.move = function(e, o, flag) {
    if ((this.sload == false) || (this.bload == false)) {
        //有图没有读取出来
    }

    this.nview.style.visibility = 'visible';
    this.picshow.style.visibility = 'visible';

    var vX;
    var vY;
    o = this.isIE ? o.parentElement : o.parentNode;

    var pleft = parseInt(this.getLeft(this.spic)) + parseInt(this.spic.width);
    var ptop = this.getTop(this.spic);



    //  this.picshow.style.left = pleft + 'px';
    // this.picshow.style.top = ptop + 'px';

    if (picstatus = "done") { //如果大图载入完毕 
        if (this.nview.style.visibility = "hidden") this.nview.style.visibility = "visible";
        var e = this.isIE ? window.event : e;

        if (!this.isIE) { //分别获取FF或IE的view位置
            if (flag == 1) { //由于o的来源不同,使用不同的算法定位
                vX = e.layerX + parseInt(this.nview.style.left) - this.nview.offsetWidth / 2 - this.vborder;
                vY = e.layerY + parseInt(this.nview.style.top) - this.nview.offsetHeight / 2 - this.vborder;
            } else {
                vX = 1 - this.nview.offsetWidth / 2 - this.vborder;
                vY = 1 - this.nview.offsetHeight / 2 - this.vborder;
            }
        }
        else {
            vX = e.offsetX - this.nview.offsetWidth / 2;
            vY = e.offsetY - this.nview.offsetHeight / 2;
        }

        if (vX < 0) vX = 0; //边界判断,不能超出缩略图的范围
        if (vY < 0) vY = 0;
        if (vX > this.smallW - this.viewW) { vX = this.smallW - this.viewW; mX = this.bigW - this.showW } else { mX = vX * this.zoomX; }
        if (vY > this.smallH - this.viewH)
        { vY = this.smallH - this.viewH; mY = this.bigH - this.showH }
        else { mY = vY * this.zoomY; }

        this.nview.style.left = vX - 60;
        this.nview.style.top = vY;

        this.bpic.style.marginLeft = -mX; //刷新预览窗口
        this.bpic.style.marginTop = -mY;

        //debugger;
    }

}
zoomImgAspect.prototype.outPicBox = function() {
    this.nview.style.visibility = 'hidden';
    //  this.picshow.style.visibility = 'hidden';
}


zoomImgAspect.prototype.getTop = function(e) {
    var self = this;
    var offset = e.offsetTop;
    if (e.offsetParent != null) offset += self.getTop(e.offsetParent);
    return offset;
}

zoomImgAspect.prototype.getLeft = function(e) {
    var self = this;
    var offset = e.offsetLeft;
    if (e.offsetParent != null) offset += self.getLeft(e.offsetParent);
    return offset;
}
zoomImgAspect.prototype.GoUrl = function(e) {
    //查看大图 4000
    if (this.picJson[this.currentIndex + this.pageIndex].realPhotoSrc + '' != '')
        window.open(this.picJson[this.currentIndex + this.pageIndex].realPhotoSrc);
}

zoomImgAspect.prototype.PageUp = function() {
    if (this.pageIndex > 0) {
        this.pageIndex--;
        this.SetPageImg(this.pageIndex);

    }

}

zoomImgAspect.prototype.PageDown = function() {

    if ((this.pageIndex + this.pageSize) < this.picJson.length) {
        this.pageIndex++;
        this.SetPageImg(this.pageIndex);
    }
}
zoomImgAspect.prototype.SetPageImg = function(startIndex) {
    //更改底部小图片
    var strName = '';
    var tmpIndex = 0;
    for (var i = 0; i < this.pageSize; i++) {
        strName = this.prefix + 'simg' + i;
        tmpIndex = startIndex + i;
        document.getElementById(strName).src = this.picJson[tmpIndex].itemPhotoSrc;
    }

    if (this.pageIndex == 0) {
        this.ChangArrowPic('left', true);
    }
    else {
        this.ChangArrowPic('left', false);
    }

    if ((this.pageIndex + this.pageSize) == this.picJson.length) {
        this.ChangArrowPic('right', true);
    }
    else {
        this.ChangArrowPic('right', false);
    }

}

zoomImgAspect.prototype.ChangArrowPic = function(direction, isEnd) {
    //根据参数，更改箭头图片 
    var picName = this.prefix + direction + 'Img';
    var arrowUrl = '';

    if (direction == 'left') {
        arrowUrl = (isEnd == true) ? this.imgArr[0] : this.imgArr[2];
    }
    else {
        arrowUrl = (isEnd == true) ? this.imgArr[1] : this.imgArr[3];
    }
    document.getElementById(picName).src = arrowUrl;

}

//zoomImgAspect.prototype.ChangeXmlStr = function() {
//    //在此处通过遍历JSON,然后给ID重新赋值的方法实现,保存XML

//    if (typeof this.xmlDoc != 'undefined') {

//        var root = this.xmlDoc.documentElement;

//        var matchStr = "pages/page";

//        var tempXml = root.selectNodes(matchStr);
//        for (var i = 0; i < tempXml.length; i++) {
//            alert(tempXml[i].getAttribute("id"));
//        }

//        var hfXml = document.getElementById(this.prefix + 'hv');

//        if (typeof hfXml != 'undefined') {
//           
//            //将保存后的XML数值保存到HIDDEN FIELD
//            hfXml.value = this.xmlDoc.xml;
//            var url = "/plugin/mynetsite/zoomSaveSession.aspx";
//            var param ="?skye="+this.xmlDoc.xml;
//            var rText = httpRequest(url + param);
//          

//        }
//    }

//}


zoomImgAspect.prototype.ChangeXmlStr = function() {
    //在此处通过遍历JSON,然后给ID重新赋值的方法实现,保存XML 
    var ret1 = ShowModalDialogInFrame("/plugin/mynetsite/ChangePage.aspx");
    if (ret1 == null) {
        return;
    }

    if (typeof this.xmlDoc != 'undefined') {
        var root = this.xmlDoc.documentElement;
        var ret = ret1.split("|")[0];

        var picJssonItem = this.picJson[this.currentIndex + this.pageIndex];
        var pageId = picJssonItem.Id;

        picJssonItem.smallPhotoSrc = picJssonItem.smallPhotoSrc.replace(picJssonItem.DocId, ret);
        picJssonItem.bigPhotoSrc = picJssonItem.bigPhotoSrc.replace(picJssonItem.DocId, ret);
        picJssonItem.DocId = ret;

        var matchStr = "pages/page[@id='" + pageId + "']";
        if (root != null) {
            var tempXml = root.selectNodes(matchStr);
            var node = tempXml[0];
            node.setAttribute("pageid", ret);       

        var hfXml = document.getElementById(this.prefix + 'hv');
        if (typeof hfXml != 'undefined') {
            //将保存后的XML数值保存到HIDDEN FIELD 
            hfXml.value = this.xmlDoc.xml;
            //            var url = "/plugin/mynetsite/zoomSaveSession.aspx";
            //            var param = "?skye=" + this.xmlDoc.xml;
            //            var rText = httpRequest(url + param);

        }
    }

        this.ChangeIndex(this.currentIndex + this.pageIndex);

    }
}

//获取成品页面的XML 
function Mynet_GetNewCPWXML() {
    var nextPrefix = "zOut_hv"; //last part of hidden field id
    var hiddenInputs = document.getElementsByTagName("input");
    var len = hiddenInputs.length;
    var retXml = "";
    for (var i = 0; i < len; i++) {
        var oneInput = hiddenInputs[i];
        if (oneInput.type == 'hidden' && oneInput.id.indexOf(nextPrefix) == oneInput.id.length - nextPrefix.length) {
            retXml = oneInput.value;
            break;
        }
    }

    return retXml;
}




