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