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(o){var b=[],g=[],h,q="--------",d=15,l=0,j=0;q+=q;var a=(arguments.length>1)?arguments[1]:N;if(a&&!isRegex(a)){a=new RegExp(a)}for(h in o){if(a&&!a.test(h)){continue}try{if(isFunc(o[h])){g.push(h)}else{b.push("."+h+" = "+o[h])}}catch(k){b.push("."+h+" = *EXCEPTION* ")}}if(a){j="matching /"+a.source+"/ "}for(h=0;(h+d)<b.length;h+=d){if(!confirm(q+"[ Properties "+j+(h+1)+" to "+(h+d)+" of "+b.length+" ]"+q+"\n"+b.slice(h,h+d).join("\n")+"\n...")){throw ("NG.dump cancelled")}}if(!confirm(q+"[ Properties "+j+(h+1)+" to "+(b.length)+" of "+b.length+" ]"+q+"\n"+b.slice(h,h+d).join("\n")+"\n"+q+"[ Methods "+j+"]"+q+"\n"+g.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(a,c){var f=arguments.length-2,g=f-c,b=this.length+g;var e=this.slice(a,a+c);if(g<=0){for(i=a;i-a<f;i++){this[i]=arguments[i-a+2]}if(g<0){for(i++;i<=b;i++){this[i+g]=this[i]}}}else{for(i=b-1;i>=a+f;i--){this[i]=this[i-g]}for(i=0;i<f;i++){this[a+i]=arguments[i+2]}}this.length=b;return e}}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(a){if(isNaN(this)||!isFinite(this)||Math.abs(this)>1e+21){return this.toString()}if(!isIntVal(a)||a==0){return(((this<0)?-1:1)*Math.round(Math.abs(this))).toString()}if(a<0||a>20){return NaN}var e=(this<0?"-":"");var b=Math.abs(this),c=Math.floor(b),f=String(Math.round((b-c)*Math.pow(10,a)));f="0".repeat(a-f.length+1)+f;f=f.insert(".",f.length-a);c+=parseInt(f);f=f.substr(f.indexOf(".")+1);return e+c+"."+f}}if(!isFunc(Number.prototype.toPrecision)){Number.prototype.toPrecision=function(c){if(isNaN(this)||!isFinite(this)||!isIntVal(c)){return this.toString()}var b=this==0?1:Math.floor(Math.log(Math.abs(this))/Math.LN10);var a=Math.round(Math.abs(this)).toString().length;if(b<=-7||a>c){return this.toExponential(c-1)}else{return this.toFixed(Math.max(0,-b)+c-(Math.floor(Math.abs(this)).toString().length))}}}if(!isFunc(Number.prototype.toExponential)){Number.prototype.toExponential=function(a){if(isNaN(this)||!isFinite(this)){return this.toString()}var b=this==0?1:Math.floor(Math.log(Math.abs(this))/Math.LN10);var c=(b<=0)?(this*Math.pow(10,Math.min(-b,150))*Math.pow(10,Math.max(0,-b-150))):(this/Math.pow(10,Math.min(b,150))/Math.pow(10,Math.max(0,b-150)));return(isIntVal(a)?c.toFixed(a):c.toString())+"e"+(b>=0?"+":"")+((this==0)?"0":b)}}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(c){var b=new c.constructor();for(var a in c){b[a]=c[a]}return b};String.prototype.repeat=function(c){var b="";for(var a=0;a<c;a++){b+=this}return b};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 c="";for(var b,a=0;a<this.length;a++){b=this.charCodeAt(a).toString(16).toUpperCase();c+=(b.length==1?"0":"")+b}return c};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(d,c){if(arguments.length==1){c=null}if(c&&d!=c){var e=new NG.point(0-d.scrollLeft,0-d.scrollTop)}else{var e=new NG.point(d.offsetLeft-d.scrollLeft,d.offsetTop-d.scrollTop);c=null}var b,a;if(d.parentNode&&d.parentNode.nodeType==1){a=NG.getPagePos(d.parentNode,(c?c:d.offsetParent));e.x+=a.x;e.y+=a.y}else{if(d.tagName=="BODY"&&isDef(typeof d.leftMargin)&&NG.ua.is("MACIE")){e.x+=parseInt((b=d.currentStyle.marginLeft.match(/([0-9]+)px/))?b[1]:d.leftMargin);e.y+=parseInt((b=d.currentStyle.marginTop.match(/([0-9]+)px/))?b[1]:d.topMargin)}}if(NG.ua.isEng("MSIE","6.0","=")&&d.currentStyle.styleFloat!="none"){e.y-=d.offsetTop}return e};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(b,a,d){if(!isDef(typeof b.onmouseout)||isNull(b.onmouseout)){b.altSrc=a;b.origSrc=b.src;if(d){NG.imgPreload(b.altSrc)}b.onmouseout=function c(){this.src=this.origSrc}}b.src=b.altSrc};NG.attachRollovers=function(a){if(arguments.length==0){a=true}var b,c,e=document.getElementsByTagName("IMG");function d(){NG.rollover(this,this.getAttribute("altsrc"))}for(b=0;b<e.length;b++){c=e[b].getAttribute("altsrc");if(isStr(c)&&c!=""){if(a){NG.imgPreload(c)}e[b].onmouseover=d}}};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(e,c,d){if(!isArr(e)){e=String(e).split(".")}if(!isArr(d)){d=String(d).split(".")}e.map(parseInt);d.map(parseInt);var a=Math.min(e.length,d.length);for(var b=0;b<a;b++){switch(c){case">":case">=":if(e[b]>d[b]){return T}if(e[b]<d[b]){return F}break;case"==":case"=":if(e[b]!=d[b]){return F}break;case"<":case"<=":if(e[b]>d[b]){return F}if(e[b]<d[b]){return T}break;case"!=":if(e[b]!=d[b]){return T}break}}switch(c){case">=":if(e.length==d.length){return T}case">":return(e.length>d.length);case"=":case"==":return(e.length==d.length);case"<=":if(e.length==d.length){return T}case"<":return(e.length<d.length);case"!=":return(e.length!=d.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(f,h,g,e,d){var b=arguments,c=NG.ua.get();if(b.length<5){d="="}if(b.length>0&&!isNull(f)&&c.OS!=f){return F}if(b.length>1&&!isNull(h)&&c.OSRel!=h){return F}if(b.length>2&&!isNull(g)&&!NG.ua.cmp(c.osVer,d,g)){return F}if(b.length>3&&!isNull(e)&&c.Arch!=e){return F}return T};NG.ua.is=function(e,c,d,b,a){return(NG.ua.isEng(e,c,a)&&NG.ua.isApp(d,b,a))};NG.ua.hasPlugin=function(b,a){};NG.popup=function(){NG.popup.open.apply(NG.popup,arguments);return false};NG.popup.open=function(c){if(!isDef(typeof c)){c="/blank.php"}if(!isStr(c)){c=c.href}if(!isObj(__G.popup)){__G.popup=new Object()}var j=arguments,h="",f,m,b,l=(j.length>1&&isObj(j[j.length-1])?NG.cloneObj(j[j.length-1]):new Object());if(j.length>=2&&isInt(j[1])){l.width=j[1]}if(j.length>=3&&isInt(j[2])){l.height=j[2]}m={width:600,height:400,toolbars:"no",scrollbars:"yes",resizable:"yes"};for(f in m){if(!isDef(typeof l[f])){l[f]=m[f]}}if(isDef(typeof l.position)){switch(l.position){case"windowcentre":case"windowcenter":l.left=Math.max(0,Math.round((screen.width/2)-(l.width/2)));l.top=Math.max(0,Math.round((screen.height/2)-(l.height/2)));break}delete l.position}if(isDef(typeof l.modal)&&!NG.popup.isClosed(__G.popup["modalWindow"])){return null}if(isDef(typeof l.modal)){l.dependant=N}if(isDef(typeof l.name)){b=l.name;delete l.name}else{b=c.replace(/[^a-zA-Z0-9_]/g,"")}if(isDef(typeof l.arg)){if(!isObj(__G.popup["args"])){__G.popup["args"]=new Object()}__G.popup["args"][b]=l.arg;delete l.arg}for(f in l){if(isStr(l[f])||isInt(l[f])){h+=(h==""?"":",")+f+"="+l[f]}else{if(isNull(l[f])){h+=(h==""?"":",")+f}}}f=window.open(c,b,h);try{f.focus()}catch(k){return null}if(isDef(typeof l.modal)){__G.popup["modalWindow"]=f;NG.popup.focusModal.install(window.top)}if(isDef(typeof l.dependant)&&(l.dependant===true||l.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(c,a,b){if((a=="mousewheel")&&(NG.ua.isEng("GECKO"))){return NG.addEventListener(c,"DOMMouseScroll",b)}else{if(isFunc(c.addEventListener)&&(a!="dblclick"||!NG.ua.is("KHTML"))){return c.addEventListener(a,b,F)}else{if(isFunc(c.attachEvent)){return c.attachEvent("on"+a,NG._msieE._addReg(c,a,b))}else{if(!isObj(c.NGEventListener)){c.NGEventListener=new Object()}if(!isArr(c.NGEventListener[a])){c.NGEventListener[a]=new Array()}c.NGEventListener[a][c.NGEventListener[a].length]=b;c["on"+a]=function(h){if(!h){h=window.event}for(var d=0;d<this.NGEventListener[a].length;d++){var g=this.NGEventListener[a][d];g.call(this,h)}}}}}};NG._msieE={};NG._msieE._reg=[];NG._msieE._addReg=function(c,a,b){var d=function(f){if(!f){f=window.event}b.apply(c,[f])};NG._msieE._reg.push({nf:c,eventName:a,origFunc:b,newFunc:d});return d};NG._msieE._delReg=function(g,a,d){var c=NG._msieE._reg;for(var b=c.length-1;b>=0;b--){try{if(c[b].eventName==a&&c[b].nf==g&&c[b].origFunc==d){var h=c[b].newFunc;delete c[b];c.splice(b,1);return h}}catch(j){}}return function(){}};NG.removeEventListener=function(d,a,c){if(isFunc(d.removeEventListener)&&(a!="dblclick"||!NG.ua.is("KHTML"))){return d.removeEventListener(a,c,F)}else{if(isFunc(d.detachEvent)){return d.detachEvent("on"+a,NG._msieE._delReg(d,a,c))}else{if(isObj(d.NGEventListener)&&isArr(d.NGEventListener[a])){for(var b=0;b<d.NGEventListener[a].length;b++){if(d.NGEventListener[a][b]==c){delete d.NGEventListener[a][b];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){}};