if(typeof Jemplate=="undefined"){Jemplate=function(){this.init.apply(this,arguments)}}if(!Jemplate.templateMap){Jemplate.templateMap={}}Jemplate.process=function(){var A=new Jemplate();return A.process.apply(A,arguments)};proto=Jemplate.prototype;proto.init=function(A){this.config=A||{AUTO_RESET:true,BLOCKS:{},CONTEXT:null,DEBUG_UNDEF:false,DEFAULT:null,ERROR:null,EVAL_JAVASCRIPT:false,FILTERS:{},INCLUDE_PATH:[""],INTERPOLATE:false,OUTPUT:null,PLUGINS:{},POST_PROCESS:[],PRE_PROCESS:[],PROCESS:null,RECURSION:false,STASH:null,TOLERANT:null,VARIABLES:{},WRAPPER:[]}};proto.process=function(B,F,D){var C=this.config.CONTEXT||new Jemplate.Context();C.config=this.config;C.stash=this.config.STASH||new Jemplate.Stash();C.stash.__config__=this.config;C.__filter__=new Jemplate.Filter();C.__filter__.config=this.config;var E;var A=function(G){try{E=C.process(B,G)}catch(I){if(!String(I).match(/Jemplate\.STOP\n/)){throw (I)}E=I.toString().replace(/Jemplate\.STOP\n/,"")}if(typeof D=="undefined"){return E}if(typeof D=="function"){D(E);return }if(typeof (D)=="string"||D instanceof String){if(D.match(/^#[\w\-]+$/)){var J=D.replace(/^#/,"");var H=document.getElementById(J);if(typeof H=="undefined"){throw ('No element found with id="'+J+'"')}H.innerHTML=E;return }}else{D.innerHTML=E;return }throw ("Invalid arguments in call to Jemplate.process");return 1};if(typeof F=="function"){F=F()}else{if(typeof F=="string"){Ajax.get(F,function(G){A(JSON.parse(G))});return }}return A(F)};if(typeof Jemplate.Context=="undefined"){Jemplate.Context=function(){}}proto=Jemplate.Context.prototype;proto.include=function(A,B){return this.process(A,B,true)};proto.process=function(A,B,E){if(E){this.stash.clone(B)}else{this.stash.update(B)}var D=Jemplate.templateMap[A];if(typeof D=="undefined"){throw ('No Jemplate template named "'+A+'" available')}var C=D(this);if(E){this.stash.declone()}return C};proto.set_error=function(A,B){this._error=[A,B];return A};proto.filter=function(C,B,A){if(B=="null"){B="null_filter"}if(typeof this.__filter__.filters[B]=="function"){return this.__filter__.filters[B](C,A,this)}else{throw"Unknown filter name ':"+B+"'"}};if(typeof Jemplate.Filter=="undefined"){Jemplate.Filter=function(){}}proto=Jemplate.Filter.prototype;proto.filters={};proto.filters.null_filter=function(A){return""};proto.filters.upper=function(A){return A.toUpperCase()};proto.filters.lower=function(A){return A.toLowerCase()};proto.filters.ucfirst=function(C){var B=C.charAt(0);var A=C.substr(1);return B.toUpperCase()+A};proto.filters.lcfirst=function(C){var B=C.charAt(0);var A=C.substr(1);return B.toLowerCase()+A};proto.filters.trim=function(A){return A.replace(/^\s+/g,"").replace(/\s+$/g,"")};proto.filters.collapse=function(A){return A.replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/," ")};proto.filters.html=function(A){A=A.replace(/&/g,"&amp;");A=A.replace(/</g,"&lt;");A=A.replace(/>/g,"&gt;");A=A.replace(/"/g,"&quot;");return A};proto.filters.html_para=function(B){var A=B.split(/(?:\r?\n){2,}/);return"<p>\n"+A.join("\n</p>\n\n<p>\n")+"</p>\n"};proto.filters.html_break=function(A){return A.replace(/(\r?\n){2,}/g,"$1<br />$1<br />$1")};proto.filters.html_line_break=function(A){return A.replace(/(\r?\n)/g,"$1<br />$1")};proto.filters.uri=function(A){return encodeURI(A)};proto.filters.indent=function(F,A){var D=A[0];if(!F){return }if(typeof D=="undefined"){D=4}var E="";if(typeof D=="number"||String(D).match(/^\d$/)){for(var B=0;B<D;B++){E+=" "}}else{E=D}var C=F.replace(/^/gm,E);return C};proto.filters.truncate=function(D,B){var A=B[0];if(!D){return }if(!A){A=32}if(D.length<A){return D}var C=A-3;return D.substr(0,C)+"..."};proto.filters.repeat=function(D,A){if(!D){return }if(!A||A==0){A=1}if(A==1){return D}var C=D;for(var B=1;B<A;B++){C+=D}return C};proto.filters.replace=function(E,B){if(!E){return }var A=B[0];var D=B[1];if(!A){A=""}if(!D){D=""}var C=new RegExp(A,"g");return E.replace(C,D)};if(typeof Jemplate.Stash=="undefined"){Jemplate.Stash=function(){this.data={}}}proto=Jemplate.Stash.prototype;proto.clone=function(A){var B=this.data;this.data={};this.update(B);this.update(A);this.data._PARENT=B};proto.declone=function(A){this.data=this.data._PARENT||this.data};proto.update=function(A){if(typeof A=="undefined"){return }for(var B in A){var C=A[B];this.set(B,C)}};proto.get=function(D){var A=this.data;if(D instanceof Array){for(var C=0;C<D.length;C+=2){var B=D.slice(C,C+2);B.unshift(A);value=this._dotop.apply(this,B);if(typeof value=="undefined"){break}A=value}}else{value=this._dotop(A,D)}if(typeof value=="undefined"){if(this.__config__.DEBUG_UNDEF){throw ("undefined value found while using DEGUG_UNDEF")}value=""}return value};proto.set=function(B,D,A){if(B instanceof Array){var C=this.get(B[0])||{};B=B[2]}else{C=this.data}if(!(A&&(typeof C[B]!="undefined"))){C[B]=D}};proto._dotop=function(A,C,B){if(typeof C=="undefined"||typeof C=="string"&&C.match(/^[\._]/)){return undefined}if((!B)&&(typeof A=="object")&&(!(A instanceof Array)||(typeof C=="number"))&&(typeof A[C]!="undefined")){var D=A[C];if(typeof D=="function"){D=D()}return D}if(typeof A=="string"&&this.string_functions[C]){return this.string_functions[C](A,B)}if(A instanceof Array&&this.list_functions[C]){return this.list_functions[C](A,B)}if(typeof A=="object"&&this.hash_functions[C]){return this.hash_functions[C](A,B)}if(typeof A[C]=="function"){return A[C].apply(A,B)}return undefined};proto.string_functions={};proto.string_functions.chunk=function(C,A){var B=A[0];var D=new Array();if(!B){B=1}if(B<0){B=0-B;for(i=C.length-B;i>=0;i=i-B){D.unshift(C.substr(i,B))}if(C.length%B){D.unshift(C.substr(0,C.length%B))}}else{for(i=0;i<C.length;i=i+B){D.push(C.substr(i,B))}}return D};proto.string_functions.defined=function(A){return 1};proto.string_functions.hash=function(A){return{value:A}};proto.string_functions.length=function(A){return A.length};proto.string_functions.list=function(A){return[A]};proto.string_functions.match=function(C,B){var A=new RegExp(B[0],"gm");var D=C.match(A);return D};proto.string_functions.repeat=function(C,A){var E=A[0]||1;var D="";for(var B=0;B<E;B++){D+=C}return D};proto.string_functions.replace=function(C,B){var A=new RegExp(B[0],"gm");var E=B[1];if(!E){E=""}var D=C.replace(A,E);return D};proto.string_functions.search=function(C,B){var A=new RegExp(B[0]);return(C.search(A)>=0)?1:0};proto.string_functions.size=function(A){return 1};proto.string_functions.split=function(C,B){var A=new RegExp(B[0]);var D=C.split(A);return D};proto.list_functions={};proto.list_functions.join=function(B,A){return B.join(A[0])};proto.list_functions.sort=function(B,A){if(typeof (A)!="undefined"&&A!=""){return B.sort(function(D,C){if(D[A]==C[A]){return 0}else{if(D[A]>C[A]){return 1}else{return -1}}})}return B.sort()};proto.list_functions.nsort=function(A){return A.sort(function(C,B){return(C-B)})};proto.list_functions.grep=function(E,B){var A=new RegExp(B[0]);var D=[];for(var C=0;C<E.length;C++){if(E[C].match(A)){D.push(E[C])}}return D};proto.list_functions.unique=function(E){var D=[];var A={};for(var B=0;B<E.length;B++){var C=E[B];if(!A[C]){D.push(C)}A[C]=true}return D};proto.list_functions.reverse=function(C){var B=[];for(var A=C.length-1;A>=0;A--){B.push(C[A])}return B};proto.list_functions.merge=function(E,B){var D=[];var A=function(G){if(G instanceof Array){for(var F=0;F<G.length;F++){D.push(G[F])}}else{D.push(G)}};A(E);for(var C=0;C<B.length;C++){A(B[C])}return D};proto.list_functions.slice=function(B,A){return B.slice(A[0],A[1])};proto.list_functions.splice=function(B,A){if(A.length==1){return B.splice(A[0])}if(A.length==2){return B.splice(A[0],A[1])}if(A.length==3){return B.splice(A[0],A[1],A[2])}};proto.list_functions.push=function(B,A){B.push(A[0]);return B};proto.list_functions.pop=function(A){return A.pop()};proto.list_functions.unshift=function(B,A){B.unshift(A[0]);return B};proto.list_functions.shift=function(A){return A.shift()};proto.list_functions.first=function(A){return A[0]};proto.list_functions.size=function(A){return A.length};proto.list_functions.max=function(A){return A.length-1};proto.list_functions.last=function(A){return A.slice(-1)};proto.hash_functions={};proto.hash_functions.each=function(C){var B=new Array();for(var A in C){B.push(A,C[A])}return B};proto.hash_functions.exists=function(B,A){return(typeof (B[A[0]])=="undefined")?0:1};proto.hash_functions.keys=function(C){var B=new Array();for(var A in C){B.push(A)}return B};proto.hash_functions.list=function(E,A){var D="";if(A){var D=A[0]}var C=new Array();if(D=="keys"){for(var B in E){C.push(B)}}else{if(D=="values"){for(var B in E){C.push(E[B])}}else{if(D=="each"){for(var B in E){C.push(B,E[B])}}else{for(var B in E){C.push({key:B,value:E[B]})}}}}return C};proto.hash_functions.nsort=function(C){var B=new Array();for(var A in C){B.push(A)}return B.sort(function(E,D){return(E-D)})};proto.hash_functions.size=function(C){var B=0;for(var A in C){B++}return B};proto.hash_functions.sort=function(C){var B=new Array();for(var A in C){B.push(A)}return B.sort()};proto.hash_functions.values=function(C){var B=new Array();for(var A in C){B.push(C[A])}return B};if(typeof Jemplate.Iterator=="undefined"){Jemplate.Iterator=function(C){if(C instanceof Array){this.object=C;this.size=C.length;this.max=this.size-1}else{if(C instanceof Object){this.object=C;var B=new Array;for(var A in C){B[B.length]=A}this.object_keys=B.sort();this.size=B.length;this.max=this.size-1}}}}proto=Jemplate.Iterator.prototype;proto.get_first=function(){this.index=0;this.first=1;this.last=0;this.count=1;return this.get_next(1)};proto.get_next=function(C){var B=this.object;var A;if(typeof (C)!="undefined"&&C){A=this.index}else{A=++this.index;this.first=0;this.count=this.index+1;if(this.index==this.size-1){this.last=1}}if(typeof B=="undefined"){throw ("No object to iterate")}if(this.object_keys){if(A<this.object_keys.length){this.prev=A>0?this.object_keys[A-1]:"";this.next=A<this.max?this.object_keys[A+1]:"";return[this.object_keys[A],false]}}else{if(A<B.length){this.prev=A>0?B[A-1]:"";this.next=A<this.max?B[A+1]:"";return[B[A],false]}}return[null,true]};function XXX(A){if(!confirm(A)){throw ("terminated...")}return A}function JJJ(A){return XXX(JSON.stringify(A))}if(!this.Ajax){Ajax={}}Ajax.get=function(A,C){var B=new XMLHttpRequest();B.open("GET",A,Boolean(C));return Ajax._send(B,null,C)};Ajax.post=function(A,C,D){var B=new XMLHttpRequest();B.open("POST",A,Boolean(D));B.setRequestHeader("Content-Type","application/x-www-form-urlencoded");return Ajax._send(B,C,D)};Ajax._send=function(A,B,C){if(C){A.onreadystatechange=function(){if(A.readyState==4){if(A.status==200){C(A.responseText)}}}}A.send(B);if(!C){if(A.status!=200){throw ('Request for "'+url+'" failed with status: '+A.status)}return A.responseText}};if(window.ActiveXObject&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){return new ActiveXObject((navigator.userAgent.toLowerCase().indexOf("msie 5")!=-1)?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP")}}if(window.opera&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){this.readyState=0;this.status=0;this.statusText="";this._headers=[];this._aborted=false;this._async=true;this.abort=function(){this._aborted=true};this.getAllResponseHeaders=function(){return this.getAllResponseHeader("*")};this.getAllResponseHeader=function(C){var A="";for(var B=0;B<this._headers.length;B++){if(C=="*"||this._headers[B].h==C){A+=this._headers[B].h+": "+this._headers[B].v+"\n"}}return A};this.setRequestHeader=function(B,A){this._headers[this._headers.length]={h:B,v:A}};this.open=function(E,C,D,A,B){this.method=E;this.url=C;this._async=true;this._aborted=false;if(arguments.length>=3){this._async=D}if(arguments.length>3){opera.postError("XMLHttpRequest.open() - user/password not supported")}this._headers=[];this.readyState=1;if(this.onreadystatechange){this.onreadystatechange()}};this.send=function(A){if(!navigator.javaEnabled()){alert("XMLHttpRequest.send() - Java must be installed and enabled.");return }if(this._async){setTimeout(this._sendasync,0,this,A)}else{this._sendsync(A)}};this._sendasync=function(A,B){if(!A._aborted){A._sendsync(B)}};this._sendsync=function(Q){this.readyState=2;if(this.onreadystatechange){this.onreadystatechange()}var F=new java.net.URL(new java.net.URL(window.location.href),this.url);var G=F.openConnection();for(var P=0;P<this._headers.length;P++){G.setRequestProperty(this._headers[P].h,this._headers[P].v)}this._headers=[];if(this.method=="POST"){G.setDoOutput(true);var A=new java.io.OutputStreamWriter(G.getOutputStream());A.write(Q);A.flush();A.close()}var K=false;var J=false;var E=false;var C=false;var H=false;var O=false;for(var P=0;;P++){var N=G.getHeaderFieldKey(P);var B=G.getHeaderField(P);if(N==null&&B==null){break}if(N!=null){this._headers[this._headers.length]={h:N,v:B};switch(N.toLowerCase()){case"content-encoding":K=true;break;case"content-length":J=true;break;case"content-type":E=true;break;case"date":C=true;break;case"expires":H=true;break;case"last-modified":O=true;break}}}var R;R=G.getContentEncoding();if(R!=null&&!K){this._headers[this._headers.length]={h:"Content-encoding",v:R}}R=G.getContentLength();if(R!=-1&&!J){this._headers[this._headers.length]={h:"Content-length",v:R}}R=G.getContentType();if(R!=null&&!E){this._headers[this._headers.length]={h:"Content-type",v:R}}R=G.getDate();if(R!=0&&!C){this._headers[this._headers.length]={h:"Date",v:(new Date(R)).toUTCString()}}R=G.getExpiration();if(R!=0&&!H){this._headers[this._headers.length]={h:"Expires",v:(new Date(R)).toUTCString()}}R=G.getLastModified();if(R!=0&&!O){this._headers[this._headers.length]={h:"Last-modified",v:(new Date(R)).toUTCString()}}var D="";var I=G.getInputStream();if(I){var M=new java.io.BufferedReader(new java.io.InputStreamReader(I));var L;while((L=M.readLine())!=null){if(this.readyState==2){this.readyState=3;if(this.onreadystatechange){this.onreadystatechange()}}D+=L+"\n"}M.close();this.status=200;this.statusText="OK";this.responseText=D;this.readyState=4;if(this.onreadystatechange){this.onreadystatechange()}if(this.onload){this.onload()}}else{this.status=404;this.statusText="Not Found";this.responseText="";this.readyState=4;if(this.onreadystatechange){this.onreadystatechange()}if(this.onerror){this.onerror()}}}}}if(!window.ActiveXObject&&window.XMLHttpRequest){window.ActiveXObject=function(A){switch(A.toLowerCase()){case"microsoft.xmlhttp":case"msxml2.xmlhttp":return new XMLHttpRequest()}return null}}var JSON=function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},s={"boolean":function(x){return String(x)},number:function(x){return isFinite(x)?String(x):"null"},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})}return'"'+x+'"'},object:function(x){if(x){var a=[],b,f,i,l,v;if(x instanceof Array){a[0]="[";l=x.length;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a[a.length]=v;b=true}}}a[a.length]="]"}else{if(x instanceof Object){a[0]="{";for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a.push(s.string(i),":",v);b=true}}}a[a.length]="}"}else{return }}return a.join("")}return"null"}};return{copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){return v}}return null},parse:function(text){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+text+")")}catch(e){return false}}}}();