var __G=new Object();var N=null,T=true,F=false;function NG(){}NG.rev="$Id: ngcore.js 5331 2007-06-12 23:08:16Z michael $";function isFunc(a){if(typeof a=="function"){return T}if(!isObj(a)){return F}if(String(a.constructor)==String(Function)){return T}try{return(String(a).search(/^\s*function [a-zA-Z]+\(\) \{\s+\[native code\]\s+\}\s*$/)!=-1)}catch(b){}return F}function isDef(a){return a!="undefined"}function isObj(a){return typeof a=="object"&&!isNull(a)}function isArr(a){return isObj(a)&&String(a.constructor)==String(Array)}function isStr(a){return typeof a=="string"}function isNum(a){return typeof a=="number"}function isInt(a){return typeof a=="number"&&Math.floor(a)==a}function isA(a,b){return isObj(a)&&a.constructor==b}function isIntVal(a){return isInt(a)||(isStr(a)&&a.search(/^[\-\+]?[0-9]+$/)!=-1)}function isRegex(a){return(a&&isFunc(a.test))||(isObj(a)&&a.constructor==RegExp)}function isNull(a){return a===N}function isId(a){return isIntVal(a)&&a>=1}function ifnull(){var b=arguments;for(var c=0;c<b.length;c++){if(b[c]!==N){return b[c]}}return N}function ifnot(){var b=arguments;for(var c=0;c<b.length;c++){if(b[c]){return b[c]}}return N}NG.dump=function(d){var j=[],l=[],o,g="--------",k=15,b=0,q=0;g+=g;var h=(arguments.length>1)?arguments[1]:N;if(h&&!isRegex(h)){h=new RegExp(h)}for(o in d){if(h&&!h.test(o)){continue}try{if(isFunc(d[o])){l.push(o)}else{j.push("."+o+" = "+d[o])}}catch(a){j.push("."+o+" = *EXCEPTION* ")}}if(h){q="matching /"+h.source+"/ "}for(o=0;(o+k)<j.length;o+=k){if(!confirm(g+"[ Properties "+q+(o+1)+" to "+(o+k)+" of "+j.length+" ]"+g+"\n"+j.slice(o,o+k).join("\n")+"\n...")){throw ("NG.dump cancelled")}}if(!confirm(g+"[ Properties "+q+(o+1)+" to "+(j.length)+" of "+j.length+" ]"+g+"\n"+j.slice(o,o+k).join("\n")+"\n"+g+"[ Methods "+q+"]"+g+"\n"+l.join(", "))){throw ("NG.dump cancelled")}};if(Math.pow(2,2)==0){Math.pow=function(c,g){if(g==0){return 1}var f=Math.floor(Math.abs(g));var a=Math.abs(g)-f;var e=1;for(var d=0;d<f;d++){e*=c}if(a!=0&&c!=1){e*=Math.exp(Math.log(c)*a)}if(g<0){e=1/e}return e}}if(!isFunc(Array.prototype.splice)){Array.prototype.splice=function(c,f){var a=arguments.length-2,b=a-f,e=this.length+b;var g=this.slice(c,c+f);if(b<=0){for(i=c;i-c<a;i++){this[i]=arguments[i-c+2]}if(b<0){for(i++;i<=e;i++){this[i+b]=this[i]}}}else{for(i=e-1;i>=c+a;i--){this[i]=this[i-b]}for(i=0;i<a;i++){this[c+i]=arguments[i+2]}}this.length=e;return g}}if(!isFunc(Array.prototype.pop)){Array.prototype.pop=function(){return(this.splice(this.length-1,1))[0]}}if(!isFunc(Array.prototype.push)){Array.prototype.push=function(){this.splice(this.length,0,arguments);return this.length}}if(!isFunc(Array.prototype.shift)){Array.prototype.shift=function(){return(this.splice(0,1))[0]}}if(!isFunc(Array.prototype.unshift)){Array.prototype.unshift=function(){this.splice(0,0,arguments);return this.length}}if(!isFunc(Array.prototype.search)){if(isFunc(Array.prototype.indexOf)){Array.prototype.search=Array.prototype.indexOf}else{Array.prototype.search=function(b){for(var a=0;a<this.length;a++){if(this[a]===b){return a}}return -1}}}if(!isFunc(Number.prototype.toFixed)){Number.prototype.toFixed=function(c){if(isNaN(this)||!isFinite(this)||Math.abs(this)>1e+21){return this.toString()}if(!isIntVal(c)||c==0){return(((this<0)?-1:1)*Math.round(Math.abs(this))).toString()}if(c<0||c>20){return NaN}var a=(this<0?"-":"");var e=Math.abs(this),f=Math.floor(e),b=String(Math.round((e-f)*Math.pow(10,c)));b="0".repeat(c-b.length+1)+b;b=b.insert(".",b.length-c);f+=parseInt(b);b=b.substr(b.indexOf(".")+1);return a+f+"."+b}}if(!isFunc(Number.prototype.toPrecision)){Number.prototype.toPrecision=function(b){if(isNaN(this)||!isFinite(this)||!isIntVal(b)){return this.toString()}var a=this==0?1:Math.floor(Math.log(Math.abs(this))/Math.LN10);var c=Math.round(Math.abs(this)).toString().length;if(a<=-7||c>b){return this.toExponential(b-1)}else{return this.toFixed(Math.max(0,-a)+b-(Math.floor(Math.abs(this)).toString().length))}}}if(!isFunc(Number.prototype.toExponential)){Number.prototype.toExponential=function(c){if(isNaN(this)||!isFinite(this)){return this.toString()}var a=this==0?1:Math.floor(Math.log(Math.abs(this))/Math.LN10);var b=(a<=0)?(this*Math.pow(10,Math.min(-a,150))*Math.pow(10,Math.max(0,-a-150))):(this/Math.pow(10,Math.min(a,150))/Math.pow(10,Math.max(0,a-150)));return(isIntVal(c)?b.toFixed(c):b.toString())+"e"+(a>=0?"+":"")+((this==0)?"0":a)}}if(!isFunc(Function.prototype.apply)){Function.prototype.apply=function(o,a){var r,n="__NGapply";o[n]=this;switch(a.length){case 0:r=o[n]();break;case 1:r=o[n](a[0]);break;case 2:r=o[n](a[0],a[1]);break;case 3:r=o[n](a[0],a[1],a[2]);break;case 4:r=o[n](a[0],a[1],a[2],a[3]);break;default:var e="r=o[n](a[0]";for(var i=0;i<a.length;i++){e+=",a["+i+"]"}eval(e+");")}delete o[n];return r}}if(!isFunc(Function.prototype.call)){Function.prototype.call=function(a){return this.apply(a,arguments.slice(1))}}Array.prototype.unset=function(a){if(isInt(a)&&a>=0&&a<this.length){this.splice(a,1)}};Array.prototype.map=function(b){for(var a=0;a<this.length;a++){this[a]=b(this[a])}};NG.cloneObj=function(b){var a=new b.constructor();for(var c in b){a[c]=b[c]}return a};String.prototype.repeat=function(b){var a="";for(var c=0;c<b;c++){a+=this}return a};String.prototype.normalize_nl=function(a){var b=this.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return(a!="\n"?b.replace(/\n/g,a):b)};String.prototype.nl2unix=function(){return this.normalize_nl("\n")};String.prototype.nl2dos=function(){return this.normalize_nl("\r\n")};String.prototype.nl2mac=function(){return this.normalize_nl("\r")};String.prototype.span=function(b){for(var a=0;a<this.length&&b.indexOf(this.charAt(a))!=-1;a++){}return a};String.prototype.insert=function(a,b){return this.substr(0,b)+a+this.substr(b)};String.prototype.rev=function(){var b="";for(var a=this.length-1;a>=0;a--){b+=this.charAt(a)}return b};String.prototype.toHex=function(){var b="";for(var a,c=0;c<this.length;c++){a=this.charCodeAt(c).toString(16).toUpperCase();b+=(a.length==1?"0":"")+a}return b};String.prototype.fromHex=function(){var b="";for(var a=0;a<this.length;a+=2){b+=String.fromCharCode(parseInt(this.substr(a,2),16))}return b};Number.prototype.ordinal=function(a){if(!isDef(typeof a)){a=T}var b=Math.abs(this);return(a?this:"")+["th","st","nd","rd","th"][Math.min(b%100-b%10==10?0:b%10,4)]};NG.round=function(a,b){if(arguments.length<2){b=0}return new Number(a).toFixed(b)};NG.point=function(a,b){this.x=parseInt(a);this.y=parseInt(b)};NG.getPagePos=function(a,e){if(arguments.length==1){e=null}if(e&&a!=e){var b=new NG.point(0-a.scrollLeft,0-a.scrollTop)}else{var b=new NG.point(a.offsetLeft-a.scrollLeft,a.offsetTop-a.scrollTop);e=null}var d,c;if(a.parentNode&&a.parentNode.nodeType==1){c=NG.getPagePos(a.parentNode,(e?e:a.offsetParent));b.x+=c.x;b.y+=c.y}else{if(a.tagName=="BODY"&&isDef(typeof a.leftMargin)&&NG.ua.is("MACIE")){b.x+=parseInt((d=a.currentStyle.marginLeft.match(/([0-9]+)px/))?d[1]:a.leftMargin);b.y+=parseInt((d=a.currentStyle.marginTop.match(/([0-9]+)px/))?d[1]:a.topMargin)}}if(NG.ua.isEng("MSIE","6.0","=")&&a.currentStyle.styleFloat!="none"){b.y-=a.offsetTop}return b};NG.include=function(a,b){if(!isObj(__G.includes)){__G.includes=new Object()}if(!b&&isDef(typeof __G.includes[a])){return F}__G.includes[a]=T;document.writeln('<script type="text/javascript" language="Javascript1.2" src="'+a+'"><\/script>');return T};NG.imgPreload=function(a){new Image().src=a};NG.rollover=function(d,c,b){if(!isDef(typeof d.onmouseout)||isNull(d.onmouseout)){d.altSrc=c;d.origSrc=d.src;if(b){NG.imgPreload(d.altSrc)}d.onmouseout=function a(){this.src=this.origSrc}}d.src=d.altSrc};NG.attachRollovers=function(c){if(arguments.length==0){c=true}var d,e,b=document.getElementsByTagName("IMG");function a(){NG.rollover(this,this.getAttribute("altsrc"))}for(d=0;d<b.length;d++){e=b[d].getAttribute("altsrc");if(isStr(e)&&e!=""){if(c){NG.imgPreload(e)}b[d].onmouseover=a}}};function userAgent(){this.App=N;this.AppVer=[];this.Engine=N;this.EngineVer=[];this.OS=N;this.OSRel=N;this.OSVer=[];this.Arch=N;var d=navigator;var c=d.userAgent.indexOf("(");var b=d.userAgent.substr(c,d.userAgent.length-c);c=d.userAgent.substr(0,c);if((r=b.match(/ Opera ([.0-9]+)/))||(r=c.match(/^Opera\/([0-9.]+) /))){this.App="Opera";this.AppVer=r[1].split(".");this.Engine="OPERA";this.EngineVer=r[1].split(".")}else{if(b.indexOf("(KHTML, like Gecko)")!=-1||(r=b.match(/ KHTML\/([\.0-9]+) \(like Gecko\)/))){this.Engine="KHTML";this.EngineVer=r?r[1].split("."):N;if((r=b.match(/ Konqueror\/([\.0-9]+); /))){this.App="Konqueror";this.AppVer=r[1].split(".")}else{if((r=b.match(/ Safari\/([\.0-9]+)( |$)/))){this.App="Safari";this.AppVer=r[1].split(".");if(isNull(this.EngineVer)){this.EngineVer=this.AppVer}}}}else{if(d.product&&d.product=="Gecko"){this.Engine="GECKO";this.EngineVer=d.productSub;if(r=b.match(/ Netscape\/([6-9](\.[0-9]+)?)( |$)/)){this.App="Netscape";this.AppVer=r[1].split(".")}else{if((r=b.match(/ (SeaMonkey|Firefox|Camino|Netscape6)\/([0-9]+(\.([0-9]|b|rc|a|p)+)*)( |$)/))){this.App=r[1].replace(/6$/,"");this.AppVer=r[2].split(".")}else{if((r=b.match(/[;\(] rv:([\.0-9]+)[ \)]/))){this.App="Mozilla";this.AppVer=r[1].split(".")}else{if(d.vendor&&d.vendor.length>0){this.App=d.vendor;this.AppVer=d.vendorSub.split(".")}}}}}else{if((r=b.match(/[;\(] ?MSIE ([\.0-9]+)[;\)]/))){if(b.search("Mac")!=-1){this.Engine="MACIE"}else{this.Engine="MSIE"}this.EngineVer=r[1].split(".");if(r=b.match(/ Netscape\/([6-9](\.[0-9]+)?)( |$)/)){this.App="Netscape";this.AppVer=r[1].split(".")}else{this.App=d.appName;this.AppVer=this.EngineVer}}else{if((r=d.userAgent.match(/^Mozilla\/([\.0-9]+)/))&&r[1]<5){this.Engine="NS4";this.EngineVer=r[1];this.App="Netscape";this.AppVer=r[1]}}}}}c=d.platform?d.platform:N;if(c&&c.search(/^Linux.*/)!=-1){this.OS="Unix";this.OSRel="Linux";if(c.search(/^Linux i[0-9]86/)!=-1||b.search(/Linux i[0-9]86;/)!=-1){this.Arch="x86"}}else{if(c=="Win32"){this.OS="Win";if(d.oscpu&&(r=d.oscpu.match(/^Win(dows)? ?(95|98|NT)?( ?[0-9]+\.[0-9]+)?/))){this.OSRel=r[2];this.OSVer=r[3]?r[3].split("."):""}else{if((r=d.appVersion.match(/(\(|; ?)Win(dows)? ?(95|98|NT)?( ?[0-9]+\.[0-9]+)?/))){this.OSRel=r[3];this.OSVer=r[4]?r[4].split("."):""}}this.Arch=d.cpuClass?d.cpuClass:"x86"}else{if(c&&(r=c.match(/^Mac(PPC|Intel)$/))){this.OS="MacOS";this.Arch=(r[1]=="Intel"?"x86":"PPC");if(c.search(/ Mac OS X /)){this.OSRel="X";this.OSVer=[10]}}else{if(c&&(r=c.match(/^(SunOS) (.*)/))){this.OS=r[1];this.Arch=r[2]}}}}}NG.ua=function(){};NG.ua.get=function(){if(!isObj(__G.userAgent)){__G.userAgent=new userAgent()}return __G.userAgent};NG.ua.cmp=function(b,e,a){if(!isArr(b)){b=String(b).split(".")}if(!isArr(a)){a=String(a).split(".")}b.map(parseInt);a.map(parseInt);var c=Math.min(b.length,a.length);for(var d=0;d<c;d++){switch(e){case">":case">=":if(b[d]>a[d]){return T}if(b[d]<a[d]){return F}break;case"==":case"=":if(b[d]!=a[d]){return F}break;case"<":case"<=":if(b[d]>a[d]){return F}if(b[d]<a[d]){return T}break;case"!=":if(b[d]!=a[d]){return T}break}}switch(e){case">=":if(b.length==a.length){return T}case">":return(b.length>a.length);case"=":case"==":return(b.length==a.length);case"<=":if(b.length==a.length){return T}case"<":return(b.length<a.length);case"!=":return(b.length!=a.length)}};NG.ua.isCmp=function(b,a){return isRegex(b)?b.test(a):a==b};NG.ua.isEng=function(f,e,d){var b=arguments,c=NG.ua.get();if(b.length<3){d="="}if(b.length>0&&!isNull(f)&&c.Engine!=f){return F}if(b.length>1&&!isNull(e)&&!NG.ua.cmp(c.EngineVer,d,e)){return F}return T};NG.ua.isApp=function(f,e,d){var b=arguments,c=NG.ua.get();if(b.length<3){d="="}if(b.length>0&&!isNull(f)&&!NG.ua.isCmp(f,c.App)){return F}if(b.length>1&&!isNull(e)&&!NG.ua.cmp(c.AppVer,d,e)){return F}return T};NG.ua.isOS=function(h,d,f,b,e){var c=arguments,g=NG.ua.get();if(c.length<5){e="="}if(c.length>0&&!isNull(h)&&g.OS!=h){return F}if(c.length>1&&!isNull(d)&&g.OSRel!=d){return F}if(c.length>2&&!isNull(f)&&!NG.ua.cmp(g.osVer,e,f)){return F}if(c.length>3&&!isNull(b)&&g.Arch!=b){return F}return T};NG.ua.is=function(b,e,a,d,c){return(NG.ua.isEng(b,e,c)&&NG.ua.isApp(a,d,c))};NG.ua.hasPlugin=function(b,a){};NG.popup=function(){NG.popup.open.apply(NG.popup,arguments);return false};NG.popup.open=function(j){if(!isDef(typeof j)){j="/blank.php"}if(!isStr(j)){j=j.href}if(!isObj(__G.popup)){__G.popup=new Object()}var l=arguments,m="",f,k,b,h=(l.length>1&&isObj(l[l.length-1])?NG.cloneObj(l[l.length-1]):new Object());if(l.length>=2&&isInt(l[1])){h.width=l[1]}if(l.length>=3&&isInt(l[2])){h.height=l[2]}k={width:600,height:400,toolbars:"no",scrollbars:"yes",resizable:"yes"};for(f in k){if(!isDef(typeof h[f])){h[f]=k[f]}}if(isDef(typeof h.position)){switch(h.position){case"windowcentre":case"windowcenter":h.left=Math.max(0,Math.round((screen.width/2)-(h.width/2)));h.top=Math.max(0,Math.round((screen.height/2)-(h.height/2)));break}delete h.position}if(isDef(typeof h.modal)&&!NG.popup.isClosed(__G.popup.modalWindow)){return null}if(isDef(typeof h.modal)){h.dependant=N}if(isDef(typeof h.name)){b=h.name;delete h.name}else{b=j.replace(/[^a-zA-Z0-9_]/g,"")}if(isDef(typeof h.arg)){if(!isObj(__G.popup.args)){__G.popup.args=new Object()}__G.popup.args[b]=h.arg;delete h.arg}for(f in h){if(isStr(h[f])||isInt(h[f])){m+=(m==""?"":",")+f+"="+h[f]}else{if(isNull(h[f])){m+=(m==""?"":",")+f}}}f=window.open(j,b,m);try{f.focus()}catch(c){return null}if(isDef(typeof h.modal)){__G.popup.modalWindow=f;NG.popup.focusModal.install(window.top)}if(isDef(typeof h.dependant)&&(h.dependant===true||h.dependant==="yes")){if(!isObj(__G.popup.dependantWindows)){__G.popup.dependantWindows=new Object()}__G.popup.dependantWindows[b]=f;NG.addEventListener(window,"unload",NG.popup.closeDependant)}return f};NG.unpopup=function(a){if(NG.popup.hasOpener()){if(arguments.length==0||a){window.opener.location.reload()}window.opener.focus()}window.close()};NG.popup.isClosed=function(a){return(!isObj(a)||a.closed)};NG.popup.hasOpener=function(){return !NG.popup.isClosed(window.opener)};NG.popup.getArg=function(){var a=window.opener;if(isObj(a.__G)&&isObj(a.__G.popup)&&isObj(a.__G.popup.args)&&isDef(typeof a.__G.popup.args[window.name])){return a.__G.popup.args[window.name]}return N};NG.popup.focusModal=function(a){if(isObj(__G.popup)&&!NG.popup.isClosed(__G.popup.modalWindow)){__G.popup.modalWindow.focus();NG.stopPropagation(a);return false}else{NG.popup.focusModal.uninstall(window.top)}};NG.popup.focusModal.install=function(b){NG.addEventListener(b,"focus",NG.popup.focusModal);for(var a=0;a<b.frames.length;a++){NG.popup.focusModal.install(b.frames[a])}};NG.popup.focusModal.uninstall=function(b){NG.removeEventListener(b,"focus",NG.popup.focusModal);for(var a=0;a<b.frames.length;a++){NG.popup.focusModal.uninstall(b.frames[a])}};NG.popup.closeDependant=function(){if(!isObj(__G.popup)||!isObj(__G.popup.dependantWindows)){return}var b=__G.popup.dependantWindows;for(var a in b){if(!NG.popup.isClosed(b[a])){b[a].close()}}};NG.heightToContent=function(){window.resizeBy(0,document.body.clientHeight-document.documentElement.clientHeight)};NG.addEventListener=function(b,c,a){if((c=="mousewheel")&&(NG.ua.isEng("GECKO"))){return NG.addEventListener(b,"DOMMouseScroll",a)}else{if(isFunc(b.addEventListener)&&(c!="dblclick"||!NG.ua.is("KHTML"))){return b.addEventListener(c,a,F)}else{if(isFunc(b.attachEvent)){return b.attachEvent("on"+c,NG._msieE._addReg(b,c,a))}else{if(!isObj(b.NGEventListener)){b.NGEventListener=new Object()}if(!isArr(b.NGEventListener[c])){b.NGEventListener[c]=new Array()}b.NGEventListener[c][b.NGEventListener[c].length]=a;b["on"+c]=function(d){if(!d){d=window.event}for(var e=0;e<this.NGEventListener[c].length;e++){var f=this.NGEventListener[c][e];f.call(this,d)}}}}}};NG._msieE={};NG._msieE._reg=[];NG._msieE._addReg=function(a,c,d){var b=function(e){if(!e){e=window.event}d.apply(a,[e])};NG._msieE._reg.push({nf:a,eventName:c,origFunc:d,newFunc:b});return b};NG._msieE._delReg=function(a,d,j){var h=NG._msieE._reg;for(var g=h.length-1;g>=0;g--){try{if(h[g].eventName==d&&h[g].nf==a&&h[g].origFunc==j){var b=h[g].newFunc;delete h[g];h.splice(g,1);return b}}catch(c){}}return function(){}};NG.removeEventListener=function(b,c,a){if(isFunc(b.removeEventListener)&&(c!="dblclick"||!NG.ua.is("KHTML"))){return b.removeEventListener(c,a,F)}else{if(isFunc(b.detachEvent)){return b.detachEvent("on"+c,NG._msieE._delReg(b,c,a))}else{if(isObj(b.NGEventListener)&&isArr(b.NGEventListener[c])){for(var d=0;d<b.NGEventListener[c].length;d++){if(b.NGEventListener[c][d]==a){delete b.NGEventListener[c][d];return}}}}}};NG.stopPropagation=function(a){if(!isObj(a)&&isObj(window.event)){a=window.event}if(isObj(a)){if(isDef(typeof a.stopPropagation)&&isFunc(a.stopPropagation)){a.stopPropagation()}else{if(isDef(typeof a.cancelBubble)){a.cancelBubble=T}else{if(isDef(typeof a.originalEvent)&&isObj(a.originalEvent)){NG.stopPropagation(a.originalEvent)}}}}};NG.preventDefault=function(a){if(!isObj(a)&&isObj(window.event)){a=window.event}if(isObj(a)){if(isDef(typeof a.preventDefault)&&isFunc(a.preventDefault)){a.preventDefault()}else{if("returnValue" in a){a.returnValue=F}else{if(isDef(typeof a.originalEvent)&&isObj(a.originalEvent)){return NG.preventDefault(a.originalEvent)}}}}return false};NG.applyCallable=function(func,args){if(arguments.length<2){args=[]}else{if(!isArr(args)){args=[args]}}if(isFunc(func)){return func.apply(window,args)}else{if(isStr(func)){return eval(func)}else{if(isArr(func)&&func.length==2&&isObj(func[0])&&isStr(func[1])&&isFunc(func[0][func[1]])){return func[0][func[1]].apply(func[0],args)}}}};NG.hitch=function(a,b){return function(){b.apply(a,arguments)}};if(NG.ua.isEng("MSIE")){try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}};
