var pc=navigator.userAgent.toLowerCase();var ie4_win=(pc.indexOf("win")!=-1)&&(pc.indexOf("msie")!=-1)&&(parseInt(navigator.appVersion)>=4);var is_gecko=pc.indexOf("gecko/")!=-1&&parseFloat(pc.substring(pc.indexOf("gecko/")+6,pc.indexOf("gecko/")+14))>20030108;function styleTag(M,D,H){var E=0;var C=H.scrollTop;var A;if(document.selection){if(document.selection.createRange().parentElement().tagName=="TEXTAREA"){var F=document.selection.createRange().text;E=getSelectionRangeEnd(H);A=_markupText(F,M,D);document.selection.createRange().text=A[0];E+=A[1]}}else{if(typeof (H.selectionStart)!="undefined"&&typeof (H.selectionEnd)!="undefined"){if(H.selectionStart==H.selectionEnd){return }var G=H.textLength;var B=H.selectionStart;var I=H.selectionEnd;if(I==1||I==2){I=G}var L=(H.value).substring(0,B);var K=(H.value).substring(B,I);var J=(H.value).substring(I,G);A=_markupText(K,M,D);H.value=L+A[0]+J;E=I+A[1]}else{return }}if(E>0){setCaretTo(H,E,C)}}function _markupText(J,M,E){var A=trimLeadingSpace(J);J=A[0];var I=A[1];A=trimTrailingSpace(J);J=A[0];var F=A[1];var D=0;if(J.indexOf("\n")>0){var L=J.split("\n");var H="";for(var G=0;G<L.length;G++){var K=L[G];A=trimLeadingSpace(K);K=A[0];var C=A[1];A=trimTrailingSpace(K);K=A[0];var B=A[1];if(K==""){H+=C+K+B}else{H+=C+M+K+E+B;D+=(M.length+E.length)}if(G<L.length-1){H+="\n"}}J=I+H+F}else{J=I+M+J+E+F}A=new Array(2);A[0]=J;A[1]=D;return A}function trimLeadingSpace(C){var B="";while(C.length>0&&(C.charAt(0)==" "||C.charAt(0)=="\n"||C.charAt(0)=="\r")){B+=C.charAt(0);C=C.substring(1)}var A=new Array(2);A[0]=C;A[1]=B;return A}function trimTrailingSpace(C){var B="";while(C.length>0&&(C.charAt(C.length-1)==" "||C.charAt(C.length-1)=="\n"||C.charAt(C.length-1)=="\r")){B+=C.charAt(C.length-1);C=C.substring(0,C.length-1)}var A=new Array(2);A[0]=C;A[1]=B;return A}function getSelectionRangeText(B){if(document.selection){return document.selection.createRange().text}else{if(is_gecko){var C=B.selectionStart;var A=B.selectionEnd;return B.value.substr(C,A-C)}else{return""}}}function getSelectionRangeEnd(B){if(document.selection){var A=document.selection.createRange();var C=A.duplicate();C.moveToElementText(B);C.setEndPoint("EndToEnd",A);var D=C.text.length-A.text.length;return D+A.text.length}else{if(is_gecko){return B.selectionEnd}else{return 0}}}function setCaretTo(B,G,E){B.focus();if(B.createTextRange){var C=0;var D=0;var F=B.value;while(C>-1&&C<G){C=F.indexOf("\r\n",C);if(C>=0){D++;C+=2}}if(D>1){D--}var A=B.createTextRange();A.move("character",(G-D));A.select()}else{if(B.selectionStart){B.setSelectionRange(G,G)}}if(E>0){B.scrollTop=E}}function caret(A){if(ie4_win&&A.createTextRange&&document.selection.createRange().parentElement().tagName=="TEXTAREA"){A.caretPos=document.selection.createRange().duplicate()}}function funcname(B){var A=B.toString().match(/function (\w*)/)[1];if((A==null)||(A.length==0)){return"anonymous"}return A}function stacktrace(){var B="";for(var A=arguments.caller;A!=null;A=A.caller){B+=funcname(A.callee)+"\n";if(A.caller==A){break}}return B}function printStackTrace(){alert("stack trace is "+stacktrace())};

var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var E=null,D=$A(arguments);if(Object.isFunction(D[0])){E=D.shift()}function A(){this.initialize.apply(this,arguments)}Object.extend(A,Class.Methods);A.superclass=E;A.subclasses=[];if(E){var B=function(){};B.prototype=E.prototype;A.prototype=new B;E.subclasses.push(A)}for(var C=0;C<D.length;C++){A.addMethods(D[C])}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction}A.prototype.constructor=A;return A}};Class.Methods={addMethods:function(G){var C=this.superclass&&this.superclass.prototype;var B=Object.keys(G);if(!Object.keys({toString:true}).length){B.push("toString","valueOf")}for(var A=0,D=B.length;A<D;A++){var F=B[A],E=G[F];if(C&&Object.isFunction(E)&&E.argumentNames().first()=="$super"){var H=E,E=Object.extend((function(I){return function(){return C[I].apply(this,arguments)}})(F).wrap(H),{valueOf:function(){return H},toString:function(){return H.toString()}})}this.prototype[F]=E}return this}};var Abstract={};Object.extend=function(A,C){for(var B in C){A[B]=C[B]}return A};Object.extend(Object,{inspect:function(A){try{if(Object.isUndefined(A)){return"undefined"}if(A===null){return"null"}return A.inspect?A.inspect():String(A)}catch(B){if(B instanceof RangeError){return"..."}throw B}},toJSON:function(A){var C=typeof A;switch(C){case"undefined":case"function":case"unknown":return ;case"boolean":return A.toString()}if(A===null){return"null"}if(A.toJSON){return A.toJSON()}if(Object.isElement(A)){return }var B=[];for(var E in A){var D=Object.toJSON(A[E]);if(!Object.isUndefined(D)){B.push(E.toJSON()+": "+D)}}return"{"+B.join(", ")+"}"},toQueryString:function(A){return $H(A).toQueryString()},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A)},keys:function(A){var B=[];for(var C in A){B.push(C)}return B},values:function(B){var A=[];for(var C in B){A.push(B[C])}return A},clone:function(A){return Object.extend({},A)},isElement:function(A){return A&&A.nodeType==1},isArray:function(A){return A!=null&&typeof A=="object"&&"splice" in A&&"join" in A},isHash:function(A){return A instanceof Hash},isFunction:function(A){return typeof A=="function"},isString:function(A){return typeof A=="string"},isNumber:function(A){return typeof A=="number"},isUndefined:function(A){return typeof A=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return A.length==1&&!A[0]?[]:A},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}},bindAsEventListener:function(){var A=this,C=$A(arguments),B=C.shift();return function(D){return A.apply(B,[D||window.event].concat(C))}},curry:function(){if(!arguments.length){return this}var A=this,B=$A(arguments);return function(){return A.apply(this,B.concat($A(arguments)))}},delay:function(){var A=this,B=$A(arguments),C=B.shift()*1000;return window.setTimeout(function(){return A.apply(A,B)},C)},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)))}}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var C;for(var B=0,D=arguments.length;B<D;B++){var A=arguments[B];try{C=A();break}catch(E){}}return C}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B;C=arguments.callee.prepareReplacement(C);while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index);A+=String.interpret(C(B));D=D.slice(B.index+B[0].length)}else{A+=D,D=""}}return A},sub:function(C,A,B){A=this.gsub.prepareReplacement(A);B=Object.isUndefined(B)?1:B;return this.gsub(C,function(D){if(--B<0){return D[0]}return A(D)})},scan:function(B,A){this.gsub(B,A);return String(this)},truncate:function(B,A){B=B||30;A=Object.isUndefined(A)?"...":A;return this.length>B?this.slice(0,B-A.length)+A:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML},unescapeHTML:function(){var A=new Element("div");A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue}):A.childNodes[0].nodeValue):""},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A){return{}}return A[1].split(B||"&").inject({},function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift());var D=F.length>1?F.join("="):F[0];if(D!=undefined){D=decodeURIComponent(D)}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]]}E[C].push(D)}else{E[C]=D}}return E})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(A){return A<1?"":new Array(A+1).join(this)},camelize:function(){var D=this.split("-"),A=D.length;if(A==1){return D[0]}var C=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var B=1;B<A;B++){C+=D[B].charAt(0).toUpperCase()+D[B].substring(1)}return C},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]];return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16)});if(B){return'"'+A.replace(/"/g,'\\"')+'"'}return"'"+A.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}")},isJSON:function(){var A=this;if(A.blank()){return false}A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(A){return this.indexOf(A)>-1},startsWith:function(A){return this.indexOf(A)===0},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(A,B){return new Template(this,B).evaluate(A)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B}var A=new Template(B);return function(C){return A.evaluate(C)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text)}var Template=Class.create({initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(D){if(A==null){return""}var F=D[1]||"";if(F=="\\"){return D[2]}var B=A,G=D[3];var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;D=E.exec(G);if(D==null){return F}while(D!=null){var C=D[1].startsWith("[")?D[2].gsub("\\\\]","]"):D[1];B=B[C];if(null==B||""==D[3]){break}G=G.substring("["==D[3]?D[1].length:D[0].length);D=E.exec(G)}return F+String.interpret(B)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(C,B){var A=0;C=C.bind(B);try{this._each(function(E){C(E,A++)})}catch(D){if(D!=$break){throw D}}return this},eachSlice:function(D,C,B){C=C?C.bind(B):Prototype.K;var A=-D,E=[],F=this.toArray();while((A+=D)<F.length){E.push(F.slice(A,A+D))}return E.collect(C,B)},all:function(C,B){C=C?C.bind(B):Prototype.K;var A=true;this.each(function(E,D){A=A&&!!C(E,D);if(!A){throw $break}});return A},any:function(C,B){C=C?C.bind(B):Prototype.K;var A=false;this.each(function(E,D){if(A=!!C(E,D)){throw $break}});return A},collect:function(C,B){C=C?C.bind(B):Prototype.K;var A=[];this.each(function(E,D){A.push(C(E,D))});return A},detect:function(C,B){C=C.bind(B);var A;this.each(function(E,D){if(C(E,D)){A=E;throw $break}});return A},findAll:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(C(E,D)){A.push(E)}});return A},grep:function(D,C,B){C=C?C.bind(B):Prototype.K;var A=[];if(Object.isString(D)){D=new RegExp(D)}this.each(function(F,E){if(D.match(F)){A.push(C(F,E))}});return A},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true}}var B=false;this.each(function(C){if(C==A){B=true;throw $break}});return B},inGroupsOf:function(B,A){A=Object.isUndefined(A)?null:A;return this.eachSlice(B,function(C){while(C.length<B){C.push(A)}return C})},inject:function(A,C,B){C=C.bind(B);this.each(function(E,D){A=C(A,E,D)});return A},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A)})},max:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==null||E>=A){A=E}});return A},min:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==null||E<A){A=E}});return A},partition:function(D,B){D=D?D.bind(B):Prototype.K;var C=[],A=[];this.each(function(F,E){(D(F,E)?C:A).push(F)});return[C,A]},pluck:function(B){var A=[];this.each(function(C){A.push(C[B])});return A},reject:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(!C(E,D)){A.push(E)}});return A},sortBy:function(B,A){B=B.bind(A);return this.map(function(D,C){return{value:D,criteria:B(D,C)}}).sort(function(F,E){var D=F.criteria,C=E.criteria;return D<C?-1:D>C?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop()}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(C){if(!C){return[]}if(C.toArray){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}if(Prototype.Browser.WebKit){$A=function(C){if(!C){return[]}if(!(Object.isFunction(C)&&C=="[object NodeList]")&&C.toArray){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length;A<C;A++){B(this[A])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(A){return A!=null})},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A])})},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B)})},reverse:function(A){return(A!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C)}return D})},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var A=[];this.each(function(B){var C=Object.toJSON(B);if(!Object.isUndefined(C)){A.push(C)}});return"["+A.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,A){A||(A=0);var B=this.length;if(A<0){A=B+A}for(;A<B;A++){if(this[A]===C){return A}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;var C=this.slice(0,A).reverse().indexOf(B);return(C<0)?C:A-C-1}}Array.prototype.toArray=Array.prototype.clone;function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[];for(var B=0,C=this.length;B<C;B++){E.push(this[B])}for(var B=0,C=arguments.length;B<C;B++){if(Object.isArray(arguments[B])){for(var A=0,D=arguments[B].length;A<D;A++){E.push(arguments[B][A])}}else{E.push(arguments[B])}}return E}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(A){$R(0,this,true).each(A);return this},toPaddedString:function(C,B){var A=this.toString(B||10);return"0".times(C-A.length)+A},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize()});function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function A(B,C){if(Object.isUndefined(C)){return B}return B+"="+encodeURIComponent(String.interpret(C))}return{initialize:function(B){this._object=Object.isHash(B)?B.toObject():Object.clone(B)},_each:function(C){for(var B in this._object){var D=this._object[B],E=[B,D];E.key=B;E.value=D;C(E)}},set:function(B,C){return this._object[B]=C},get:function(B){return this._object[B]},unset:function(B){var C=this._object[B];delete this._object[B];return C},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(C){var B=this.detect(function(D){return D.value===C});return B&&B.key},merge:function(B){return this.clone().update(B)},update:function(B){return new Hash(B).inject(this,function(C,D){C.set(D.key,D.value);return C})},toQueryString:function(){return this.map(function(D){var C=encodeURIComponent(D.key),B=D.value;if(B&&typeof B=="object"){if(Object.isArray(B)){return B.map(A.curry(C)).join("&")}}return A(C,B)}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C;this.end=A;this.exclusive=B},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ()}},include:function(A){if(A<this.start){return false}if(this.exclusive){return A<this.end}return A<=this.end}});var $R=function(C,A,B){return new ObjectRange(C,A,B)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A])}catch(F){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A);this.transport=Ajax.getTransport();this.request(B)},request:function(B){this.url=B;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D._method=this.method;this.method="post"}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="}}}try{var A=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(A)}Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(Object.isFunction(C.push)){for(var B=0,D=C.length;B<D;B+=2){E[C[B]]=C[B+1]}}else{$H(C).each(function(F){E[F.key]=F.value})}}for(var A in E){this.transport.setRequestHeader(A,E[A])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(D){this.dispatchException(D)}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON)}catch(D){this.dispatchException(D)}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=D.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(E,F){this.updateContent(E.responseText);if(Object.isFunction(D)){D(E,F)}}).bind(this);$super(C,B)},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options;if(!A.evalScripts){D=D.stripScripts()}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={};B[A.insertion]=D;C.insert(B)}else{A.insertion(C,D)}}else{C.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=C;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;A<C;A++){D.push($(arguments[A]))}return D}if(Object.isString(B)){B=document.getElementById(B)}return Element.extend(B)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[];var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,D=E.snapshotLength;B<D;B++){C.push(Element.extend(E.snapshotItem(B)))}return C}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var A=this.Element;this.Element=function(D,C){C=C||{};D=D.toLowerCase();var B=Element.cache;if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">';delete C.name;return Element.writeAttribute(document.createElement(D),C)}if(!B[D]){B[D]=Element.extend(document.createElement(D))}return Element.writeAttribute(B[D].cloneNode(false),C)};Object.extend(this.Element,A||{})}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){$(A).style.display="none";return A},show:function(A){$(A).style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement()}if(Object.isElement(B)){return A.update().insert(B)}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A},replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(C,E){C=$(C);if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E}}var D,F,B,G;for(var A in E){D=E[A];A=A.toLowerCase();F=Element._insertionTranslations[A];if(D&&D.toElement){D=D.toElement()}if(Object.isElement(D)){F(C,D);continue}D=Object.toHTML(D);B=((A=="before"||A=="after")?C.parentNode:C).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(B,D.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(F.curry(C));D.evalScripts.bind(D).defer()}return C},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{})}else{if(Object.isString(C)){C=new Element(C,A)}else{C=new Element("div",C)}}if(B.parentNode){B.parentNode.replaceChild(C,B)}C.appendChild(B);return C},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(F){var E=F.first(),C=F.last();var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true)}});return A+">"},recursivelyCollect:function(A,C){A=$(A);var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A))}}return B},ancestors:function(A){return $(A).recursivelyCollect("parentNode")},descendants:function(A){return $(A).select("*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling")},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling")},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings())},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(B,D,A){B=$(B);if(arguments.length==1){return $(B.parentNode)}var C=B.ancestors();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},down:function(B,C,A){B=$(B);if(arguments.length==1){return B.firstDescendant()}return Object.isNumber(C)?B.descendants()[C]:B.select(C)[A||0]},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var C=B.previousSiblings();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},next:function(C,D,B){C=$(C);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C))}var A=C.nextSiblings();return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},select:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B,A)},adjacent:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(B){B=$(B);var C=B.readAttribute("id"),A=arguments.callee;if(C){return C}do{C="anonymous_element_"+A.counter++}while($(C));B.writeAttribute("id",C);return C},readAttribute:function(C,A){C=$(C);if(Prototype.Browser.IE){var B=Element._attributeTranslations.read;if(B.values[A]){return B.values[A](C,A)}if(B.names[A]){A=B.names[A]}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value}}return C.getAttribute(A)},writeAttribute:function(E,C,F){E=$(E);var B={},D=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=D.names[A]||A;F=B[A];if(D.values[A]){C=D.values[A](E,F)}if(F===false||F===null){E.removeAttribute(C)}else{if(F===true){E.setAttribute(C,C)}else{E.setAttribute(C,F)}}}return E},getHeight:function(A){return $(A).getDimensions().height},getWidth:function(A){return $(A).getDimensions().width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(A,B){if(!(A=$(A))){return }var C=A.className;return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C)))},addClassName:function(A,B){if(!(A=$(A))){return }if(!A.hasClassName(B)){A.className+=(A.className?" ":"")+B}return A},removeClassName:function(A,B){if(!(A=$(A))){return }A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip();return A},toggleClassName:function(A,B){if(!(A=$(A))){return }return A[A.hasClassName(B)?"removeClassName":"addClassName"](B)},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C)}C=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(D,C){D=$(D),C=$(C);var F=C;if(D.compareDocumentPosition){return(D.compareDocumentPosition(C)&8)===8}if(D.sourceIndex&&!Prototype.Browser.Opera){var E=D.sourceIndex,B=C.sourceIndex,A=C.nextSibling;if(!A){do{C=C.parentNode}while(!(A=C.nextSibling)&&C.parentNode)}if(A&&A.sourceIndex){return(E>B&&E<A.sourceIndex)}}while(D=D.parentNode){if(D==F){return true}}return false},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();window.scrollTo(B[0],B[1]);return A},getStyle:function(B,C){B=$(B);C=C=="float"?"cssFloat":C.camelize();var D=B.style[C];if(!D){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(B,C){B=$(B);var E=B.style,A;if(Object.isString(C)){B.style.cssText+=";"+C;return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B}for(var D in C){if(D=="opacity"){B.setOpacity(C[D])}else{E[(D=="float"||D=="cssFloat")?(Object.isUndefined(E.styleFloat)?"cssFloat":"styleFloat"):D]=C[D]}}return B},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(C){C=$(C);var G=$(C).getStyle("display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(window.opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return Element._returnOffset(C,A)},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break}var C=Element.getStyle(B,"position");if(C!=="static"){break}}}while(B);return Element._returnOffset(D,A)},absolutize:function(B){B=$(B);if(B.getStyle("position")=="absolute"){return }var D=B.positionedOffset();var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px";return B},relativize:function(A){A=$(A);if(A.getStyle("position")=="relative"){return }A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A},cumulativeScrollOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode}while(B);return Element._returnOffset(C,A)},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent)}if(A==document.body){return $(A)}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A)}}return $(document.body)},viewportOffset:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break}}while(B=B.offsetParent);B=D;do{if(!Prototype.Browser.Opera||B.tagName=="BODY"){A-=B.scrollTop||0;C-=B.scrollLeft||0}}while(B=B.parentNode);return Element._returnOffset(C,A)},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});D=$(D);var E=D.viewportOffset();B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=B.getOffsetParent();F=C.viewportOffset()}if(C==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){B.style.width=D.offsetWidth+"px"}if(A.setHeight){B.style.height=D.offsetHeight+"px"}return B}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(D,B,C){switch(C){case"left":case"top":case"right":case"bottom":if(D(B,"position")==="static"){return null}case"height":case"width":if(!Element.visible(B)){return null}var E=parseInt(D(B,C),10);if(E!==B["offset"+C.capitalize()]){return E+"px"}var A;if(C==="height"){A=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{A=["border-left-width","padding-left","padding-right","border-right-width"]}return A.inject(E,function(F,G){var H=D(B,G);return H===null?F:F-parseInt(H,10)})+"px";default:return D(B,C)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(C,A,B){if(B==="title"){return A.title}return C(A,B)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(C,B){B=$(B);var A=B.getStyle("position");if(A!=="static"){return C(B)}B.setStyle({position:"relative"});var D=C(B);B.setStyle({position:A});return D});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(E,C){C=$(C);var B=C.getStyle("position");if(B!=="static"){return E(C)}var D=C.getOffsetParent();if(D&&D.getStyle("position")==="fixed"){D.setStyle({zoom:1})}C.setStyle({position:"relative"});var F=E(C);C.setStyle({position:B});return F})});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B]}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100}}return 1}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return C};Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}B=$(B);var A=B.currentStyle;if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1}var D=B.getStyle("filter"),C=B.style;if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter");return B}else{if(E<0.00001){E=0}}C.filter=F(D)+"alpha(opacity="+(E*100)+")";return B};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2)},_getAttrNode:function(A,C){var B=A.getAttributeNode(C);return B?B.value:""},_getEv:function(A,B){B=A.getAttribute(B);return B?B.toString().slice(23,-2):null},_flag:function(A,B){return $(A).hasAttribute(B)?B:null},style:function(A){return A.style.cssText.toLowerCase()},title:function(A){return A.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName=="IMG"&&A.width){A.width++;A.width--}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(C){}}}return A};Element.Methods.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}B=B.offsetParent}while(B);return Element._returnOffset(C,A)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}if(Object.isElement(C)){return B.update().insert(C)}C=Object.toHTML(C);var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D)});Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D)})}else{B.innerHTML=C.stripScripts()}C.evalScripts.bind(C).defer();return B}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(C,E){C=$(C);if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){C.parentNode.replaceChild(E,C);return C}E=Object.toHTML(E);var D=C.parentNode,B=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[B]){var F=C.next();var A=Element._getContentFromAnonymousElement(B,E.stripScripts());D.removeChild(C);if(F){A.each(function(G){D.insertBefore(G,F)})}else{A.each(function(G){D.appendChild(G)})}}else{C.outerHTML=E.stripScripts()}E.evalScripts.bind(E).defer();return C}}Element._returnOffset=function(B,C){var A=[B,C];A.left=B;A.top=C;return A};Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C];if(A){D.innerHTML=A[0]+B+A[1];A[2].times(function(){D=D.firstChild})}else{D.innerHTML=B}return $A(D.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return B&&B.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var A={},B=Element.Methods.ByTag;var C=Object.extend(function(F){if(!F||F._extendedByPrototype||F.nodeType!=1||F==window){return F}var D=Object.clone(A),E=F.tagName,H,G;if(B[E]){Object.extend(D,B[E])}for(H in D){G=D[H];if(Object.isFunction(G)&&!(H in F)){F[H]=G.methodize()}}F._extendedByPrototype=Prototype.emptyFunction;return F},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);Object.extend(A,Element.Methods.Simulated)}}});C.refresh();return C})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var B=C;C=arguments[1]}if(!B){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(B)){B.each(H)}else{H(B)}}function H(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function A(L,K,F){F=F||false;for(var N in L){var M=L[N];if(!Object.isFunction(M)){continue}if(!F||!(N in K)){K[N]=M.methodize()}}}function E(L){var F;var K={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(K[L]){F="HTML"+K[L]+"Element"}if(window[F]){return window[F]}F="HTML"+L+"Element";if(window[F]){return window[F]}F="HTML"+L.capitalize()+"Element";if(window[F]){return window[F]}window[F]={};window[F].prototype=document.createElement(L).__proto__;return window[F]}if(I.ElementExtensions){A(Element.Methods,HTMLElement.prototype);A(Element.Methods.Simulated,HTMLElement.prototype,true)}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var G=E(J);if(Object.isUndefined(G)){continue}A(D[J],G.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var A={};var C=Prototype.Browser;$w("width height").each(function(E){var B=E.capitalize();A[E]=(C.WebKit&&!document.evaluate)?self["inner"+B]:(C.Opera)?document.body["client"+B]:document.documentElement["client"+B]});return A},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();this.compileMatcher()},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var A=this.expression;if(Prototype.Browser.WebKit&&(A.include("-of-type")||A.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false}return true},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher()}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return }this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A;if(Selector._cache[E]){this.xpath=Selector._cache[E];return }this.matcher=[".//*"];while(E&&D!=E&&(/\S/).test(E)){D=E;for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A));E=E.replace(A[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;if(this.xpath){return document._getElementsByXPath(this.xpath,A)}return this.matcher(A)},match:function(H){this.tokens=[];var L=this.expression,A=Selector.patterns,E=Selector.assertions;var B,D,F;while(L&&B!==L&&(/\S/).test(L)){B=L;for(var I in A){D=A[I];if(F=L.match(D)){if(E[I]){this.tokens.push([I,Object.clone(F)]);L=L.replace(F[0],"")}else{return this.findElements(document).include(H)}}}}var K=true,C,J;for(var I=0,G;G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,C;var F=[];while(H&&E!=H&&(/\S/).test(H)){E=H;for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B);F.push("("+C.substring(1,C.length-1)+")");H=H.replace(B[0],"");break}}}return"[not("+F.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(E,C){var F,G=C[6],B;if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]"}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1}var D=F[1]?Number(F[1]):1;var A=F[2]?Number(F[2]):0;B="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(B).evaluate({fragment:E,a:D,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6])}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D)}return B},mark:function(A){var D=Prototype.emptyFunction;for(var B=0,C;C=A[B];B++){C._countedByPrototype=D}return A},unmark:function(A){for(var B=0,C;C=A[B];B++){C._countedByPrototype=undefined}return A},index:function(A,D,G){A._countedByPrototype=Prototype.emptyFunction;if(D){for(var B=A.childNodes,E=B.length-1,C=1;E>=0;E--){var F=B[E];if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}else{for(var E=0,C=1,B=A.childNodes;F=B[E];E++){if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}},unique:function(B){if(B.length==0){return B}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(!(E=B[C])._countedByPrototype){E._countedByPrototype=Prototype.emptyFunction;D.push(Element.extend(E))}}return Selector.handlers.unmark(D)},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"))}return B},child:function(A){var E=Selector.handlers;for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G)}}}return C},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D)}}return B},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,H,C,B){var I=C.toUpperCase();var E=[],G=Selector.handlers;if(A){if(B){if(B=="descendant"){for(var F=0,D;D=A[F];F++){G.concat(E,D.getElementsByTagName(C))}return E}else{A=this[B](A)}if(C=="*"){return A}}for(var F=0,D;D=A[F];F++){if(D.tagName.toUpperCase()===I){E.push(D)}}return E}else{return H.getElementsByTagName(C)}},id:function(B,A,H,F){var G=$(H),D=Selector.handlers;if(!G){return[]}if(!B&&A==document){return[G]}if(B){if(F){if(F=="child"){for(var C=0,E;E=B[C];C++){if(G.parentNode==E){return[G]}}}else{if(F=="descendant"){for(var C=0,E;E=B[C];C++){if(Element.descendantOf(G,E)){return[G]}}}else{if(F=="adjacent"){for(var C=0,E;E=B[C];C++){if(Selector.handlers.previousElementSibling(G)==E){return[G]}}}else{B=D[F](B)}}}}for(var C=0,E;E=B[C];C++){if(E==G){return[G]}}return[]}return(G&&Element.descendantOf(G,A))?[G]:[]},className:function(B,A,C,D){if(B&&D){B=this[D](B)}return Selector.handlers.byClassName(B,A,C)},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B])}var H=" "+F+" ";for(var E=0,D=[],G,A;G=C[E];E++){A=G.className;if(A.length==0){continue}if(A==F||(" "+A+" ").include(H)){D.push(G)}}return D},attrPresence:function(C,B,A,G){if(!C){C=B.getElementsByTagName("*")}if(C&&G){C=this[G](C)}var E=[];for(var D=0,F;F=C[D];D++){if(Element.hasAttribute(F,A)){E.push(F)}}return E},attr:function(A,I,H,J,C,B){if(!A){A=I.getElementsByTagName("*")}if(A&&B){A=this[B](A)}var K=Selector.operators[C],F=[];for(var E=0,D;D=A[E];E++){var G=Element.readAttribute(D,H);if(G===null){continue}if(K(G,J)){F.push(D)}}return F},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B)}if(!B){B=A.getElementsByTagName("*")}return Selector.pseudos[C](B,E,A)}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue}C.push(E)}return C},"last-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue}C.push(E)}return C},"only-child":function(B,G,A){var E=Selector.handlers;for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F)}}return C},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A)},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true)},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true)},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true)},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A)},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[]}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E)}return D})},nth:function(A,L,N,K,C){if(A.length==0){return[]}if(L=="even"){L="2n+0"}if(L=="odd"){L="2n+1"}var J=Selector.handlers,I=[],B=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,K,C);B.push(D.parentNode)}}if(L.match(/^\d+$/)){L=Number(L);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==L){I.push(D)}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;G++){if(D.nodeIndex==P[G]){I.push(D)}}}}}J.unmark(A);J.unmark(B);return I},empty:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.tagName=="!"||(E.firstChild&&!E.innerHTML.match(/^\s*$/))){continue}C.push(E)}return C},not:function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;B=A[F];F++){if(!B._countedByPrototype){E.push(B)}}G.unmark(H);return E},enabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(!E.disabled){C.push(E)}}return C},disabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.disabled){C.push(E)}}return C},checked:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E)}}return C}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B.startsWith(A)},"$=":function(B,A){return B.endsWith(A)},"*=":function(B,A){return B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+B.toUpperCase()+"-").include("-"+A.toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip())});return A},matchElements:function(F,G){var E=$$(G),D=Selector.handlers;D.mark(E);for(var C=0,B=[],A;A=F[C];C++){if(A._countedByPrototype){B.push(A)}}D.unmark(E);return B},findElement:function(B,C,A){if(Object.isNumber(C)){A=C;C=false}return Selector.matchElements(B,C||"*")[A||0]},findChildElements:function(E,G){G=Selector.split(G.join(","));var D=[],F=Selector.handlers;for(var C=0,B=G.length,A;C<B;C++){A=new Selector(G[C].strip());F.concat(D,A.findElements(E))}return(B>1)?F.unique(D):D}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var C=0,D;D=A[C];C++){if(D.tagName!=="!"){B.push(D)}}return B},unmark:function(A){for(var B=0,C;C=A[B];B++){C.removeAttribute("_countedByPrototype")}return A}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){$(A).reset();return A},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B}}else{if(Object.isUndefined(B.hash)){B.hash=true}}var C,F,A=false,E=B.submit;var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name;F=$(I).getValue();if(F!=null&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]]}H[C].push(F)}else{H[C]=F}}}return H});return B.hash?D:Object.toQueryString(D)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C))}return B})},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return $A(A).map(Element.extend)}for(var E=0,H=[],F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue}H.push(Element.extend(B))}return H},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return A?A:C.find(function(D){return["input","select","textarea"].include(D.tagName.toLowerCase())})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(B,A){B=$(B),A=Object.clone(A||{});var D=A.parameters,C=B.readAttribute("action")||"";if(C.blank()){C=window.location.href}A.parameters=B.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(A.parameters,D)}if(B.hasAttribute("method")&&!A.method){A.method=B.method}return new Ajax.Request(C,A)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.blur();A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(D,A){if(Object.isUndefined(A)){return this[D.type=="select-one"?"selectOne":"selectMany"](D)}else{var C,F,G=!Object.isArray(A);for(var B=0,E=D.length;B<E;B++){C=D.options[B];F=this.optionValue(C);if(G){if(F==A){C.selected=true;return }}else{C.selected=A.include(F)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(D){var A,E=D.length;if(!E){return null}for(var C=0,A=[];C<E;C++){var B=D.options[C];if(B.selected){A.push(this.optionValue(B))}}return A},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null}return Element.extend(A)}});Event.Methods=(function(){var A;if(Prototype.Browser.IE){var B={0:1,1:4,2:2};A=function(D,C){return D.button==B[C]}}else{if(Prototype.Browser.WebKit){A=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;case 1:return D.which==1&&D.metaKey;default:return false}}}else{A=function(D,C){return D.which?(D.which===C+1):(D.button===C)}}}return{isLeftClick:function(C){return A(C,0)},isMiddleClick:function(C){return A(C,1)},isRightClick:function(C){return A(C,2)},element:function(D){var C=Event.extend(D).target;return Element.extend(C.nodeType==Node.TEXT_NODE?C.parentNode:C)},findElement:function(D,F){var C=Event.element(D);if(!F){return C}var E=[C].concat(C.ancestors());return Selector.findElement(E,F,0)},pointer:function(C){return{x:C.pageX||(C.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:C.pageY||(C.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}},pointerX:function(C){return Event.pointer(C).x},pointerY:function(C){return Event.pointer(C).y},stop:function(C){Event.extend(C);C.preventDefault();C.stopPropagation();C.stopped=true}}})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize();return B});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(B){if(!B){return false}if(B._extendedByPrototype){return B}B._extendedByPrototype=Prototype.emptyFunction;var C=Event.pointer(B);Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y});return Object.extend(B,A)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,A);return Prototype.K}})();Object.extend(Event,(function(){var B=Event.cache;function C(J){if(J._prototypeEventID){return J._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return J._prototypeEventID=[++arguments.callee.id]}function G(J){if(J&&J.include(":")){return"dataavailable"}return J}function A(J){return B[J]=B[J]||{}}function F(L,J){var K=A(L);return K[J]=K[J]||[]}function H(K,J,L){var O=C(K);var N=F(O,J);if(N.pluck("handler").include(L)){return false}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false}Event.extend(P);L.call(K,P)};M.handler=L;N.push(M);return M}function I(M,J,K){var L=F(M,J);return L.find(function(N){return N.handler==K})}function D(M,J,K){var L=A(M);if(!L[J]){return false}L[J]=L[J].without(I(M,J,K))}function E(){for(var K in B){for(var J in B[K]){B[K][J]=null}}}if(window.attachEvent){window.attachEvent("onunload",E)}return{observe:function(L,J,M){L=$(L);var K=G(J);var N=H(L,J,M);if(!N){return L}if(L.addEventListener){L.addEventListener(K,N,false)}else{L.attachEvent("on"+K,N)}return L},stopObserving:function(L,J,M){L=$(L);var O=C(L),K=G(J);if(!M&&J){F(O,J).each(function(P){if(L&&L.stopObserving){L.stopObserving(J,P.handler)}});return L}else{if(!J){Object.keys(A(O)).each(function(P){L.stopObserving(P)});return L}}var N=I(O,J,M);if(!N){return L}if(L.removeEventListener){L.removeEventListener(K,N,false)}else{L.detachEvent("on"+K,N)}D(O,J,M);return L},fire:function(L,K,J){L=$(L);if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement}var M;if(document.createEvent){M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",true,true)}else{M=document.createEventObject();M.eventType="ondataavailable"}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M)}else{L.fireEvent(M.eventType,M)}return Event.extend(M)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var B;function A(){if(document.loaded){return }if(B){window.clearInterval(B)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){B=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A()}},0);Event.observe(window,"load",A)}else{document.addEventListener("DOMContentLoaded",A,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;A()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{};return Element.clonePosition(C,B,A)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().strip();var D=/\s/.test(E)?$w(E).map(A).join(""):A(E);return D?document._getElementsByXPath(".//*"+D,C):[]}:function(E,F){F=F.toString().strip();var G=[],H=(/\s/.test(F)?$w(F):null);if(!H&&!F){return G}var C=$(E).getElementsByTagName("*");F=" "+F+" ";for(var D=0,J,I;J=C[D];D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){G.push(Element.extend(J))}}return G};return function(D,C){return $(C||document.body).getElementsByClassName(D)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A)},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0})._each(A)},set:function(A){this.element.className=A},add:function(A){if(this.include(A)){return }this.set($A(this).concat(A).join(" "))},remove:function(A){if(!this.include(A)){return }this.set($A(this).without(A).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();

var Scriptaculous={Version:"1.8.1",require:function(A){document.write('<script type="text/javascript" src="'+A+'"><\/script>')},REQUIRED_PROTOTYPE:"1.6.0",load:function(){function A(B){var C=B.split(".");return parseInt(C[0])*100000+parseInt(C[1])*1000+parseInt(C[2])}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(A(Prototype.Version)<A(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE)}$A(document.getElementsByTagName("script")).findAll(function(B){return(B.src&&B.src.match(/scriptaculous\.js(\?.*)?$/))}).each(function(C){var D=C.src.replace(/scriptaculous\.js(\?.*)?$/,"");var B=C.src.match(/\?.*load=([a-z,]*)/);(B?B[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(E){Scriptaculous.require(D+E+".js")})})}};Scriptaculous.load();

String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(C[B]).toColorPart()}while(++B<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;B<4;B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()}}if(this.length==7){A=this.toLowerCase()}}}return(A.length==7?A:(arguments[0]||this))};Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(A,B){return $A($(A).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,B))?Element.collectTextNodesIgnoreClass(C,B):""))}).flatten().join("")};Element.setContentZoom=function(A,B){A=$(A);A.setStyle({fontSize:(B/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return A};Element.getInlineOpacity=function(A){return $(A).style.opacity||""};Element.forceRerendering=function(A){try{A=$(A);var C=document.createTextNode(" ");A.appendChild(C);A.removeChild(C)}catch(B){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5},reverse:function(A){return 1-A},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;return A>1?1:A},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){A=A||5;return(((B%(1/A))*A).round()==0?((B*A*2)-(B*A*2).floor()):1-((B*A*2)-(B*A*2).floor()))},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},none:function(A){return 0},full:function(A){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative";if(Prototype.Browser.IE){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(new Element("span",{style:B}).update(D==" "?String.fromCharCode(160):D),C)});Element.remove(C)}})},multiple:function(B,C){var E;if(((typeof B=="object")||Object.isFunction(B))&&(B.length)){E=B}else{E=$(B).childNodes}var A=Object.extend({speed:0.1,delay:0},arguments[2]||{});var D=A.delay;$A(E).each(function(G,F){new C(G,Object.extend(A,{delay:F*A.speed+D}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,C){B=$(B);C=(C||"appear").toLowerCase();var A=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});Effect[B.visible()?Effect.PAIRS[C][1]:Effect.PAIRS[C][0]](B,A)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(A){this.effects._each(A)},add:function(B){var C=new Date().getTime();var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;switch(A){case"front":this.effects.findAll(function(D){return D.state=="idle"}).each(function(D){D.startOn+=B.finishOn;D.finishOn+=B.finishOn});break;case"with-last":C=this.effects.pluck("startOn").max()||C;break;case"end":C=this.effects.pluck("finishOn").max()||C;break}B.startOn+=C;B.finishOn+=C;if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var C=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(C)}}});Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return }var B=(C-this.startOn)/this.totalTime,A=(B*this.totalFrames).round();if(A>this.currentFrame){this.render(B);this.currentFrame=A}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){var A=$H();for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(C,F,E){C=Object.isString(C)?$(C):C;var B=$A(arguments),D=B.last(),A=B.length==5?B[3]:null;this.method=Object.isFunction(D)?D.bind(C):Object.isFunction(C[D])?C[D].bind(C):function(G){C[D]=G};this.start(Object.extend({from:F,to:E},A||{}))},update:function(A){this.method(A)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var A=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(A)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(A)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})}});Effect.MoveBy=function(B,A,C){return new Effect.Move(B,Object.extend({x:C,y:A},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(B,C){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:C},arguments[2]||{});this.start(A)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var A=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A);this.fontSizeType=B}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType})}this.setDimensions(this.dims[0]*B,this.dims[1]*B)},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(A,D){var E={};if(this.options.scaleX){E.width=D.round()+"px"}if(this.options.scaleY){E.height=A.round()+"px"}if(this.options.scaleFromCenter){var C=(A-this.dims[0])/2;var B=(D-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-C+"px"}if(this.options.scaleX){E.left=this.originalLeft-B+"px"}}else{if(this.options.scaleY){E.top=-C+"px"}if(this.options.scaleX){E.left=-B+"px"}}}this.element.setStyle(E)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(A)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return }this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]}.bind(this))},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,C,D){return B+((this._base[D]+(this._delta[D]*A)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(D){var C=arguments[1]||{},B=document.viewport.getScrollOffsets(),E=$(D).cumulativeOffset(),A=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(C.offset){E[1]+=C.offset}return new Effect.Tween(null,B.top,E[1]>A?A:E[1],C,function(F){scrollTo(B.left,F.round())})};Effect.Fade=function(C){C=$(C);var A=C.getInlineOpacity();var B=Object.extend({from:C.getOpacity()||1,to:0,afterFinishInternal:function(D){if(D.options.to!=0){return }D.element.hide().setStyle({opacity:A})}},arguments[1]||{});return new Effect.Opacity(C,B)};Effect.Appear=function(B){B=$(B);var A=Object.extend({from:(B.getStyle("display")=="none"?0:B.getOpacity()||0),to:1,afterFinishInternal:function(C){C.element.forceRerendering()},beforeSetup:function(C){C.element.setOpacity(C.options.from).show()}},arguments[1]||{});return new Effect.Opacity(B,A)};Effect.Puff=function(B){B=$(B);var A={opacity:B.getInlineOpacity(),position:B.getStyle("position"),top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(C){Position.absolutize(C.effects[0].element)},afterFinishInternal:function(C){C.effects[0].element.hide().setStyle(A)}},arguments[1]||{}))};Effect.BlindUp=function(A){A=$(A);A.makeClipping();return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(B){B=$(B);var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(C){C.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(C){C.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(B){B=$(B);var A=B.getInlineOpacity();return new Effect.Appear(B,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(C){new Effect.Scale(C.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(D){D.element.makePositioned().makeClipping()},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned().setStyle({opacity:A})}})}},arguments[1]||{}))};Effect.DropOut=function(B){B=$(B);var A={top:B.getStyle("top"),left:B.getStyle("left"),opacity:B.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(B,{x:0,y:100,sync:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(C){C.effects[0].element.makePositioned()},afterFinishInternal:function(C){C.effects[0].element.hide().undoPositioned().setStyle(A)}},arguments[1]||{}))};Effect.Shake=function(D){D=$(D);var B=Object.extend({distance:20,duration:0.5},arguments[1]||{});var E=parseFloat(B.distance);var C=parseFloat(B.duration)/10;var A={top:D.getStyle("top"),left:D.getStyle("left")};return new Effect.Move(D,{x:E,y:0,duration:C,afterFinishInternal:function(F){new Effect.Move(F.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(G){new Effect.Move(G.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:-E,y:0,duration:C,afterFinishInternal:function(K){K.element.undoPositioned().setStyle(A)}})}})}})}})}})}})};Effect.SlideDown=function(C){C=$(C).cleanWhitespace();var A=C.down().getStyle("bottom");var B=C.getDimensions();return new Effect.Scale(C,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:A})}},arguments[1]||{}))};Effect.SlideUp=function(C){C=$(C).cleanWhitespace();var A=C.down().getStyle("bottom");var B=C.getDimensions();return new Effect.Scale(C,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:A})}},arguments[1]||{}))};Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){B.element.makeClipping()},afterFinishInternal:function(B){B.element.hide().undoClipping()}})};Effect.Grow=function(C){C=$(C);var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()};var G=C.getDimensions();var H,F;var E,D;switch(B.direction){case"top-left":H=F=E=D=0;break;case"top-right":H=G.width;F=D=0;E=-G.width;break;case"bottom-left":H=E=0;F=G.height;D=-G.height;break;case"bottom-right":H=G.width;F=G.height;E=-G.width;D=-G.height;break;case"center":H=G.width/2;F=G.height/2;E=-G.width/2;D=-G.height/2;break}return new Effect.Move(C,{x:H,y:F,duration:0.01,beforeSetup:function(I){I.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(I){new Effect.Parallel([new Effect.Opacity(I.element,{sync:true,to:1,from:0,transition:B.opacityTransition}),new Effect.Move(I.element,{x:E,y:D,sync:true,transition:B.moveTransition}),new Effect.Scale(I.element,100,{scaleMode:{originalHeight:G.height,originalWidth:G.width},sync:true,scaleFrom:window.opera?1:0,transition:B.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(J){J.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(J){J.effects[0].element.undoClipping().undoPositioned().setStyle(A)}},B))}})};Effect.Shrink=function(C){C=$(C);var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()};var F=C.getDimensions();var E,D;switch(B.direction){case"top-left":E=D=0;break;case"top-right":E=F.width;D=0;break;case"bottom-left":E=0;D=F.height;break;case"bottom-right":E=F.width;D=F.height;break;case"center":E=F.width/2;D=F.height/2;break}return new Effect.Parallel([new Effect.Opacity(C,{sync:true,to:0,from:1,transition:B.opacityTransition}),new Effect.Scale(C,window.opera?1:0,{sync:true,transition:B.scaleTransition,restoreAfterFinish:true}),new Effect.Move(C,{x:E,y:D,sync:true,transition:B.moveTransition})],Object.extend({beforeStartInternal:function(G){G.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(G){G.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)}},B))};Effect.Pulsate=function(C){C=$(C);var B=arguments[1]||{};var A=C.getInlineOpacity();var E=B.transition||Effect.Transitions.sinoidal;var D=function(F){return E(1-Effect.Transitions.pulse(F,B.pulses))};D.bind(E);return new Effect.Opacity(C,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(F){F.element.setStyle({opacity:A})}},B),{transition:D}))};Effect.Fold=function(B){B=$(B);var A={top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};B.makeClipping();return new Effect.Scale(B,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(C){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(D){D.element.hide().undoClipping().setStyle(A)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(C){this.element=$(C);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(A.style)){this.style=$H(A.style)}else{if(A.style.include(":")){this.style=A.style.parseStyle()}else{this.element.addClassName(A.style);this.style=$H(this.element.getStyles());this.element.removeClassName(A.style);var B=this.element.getStyles();this.style=this.style.reject(function(D){return D.value==B[D.key]});A.afterFinishInternal=function(D){D.element.addClassName(D.options.style);D.transforms.each(function(E){D.element.style[E.style]=""})}}}this.start(A)},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff"}B=B.parseColor();return $R(0,2).map(function(C){return parseInt(B.slice(C*2+1,C*2+3),16)})}this.transforms=this.style.map(function(G){var F=G[0],E=G[1],D=null;if(E.parseColor("#zzzzzz")!="#zzzzzz"){E=E.parseColor();D="color"}else{if(F=="opacity"){E=parseFloat(E);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(E)){var C=E.match(/^([\+\-]?[0-9\.]+)(.*)$/);E=parseFloat(C[1]);D=(C.length==3)?C[2]:null}}}var B=this.element.getStyle(F);return{style:F.camelize(),originalValue:D=="color"?A(B):parseFloat(B||0),targetValue:D=="color"?A(E):E,unit:D}}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var D={},B,C=this.transforms.length;while(C--){D[(B=this.transforms[C]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit)}this.element.setStyle(D,true)}});Effect.Transform=Class.create({initialize:function(A){this.tracks=[];this.options=arguments[1]||{};this.addTracks(A)},addTracks:function(A){A.each(function(B){B=$H(B);var C=B.values().first();this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:C}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(A){var D=A.get("ids"),C=A.get("effect"),B=A.get("options");var E=[$(D)||$$(D)].flatten();return E.map(function(F){return new C(F,Object.extend({sync:true},B))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var B,A=$H();if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';B=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(C){if(B[C]){A.set(C,B[C])}});if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return A};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(B){var A=document.defaultView.getComputedStyle($(B),null);return Element.CSS_PROPERTIES.inject({},function(C,D){C[D]=A[D];return C})}}else{Element.getStyles=function(B){B=$(B);var A=B.currentStyle,C;C=Element.CSS_PROPERTIES.inject({},function(D,E){D[E]=A[E];return D});if(!C.opacity){C.opacity=B.getOpacity()}return C}}Effect.Methods={morph:function(A,B){A=$(A);new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A},visualEffect:function(C,E,B){C=$(C);var D=E.dasherize().camelize(),A=D.charAt(0).toUpperCase()+D.substring(1);new Effect[A](C,B);return C},highlight:function(B,A){B=$(B);new Effect.Highlight(B,A);return B}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(C,B){C=$(C);Effect[A.charAt(0).toUpperCase()+A.substring(1)](C,B);return C}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]});Element.addMethods(Effect.Methods);

if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(B,C,A){B=$(B);this.element=B;this.update=$(C);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(A)}else{this.options=A||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(D,E){if(!E.style.position||E.style.position=="absolute"){E.style.position="absolute";Position.clone(D,E,{setHeight:false,offsetTop:D.offsetHeight})}Effect.Appear(E,{duration:0.15})};this.options.onHide=this.options.onHide||function(D,E){new Effect.Fade(E,{duration:0.15})};if(typeof (this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(A){if(this.active){switch(A.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(A);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(A);return ;case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(A);return ;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(A);return }}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return }}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(B){var A=Event.findElement(B,"LI");if(this.index!=A.autocompleteIndex){this.index=A.autocompleteIndex;this.render()}Event.stop(B)},onClick:function(B){var A=Event.findElement(B,"LI");this.index=A.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(A){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var A=0;A<this.entryCount;A++){this.index==A?Element.addClassName(this.getEntry(A),"selected"):Element.removeClassName(this.getEntry(A),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(A){return this.update.firstChild.childNodes[A]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(F){if(this.options.updateElement){this.options.updateElement(F);return }var D="";if(this.options.select){var A=$(F).select("."+this.options.select)||[];if(A.length>0){D=Element.collectTextNodes(A[0],this.options.select)}}else{D=Element.collectTextNodesIgnoreClass(F,"informal")}var C=this.getTokenBounds();if(C[0]!=-1){var E=this.element.value.substr(0,C[0]);var B=this.element.value.substr(C[0]).match(/^\s+/);if(B){E+=B[0]}this.element.value=E+D+this.element.value.substr(C[1])}else{this.element.value=D}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,F)}},updateChoices:function(C){if(!this.changed&&this.hasFocus){this.update.innerHTML=C;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var A=0;A<this.entryCount;A++){var B=this.getEntry(A);B.autocompleteIndex=A;this.addObservers(B)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(A){Event.observe(A,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(A,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var A=this.getTokenBounds();return this.element.value.substring(A[0],A[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var E=this.element.value;if(E.strip().empty()){return[-1,0]}var F=arguments.callee.getFirstDifferencePos(E,this.oldElementValue);var H=(F==this.oldElementValue.length?1:0);var D=-1,C=E.length;var G;for(var B=0,A=this.options.tokens.length;B<A;++B){G=E.lastIndexOf(this.options.tokens[B],F+H-1);if(G>D){D=G}G=E.indexOf(this.options.tokens[B],F+H);if(-1!=G&&G<C){C=G}}return(this.tokenBounds=[D+1,C])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(C,A){var D=Math.min(C.length,A.length);for(var B=0;B<D;++B){if(C[B]!=A[B]){return B}}return D};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(C,D,B,A){this.baseInitialize(C,D,A);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=B},getUpdatedChoices:function(){this.startIndicator();var A=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,A):A;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(A){this.updateChoices(A.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(B,D,C,A){this.baseInitialize(B,D,A);this.options.array=C},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(A){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(B){var D=[];var C=[];var H=B.getToken();var G=0;for(var E=0;E<B.options.array.length&&D.length<B.options.choices;E++){var F=B.options.array[E];var I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase()):F.indexOf(H);while(I!=-1){if(I==0&&F.length!=H.length){D.push("<li><strong>"+F.substr(0,H.length)+"</strong>"+F.substr(H.length)+"</li>");break}else{if(H.length>=B.options.partialChars&&B.options.partialSearch&&I!=-1){if(B.options.fullSearch||/\s/.test(F.substr(I-1,1))){C.push("<li>"+F.substr(0,I)+"<strong>"+F.substr(I,H.length)+"</strong>"+F.substr(I+H.length)+"</li>");break}}}I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase(),I+1):F.indexOf(H,I+1)}}if(C.length){D=D.concat(C.slice(0,B.options.choices-D.length))}return"<ul>"+D.join("")+"</ul>"}},A||{})}});Field.scrollFreeActivate=function(A){setTimeout(function(){Field.activate(A)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(C,B,A){this.url=B;this.element=C=$(C);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(A);Object.extend(this.options,A||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(A){if(!this._editing||A.ctrlKey||A.altKey||A.shiftKey){return }if(Event.KEY_ESC==A.keyCode){this.handleFormCancellation(A)}else{if(Event.KEY_RETURN==A.keyCode){this.handleFormSubmission(A)}}},createControl:function(G,C,B){var E=this.options[G+"Control"];var F=this.options[G+"Text"];if("button"==E){var A=document.createElement("input");A.type="submit";A.value=F;A.className="editor_"+G+"_button";if("cancel"==G){A.onclick=this._boundCancelHandler}this._form.appendChild(A);this._controls[G]=A}else{if("link"==E){var D=document.createElement("a");D.href="#";D.appendChild(document.createTextNode(F));D.onclick="cancel"==G?this._boundCancelHandler:this._boundSubmitHandler;D.className="editor_"+G+"_link";if(B){D.className+=" "+B}this._form.appendChild(D);this._controls[G]=D}}},createEditField:function(){var C=(this.options.loadTextURL?this.options.loadingText:this.getText());var B;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){B=document.createElement("input");B.type="text";var A=this.options.size||this.options.cols||0;if(0<A){B.size=A}}else{B=document.createElement("textarea");B.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);B.cols=this.options.cols||40}B.name=this.options.paramName;B.value=C;B.className="editor_field";if(this.options.submitOnBlur){B.onblur=this._boundSubmitHandler}this._controls.editor=B;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var B=this;function A(D,E){var C=B.options["text"+D+"Controls"];if(!C||E===false){return }B._form.appendChild(document.createTextNode(C))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}A("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);A("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");A("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(A){if(this._saving||this._editing){return }this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(A){Event.stop(A)}},enterHover:function(A){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return }this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML},handleAJAXFailure:function(A){this.triggerCallback("onFailure",A);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(A){this.wrapUp();if(A){Event.stop(A)}},handleFormSubmission:function(D){var B=this._form;var C=$F(this._controls.editor);this.prepareSubmission();var E=this.options.callback(B,C)||"";if(Object.isString(E)){E=E.toQueryParams()}E.editorId=this.element.id;if(this.options.htmlResponse){var A=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(A,{parameters:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,A)}else{var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,A)}if(D){Event.stop(D)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(A){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return }this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(C){this._form.removeClassName(this.options.loadingClassName);var B=C.responseText;if(this.options.stripLoadedTextTags){B=B.stripTags()}this._controls.editor.value=B;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,A)},postProcessEditField:function(){var A=this.options.fieldPostCreation;if(A){$(this._controls.editor)["focus"==A?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(A){Object.extend(this.options,A)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var A;$H(Ajax.InPlaceEditor.Listeners).each(function(B){A=this[B.value].bind(this);this._listeners[B.key]=A;if(!this.options.externalControlOnly){this.element.observe(B.key,A)}if(this.options.externalControl){this.options.externalControl.observe(B.key,A)}}.bind(this))},removeForm:function(){if(!this._form){return }this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(B,A){if("function"==typeof this.options[B]){this.options[B](this,A)}},unregisterListeners:function(){$H(this._listeners).each(function(A){if(!this.options.externalControlOnly){this.element.stopObserving(A.key,A.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(A.key,A.value)}}.bind(this))},wrapUp:function(A){this.leaveEditMode();this._boundComplete(A,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,C,B,A){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(C,B,A)},createEditField:function(){var A=document.createElement("select");A.name=this.options.paramName;A.size=1;this._controls.editor=A;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw"Server returned an invalid collection representation."}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(B){this._controls.editor.disabled=true;var A=this._controls.editor.firstChild;if(!A){A=document.createElement("option");A.value="";this._controls.editor.appendChild(A);A.selected=true}A.update((B||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(B){this._text=B.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,A)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(D){return 2===D.length?D:[D,D].flatten()});var B=("value" in this.options)?this.options.value:this._text;var A=this._collection.any(function(D){return D[0]==B}.bind(this));this._controls.editor.update("");var C;this._collection.each(function(E,D){C=document.createElement("option");C.value=E[0];C.selected=A?E[0]==B:0==D;C.appendChild(document.createTextNode(E[1]));this._controls.editor.appendChild(C)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(A){if(!A){return }function B(C,D){if(C in A||D===undefined){return }A[C]=D}B("cancelControl",(A.cancelLink?"link":(A.cancelButton?"button":A.cancelLink==A.cancelButton==false?false:undefined)));B("okControl",(A.okLink?"link":(A.okButton?"button":A.okLink==A.okButton==false?false:undefined)));B("highlightColor",A.highlightcolor);B("highlightEndColor",A.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(A){return Form.serialize(A)},onComplete:function(B,A){new Effect.Highlight(A,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(A){A.element.style.backgroundColor=A.options.highlightColor;if(A._effect){A._effect.cancel()}},onFailure:function(B,A){alert("Error communication with the server: "+B.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(A){A._effect=new Effect.Highlight(A.element,{startcolor:A.options.highlightColor,endcolor:A.options.highlightEndColor,restorecolor:A._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(B,A,C){this.delay=A||0.5;this.element=$(B);this.callback=C;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(A){if(this.lastValue==$F(this.element)){return }if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});

function jiveToggleTab(E,F){var D=$(E);if(D){var A=$(D.id+"-tab")}if(D&&D.style.display=="none"){if(A){A.className="jive-body-tab jive-body-tabcurrent";D.style.display="block"}for(var C=0;C<F.length;C++){var G=$(F[C]);if(G){var B=$(G.id+"-tab")}if(B){B.className="jive-body-tab";G.style.display="none"}}}}function jiveToggleOptions(A){if($(A+"-form").style.display!="none"){Element.hide(A+"-form");$(A+"-hdr").className="jive-compose-hdr-opt-closed"}else{$(A+"-form").style.display="block";$(A+"-hdr").className="jive-compose-hdr-opt"}}function jiveShowTopicFilter(A){if($(A).style.display!="none"){Element.toggle($(A))}else{Element.toggle($(A))}}function jiveToggleSpaceDetails(A){Element.toggle($(A));if($(A).style.display!="none"){$(A+"-less").style.display="";$(A+"-more").style.display="none"}else{$(A+"-more").style.display="";$(A+"-less").style.display="none"}}function jiveToggleSpaceDetails2(A){if($(A).className=="jive-space-namedesc-full"){$(A).className="";$(A+"-more").style.display="";$(A+"-less").style.display="none"}else{$(A).className="jive-space-namedesc-full";$(A+"-less").style.display="";$(A+"-more").style.display="none"}}function callOnLoad(A){if(window.addEventListener){window.addEventListener("load",A,false)}else{if(window.attachEvent){window.attachEvent("onload",A)}else{window.onload=A}}}Jive=Class.create();Jive.AlertMessage=function(B){var A=arguments[1]||{};new Effect.Appear(B,{queue:"front",scope:B,duration:1,beforeStart:A.beforeStart,afterFinish:function(C){new Pause(1);new Effect.Fade(B,{queue:"end",scope:C,duration:1,afterFinish:A.afterFinish})}})};function Pause(B,A){this.duration=B*1000;this.busywork=null;this.runner=0;if(arguments.length==2){this.busywork=A}this.pause(this.duration)}Pause.prototype.pause=function(B){if((B==null)||(B<0)){return }var A=(new Date()).getTime()+B;while(true){if((new Date()).getTime()>A){break}this.runner++;if(this.busywork!=null){this.busywork(this.runner)}}};var TimeoutExecutor=Class.create();TimeoutExecutor.prototype={initialize:function(B,A){this.callback=B;this.timeout=A;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timeoutID=setTimeout(this.onTimerEvent.bind(this),this.timeout)},onTimerEvent:function(){try{this.currentlyExecuting=true;if(this.callback&&this.callback instanceof Function){this.callback()}}finally{this.currentlyExecuting=false;delete this.timeoutID}},cancel:function(){if(!this.currentlyExecuting&&this.timeoutID){clearTimeout(this.timeoutID);delete this.timeoutID}},reset:function(){if(!this.currentlyExecuting&&this.timeoutID){clearTimeout(this.timeoutID);delete this.timeoutID;this.registerCallback()}}};var QuickUserProfile=Class.create();QuickUserProfile.prototype={initialize:function(D,C,B,A){this.loadingContent='<strong class="jive-tooltip2-loading">'+B+"</strong>";this.userTT=D;this.userTTURL=C.indexOf("?")<0?C+"?tooltip=true":C+"&tooltip=true";this.textErrorTT=A;this.jiveUserTips=new SuperNote("jiveTT",{showDelay:700,hideDelay:30,cssProp:"visibility",cssVis:"visible",cssHid:"hidden"})},getUserProfileTooltip:function(A){this.cancelTooltip();$(this.userTT).innerHTML=this.loadingContent;this.timeoutExecutor=new TimeoutExecutor(this.getUserProfile.bind(this,A),700)},getUserProfile:function(B){var A=this;new Ajax.Updater(this.userTT,this.userTTURL,{method:"get",parameters:{targetUser:B},onError:function(){$(this.userTT).innerHTML=A.textTTError}})},cancelTooltip:function(){if(this.timeoutExecutor){this.timeoutExecutor.cancel()}}};

if(!window.Zapatec||(Zapatec&&!Zapatec.include)){alert("You need to include zapatec.js file!")}else{Zapatec.calendarPath=Zapatec.getPath("Zapatec.CalendarWidget")}window.calendar=null;Zapatec.Calendar=function(C,B,E,A){this.bShowHistoryEvent=false;this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=E||null;this.onClose=A||null;this.onFDOW=null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.minMonth=0;this.maxMonth=11;this.dateFormat=Zapatec.Calendar.i18n("DEF_DATE_FORMAT");this.ttDateFormat=Zapatec.Calendar.i18n("TT_DATE_FORMAT");this.historyDateFormat="%B %d, %Y";this.isPopup=true;this.weekNumbers=true;this.noGrab=false;if(Zapatec.Calendar.prefs.fdow||(Zapatec.Calendar.prefs.fdow==0)){this.firstDayOfWeek=parseInt(Zapatec.Calendar.prefs.fdow,10)}else{var D=0;if(typeof C=="number"){D=C}else{if(typeof Zapatec.Calendar._FD=="number"){D=Zapatec.Calendar._FD}}this.firstDayOfWeek=D}this.showsOtherMonths=false;this.dateStr=B;this.showsTime=false;this.sortOrder="asc";this.time24=true;this.timeInterval=null;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=new Array();this.firstdayname=null;this.monthsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.yearsCombo=null;this.hilitedYear=null;this.activeYear=null;this.histCombo=null;this.hilitedHist=null;this.dateClicked=false;this.numberMonths=1;this.controlMonth=1;this.vertical=false;this.monthsInRow=1;this.titles=new Array();this.rowsOfDayNames=new Array();this.helpButton=true;this.disableFdowClick=true;this.disableDrag=false;this.yearNav=true;this.closeButton=true;Zapatec.Calendar._initSDN()};Zapatec.Calendar._initSDN=function(){if(typeof Zapatec.Calendar._TT._SDN=="undefined"){if(typeof Zapatec.Calendar._TT._SDN_len=="undefined"){Zapatec.Calendar._TT._SDN_len=3}var A=[];for(var B=8;B>0;){A[--B]=Zapatec.Calendar._TT._DN[B].substr(0,Zapatec.Calendar._TT._SDN_len)}Zapatec.Calendar._TT._SDN=A;if(typeof Zapatec.Calendar._TT._SMN_len=="undefined"){Zapatec.Calendar._TT._SMN_len=3}A=[];for(var B=12;B>0;){A[--B]=Zapatec.Calendar._TT._MN[B].substr(0,Zapatec.Calendar._TT._SMN_len)}Zapatec.Calendar._TT._SMN=A}if(typeof Zapatec.Calendar._TT._AMPM=="undefined"){Zapatec.Calendar._TT._AMPM={am:"am",pm:"pm"}}};Zapatec.Calendar.i18n=function(C,A){var B="";if(!A){if(Zapatec.Calendar._TT){B=Zapatec.Calendar._TT[C]}if(!B&&Zapatec.Calendar._TT_en){B=Zapatec.Calendar._TT_en[C]}}else{switch(A){case"dn":B=Zapatec.Calendar._TT._DN[C];break;case"sdn":B=Zapatec.Calendar._TT._SDN[C];break;case"mn":B=Zapatec.Calendar._TT._MN[C];break;case"smn":B=Zapatec.Calendar._TT._SMN[C];break;case"ampm":B=Zapatec.Calendar._TT._AMPM[C];break}}if(!B){B=""+C}return B};Zapatec.Calendar._C=null;Zapatec.Calendar.prefs={fdow:null,history:"",sortOrder:"asc",hsize:9};Zapatec.Calendar.savePrefs=function(){Zapatec.Utils.writeCookie("ZP_CAL",Zapatec.Utils.makePref(this.prefs),null,"/",30)};Zapatec.Calendar.loadPrefs=function(){var A=Zapatec.Utils.getCookie("ZP_CAL"),B;if(A){B=Zapatec.Utils.loadPref(A);if(B){Zapatec.Utils.mergeObjects(this.prefs,B)}}};Zapatec.Calendar._add_evs=function(A){var B=Zapatec.Calendar;Zapatec.Utils.addEvent(A,"mouseover",B.dayMouseOver);Zapatec.Utils.addEvent(A,"mousedown",B.dayMouseDown);Zapatec.Utils.addEvent(A,"mouseout",B.dayMouseOut);if(Zapatec.is_ie){Zapatec.Utils.addEvent(A,"dblclick",B.dayMouseDblClick)}};Zapatec.Calendar._del_evs=function(A){var B=this;Zapatec.Utils.removeEvent(A,"mouseover",B.dayMouseOver);Zapatec.Utils.removeEvent(A,"mousedown",B.dayMouseDown);Zapatec.Utils.removeEvent(A,"mouseout",B.dayMouseOut);if(Zapatec.is_ie){Zapatec.Utils.removeEvent(A,"dblclick",B.dayMouseDblClick)}};Zapatec.Calendar.findMonth=function(A){if(typeof A.month!="undefined"){return A}else{if(A.parentNode&&typeof A.parentNode.month!="undefined"){return A.parentNode}}return null};Zapatec.Calendar.findHist=function(A){if(typeof A.histDate!="undefined"){return A}else{if(A.parentNode&&typeof A.parentNode.histDate!="undefined"){return A.parentNode}}return null};Zapatec.Calendar.findYear=function(A){if(typeof A.year!="undefined"){return A}else{if(A.parentNode&&typeof A.parentNode.year!="undefined"){return A.parentNode}}return null};Zapatec.Calendar.showMonthsCombo=function(){var B=Zapatec.Calendar._C;if(!B){return false}var D=B.activeDiv;var J=B.monthsCombo;var F=B.date,K=B.date.getMonth(),C=B.date.getFullYear(),G=(C==B.minYear),I=(C==B.maxYear);for(var H=J.firstChild;H;H=H.nextSibling){var E=H.month;Zapatec.Utils.removeClass(H,"hilite");Zapatec.Utils.removeClass(H,"active");Zapatec.Utils.removeClass(H,"disabled");H.disabled=false;if((G&&E<B.minMonth)||(I&&E>B.maxMonth)){Zapatec.Utils.addClass(H,"disabled");H.disabled=true}if(E==K){Zapatec.Utils.addClass(B.activeMonth=H,"active")}}var L=J.style;L.display="block";if(D.navtype<0){L.left=D.offsetLeft+"px"}else{var A=J.offsetWidth;if(typeof A=="undefined"){A=50}L.left=(D.offsetLeft+D.offsetWidth-A)+"px"}L.top=(D.offsetTop+D.offsetHeight)+"px";B.updateWCH(J)};Zapatec.Calendar.showHistoryCombo=function(){var B=Zapatec.Calendar._C,H,F,D,C,G,I,E,A;if(!B){return false}G=B.histCombo;while(G.firstChild){G.removeChild(G.lastChild)}if(Zapatec.Calendar.prefs.history){H=Zapatec.Calendar.prefs.history.split(/,/);D=0;while(E=H[D++]){E=E.split(/\//);F=Zapatec.Utils.createElement("div");F.className=Zapatec.is_ie?"label-IEfix":"label";F.histDate=new Date(parseInt(E[0],10),parseInt(E[1],10)-1,parseInt(E[2],10),E[3]?parseInt(E[3],10):0,E[4]?parseInt(E[4],10):0);F.appendChild(window.document.createTextNode(F.histDate.print(B.historyDateFormat)));G.appendChild(F);if(F.histDate.dateEqualsTo(B.date)){Zapatec.Utils.addClass(F,"active")}}}C=B.activeDiv;I=G.style;I.display="block";I.left=Math.floor(C.offsetLeft+(C.offsetWidth-G.offsetWidth)/2)+"px";I.top=(C.offsetTop+C.offsetHeight)+"px";B.updateWCH(G);B.bEventShowHistory=true};Zapatec.Calendar.showYearsCombo=function(D){var A=Zapatec.Calendar._C;if(!A){return false}var C=A.activeDiv;var F=A.yearsCombo;if(A.hilitedYear){Zapatec.Utils.removeClass(A.hilitedYear,"hilite")}if(A.activeYear){Zapatec.Utils.removeClass(A.activeYear,"active")}A.activeYear=null;var B=A.date.getFullYear()+(D?1:-1);var I=F.firstChild;var H=false;for(var E=12;E>0;--E){if(B>=A.minYear&&B<=A.maxYear){I.firstChild.data=B;I.year=B;I.style.display="block";H=true}else{I.style.display="none"}I=I.nextSibling;B+=D?A.yearStep:-A.yearStep}if(H){var J=F.style;J.display="block";if(C.navtype<0){J.left=C.offsetLeft+"px"}else{var G=F.offsetWidth;if(typeof G=="undefined"){G=50}J.left=(C.offsetLeft+C.offsetWidth-G)+"px"}J.top=(C.offsetTop+C.offsetHeight)+"px"}A.updateWCH(F)};Zapatec.Calendar.tableMouseUp=function(E){var H=Zapatec.Calendar._C;if(!H){return false}if(H.timeout){clearTimeout(H.timeout)}var D=H.activeDiv;if(!D){return false}var G=Zapatec.Utils.getTargetElement(E);if(typeof (D.navtype)=="undefined"){while(G&&!G.calendar){G=G.parentNode}}E||(E=window.event);Zapatec.Utils.removeClass(D,"active");if(G==D||G.parentNode==D){Zapatec.Calendar.cellClick(D,E)}var C=Zapatec.Calendar.findMonth(G);var A=null;if(C){if(!C.disabled){A=new Date(H.date);if(C.month!=A.getMonth()){A.setMonth(C.month);H.setDate(A,true);H.dateClicked=false;H.callHandler()}}}else{var B=Zapatec.Calendar.findYear(G);if(B){A=new Date(H.date);if(B.year!=A.getFullYear()){A.setFullYear(B.year);H.setDate(A,true);H.dateClicked=false;H.callHandler()}}else{var F=Zapatec.Calendar.findHist(G);if(F&&!F.histDate.dateEqualsTo(H.date)){A=new Date(F.histDate);H._init(H.firstDayOfWeek,H.date=A);H.dateClicked=false;H.callHandler();H.updateHistory()}}}Zapatec.Utils.removeEvent(window.document,"mouseup",Zapatec.Calendar.tableMouseUp);Zapatec.Utils.removeEvent(window.document,"mouseover",Zapatec.Calendar.tableMouseOver);Zapatec.Utils.removeEvent(window.document,"mousemove",Zapatec.Calendar.tableMouseOver);H._hideCombos();Zapatec.Calendar._C=null;return Zapatec.Utils.stopEvent(E)};Zapatec.Calendar.tableMouseOver=function(U){var M=Zapatec.Calendar._C;if(!M){return }var D=M.activeDiv;var W=Zapatec.Utils.getTargetElement(U);if(W==D||W.parentNode==D){Zapatec.Utils.addClass(D,"hilite active");Zapatec.Utils.addClass(D.parentNode,"rowhilite")}else{if(typeof D.navtype=="undefined"||(D.navtype!=50&&((D.navtype==0&&!M.histCombo)||Math.abs(D.navtype)>2))){Zapatec.Utils.removeClass(D,"active")}Zapatec.Utils.removeClass(D,"hilite");Zapatec.Utils.removeClass(D.parentNode,"rowhilite")}U||(U=window.event);if(D.navtype==50&&W!=D){var G=Zapatec.Utils.getAbsolutePos(D);var J=D.offsetWidth;var I=U.clientX;var L;var A=true;if(I>G.x+J){L=I-G.x-J;A=false}else{L=G.x-I}if(L<0){L=0}var N=D._range;var P=D._current;var V=M.currentDate;var T=(V.getHours()>=12);var B=D.firstChild.data;var H=Math.floor(L/10)%N.length;for(var S=N.length;--S>=0;){if(N[S]==P){break}}while(H-->0){if(A){if(--S<0){S=N.length-1}}else{if(++S>=N.length){S=0}}}if(M.getDateStatus){var O=null;var F=null;var C=new Date(V);if(D.className.indexOf("ampm",0)!=-1){O=V.getMinutes();if(B!=N[S]){F=(N[S]==Zapatec.Calendar.i18n("pm","ampm"))?((V.getHours()==0)?(12):(V.getHours()+12)):(V.getHours()-12)}else{F=V.getHours()}C.setHours(F)}if(D.className.indexOf("hour",0)!=-1){O=V.getMinutes();F=(!M.time24)?((T)?((N[S]!=12)?(parseInt(N[S],10)+12):(12)):((N[S]!=12)?(N[S]):(0))):(N[S]);C.setHours(F)}if(D.className.indexOf("minute",0)!=-1){F=V.getHours();O=N[S];C.setMinutes(O)}}var Q=false;if(M.getDateStatus){Q=M.getDateStatus(C,V.getFullYear(),V.getMonth(),V.getDate(),parseInt(F,10),parseInt(O,10))}if(Q==false){if(!((!M.time24)&&(N[S]==Zapatec.Calendar.i18n("pm","ampm"))&&(F>23))){D.firstChild.data=N[S]}}M.onUpdateTime()}var R=Zapatec.Calendar.findMonth(W);if(R){if(!R.disabled){if(R.month!=M.date.getMonth()){if(M.hilitedMonth){Zapatec.Utils.removeClass(M.hilitedMonth,"hilite")}Zapatec.Utils.addClass(R,"hilite");M.hilitedMonth=R}else{if(M.hilitedMonth){Zapatec.Utils.removeClass(M.hilitedMonth,"hilite")}}}}else{if(M.hilitedMonth){Zapatec.Utils.removeClass(M.hilitedMonth,"hilite")}var K=Zapatec.Calendar.findYear(W);if(K){if(K.year!=M.date.getFullYear()){if(M.hilitedYear){Zapatec.Utils.removeClass(M.hilitedYear,"hilite")}Zapatec.Utils.addClass(K,"hilite");M.hilitedYear=K}else{if(M.hilitedYear){Zapatec.Utils.removeClass(M.hilitedYear,"hilite")}}}else{if(M.hilitedYear){Zapatec.Utils.removeClass(M.hilitedYear,"hilite")}var E=Zapatec.Calendar.findHist(W);if(E){if(!E.histDate.dateEqualsTo(M.date)){if(M.hilitedHist){Zapatec.Utils.removeClass(M.hilitedHist,"hilite")}Zapatec.Utils.addClass(E,"hilite");M.hilitedHist=E}else{if(M.hilitedHist){Zapatec.Utils.removeClass(M.hilitedHist,"hilite")}}}else{if(M.hilitedHist){Zapatec.Utils.removeClass(M.hilitedHist,"hilite")}}}}return Zapatec.Utils.stopEvent(U)};Zapatec.Calendar.tableMouseDown=function(A){if(Zapatec.Utils.getTargetElement(A)==Zapatec.Utils.getElement(A)){return Zapatec.Utils.stopEvent(A)}};Zapatec.Calendar.calDragIt=function(D){D||(D=window.event);var E=Zapatec.Calendar._C;if(!E){Zapatec.Calendar.calDragEnd()}if(!E.disableDrag){if(!(E&&E.dragging)){return false}var G=D.clientX+window.document.body.scrollLeft;var F=D.clientY+window.document.body.scrollTop;E.hideShowCovered();var C=E.element.style,A=G-E.xOffs,B=F-E.yOffs;C.left=A+"px";C.top=B+"px";Zapatec.Utils.setupWCH(E.WCH,A,B)}return Zapatec.Utils.stopEvent(D)};Zapatec.Calendar.calDragEnd=function(A){var B=Zapatec.Calendar._C;Zapatec.Utils.removeEvent(window.document,"mousemove",Zapatec.Calendar.calDragIt);Zapatec.Utils.removeEvent(window.document,"mouseover",Zapatec.Calendar.calDragIt);Zapatec.Utils.removeEvent(window.document,"mouseup",Zapatec.Calendar.calDragEnd);if(!B){return false}B.dragging=false;Zapatec.Calendar.tableMouseUp(A);B.hideShowCovered()};Zapatec.Calendar.dayMouseDown=function(C){var A=true;var B=Zapatec.Utils.getElement(C);if(B.className.indexOf("disabled")!=-1||B.className.indexOf("true")!=-1){return false}var D=B.calendar;while(!D){B=B.parentNode;D=B.calendar}D.bEventShowHistory=false;D.activeDiv=B;Zapatec.Calendar._C=D;if(B.navtype!=300){if(B.navtype==50){if(!((D.timeInterval==null)||((D.timeInterval<60)&&(B.className.indexOf("hour",0)!=-1)))){A=false}B._current=B.firstChild.data;if(A){Zapatec.Utils.addEvent(window.document,"mousemove",Zapatec.Calendar.tableMouseOver)}}else{if(((B.navtype==201)||(B.navtype==202))&&(D.timeInterval>30)&&(B.timePart.className.indexOf("minute",0)!=-1)){A=false}if(A){Zapatec.Utils.addEvent(window.document,Zapatec.is_ie5?"mousemove":"mouseover",Zapatec.Calendar.tableMouseOver)}}if(A){Zapatec.Utils.addClass(B,"hilite active")}Zapatec.Utils.addEvent(window.document,"mouseup",Zapatec.Calendar.tableMouseUp)}else{if(D.isPopup){D._dragStart(C)}else{Zapatec.Calendar._C=null}}if(B.navtype==-1||B.navtype==1){if(D.timeout){clearTimeout(D.timeout)}D.timeout=setTimeout("Zapatec.Calendar.showMonthsCombo()",250)}else{if(B.navtype==-2||B.navtype==2){if(D.timeout){clearTimeout(D.timeout)}D.timeout=setTimeout((B.navtype>0)?"Zapatec.Calendar.showYearsCombo(true)":"Zapatec.Calendar.showYearsCombo(false)",250)}else{if(B.navtype==0&&Zapatec.Calendar.prefs.history){if(D.timeout){clearTimeout(D.timeout)}D.timeout=setTimeout("Zapatec.Calendar.showHistoryCombo()",250)}else{D.timeout=null}}}return Zapatec.Utils.stopEvent(C)};Zapatec.Calendar.dayMouseDblClick=function(A){Zapatec.Calendar.cellClick(Zapatec.Utils.getElement(A),A||window.event);if(Zapatec.is_ie){window.document.selection.empty()}};Zapatec.Calendar.dayMouseOver=function(D){var C=Zapatec.Utils.getElement(D),A=C.caldate;while(!C.calendar){C=C.parentNode;A=C.caldate}var E=C.calendar;var B=C.timePart;if(A){A=new Date(A[0],A[1],A[2]);if(A.getDate()!=C.caldate[2]){A.setDate(C.caldate[2])}}if(Zapatec.Utils.isRelated(C,D)||Zapatec.Calendar._C||C.className.indexOf("disabled")!=-1||C.className.indexOf("true")!=-1){return false}if(C.ttip){if(C.ttip.substr(0,1)=="_"){C.ttip=A.print(C.calendar.ttDateFormat)+C.ttip.substr(1)}C.calendar.showHint(C.ttip)}if(C.navtype!=300){if(!((E.timeInterval==null)||(C.className.indexOf("ampm",0)!=-1)||((E.timeInterval<60)&&(C.className.indexOf("hour",0)!=-1)))&&(C.navtype==50)){return Zapatec.Utils.stopEvent(D)}if(((C.navtype==201)||(C.navtype==202))&&(E.timeInterval>30)&&(B.className.indexOf("minute",0)!=-1)){return Zapatec.Utils.stopEvent(D)}Zapatec.Utils.addClass(C,"hilite");if(A){Zapatec.Utils.addClass(C.parentNode,"rowhilite")}}return Zapatec.Utils.stopEvent(D)};Zapatec.Calendar.dayMouseOut=function(B){var A=Zapatec.Utils.getElement(B);while(!A.calendar){A=A.parentNode;caldate=A.caldate}if(Zapatec.Utils.isRelated(A,B)||Zapatec.Calendar._C||A.className.indexOf("disabled")!=-1||A.className.indexOf("true")!=-1){return false}Zapatec.Utils.removeClass(A,"hilite");if(A.caldate){Zapatec.Utils.removeClass(A.parentNode,"rowhilite")}if(A.calendar){A.calendar.showHint(Zapatec.Calendar.i18n("SEL_DATE"))}return Zapatec.Utils.stopEvent(B)};Zapatec.Calendar.cellClick=function(C,U){var K=C.calendar;var G=false;var B=false;var V=null;while(!K){C=C.parentNode;K=C.calendar}if(C.className.indexOf("disabled")!=-1||C.className.indexOf("true")!=-1){return false}if(typeof C.navtype=="undefined"){if(K.currentDateEl){Zapatec.Utils.removeClass(K.currentDateEl,"selected");Zapatec.Utils.addClass(C,"selected");G=(K.currentDateEl==C);if(!G){K.currentDateEl=C}}var D=new Date(C.caldate[0],C.caldate[1],C.caldate[2]);if(D.getDate()!=C.caldate[2]){D.setDate(C.caldate[2])}K.date.setDateOnly(D);K.currentDate.setDateOnly(D);V=K.date;K.dateClicked=true;if(K.multiple){K._toggleMultipleDate(new Date(V))}B=true;if(C.otherMonth){K._init(K.firstDayOfWeek,V)}K.onSetTime()}else{if(C.navtype==200){Zapatec.Utils.removeClass(C,"hilite");K.callCloseHandler();return }V=new Date(K.date);if(C.navtype==0&&!K.bEventShowHistory){V.setDateOnly(new Date())}K.dateClicked=false;var J=V.getFullYear();var Q=V.getMonth();function I(Y){var Z=V.getDate();var X=V.getMonthDays(Y);if(Z>X){V.setDate(X)}V.setMonth(Y)}switch(C.navtype){case 400:Zapatec.Utils.removeClass(C,"hilite");var L=Zapatec.Calendar.i18n("ABOUT");if(typeof L!="undefined"){L+=K.showsTime?Zapatec.Calendar.i18n("ABOUT_TIME"):""}else{L='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <support@zapatec.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://www.zapatec.com\n'}alert(L);return ;case -2:if(J>K.minYear){V.setFullYear(J-1)}break;case -1:if(Q>0){I(Q-1)}else{if(J-->K.minYear){V.setFullYear(J);I(11)}}break;case 1:if(Q<11){I(Q+1)}else{if(J<K.maxYear){V.setFullYear(J+1);I(0)}}break;case 2:if(J<K.maxYear){V.setFullYear(J+1)}break;case 100:K.setFirstDayOfWeek(C.fdow);Zapatec.Calendar.prefs.fdow=K.firstDayOfWeek;Zapatec.Calendar.savePrefs();if(K.onFDOW){K.onFDOW(K.firstDayOfWeek)}return ;case 50:var V=K.currentDate;if(C.className.indexOf("ampm",0)>=0){}else{if(!((K.timeInterval==null)||((K.timeInterval<60)&&(C.className.indexOf("hour",0)!=-1)))){break}}var M=C._range;var O=C.firstChild.data;var S=(V.getHours()>=12);for(var R=M.length;--R>=0;){if(M[R]==O){break}}if(U&&U.shiftKey){if(--R<0){R=M.length-1}}else{if(++R>=M.length){R=0}}if(K.getDateStatus){var N=null;var F=null;var A=new Date(V);if(C.className.indexOf("ampm",0)!=-1){N=V.getMinutes();F=(M[R]==Zapatec.Calendar.i18n("pm","ampm"))?((V.getHours()==12)?(V.getHours()):(V.getHours()+12)):(V.getHours()-12);if(K.getDateStatus&&K.getDateStatus(A,V.getFullYear(),V.getMonth(),V.getDate(),parseInt(F,10),parseInt(N,10))){var H;if(M[R]==Zapatec.Calendar.i18n("pm","ampm")){H=-5}else{H=5}hours=F;minutes=N;do{minutes+=H;if(minutes>=60){minutes-=60;++hours;if(hours>=24){hours-=24}A.setHours(hours)}if(minutes<0){minutes+=60;--hours;if(hours<0){hours+=24}A.setHours(hours)}A.setMinutes(minutes);if(!K.getDateStatus(A,V.getFullYear(),V.getMonth(),V.getDate(),parseInt(hours,10),parseInt(minutes,10))){F=hours;N=minutes;if(F>12){R=1}else{R=0}K.date.setHours(F);K.date.setMinutes(N);K.onSetTime()}}while((F!=hours)||(N!=minutes))}A.setHours(F)}if(C.className.indexOf("hour",0)!=-1){N=V.getMinutes();F=(!K.time24)?((S)?((M[R]!=12)?(parseInt(M[R],10)+12):(12)):((M[R]!=12)?(M[R]):(0))):(M[R]);A.setHours(F)}if(C.className.indexOf("minute",0)!=-1){F=V.getHours();N=M[R];A.setMinutes(N)}}var P=false;if(K.getDateStatus){P=K.getDateStatus(A,V.getFullYear(),V.getMonth(),V.getDate(),parseInt(F,10),parseInt(N,10))}if(!P){C.firstChild.data=M[R]}K.onUpdateTime();return ;case 201:case 202:var T=C.timePart;var V=K.currentDate;if((T.className.indexOf("minute",0)!=-1)&&(K.timeInterval>30)){break}var W=parseInt(T.firstChild.data,10);var S=(V.getHours()>=12);var M=T._range;for(var R=M.length;--R>=0;){if(W==M[R]){W=R;break}}var E=T._step;if(C.navtype==201){W=E*Math.floor(W/E);W+=E;if(W>=M.length){W=0}}else{W=E*Math.ceil(W/E);W-=E;if(W<0){W=M.length-E}}if(K.getDateStatus){var N=null;var F=null;var A=new Date(V);if(T.className=="hour"){N=V.getMinutes();F=(!K.time24)?((S)?((M[W]!=12)?(parseInt(M[W],10)+12):(12)):((M[W]!=12)?(M[W]):(0))):(M[W]);A.setHours(F)}if(T.className=="minute"){F=V.getHours();N=W;A.setMinutes(M[W])}}var P=false;if(K.getDateStatus){P=K.getDateStatus(A,V.getFullYear(),V.getMonth(),V.getDate(),parseInt(F,10),parseInt(N,10))}if(!P){T.firstChild.data=M[W]}K.onUpdateTime();return ;case 0:if(K.getDateStatus&&((K.getDateStatus(V,V.getFullYear(),V.getMonth(),V.getDate())==true)||(K.getDateStatus(V,V.getFullYear(),V.getMonth(),V.getDate())=="disabled"))){return false}break}if(!V.equalsTo(K.date)){if((C.navtype>=-2&&C.navtype<=2)&&(C.navtype!=0)){K._init(K.firstDayOfWeek,V,true);return }K.setDate(V);B=!(C.navtype&&(C.navtype>=-2&&C.navtype<=2))}}if(B){K.callHandler()}if(G){Zapatec.Utils.removeClass(C,"hilite");K.callCloseHandler()}};Zapatec.Calendar.prototype.create=function(K){var G=null;if(!K){G=window.document.getElementsByTagName("body")[0];this.isPopup=true;this.WCH=Zapatec.Utils.createWCH()}else{G=K;this.isPopup=false}this.currentDate=this.date=this.dateStr?new Date(this.dateStr):new Date();var T=Zapatec.Utils.createElement("table");this.table=T;T.cellSpacing=0;T.cellPadding=0;Zapatec.Utils.createProperty(T,"calendar",this);Zapatec.Utils.addEvent(T,"mousedown",Zapatec.Calendar.tableMouseDown);var J=Zapatec.Utils.createElement("div");this.element=J;J.className="calendar";if(Zapatec.is_opera){T.style.width=(this.monthsInRow*((this.weekNumbers)?(8):(7))*2+4.4*this.monthsInRow)+"em"}if(this.isPopup){J.style.position="absolute";J.style.display="none"}J.appendChild(T);var C=null;var F=null;var I=this;var D=function(Y,X,W){C=Zapatec.Utils.createElement("td",F);C.colSpan=X;C.className="button";if(Math.abs(W)<=2){C.className+=" nav"}Zapatec.Calendar._add_evs(C);Zapatec.Utils.createProperty(C,"calendar",I);C.navtype=W;if(Y.substr(0,1)!="&"){C.appendChild(document.createTextNode(Y))}else{C.innerHTML=Y}return C};var E=function(W,X){C=Zapatec.Utils.createElement("td",W);C.colSpan=X;C.className="button";C.innerHTML="<div>&nbsp</div>";return C};var U=((this.weekNumbers)?(8):(7))*this.monthsInRow-2;var S=Zapatec.Utils.createElement("thead",T);if(this.numberMonths==1){this.title=S}F=Zapatec.Utils.createElement("tr",S);if(this.helpButton){D("?",1,400).ttip=Zapatec.Calendar.i18n("INFO")}else{E(F,1)}this.title=D("&nbsp;",U,300);this.title.className="title";if(this.isPopup){if(!this.disableDrag){this.title.ttip=Zapatec.Calendar.i18n("DRAG_TO_MOVE");this.title.style.cursor="move"}if(this.closeButton){D("&#x00d7;",1,200).ttip=Zapatec.Calendar.i18n("CLOSE")}else{E(F,1)}}else{E(F,1)}F=Zapatec.Utils.createElement("tr",S);this._nav_py=D("&#x00ab;",1,-2);this._nav_py.ttip=Zapatec.Calendar.i18n("PREV_YEAR");this._nav_pm=D("&#x2039;",1,-1);this._nav_pm.ttip=Zapatec.Calendar.i18n("PREV_MONTH");this._nav_now=D(Zapatec.Calendar.i18n("TODAY"),U-2,0);this._nav_now.ttip=Zapatec.Calendar.i18n("GO_TODAY");this._nav_nm=D("&#x203a;",1,1);this._nav_nm.ttip=Zapatec.Calendar.i18n("NEXT_MONTH");this._nav_ny=D("&#x00bb;",1,2);this._nav_ny.ttip=Zapatec.Calendar.i18n("NEXT_YEAR");var V=Math.floor(this.numberMonths/this.monthsInRow);if(this.numberMonths%this.monthsInRow>0){++V}for(var L=1;L<=V;++L){var S=Zapatec.Utils.createElement("thead",T);if(Zapatec.is_opera){S.style.display="table-row-group"}if(this.numberMonths!=1){F=Zapatec.Utils.createElement("tr",S);var U=5;this.weekNumbers&&++U;this.titles[L]=new Array();for(var M=1;(M<=this.monthsInRow)&&((L-1)*this.monthsInRow+M<=this.numberMonths);++M){E(F,1);this.titles[L][M]=D("&nbsp;",U,300);this.titles[L][M].className="title";E(F,1)}}F=Zapatec.Utils.createElement("tr",S);F.className="daynames";for(M=1;(M<=this.monthsInRow)&&((L-1)*this.monthsInRow+M<=this.numberMonths);++M){if(this.weekNumbers){C=Zapatec.Utils.createElement("td",F);C.className="name wn";C.appendChild(window.document.createTextNode(Zapatec.Calendar.i18n("WK")));if(M>1){Zapatec.Utils.addClass(C,"month-left-border")}var R=Zapatec.Calendar.i18n("WK");if(R==null){R=""}}for(var Q=7;Q>0;--Q){C=Zapatec.Utils.createElement("td",F);C.appendChild(document.createTextNode("&nbsp;"))}}this.firstdayname=F.childNodes[this.weekNumbers?1:0];this.rowsOfDayNames[L]=this.firstdayname;this._displayWeekdays();var B=Zapatec.Utils.createElement("tbody",T);this.tbody[L]=B;for(Q=6;Q>0;--Q){F=Zapatec.Utils.createElement("tr",B);for(M=1;(M<=this.monthsInRow)&&((L-1)*this.monthsInRow+M<=this.numberMonths);++M){if(this.weekNumbers){C=Zapatec.Utils.createElement("td",F);C.appendChild(document.createTextNode("&nbsp;"))}for(var N=7;N>0;--N){C=Zapatec.Utils.createElement("td",F);C.appendChild(document.createTextNode("&nbsp;"));Zapatec.Utils.createProperty(C,"calendar",this);Zapatec.Calendar._add_evs(C)}}}}var H=Zapatec.Utils.createElement("tfoot",T);if(this.showsTime){F=Zapatec.Utils.createElement("tr",H);F.className="time";var A;if(this.monthsInRow!=1){C=Zapatec.Utils.createElement("td",F);A=C.colSpan=Math.ceil((((this.weekNumbers)?8:7)*(this.monthsInRow-1))/2);C.className="timetext";C.innerHTML="&nbsp"}C=Zapatec.Utils.createElement("td",F);C.className="timetext";C.colSpan=this.weekNumbers?2:1;C.innerHTML=Zapatec.Calendar.i18n("TIME")||"&nbsp;";(function(){function b(q,u,g,t){var v,p,r,l,h;if(t){C=Zapatec.Utils.createElement("td",F);C.colSpan=1;if(I.showsTime!="seconds"){++C.colSpan}C.className="parent-"+q;v=Zapatec.Utils.createElement("table",C);v.cellSpacing=v.cellPadding=0;if(q=="hour"){v.align="right"}v.className="calendar-time-scroller";p=Zapatec.Utils.createElement("tbody",v);r=Zapatec.Utils.createElement("tr",p);l=Zapatec.Utils.createElement("tr",p)}else{r=F}h=Zapatec.Utils.createElement("td",r);h.className=q;h.appendChild(window.document.createTextNode(u));Zapatec.Utils.createProperty(h,"calendar",I);h.ttip=Zapatec.Calendar.i18n("TIME_PART");h.navtype=50;h._range=[];if(!t){h._range=g}else{h.rowSpan=2;for(var o=g;o<=t;++o){var n;if(o<10&&t>=10){n="0"+o}else{n=""+o}h._range[h._range.length]=n}var m=Zapatec.Utils.createElement("td",r);m.className="up";m.navtype=201;Zapatec.Utils.createProperty(m,"calendar",I);m.timePart=h;if(Zapatec.is_khtml){m.innerHTML="&nbsp;"}Zapatec.Calendar._add_evs(m);var s=Zapatec.Utils.createElement("td",l);s.className="down";s.navtype=202;Zapatec.Utils.createProperty(s,"calendar",I);s.timePart=h;if(Zapatec.is_khtml){s.innerHTML="&nbsp;"}Zapatec.Calendar._add_evs(s)}Zapatec.Calendar._add_evs(h);return h}var e=I.currentDate.getHours();var W=I.currentDate.getMinutes();if(I.showsTime=="seconds"){var Z=I.currentDate.getSeconds()}var f=!I.time24;var X=(e>12);if(f&&X){e-=12}var c=b("hour",e,f?1:0,f?12:23);c._step=(I.timeInterval>30)?(I.timeInterval/60):1;C=Zapatec.Utils.createElement("td",F);C.innerHTML=":";C.className="colon";var a=b("minute",W,0,59);a._step=((I.timeInterval)&&(I.timeInterval<60))?(I.timeInterval):5;if(I.showsTime=="seconds"){C=Zapatec.Utils.createElement("td",F);C.innerHTML=":";C.className="colon";var Y=b("minute",Z,0,59);Y._step=5}var d=null;if(f){d=b("ampm",X?Zapatec.Calendar.i18n("pm","ampm"):Zapatec.Calendar.i18n("am","ampm"),[Zapatec.Calendar.i18n("am","ampm"),Zapatec.Calendar.i18n("pm","ampm")]);d.className+=" button"}else{Zapatec.Utils.createElement("td",F).innerHTML="&nbsp;"}I.onSetTime=function(){var l=this.currentDate.getHours();var m=this.currentDate.getMinutes();if(this.showsTime=="seconds"){var i=I.currentDate.getSeconds()}if(this.timeInterval){m+=this.timeInterval-((m-1+this.timeInterval)%this.timeInterval)-1}while(m>=60){m-=60;++l}if(this.timeInterval>60){var g=this.timeInterval/60;if(l%g!=0){l+=g-((l-1+g)%g)-1}if(l>=24){l-=24}}var n=new Date(this.currentDate);if(this.getDateStatus&&this.getDateStatus(this.currentDate,this.currentDate.getFullYear(),this.currentDate.getMonth(),this.currentDate.getDate(),l,m)){hours=l;minutes=m;do{if(this.timeInterval){if(this.timeInterval<60){minutes+=this.timeInterval}else{l+=this.timeInterval/60}}else{minutes+=5}if(minutes>=60){minutes-=60;hours+=1}if(hours>=24){hours-=24}n.setMinutes(minutes);n.setHours(hours);if(!this.getDateStatus(n,this.currentDate.getFullYear(),this.currentDate.getMonth(),this.currentDate.getDate(),hours,minutes)){l=hours;m=minutes}}while((l!=hours)||(m!=minutes))}this.currentDate.setMinutes(m);this.currentDate.setHours(l);var h=(l>=12);if(h&&f&&l!=12){l-=12}if(!h&&f&&l==0){l=12}c.firstChild.data=(l<10)?("0"+l):l;a.firstChild.data=(m<10)?("0"+m):m;if(this.showsTime=="seconds"){Y.firstChild.data=(i<10)?("0"+i):i}if(f){d.firstChild.data=h?Zapatec.Calendar.i18n("pm","ampm"):Zapatec.Calendar.i18n("am","ampm")}};I.onUpdateTime=function(){var i=this.currentDate;var l=parseInt(c.firstChild.data,10);if(f){if(/pm/i.test(d.firstChild.data)&&l<12){l+=12}else{if(/am/i.test(d.firstChild.data)&&l==12){l=0}}}var n=i.getDate();var g=i.getMonth();var o=i.getFullYear();i.setHours(l);i.setMinutes(parseInt(a.firstChild.data,10));if(this.showsTime=="seconds"){i.setSeconds(parseInt(Y.firstChild.data,10))}i.setFullYear(o);i.setMonth(g);i.setDate(n);this.dateClicked=false;this.callHandler()}})();if(this.monthsInRow!=1){C=Zapatec.Utils.createElement("td",F);C.colSpan=((this.weekNumbers)?8:7)*(this.monthsInRow-1)-Math.ceil(A);C.className="timetext";C.innerHTML="&nbsp"}}else{this.onSetTime=this.onUpdateTime=function(){}}F=Zapatec.Utils.createElement("tr",H);F.className="footrow";C=D(Zapatec.Calendar.i18n("SEL_DATE"),this.weekNumbers?(8*this.numberMonths):(7*this.numberMonths),300);C.className="ttip";if(this.isPopup&&!this.disableDrag){C.ttip=Zapatec.Calendar.i18n("DRAG_TO_MOVE");C.style.cursor="move"}this.tooltips=C;J=this.monthsCombo=Zapatec.Utils.createElement("div",this.element);J.className="combo";for(Q=0;Q<12;++Q){var P=Zapatec.Utils.createElement("div");P.className=Zapatec.is_ie?"label-IEfix":"label";P.month=Q;P.appendChild(window.document.createTextNode(Zapatec.Calendar.i18n(Q,"smn")));J.appendChild(P)}J=this.yearsCombo=Zapatec.Utils.createElement("div",this.element);J.className="combo";for(Q=12;Q>0;--Q){var O=Zapatec.Utils.createElement("div");O.className=Zapatec.is_ie?"label-IEfix":"label";O.appendChild(window.document.createTextNode("&nbsp;"));J.appendChild(O)}J=this.histCombo=Zapatec.Utils.createElement("div",this.element);J.className="combo history";this._init(this.firstDayOfWeek,this.date);G.appendChild(this.element)};Zapatec.Calendar._keyEvent=function(D){if(!window.calendar){return false}(Zapatec.is_ie)&&(D=window.event);var E=window.calendar;var B=(Zapatec.is_ie||D.type=="keypress");var A=D.keyCode;var C=new Date(E.date);if(D.ctrlKey){switch(A){case 37:B&&Zapatec.Calendar.cellClick(E._nav_pm);break;case 38:B&&Zapatec.Calendar.cellClick(E._nav_py);break;case 39:B&&Zapatec.Calendar.cellClick(E._nav_nm);break;case 40:B&&Zapatec.Calendar.cellClick(E._nav_ny);break;default:return false}}else{switch(A){case 32:Zapatec.Calendar.cellClick(E._nav_now);break;case 27:B&&E.callCloseHandler();break;case 37:if(B&&!E.multiple){C.setTime(C.getTime()-86400000);E.setDate(C)}break;case 38:if(B&&!E.multiple){C.setTime(C.getTime()-7*86400000);E.setDate(C)}break;case 39:if(B&&!E.multiple){C.setTime(C.getTime()+86400000);E.setDate(C)}break;case 40:if(B&&!E.multiple){C.setTime(C.getTime()+7*86400000);E.setDate(C)}break;case 13:if(B){Zapatec.Calendar.cellClick(E.currentDateEl)}break;default:return false}}return Zapatec.Utils.stopEvent(D)};Zapatec.Calendar.prototype._init=function(Q,t,N){var I=new Date(),q=I.getDate(),b=I.getFullYear(),h=I.getMonth();if(this.getDateStatus&&!N){var Z=this.getDateStatus(t,t.getFullYear(),t.getMonth(),t.getDate());var F=new Date(t);while(((Z==true)||(Z=="disabled"))&&(F.getMonth()==t.getMonth())){t.setTime(t.getTime()+86400000);var Z=this.getDateStatus(t,t.getFullYear(),t.getMonth(),t.getDate())}if(F.getMonth()!=t.getMonth()){t=new Date(F);while(((Z==true)||(Z=="disabled"))&&(F.getMonth()==t.getMonth())){t.setTime(t.getTime()-86400000);var Z=this.getDateStatus(t,t.getFullYear(),t.getMonth(),t.getDate())}}if(F.getMonth()!=t.getMonth()){N=true;t=new Date(F)}}var E=t.getFullYear();var A=t.getMonth();var v=Math.floor(this.numberMonths/this.monthsInRow);var P;var T,a,K;if(!this.vertical){T=(this.controlMonth-1);P=A-T}else{a=((this.numberMonths-1)%this.monthsInRow)+1;K=(this.controlMonth-1)%this.monthsInRow;bottom=(K>=(a)?(a):(K));T=(K)*(v-1)+Math.floor((this.controlMonth-1)/this.monthsInRow)+bottom;P=A-T}var M=E;if(P<0){P+=12;--M}var U=P+this.numberMonths-1;var S=M;if(U>11){U-=12;++S}function W(i){Zapatec.Calendar._del_evs(i);i.disabled=true;i.className="button";i.innerHTML="<div>&nbsp</div>"}function D(l,i){Zapatec.Calendar._add_evs(l);l.disabled=false;l.className="button nav";l.innerHTML=i}if((M<=this.minYear)||!this.yearNav){if(!this._nav_py.disabled){W(this._nav_py)}}else{if(this._nav_py.disabled){D(this._nav_py,"&#x00ab;")}}if(S>=this.maxYear||!this.yearNav){if(!this._nav_ny.disabled){W(this._nav_ny)}}else{if(this._nav_ny.disabled){D(this._nav_ny,"&#x00bb;")}}if(((M==this.minYear)&&(P<=this.minMonth))||(M<this.minYear)){if(!this._nav_pm.disabled){W(this._nav_pm)}}else{if(this._nav_pm.disabled){D(this._nav_pm,"&#x2039;")}}if(((S==this.maxYear)&&(U>=this.maxMonth))||(S>this.maxYear)){if(!this._nav_nm.disabled){W(this._nav_nm)}}else{if(this._nav_nm.disabled){D(this._nav_nm,"&#x203a;")}}upperMonth=this.maxMonth+1;upperYear=this.maxYear;if(upperMonth>11){upperMonth-=12;++upperYear}bottomMonth=this.minMonth-1;bottomYear=this.minYear;if(bottomMonth<0){bottomMonth+=12;--bottomYear}maxDate1=new Date(S,U,t.getMonthDays(U),23,59,59,999);maxDate2=new Date(upperYear,upperMonth,1,0,0,0,0);minDate1=new Date(M,P,1,0,0,0,0);minDate2=new Date(bottomYear,bottomMonth,t.getMonthDays(bottomMonth),23,59,59,999);if(maxDate1.getTime()>maxDate2.getTime()){t.setTime(t.getTime()-(maxDate1.getTime()-maxDate2.getTime()))}if(minDate1.getTime()<minDate2.getTime()){t.setTime(t.getTime()+(minDate2.getTime()-minDate1.getTime())+1)}delete maxDate1;delete maxDate2;delete minDate1;delete minDate2;this.firstDayOfWeek=Q;if(!N){this.currentDate=t}this.date=t;(this.date=new Date(this.date)).setDateOnly(t);E=this.date.getFullYear();A=this.date.getMonth();var H=t.getMonth();var G=this.date.getDate();var e=t.getMonthDays();var R=new Array();if(this.numberMonths%this.monthsInRow>0){++v}for(var o=1;o<=v;++o){R[o]=new Array();for(var p=1;(p<=this.monthsInRow)&&((o-1)*this.monthsInRow+p<=this.numberMonths);++p){var d=new Date(t);if(this.vertical){var u=t.getMonth()-T+((p-1)*(v-1)+(o-1)+((a<p)?(a):(p-1)))}else{var u=t.getMonth()-T+(o-1)*this.monthsInRow+p-1}if(u<0){d.setFullYear(d.getFullYear()-1);u=12+u}if(u>11){d.setFullYear(d.getFullYear()+1);u=u-12}d.setDate(1);d.setMonth(u);var m=(d.getDay()-this.firstDayOfWeek)%7;if(m<0){m+=7}var V=d.getHours();d.setDate(-m);d.setDate(d.getDate()+1);if(V!=d.getHours()){d.setDate(1);d.setMonth(u);d.setDate(-m);d.setDate(d.getDate()+1)}R[o][p]=d}}var B=Zapatec.Calendar.i18n(A,"smn");var C=Zapatec.Calendar.i18n("WEEKEND");var n=this.multiple?(this.datesCells={}):null;var f=this.getDateText;for(var o=1;o<=v;++o){var J=this.tbody[o].firstChild;for(var r=7;--r>0;J=J.nextSibling){var X=J.firstChild;var w=false;for(var p=1;(p<=this.monthsInRow)&&((o-1)*this.monthsInRow+p<=this.numberMonths);++p){t=R[o][p];if(this.weekNumbers){X.className=" day wn";X.innerHTML=t.getWeekNumber();if(p>1){Zapatec.Utils.addClass(X,"month-left-border")}X=X.nextSibling}J.className="daysrow";var Y;for(j=7;X&&(Y=t.getDate())&&(j>0);t.setDate(Y+1),((t.getDate()==Y)?(t.setHours(1)&&t.setDate(Y+1)):(false)),X=X.nextSibling,--j){var L=t.getDay(),c=t.getMonth(),g=t.getFullYear();X.className=" day";if((!this.weekNumbers)&&(j==7)&&(p!=1)){Zapatec.Utils.addClass(X,"month-left-border")}if((j==1)&&(p!=this.monthsInRow)){Zapatec.Utils.addClass(X,"month-right-border")}if(this.vertical){u=H-T+((p-1)*(v-1)+(o-1)+((a<p)?(a):(p-1)))}else{u=H-T+((o-1)*this.monthsInRow+p-1)}if(u<0){u=12+u}if(u>11){u=u-12}var s=!(X.otherMonth=!(c==u));if(!s){if(this.showsOtherMonths){X.className+=" othermonth"}else{X.className+=" true";X.innerHTML="<div>&nbsp;</div>";continue}}else{w=true}X.innerHTML=f?f(t,g,c,Y):Y;n&&(n[t.print("%Y%m%d")]=X);if(this.getDateStatus){var Z=this.getDateStatus(t,g,c,Y);if(this.getDateToolTip){var O=this.getDateToolTip(t,g,c,Y);if(O){X.title=O}}if(Z==true){X.className+=" disabled"}else{X.className+=" "+Z}}if(!X.disabled){X.caldate=[g,c,Y];X.ttip="_";if(!this.multiple&&s&&Y==this.currentDate.getDate()&&this.hiliteToday&&(c==this.currentDate.getMonth())&&(g==this.currentDate.getFullYear())){X.className+=" selected";this.currentDateEl=X}if(g==b&&c==h&&Y==q){X.className+=" today";X.ttip+=Zapatec.Calendar.i18n("PART_TODAY")}if((C!=null)&&(C.indexOf(L.toString())!=-1)){X.className+=X.otherMonth?" oweekend":" weekend"}}}if(!(w||this.showsOtherMonths)){J.className="emptyrow"}}if((r==1)&&(o<v)){if(J.className=="emptyrow"){J=J.previousSibling}X=J.firstChild;while(X!=null){Zapatec.Utils.addClass(X,"month-bottom-border");X=X.nextSibling}}}}if(this.numberMonths==1){this.title.innerHTML=Zapatec.Calendar.i18n(A,"mn")+", "+E;if(this.params&&this.params.titleHtml){if(typeof this.params.titleHtml=="function"){this.title.innerHTML=this.params.titleHtml(this.title.innerHTML,A,E)}else{this.title.innerHTML+=this.params.titleHtml}}}else{if(this.params&&this.params.titleHtml){if(typeof this.params.titleHtml=="function"){this.title.innerHTML=this.params.titleHtml(Zapatec.Calendar.i18n(A,"mn")+", "+E,A,E)}else{this.title.innerHTML=this.params.titleHtml}}for(var o=1;o<=v;++o){for(var p=1;(p<=this.monthsInRow)&&((o-1)*this.monthsInRow+p<=this.numberMonths);++p){if(this.vertical){u=A-T+((p-1)*(v-1)+(o-1)+((a<p)?(a):(p-1)))}else{u=A-T+(o-1)*this.monthsInRow+p-1}validYear=E;if(u<0){--validYear;u=12+u}if(u>11){++validYear;u=u-12}this.titles[o][p].innerHTML=Zapatec.Calendar.i18n(u,"mn")+", "+validYear}}}this.onSetTime();this._initMultipleDates();this.updateWCH()};Zapatec.Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var B in this.multiple){var A=this.datesCells[B];var C=this.multiple[B];if(!C){continue}if(A){A.className+=" selected"}}}};Zapatec.Calendar.prototype._toggleMultipleDate=function(B){if(this.multiple){var C=B.print("%Y%m%d");var A=this.datesCells[C];if(A){var D=this.multiple[C];if(!D){Zapatec.Utils.addClass(A,"selected");this.multiple[C]=B}else{Zapatec.Utils.removeClass(A,"selected");delete this.multiple[C]}}}};Zapatec.Calendar.prototype.setDateToolTipHandler=function(A){this.getDateToolTip=A};Zapatec.Calendar.prototype.setDate=function(B,D){if(!B){B=new Date()}if(!B.equalsTo(this.date)){var C=B.getFullYear(),A=B.getMonth();if(C<this.minYear||(C==this.minYear&&A<this.minMonth)){this.showHint("<div class='error'>"+Zapatec.Calendar.i18n("E_RANGE")+" »»»</div>")}else{if(C>this.maxYear||(C==this.maxYear&&A>this.maxMonth)){this.showHint("<div class='error'>««« "+Zapatec.Calendar.i18n("E_RANGE")+"</div>")}}this._init(this.firstDayOfWeek,B,D)}};Zapatec.Calendar.prototype.showHint=function(A){this.tooltips.innerHTML=A};Zapatec.Calendar.prototype.reinit=function(){this._init(this.firstDayOfWeek,this.date)};Zapatec.Calendar.prototype.refresh=function(){var B=this.isPopup?null:this.element.parentNode;var A=parseInt(this.element.style.left);var C=parseInt(this.element.style.top);this.destroy();this.dateStr=this.date;this.create(B);if(this.isPopup){this.showAt(A,C)}else{this.show()}};Zapatec.Calendar.prototype.setFirstDayOfWeek=function(B){if(this.firstDayOfWeek!=B){this._init(B,this.date);var C=Math.floor(this.numberMonths/this.monthsInRow);if(this.numberMonths%this.monthsInRow>0){++C}for(var A=1;A<=C;++A){this.firstdayname=this.rowsOfDayNames[A];this._displayWeekdays()}}};Zapatec.Calendar.prototype.setDateStatusHandler=Zapatec.Calendar.prototype.setDisabledHandler=function(A){this.getDateStatus=A};Zapatec.Calendar.prototype.setRange=function(C,E){var B,D=Math.min(C,E),F=Math.max(C,E);this.minYear=B=Math.floor(D);this.minMonth=(B==D)?0:Math.ceil((D-B)*100-1);this.maxYear=B=Math.floor(F);this.maxMonth=(B==F)?11:Math.ceil((F-B)*100-1)};Zapatec.Calendar.prototype.setMultipleDates=function(A){if(!A||typeof A=="undefined"){return }this.multiple={};for(var B=A.length;--B>=0;){var D=A[B];var C=D.print("%Y%m%d");this.multiple[C]=D}};Zapatec.Calendar.prototype.submitFlatDates=function(){if(typeof this.params.flatCallback=="function"){Zapatec.Utils.sortOrder=(this.sortOrder!="asc"&&this.sortOrder!="desc"&&this.sortOrder!="none")?"none":this.sortOrder;if(this.multiple&&(Zapatec.Utils.sortOrder!="none")){var D=new Array();for(var B in this.multiple){var A=this.multiple[B];if(A){D[D.length]=A}D.sort(Zapatec.Utils.compareDates)}this.multiple={};for(var B=0;B<D.length;B++){var E=D[B];var C=E.print("%Y%m%d");this.multiple[C]=E}}this.params.flatCallback(this)}};Zapatec.Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Zapatec.Calendar.prototype.updateHistory=function(){var B,D,G,C,E,F="",A=Zapatec.Calendar.prefs.hsize-1;if(Zapatec.Calendar.prefs.history){B=Zapatec.Calendar.prefs.history.split(/,/);D=0;while(D<A&&(C=B[D++])){E=C.split(/\//);G=new Date(parseInt(E[0],10),parseInt(E[1],10)-1,parseInt(E[2],10),parseInt(E[3],10),parseInt(E[4],10));if(!G.dateEqualsTo(this.date)){F+=","+C}}}Zapatec.Calendar.prefs.history=this.date.print("%Y/%m/%d/%H/%M")+F;Zapatec.Calendar.savePrefs()};Zapatec.Calendar.prototype.callCloseHandler=function(){if(this.dateClicked){this.updateHistory()}if(this.onClose){this.onClose(this)}this.hideShowCovered()};Zapatec.Calendar.prototype.destroy=function(){this.hide();Zapatec.Utils.destroy(this.element);Zapatec.Utils.destroy(this.WCH);Zapatec.Calendar._C=null;window.calendar=null};Zapatec.Calendar.prototype.reparent=function(B){var A=this.element;A.parentNode.removeChild(A);B.appendChild(A)};Zapatec.Calendar._checkCalendar=function(B){if(!window.calendar){return false}var A=Zapatec.is_ie?Zapatec.Utils.getElement(B):Zapatec.Utils.getTargetElement(B);for(;A!=null&&A!=calendar.element;A=A.parentNode){}if(A==null){window.calendar.callCloseHandler()}};Zapatec.Calendar.prototype.updateWCH=function(A){Zapatec.Utils.setupWCH_el(this.WCH,this.element,A)};Zapatec.Calendar.prototype.show=function(){var E=this.table.getElementsByTagName("tr");for(var D=E.length;D>0;){var F=E[--D];Zapatec.Utils.removeClass(F,"rowhilite");var C=F.getElementsByTagName("td");for(var B=C.length;B>0;){var A=C[--B];Zapatec.Utils.removeClass(A,"hilite");Zapatec.Utils.removeClass(A,"active")}}if(this.element.style.display!="block"){this.element.style.display="block"}this.hidden=false;if(this.isPopup){this.updateWCH();window.calendar=this;if(!this.noGrab){Zapatec.Utils.addEvent(window.document,"keydown",Zapatec.Calendar._keyEvent);Zapatec.Utils.addEvent(window.document,"keypress",Zapatec.Calendar._keyEvent);Zapatec.Utils.addEvent(window.document,"mousedown",Zapatec.Calendar._checkCalendar)}}this.hideShowCovered()};Zapatec.Calendar.prototype.hide=function(){if(this.isPopup){Zapatec.Utils.removeEvent(window.document,"keydown",Zapatec.Calendar._keyEvent);Zapatec.Utils.removeEvent(window.document,"keypress",Zapatec.Calendar._keyEvent);Zapatec.Utils.removeEvent(window.document,"mousedown",Zapatec.Calendar._checkCalendar)}this.element.style.display="none";Zapatec.Utils.hideWCH(this.WCH);this.hidden=true;this.hideShowCovered()};Zapatec.Calendar.prototype.showAt=function(A,C){var B=this.element.style;B.left=A+"px";B.top=C+"px";this.show()};Zapatec.Calendar.prototype.showAtElement=function(E,F){var B=this;var H=Zapatec.Utils.getElementOffset(E);if(!F||typeof F!="string"){this.showAt(H.x,H.y+E.offsetHeight);return true}this.element.style.display="block";var A=B.element.offsetWidth;var D=B.element.offsetHeight;B.element.style.display="none";var C=F.substr(0,1);var G="l";if(F.length>1){G=F.substr(1,1)}switch(C){case"T":H.y-=D;break;case"B":H.y+=E.offsetHeight;break;case"C":H.y+=(E.offsetHeight-D)/2;break;case"t":H.y+=E.offsetHeight-D;break;case"b":break}switch(G){case"L":H.x-=A;break;case"R":H.x+=E.offsetWidth;break;case"C":H.x+=(E.offsetWidth-A)/2;break;case"l":H.x+=E.offsetWidth-A;break;case"r":break}H.width=A;H.height=D;B.monthsCombo.style.display="none";Zapatec.Utils.fixBoxPosition(H,10);B.showAt(H.x,H.y)};Zapatec.Calendar.prototype.setDateFormat=function(A){this.dateFormat=A};Zapatec.Calendar.prototype.setTtDateFormat=function(A){this.ttDateFormat=A};Zapatec.Calendar.prototype.parseDate=function(C,A){if(!C){return this.setDate(this.date)}if(!A){A=this.dateFormat}var B=Date.parseDate(C,A);return this.setDate(B)};Zapatec.Calendar.prototype.hideShowCovered=function(){if(!Zapatec.is_ie5){return }var P=this;function B(S){var R=S.style.visibility;if(!R){if(window.document.defaultView&&typeof (window.document.defaultView.getComputedStyle)=="function"){if(!Zapatec.is_khtml){R=window.document.defaultView.getComputedStyle(S,"").getPropertyValue("visibility")}else{R=""}}else{if(S.currentStyle){R=S.currentStyle.visibility}else{R=""}}}return R}var Q=["applet","iframe","select"];var C=P.element;var A=Zapatec.Utils.getAbsolutePos(C);var F=A.x;var D=C.offsetWidth+F;var O=A.y;var N=C.offsetHeight+O;for(var H=Q.length;H>0;){var G=window.document.getElementsByTagName(Q[--H]);var E=null;for(var J=G.length;J>0;){E=G[--J];A=Zapatec.Utils.getAbsolutePos(E);var M=A.x;var L=E.offsetWidth+M;var K=A.y;var I=E.offsetHeight+K;if(P.hidden||(M>D)||(L<F)||(K>N)||(I<O)){if(!E.__msh_save_visibility){E.__msh_save_visibility=B(E)}E.style.visibility=E.__msh_save_visibility}else{if(!E.__msh_save_visibility){E.__msh_save_visibility=B(E)}E.style.visibility="hidden"}}}};Zapatec.Calendar.prototype._displayWeekdays=function(){var B=this.firstDayOfWeek;var A=this.firstdayname;var D=Zapatec.Calendar.i18n("WEEKEND");for(k=1;(k<=this.monthsInRow)&&(A);++k){for(var C=0;C<7;++C){A.className=" day name";if((!this.weekNumbers)&&(C==0)&&(k!=1)){Zapatec.Utils.addClass(A,"month-left-border")}if((C==6)&&(k!=this.monthsInRow)){Zapatec.Utils.addClass(A,"month-right-border")}var E=(C+B)%7;if((!this.disableFdowClick)&&((this.params&&this.params.fdowClick)||C)){if(Zapatec.Calendar.i18n("DAY_FIRST")!=null){A.ttip=Zapatec.Calendar.i18n("DAY_FIRST").replace("%s",Zapatec.Calendar.i18n(E,"dn"))}A.navtype=100;A.calendar=this;A.fdow=E;Zapatec.Calendar._add_evs(A)}if((D!=null)&&(D.indexOf(E.toString())!=-1)){Zapatec.Utils.addClass(A,"weekend")}A.innerHTML=Zapatec.Calendar.i18n((C+B)%7,"sdn");A=A.nextSibling}if(this.weekNumbers&&A){A=A.nextSibling}}};Zapatec.Utils.compareDates=function(B,A){if(Zapatec.Calendar.prefs.sortOrder=="asc"){return B-A}else{return A-B}};Zapatec.Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";this.histCombo.style.display="none";this.updateWCH()};Zapatec.Calendar.prototype._dragStart=function(B){B||(B=window.event);if(this.dragging){return }this.dragging=true;var D=B.clientX+window.document.body.scrollLeft;var C=B.clientY+window.document.body.scrollTop;var A=this.element.style;this.xOffs=D-parseInt(A.left);this.yOffs=C-parseInt(A.top);Zapatec.Utils.addEvent(window.document,"mousemove",Zapatec.Calendar.calDragIt);Zapatec.Utils.addEvent(window.document,"mouseover",Zapatec.Calendar.calDragIt);Zapatec.Utils.addEvent(window.document,"mouseup",Zapatec.Calendar.calDragEnd)};Date._MD=[31,28,31,30,31,30,31,31,30,31,30,31];Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.prototype.getMonthDays=function(B){var A=this.getFullYear();if(typeof B=="undefined"){B=this.getMonth()}if(((0==(A%4))&&((0!=(A%100))||(0==(A%400))))&&B==1){return 29}else{return Date._MD[B]}};Date.prototype.getDayOfYear=function(){var A=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var C=new Date(this.getFullYear(),0,0,0,0,0);var B=A-C;return Math.round(B/Date.DAY)};Date.prototype.getWeekNumber=function(){var C=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var B=C.getDay();C.setDate(C.getDate()-(B+6)%7+3);var A=C.valueOf();C.setMonth(0);C.setDate(4);return Math.round((A-C.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(A){return((this.getFullYear()==A.getFullYear())&&(this.getMonth()==A.getMonth())&&(this.getDate()==A.getDate())&&(this.getHours()==A.getHours())&&(this.getMinutes()==A.getMinutes()))};Date.prototype.dateEqualsTo=function(A){return((this.getFullYear()==A.getFullYear())&&(this.getMonth()==A.getMonth())&&(this.getDate()==A.getDate()))};Date.prototype.setDateOnly=function(A){var B=new Date(A);this.setDate(1);this.setFullYear(B.getFullYear());this.setMonth(B.getMonth());this.setDate(B.getDate())};Date.prototype.print=function(I){var A=this.getMonth();var H=this.getDate();var J=this.getFullYear();var L=this.getWeekNumber();var M=this.getDay();var Q={};var N=this.getHours();var B=(N>=12);var F=(B)?(N-12):N;var P=this.getDayOfYear();if(F==0){F=12}var C=this.getMinutes();var G=this.getSeconds();Q["%a"]=Zapatec.Calendar.i18n(M,"sdn");Q["%A"]=Zapatec.Calendar.i18n(M,"dn");Q["%b"]=Zapatec.Calendar.i18n(A,"smn");Q["%B"]=Zapatec.Calendar.i18n(A,"mn");Q["%C"]=1+Math.floor(J/100);Q["%d"]=(H<10)?("0"+H):H;Q["%e"]=H;Q["%H"]=(N<10)?("0"+N):N;Q["%I"]=(F<10)?("0"+F):F;Q["%j"]=(P<100)?((P<10)?("00"+P):("0"+P)):P;Q["%k"]=N?N:"0";Q["%l"]=F;Q["%m"]=(A<9)?("0"+(1+A)):(1+A);Q["%M"]=(C<10)?("0"+C):C;Q["%n"]="\n";Q["%p"]=B?"PM":"AM";Q["%P"]=B?"pm":"am";Q["%s"]=Math.floor(this.getTime()/1000);Q["%S"]=(G<10)?("0"+G):G;Q["%t"]="\t";Q["%U"]=Q["%W"]=Q["%V"]=(L<10)?("0"+L):L;Q["%u"]=(M==0)?7:M;Q["%w"]=M?M:"0";Q["%y"]=""+J%100;if(Q["%y"]<10){Q["%y"]="0"+Q["%y"]}Q["%Y"]=J;Q["%%"]="%";var O=/%./g;var K=I.match(O)||[];for(var E=0;E<K.length;E++){var D=Q[K[E]];if(D){O=new RegExp(K[E],"g");I=I.replace(O,D)}}return I};Date.parseDate=function(R,V){var B=V,A=0,G=null,I=null,S=null,N=null,Y=null,Z=new Date(),C={};var O=["%d","%H","%I","%m","%M","%S","%s","%W","%u","%w","%y","%e","%k","%l","%s","%Y","%C"];function D(b){if(Zapatec.Utils.arrIndexOf(O,b)!=-1){return true}return false}function H(){for(var b=N[0];b<N[1];++b){var c=Zapatec.Calendar.i18n(b,Y);if(!c){return null}if(c==R.substr(A,c.length)){S=c.length;return b}}return null}function L(){var b=R.substr(A,S);if(b.length!=S||/$\d+^/.test(b)){return null}return parseInt(b,10)}function T(){var b=(R.substr(A,S).toLowerCase()==Zapatec.Calendar.i18n("pm","ampm"))?true:false;return b||((R.substr(A,S).toLowerCase()==Zapatec.Calendar.i18n("am","ampm"))?false:null)}function K(){return""}function J(b){return(C[b]=I())}function P(b){if(typeof b=="undefined"||b===null){return false}return true}function E(){for(var b=0;b<arguments.length;++b){if(arguments[b]!==null&&typeof arguments[b]!="undefined"&&!isNaN(arguments[b])){return arguments[b]}}return null}if(typeof B!="string"||typeof R!="string"||R==""||B==""){return null}while(B){I=L;S=B.indexOf("%");S=(S==-1)?B.length:S;G=B.slice(0,S);if(G!=R.substr(A,S)){return null}A+=S;B=B.slice(S);if(B==""){break}G=B.slice(0,2);S=2;switch(G){case"%A":case"%a":Y=(G=="%A")?"dn":"sdn";N=[0,7];I=H;break;case"%B":case"%b":Y=(G=="%B")?"mn":"smn";N=[0,12];I=H;break;case"%p":case"%P":I=T;break;case"%Y":S=4;if(D(B.substr(2,2))){return null}while(isNaN(parseInt(R.charAt(A+S-1)))&&S>0){--S}if(S==0){break}break;case"%C":case"%s":S=1;if(D(B.substr(2,2))){return null}while(!isNaN(parseInt(R.charAt(A+S)))){++S}break;case"%k":case"%l":case"%e":S=1;if(D(B.substr(2,2))){return null}if(!isNaN(parseInt(R.charAt(A+1)))){++S}break;case"%j":S=3;break;case"%u":case"%w":S=1;case"%y":case"%m":case"%d":case"%W":case"%H":case"%I":case"%M":case"%S":break}if(J(G)===null){return null}A+=S;B=B.slice(2)}if(P(C["%s"])){Z.setTime(C["%s"]*1000)}else{var M=E(C["%Y"],C["%y"]+ --C["%C"]*100,C["%y"]+(Z.getFullYear()-Z.getFullYear()%100),C["%C"]*100+Z.getFullYear()%100);var a=E(C["%m"]-1,C["%b"],C["%B"]);var U=E(C["%d"]||C["%e"]);if(U===null||a===null){var Q=E(C["%a"],C["%A"],C["%u"]==7?0:C["%u"],C["%w"])}var F=E(C["%H"],C["%k"]);if(F===null&&(P(C["%p"])||P(C["%P"]))){var X=E(C["%p"],C["%P"]);F=E(C["%I"],C["%l"]);F=X?((F==12)?12:(F+12)):((F==12)?(0):F)}if(M||M===0){Z.setFullYear(M)}if(a||a===0){Z.setMonth(a)}if(U||U===0){Z.setDate(U)}if(P(C["%j"])){Z.setMonth(0);Z.setDate(1);Z.setDate(C["%j"])}if(P(Q)){Z.setDate(Z.getDate()+(Q-Z.getDay()))}if(P(C["%W"])){var W=Z.getWeekNumber();if(W!=C["%W"]){Z.setDate(Z.getDate()+(C["%W"]-W)*7)}}if(F!==null){Z.setHours(F)}if(P(C["%M"])){Z.setMinutes(C["%M"])}if(P(C["%S"])){Z.setSeconds(C["%S"])}}if(Z.print(V)!=R){return null}return Z};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(B){var A=new Date(this);A.__msh_oldSetFullYear(B);if(A.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(B)};Date.prototype.compareDatesOnly=function(E,D){var C=E.getYear();var B=D.getYear();var A=E.getMonth();var H=D.getMonth();var G=E.getDate();var F=D.getDate();if(C>B){return -1}if(B>C){return 1}if(A>H){return -1}if(H>A){return 1}if(G>F){return -1}if(F>G){return 1}return 0};Zapatec.Setup=function(){};Zapatec.Setup.test=true;Zapatec.Calendar.setup=function(B){paramsList=["id"];function F(L,M){if(typeof B[L]=="undefined"){B[L]=M}paramsList.push(L)}B.id=Zapatec.Utils.generateID("calendar");F("inputField",null);F("displayArea",null);F("button",null);F("eventName","click");F("closeEventName",null);F("ifFormat",Zapatec.Calendar.i18n("DEF_DATE_FORMAT"));F("daFormat","%Y/%m/%d");F("singleClick",true);F("disableFunc",null);F("dateStatusFunc",B.disableFunc);F("dateText",null);F("firstDay",null);F("align","Br");F("range",[1900,2999]);F("weekNumbers",true);F("flat",null);F("flatCallback",null);F("onSelect",null);F("onClose",null);F("onUpdate",null);F("date",null);F("showsTime",false);F("sortOrder","asc");F("timeFormat","24");F("timeInterval",null);F("electric",true);F("step",2);F("position",null);F("cache",false);F("showOthers",false);F("multiple",null);F("saveDate",null);F("fdowClick",false);F("titleHtml",null);F("noHelp",false);F("noCloseButton",false);F("disableYearNav",false);F("disableFdowChange",false);if(B.weekNumbers){B.disableFdowChange=true;B.firstDay=1}F("disableDrag",false);F("numberMonths",1);if((B.numberMonths>12)||(B.numberMonths<1)){B.numberMonths=1}if(B.numberMonths>1){B.showOthers=false}B.numberMonths=parseInt(B.numberMonths,10);F("controlMonth",1);if((B.controlMonth>B.numberMonths)||(B.controlMonth<1)){B.controlMonth=1}B.controlMonth=parseInt(B.controlMonth,10);F("vertical",false);if(B.monthsInRow>B.numberMonths){B.monthsInRow=B.numberMonths}F("monthsInRow",B.numberMonths);B.monthsInRow=parseInt(B.monthsInRow,10);F("multiple",false);if(B.multiple){B.singleClick=false}F("canType",false);var D=["inputField","displayArea","button"];for(var E in D){if(typeof B[D[E]]=="string"){B[D[E]]=document.getElementById(B[D[E]])}}if(!B.inputField){B.canType=false}else{B.inputField.setAttribute("autocomplete","off")}if(!(B.flat||B.multiple||B.inputField||B.displayArea||B.button)){alert("Calendar.setup '"+B.id+"':\n  Nothing to setup (no fields found).  Please check your code");return false}if(((B.timeInterval)&&((B.timeInterval!==Math.floor(B.timeInterval))||((60%B.timeInterval!==0)&&(B.timeInterval%60!==0))))||(B.timeInterval>360)){alert("'"+B.id+"': timeInterval option can only have the following number of minutes:\n1, 2, 3, 4, 5, 6, 10, 15, 30,  60, 120, 180, 240, 300, 360 ");B.timeInterval=null}if(B.date&&!Date.parse(B.date)){alert("'"+B.id+"' Start Date Invalid: "+B.date+".\nSee date option.\nDefaulting to today.");B.date=null}if(B.saveDate){F("cookiePrefix",window.location.href+"--"+B.button.id);var I=B.cookiePrefix;var G=Zapatec.Utils.getCookie(I);if(G!=null){document.getElementById(B.inputField.id).value=G}}for(var J in B){if(typeof B.constructor.prototype[J]!="undefined"){continue}if(Zapatec.Utils.arrIndexOf(paramsList,J)==-1){alert("Wrong config option: "+J)}}function H(M){var L=M.params;var O=(M.dateClicked||L.electric);if(O&&L.flat){if(typeof L.flatCallback=="function"){if(!L.multiple){L.flatCallback(M)}}else{alert("'"+M.id+"': No flatCallback given -- doing nothing.")}return false}if(O&&L.inputField){L.inputField.value=M.currentDate.print(L.ifFormat);if(typeof L.inputField.onchange=="function"){L.inputField.onchange()}}if(O&&L.displayArea){L.displayArea.innerHTML=M.currentDate.print(L.daFormat)}if(O&&L.singleClick&&M.dateClicked){M.callCloseHandler()}if(O&&typeof L.onUpdate=="function"){L.onUpdate(M)}if(L.saveDate){var N=L.cookiePrefix;Zapatec.Utils.writeCookie(N,L.inputField.value,null,"/",L.saveDate)}}if(B.flat!=null){if(typeof B.flat=="string"){B.flat=document.getElementById(B.flat)}if(!B.flat){alert("Calendar.setup '"+B.id+"':\n  Flat specified but can't find parent.");return false}var A=new Zapatec.Calendar(B.firstDay,B.date,B.onSelect||H);A.id=B.id;A.disableFdowClick=B.disableFdowChange;A.showsOtherMonths=B.showOthers;A.showsTime=B.showsTime;A.time24=(B.timeFormat=="24");A.timeInterval=B.timeInterval;A.params=B;A.weekNumbers=B.weekNumbers;A.sortOrder=B.sortOrder.toLowerCase();A.setRange(B.range[0],B.range[1]);A.setDateStatusHandler(B.dateStatusFunc);A.getDateText=B.dateText;A.numberMonths=B.numberMonths;A.controlMonth=B.controlMonth;A.vertical=B.vertical;A.yearStep=B.step;A.monthsInRow=B.monthsInRow;A.helpButton=!B.noHelp;A.closeButton=!B.noCloseButton;A.yearNav=!B.disableYearNav;if(B.ifFormat){A.setDateFormat(B.ifFormat)}if(B.inputField&&B.inputField.type=="text"&&typeof B.inputField.value=="string"){A.parseDate(B.inputField.value)}if(B.multiple){A.setMultipleDates(B.multiple)}A.create(B.flat);A.show();return A}var K=B.button||B.displayArea||B.inputField;if(B.canType){function C(L){L=L||window.event;if(Zapatec.is_ie){L.cancelBubble=true}else{L.stopPropagation()}}Zapatec.Utils.addEvent(B.inputField,"mousedown",C);Zapatec.Utils.addEvent(B.inputField,"keydown",C);Zapatec.Utils.addEvent(B.inputField,"keypress",C);Zapatec.Utils.addEvent(B.inputField,"keyup",function(M){var O=B.inputField?B.ifFormat:B.daFormat;var L=Date.parseDate(B.inputField.value,O);var N=window.calendar;if(N&&L&&!N.hidden){N.setDate(L)}})}K["on"+B.eventName]=function(){var L=B.inputField||B.displayArea;if((!B.canType||B.inputField!=K)&&K.blur){K.blur()}var O=B.inputField?B.ifFormat:B.daFormat;var Q=false;var P=window.calendar;if(B.canType&&(B.inputField==K)&&P&&!P.hidden){return }if(!(P&&B.cache)){window.calendar=P=new Zapatec.Calendar(B.firstDay,B.date,B.onSelect||H,B.onClose||function(R){if(B.cache){R.hide()}else{R.destroy()}});P.id=B.id;P.disableFdowClick=B.disableFdowChange;P.showsTime=B.showsTime;P.time24=(B.timeFormat=="24");P.timeInterval=B.timeInterval;P.weekNumbers=B.weekNumbers;P.numberMonths=B.numberMonths;P.controlMonth=B.controlMonth;P.vertical=B.vertical;P.monthsInRow=B.monthsInRow;P.historyDateFormat=B.ifFormat||B.daFormat;P.helpButton=!B.noHelp;P.disableDrag=B.disableDrag;P.closeButton=!B.noCloseButton;P.yearNav=!B.disableYearNav;P.sortOrder=B.sortOrder.toLowerCase();Q=true}else{if(B.date){P.setDate(B.date)}P.hide()}if(B.multiple){P.setMultipleDates(B.multiple)}P.showsOtherMonths=B.showOthers;P.yearStep=B.step;P.setRange(B.range[0],B.range[1]);P.params=B;P.setDateStatusHandler(B.dateStatusFunc);P.getDateText=B.dateText;P.setDateFormat(O);if(Q){P.create()}if(L){var M;if(L.value){M=L.value}else{M=L.innerHTML}if(M!=""){var N=Date.parseDate(L.value||L.innerHTML,O);if(N!=null){P.setDate(N)}}}if(!B.position){P.showAtElement(B.button||B.displayArea||B.inputField,B.align)}else{P.showAt(B.position[0],B.position[1])}return false};if(B.closeEventName){K["on"+B.closeEventName]=function(){if(window.calendar){window.calendar.callCloseHandler()}}}return A};

Zapatec.Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Zapatec.Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Zapatec.Calendar._FD=0;Zapatec.Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Zapatec.Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Zapatec.Calendar._TT_en=Zapatec.Calendar._TT={};Zapatec.Calendar._TT.INFO="About the calendar";Zapatec.Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) zapatec.com 2002-2007\nFor latest version visit: http://www.zapatec.com/\n\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Zapatec.Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Zapatec.Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Zapatec.Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Zapatec.Calendar._TT.GO_TODAY="Go Today (hold for history)";Zapatec.Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Zapatec.Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Zapatec.Calendar._TT.SEL_DATE="Select date";Zapatec.Calendar._TT.DRAG_TO_MOVE="Drag to move";Zapatec.Calendar._TT.PART_TODAY=" (today)";Zapatec.Calendar._TT.DAY_FIRST="Display %s first";Zapatec.Calendar._TT.WEEKEND="0,6";Zapatec.Calendar._TT.CLOSE="Close";Zapatec.Calendar._TT.TODAY="Today";Zapatec.Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Zapatec.Calendar._TT.DEF_DATE_FORMAT="%m/%d/%Y";Zapatec.Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Zapatec.Calendar._TT.WK="wk";Zapatec.Calendar._TT.TIME="Time:";Zapatec.Calendar._TT.E_RANGE="Outside the range";Zapatec.Calendar._TT._AMPM={am:"am",pm:"pm"};if(Zapatec.Calendar._DN){Zapatec.Calendar._TT._DN=Zapatec.Calendar._DN}if(Zapatec.Calendar._SDN){Zapatec.Calendar._TT._SDN=Zapatec.Calendar._SDN}if(Zapatec.Calendar._SDN_len){Zapatec.Calendar._TT._SDN_len=Zapatec.Calendar._SDN_len}if(Zapatec.Calendar._MN){Zapatec.Calendar._TT._MN=Zapatec.Calendar._MN}if(Zapatec.Calendar._SMN){Zapatec.Calendar._TT._SMN=Zapatec.Calendar._SMN}if(Zapatec.Calendar._SMN_len){Zapatec.Calendar._TT._SMN_len=Zapatec.Calendar._SMN_len}Zapatec.Calendar._DN=Zapatec.Calendar._SDN=Zapatec.Calendar._SDN_len=Zapatec.Calendar._MN=Zapatec.Calendar._SMN=Zapatec.Calendar._SMN_len=null;

if(typeof addEvent!="function"){var addEvent=function(B,J,F,E){var G="addEventListener",C="on"+J,I=B,H=J,D=F,A=E;if(B[G]&&!E){return B[G](J,F,false)}if(!B._evts){B._evts={}}if(!B._evts[J]){B._evts[J]=B[C]?{b:B[C]}:{};B[C]=new Function("e",'var r=true,o=this,a=o._evts["'+J+'"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');if(J!="unload"){addEvent(window,"unload",function(){removeEvent(I,H,D,A)})}}if(!F._i){F._i=addEvent._i++}B._evts[J][F._i]=F};addEvent._i=1;var removeEvent=function(E,B,C,A){var D="removeEventListener";if(E[D]&&!A){return E[D](B,C,false)}if(E._evts&&E._evts[B]&&C._i){delete E._evts[B][C._i]}}}function cancelEvent(A,B){A.returnValue=false;if(A.preventDefault){A.preventDefault()}if(B){A.cancelBubble=true;if(A.stopPropagation){A.stopPropagation()}}}function SuperNote(B,A){var E={myName:B,allowNesting:false,cssProp:"visibility",cssVis:"inherit",cssHid:"hidden",IESelectBoxFix:true,showDelay:0,hideDelay:500,animInSpeed:0.1,animOutSpeed:0.1,animations:[],mouseX:0,mouseY:0,notes:{},rootElm:null,onshow:null,onhide:null};for(var D in E){this[D]=(typeof A[D]=="undefined")?E[D]:A[D]}var C=this;addEvent(document,"mouseover",function(F){C.mouseHandler(F,1)});addEvent(document,"mousemove",function(F){C.mouseTrack(F)});addEvent(document,"mouseout",function(F){C.mouseHandler(F,0)});this.instance=SuperNote.instances.length;SuperNote.instances[this.instance]=this}SuperNote.instances=[];SuperNote.prototype.bTypes={};SuperNote.prototype.pTypes={};SuperNote.prototype.pTypes.mouseoffset=function(obj,noteID,nextVis,nextAnim){with(obj){var note=notes[noteID];if(nextVis&&!note.animating&&!note.visible){note.ref.style.left=checkWinX(mouseX,note)+"px";note.ref.style.top=checkWinY(mouseY,note)+"px"}}};SuperNote.prototype.pTypes.mousetrack=function(obj,noteID,nextVis,nextAnim){with(obj){var note=notes[noteID];if(nextVis&&!note.animating&&!note.visible){var posString="with("+myName+'){var note=notes["'+noteID+'"];note.ref.style.left=checkWinX(mouseX,note)+"px";note.ref.style.top=checkWinY(mouseY,note)+"px"}';eval(posString);obj.IEFrameFix(noteID,1);if(!note.trackTimer){note.trackTimer=setInterval(posString,50)}}else{if(!nextVis&&!nextAnim){clearInterval(note.trackTimer);note.trackTimer=null}}}};SuperNote.prototype.pTypes.triggeroffset=function(obj,noteID,nextVis,nextAnim){with(obj){var note=notes[noteID];if(nextVis&&!note.animating&&!note.visible){var x=0,y=0,elm=note.trigRef;while(elm){x+=elm.offsetLeft;y+=elm.offsetTop;elm=elm.offsetParent}note.ref.style.left=checkWinX(x,note)+"px";note.ref.style.top=checkWinY(y,note)+"px"}}};SuperNote.prototype.bTypes.pinned=function(obj,noteID,nextVis){with(obj){return(!nextVis)?false:true}};SuperNote.prototype.docBody=function(){return document[(document.compatMode&&document.compatMode.indexOf("CSS")>-1)?"documentElement":"body"]};SuperNote.prototype.getWinW=function(){return this.docBody().clientWidth||window.innerWidth||0};SuperNote.prototype.getWinH=function(){return this.docBody().clientHeight||window.innerHeight||0};SuperNote.prototype.getScrX=function(){return this.docBody().scrollLeft||window.scrollX||0};SuperNote.prototype.getScrY=function(){return this.docBody().scrollTop||window.scrollY||0};SuperNote.prototype.checkWinX=function(newX,note){with(this){return Math.max(getScrX(),Math.min(newX,getScrX()+getWinW()-note.ref.offsetWidth-8))}};SuperNote.prototype.checkWinY=function(newY,note){with(this){return Math.max(getScrY(),Math.min(newY,getScrY()+getWinH()-note.ref.offsetHeight-8))}};SuperNote.prototype.mouseTrack=function(evt){with(this){mouseX=evt.pageX||evt.clientX+getScrX()||0;mouseY=evt.pageY||evt.clientY+getScrY()||0}};SuperNote.prototype.mouseHandler=function(evt,show){with(this){if(!document.documentElement){return true}var srcElm=evt.target||evt.srcElement,trigRE=new RegExp(myName+"-(hover|click)-([a-z0-9]+)","i"),targRE=new RegExp(myName+"-(note)-([a-z0-9]+)","i"),trigFind=1,foundNotes={};if(srcElm.nodeType!=1){srcElm=srcElm.parentNode}var elm=srcElm;while(elm&&elm!=rootElm){if(targRE.test(elm.id)||(trigFind&&trigRE.test(elm.className))){if(!allowNesting){trigFind=0}var click=RegExp.$1=="click"?1:0,noteID=RegExp.$2,ref=document.getElementById(myName+"-note-"+noteID),trigRef=trigRE.test(elm.className)?elm:null;if(ref){if(!notes[noteID]){notes[noteID]={click:click,ref:ref,trigRef:null,visible:0,animating:0,timer:null};ref._sn_obj=this;ref._sn_id=noteID}var note=notes[noteID];if(!note.click||(trigRef!=srcElm)){foundNotes[noteID]=true}if(!note.click||(show==2)){if(trigRef){notes[noteID].trigRef=notes[noteID].ref._sn_trig=elm}display(noteID,show);if(note.click&&(srcElm==trigRef)){cancelEvent(evt)}}}}if(elm._sn_trig){trigFind=1;elm=elm._sn_trig}else{elm=elm.parentNode}}if(show==2){for(var n in notes){if(notes[n].click&&notes[n].visible&&!foundNotes[n]){display(n,0)}}}}};SuperNote.prototype.display=function(noteID,show){with(this){with(notes[noteID]){clearTimeout(timer);if(!animating||(show?!visible:visible)){var tmt=animating?1:(show?showDelay||1:hideDelay||1);timer=setTimeout("SuperNote.instances["+instance+'].setVis("'+noteID+'",'+show+",false)",tmt)}}}};SuperNote.prototype.checkType=function(noteID,nextVis,nextAnim){with(this){var note=notes[noteID],bType,pType;if((/snp-([a-z]+)/).test(note.ref.className)){pType=RegExp.$1}if((/snb-([a-z]+)/).test(note.ref.className)){bType=RegExp.$1}if(nextAnim&&bType&&bTypes[bType]&&(bTypes[bType](this,noteID,nextVis)==false)){return false}if(pType&&pTypes[pType]){pTypes[pType](this,noteID,nextVis,nextAnim)}return true}};SuperNote.prototype.setVis=function(noteID,show,now){with(this){var note=notes[noteID];if(note&&checkType(noteID,show,1)||now){note.visible=show;note.animating=1;animate(noteID,show,now)}}};SuperNote.prototype.animate=function(noteID,show,now){with(this){var note=notes[noteID];if(!note.animTimer){note.animTimer=0}if(!note.animC){note.animC=0}with(note){clearTimeout(animTimer);var speed=(animations.length&&!now)?(show?animInSpeed:animOutSpeed):1;if(show&&!animC){if(onshow){this.onshow(noteID)}IEFrameFix(noteID,1);ref.style[cssProp]=cssVis}animC=Math.max(0,Math.min(1,animC+speed*(show?1:-1)));if(document.getElementById&&speed<1){for(var a=0;a<animations.length;a++){animations[a](ref,animC)}}if(!show&&!animC){if(onhide){this.onhide(noteID)}IEFrameFix(noteID,0);ref.style[cssProp]=cssHid}if(animC!=parseInt(animC)){animTimer=setTimeout(myName+'.animate("'+noteID+'",'+show+")",50)}else{checkType(noteID,animC?1:0,0);note.animating=0}}}};SuperNote.prototype.IEFrameFix=function(noteID,show){with(this){if(!window.createPopup||!IESelectBoxFix){return }var note=notes[noteID],ifr=note.iframe;if(!ifr){ifr=notes[noteID].iframe=document.createElement("iframe");ifr.setAttribute("src",CS_BASE_URL+"/resources/blank.html");ifr.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";ifr.style.position="absolute";ifr.style.borderWidth="0";note.ref.parentNode.insertBefore(ifr,note.ref.parentNode.firstChild)}if(show){ifr.style.left=note.ref.offsetLeft+"px";ifr.style.top=note.ref.offsetTop+"px";ifr.style.width=note.ref.offsetWidth+"px";ifr.style.height=note.ref.offsetHeight+"px";ifr.style.visibility="inherit"}else{ifr.style.visibility="hidden"}}};

var HOSTURL="/";var AJAXPATH="";if(typeof (jive)=="undefined"){var jive=new Object();jive.gui=new Object();jive.model=new Object();jive.ext=new Object();jive.ext.y=new Object();jive.ext.x=new Object();jive.xml=new Object();jive.rte=new Object();jive.rte.macros=new Array()}if(typeof (console)=="undefined"){console=new Object();console.log=function(A){}}if(typeof (console.debug)!="function"){console.debug=console.log};

jive.ext.x.xMac=(navigator.appVersion.indexOf("Mac")!=-1);jive.ext.x.xWindows=!jive.ext.x.xMac;jive.ext.x.xVersion="3.15.1";jive.ext.x.xNN4=false;jive.ext.x.xOp7=false;jive.ext.x.xOp5or6=false;jive.ext.x.xIE4Up=false;jive.ext.x.xIE4=false;jive.ext.x.xIE5=false;jive.ext.x.xUA=navigator.userAgent.toLowerCase();jive.ext.x.xIE=false;jive.ext.x.xSafari=false;if(window.opera){jive.ext.x.xOp7=(jive.ext.x.xUA.indexOf("opera 7")!=-1||jive.ext.x.xUA.indexOf("opera/7")!=-1);if(!jive.ext.x.xOp7){jive.ext.x.xOp5or6=(jive.ext.x.xUA.indexOf("opera 5")!=-1||jive.ext.x.xUA.indexOf("opera/5")!=-1||jive.ext.x.xUA.indexOf("opera 6")!=-1||jive.ext.x.xUA.indexOf("opera/6")!=-1)}}else{if(document.all){jive.ext.x.xIE4Up=jive.ext.x.xUA.indexOf("msie")!=-1&&parseInt(navigator.appVersion)>=4;jive.ext.x.xIE4=jive.ext.x.xUA.indexOf("msie 4")!=-1;jive.ext.x.xIE5=jive.ext.x.xUA.indexOf("msie 5")!=-1;jive.ext.x.xIE6=jive.ext.x.xUA.indexOf("msie 6")!=-1;jive.ext.x.xIE7=jive.ext.x.xUA.indexOf("msie 7")!=-1;jive.ext.x.xIE4Up=jive.ext.x.xIE4||jive.ext.x.xIE5||jive.ext.x.xIE6;jive.ext.x.xIE=true}}if(jive.ext.x.xUA.indexOf("safari")!=-1||jive.ext.x.xUA.indexOf("Safari")!=-1){jive.ext.x.xSafari=true}jive.ext.x.xGetElementById=function(B,A){if(!$obj(A)){A=B.ownerDocument}if(B==null){return B}if(typeof (B)!="string"){return B}if(A.getElementById){B=A.getElementById(B)}else{if(A.all){B=A.all[B]}else{B=null}}return B};jive.ext.x.xParent=function(C,B){if(!(C=jive.ext.x.xGetElementById(C))){return null}var A=null;if(!B&&$def(C.offsetParent)){A=C.offsetParent}else{if($def(C.parentNode)){A=C.parentNode}else{if($def(C.parentElement)){A=C.parentElement}}}return A};var $def=function(A){return(typeof (A)!="undefined")};var $obj=function(A){return(typeof (A)=="object")};var $arr=function(A){return A!=null&&$obj(A)&&$def(A.splice)};$str=function(A){return typeof (A)=="string"};var $num=function(A){return typeof (A)=="number"};jive.ext.x.xShow=function(A){if(!(A=jive.ext.x.xGetElementById(A))){return }if(A.style&&$def(A.style.visibility)){A.style.visibility="visible"}};jive.ext.x.xHide=function(A){if(!(A=jive.ext.x.xGetElementById(A))){return }if(A.style&&$def(A.style.visibility)){A.style.visibility="hidden"}};jive.ext.x.xDisplay=function(B,A){if(!(B=jive.ext.x.xGetElementById(B))){return null}if(B.style&&$def(B.style.display)){if($str(A)){B.style.display=A}return B.style.display}return null};jive.ext.x.xDisplayNone=function(A){if(!(A=jive.ext.x.xGetElementById(A))){return }if(A.style&&$def(A.style.display)){A.style.display="none"}};jive.ext.x.xDisplayBlock=function(A){if(!(A=jive.ext.x.xGetElementById(A))){return }if(A.style&&$def(A.style.display)){A.style.display="block"}};jive.ext.x.xDisplayInline=function(A){if(!(A=jive.ext.x.xGetElementById(A))){return }if(A.style&&$def(A.style.display)){A.style.display="inline"}};jive.ext.x.xZIndex=function(B,A){if(!(B=jive.ext.x.xGetElementById(B))){return 0}if(B.style&&$def(B.style.zIndex)){if($num(A)){B.style.zIndex=A}A=parseInt(B.style.zIndex)}return A};jive.ext.x.xMoveTo=function(B,A,C){jive.ext.x.xLeft(B,A);jive.ext.x.xTop(B,C)};jive.ext.x.xLeft=function(C,A){if(!(C=jive.ext.x.xGetElementById(C))){return 0}var B=$def(C.style);if(B&&$str(C.style.left)){if($num(A)){C.style.left=A+"px"}else{A=parseInt(C.style.left);if(isNaN(A)){A=0}}}else{if(B&&$def(C.style.pixelLeft)){if($num(A)){C.style.pixelLeft=A}else{A=C.style.pixelLeft}}}return A};jive.ext.x.xTop=function(B,C){if(!(B=jive.ext.x.xGetElementById(B))){return 0}var A=$def(B.style);if(A&&$str(B.style.top)){if($num(C)){B.style.top=C+"px"}else{C=parseInt(B.style.top);if(isNaN(C)){C=0}}}else{if(A&&$def(B.style.pixelTop)){if($num(C)){B.style.pixelTop=C}else{C=B.style.pixelTop}}}return C};jive.ext.x.xPageX=function(A){var B=0;if(A.offsetParent){while(1){B+=A.offsetLeft;if(!A.offsetParent){break}A=A.offsetParent}}else{if(A.x){B+=A.x}}return B};jive.ext.x.xPageY=function(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetTop;if(!B.offsetParent){break}B=B.offsetParent}}else{if(B.y){A+=B.y}}return A};jive.ext.x.xScrollLeft=function(B){var C=0,A=B.ownerDocument;if(!(B=jive.ext.x.xGetElementById(B))){if(A.documentElement&&A.documentElement.scrollLeft){C=A.documentElement.scrollLeft}else{if(A.body&&$def(A.body.scrollLeft)){C=A.body.scrollLeft}}}else{if($num(B.scrollLeft)){C=B.scrollLeft}}return C};jive.ext.x.xScrollTop=function(B){var C=0,A=B.ownerDocument;if(!(B=jive.ext.x.xGetElementById(B))){if(A.documentElement&&A.documentElement.scrollTop){C=A.documentElement.scrollTop}else{if(A.body&&$def(A.body.scrollTop)){C=A.body.scrollTop}}}else{if($num(B.scrollTop)){C=B.scrollTop}}return C};jive.ext.x.xWidth=function(F,B){if(!(F=jive.ext.x.xGetElementById(F))){return 0}if($num(B)){if(B<0){B=0}else{B=Math.round(B)}}else{B=-1}var D=$def(F.style);if(F==document||F.tagName.toLowerCase()=="html"||F.tagName.toLowerCase()=="body"){B=jive.ext.x.xClientWidth()}else{if(D&&$def(F.offsetWidth)&&$str(F.style.width)){if(B>=0){var E=0,H=0,G=0,C=0;if(document.compatMode=="CSS1Compat"){var A=jive.ext.x.xGetCS;E=A(F,"padding-left",1);if(E!==null){H=A(F,"padding-right",1);G=A(F,"border-left-width",1);C=A(F,"border-right-width",1)}else{if($def(F.offsetWidth,F.style.width)){F.style.width=B+"px";E=F.offsetWidth-B}}}B-=(E+H+G+C);if(isNaN(B)||B<0){return }else{F.style.width=B+"px"}}B=F.offsetWidth}else{if(D&&$def(F.style.pixelWidth)){if(B>=0){F.style.pixelWidth=B}B=F.style.pixelWidth}}}return B};jive.ext.x.xCamelize=function(B){var C,E,A=B.split("-");var D=A[0];for(C=1;C<A.length;++C){E=A[C].charAt(0);D+=A[C].replace(E,E.toUpperCase())}return D};jive.ext.x.xGetCS=function(E,D){try{if(!(E=jive.ext.x.xGetElementById(E))){return null}var C,A="undefined",B=E.ownerDocument.defaultView;if(B&&B.getComputedStyle){C=B.getComputedStyle(E,"");if(C){A=C.getPropertyValue(D)}}else{if(E.currentStyle){A=E.currentStyle[jive.ext.x.xCamelize(D)]}else{return null}}if($str(A)&&A.indexOf("px")>0){A=A.substr(0,A.indexOf("px"));A=parseInt(A)}return A}catch(E){return""}};jive.ext.x.xSetCH=function(E,D){var G=0,B=0,A=0,H=0,F=E.ownerDocument;if($def(F.defaultView)&&$def(F.defaultView.getComputedStyle)){G=jive.ext.x.xGetCS(E,"padding-top");B=jive.ext.x.xGetCS(E,"padding-bottom");A=jive.ext.x.xGetCS(E,"border-top-width");H=jive.ext.x.xGetCS(E,"border-bottom-width")}else{if($def(E.currentStyle,F.compatMode)){if(F.compatMode=="CSS1Compat"){G=parseInt(E.currentStyle.paddingTop);B=parseInt(E.currentStyle.paddingBottom);A=parseInt(E.currentStyle.borderTopWidth);H=parseInt(E.currentStyle.borderBottomWidth)}}else{if($def(E.offsetHeight,E.style.height)){E.style.height=D+"px";G=E.offsetHeight-D}}}if(isNaN(G)){G=0}if(isNaN(B)){B=0}if(isNaN(A)){A=0}if(isNaN(H)){H=0}var C=D-(G+B+A+H);if(isNaN(C)||C<0){return }else{E.style.height=C+"px"}};jive.ext.x.xHeight=function(C,B){if(!(C=jive.ext.x.xGetElementById(C))){return 0}if($num(B)){if(B<0){B=0}else{B=Math.round(B)}}else{B=0}var A=$def(C.style);if(A&&$def(C.offsetHeight)&&$str(C.style.height)){if(B){jive.ext.x.xSetCH(C,B)}B=C.offsetHeight}else{if(A&&$def(C.style.pixelHeight)){if(B){C.style.pixelHeight=B}B=C.style.pixelHeight}}return B};jive.ext.x.xHasPoint=function(I,E,D,B,C,A,F){if(!$num(B)){B=C=A=F=0}else{if(!$num(C)){C=A=F=B}else{if(!$num(A)){F=C;A=B}}}var H=jive.ext.x.xPageX(I),G=jive.ext.x.xPageY(I);return(E>=H+F&&E<=H+jive.ext.x.xWidth(I)-C&&D>=G+B&&D<=G+jive.ext.x.xHeight(I)-A)};jive.ext.x.xClientWidth=function(){var A=0;if(jive.ext.x.xOp5or6){A=window.innerWidth}else{if(!window.opera&&document.documentElement&&document.documentElement.clientWidth){A=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){A=document.body.clientWidth}else{if($def(window.innerWidth,window.innerHeight,document.height)){A=window.innerWidth;if(document.height>window.innerHeight){A-=16}}}}}return A};jive.ext.x.xClientHeight=function(){var A=0;if(jive.ext.x.xOp5or6){A=window.innerHeight}else{if(!window.opera&&document.documentElement&&document.documentElement.clientHeight){A=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){A=document.body.clientHeight}else{if($def(window.innerWidth,window.innerHeight,document.width)){A=window.innerHeight;if(document.width>window.innerWidth){A-=16}}}}}return A};jive.ext.x.xDocHeight=function(F){if(F){var B=F.body,E=F.documentElement}else{var B=document.body,E=document.documentElement}var C=0,G=0,D=0,A=0;if(E){C=E.scrollHeight;G=E.offsetHeight}if(B){D=B.scrollHeight;A=B.offsetHeight}return Math.max(C,G,D,A)};

jive.ext.x.xAddEventListener=function(e,eventType,eventListener,useCapture){if(!(e=jive.ext.x.xGetElementById(e))){return }eventType=eventType.toLowerCase();if((!jive.ext.x.xIE4Up&&!jive.ext.x.xOp7)&&e==window){if(eventType=="resize"){jive.ext.x.xPCW=jive.ext.x.xClientWidth();jive.ext.x.xPCH=jive.ext.x.xClientHeight();jive.ext.x.xREL=eventListener;jive.ext.x.xResizeEvent();return }if(eventType=="scroll"){jive.ext.x.xPSL=jive.ext.x.xScrollLeft();jive.ext.x.xPST=jive.ext.x.xScrollTop();jive.ext.x.xSEL=eventListener;jive.ext.x.xScrollEvent();return }}if(e.addEventListener){e.addEventListener(eventType,eventListener,useCapture)}else{if(e.attachEvent){e.attachEvent("on"+eventType,eventListener)}else{if(e.captureEvents){if(useCapture||(eventType.indexOf("mousemove")!=-1)){e.captureEvents(eval("Event."+eventType.toUpperCase()))}var eh="e.on"+eventType+"=eventListener";eval(eh)}else{var eh="e.on"+eventType+"=eventListener";eval(eh)}}}};jive.ext.x.xRemoveEventListener=function(e,eventType,eventListener,useCapture){if(!(e=jive.ext.x.xGetElementById(e))){return }eventType=eventType.toLowerCase();if((!jive.ext.x.xIE4Up&&!jive.ext.x.xOp7)&&e==window){if(eventType=="resize"){jive.ext.x.xREL=null;return }if(eventType=="scroll"){jive.ext.x.xSEL=null;return }}var eh="e.on"+eventType+"=null";if(e.removeEventListener){e.removeEventListener(eventType,eventListener,useCapture)}else{if(e.detachEvent){e.detachEvent("on"+eventType,eventListener)}else{if(e.releaseEvents){if(useCapture||(eventType.indexOf("mousemove")!=-1)){e.releaseEvents(eval("Event."+eventType.toUpperCase()))}eval(eh)}else{eval(eh)}}}};jive.ext.x.xStopPropagation=function(A){if(A&&A.stopPropagation){A.stopPropagation()}else{if(window.event){window.event.cancelBubble=true}}};jive.ext.x.xEvent=function(B){this.type="";this.target=null;this.keyCode=0;var E=B?B:window.event;if(!E){return }if(E.type){this.type=E.type}if(E.target){this.target=E.target}else{if(E.srcElement){this.target=E.srcElement}}var D=null;var C=null;this.pageX=function(){if(D==null){if(jive.ext.x.xOp5or6){D=E.clientX;C=E.clientY}else{if(jive.ext.x.xDef(E.clientX,E.clientY)){D=E.clientX+jive.ext.x.xScrollLeft();C=E.clientY+jive.ext.x.xScrollTop()}}}return D};this.pageY=function(){if(C==null){if(jive.ext.x.xOp5or6){D=E.clientX;C=E.clientY}else{if(jive.ext.x.xDef(E.clientX,E.clientY)){D=E.clientX+jive.ext.x.xScrollLeft();C=E.clientY+jive.ext.x.xScrollTop()}}}return C};var A=null;var F=null;this.offsetX=function(){if(A==null){if(jive.ext.x.xDef(E.layerX,E.layerY)){A=E.layerX;F=E.layerY}else{if(jive.ext.x.xDef(E.offsetX,E.offsetY)){A=E.offsetX;F=E.offsetY}else{A=this.pageX-jive.ext.x.xPageX(this.target);F=this.pageY-jive.ext.x.xPageY(this.target)}}}return A};this.offsetY=function(){if(F==null){if(jive.ext.x.xDef(E.layerX,E.layerY)){A=E.layerX;F=E.layerY}else{if(jive.ext.x.xDef(E.offsetX,E.offsetY)){A=E.offsetX;F=E.offsetY}else{A=this.pageX-jive.ext.x.xPageX(this.target);F=this.pageY-jive.ext.x.xPageY(this.target)}}}return F};if(E.keyCode){this.keyCode=E.keyCode}else{if(jive.ext.x.xDef(E.which)){this.keyCode=E.which}}};jive.ext.x.xResizeEvent=function(){if(jive.ext.x.xREL){setTimeout("jive.ext.x.xResizeEvent()",250)}var A=jive.ext.x.xClientWidth(),B=jive.ext.x.xClientHeight();if(jive.ext.x.xPCW!=A||jive.ext.x.xPCH!=B){jive.ext.x.xPCW=A;jive.ext.x.xPCH=B;if(jive.ext.x.xREL){jive.ext.x.xREL()}}};jive.ext.x.xScrollEvent=function(){if(jive.ext.x.xSEL){setTimeout("jive.ext.x.xScrollEvent()",250)}var A=jive.ext.x.xScrollLeft(),B=jive.ext.x.xScrollTop();if(jive.ext.x.xPSL!=A||jive.ext.x.xPST!=B){jive.ext.x.xPSL=A;jive.ext.x.xPST=B;if(jive.ext.x.xSEL){jive.ext.x.xSEL()}}};

jive.ext.x.xTimerMgr=function(){this.set=function(D,F,C,B,E){return(this.timers[this.timers.length]=new A(D,F,C,B,E))};this.timers=new Array();this.running=false;this.run=function(){if(this.running){return }this.running=true;var D,C,E=new Date(),B=E.getTime();for(D=0;D<this.timers.length;++D){C=this.timers[D];if(C&&C.running){C.elapsed=B-C.time0;if(C.elapsed>=C.preset){C.obj[C.mthd](C);if(C.type.charAt(0)=="i"){C.time0=B}else{C.stop()}}}}this.running=false};function A(B,E,F,C,D){this.stop=function(){this.running=false};this.start=function(){this.running=true};this.reset=function(){var G=new Date();this.time0=G.getTime();this.elapsed=0;this.running=true};this.data=D;this.type=B;this.obj=E;this.mthd=F;this.preset=C;this.reset()}};jive.ext.x.xTimer=new jive.ext.x.xTimerMgr();jive.ext.x.xAddEventListener(window,"load",function(){setInterval("jive.ext.x.xTimer.run()",250)});

jive.ext.y.HashTable=function(){var B=this;var A=0;this.getCount=function(){return A};this.undefined=new Object();this.cache=new Array();this.put=function(C,D){B.clear(C);B.cache[C]=D;A=A+1};this.get=function(C){if(typeof (B.cache[C])!="undefined"&&B.cache[C]!=B.undefined){return B.cache[C]}else{return false}};this.clear=function(C){if(B.cache[C]!=B.undefined&&B.cache[C]!=null){A=A-1}B.cache[C]=B.undefined};this.toArray=function(E){var C=new Array();for(var D in B.cache){if(typeof (E)=="function"&&E(B.cache[D])){C.push(B.cache[D])}else{if(typeof (E)!="function"&&B.cache[D]!=B.undefined&&B.cache[D]!=Array.prototype.find&&B.cache[D]!=Array.prototype.jFind&&B.cache[D]!=Array.prototype.remove&&B.cache[D]!=Array.prototype.______array&&B.cache[D]!=null){C.push(B.cache[D])}}}return C};this.toKeysArray=function(E){var C=new Array();for(var D in B.cache){C.push(D)}return D}};jive.ext.y.yBottom=function(B,C){if(!(B=jive.ext.x.xGetElementById(B))){return 0}var A=$def(B.style);if(A&&$str(B.style.bottom)){if($num(C)){B.style.bottom=C+"px"}else{C=parseInt(B.style.bottom);if(isNaN(C)){C=0}}}else{if(A&&$def(B.style.pixelBottom)){if($num(C)){B.style.pixelBottom=C}else{C=B.style.pixelBottom}}}return C};jive.ext.y.yOpacity=function(A,B){if(!(A=jive.ext.x.xGetElementById(A))){return }if(jotlet.external.x.xNum(B)){if(B<0){B=0}else{if(B>100){B=100}else{B=Math.round(B)}}if(jotlet.external.x.xDef(A.style.MozOpacity)){A.style.MozOpacity=(B/100);return A.style.MozOpacity*100}if(jotlet.external.x.xDef(A.style.opacity)){A.style.opacity=(B/100);return A.style.opacity*100}if(jotlet.external.x.xStr(A.style.filter)){A.style.filter="alpha(opacity="+(B)+")";A.yOpacity=B;return A.yOpacity}}if(jotlet.external.x.xDef(A.style.MozOpacity)){return A.style.MozOpacity*100}if(jotlet.external.x.xDef(A.style.opacity)){return A.style.opacity*100}if(jotlet.external.x.xDef(A.filters)&&jotlet.external.x.xDef(A.filters.alpha)&&jotlet.external.x.xDef(A.filters.alpha.opacity)){return A.filters.alpha.opacity}};

jive.ext.y.yAjax=function(A,D){var E=false;if(window.XMLHttpRequest){E=new XMLHttpRequest();if(E.overrideMimeType){E.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{E=new ActiveXObject("Msxml2.XMLHTTP")}catch(C){try{E=new ActiveXObject("Microsoft.XMLHTTP")}catch(C){}}}}if(!E){return false}E.onreadystatechange=B;function B(){try{if(E.readyState==4){if(E.status==200){A(E.responseText)}else{D()}}}catch(F){}}this.POST=function(F,G){E.open("POST",F,true);E.setRequestHeader("Content-type","application/x-www-form-urlencoded");E.setRequestHeader("Content-length",G.length);E.setRequestHeader("Connection","close");E.send(G)}};

jive.xml._Xparse_count=0;jive.xml._Xparse_index=new Array();jive.xml._entity=function(C){var B=new Array();B=C.split("&lt;");C=B.join("<");B=C.split("&gt;");C=B.join(">");B=C.split("&quot;");C=B.join('"');B=C.split("&apos;");C=B.join("'");B=C.split("&amp;");C=B.join("&");return C};jive.xml._strip=function(C){var B=new Array();B=C.split("\n");C=B.join("");B=C.split(" ");C=B.join("");B=C.split("\t");C=B.join("");return C};jive.xml._normalize=function(C){var B=new Array();B=C.split("\n");C=B.join(" ");B=C.split("\t");C=B.join(" ");return C};jive.xml._element=function(){this.type="element";this.tagName=new String();this.attributes=new Array();this.childNodes=new Array();this.nodeValue="";this.uid=jive.xml._Xparse_count++;jive.xml._Xparse_index[this.uid]=this};jive.xml._chardata=function(){this.type="chardata";this.value=new String()};jive.xml._pi=function(){this.type="pi";this.value=new String()};jive.xml._comment=function(){this.type="comment";this.value=new String()};jive.xml._frag=function(){this.str=new String();this.ary=new Array();this.end=new String()};jive.xml._tag_element=function(I){var J=I.str.indexOf(">");var F=(I.str.substring(J-1,J)=="/");if(F){J-=1}var G=jive.xml._normalize(I.str.substring(1,J));var C=G.indexOf(" ");var A=new String();var B=new String();if(C!=-1){B=G.substring(0,C);A=G.substring(C+1,G.length)}else{B=G}var H=I.ary.length;I.ary[H]=new jive.xml._element();I.ary[H].tagName=jive.xml._strip(B);if(A.length>0){I.ary[H].attributes=jive.xml._attribution(A)}if(!F){var E=new jive.xml._frag();E.str=I.str.substring(J+1,I.str.length);E.end=B;var D=E;E=jive.xml._compile(E);I.ary[H].childNodes=E.ary;I.ary[H].nodeValue=D;I.str=E.str}else{I.str=I.str.substring(J+2,I.str.length)}return I};jive.xml._tag_pi=function(D){var C=D.str.indexOf("?>");var B=D.str.substring(2,C);var A=D.ary.length;D.ary[A]=new jive.xml._pi();D.ary[A].nodeValue=B;D.str=D.str.substring(C+2,D.str.length);return D};jive.xml._tag_comment=function(D){var C=D.str.indexOf("-->");var B=D.str.substring(4,C);var A=D.ary.length;D.ary[A]=new jive.xml._comment();D.ary[A].nodeValue=B;D.str=D.str.substring(C+3,D.str.length);return D};jive.xml._tag_cdata=function(D){var C=D.str.indexOf("]]>");var B=D.str.substring(9,C);var A=D.ary.length;D.ary[A]=new jive.xml._chardata();D.ary[A].nodeValue=B;D.str=D.str.substring(C+3,D.str.length);return D};jive.xml._attribution=function(E){var F=new Array();while(1){var I=E.indexOf("=");if(E.length==0||I==-1){return F}var H=E.indexOf("'");var G=E.indexOf('"');var A=new Number();var C=new String();if((H<G&&H!=-1)||G==-1){A=H;C="'"}if((G<H||H==-1)&&G!=-1){A=G;C='"'}var J=E.indexOf(C,A+1);var D=E.substring(A+1,J);var B=jive.xml._strip(E.substring(0,I));F[B]=jive.xml._entity(D);E=E.substring(J+1,E.length)}return""};jive.xml._compile=function(C){while(1){if(C.str.length==0){return C}var A=C.str.indexOf("<");if(A!=0){var B=C.ary.length;C.ary[B]=new jive.xml._chardata();if(A==-1){C.ary[B].nodeValue=jive.xml._entity(C.str);C.str=""}else{C.ary[B].nodeValue=jive.xml._entity(C.str.substring(0,A));C.str=C.str.substring(A,C.str.length)}}else{if(C.str.substring(1,2)=="?"){C=jive.xml._tag_pi(C)}else{if(C.str.substring(1,4)=="!--"){C=jive.xml._tag_comment(C)}else{if(C.str.substring(1,9)=="![CDATA["){C=jive.xml._tag_cdata(C)}else{if(C.str.substring(1,C.end.length+3)=="/"+C.end+">"||jive.xml._strip(C.str.substring(1,C.end.length+3))=="/"+C.end){C.str=C.str.substring(C.end.length+3,C.str.length);C.end="";return C}else{C=jive.xml._tag_element(C)}}}}}}return""};jive.xml._prolog=function(D){var B=new Array();B=D.split("\r\n");D=B.join("\n");B=D.split("\r");D=B.join("\n");var F=D.indexOf("<");if(D.substring(F,F+3)=="<?x"||D.substring(F,F+3)=="<?X"){var C=D.indexOf("?>");D=D.substring(C+2,D.length)}var F=D.indexOf("<!DOCTYPE");if(F!=-1){var C=D.indexOf(">",F)+1;var E=D.indexOf("[",F);if(E<C&&E!=-1){C=D.indexOf("]>",F)+2}D=D.substring(C,D.length)}return D};jive.xml.Xparse=function(B){var C=new jive.xml._frag();C.str=jive.xml._prolog(B);var A=new Object();C=jive.xml._compile(C);if(C.ary.length>0){A.documentElement=C.ary[0]}else{A.documentElement=null}A.tagName="ROOT";A.index=jive.xml._Xparse_index;jive.xml._Xparse_index=new Array();return A};

jive.xml.XMLParser=function(){var F=null;if(window.ActiveXObject){var A=["MSXML4.DOMDocument","MSXML3.DOMDocument","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XmlDom"];var D=null;if(D==null){var C=false;for(var B=0;B<A.length&&!C;B++){try{D=new ActiveXObject(A[B]);C=true}catch(E){}}}if(D==null){alert("No XML parser available");return }F=function(G){D.async="false";D.loadXML(G);return D}}if(F==null&&window.DOMParser){var D=new DOMParser();F=function(I){var H=D.parseFromString(I,"text/xml");var G=H.documentElement;if((G.tagName=="parserError")||(G.namespaceURI=="http://www.mozilla.org/newlayout/xml/parsererror.xml")){return null}return H}}else{if(F==null&&document.implementation&&document.implementation.createDocument){var D=document.implementation.createDocument("","",null);F=function(G){D.async="false";D.loadXML(G);return D}}else{F=function(G){return jive.xml.Xparse(G)}}}this.parse=function(G){if(F!=null){return F(G)}else{throw"no xml parser defined"}}};

jive.model.Ajax=function(C,A,D){var B=this;this.POST=function(F,G){var E=function(J){try{var K=null;if(!$obj(K)||K==null||!$obj(K.documentElement)||K.documentElement==null){var M=new jive.xml.XMLParser();try{K=M.parse(J)}catch(L){D("XML Parse exception");return }}if($obj(K)&&K!=null&&$obj(K.documentElement)&&K.documentElement!=null){K=K.documentElement}else{D("XML Parse exception");return }if(K.tagName=="br"){D("Server Exception")}else{if(K.tagName=="NotLoggedInException"){C.handleLogIn(function(){B.POST(F,G)})}else{C.poke();A(K)}}}catch(L){alert("ajax error:"+L)}};var I=function(){D("500 Status")};var H=new jive.ext.y.yAjax(E,I);H.POST(F,G)}};

jive.model.Controller=function(){var F=this;var A=new Object();A.childNodes=new Array();this.newAjax=function(L,M){return new jive.model.Ajax(F,L,M)};var C=new jive.model.LoginManager(F);this.getLoginManager=function(){return C};var D=new jive.model.SettingsManager(F);this.getSettingsManager=function(){return D};var I=new jive.model.RefreshManager(F);this.getRefreshManager=function(){return I};var E=new jive.model.LanguageManager(F,default_lang);this.getLanguageManager=function(){return E};var K=new jive.model.ProjectCache(F);this.getProjectCache=function(){return K};var G=new jive.model.UserCache(F);this.getUserCache=function(){return G};var B=new jive.model.TaskCache(F);this.getTaskCache=function(){return B};this.handleLogIn=function(L){F.getRefreshManager().loggedOut()};this.poke=function(){F.getRefreshManager().poke()};this.isCalendarVisibleHuh=function(L){return true};this.isReadOnly=function(){return false};this.addListener=function(L){H.push(L)};var H=new Array();var J=new Array();this.addListenerAction=function(L){J.push(L)};this.executeListenerActions=function(){while(J.length>0){J[0]();J.splice(0,1)}};this.removeListener=function(M){for(var L=0;L<H.length;L++){if(H[L]==M){H.splice(L,1)}}};this.notifyTinyMCELoaded=function(){for(var L=0;L<H.length;L++){H[L].tinyMCELoaded()}F.executeListenerActions()}};

jive.model.dateLTEQ=function(B,A){return(B.getFullYear()<A.getFullYear()||B.getFullYear()==A.getFullYear()&&(B.getMonth()<A.getMonth()||B.getMonth()==A.getMonth()&&(B.getDate()<=A.getDate())))};jive.model.dateLT=function(B,A){return(B.getFullYear()<A.getFullYear()||B.getFullYear()==A.getFullYear()&&(B.getMonth()<A.getMonth()||B.getMonth()==A.getMonth()&&(B.getDate()<A.getDate())))};jive.model.dateGT=function(B,A){return jive.model.dateLT(A,B)};jive.model.dateGTEQ=function(B,A){return jive.model.dateLTEQ(A,B)};jive.model.monthYearEQ=function(B,A){return B.getMonth()==A.getMonth()&&B.getFullYear()==A.getFullYear()};jive.model.dateEQ=function(B,A){return(B.getDate()==A.getDate()&&B.getMonth()==A.getMonth()&&B.getFullYear()==A.getFullYear())};jive.model.datetimeEQ=function(B,A){return(B.getFullYear()==A.getFullYear()&&B.getMonth()==A.getMonth()&&B.getDate()==A.getDate()&&B.getHours()==A.getHours()&&B.getMinutes()==A.getMinutes())};jive.model.datetimeLTEQ=function(B,A){return(B.getFullYear()<A.getFullYear()||(B.getFullYear()==A.getFullYear()&&(B.getMonth()<A.getMonth()||B.getMonth()==A.getMonth()&&(B.getDate()<A.getDate()||B.getDate()==A.getDate()&&(B.getHours()<A.getHours()||B.getHours()==A.getHours()&&B.getMinutes()<=A.getMinutes())))))};jive.model.dateMinusMonth=function(B){var A=B.getMonth();if(B.getMonth()==0){B.setFullYear(B.getFullYear()-1);B.setMonth(11)}else{B.setMonth(B.getMonth()-1)}while(B.getMonth()==A){B.setDate(B.getDate()-1)}};jive.model.dateMinusWeek=function(A){A.setDate(A.getDate()-7)};jive.model.dateMinusDay=function(A){if(A.getDate()==0&&A.getDate()==1){A.setFullYear(A.getFullYear()-1);A.setMonth(11);A.setDate(31)}else{A.setDate(A.getDate()-1)}};jive.model.DateHelper=function(D){var A=D.getSettingsManager();var C=D.getLanguageManager();var B=this;this.readableDifference=function(G,F){var J=G.getTime()-F.getTime();J=J/1000;var I=false;if(J<=0){I=true;J=-1*J}var K="";if(J<10){return"just now"}else{if(J<20){K="a few seconds"}else{if(J<60){K="less than a minute"}else{if(J<90){K="about a minute"}else{var H=Math.ceil(J/60);if(H<=50){var N=(H==1)?"":"s";K=H+" minute"+N}else{var L=Math.ceil(H/60);if(L<20){var N=(L==1)?"":"s";K=L+" hour"+N}else{var M=Math.round(L/24);if(M<7){var N=(M==1)?"":"s";K=M+" day"+N}else{var E=Math.ceil(M/7);var N=(E==1)?"":"s";K=E+" week"+N}}}}}}}if(I){return K+" ago"}else{return"in "+K}};this.readableDateDifference=function(L,I){var G=new Date();G.setTime(L.getTime());G.setHours(0);G.setMinutes(0);G.setSeconds(0);G.setMilliseconds(0);var F=new Date();F.setTime(I.getTime());F.setHours(0);F.setMinutes(0);F.setSeconds(0);F.setMilliseconds(0);var K=G.getTime()-F.getTime();K=K/1000;var J=false;if(jive.model.dateLT(G,F)){J=true}K=Math.abs(K);var M="";var H=Math.ceil(K/60);var N=Math.ceil(H/60);var O=Math.floor(N/24);if(O==0){M="today"}else{if(O==1&&J){M="yesterday"}else{if(O==1&&!J){M="tomorrow"}else{if(O<7){var P=(O==1)?"":"s";M=O+" day"+P;if(J){M=M+" ago"}else{M="in "+M}}else{var E=Math.ceil(O/7);var P=(E==1)?"":"s";M=E+" week"+P;if(J){M=M+" ago"}else{M="in "+M}}}}}return M};this.formatToDateTime=function(K){var H=K.getFullYear();var I=K.getMonth()+1;if(I<10){I="0"+I}var F=K.getDate();if(F<10){F="0"+F}var E=K.getHours();if(E<10){E="0"+E}var J=K.getMinutes();if(J<10){J="0"+J}var G=K.getSeconds();if(G<10){G="0"+G}return H+"-"+I+"-"+F+" "+E+":"+J+":"+G};this.formatTo12HourTime=function(I){var G=A.getTimeFormat();if(G=="3:00p"){var E=I.getHours();var H=I.getMinutes();if(H<10){H="0"+H}var F="a";if(E>=12){F="p";E-=12}if(E==0){E=12}return E+":"+H+F}else{var E=I.getHours();var H=I.getMinutes();if(H<10){H="0"+H}return E+":"+H}};this.formatToHourTime=function(H){var G=A.getTimeFormat();if(G=="3:00p"){var E=H.getHours();var F="a";if(E>=12){F="p";E-=12}if(E==0){E=12}return E+F}else{var E=H.getHours();return E}};this.formatToStandardTime=function(K){var H=""+K.getFullYear();var I=K.getMonth()+1;if(I<10){I="0"+I}var F=K.getDate();if(F<10){F="0"+F}var E=K.getHours();if(E<10){E="0"+E}var J=K.getMinutes();if(J<10){J="0"+J}var G=K.getSeconds();if(G<10){G="0"+G}return H+"-"+I+"-"+F};this.formatToShortDate=function(H){var G=H.getMonth()+1;var E=H.getDate();var F=A.getDateFormat();if(F=="4/30"){return G+"/"+E}else{return E+"/"+G}};this.formatToLongDate=function(J){var E=C.getActiveLanguage();var I=E.longDay(J.getDay())+", ";var H=E.longMonth(J.getMonth());var F=J.getDate();var G=A.getDateFormat();if(G=="4/30"){if(J.getDate()==1||J.getDate()==21||J.getDate()==31){F+="st"}else{if(J.getDate()==2||J.getDate()==22){F+="nd"}else{if(J.getDate()==3||J.getDate()==23){F+="rd"}else{F+="th"}}}I+=H+" "+F}else{I+=F+" "+H}I+=", "+J.getFullYear();return I};this.formatToMediumDate=function(F){var E=B.formatToMediumDateNoYear(F);E+=", "+F.getFullYear();return E};this.formatToMediumDateNoYear=function(J){var E=C.getActiveLanguage();var I=E.shortDay(J.getDay())+", ";var H=E.shortMonth(J.getMonth());var F=J.getDate();var G=A.getDateFormat();if(G=="4/30"){if(J.getDate()==1||J.getDate()==21||J.getDate()==31){F+="st"}else{if(J.getDate()==2||J.getDate()==22){F+="nd"}else{if(J.getDate()==3||J.getDate()==23){F+="rd"}else{F+="th"}}}I+=H+" "+F}else{I+=F+" "+H}return I};this.formatToMedDate=function(K){var E=C.getActiveLanguage();var I=E.shortMonth(K.getMonth());var F=K.getDate();var J="";var H=A.getDateFormat();if(H=="4/30"){var G="";if(K.getDate()==1||K.getDate()==21||K.getDate()==31){G="st"}else{if(K.getDate()==2||K.getDate()==22){G="nd"}else{if(K.getDate()==3||K.getDate()==23){G="rd"}else{G="th"}}}J=I+" "+F+G}else{J=F+" "+I}return J};this.formatToMedLongDate=function(K){var E=C.getActiveLanguage();var I=E.longMonth(K.getMonth());var F=K.getDate();var J="";var H=A.getDateFormat();if(H=="4/30"){var G="";if(K.getDate()==1||K.getDate()==21||K.getDate()==31){G="st"}else{if(K.getDate()==2||K.getDate()==22){G="nd"}else{if(K.getDate()==3||K.getDate()==23){G="rd"}else{G="th"}}}J=I+" "+F+G}else{J=F+" "+I}return J};this.getMonthName=function(F){var E=C.getActiveLanguage();return E.longMonth(F.getMonth())}};

var default_lang={childNodes:[{childNodes:[{tagName:"lang_id",childNodes:[{nodeValue:"1"}]},{tagName:"name",childNodes:[{nodeValue:"English"}]},{childNodes:[{tagName:"eng_name",childNodes:[{nodeValue:"English"}]},{tagName:"name",childNodes:[{nodeValue:"English"}]},{tagName:"january",childNodes:[{nodeValue:"January"}]},{tagName:"february",childNodes:[{nodeValue:"February"}]},{tagName:"march",childNodes:[{nodeValue:"March"}]},{tagName:"april",childNodes:[{nodeValue:"April"}]},{tagName:"may",childNodes:[{nodeValue:"May"}]},{tagName:"june",childNodes:[{nodeValue:"June"}]},{tagName:"july",childNodes:[{nodeValue:"July"}]},{tagName:"august",childNodes:[{nodeValue:"August"}]},{tagName:"september",childNodes:[{nodeValue:"September"}]},{tagName:"october",childNodes:[{nodeValue:"October"}]},{tagName:"november",childNodes:[{nodeValue:"November"}]},{tagName:"december",childNodes:[{nodeValue:"December"}]},{tagName:"sunday",childNodes:[{nodeValue:"Sunday"}]},{tagName:"monday",childNodes:[{nodeValue:"Monday"}]},{tagName:"tuesday",childNodes:[{nodeValue:"Tuesday"}]},{tagName:"wednesday",childNodes:[{nodeValue:"Wednesday"}]},{tagName:"thursday",childNodes:[{nodeValue:"Thursday"}]},{tagName:"friday",childNodes:[{nodeValue:"Friday"}]},{tagName:"saturday",childNodes:[{nodeValue:"Saturday"}]},{tagName:"sh_january",childNodes:[{nodeValue:"Jan"}]},{tagName:"sh_february",childNodes:[{nodeValue:"Feb"}]},{tagName:"sh_march",childNodes:[{nodeValue:"Mar"}]},{tagName:"sh_april",childNodes:[{nodeValue:"Apr"}]},{tagName:"sh_may",childNodes:[{nodeValue:"May"}]},{tagName:"sh_june",childNodes:[{nodeValue:"Jun"}]},{tagName:"sh_july",childNodes:[{nodeValue:"Jul"}]},{tagName:"sh_august",childNodes:[{nodeValue:"Aug"}]},{tagName:"sh_september",childNodes:[{nodeValue:"Sep"}]},{tagName:"sh_october",childNodes:[{nodeValue:"Oct"}]},{tagName:"sh_november",childNodes:[{nodeValue:"Nov"}]},{tagName:"sh_december",childNodes:[{nodeValue:"Dec"}]},{tagName:"sh_sunday",childNodes:[{nodeValue:"Sun"}]},{tagName:"sh_monday",childNodes:[{nodeValue:"Mon"}]},{tagName:"sh_tuesday",childNodes:[{nodeValue:"Tue"}]},{tagName:"sh_wednesday",childNodes:[{nodeValue:"Wed"}]},{tagName:"sh_thursday",childNodes:[{nodeValue:"Thu"}]},{tagName:"sh_friday",childNodes:[{nodeValue:"Fri"}]},{tagName:"sh_saturday",childNodes:[{nodeValue:"Sat"}]},{tagName:"loading",childNodes:[{nodeValue:"Loading..."}]},{tagName:"sb_actions",childNodes:[{nodeValue:"Actions"}]},{tagName:"sb_my_calendars",childNodes:[{nodeValue:"My Calendars"}]},{tagName:"sb_other_calendars",childNodes:[{nodeValue:"Other Calendars"}]},{tagName:"sb_alerts",childNodes:[{nodeValue:"Alerts"}]},{tagName:"sb_general_tasks",childNodes:[{nodeValue:"General Tasks"}]},{tagName:"sb_no_tasks",childNodes:[{nodeValue:"no tasks"}]},{tagName:"sb_reminder",childNodes:[{nodeValue:"Reminder"}]},{tagName:"sb_reminders",childNodes:[{nodeValue:"Reminders"}]},{tagName:"sb_alert",childNodes:[{nodeValue:"Alert"}]},{tagName:"motto",childNodes:[{nodeValue:"Simply Spectacular Time Management"}]},{tagName:"nav_month",childNodes:[{nodeValue:"month"}]},{tagName:"nav_week",childNodes:[{nodeValue:"week"}]},{tagName:"nav_day",childNodes:[{nodeValue:"day"}]},{tagName:"nav_today",childNodes:[{nodeValue:"today"}]},{tagName:"nav_tomorrow",childNodes:[{nodeValue:"tomorrow"}]},{tagName:"nav_refresh",childNodes:[{nodeValue:"refresh"}]},{tagName:"nav_list",childNodes:[{nodeValue:"list"}]},{tagName:"nav_overview",childNodes:[{nodeValue:"overview"}]},{tagName:"nav_feedback",childNodes:[{nodeValue:"feedback"}]},{tagName:"nav_send",childNodes:[{nodeValue:"Send"}]},{tagName:"nav_settings",childNodes:[{nodeValue:"settings"}]},{tagName:"nav_advanced",childNodes:[{nodeValue:"advanced"}]},{tagName:"nav_logout",childNodes:[{nodeValue:"logout"}]},{tagName:"nav_prelogout",childNodes:[{nodeValue:"Any unsaved changes will be lost!"}]},{tagName:"nav_back",childNodes:[{nodeValue:"Back to:"}]},{tagName:"nav_event",childNodes:[{nodeValue:"event"}]},{tagName:"nav_task",childNodes:[{nodeValue:"task"}]},{tagName:"nav_invite",childNodes:[{nodeValue:"Invite!"}]},{tagName:"nav_save",childNodes:[{nodeValue:"Save"}]},{tagName:"nav_filter",childNodes:[{nodeValue:"filter"}]},{tagName:"feedback_title",childNodes:[{nodeValue:"What do you think about Jotlet?"}]},{tagName:"feedback_name",childNodes:[{nodeValue:"your name:"}]},{tagName:"feedback_body",childNodes:[{nodeValue:"we welcome brutal honesty:"}]},{tagName:"feedback_error",childNodes:[{nodeValue:"There was an error sending your feedback. Please try again in a few minutes."}]},{tagName:"feedback_thanks",childNodes:[{nodeValue:"Thanks for your feedback!"}]},{tagName:"cal_create",childNodes:[{nodeValue:"create a calendar"}]},{tagName:"cal_add",childNodes:[{nodeValue:"Add Calendar"}]},{tagName:"cal_edit",childNodes:[{nodeValue:"Edit Calendar"}]},{tagName:"cal_delete",childNodes:[{nodeValue:"Delete Calendar"}]},{tagName:"cal_remove",childNodes:[{nodeValue:"Remove Calendar"}]},{tagName:"cal_name",childNodes:[{nodeValue:"calendar name"}]},{tagName:"cal_color",childNodes:[{nodeValue:"select a color for this calendar:"}]},{tagName:"color_red",childNodes:[{nodeValue:"red"}]},{tagName:"color_blue",childNodes:[{nodeValue:"blue"}]},{tagName:"color_green",childNodes:[{nodeValue:"green"}]},{tagName:"color_pink",childNodes:[{nodeValue:"pink"}]},{tagName:"color_purple",childNodes:[{nodeValue:"purple"}]},{tagName:"color_orange",childNodes:[{nodeValue:"orange"}]},{tagName:"color_yellow",childNodes:[{nodeValue:"yellow"}]},{tagName:"color_grey",childNodes:[{nodeValue:"grey"}]},{tagName:"nav_close",childNodes:[{nodeValue:"Close"}]},{tagName:"nav_cancel",childNodes:[{nodeValue:"Cancel"}]},{tagName:"event_menu",childNodes:[{nodeValue:"Add Event to..."}]},{tagName:"event_edit",childNodes:[{nodeValue:"edit event"}]},{tagName:"event_edit_cap",childNodes:[{nodeValue:"Edit Event"}]},{tagName:"event_loading",childNodes:[{nodeValue:"Loading Add Event Page..."}]},{tagName:"event_add",childNodes:[{nodeValue:"add event"}]},{tagName:"event_title",childNodes:[{nodeValue:"event title"}]},{tagName:"event_dt",childNodes:[{nodeValue:"date &amp; time"}]},{tagName:"event_begins",childNodes:[{nodeValue:"begins"}]},{tagName:"event_ends",childNodes:[{nodeValue:"ends"}]},{tagName:"event_at",childNodes:[{nodeValue:"at"}]},{tagName:"event_allday",childNodes:[{nodeValue:"This event is an all day event"}]},{tagName:"event_repeats",childNodes:[{nodeValue:"This event repeats"}]},{tagName:"event_desc",childNodes:[{nodeValue:"description"}]},{tagName:"event_add_cap",childNodes:[{nodeValue:"Add Event"}]},{tagName:"event_update",childNodes:[{nodeValue:"Update Event"}]},{tagName:"event_remind",childNodes:[{nodeValue:"Add Reminder"}]},{tagName:"event_sb_delete",childNodes:[{nodeValue:"Delete this event"}]},{tagName:"event_sb_delete_series",childNodes:[{nodeValue:"Delete this series"}]},{tagName:"event_sb_edit",childNodes:[{nodeValue:"Edit this event"}]},{tagName:"event_sb_export",childNodes:[{nodeValue:"Download this event"}]},{tagName:"event_sb_perm",childNodes:[{nodeValue:"This is a shared calendar. You do not have permission to edit or delete information."}]},{tagName:"task_menu",childNodes:[{nodeValue:"Add Task to..."}]},{tagName:"task_edit",childNodes:[{nodeValue:"edit task"}]},{tagName:"task_loading",childNodes:[{nodeValue:"Loading Add Task Page..."}]},{tagName:"task_title",childNodes:[{nodeValue:"task title"}]},{tagName:"task_due_date",childNodes:[{nodeValue:"due date"}]},{tagName:"task_due",childNodes:[{nodeValue:"due"}]},{tagName:"task_no_due",childNodes:[{nodeValue:"This task does not have a due date"}]},{tagName:"task_repeats",childNodes:[{nodeValue:"This task repeats"}]},{tagName:"task_add_cap",childNodes:[{nodeValue:"Add Task"}]},{tagName:"task_update",childNodes:[{nodeValue:"Update Task"}]},{tagName:"task_add",childNodes:[{nodeValue:"add task"}]},{tagName:"task_sb_delete",childNodes:[{nodeValue:"Delete this task"}]},{tagName:"task_sb_delete_series",childNodes:[{nodeValue:"Delete this series"}]},{tagName:"task_sb_edit",childNodes:[{nodeValue:"Edit this task"}]},{tagName:"task_sb_export",childNodes:[{nodeValue:"Download this task"}]},{tagName:"task_sb_perm",childNodes:[{nodeValue:"This is a shared calendar. You do not have permission to edit   or delete information."}]},{tagName:"info_in_cal",childNodes:[{nodeValue:"in the %sub% calendar"}]},{tagName:"info_no_desc",childNodes:[{nodeValue:"no description"}]},{tagName:"info_on",childNodes:[{nodeValue:"on"}]},{tagName:"info_never",childNodes:[{nodeValue:"never"}]},{tagName:"info_no_title",childNodes:[{nodeValue:"no title"}]},{tagName:"info_more",childNodes:[{nodeValue:"More Info"}]},{tagName:"info_allday",childNodes:[{nodeValue:"All Day"}]},{tagName:"info_minutes",childNodes:[{nodeValue:"minutes"}]},{tagName:"info_hours",childNodes:[{nodeValue:"hours"}]},{tagName:"info_duration",childNodes:[{nodeValue:"duration"}]},{tagName:"day_notes",childNodes:[{nodeValue:"click to add daily notes"}]},{tagName:"day_tasks",childNodes:[{nodeValue:"Tasks for the Day"}]},{tagName:"day_add_task",childNodes:[{nodeValue:"add new task"}]},{tagName:"day_all_day",childNodes:[{nodeValue:"All Day Events"}]},{tagName:"day_click",childNodes:[{nodeValue:"click here to add some notes"}]},{tagName:"day_saving",childNodes:[{nodeValue:"saving..."}]},{tagName:"day_loading",childNodes:[{nodeValue:"loading..."}]},{tagName:"manage_cal",childNodes:[{nodeValue:"Calendar Management"}]},{tagName:"manage_prop",childNodes:[{nodeValue:"calendar properties"}]},{tagName:"manage_share",childNodes:[{nodeValue:"share calendar"}]},{tagName:"manage_export",childNodes:[{nodeValue:"export calendar"}]},{tagName:"manage_delete",childNodes:[{nodeValue:"delete calendar: "}]},{tagName:"manage_remove",childNodes:[{nodeValue:"remove calendar: "}]},{tagName:"manage_edit",childNodes:[{nodeValue:"edit a calendar"}]},{tagName:"manage_select_buddies",childNodes:[{nodeValue:"Select which buddies to share with from the list on the right"}]},{tagName:"manage_add_buddy",childNodes:[{nodeValue:"Add Buddy"}]},{tagName:"manage_add_buddy_link",childNodes:[{nodeValue:"Add a Buddy!"}]},{tagName:"manage_no_buddies",childNodes:[{nodeValue:"No Buddies Here :("}]},{tagName:"manage_buddy_email",childNodes:[{nodeValue:"enter buddy's email address"}]},{tagName:"manage_buddy_name",childNodes:[{nodeValue:"Buddy Name:"}]},{tagName:"manage_invite_buddy",childNodes:[{nodeValue:"Invite Your Buddy!"}]},{tagName:"manage_invite_buddy_to",childNodes:[{nodeValue:"Invite %sub% to Jotlet!"}]},{tagName:"manage_go_back",childNodes:[{nodeValue:"Go Back"}]},{tagName:"manage_share_bang",childNodes:[{nodeValue:"Share!"}]},{tagName:"manage_share_self",childNodes:[{nodeValue:"You can't share with yourself! :)"}]},{tagName:"manage_buddy_in_list",childNodes:[{nodeValue:"%sub% is already in your buddy list"}]},{tagName:"manage_valid_email",childNodes:[{nodeValue:"Please enter a valid email address"}]},{tagName:"manage_searching",childNodes:[{nodeValue:"Searching..."}]},{tagName:"manage_adding_buddy",childNodes:[{nodeValue:"Adding Buddy..."}]},{tagName:"manage_done_sharing",childNodes:[{nodeValue:"Done Sharing!"}]},{tagName:"manage_error",childNodes:[{nodeValue:"There was an error trying to share"}]},{tagName:"manage_sharing",childNodes:[{nodeValue:"Sharing with Buddy..."}]},{tagName:"manage_add_fail",childNodes:[{nodeValue:"could not add buddy :("}]},{tagName:"manage_inviting",childNodes:[{nodeValue:"Inviting Buddy..."}]},{tagName:"manage_done_inviting",childNodes:[{nodeValue:"Done Inviting!"}]},{tagName:"manage_fail_inviting",childNodes:[{nodeValue:"Error Inviting"}]},{tagName:"manage_done_invite_msg",childNodes:[{nodeValue:"We'll let you know when your buddy has accepted the invitation to Jotlet."}]},{tagName:"manage_fail_invite_msg",childNodes:[{nodeValue:"There was an error inviting your buddy. Please try again in a few minutes."}]},{tagName:"manage_subscribe",childNodes:[{nodeValue:"Subscribe"}]},{tagName:"manage_export_bang",childNodes:[{nodeValue:"Export"}]},{tagName:"confirm_del_cal",childNodes:[{nodeValue:'Delete calendar "%sub%"?\nThis cannot be undone!'}]},{tagName:"confirm_rem_cal",childNodes:[{nodeValue:'Remove calendar "%sub%"?\nThis cannot be undone!'}]},{tagName:"confirm_del_event",childNodes:[{nodeValue:'Delete event "%sub%"?\nThis cannot be undone!'}]},{tagName:"confirm_del_event_s",childNodes:[{nodeValue:'Delete event series containing "%sub%"?\nThis cannot be undone!'}]},{tagName:"confirm_del_task",childNodes:[{nodeValue:'Delete task "%sub%"?\nThis cannot be undone!'}]},{tagName:"confirm_del_task_s",childNodes:[{nodeValue:'Delete task series containing "%sub%"?\nThis cannot be undone!'}]},{tagName:"setting_title",childNodes:[{nodeValue:"Personal Settings"}]},{tagName:"setting_first",childNodes:[{nodeValue:"First Name"}]},{tagName:"setting_last",childNodes:[{nodeValue:"Last Name"}]},{tagName:"setting_email",childNodes:[{nodeValue:"Email"}]},{tagName:"setting_sms",childNodes:[{nodeValue:"SMS"}]},{tagName:"setting_zip",childNodes:[{nodeValue:"Postal Code"}]},{tagName:"setting_language",childNodes:[{nodeValue:"Language"}]},{tagName:"setting_save",childNodes:[{nodeValue:"Save Profile"}]},{tagName:"setting_old_pass",childNodes:[{nodeValue:"Old Password"}]},{tagName:"setting_new_pass",childNodes:[{nodeValue:"New Password"}]},{tagName:"setting_confirm",childNodes:[{nodeValue:"Confirm"}]},{tagName:"setting_save_pass",childNodes:[{nodeValue:"Update Password"}]},{tagName:"setting_zone",childNodes:[{nodeValue:"Time zone"}]},{tagName:"setting_zone_desc",childNodes:[{nodeValue:"Time zones are listed with an * if they respect Daylight Savings Time"}]},{tagName:"setting_save_zone",childNodes:[{nodeValue:"Save Local Settings"}]},{tagName:"setting_zoom",childNodes:[{nodeValue:"Zoom Level"}]},{tagName:"setting_zoom_desc",childNodes:[{nodeValue:"The zoom level affects how much time each row in day view represents. The 1 hour zoom will show a compact view, while the 15 minute zoom will show more detail."}]},{tagName:"setting_zoom_15_min",childNodes:[{nodeValue:"15 minutes"}]},{tagName:"setting_zoom_30_min",childNodes:[{nodeValue:"30 minutes"}]},{tagName:"setting_zoom_1_hour",childNodes:[{nodeValue:"1 hour"}]},{tagName:"setting_save_zoom",childNodes:[{nodeValue:"Save Zoom"}]},{tagName:"setting_shade",childNodes:[{nodeValue:"Smart-Shading day cells"}]},{tagName:"setting_shade_desc",childNodes:[{nodeValue:"Smart-Shading will automatically darken the background of busier days in month view. The busier the day, the darker the cell."}]},{tagName:"setting_save_shade",childNodes:[{nodeValue:"Save Month Settings"}]},{tagName:"setting_profile",childNodes:[{nodeValue:"user profile"}]},{tagName:"setting_change_pass",childNodes:[{nodeValue:"change password"}]},{tagName:"setting_time_zones",childNodes:[{nodeValue:"time zones"}]},{tagName:"setting_day_view",childNodes:[{nodeValue:"day view"}]},{tagName:"setting_month_view",childNodes:[{nodeValue:"month view"}]},{tagName:"setting_start_week",childNodes:[{nodeValue:"Start of Week:  "}]},{tagName:"err_cal_name",childNodes:[{nodeValue:"Please enter a name for the calendar"}]},{tagName:"email_invite",childNodes:[{nodeValue:"Hey!\n\nCheck out Jotlet Calendar at www.jotlet.net! It's a great looking and easy to use online calendar.\n\nSign up so I can share my schedule with you!"}]},{tagName:"err_task_title",childNodes:[{nodeValue:"Please enter a title for your task."}]},{tagName:"err_event_title",childNodes:[{nodeValue:"Please enter a title for your event."}]},{tagName:"remind_adding",childNodes:[{nodeValue:"Adding Reminder..."}]},{tagName:"remind_loading",childNodes:[{nodeValue:"Loading Reminder..."}]},{tagName:"remind_email",childNodes:[{nodeValue:"Email"}]},{tagName:"remind_sms",childNodes:[{nodeValue:"Text Message"}]},{tagName:"remind_both",childNodes:[{nodeValue:"Both"}]},{tagName:"remind_5_min",childNodes:[{nodeValue:"5 minutes"}]},{tagName:"remind_4_hour",childNodes:[{nodeValue:"4 hours"}]},{tagName:"remind_0_day",childNodes:[{nodeValue:"the same day"}]},{tagName:"remind_1_day",childNodes:[{nodeValue:"the day before"}]},{tagName:"remind_2_day",childNodes:[{nodeValue:"2 days before"}]},{tagName:"remind_3_day",childNodes:[{nodeValue:"3 days before"}]},{tagName:"remind_4_day",childNodes:[{nodeValue:"4 days before"}]},{tagName:"remind_5_day",childNodes:[{nodeValue:"5 days before"}]},{tagName:"remind_1_week",childNodes:[{nodeValue:"1 week before"}]},{tagName:"remind_2_week",childNodes:[{nodeValue:"2 weeks before"}]},{tagName:"remind_event",childNodes:[{nodeValue:"%email% me %time% before this event"}]},{tagName:"remind_task_due",childNodes:[{nodeValue:"%email% me at %time%%date% its due"}]},{tagName:"remind_task_no",childNodes:[{nodeValue:"%email% me at %time% on %date%"}]},{tagName:"recur_daily",childNodes:[{nodeValue:"daily"}]},{tagName:"recur_daily_num",childNodes:[{nodeValue:"every %num% days"}]},{tagName:"recur_daily_weekday",childNodes:[{nodeValue:"every weekday"}]},{tagName:"recur_weekly",childNodes:[{nodeValue:"weekly"}]},{tagName:"recur_weekly_num",childNodes:[{nodeValue:"every %num% weeks on:"}]},{tagName:"recur_monthly",childNodes:[{nodeValue:"monthly"}]},{tagName:"recur_monthly_num",childNodes:[{nodeValue:"day %num% of every %num2% months"}]},{tagName:"recur_monthly_date",childNodes:[{nodeValue:"the %first% %weekday% of every %num% months"}]},{tagName:"recur_yearly",childNodes:[{nodeValue:"yearly"}]},{tagName:"recur_yearly_exact",childNodes:[{nodeValue:"every %month% %day%"}]},{tagName:"recur_yearly_rel",childNodes:[{nodeValue:"the %first% %weekday% of %month%"}]},{tagName:"recur_custom",childNodes:[{nodeValue:"custom"}]},{tagName:"recur_custom_desc",childNodes:[{nodeValue:"Select your custom series of dates from the small calendar on the left."}]},{tagName:"recur_custom_dates",childNodes:[{nodeValue:"Selected Dates: "}]},{tagName:"recur_end",childNodes:[{nodeValue:"End Series:"}]},{tagName:"recur_end_after_e",childNodes:[{nodeValue:"End after %num% events"}]},{tagName:"recur_end_after_t",childNodes:[{nodeValue:"End after %num% tasks"}]},{tagName:"recur_end_by",childNodes:[{nodeValue:"by %date%"}]},{tagName:"recur_event",childNodes:[{nodeValue:"Repeat this event: "}]},{tagName:"recur_task",childNodes:[{nodeValue:"Repeat this task: "}]},{tagName:"recur_first",childNodes:[{nodeValue:"first"}]},{tagName:"recur_second",childNodes:[{nodeValue:"second"}]},{tagName:"recur_third",childNodes:[{nodeValue:"third"}]},{tagName:"recur_fourth",childNodes:[{nodeValue:"fourth"}]},{tagName:"recur_fifth",childNodes:[{nodeValue:"fifth"}]},{tagName:"recur_last",childNodes:[{nodeValue:"last"}]}],tagName:"lang_table"}],tagName:"language"}],tagName:"languages"};

jive.model.isLanguage=function(A){return $def(A)&&$obj(A)&&A!=null&&$def(A.translate)&&$def(A.getId)};jive.model.Language=function(E,B,D){var C=this;this.getId=function(){return E};this.getName=function(){return B};this.translate=function(F){var G=D.get(F);if(G==false){alert('Language Exception: key "'+F+'" not found')}else{if(G=="_"){return" "}else{G=G.replace(/#xD#xA/g,"\r\n");return G}}};var A=new Array();A.push("red"),A.push("blue"),A.push("green"),A.push("pink"),A.push("purple"),A.push("orange"),A.push("yellow"),A.push("grey");this.color=function(F){return C.translate("color_"+A[F])};this.longMonth=function(F){var G=new Array();G.push("january");G.push("february");G.push("march");G.push("april");G.push("may");G.push("june");G.push("july");G.push("august");G.push("september");G.push("october");G.push("november");G.push("december");return C.translate(G[F])};this.shortMonth=function(F){var G=new Array();G.push("sh_january");G.push("sh_february");G.push("sh_march");G.push("sh_april");G.push("sh_may");G.push("sh_june");G.push("sh_july");G.push("sh_august");G.push("sh_september");G.push("sh_october");G.push("sh_november");G.push("sh_december");return C.translate(G[F])};this.longDay=function(F){var G=new Array();G.push("sunday");G.push("monday");G.push("tuesday");G.push("wednesday");G.push("thursday");G.push("friday");G.push("saturday");return C.translate(G[F])};this.shortDay=function(F){var G=new Array();G.push("sh_sunday");G.push("sh_monday");G.push("sh_tuesday");G.push("sh_wednesday");G.push("sh_thursday");G.push("sh_friday");G.push("sh_saturday");return C.translate(G[F])};this.weekNumber=function(F){var G=new Array();G.push("recur_first");G.push("recur_second");G.push("recur_third");G.push("recur_fourth");G.push("recur_fifth");G.push("recur_last");return C.translate(G[F])}};jive.model.LanguageManager=function(D,J){var G=this;var E=null;var F=new Array();var A=new jive.ext.y.HashTable();var I=new Array();this.getActiveLanguage=function(){return E};this.setActiveLanguage=function(K){if(jive.model.isLanguage(K)){E=K;G.notifyLanguageChanged(E)}else{return false}};this.getLanguageList=function(){return A.toArray()};this.getSilentLanguages=function(){return F};this.loadLanguage=function(L){G.notifyLoadBegin();var K=D.newAjax(G.loadOk,G.loadFail);K.POST(HOSTURL+AJAXPATH+"?load_language","lang_id="+L)};this.saveLanguage=function(L){G.notifyLoadBegin();var M=function(O){return function(P){G.loadOk(P);var Q=A.get(O);if($obj(Q)&&Q!=null){G.setActiveLanguage(Q)}}}(L);var N=A.get(L);if($obj(N)&&N!=null){M=function(O){return function(P){G.setActiveLanguage(A.get(O))}}(L)}var K=D.newAjax(M,G.loadFail);K.POST(HOSTURL+AJAXPATH+"?save_language","lang_id="+L)};function C(P){var K;if(P.childNodes.length>0){if(P.childNodes[0].tagName=="language"){if(P.childNodes[0].childNodes.length>0){B=P.childNodes[0];var N="";var R=0;var Q=new jive.ext.y.HashTable();for(var M=0;M<B.childNodes.length;M++){if(B.childNodes[M].tagName=="name"){N=B.childNodes[M].childNodes[0].nodeValue}else{if(B.childNodes[M].tagName=="lang_id"){R=B.childNodes[M].childNodes[0].nodeValue}else{if(B.childNodes[M].tagName=="lang_table"){var O=B.childNodes[M];for(var L=0;L<O.childNodes.length;L++){Q.put(O.childNodes[L].tagName,O.childNodes[L].childNodes[0].nodeValue)}}}}}B=new jive.model.Language(R,N,Q);A.put(B.getId(),B)}else{return false}}else{return false}}else{return false}return B}this.loadOk=function(K){if(!C(K)){G.notifyLoadFail()}else{G.notifyLoadFinish()}};this.loadFail=function(){G.notifyLoadFail()};this.addListener=function(K){I.push(K)};this.removeListener=function(L){for(var K=0;K<I.length;K++){if(I[K]==L){I.splice(K,1)}}};this.notifyLoadBegin=function(){for(var K=0;K<I.length;K++){I[K].beginLoadingLanguages()}};this.notifyLoad=function(L){for(var K=0;K<I.length;K++){I[K].loadLanguage(L)}};this.notifyLoadFinish=function(){for(var K=0;K<I.length;K++){I[K].doneLoadingLanguages()}};this.notifyLoadFail=function(){for(var K=0;K<I.length;K++){I[K].loadingLanguagesFailed()}};this.notifyLanguageChanged=function(L){for(var K=0;K<I.length;K++){I[K].languageChanged(L)}};try{if($def(J)){var B=C(J);if($obj(B)&&B!=null){G.setActiveLanguage(B)}else{alert("error parsing")}}else{alert("no default langauge")}}catch(H){alert("language: "+H)}};

jive.model.LoginManager=function(H){var F=this;var E=new Array();var B=new Array();function A(I){try{var L=new jive.xml.XMLParser();var J=L.parse(I);if($obj(J.documentElement)&&J.documentElement!=null){J=J.documentElement}else{J=new Object();J.childNodes=new Array();J.tagName="failed"}if(J.tagName=="success"){F.notifyLoginOk()}else{F.notifyLoginFail()}}catch(K){alert(K)}}function D(){F.notifyLoginFail()}this.login=function(J){var I=new jotlet.external.y.yAjax(A,D);alert("logging in via ajax")};var C=false;function G(){while(B.length>0){B[0]();B.splice(0,1)}}this.addListener=function(I){if(!C){E.push(I)}else{B.push(function(){F.addListener(I)})}};this.removeListener=function(J){if(!C){for(var I=0;I<E.length;I++){if(E[I]==J){E.splice(I,1)}}}else{B.push(function(){F.removeListener(J)})}};this.notifyLoginOk=function(){C=true;for(var I=0;I<E.length;I++){E[I].loginOk()}C=false;G()};this.notifyLoginFail=function(){C=true;for(var I=0;I<E.length;I++){E[I].loginFail()}C=false;G()}};

jive.model.RefreshManager=function(H){var I=this;var L=new Array();var A=H.getSettingsManager().getGMT();var D=H.getSettingsManager().getGMT();var B=true;this.poke=function(){try{if(B){A=H.getSettingsManager().getGMT()}}catch(N){alert("refresh error:"+N)}};this.loggedOut=function(){B=false};function F(S,Q){try{I.notifyRefreshing();S.setTime(S.getTime()-5);var T=new jive.model.DateHelper(H);var R=T.formatToDateTime(S);var O=H.newAjax(E,G);var P=T.formatToDateTime(H.getEventCache().getMinTime());var N=T.formatToDateTime(H.getEventCache().getMaxTime());O.POST(HOSTURL+AJAXPATH+"?refresh","dt="+encodeURIComponent(R)+"&mindt="+P+"&maxdt="+N+(Q?"&all":""))}catch(U){alert("refreshing: "+U)}}this.refresh=function(){if(B){F(D,false)}};this.reload=function(O){var N=D;I.notifyRefreshing();E(O);D=N};var K=new jive.ext.y.HashTable();this.getCustomCache=function(N){var O=K.get(N);if(!$obj(O)){O=new jive.ext.y.HashTable();K.put(N,O)}return O};function C(N){var O=new jive.ext.y.HashTable();K.put(N,O);return O}function M(P){for(var O=0;O<P.childNodes.length;O++){var R=C(P.childNodes[O].tagName);for(var N=0;N<P.childNodes[O].childNodes.length;N++){var Q=parseInt(P.childNodes[O].childNodes[N].childNodes[0].nodeValue);R.put(Q,true)}}}function E(U){try{B=true;for(var R=0;R<U.childNodes.length;R++){if(U.childNodes[R].tagName=="projects"){if(U.childNodes[R].childNodes.length>0){H.getProjectCache().loadExternalProjects(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="events"){if(U.childNodes[R].childNodes.length>0){H.getEventCache().reloadEvents(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="del_cals"){try{if(U.childNodes[R].childNodes.length>0){H.getCalendarCache().unloadCalendars(U.childNodes[R])}}catch(T){alert("error unloading calendars: "+T)}}else{if(U.childNodes[R].tagName=="del_events"){try{if(U.childNodes[R].childNodes.length>0){H.getEventCache().unloadEvents(U.childNodes[R])}}catch(T){alert("error unloading calendars: "+T)}}else{if(U.childNodes[R].tagName=="event_cache"){try{if(U.childNodes[R].childNodes.length>0){M(U.childNodes[R])}}catch(T){alert("error unloading calendars: "+T)}}else{if(U.childNodes[R].tagName=="reminders"){if(U.childNodes[R].childNodes.length>0){H.getReminderCache().reloadReminders(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="comments"){if(U.childNodes[R].childNodes.length>0){H.getCommentCache().reloadComments(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="forms"){if(U.childNodes[R].childNodes.length>0){H.getFormManager().reloadForms(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="sync"){if($def(H.getSyncManager)){H.getSyncManager().reloadSync(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="calendars"){if(U.childNodes[R].childNodes.length>0){H.getCalendarCache().reloadCalendars(U.childNodes[R])}}else{if(U.childNodes[R].tagName=="settings"){H.getSettingsManager().reloadSettings(U.childNodes[R])}else{if(U.childNodes[R].tagName=="deleted"){try{var W=U.childNodes[R];for(var Q=0;Q<W.childNodes.length;Q++){if(W.childNodes[R].tagName=="event"){var X=parseInt(W.childNodes[Q].nodeValue);var O=H.getEventCache().getTaskSilent(V);H.getEventCache().notifyDeletingEvent(O);H.getEventCache().notifyDoneDeletingEvent(O)}else{if(W.childNodes[R].tagName=="task"){var V=parseInt(W.childNodes[Q].nodeValue);var P=H.getEventCache().getTaskSilent(V);H.getEventCache().notifyDeletingTask(P);H.getEventCache().notifyDoneDeletingTask(P)}else{if(W.childNodes[R].tagName=="calendar"){var S=parseInt(W.childNodes[Q].nodeValue);var N=H.getCalendarCache().getCalendar(S);if($obj(N)&&N!=null){H.getCalendarCache().notifyDeletingCalendar(N);H.getCalendarCache().notifyDoneDeletingCalendar(N)}}}}}}catch(T){alert("exception refreshing deleted items: "+T)}}}}}}}}}}}}}}D=H.getSettingsManager().getGMT();I.notifyDoneRefreshing()}catch(T){alert("refresh.js:loadXML: "+T)}}function G(){I.notifyRefreshingFailed()}this.loadRemoteXML=function(N){I.notifyRefreshing();E(N)};this.addListener=function(N){L.push(N)};this.removeListener=function(O){for(var N=0;N<L.length;N++){if(L[N]==O){L.splice(N,1)}}};this.notifyRefreshing=function(){for(var N=0;N<L.length;N++){L[N].refreshing()}};this.notifyDoneRefreshing=function(){for(var N=0;N<L.length;N++){L[N].doneRefreshing()}};this.notifyRefreshingFailed=function(){for(var N=0;N<L.length;N++){L[N].refreshingFailed()}};var J=new Object();J.loginOk=function(){var O=new jive.model.DateHelper(H);if(A.getTime()<D.getTime()){var N=A}else{var N=D}F(N,true)};J.loginFail=function(){};H.getLoginManager().addListener(J)};

jive.model.SettingsManager=function(C){var A=null;var B=(new Date()).getTime();this.getGMT=function(){var E=new Date();if(A!=null&&E.getTime()<B+500){return A}var E=new Date();var D=new Date();D.setTime(Date.parse(E.toUTCString().substring(0,E.toUTCString().length-3)));A=D;return D};this.getNOW=function(){return new Date()};this.getStartWeekOn=function(){return 1};this.getSmartShading=function(){return true};this.getWeatherImage=function(D){return""};this.getDateFormat=function(){return"4/30"};this.getPreferredEditorMode=function(){if(preferredMode==""&&$def(WikiTextConverter)){WikiTextConverter.getPreferredEditorMode({callback:function(D){preferredMode=D},timeout:DWRTimeout,errorHandler:editorErrorHandler})}if(preferredMode==""){preferredMode="text"}return preferredMode}};

jive.model.User=function(){var E=this;var D=new Array();function B(H,I){return function(){H(I)}}this.clearRevertActions=function(){D=new Array()};this.revert=function(){while(D.length>0){D[0]();D.splice(0,1)}};var G;var F;var A;var C;this.getID=function(){return G};this.getUsername=function(){return F};this.getFullName=function(){return A};this.getURL=function(){return C};this.setID=function(H){G=H};this.setUsername=function(H){F=H};this.setFullName=function(H){D.push(B(function(I){A=I},A));A=H};this.setURL=function(H){C=H};this.cleanAfterInit=function(){E.clearRevertActions();E.setID=null;E.setUsername=null;this.setURL=null}};jive.model.UserCache=function(F){var E=this;var B=new jive.ext.y.HashTable();function G(H){var I=B.get(H.getID());if($obj(I)){I.setFullName(H.getFullName());I.clearRevertActions()}else{B.put(H.getID(),H)}E.notifyLoadUser(H)}function A(J){var H=new jive.model.User();for(var I=0;I<J.childNodes.length;I++){if(J.childNodes[I].tagName=="i"){if(J.childNodes[I].childNodes.length>0){H.setID(parseInt(J.childNodes[I].childNodes[0].nodeValue))}}else{if(J.childNodes[I].tagName=="u"){H.setUsername(J.childNodes[I].childNodes[0].nodeValue)}else{if(J.childNodes[I].tagName=="n"){H.setFullName(J.childNodes[I].childNodes[0].nodeValue)}else{if(J.childNodes[I].tagName=="url"){H.setURL(J.childNodes[I].childNodes[0].nodeValue)}}}}}H.cleanAfterInit();G(H);return H}this.loadExternalUser=function(I){E.notifyLoadBegin();try{var H=A(I);E.notifyLoadFinish();return H}catch(J){E.notifyLoadFail()}return null};this.addListener=function(H){D.push(H)};var D=new Array();var C=new Array();this.addListenerAction=function(H){C.push(H)};this.executeListenerActions=function(){while(C.length>0){C[0]();C.splice(0,1)}};this.removeListener=function(I){for(var H=0;H<D.length;H++){if(D[H]==I){D.splice(H,1)}}};this.notifyLoadUser=function(I){for(var H=0;H<D.length;H++){D[H].loadUser(I)}E.executeListenerActions()};this.notifyLoadBegin=function(){for(var H=0;H<D.length;H++){D[H].beginLoadingUsers()}E.executeListenerActions()};this.notifyLoadFinish=function(){for(var H=0;H<D.length;H++){D[H].doneLoadingUsers()}E.executeListenerActions()};this.notifyLoadFail=function(){for(var H=0;H<D.length;H++){D[H].loadingUsersFailed()}E.executeListenerActions()}};

jive.model.isCheckPoint=function(A){return $def(A)&&$obj(A)&&A!=null&&$def(A.isCheckPoint)};jive.model.CheckPoint=function(C){var I=this;var E=new Array();function K(L,M){return function(){L(M)}}this.clearRevertActions=function(){E=new Array()};this.revert=function(){while(E.length>0){E[0]();E.splice(0,1)}};var F=C;this.getProject=function(){return F};var B;var G=null;var D=null;var A="";var H="";var J=null;this.isCheckPoint=function(){return true};this.getID=function(){return B};this.getCreatedOn=function(){return G};this.getLastModifiedOn=function(){return D};this.getName=function(){return A};this.getDescription=function(){return H};this.getDueDate=function(){return J};this.setID=function(L){B=L};this.setCreatedOn=function(L){G=L};this.setLastModifiedOn=function(L){D=L};this.setName=function(L){E.push(K(function(M){A=M},A));A=L};this.setDescription=function(L){E.push(K(function(M){H=M},H));H=L};this.setDueDate=function(L){E.push(K(function(M){J=M},J));J=L};this.cleanAfterInit=function(){I.clearRevertActions();I.setID=null;I.setCreatedOn=null;I.setLastModifiedOn=null}};jive.model.Project=function(){var J=this;var F=new Array();function L(M,N){return function(){M(N)}}this.clearRevertActions=function(){F=new Array()};this.revert=function(){while(F.length>0){F[0]();F.splice(0,1)}};var C;var A="";var I="";var E;var K;var B;var G;var D=false;var H=new Array();this.getID=function(){return C};this.getCreator=function(){return E};this.getLastModifiedOn=function(){return B};this.getName=function(){return A};this.getDescription=function(){return I};this.getDueDate=function(){return K};this.getTasks=function(){return G};this.isEditable=function(){return D};this.getCheckPoints=function(){return H};this.setID=function(M){C=M};this.setCreator=function(M){E=M};this.setEditable=function(M){D=M};this.setLastModifiedOn=function(M){B=M};this.setName=function(M){F.push(L(function(N){A=N},A));A=M};this.setDescription=function(M){F.push(L(function(N){I=N},I));I=M};this.setDueDate=function(M){F.push(L(function(N){K=N},K));K=M};this.setTasks=function(M){G=M};this.setCheckPoints=function(M){H=M};this.cleanAfterInit=function(){J.clearRevertActions();J.setID=null;J.setCreator=null;J.setEditable=null;J.setLastModifiedOn=null;J.setCheckPoints=null}};jive.model.ProjectCache=function(G){var F=this;var C=new jive.ext.y.HashTable();this.getProject=function(I){return C.get(I)};function B(I){var J=C.get(I.getID());if($obj(J)){J.setCreator(I.getCreator());J.setDescription(I.getDescription());J.setDueDate(I.getDueDate());J.clearRevertActions()}else{C.put(I.getID(),I)}F.notifyLoadProject(I)}function H(P){var Q=new Array();for(var N=0;N<P.childNodes.length;N++){var L=new jive.model.Project();var T=P.childNodes[N];var O=new Array();for(var M=0;M<T.childNodes.length;M++){if(T.childNodes[M].tagName=="id"){if(T.childNodes[M].childNodes.length>0){L.setID(T.childNodes[M].childNodes[0].nodeValue)}}else{if(T.childNodes[M].tagName=="name"){if(T.childNodes[M].childNodes.length>0){L.setName(T.childNodes[M].childNodes[0].nodeValue)}}else{if(T.childNodes[M].tagName=="desc"){if(T.childNodes[M].childNodes.length>0){L.setDescription(T.childNodes[M].childNodes[0].nodeValue)}}else{if(T.childNodes[M].tagName=="creator"){var R=T.childNodes[M];var V=G.getUserCache().loadExternalUser(R.childNodes[0]);L.setCreator(V)}else{if(T.childNodes[M].tagName=="d_on"){var I=T.childNodes[M].childNodes[0].nodeValue;if(I!=null){L.setDueDate(new Date(I.replace(/-/g,"/")))}else{L.setDueDate(null)}}else{if(T.childNodes[M].tagName=="m_on"){var I=T.childNodes[M].childNodes[0].nodeValue;if(I!=null){L.setLastModifiedOn(new Date(I.replace(/-/g,"/")))}else{L.setLastModifiedOn(null)}}else{if(T.childNodes[M].tagName=="editable"){L.setEditable(true)}else{if(T.childNodes[M].tagName=="tasks"){var R=T.childNodes[M];var V=G.getTaskCache().loadExternalTasks(R);L.setTasks(V)}else{if(T.childNodes[M].tagName=="cps"){var R=T.childNodes[M];for(var K=0;K<R.childNodes.length;K++){var U=R.childNodes[K];var S=new jive.model.CheckPoint(L);for(var J=0;J<U.childNodes.length;J++){if(U.childNodes[J].tagName=="id"){if(U.childNodes[J].childNodes.length>0){S.setID(U.childNodes[J].childNodes[0].nodeValue)}}else{if(U.childNodes[J].tagName=="c_on"){var I=U.childNodes[J].childNodes[0].nodeValue;if(I!=null){S.setCreatedOn(new Date(I.replace(/-/g,"/")))}else{S.setCreatedOn(null)}}else{if(U.childNodes[J].tagName=="m_on"){var I=U.childNodes[J].childNodes[0].nodeValue;if(I!=null){S.setLastModifiedOn(new Date(I.replace(/-/g,"/")))}else{S.setLastModifiedOn(null)}}else{if(U.childNodes[J].tagName=="nm"){if(U.childNodes[J].childNodes.length>0){S.setName(U.childNodes[J].childNodes[0].nodeValue)}}else{if(U.childNodes[J].tagName=="desc"){if(U.childNodes[J].childNodes.length>0){S.setName(U.childNodes[J].childNodes[0].nodeValue)}}else{if(U.childNodes[J].tagName=="due"){if(U.childNodes[J].childNodes.length>0){var I=U.childNodes[J].childNodes[0].nodeValue;if(I!=null){S.setDueDate(new Date(I.replace(/-/g,"/")))}else{S.setDueDate(null)}}}}}}}}}O.push(S);L.setCheckPoints(O)}}}}}}}}}}}L.cleanAfterInit();B(L);Q.push(L)}return Q}this.loadExternalProjects=function(J){F.notifyLoadBegin();try{var I=H(J);F.notifyLoadFinish();return I}catch(K){F.notifyLoadFail()}return null};this.canEditProjectHuh=function(I){if(I==0){return true}};this.addListener=function(I){E.push(I)};var E=new Array();var A=0;var D=new Array();this.addListenerAction=function(I){D.push(I)};this.executeListenerActions=function(){while(D.length>0){D[0]();D.splice(0,1)}};this.removeListener=function(J){if(A==0){for(var I=0;I<E.length;I++){if(E[I]==J){E.splice(I,1)}}}else{F.addListenerAction(function(K){return function(){F.removeListener(K)}}(J))}};this.notifyLoadProject=function(J){A++;for(var I=0;I<E.length;I++){E[I].loadProject(J)}A--;F.executeListenerActions()};this.notifyLoadBegin=function(){A++;for(var I=0;I<E.length;I++){E[I].beginLoadingProjects()}A--;F.executeListenerActions()};this.notifyLoadFinish=function(){A++;for(var I=0;I<E.length;I++){E[I].doneLoadingProjects()}A--;F.executeListenerActions()};this.notifyLoadFail=function(){A++;for(var I=0;I<E.length;I++){E[I].loadingProjectsFailed()}A--;F.executeListenerActions()}};

jive.model.ProjectCacheListener=function(){this.loadProject=function(A){};this.beginLoadingProjects=function(){};this.doneLoadingProjects=function(){};this.loadingProjectsFailed=function(){}};

jive.model.isDocument=function(A){return $obj(A)&&A!=null&&$def(A.getBody)&&$def(A.getSubject)};jive.model.Document=function(){var E=this;var D=new Array();function A(G,H){return function(){G(H)}}this.clearRevertActions=function(){D=new Array()};this.revert=function(){while(D.length>0){D[0]();D.splice(0,1)}};this.confirm=function(){E.notifyTaskChanged()};var F;var B;this.getID=function(){return F};this.getHTML=function(){return B};this.setID=function(G){F=G};this.setHTML=function(G){D.push(A(function(H){B=H},B));B=G};this.cleanAfterInit=function(){E.clearRevertActions();E.setID=null};this.convertToWiki=function(){objectLookupSessionKey};var C=new Array();this.addListener=function(G){C.push(G)};this.removeListener=function(H){for(var G=0;G<C.length;G++){if(C[G]==H){C.splice(G,1)}}};this.notifyDocumentChanged=function(){for(var G=0;G<C.length;G++){C[G].documentChanged(E)}}};jive.model.DocumentCache=function(D){var F=this;var A=new jive.ext.y.HashTable();function J(){this.documentChanged=function(K){F.notifyDocumentChanged(K)}}function E(L){var K=A.get(L.getID());if($obj(K)){K.clearRevertActions()}else{L.addListener(new J());A.put(L.getID(),L)}F.notifyLoadDocument(L)}this.saveDocument=function(M){F.notifySavingDocument(M);try{var L=D.getSettingsManager();var N=new jive.model.DateHelper(D);var K=D.newAjax(function(P){try{if(P.tagName=="success"){F.notifyDoneSavingDocument(M)}else{F.notifySavingDocumentFailed(M)}}catch(Q){alert(Q)}},function(){try{F.notifySavingDocumentFailed(M)}catch(P){alert("saving failed: "+P)}})}catch(O){F.notifySavingDocumentFailed(M)}};function C(K){F.notifyNewDocumentFromWiki(new jive.model.Document("",K))}this.newDocumentFromWiki=function(K){if(!$def(window.objectLookupSessionKey)){throw"window.objectLookupSessionKey must be defined to use newDocumentFromWiki()"}if(!$def(WikiTextConverter)){throw"WikiTextConverter must be defined to use newDocumentFromWiki()"}WikiTextConverter.convertFromWiki(K,window.objectLookupSessionKey,{callback:C,timeout:DWRTimeout,errorHandler:F.notifyNewDocumentFromWikiFailed})};function B(O){var M=new Array();for(var N=0;N<O.childNodes.length;N++){var K=new jive.model.Document();var P=O.childNodes[N];for(var L=0;L<P.childNodes.length;L++){if(P.childNodes[L].tagName=="id"){if(P.childNodes[L].childNodes.length>0){K.setID(P.childNodes[L].childNodes[0].nodeValue)}}}M.push(K);K.cleanAfterInit();E(K)}return M}this.loadExternalDocuments=function(L){F.notifyLoadBegin();try{var K=loadDocumentsXML(L);F.notifyLoadFinish();return K}catch(M){F.notifyLoadFail()}return null};this.addListener=function(K){H.push(K)};var H=new Array();var I=new Array();this.addListenerAction=function(K){I.push(K)};this.executeListenerActions=function(){while(I.length>0){I[0]();I.splice(0,1)}};this.removeListener=function(L){for(var K=0;K<H.length;K++){if(H[K]==L){H.splice(K,1)}}};this.notifyDocumentChanged=function(L){for(var K=0;K<H.length;K++){H[K].documentChanged(L)}F.executeListenerActions()};this.notifyLoadDocument=function(L){for(var K=0;K<H.length;K++){H[K].loadDocument(L)}F.executeListenerActions()};this.notifyLoadBegin=function(){for(var K=0;K<H.length;K++){H[K].beginLoadingDocuments()}F.executeListenerActions()};this.notifyLoadFinish=function(){for(var K=0;K<H.length;K++){H[K].doneLoadingDocuments()}F.executeListenerActions()};this.notifyLoadFail=function(){for(var K=0;K<H.length;K++){H[K].loadingDocumentsFailed()}F.executeListenerActions()};this.notifySavingDocument=function(L){for(var K=0;K<H.length;K++){H[K].savingDocument(L)}F.executeListenerActions()};this.notifyDoneSavingDocument=function(L){for(var K=0;K<H.length;K++){H[K].doneSavingDocument(L)}F.executeListenerActions()};this.notifySavingDocumentFailed=function(L){for(var K=0;K<H.length;K++){H[K].savingDocumentFailed(L)}F.executeListenerActions()};this.notifyNewDocumentFromWiki=function(L){for(var K=0;K<H.length;K++){H[K].newDocumentFromWiki(L)}F.executeListenerActions()};this.notifyNewDocumentFromWikiFailed=function(){for(var K=0;K<H.length;K++){H[K].newDocumentFromWikiFailed(p)}F.executeListenerActions()};var G=new jive.model.DocumentCacheListener();G.documentChanged=function(K){F.saveDocument(K)};F.addListener(G)};

jive.model.DocumentCacheListener=function(){this.loadingDocumentsFailed=function(){};this.doneLoadingDocuments=function(){};this.beginLoadingDocuments=function(){};this.loadDocument=function(){};this.documentChanged=function(){};this.savingDocument=function(){};this.doneSavingDocument=function(){};this.savingDocumentFailed=function(){};this.newDocumentFromWikiFailed=function(){}};

jive.model.TaskCacheListener=function(){this.loadingTasksFailed=function(){};this.doneLoadingTasks=function(){};this.beginLoadingTasks=function(){};this.loadTask=function(){};this.taskChanged=function(){}};

jive.model.isEvent=function(A){return $obj(A)&&A!=null&&$def(A.getStart)&&$def(A.getEnd)};jive.model.isTask=function(A){return $obj(A)&&A!=null&&$def(A.getDueDate)&&$def(A.getProjectID)};jive.model.Task=function(){var H=this;var E=0;var D=new Array();function P(Q,R){return function(){Q(R)}}this.clearRevertActions=function(){D=new Array()};this.revert=function(){while(D.length>0){D[0]();D.splice(0,1)}};this.confirm=function(){H.notifyTaskChanged()};var C;var O=E;var I=null;var K;var M;var G;var F;var N;var L;var B;var A;this.getID=function(){return C};this.getProjectID=function(){return O};this.getDueDate=function(){return I};this.hasDueDate=function(){return I!=null};this.getSubject=function(){return K};this.getDescription=function(){return M};this.getCreatedBy=function(){return G};this.getCreatedOn=function(){return F};this.getAssignedBy=function(){return L};this.getAssignedTo=function(){return N};this.getURL=function(){return A};this.isComplete=function(){return B};this.setID=function(Q){C=Q};this.setProjectID=function(Q){O=Q};this.setCreatedBy=function(Q){G=Q};this.setCreatedOn=function(Q){F=Q};this.setComplete=function(Q){B=Q};this.setURL=function(Q){A=Q};this.setDueDate=function(Q){D.push(P(function(R){I=R},I));I=Q};this.setSubject=function(Q){D.push(P(function(R){K=R},K));K=Q};this.setDescription=function(Q){D.push(P(function(R){M=R},M));M=Q};this.setAssignedBy=function(Q){D.push(P(function(R){L=R},L));L=Q};this.setAssignedTo=function(Q){D.push(P(function(R){N=R},N));N=Q};this.cleanAfterInit=function(){H.clearRevertActions();H.setID=null;H.setCreatedBy=null;H.setCreatedOn=null;H.setURL=null};var J=new Array();this.addListener=function(Q){J.push(Q)};this.removeListener=function(R){for(var Q=0;Q<J.length;Q++){if(J[Q]==R){J.splice(Q,1)}}};this.notifyTaskChanged=function(){for(var Q=0;Q<J.length;Q++){J[Q].taskChanged(H)}}};jive.model.TaskCache=function(D){var F=this;var A=new jive.ext.y.HashTable();function C(){this.taskChanged=function(J){F.notifyTaskChanged(J)}}function E(K){var J=A.get(K.getID());if($obj(J)){J.setDueDate(K.getDueDate());J.setSubject(K.getSubject());J.setDescription(K.getDescription());J.setAssignedTo(K.getAssignedTo());J.setAssignedBy(K.getAssignedBy());J.clearRevertActions()}else{K.addListener(new C());A.put(K.getID(),K)}F.notifyLoadTask(K)}this.saveTask=function(J){F.notifySavingTask(J);try{var L=D.getSettingsManager();var Q=new jive.model.DateHelper(D);var S=D.newAjax(function(U){try{if(U.tagName=="success"){F.notifyDoneSavingTask(J)}else{F.notifySavingTaskFailed(J)}}catch(V){alert(V)}},function(){try{F.notifySavingTaskFailed(J)}catch(U){alert("saving failed: "+U)}});var P=J.getDueDate();P=(P!=null)?Q.formatToDateTime(P):"";var M=!J.hasDueDate();var N=J.getStatus();var R=J.getSubject();var T=J.getDescription();var K=J.getProjectID();S.POST(HOSTURL+AJAXPATH+"?save_task","task_id="+encodeURIComponent(J.getID())+"&due="+encodeURIComponent(P)+"&status="+encodeURIComponent(N)+"&title="+encodeURIComponent(R)+"&description="+encodeURIComponent(T)+"&never_due="+encodeURIComponent(M?"1":"0")+"&project_id="+K)}catch(O){F.notifySavingTaskFailed(J)}};function B(O){var L=new Array();for(var M=0;M<O.childNodes.length;M++){var J=new jive.model.Task();var P=O.childNodes[M];for(var K=0;K<P.childNodes.length;K++){if(P.childNodes[K].tagName=="id"){if(P.childNodes[K].childNodes.length>0){J.setID(P.childNodes[K].childNodes[0].nodeValue)}}else{if(P.childNodes[K].tagName=="pid"){if(P.childNodes[K].childNodes.length>0){J.setProjectID(P.childNodes[K].childNodes[0].nodeValue)}}else{if(P.childNodes[K].tagName=="due"){var N=P.childNodes[K].childNodes[0].nodeValue;if(N!=null){J.setDueDate(new Date(N.replace(/-/g,"/")))}else{J.setDueDate(null)}}else{if(P.childNodes[K].tagName=="subj"){J.setSubject(P.childNodes[K].childNodes[0].nodeValue)}else{if(P.childNodes[K].tagName=="desc"){J.setDescription(P.childNodes[K].childNodes[0].nodeValue)}else{if(P.childNodes[K].tagName=="c_on"){var N=P.childNodes[K].childNodes[0].nodeValue;if(N!=null){J.setCreatedOn(new Date(N.replace(/-/g,"/")))}else{J.setCreatedOn(null)}}else{if(P.childNodes[K].tagName=="c_by"){J.setCreatedBy(D.getUserCache().loadExternalUser(P.childNodes[K].childNodes[0]))}else{if(P.childNodes[K].tagName=="a_by"){J.setAssignedBy(D.getUserCache().loadExternalUser(P.childNodes[K].childNodes[0]))}else{if(P.childNodes[K].tagName=="a_to"){J.setAssignedTo(D.getUserCache().loadExternalUser(P.childNodes[K].childNodes[0]))}else{if(P.childNodes[K].tagName=="url"){J.setURL(P.childNodes[K].childNodes[0].nodeValue)}else{if(P.childNodes[K].tagName=="status"){J.setComplete(P.childNodes[K].nodeValue=="c")}}}}}}}}}}}}L.push(J);J.cleanAfterInit();E(J)}return L}this.loadExternalTasks=function(K){F.notifyLoadBegin();try{var J=B(K);F.notifyLoadFinish();return J}catch(L){F.notifyLoadFail()}return null};this.addListener=function(J){H.push(J)};var H=new Array();var I=new Array();this.addListenerAction=function(J){I.push(J)};this.executeListenerActions=function(){while(I.length>0){I[0]();I.splice(0,1)}};this.removeListener=function(K){for(var J=0;J<H.length;J++){if(H[J]==K){H.splice(J,1)}}};this.notifyTaskChanged=function(K){for(var J=0;J<H.length;J++){H[J].taskChanged(K)}F.executeListenerActions()};this.notifyLoadTask=function(K){for(var J=0;J<H.length;J++){H[J].loadTask(K)}F.executeListenerActions()};this.notifyLoadBegin=function(){for(var J=0;J<H.length;J++){H[J].beginLoadingTasks()}F.executeListenerActions()};this.notifyLoadFinish=function(){for(var J=0;J<H.length;J++){H[J].doneLoadingTasks()}F.executeListenerActions()};this.notifyLoadFail=function(){for(var J=0;J<H.length;J++){H[J].loadingTasksFailed()}F.executeListenerActions()};var G=new jive.model.TaskCacheListener();G.taskChanged=function(J){F.saveTask(J)};F.addListener(G)};

jive.rte.settings=function(D){function C(F){for(var E=0;E<jive.rte.defaultStyles.length;E++){F+=","+jive.rte.defaultStyles[E]}return F}if(D=="mini-w-quote"){var B=false;var A=jive.rte.settings(0);A.content_css=C(CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/content.css");A.theme_advanced_statusbar_location="none";A.theme_advanced_buttons1="bold,italic,underline,strikethrough,spacerbutton,bullist,numlist,spacerbutton,jiveimage,jivevideo,spacerbutton,jivelink,jiveemoticons,jivequote,spellchecker,html";delete A.theme_advanced_buttons2;delete A.theme_advanced_buttons3;A.default_height=29;return A}else{if(D=="mini"){var B=false;var A=jive.rte.settings(0);A.content_css=C(CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/content.css");A.theme_advanced_statusbar_location="none";A.theme_advanced_buttons1="bold,italic,underline,strikethrough,spacerbutton,bullist,numlist,spacerbutton,jiveimage,jivevideo,spacerbutton,jivelink,jiveemoticons,spellchecker,html";delete A.theme_advanced_buttons2;delete A.theme_advanced_buttons3;A.default_height=29;return A}else{if(D=="widget"){var B=false;var A=jive.rte.settings(0);A.content_css=C(CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/content.css");A.theme_advanced_statusbar_location="none";return A}else{if(D=="wiki"){var A=jive.rte.settings(0);A.content_css=C(CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/wiki.css");return A}else{if(D=="blog"){var A=jive.rte.settings(0);A.content_css=C(CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/blog.css");return A}else{if(D=="thread"){var A=jive.rte.settings(0);A.content_css=C(CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/thread.css");if(_jive_gui_quote_text&&_jive_gui_quote_text.length>0){A.theme_advanced_buttons1="fontselect, fontsizeselect, removeformat, magicspacer, spacerbutton,bullist, numlist, outdent, indent, spacerbutton,jivevideo,spacerbutton,jivelink,tabletoolbar,extra,jivequote,spellchecker,html"}return A}else{if(D==0){return{keep_values:true,convert_urls:false,default_height:58,theme_advanced_buttons1:"fontselect, fontsizeselect, removeformat, magicspacer, spacerbutton,bullist, numlist, outdent, indent, spacerbutton,jivevideo,spacerbutton,jivelink,tabletoolbar,extra,spellchecker,html",theme_advanced_buttons2:"bold,italic,underline,strikethrough,forecolor,jivestyle, magicspacer, spacerbutton, justifyleft,justifycenter,justifyright,justifyfull, spacerbutton,jiveimage,spacerbutton,jiveemoticons, jivemacros ",theme_advanced_buttons3:"tablecontrols",fix_list_elements:false,save_callback:"RawHTMLSaveFunction",convert_fonts_to_spans:true,font_size_style_values:"8pt,10pt,12pt,14pt,18pt,24pt,36pt",strict_loading_mode:true,body_class:"jive-widget-formattedtext",theme:"advanced",plugins:"jivebuttons,jiveemoticons,jivestyle,jivelink,jivequote,jivevideo,jiveimage,alignment,safari,spellchecker,html,style,jivelists,table,save,advimage,advlink,iespell,inlinepopups,media,contextmenu,tabletoolbar,jivemacros,jiveutil",doctype:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",content_css:CS_BASE_URL+"/resources/scripts/tiny_mce3/themes/advanced/skins/default/wiki.css",theme_advanced_resize_horizontal:false,theme_advanced_resizing:true,apply_source_formatting:true,spellchecker_languages:SPELL_LANGS,spellchecker_rpc_url:CS_BASE_URL+"/spellcheck.jspa",jive_image_picker_url:B,jive_video_picker_url:B,relative_urls:false,valid_elements:"a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev|shape<circle?default?poly?rect|style|tabindex|title|target|type|jivemacro|_.*],abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase|height|hspace|id|name|object|style|title|vspace|width],area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|shape<circle?default?poly?rect|style|tabindex|title|target],base[href|target],basefont[color|face|id|size],bdo[class|dir<ltr?rtl|id|lang|style|title],big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],blockquote[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink],br[class|clear<all?left?none?right|id|style|title],button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type|value],caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title|valign<baseline?bottom?middle?top|width],colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title|valign<baseline?bottom?middle?top|width],dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],embed[width|height|src|pluginspage|name|swliveconnect|play<true?false|loop<true?false|menu<true?false|quality<low?autolow?autohigh?high?medium?high?best|scale<default?exact?noorder|salign<l?t?r?b?tl?tr?bl?br|wmode<window?opaque?transparent|bgcolor|base|flashvars|type|allowfullscreen],fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],font[class|color|dir<ltr?rtl|face|id|lang|size|style|title],form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit|style|title|target],frame[class|frameborder|id|longdesc|marginheight|marginwidth|name|noresize<noresize|scrolling<auto?no?yes|src|style|title],frameset[class|cols|id|onload|onunload|rows|style|title],h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],head[dir<ltr?rtl|lang|profile],hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style|title|width],html[dir<ltr?rtl|lang|version],iframe[align<bottom?left?middle?right?top|class|frameborder|height|id|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style|title|width],img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|src|style|title|usemap|vspace|width|jivemacro|_.*|param_.*],input[accept|accesskey|align<bottom?left?middle?right?top|alt|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect|readonly<readonly|size|src|style|tabindex|title|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text|usemap|value],ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],isindex[class|dir<ltr?rtl|id|lang|prompt|style|title],kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type|value],link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type],map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme],noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],noscript[class|dir<ltr?rtl|id|lang|style|title],object[align<bottom?left?middle?right?top|archive|border|class|classid|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap|vspace|width],ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|start|style|title|type],optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|selected<selected|style|title|value],p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],param[id|name|type|value|valuetype<DATA?OBJECT?REF],pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|width|jivemacro|_.*],q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],script[charset|defer|language|src|type],select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name|onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style|tabindex|title],small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|jivemacro|_.*],strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],style[dir<ltr?rtl|lang|media|title|type],sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules|style|summary|title|width],tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|valign<baseline?bottom?middle?top],td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup|style|title|valign<baseline?bottom?middle?top|width],textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect|readonly<readonly|rows|style|tabindex|title],tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|valign<baseline?bottom?middle?top],th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup|style|title|valign<baseline?bottom?middle?top|width],thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|valign<baseline?bottom?middle?top],title[dir<ltr?rtl|lang],tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|valign<baseline?bottom?middle?top],tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type],var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]"}}}}}}}}};

jive.rte.ParamSet=function(){var A=this;this.name="";this.deleteAll=false;this.params=new Array();this.addParam=function(C,B){A.params.push({name:C,value:B})}};

jive.rte.RTE=function(E,J,B){var F=this;var M=false;var K=$(J);var L=document.createElement("TEXTAREA");L.style.display="none";K.parentNode.insertBefore(L,K);if(!$def(B)){B=0}var C=jive.rte.settings(B);C.mode="exact";C.elements=J;C.images_enabled=window._images_enabled;try{if(!C.jive_image_picker_url&&_jive_image_picker_url){C.jive_image_picker_url=_jive_image_picker_url}}catch(H){}if(typeof (tinyMCE)=="undefined"){M=true;L.style.display="none";K.style.display="block";K.style.height="200px"}else{try{tinyMCE.init(C)}catch(H){M=true;L.style.display="none";K.style.display="block";K.style.height="200px"}}this.isTextOnly=function(){return M};var G=null;var O=true;var D=false;var P=true;function A(){if(!F.isTextOnly()&&G==null){G=tinyMCE.getInstanceById(J);if(!$def(G)||G==null){return null}G.getContainer().childNodes[0].style.width="";G.onKeyUp.add(function(R,S){F.notifyOnKeyUp(S.keyCode)});G.onChange.add(function(R,S){F.notifyOnChange(S.keyCode)});G.onInit.add(function(R){return function(S,T){if(S.id==J){R.notifyInitFinished()}}}(F));G.onBeginSpelling.add(function(){D=true});G.onEndSpelling.add(function(){D=false});G.theme.onResize.add(function(){if(P){P=false;F.resizeTo(F.getHeight()+F.getToolbarHeight()+1);G.theme.onResize.dispatch()}else{P=true;F.notifyResized()}});G.plugins.html.registerToggleFunction(F.toggleEditorMode);window.setTimeout(function(){F.notifyInitFinished()},5000);if(window.autoSave){var Q={navigateAway:function(){if(window&&window.autoSave&&F.restoreNavigateAway){window.autoSave.confirmation=F.restoreNavigateAway;F.restoreNavigateAway=false}}};window.autoSave.addListener(Q)}}return G}this.isSpellChecking=function(){return D};this.toggleSpellChecker=function(){A().execCommand("mceSpellCheck")};this.closeAllDialogs=function(){var S=A().windowManager.windows;var R=Object.keys(S);for(var Q=0;Q<R.length;Q++){A().windowManager.close(null,S[R[Q]].id)}return S};this.addMacro=function(S,Q){var R=A();var U=R.selection.isCollapsed();var T=R.plugins.jivemacros.insertMacro(S);R.plugins.jivemacros.applyParameterSet(T,S,Q);if(U){T.setAttribute("id","__sel_me__");R.selection.setNode(T);T=R.getDoc().getElementById("__sel_me__");T.removeAttribute("id")}R.nodeChanged();return T};this.destroy=function(){tinyMCE.remove(J);L.parentNode.removeChild(L);A().getContainer().parentNode.removeChild(G.getContainer())};this.getLang=function(R,Q){return A().getLang(R,Q)};this.isReady=function(){if(F.isTextOnly()){return true}var Q=A();return Q!=null};this.getDOM=function(){return A().getContainer()};this.getID=function(){return J};this.setHTML=function(Q){if(F.isTextOnly()){return K.value=Q}L.value=Q;return A().setContent(Q)};this.getHTML=function(){if(F.isTextOnly()){return K.value}if(this.isHidden()){this.setHTML(L.value)}var Q=A().getContent();if((this.trim(Q).length>0)&&Q.indexOf("<body")!=0){Q="<body>"+Q+"</body>"}while(Q.indexOf("  ")>=0){Q=Q.replace("  ","&nbsp; ")}return Q};this.trim=function(R){var T=R.replace(/^\s\s*/,"");var Q=/\s/;var S=T.length;while(Q.test(T.charAt(--S))){}return T.slice(0,S+1)};this.show=function(){A().show();F.notifyShowing()};this.getWindow=function(){return A().getWin()};this.getBody=function(){return A().getBody()};this.focus=function(){try{if(this.isHidden()){L.focus()}else{A().focus()}}catch(Q){}};this.collapseSelection=function(){var Q=A();Q.selection.select(Q.selection.getNode());Q.selection.collapse()};this.hide=function(){A().hide()};this.isHidden=function(){return L.style.display=="block"};this.resizeTo=function(Q){var U=A().getContainer();var T=U.firstChild;if(T.nodeName.toLowerCase()!="table"){T=T.childNodes[0]}var R=jive.ext.x.xHeight(T.rows[0].cells[0]);if(T.rows.length>2){R+=jive.ext.x.xHeight(T.rows[T.rows.length-1].cells[0])}var S=A().getContentAreaContainer();var V=A().getContentAreaContainer().firstChild;tinymce.DOM.setStyle(V,"height",Q-R);tinymce.DOM.setStyle(T,"height",Q)};this.getHeight=function(){var Q=A().getContentAreaContainer().firstChild;return jive.ext.x.xHeight(Q)};this.getToolbarHeight=function(){var S=A().getContainer();var R=S.firstChild;if(R.nodeName.toLowerCase()!="table"){R=R.childNodes[0]}var Q=jive.ext.x.xHeight(R.rows[0].cells[0]);if(R.rows.length>2){Q+=jive.ext.x.xHeight(R.rows[R.rows.length-1].cells[0])}return Q};this.toggleEditorMode=function(R){if(R==J){if(window&&window.autoSave){F.restoreNavigateAway=window.autoSave.confirmation;window.autoSave.confirmation=false}var S=$(J+"_parent");if(F.isHidden()){var T=jive.ext.x.xHeight(L);L.style.display="none";F.show();F.setHTML(L.value);F.focus();F.resizeTo(T);A().plugins.jivemacros.removeDuplicateMacros(A(),A().getBody())}else{var Q=$(J+"_tbl");var T=jive.ext.x.xHeight(Q);L.value=F.getHTML(true);F.hide();L.style.display="block";K.style.display="none";jive.ext.x.xHeight(L,T);F.focus()}F.notifyDoneTogglingMode()}};this.addListener=function(Q){if($def(Q.onShow)){Q.onShow()}I.push(Q)};var I=new Array();var N=new Array();this.addListenerAction=function(Q){N.push(Q)};this.executeListenerActions=function(){while(N.length>0){N[0]();N.splice(0,1)}};this.removeListener=function(R){for(var Q=0;Q<I.length;Q++){if(I[Q]==R){I.splice(Q,1)}}};this.initted=false;this.notifyInitFinished=function(){if(!F.initted){F.initted=true;for(var Q=0;Q<I.length;Q++){I[Q].initFinished()}F.executeListenerActions()}};this.notifyOnKeyUp=function(R){for(var Q=0;Q<I.length;Q++){I[Q].onKeyUp(R)}F.executeListenerActions()};this.notifyOnChange=function(){if(O){O=false;return }for(var Q=0;Q<I.length;Q++){I[Q].onChange()}F.executeListenerActions()};this.notifyResized=function(){for(var Q=0;Q<I.length;Q++){I[Q].onResize()}F.executeListenerActions()};this.notifyShowing=function(){for(var Q=0;Q<I.length;Q++){I[Q].onShow()}F.executeListenerActions()};this.notifyDoneTogglingMode=function(){for(var Q=0;Q<I.length;Q++){I[Q].doneTogglingMode()}F.executeListenerActions()}};

jive.rte.Macro=function(D,A,E,I,B,J,C,H,F){var G=this;this.getName=function(){return D};this.getUrl=function(){return A};this.isButton=function(){return F};this.isEnabled=function(){return H};this.isShowSettings=function(){return I};this.isShowInMacroList=function(){return B};this.getMacroType=function(){return E};this.getParameterSets=function(){return J};this.getAllowedParameters=function(){return C};this.refresh=function(K,M){if(M.getAttribute("jivemacro")==this.getName()){if(this.getMacroType().toLowerCase()=="inline"){var P=M.getAttribute("_title");if($def(P)&&P!=null&&P.length>0){M.innerHTML=P;M.attributes.removeNamedItem("_title")}else{if(tinyMCE.activeEditor.dom.hasClass(M,"default_title")){var L=M.getAttribute("jivemacro");var Q=M.getAttribute("___default_attr");var O=tinyMCE.activeEditor.plugins.jivemacros.getTitleFor(L,Q);if(O&&M.innerHTML!=O[0]){M.innerHTML=O[0]}if(M.innerHTML==""){M.innerHTML="unknown"}}}}else{if(this.getMacroType().toLowerCase()=="image"){var N=window.CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/jiveemoticons/images/spacer.gif";M.setAttribute("src",N);M.setAttribute("mce_src",N)}}}}};

jive.rte.EmoticonMacro=function(){var C=this;var D=new Array();var E=new Array();D.push({name:"__jive_emoticon_name",value:["happy","laugh","silly","wink","plain","angry","blush","confused","cool","cry","devil","grin","love","mischief","sad","shocked"]});for(var A=0;A<D[0].value.length;A++){E.push({name:D[0].value[A],deleteAll:true,params:[{name:D[0].name,value:D[0].value[A]}]})}var B=new jive.rte.Macro("emoticon","","img",false,true,E,D,true,false);this.getName=B.getName;this.getUrl=B.getUrl;this.isShowInMacroList=B.isShowInMacroList;this.isShowSettings=B.isShowSettings;this.getMacroType=B.getMacroType;this.getParameterSets=B.getParameterSets;this.getAllowedParameters=B.getAllowedParameters;this.refresh=function(F,H){B.refresh(F,H);var G=H.getAttribute("_"+D[0].name);H.setAttribute("class","jive_macro jive_emote");H.setAttribute("src",window.CS_BASE_URL+"/images/emoticons/"+G+".gif");H.setAttribute("mce_src",window.CS_BASE_URL+"/images/emoticons/"+G+".gif")}};jive.rte.macros.push(new jive.rte.EmoticonMacro());

jive.rte.RTEListener=function(){this.onKeyUp=function(A){};this.onChange=function(){};this.onResize=function(){};this.onShow=function(){};this.doneTogglingMode=function(){};this.initFinished=function(){}};

jive.ext.y._sliders_on=true;jive.ext.y._sliders=new jive.ext.y.HashTable();jive.ext.y.ySlider=function(B,E,A){var D=new Array();var C=this;this.hash=0;this.name=A;this.moving=false;if(!$obj(E)||E==null){E=new Object()}if(!$def(E.timeout)||E.timeout==null){E.timeout=false}this.go=function(){try{while(C.hash==0||$obj(jive.ext.y._sliders.get(C.hash))){C.hash=Math.round(Math.random()*10000)+1}jive.ext.y._sliders.put(C.hash,this);if(!E.timeout){E.timeout=40}for(var G=0;G<D.length;G++){D[G].init()}E.slideTime=B;E.stop=false;E.B=Math.PI/(2*E.slideTime);var H=new Date();E.C=H.getTime();if(!jive.ext.y._sliders_on){E.slideTime=0}if(!C.moving){this._slide()}}catch(F){alert("error initializing slider:"+E.message)}};this._slide=function(){try{var F,J,I,K;F=new Date();I=F.getTime()-E.C;if(E.stop){C.moving=false}else{if(I<E.slideTime){setTimeout("jive.ext.y._sliders.get('"+C.hash+"')._slide();",E.timeout);var J=Math.sin(E.B*I);for(var H=0;H<D.length;H++){D[H].tick(J)}C.moving=true}else{for(var H=0;H<D.length;H++){D[H].stop()}C.moving=false}}}catch(G){alert("error sliding slider:"+E)}};this.addTicker=function(F){D.push(F)}};jive.ext.y.EndOfSlideTicker=function(A){this.init=function(){};this.tick=function(B){};this.stop=function(){A()}};jive.ext.y.SlideToTicker=function(B,A,C){this.init=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }B.xTarget=A;B.yTarget=C;B.yA=B.yTarget-jive.ext.x.xTop(B);B.xA=B.xTarget-jive.ext.x.xLeft(B);B.yD=jive.ext.x.xTop(B);B.xD=jive.ext.x.xLeft(B)};this.tick=function(D){if(!(B=jive.ext.x.xGetElementById(B))){return }var F=Math.round(B.xA*D+B.xD);var E=Math.round(B.yA*D+B.yD);jive.ext.x.xMoveTo(B,F,E)};this.stop=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }jive.ext.x.xMoveTo(B,B.xTarget,B.yTarget)}};jive.ext.y.SlideHeightToTicker=function(B,A){this.init=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }B.xTargetH=A;B.xAH=B.xTargetH-jive.ext.x.xHeight(B);B.xDH=jive.ext.x.xHeight(B)};this.tick=function(D){if(!(B=jive.ext.x.xGetElementById(B))){return }var C=Math.round(B.xAH*D+B.xDH);jive.ext.x.xHeight(B,C)};this.stop=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }jive.ext.x.xHeight(B,B.xTargetH)}};jive.ext.y.SlideWidthToTicker=function(B,A){this.init=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }B.xTargetW=A;B.xAW=B.xTargetW-jive.ext.x.xWidth(B);B.xDW=jive.ext.x.xWidth(B)};this.tick=function(C){if(!(B=jive.ext.x.xGetElementById(B))){return }var D=Math.round(B.xAW*C+B.xDW);jive.ext.x.xWidth(B,D)};this.stop=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }jive.ext.x.xWidth(B,B.xTargetW)}};jive.ext.y.SlideTopToTicker=function(B,A){this.init=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }B.xTargetT=A;B.xAT=B.xTargetT-jive.ext.x.xTop(B);B.xDT=jive.ext.x.xTop(B)};this.tick=function(D){if(!(B=jive.ext.x.xGetElementById(B))){return }var C=Math.round(B.xAT*D+B.xDT);jive.ext.x.xTop(B,C)};this.stop=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }jive.ext.x.xTop(B,B.xTargetT)}};jive.ext.y.SlideBottomToTicker=function(B,A){this.init=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }B.xTargetT=A;B.xAT=B.xTargetT-jive.ext.y.yBottom(B);B.xDT=jive.ext.y.yBottom(B)};this.tick=function(D){if(!(B=jive.ext.x.xGetElementById(B))){return }var C=Math.round(B.xAT*D+B.xDT);jive.ext.y.yBottom(B,C)};this.stop=function(){if(!(B=jive.ext.x.xGetElementById(B))){return }jive.ext.y.yBottom(B,B.xTargetT)}};jive.ext.y.SlideOpacityToTicker=function(A,B){this.init=function(){if(!(A=jive.ext.x.xGetElementById(A))){return }A.xTargetO=B;A.xAO=A.xTargetO-jive.ext.y.yOpacity(A);A.xDO=jive.ext.y.yOpacity(A)};this.tick=function(C){if(!(A=jive.ext.x.xGetElementById(A))){return }var D=Math.round(A.xAO*C+A.xDO);jive.ext.y.yOpacity(A,D)};this.stop=function(){if(!(A=jive.ext.x.xGetElementById(A))){return }jive.ext.y.yOpacity(A,A.xTargetO)}};

var tinymce={majorVersion:"3",minorVersion:"0.7",releaseDate:"2008-04-14",_init:function(){var J=this,H=document,I=window,G=navigator,B=G.userAgent,F,A,E,D;J.isOpera=I.opera&&opera.buildNumber;J.isWebKit=/WebKit/.test(B);J.isOldWebKit=J.isWebKit&&!I.getSelection().getRangeAt;J.isIE=!J.isWebKit&&!J.isOpera&&(/MSIE/gi).test(B)&&(/Explorer/gi).test(G.appName);J.isIE6=J.isIE&&/MSIE [56]/.test(B);J.isGecko=!J.isWebKit&&/Gecko/.test(B);J.isMac=B.indexOf("Mac")!=-1;if(I.tinyMCEPreInit){J.suffix=tinyMCEPreInit.suffix;J.baseURL=tinyMCEPreInit.base;return }J.suffix="";A=H.getElementsByTagName("base");for(F=0;F<A.length;F++){if(A[F].href){D=A[F].href}}function C(K){if(K.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(K.src)){if(/_(src|dev)\.js/g.test(K.src)){J.suffix="_src"}J.baseURL=K.src.substring(0,K.src.lastIndexOf("/"));if(D&&J.baseURL.indexOf("://")==-1){J.baseURL=D+J.baseURL}return J.baseURL}return null}A=H.getElementsByTagName("script");for(F=0;F<A.length;F++){if(C(A[F])){return }}E=H.getElementsByTagName("head")[0];if(E){A=E.getElementsByTagName("script");for(F=0;F<A.length;F++){if(C(A[F])){return }}}return },is:function(B,A){var C=typeof (B);if(!A){return C!="undefined"}if(A=="array"&&(B instanceof Array)){return true}return C==A},each:function(D,A,C){var E,B;if(!D){return 0}C=C||D;if(typeof (D.length)!="undefined"){for(E=0,B=D.length;E<B;E++){if(A.call(C,D[E],E,D)===false){return 0}}}else{for(E in D){if(D.hasOwnProperty(E)){if(A.call(C,D[E],E,D)===false){return 0}}}}return 1},map:function(A,B){var C=[];tinymce.each(A,function(D){C.push(B(D))});return C},grep:function(A,B){var C=[];tinymce.each(A,function(D){if(!B||B(D)){C.push(D)}});return C},inArray:function(B,C){var D,A;if(B){for(D=0,A=B.length;D<A;D++){if(B[D]===C){return D}}}return -1},extend:function(D,C){var B,A=arguments;for(B=1;B<A.length;B++){C=A[B];tinymce.each(C,function(E,F){if(typeof (E)!=="undefined"){D[F]=E}})}return D},trim:function(A){return(A?""+A:"").replace(/^\s*|\s*$/g,"")},create:function(I,A){var H=this,B,D,E,F,C,G=0;I=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(I);E=I[3].match(/(^|\.)(\w+)$/i)[2];D=H.createNS(I[3].replace(/\.\w+$/,""));if(D[E]){return }if(I[2]=="static"){D[E]=A;if(this.onCreate){this.onCreate(I[2],I[3],D[E])}return }if(!A[E]){A[E]=function(){};G=1}D[E]=A[E];H.extend(D[E].prototype,A);if(I[5]){B=H.resolve(I[5]).prototype;F=I[5].match(/\.(\w+)$/i)[1];C=D[E];if(G){D[E]=function(){return B[F].apply(this,arguments)}}else{D[E]=function(){this.parent=B[F];return C.apply(this,arguments)}}D[E].prototype[E]=D[E];H.each(B,function(J,K){D[E].prototype[K]=B[K]});H.each(A,function(J,K){if(B[K]){D[E].prototype[K]=function(){this.parent=B[K];return J.apply(this,arguments)}}else{if(K!=E){D[E].prototype[K]=J}}})}H.each(A["static"],function(J,K){D[E][K]=J});if(this.onCreate){this.onCreate(I[2],I[3],D[E].prototype)}},walk:function(C,B,D,A){A=A||this;if(C){if(D){C=C[D]}tinymce.each(C,function(F,E){if(B.call(A,F,E,D)===false){return false}tinymce.walk(F,B,D,A)})}},createNS:function(D,C){var B,A;C=C||window;D=D.split(".");for(B=0;B<D.length;B++){A=D[B];if(!C[A]){C[A]={}}C=C[A]}return C},resolve:function(D,C){var B,A;C=C||window;D=D.split(".");for(B=0,A=D.length;B<A;B++){C=C[D[B]];if(!C){break}}return C},addUnload:function(E,D){var C=this,A=window;E={func:E,scope:D||this};if(!C.unloads){function B(){var G=C.unloads,H,I;if(G){for(I in G){H=G[I];if(H&&H.func){H.func.call(H.scope,1)}}if(A.detachEvent){A.detachEvent("onbeforeunload",F);A.detachEvent("onunload",B)}else{if(A.removeEventListener){A.removeEventListener("unload",B,false)}}C.unloads=H=G=A=B=null;if(window.CollectGarbage){window.CollectGarbage()}}}function F(){var H=document;if(H.readyState=="interactive"){function G(){H.detachEvent("onstop",G);B();H=null}H.attachEvent("onstop",G);window.setTimeout(function(){H.detachEvent("onstop",G)},0)}}if(A.attachEvent){A.attachEvent("onunload",B);A.attachEvent("onbeforeunload",F)}else{if(A.addEventListener){A.addEventListener("unload",B,false)}}C.unloads=[E]}else{C.unloads.push(E)}return E},removeUnload:function(C){var A=this.unloads,B=null;tinymce.each(A,function(E,D){if(E&&E.func==C){A.splice(D,1);B=C;return false}});return B},explode:function(A,B){return tinymce.map(A.split(B||","),tinymce.trim)},_addVer:function(A,B){return A+(A.indexOf("?")==-1?"?":"&")+"v="+(tinymce.majorVersion+tinymce.minorVersion).replace(/[^0-9]/g,"")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(A){this.scope=A||this;this.listeners=[]},add:function(A,B){this.listeners.push({cb:A,scope:B||this.scope});return A},addToTop:function(A,B){this.listeners.unshift({cb:A,scope:B||this.scope});return A},remove:function(A){var B=this.listeners,C=null;tinymce.each(B,function(E,D){if(A==E.cb){C=A;B.splice(D,1);return false}});return C},dispatch:function(){var D,B=arguments,C,A=this.listeners,F;for(C=0;C<A.length;C++){try{F=A[C];D=F.cb.apply(F.scope,B)}catch(E){}if(D===false){break}}return D}});(function(){var A=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(D,F){var E=this,G,C,B;F=E.settings=F||{};if(/^(mailto|news|javascript|about):/i.test(D)||/^\s*#/.test(D)){E.source=D;return }if(D.indexOf("/")===0&&D.indexOf("//")!==0){D=(F.base_uri?F.base_uri.protocol||"http":"http")+"://mce_host"+D}if(D.indexOf("://")===-1&&D.indexOf("//")!==0){D=(F.base_uri.protocol||"http")+"://mce_host"+E.toAbsPath(F.base_uri.path,D)}D=D.replace(/@@/g,"(mce_at)");D=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(D);A(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(H,I){var J=D[I];if(J){J=J.replace(/\(mce_at\)/g,"@@")}E[H]=J});if(B=F.base_uri){if(!E.protocol){E.protocol=B.protocol}if(!E.userInfo){E.userInfo=B.userInfo}if(!E.port&&E.host=="mce_host"){E.port=B.port}if(!E.host||E.host=="mce_host"){E.host=B.host}E.source=""}},setPath:function(C){var B=this;C=/^(.*?)\/?(\w+)?$/.exec(C);B.path=C[0];B.directory=C[1];B.file=C[2];B.source="";B.getURI()},toRelative:function(B){var C=this,D;B=new tinymce.util.URI(B,{base_uri:C});if((B.host!="mce_host"&&C.host!=B.host&&B.host)||C.port!=B.port||C.protocol!=B.protocol){return B.getURI()}D=C.toRelPath(C.path,B.path);if(B.query){D+="?"+B.query}if(B.anchor){D+="#"+B.anchor}return D},toAbsolute:function(B,C){var B=new tinymce.util.URI(B,{base_uri:this});return B.getURI(this.host==B.host?C:0)},toRelPath:function(F,G){var B,E=0,C="",D;F=F.substring(0,F.lastIndexOf("/"));F=F.split("/");B=G.split("/");if(F.length>=B.length){for(D=0;D<F.length;D++){if(D>=B.length||F[D]!=B[D]){E=D+1;break}}}if(F.length<B.length){for(D=0;D<B.length;D++){if(D>=F.length||F[D]!=B[D]){E=D+1;break}}}if(E==1){return G}for(D=0;D<F.length-(E-1);D++){C+="../"}for(D=E-1;D<B.length;D++){if(D!=E-1){C+="/"+B[D]}else{C+=B[D]}}return C},toAbsPath:function(D,E){var C,B=0,F=[];D=D.split("/");E=E.split("/");A(D,function(G){if(G){F.push(G)}});D=F;for(C=E.length-1,F=[];C>=0;C--){if(E[C].length==0||E[C]=="."){continue}if(E[C]==".."){B++;continue}if(B>0){B--;continue}F.push(E[C])}C=D.length-B;if(C<=0){return"/"+F.reverse().join("/")}return"/"+D.slice(0,C).join("/")+"/"+F.reverse().join("/")},getURI:function(D){var C,B=this;if(!B.source||D){C="";if(!D){if(B.protocol){C+=B.protocol+"://"}if(B.userInfo){C+=B.userInfo+"@"}if(B.host){C+=B.host}if(B.port){C+=":"+B.port}}if(B.path){C+=B.path}if(B.query){C+="?"+B.query}if(B.anchor){C+="#"+B.anchor}B.source=C}return B.source}})})();(function(){var A=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(D){var B=this.get(D),C;if(B){A(B.split("&"),function(E){E=E.split("=");C=C||{};C[unescape(E[0])]=unescape(E[1])})}return C},setHash:function(H,B,E,D,G,C){var F="";A(B,function(J,I){F+=(!F?"":"&")+escape(I)+"="+escape(J)});this.set(H,F,E,D,G,C)},get:function(F){var E=document.cookie,D,C=F+"=",B;if(!E){return }B=E.indexOf("; "+C);if(B==-1){B=E.indexOf(C);if(B!=0){return null}}else{B+=2}D=E.indexOf(";",B);if(D==-1){D=E.length}return unescape(E.substring(B+C.length,D))},set:function(G,B,E,D,F,C){document.cookie=G+"="+escape(B)+((E)?"; expires="+E.toGMTString():"")+((D)?"; path="+escape(D):"")+((F)?"; domain="+F:"")+((C)?"; secure":"")},remove:function(D,B){var C=new Date();C.setTime(C.getTime()-1000);this.set(D,"",C,B,C)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(E){var C,A,D=tinymce.util.JSON.serialize,B;if(E==null){return"null"}B=typeof E;if(B=="string"){A="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+E.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(G,F){C=A.indexOf(F);if(C+1){return"\\"+A.charAt(C+1)}G=F.charCodeAt().toString(16);return"\\u"+"0000".substring(G.length)+G})+'"'}if(B=="object"){if(E instanceof Array){for(C=0,A="[";C<E.length;C++){A+=(C>0?",":"")+D(E[C])}return A+"]"}A="{";for(C in E){A+=typeof E[C]!="function"?(A.length>1?',"':'"')+C+'":'+D(E[C]):""}return A+"}"}return""+E},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(E){var A,D,B=window,F=0;E.scope=E.scope||this;E.success_scope=E.success_scope||E.scope;E.error_scope=E.error_scope||E.scope;E.async=E.async===false?false:true;E.data=E.data||"";function C(H){A=0;try{A=new ActiveXObject(H)}catch(G){}return A}A=B.XMLHttpRequest?new XMLHttpRequest():C("Microsoft.XMLHTTP")||C("Msxml2.XMLHTTP");if(A){if(A.overrideMimeType){A.overrideMimeType(E.content_type)}A.open(E.type||(E.data?"POST":"GET"),E.url,E.async);if(E.content_type){A.setRequestHeader("Content-Type",E.content_type)}A.send(E.data);D=B.setInterval(function(){if(A.readyState==4||F++>10000){B.clearInterval(D);if(E.success&&F<10000&&A.status==200){E.success.call(E.success_scope,""+A.responseText,A,E)}else{if(E.error){E.error.call(E.error_scope,F>10000?"TIMED_OUT":"GENERAL",A,E)}}A=null}},10)}}});(function(){var C=tinymce.extend,B=tinymce.util.JSON,A=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(D){this.settings=C({},D);this.count=0},send:function(F){var E=F.error,D=F.success;F=C(this.settings,F);F.success=function(H,G){H=B.parse(H);if(typeof (H)=="undefined"){H={error:"JSON Parse error."}}if(H.error){E.call(F.error_scope||F.scope,H.error,G)}else{D.call(F.success_scope||F.scope,H.result)}};F.error=function(H,G){E.call(F.error_scope||F.scope,H,G)};F.data=B.serialize({id:F.id||"c"+(this.count++),method:F.method,params:F.params});F.content_type="application/json";A.send(F)},"static":{sendRPC:function(D){return new tinymce.util.JSONRequest().send(D)}}})}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand("BackgroundImageCache",false,true)}catch(e){t.cssFlicker=true}}tinymce.addUnload(t.destroy,t)},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight}},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,"width");h=t.getStyle(e,"height");if(w.indexOf("px")===-1){w=0}if(h.indexOf("px")===-1){h=0}return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight}},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root){r=r||this.getRoot()}if(is(f,"string")){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==="*"){s=true;return false}each(na.split(","),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName==v)){s=true;return false}});return s}}while(n){if(n==r){return null}if(f(n)){return n}n=n.parentNode}return null},get:function(e){var n;if(this.doc&&typeof (e)=="string"){n=e;try{e=this.doc.getElementById(e);if(e&&e.id!==n){return this.doc.getElementsByName(n)[1]}}catch(ex){}}return e},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id="_mc_tmp";pa="#_mc_tmp "+pa}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase())}}else{function get(s,n){return s.getElementsByTagName(n)}}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++){o.push(x[i])}return o}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||"*");c=" "+pl[2]+" ";for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(" "+n.className+" ").indexOf(c)!==-1){o.push(n)}}return o}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n)}}function collectIE(n){if(!n.getAttribute("mce_save")){n.setAttribute("mce_save","1");o.push(n)}}function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++){f(nl[i])}}each(pa.split(","),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n)});return }if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2])){collect(n)}});return }if(!(cs=t.cache[pa])){cs="x=(function(cf, s) {";pl=v.split(" ");each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||"*";cs+='find("'+p[1]+'", function(n) {';if(p[2]){cs+='if (n.id !== "'+p[2]+'") return;'}if(p[3]){cs+='var c = " " + n.className + " ";';cs+="if (";c="";each(p[3].split("."),function(v){if(v){c+=(c?"||":"")+'c.indexOf(" '+v+' ") === -1'}});cs+=c+") return;"}});cs+="cf(n);";for(i=pl.length-1;i>=0;i--){cs+="}, "+(i?"n":"s")+");"}cs+="})";t.cache[pa]=cs=eval(cs)}cs(isIE?collectIE:collect,s)});each(o,function(n){if(isIE){n.removeAttribute("mce_save")}else{delete n.mce_save}});return o},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,"string")?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],"object")){t.setAttrib(e,k,""+a[k])}}if(a.style&&!is(a.style,"string")){each(a.style,function(v,n){t.setStyle(e,n,v)})}}if(h){if(h.nodeType){e.appendChild(h)}else{t.setHTML(e,h)}}return !c?p.appendChild(e):e})},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1)},createHTML:function(n,a,h){var o="",t=this,k;o+="<"+n;for(k in a){if(a.hasOwnProperty(k)){o+=" "+k+'="'+t.encode(a[k])+'"'}}if(tinymce.is(h)){return o+">"+h+"</"+n+">"}return o+" />"},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p){return null}if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n)})}return p.removeChild(n)})},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(t.pixelStyles.test(na)&&(tinymce.is(v,"number")||/^[\-0-9\.]+$/.test(v))){v+="px"}switch(na){case"opacity":if(isIE){s.filter=v===""?"":"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout){s.display="inline-block"}}s[na]=s["-moz-opacity"]=s["-khtml-opacity"]=v||"";break;case"float":isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||""}if(t.settings.update_styles){t.setAttrib(e,"mce_style")}})},getStyle:function(n,na,c){n=this.get(n);if(!n){return false}if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return"-"+a});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na)}catch(ex){return null}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(na=="float"){na=isIE?"styleFloat":"cssFloat"}if(n.currentStyle&&c){return n.currentStyle[na]}return n.style[na]},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v)});s.update_styles=ol;if(s.update_styles){t.setAttrib(e,s.cssText)}},setAttrib:function(e,n,v){var t=this;if(t.settings.strict){n=n.toLowerCase()}return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values&&/^(| )(top|left|bottom|right|width|height)/i.test(v)){if(v){e.setAttribute("mce_style",v,2)}else{e.removeAttribute("mce_style",2)}}e.style.cssText=v;break;case"class":e.className=v||"";break;case"src":case"href":if(s.keep_values){if(s.url_converter){v=s.url_converter.call(s.url_converter_scope||t,v,n,e)}t.setAttrib(e,"mce_"+n,v,2)}break}if(is(v)&&v!==null&&v.length!==0){e.setAttribute(n,""+v,2)}else{e.removeAttribute(n,2)}})},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v)})})},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1){return false}if(!is(dv)){dv=""}if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v){return v}}v=e.getAttribute(n,2);if(!v){switch(n){case"class":v=e.className;break;default:if(isIE&&n==="name"&&e.nodeName==="A"){v=e.name;break}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v}}switch(n){case"style":v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&/^(| )(top|left|bottom|right|width|height)/i.test(v)){e.setAttribute("mce_style",v)}}break}if(isWebKit&&n==="class"&&v){v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(isIE){switch(n){case"rowspan":case"colspan":if(v===1){v=""}break;case"size":if(v==="+0"){v=""}break;case"hspace":if(v===-1){v=""}break;case"tabindex":if(v===32768){v=""}break;case"shape":v=v.toLowerCase();break;default:if(n.indexOf("on")===0&&v){v=(""+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(v&&v!="")?""+v:dv},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select("html")[0],"borderWidth");x=(x=="medium"||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x}}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0}r=r.parentNode;if(r==d.body){break}}return{x:x,y:y}},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st){return o}function compress(p,s,ot){var t,r,b,l;t=o[p+"-top"+s];if(!t){return }r=o[p+"-right"+s];if(t!=r){return }b=o[p+"-bottom"+s];if(r!=b){return }l=o[p+"-left"+s];if(b!=l){return }o[ot]=l;delete o[p+"-top"+s];delete o[p+"-right"+s];delete o[p+"-bottom"+s];delete o[p+"-left"+s]}function compress2(ta,a,b,c){var t;t=o[a];if(!t){return }t=o[b];if(!t){return }t=o[c];if(!t){return }o[ta]=o[a]+" "+o[b]+" "+o[c];delete o[a];delete o[b];delete o[c]}each(st.split(";"),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return"url("+ur.length+")"});v=v.split(":");sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1]});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),"style",null))+")"})}o[tinymce.trim(v[0]).toLowerCase()]=sv}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2("border","border-width","border-style","border-color");if(isIE){if(o.border=="medium none"){o.border=""}}return o},serializeStyle:function(o){var s="";each(o,function(v,k){if(k&&v){switch(k){case"color":case"background-color":v=v.toLowerCase();break}s+=(s?" ":"")+k+": "+v+";"}});return s},loadCSS:function(u){var t=this,d=t.doc;if(!u){u=""}each(u.split(","),function(u){if(t.files[u]){return }t.files[u]=true;t.add(t.select("head")[0],"link",{rel:"stylesheet",href:tinymce._addVer(u)})})},addClass:function(e,c){return this.run(e,function(e){var o;if(!c){return 0}if(this.hasClass(e,c)){return e.className}o=this.removeClass(e,c);return e.className=(o!=""?(o+" "):"")+c})},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re){re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g")}v=e.className.replace(re," ");return e.className=tinymce.trim(v!=" "?v:"")}return e.className})},hasClass:function(n,c){n=this.get(n);if(!n||!c){return false}return(" "+n.className+" ").indexOf(" "+c+" ")!==-1},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){e=this.get(e);return e.style.display=="none"||this.getStyle(e,"display")=="none"},uniqueId:function(p){do{id=(!p?"mce_":p)+(this.counter++)}while(this.doc.getElementById(id));return id},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){while(e.childNodes.length>0){e.removeChild(e.childNodes[0])}x=t.create("div");x.innerHTML="<br />"+h;while(x.childNodes.length>1&&e.nodeType==1&&e.nodeName.toLowerCase()!="input"){e.appendChild(x.childNodes[1])}}if(t.settings.fix_ie_paragraphs){h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true">&nbsp;</p>')}set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break}n.removeAttribute("mce_keep")}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,"</div>");set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement("p");n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=="mce_tmp"){v=n.getAttribute(b);if(!v&&b==="class"){v=n.className}p.setAttribute(b,v)}});for(x=0;x<n.childNodes.length;x++){p.appendChild(n.childNodes[x].cloneNode(true))}n.swapNode(p)}}}}}else{e.innerHTML=h}return h})},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html){return h}if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(isIE){h=h.replace(/&apos;/g,"&#39;")}}h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(s.keep_values){if(h.indexOf("<script")!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,"<mce:script$1><!--\n");h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,"\n// --></mce:script>");h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,"<mce:script$1></mce:script>")}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf("mce_"+b)!=-1){return m}if(b=="style"){if(/^(| )(top|left|bottom|right|width|height)/i.test(c)){return m}if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)})}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+")"})}}else{if(b!="coords"){if(s.url_converter){u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))}}}return" "+b+'="'+c+'" mce_'+b+'="'+u+'"'}a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle)})}return h},getOuterHTML:function(e){var d;e=this.get(e);if(!e){return null}if(isIE){return e.outerHTML}d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1){e.outerHTML=h}else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling}t.remove(e)}})},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return !e.firstChild?s:e.firstChild.nodeValue}return s},encode:function(s){return s?(""+s).replace(/[<>&\"]/g,function(c,b){switch(c){case"&":return"&amp;";case'"':return"&quot;";case"<":return"&lt;";case">":return"&gt;"}return c}):s},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns){p.insertBefore(n,ns)}else{p.appendChild(n)}return n})},isBlock:function(n){if(n.nodeType&&n.nodeType!==1){return false}n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|TH|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n)},replace:function(n,o,k){if(is(o,"array")){n=n.cloneNode(true)}return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true))})}return o.parentNode.replaceChild(n,o)})},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:"0"+s}if(c){s="#"+hex(c[1])+hex(c[2])+hex(c[3]);return s}return s},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes){return t.classes}function addClasses(s){each(s.imports,function(r){addClasses(r)});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(","),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v)){return }ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(f&&!(v=f(v,ov))){return }if(!lo[v]){cl.push({"class":v});lo[v]=1}})}break;case 3:addClasses(r.styleSheet);break}})}try{each(t.doc.styleSheets,addClasses)}catch(ex){}if(cl.length>0){t.classes=cl}return cl},run:function(e,f,s){var t=this,o;if(t.doc&&typeof (e)==="string"){e=t.doc.getElementById(e)}if(!e){return false}s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof (e)=="string"){e=t.doc.getElementById(e)}o.push(f.call(s,e,i))}});return o}return f.call(s,e)},getAttribs:function(n){var o;n=this.get(n);if(!n){return[]}if(isIE){o=[];if(n.nodeName=="OBJECT"){return n.attributes}n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b})});return o}return n.attributes},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s){tinymce.removeUnload(t.destroy)}}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0})})();(function(){var E=tinymce.each,C=tinymce.DOM,B=tinymce.isIE,D=tinymce.isWebKit,A;tinymce.create("static tinymce.dom.Event",{inits:[],events:[],add:function(L,M,K,I){var F,G=this,H=G.events,J;if(L&&L instanceof Array){J=[];E(L,function(N){N=C.get(N);J.push(G.add(N,M,K,I))});return J}L=C.get(L);if(!L){return }F=function(N){N=N||window.event;if(N&&!N.target&&B){N.target=N.srcElement}if(!I){return K(N)}return K.call(I,N)};if(M=="unload"){tinymce.unloads.unshift({func:F});return F}if(M=="init"){if(G.domLoaded){F()}else{G.inits.push(F)}return F}H.push({obj:L,name:M,func:K,cfunc:F,scope:I});G._add(L,M,F);return K},remove:function(K,L,J){var G=this,F=G.events,H=false,I;if(K&&K instanceof Array){I=[];E(K,function(M){M=C.get(M);I.push(G.remove(M,L,J))});return I}K=C.get(K);E(F,function(N,M){if(N.obj==K&&N.name==L&&(!J||(N.func==J||N.cfunc==J))){F.splice(M,1);G._remove(K,L,N.cfunc);H=true;return false}});return H},clear:function(J){var H=this,F=H.events,G,I;if(J){J=C.get(J);for(G=F.length-1;G>=0;G--){I=F[G];if(I.obj===J){H._remove(I.obj,I.name,I.cfunc);I.obj=I.cfunc=null;F.splice(G,1)}}}},cancel:function(F){if(!F){return false}this.stop(F);return this.prevent(F)},stop:function(F){if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}return false},prevent:function(F){if(F.preventDefault){F.preventDefault()}else{F.returnValue=false}return false},_unload:function(){var F=A;E(F.events,function(H,G){F._remove(H.obj,H.name,H.cfunc);H.obj=H.cfunc=null});F.events=[];F=null},_add:function(G,H,F){if(G.attachEvent){G.attachEvent("on"+H,F)}else{if(G.addEventListener){G.addEventListener(H,F,false)}else{G["on"+H]=F}}},_remove:function(H,I,G){if(H){try{if(H.detachEvent){H.detachEvent("on"+I,G)}else{if(H.removeEventListener){H.removeEventListener(I,G,false)}else{H["on"+I]=null}}}catch(F){}}},_pageInit:function(){var F=A;F._remove(window,"DOMContentLoaded",F._pageInit);F.domLoaded=true;E(F.inits,function(G){G()});F.inits=[]},_wait:function(){var F;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){return }if(B&&document.location.protocol!="https:"){document.write("<script id=__ie_onload defer src='javascript:\"\"';><\/script>");C.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){A._pageInit();C.get("__ie_onload").onreadystatechange=null}}}else{A._add(window,"DOMContentLoaded",A._pageInit,A);if(B||D){F=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(F);A._pageInit()}},10)}}}});A=tinymce.dom.Event;A._wait();tinymce.addUnload(A._unload)})();(function(){var A=tinymce.each;tinymce.create("tinymce.dom.Element",{Element:function(F,D){var B=this,E,C;D=D||{};B.id=F;B.dom=E=D.dom||tinymce.DOM;B.settings=D;if(!tinymce.isIE){C=B.dom.get(B.id)}A(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(G){B[G]=function(){var H=arguments,I;if(tinymce.isOpera){H=[F];A(arguments,function(J){H.push(J)})}else{Array.prototype.unshift.call(H,C||F)}I=E[G].apply(E,H);B.update(G);return I}})},on:function(D,C,B){return tinymce.dom.Event.add(this.id,D,C,B)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var B=this.dom.get(this.id);if(!B){B=tinyMCE.activeEditor.getContainer()}return{w:parseInt(this.getStyle("width")||B.clientWidth),h:parseInt(this.getStyle("height")||B.clientHeight)}},moveTo:function(B,C){this.setStyles({left:B,top:C})},moveBy:function(B,D){var C=this.getXY();this.moveTo(C.x+B,C.y+D)},resizeTo:function(B,C){this.setStyles({width:B,height:C})},resizeBy:function(B,D){var C=this.getSize();this.resizeTo(C.w+B,C.h+D)},update:function(C){var D=this,B,E=D.dom;if(tinymce.isIE6&&D.settings.blocker){C=C||"";if(C.indexOf("get")===0||C.indexOf("has")===0||C.indexOf("is")===0){return }if(C=="remove"){E.remove(D.blocker);return }if(!D.blocker){D.blocker=E.uniqueId();B=E.add(D.settings.container||E.getRoot(),"iframe",{id:D.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});E.setStyle(B,"opacity",0)}else{B=E.get(D.blocker)}E.setStyle(B,"left",D.getStyle("left",1));E.setStyle(B,"top",D.getStyle("top",1));E.setStyle(B,"width",D.getStyle("width",1));E.setStyle(B,"height",D.getStyle("height",1));E.setStyle(B,"display",D.getStyle("display",1));E.setStyle(B,"zIndex",parseInt(D.getStyle("zIndex",1)||0)-1)}}})})();(function(){var B=tinymce.is,A=tinymce.isIE,C=tinymce.each;tinymce.create("tinymce.dom.Selection",{Selection:function(G,F,E){var D=this;D.dom=G;D.win=F;D.serializer=E;tinymce.addUnload(D.destroy,D)},getContent:function(E){var D=this,F=D.getRng(),J=D.dom.create("body"),H=D.getSel(),G,I,K;E=E||{};G=I="";E.get=true;E.format=E.format||"html";if(E.format=="text"){return D.isCollapsed()?"":(F.text||(H.toString?H.toString():""))}if(F.cloneContents){K=F.cloneContents();if(K){J.appendChild(K)}}else{if(B(F.item)||B(F.htmlText)){J.innerHTML=F.item?F.item(0).outerHTML:F.htmlText}else{J.innerHTML=F.toString()}}if(/^\s/.test(J.innerHTML)){G=" "}if(/\s+$/.test(J.innerHTML)){I=" "}E.getInner=true;return D.isCollapsed()?"":G+D.serializer.serialize(J,E)+I},setContent:function(G,F){var E=this,H=E.getRng(),I;F=F||{format:"html"};F.set=true;G=E.dom.processHTML(G);if(H.insertNode){I=E.win.document;if(tinymce.isGecko&&G.indexOf("<")==-1){H.deleteContents();H.insertNode(E.getRng().createContextualFragment(G+'<span id="__caret">_</span>'));E.select(E.dom.get("__caret"));E.getRng().deleteContents();return }try{if(I.queryCommandEnabled("InsertHTML")){return I.execCommand("InsertHTML",false,G)}}catch(D){H.deleteContents();H.insertNode(E.getRng().createContextualFragment(G))}}else{if(H.item){H.item(0).outerHTML=G}else{H.pasteHTML(G)}}},getStart:function(){var D=this,E=D.getRng(),F;if(A){if(E.item){return E.item(0)}E=E.duplicate();E.collapse(1);F=E.parentElement();if(F.nodeName=="BODY"){return F.firstChild}return F}else{F=E.startContainer;if(F.nodeName=="BODY"){return F.firstChild}return D.dom.getParent(F,function(G){return G.nodeType==1})}},getEnd:function(){var D=this,E=D.getRng(),F;if(A){if(E.item){return E.item(0)}E=E.duplicate();E.collapse(0);F=E.parentElement();if(F.nodeName=="BODY"){return F.lastChild}return F}else{F=E.endContainer;if(F.nodeName=="BODY"){return F.lastChild}return D.dom.getParent(F,function(G){return G.nodeType==1})}},getBookmark:function(S){var H=this,K=H.getRng(),D,L,J,P=H.dom.getViewPort(H.win),Q,N,U,M,R=-16777215,I,F=H.dom.getRoot(),E=0,G=0,T;L=P.x;J=P.y;if(S=="simple"){return{rng:K,scrollX:L,scrollY:J}}if(A){if(K.item){Q=K.item(0);C(H.dom.select(Q.nodeName),function(W,V){if(Q==W){N=V;return false}});return{tag:Q.nodeName,index:N,scrollX:L,scrollY:J}}D=H.dom.doc.body.createTextRange();D.moveToElementText(F);D.collapse(true);U=Math.abs(D.move("character",R));D=K.duplicate();D.collapse(true);N=Math.abs(D.move("character",R));D=K.duplicate();D.collapse(false);M=Math.abs(D.move("character",R))-N;return{start:N-U,length:M,scrollX:L,scrollY:J}}Q=H.getNode();I=H.getSel();if(!I){return null}if(Q&&Q.nodeName=="IMG"){return{scrollX:L,scrollY:J}}function O(X,a,W){var V=H.dom.doc.createTreeWalker(X,NodeFilter.SHOW_TEXT,null,false),b,Y=0,Z={};while((b=V.nextNode())!=null){if(b==a){Z.start=Y}if(b==W){Z.end=Y;return Z}Y+=tinymce.trim(b.nodeValue||"").length}return null}if(I.anchorNode==I.focusNode&&I.anchorOffset==I.focusOffset){Q=O(F,I.anchorNode,I.focusNode);if(!Q){return{scrollX:L,scrollY:J}}(I.anchorNode.nodeValue||"").replace(/^\s+/,function(V){E=V.length});return{start:Math.max(Q.start+I.anchorOffset-E,0),end:Math.max(Q.end+I.focusOffset-E,0),scrollX:L,scrollY:J,beg:I.anchorOffset-E==0}}else{Q=O(F,K.startContainer,K.endContainer);(K.startContainer.nodeValue||"").replace(/^\s+/,function(V){E=V.length});(K.endContainer.nodeValue||"").replace(/^\s+/,function(V){G=V.length});if(!Q){return{scrollX:L,scrollY:J}}return{start:Math.max(Q.start+K.startOffset-E,0),end:Math.max(Q.end+K.endOffset-G,0),scrollX:L,scrollY:J,beg:K.startOffset-E==0}}},moveToBookmark:function(L){var M=this,E=M.getRng(),N=M.getSel(),H=M.dom.getRoot(),K,F,I;function G(O,Q,Y){var W=M.dom.doc.createTreeWalker(O,NodeFilter.SHOW_TEXT,null,false),S,P=0,V={},R,X,U,T;while((S=W.nextNode())!=null){U=T=0;I=S.nodeValue||"";I.replace(/^\s+[^\s]/,function(Z){T=Z.length-1});I.replace(/[^\s]\s+$/,function(Z){U=Z.length-1});F=tinymce.trim(I).length;P+=F;if(P>=Q&&!V.startNode){R=Q-(P-F);if(L.beg&&R>=F){continue}V.startNode=S;V.startOffset=R+T}if(P>=Y){V.endNode=S;V.endOffset=Y-(P-F)+T;return V}}return null}if(!L){return false}M.win.scrollTo(L.scrollX,L.scrollY);if(A){if(E=L.rng){try{E.select()}catch(J){}return true}M.win.focus();if(L.tag){E=H.createControlRange();C(M.dom.select(L.tag),function(P,O){if(O==L.index){E.addElement(P)}})}else{try{if(L.start<0){return true}E=N.createRange();E.moveToElementText(H);E.collapse(true);E.moveStart("character",L.start);E.moveEnd("character",L.length)}catch(D){return true}}try{E.select()}catch(J){}return true}if(!N){return false}if(L.rng){N.removeAllRanges();N.addRange(L.rng)}else{if(B(L.start)&&B(L.end)){try{K=G(H,L.start,L.end);if(K){E=M.dom.doc.createRange();E.setStart(K.startNode,K.startOffset);E.setEnd(K.endNode,K.endOffset);N.removeAllRanges();N.addRange(E)}if(!tinymce.isOpera){M.win.focus()}}catch(J){}}}},select:function(E,J){var N=this,D=N.getRng(),O=N.getSel(),L,K,I,H=N.win.document;function F(P){return P?H.createTreeWalker(P,NodeFilter.SHOW_TEXT,null,false).nextNode():null}function M(S){var R,Q,P;if(!S){return null}P=H.createTreeWalker(S,NodeFilter.SHOW_TEXT,null,false);while(R=P.nextNode()){Q=R}return Q}if(A){try{L=H.body;if(/^(IMG|TABLE)$/.test(E.nodeName)){D=L.createControlRange();D.addElement(E)}else{D=L.createTextRange();D.moveToElementText(E)}D.select()}catch(G){}}else{if(J){K=F(E);I=M(E);if(K&&I){D=H.createRange();D.setStart(K,0);D.setEnd(I,I.nodeValue.length)}else{D.selectNode(E)}}else{D.selectNode(E)}N.setRng(D)}return E},isCollapsed:function(){var D=this,F=D.getRng(),E=D.getSel();if(!F||F.item){return false}return !E||F.boundingWidth==0||E.isCollapsed},collapse:function(D){var E=this,F=E.getRng(),G;if(F.item){G=F.item(0);F=this.win.document.body.createTextRange();F.moveToElementText(G)}F.collapse(!!D);E.setRng(F)},getSel:function(){var E=this,D=this.win;return D.getSelection?D.getSelection():D.document.selection},getRng:function(){var E=this,F=E.getSel(),G;try{if(F){G=F.rangeCount>0?F.getRangeAt(0):(F.createRange?F.createRange():E.win.document.createRange())}}catch(D){}if(!G){G=A?E.win.document.body.createTextRange():E.win.document.createRange()}return G},setRng:function(F){var E;if(!A){E=this.getSel();if(E){E.removeAllRanges();E.addRange(F)}}else{try{F.select()}catch(D){}}},setNode:function(E){var D=this;D.setContent(D.dom.getOuterHTML(E));return E},getNode:function(){var D=this,F=D.getRng(),E=D.getSel(),G;if(!A){if(!F){return D.dom.getRoot()}G=F.commonAncestorContainer;if(!F.collapsed){if(F.startContainer==F.endContainer||(tinymce.isWebKit&&F.startContainer==F.endContainer.parentNode)){if(F.startOffset-F.endOffset<2||tinymce.isWebKit){if(F.startContainer.hasChildNodes()){G=F.startContainer.childNodes[F.startOffset]}}}}return D.dom.getParent(G,function(H){return H.nodeType==1})}return F.item?F.item(0):F.parentElement()},destroy:function(E){var D=this;D.win=null;if(!E){tinymce.removeUnload(D.destroy)}}})})();(function(){tinymce.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(B){function A(){var D=document.implementation;if(!D||!D.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(C){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(C){}}else{return D.createDocument("","",null)}}this.doc=A();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset()},reset:function(){var A=this,B=A.doc;if(B.firstChild){B.removeChild(B.firstChild)}A.node=B.appendChild(B.createElement("html"))},writeStartElement:function(B){var A=this;A.node=A.node.appendChild(A.doc.createElement(B))},writeAttribute:function(B,A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.setAttribute(B,A)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var A=this,B=A.node;B.appendChild(A.doc.createTextNode(""));A.node=B.parentNode},writeText:function(A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(A))},writeCDATA:function(A){this.node.appendChild(this.doc.createCDATA(A))},writeComment:function(A){this.node.appendChild(this.doc.createComment(A.replace(/\-\-/g," ")))},getContent:function(){var A;A=this.doc.xml||new XMLSerializer().serializeToString(this.doc);A=A.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");A=A.replace(/ ?\/>/g," />");if(this.valid){A=A.replace(/\%MCGT%/g,"&gt;")}return A}})})();(function(){tinymce.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(A){this.settings=tinymce.extend({indent_char:" ",indentation:1},A);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(A){this._writeAttributesEnd();this.writeRaw("<"+A);this.tags.push(A);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(C,A){var B=this;B.writeRaw(" "+B.encode(C)+'="'+B.encode(A)+'"')},writeEndElement:function(){var A;if(this.tags.length>0){A=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+A+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(A){this._writeAttributesEnd();this.writeRaw(this.encode(A));this.count++},writeCDATA:function(A){this._writeAttributesEnd();this.writeRaw("<![CDATA["+A+"]]>");this.count++},writeComment:function(A){this._writeAttributesEnd();this.writeRaw("<!-- "+A+"-->");this.count++},writeRaw:function(A){this.str+=A},encode:function(A){return A.replace(/[<>&"]/g,function(B){switch(B){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}return B})},getContent:function(){return this.str},_writeAttributesEnd:function(A){if(!this.inAttr){return }this.inAttr=false;if(A&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})();(function(){var G=tinymce.extend,E=tinymce.each,B=tinymce.util.Dispatcher,D=tinymce.isIE,A=tinymce.isGecko;function F(I){var H=[];if(I.nodeName=="OBJECT"){return I.attributes}I.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(K,J){H.push({specified:1,nodeName:J})});return H}function C(H){return H.replace(/([?+*])/g,".$1")}tinymce.create("tinymce.dom.Serializer",{Serializer:function(J){var I=this;I.key=0;I.onPreProcess=new B(I);I.onPostProcess=new B(I);if(tinymce.relaxedDomain&&tinymce.isGecko){I.writer=new tinymce.dom.StringWriter()}else{try{I.writer=new tinymce.dom.XMLWriter()}catch(H){I.writer=new tinymce.dom.StringWriter()}}I.settings=J=G({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1},J);I.dom=J.dom;if(J.fix_list_elements){I.onPreProcess.add(function(R,O){var L,T,S=["ol","ul"],Q,P,N,K=/^(OL|UL)$/,U;function M(X,Y){var V=Y.split(","),W;while((X=X.previousSibling)!=null){for(W=0;W<V.length;W++){if(X.nodeName==V[W]){return X}}}return null}for(T=0;T<S.length;T++){L=I.dom.select(S[T],O.node);for(Q=0;Q<L.length;Q++){P=L[Q];N=P.parentNode;if(K.test(N.nodeName)){U=M(P,"LI");if(!U){U=I.dom.create("li");U.innerHTML="&nbsp;";U.appendChild(P);N.insertBefore(U,N.firstChild)}else{U.appendChild(P)}}}}})}if(J.fix_table_elements){I.onPreProcess.add(function(K,L){E(I.dom.select("table",L.node),function(S){var R=I.dom.getParent(S,"H1,H2,H3,H4,H5,H6,P"),N,T,M,Q=[],O,P;if(R){N=R.cloneNode(false);Q.push(S);for(T=S;T=T.parentNode;){Q.push(T);if(T==R){break}}M=N;for(O=Q.length-1;O>=0;O--){if(O==Q.length-1){while(P=Q[O-1].nextSibling){M.appendChild(P.parentNode.removeChild(P))}}else{T=Q[O].cloneNode(false);if(O!=0){while(P=Q[O-1].nextSibling){T.appendChild(P.parentNode.removeChild(P))}}M=M.appendChild(T)}}S=I.dom.insertAfter(S.parentNode.removeChild(S),R);I.dom.insertAfter(S,R);I.dom.insertAfter(N,S)}})})}},setEntities:function(N){var L=this,I,K,H={},M="",J;if(L.entityLookup){return }I=N.split(",");for(K=0;K<I.length;K+=2){J=I[K];if(J==34||J==38||J==60||J==62){continue}H[String.fromCharCode(I[K])]=I[K+1];J=parseInt(I[K]).toString(16);M+="\\u"+"0000".substring(J.length)+J}if(!M){L.settings.entity_encoding="raw";return }L.entitiesRE=new RegExp("["+M+"]","g");L.entityLookup=H},setValidChildRules:function(H){this.childRules=null;this.addValidChildRules(H)},addValidChildRules:function(K){var J=this,L,H,I;if(!K){return }L="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";H="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";I="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";E(K.split(","),function(N){var O=N.split(/\[|\]/),M;N="";E(O[1].split("|"),function(P){if(N){N+="|"}switch(P){case"%itrans":P=H;break;case"%itrans_na":P=H.substring(2);break;case"%istrict":P=L;break;case"%istrict_na":P=L.substring(2);break;case"%btrans":P=I;break;case"%bstrict":P=I;break}N+=P});M=new RegExp("^("+N.toLowerCase()+")$","i");E(O[0].split("/"),function(P){J.childRules=J.childRules||{};J.childRules[P]=M})});K="";E(J.childRules,function(N,M){if(K){K+="|"}K+=M});J.parentElementsRE=new RegExp("^("+K.toLowerCase()+")$","i")},setRules:function(I){var H=this;H._setup();H.rules={};H.wildRules=[];H.validElements={};return H.addRules(I)},addRules:function(I){var H=this,J;if(!I){return }H._setup();E(I.split(","),function(M){var P=M.split(/\[|\]/),L=P[0].split("/"),Q,K,O,N=[];if(J){K=tinymce.extend([],J.attribs)}if(P.length>1){E(P[1].split("|"),function(T){var R={},S;K=K||[];T=T.replace(/::/g,"~");T=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(T);T[2]=T[2].replace(/~/g,":");if(T[1]=="!"){Q=Q||[];Q.push(T[2])}if(T[1]=="-"){for(S=0;S<K.length;S++){if(K[S].name==T[2]){K.splice(S,1);return }}}switch(T[3]){case"=":R.defaultVal=T[4]||"";break;case":":R.forcedVal=T[4];break;case"<":R.validVals=T[4].split("?");break}if(/[*.?]/.test(T[2])){O=O||[];R.nameRE=new RegExp("^"+C(T[2])+"$");O.push(R)}else{R.name=T[2];K.push(R)}N.push(T[2])})}E(L,function(U,T){var V=U.charAt(0),S=1,R={};if(J){if(J.noEmpty){R.noEmpty=J.noEmpty}if(J.fullEnd){R.fullEnd=J.fullEnd}if(J.padd){R.padd=J.padd}}switch(V){case"-":R.noEmpty=true;break;case"+":R.fullEnd=true;break;case"#":R.padd=true;break;default:S=0}L[T]=U=U.substring(S);H.validElements[U]=1;if(/[*.?]/.test(L[0])){R.nameRE=new RegExp("^"+C(L[0])+"$");H.wildRules=H.wildRules||{};H.wildRules.push(R)}else{R.name=L[0];if(L[0]=="@"){J=R}H.rules[U]=R}R.attribs=K;if(Q){R.requiredAttribs=Q}if(O){U="";E(N,function(W){if(U){U+="|"}U+="("+C(W)+")"});R.validAttribsRE=new RegExp("^"+U.toLowerCase()+"$");R.wildAttribs=O}})});I="";E(H.validElements,function(L,K){if(I){I+="|"}if(K!="@"){I+=K}});H.validElementsRE=new RegExp("^("+C(I.toLowerCase())+")$")},findRule:function(L){var I=this,K=I.rules,H,J;I._setup();J=K[L];if(J){return J}K=I.wildRules;for(H=0;H<K.length;H++){if(K[H].nameRE.test(L)){return K[H]}}return null},findAttribRule:function(H,K){var I,J=H.wildAttribs;for(I=0;I<J.length;I++){if(J[I].nameRE.test(K)){return J[I]}}return null},serialize:function(K,J){var I,H=this;H._setup();J=J||{};J.format=J.format||"html";H.processObj=J;K=K.cloneNode(true);H.key=""+(parseInt(H.key)+1);if(!J.no_events){J.node=K;H.onPreProcess.dispatch(H,J)}H.writer.reset();H._serializeNode(K,J.getInner);J.content=H.writer.getContent();if(!J.no_events){H.onPostProcess.dispatch(H,J)}H._postProcess(J);J.node=null;return tinymce.trim(J.content)},_postProcess:function(M){var H=this,J=H.settings,I=M.content,L=[],K;if(M.format=="html"){K=H._protect({content:I,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});I=K.content;if(J.entity_encoding!=="raw"){I=H._encode(I)}if(!M.set){I=I.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,J.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");if(J.remove_linebreaks){I=I.replace(/\r?\n|\r/g," ");I=I.replace(/(<[^>]+>)\s+/g,"$1 ");I=I.replace(/\s+(<\/[^>]+>)/g," $1");I=I.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");I=I.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");I=I.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(J.apply_source_formatting&&J.indent_mode=="simple"){I=I.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");I=I.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");I=I.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");I=I.replace(/\n\n/g,"\n")}}I=H._unprotect(I,K);if(J.entity_encoding=="raw"){I=I.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}}M.content=I},_serializeNode:function(V,K){var R=this,S=R.settings,P=R.writer,M,I,O,X,W,Y,T,H,Q,J,N,U,L;if(!S.node_filter||S.node_filter(V)){switch(V.nodeType){case 1:if(V.hasAttribute?V.hasAttribute("mce_bogus"):V.getAttribute("mce_bogus")){return }L=false;M=V.hasChildNodes();J=V.getAttribute("mce_name")||V.nodeName.toLowerCase();if(D){if(V.scopeName!=="HTML"&&V.scopeName!=="html"){J=V.scopeName+":"+J}}if(J.indexOf("mce:")===0){J=J.substring(4)}if(!R.validElementsRE.test(J)||(R.invalidElementsRE&&R.invalidElementsRE.test(J))||K){L=true;break}if(D){if(S.fix_content_duplication){if(V.mce_serialized==R.key){return }V.mce_serialized=R.key}if(J.charAt(0)=="/"){J=J.substring(1)}}else{if(A){if(V.nodeName==="BR"&&V.getAttribute("type")=="_moz"){return }}}if(R.childRules){if(R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(J)){L=true;break}}R.elementName=J}N=R.findRule(J);J=N.name||J;if((!M&&N.noEmpty)||(D&&!J)){L=true;break}if(N.requiredAttribs){Y=N.requiredAttribs;for(X=Y.length-1;X>=0;X--){if(this.dom.getAttrib(V,Y[X])!==""){break}}if(X==-1){L=true;break}}P.writeStartElement(J);if(N.attribs){for(X=0,T=N.attribs,W=T.length;X<W;X++){Y=T[X];Q=R._getAttrib(V,Y);if(Q!==null){P.writeAttribute(Y.name,Q)}}}if(N.validAttribsRE){T=D?F(V):V.attributes;for(X=T.length-1;X>-1;X--){H=T[X];if(H.specified){Y=H.nodeName.toLowerCase();if(S.invalid_attrs.test(Y)||!N.validAttribsRE.test(Y)){continue}U=R.findAttribRule(N,Y);if(U!==null){Q=R._getAttrib(V,U,Y);if(Q!==null){P.writeAttribute(Y,Q)}}}}}if(!M&&N.padd){P.writeText("\u00a0")}break;case 3:if(R.childRules&&R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(V.nodeName)){return }}return P.writeText(V.nodeValue);case 4:return P.writeCDATA(V.nodeValue);case 8:return P.writeComment(V.nodeValue)}}else{if(V.nodeType==1){M=V.hasChildNodes()}}if(M){O=V.firstChild;while(O){R._serializeNode(O);R.elementName=J;O=O.nextSibling}}if(!L){if(M||!S.closed.test(J)){P.writeFullEndElement()}else{P.writeEndElement()}}},_protect:function(J){var I=this;J.items=J.items||[];function H(L){return L.replace(/[\r\n\\]/g,function(M){if(M==="\n"){return"\\n"}else{if(M==="\\"){return"\\\\"}}return"\\r"})}function K(L){return L.replace(/\\[\\rn]/g,function(M){if(M==="\\n"){return"\n"}else{if(M==="\\\\"){return"\\"}}return"\r"})}E(J.patterns,function(L){J.content=K(H(J.content).replace(L.pattern,function(N,O,M,P){M=K(M);if(L.encode){M=I._encode(M)}J.items.push(M);return O+"<!--mce:"+(J.items.length-1)+"-->"+P}))});return J},_unprotect:function(H,I){H=H.replace(/\<!--mce:([0-9]+)--\>/g,function(K,J){return I.items[parseInt(J)]});I.items=[];return H},_encode:function(K){var I=this,J=I.settings,H;if(J.entity_encoding!=="raw"){if(J.entity_encoding.indexOf("named")!=-1){I.setEntities(J.entities);H=I.entityLookup;K=K.replace(I.entitiesRE,function(L){var M;if(M=H[L]){L="&"+M+";"}return L})}if(J.entity_encoding.indexOf("numeric")!=-1){K=K.replace(/[\u007E-\uFFFF]/g,function(L){return"&#"+L.charCodeAt(0)+";"})}}return K},_setup:function(){var H=this,I=this.settings;if(H.done){return }H.done=1;H.setRules(I.valid_elements);H.addRules(I.extended_valid_elements);H.addValidChildRules(I.valid_child_elements);if(I.invalid_elements){H.invalidElementsRE=new RegExp("^("+C(I.invalid_elements.replace(",","|").toLowerCase())+")$")}if(I.attrib_value_filter){H.attribValueFilter=I.attribValueFilter}},_getAttrib:function(L,I,H){var K,J;H=H||I.name;if(I.forcedVal&&(J=I.forcedVal)){if(J==="{$uid}"){return this.dom.uniqueId()}return J}J=this.dom.getAttrib(L,H);switch(H){case"rowspan":case"colspan":if(J=="1"){J=""}break}if(this.attribValueFilter){J=this.attribValueFilter(H,J,L)}if(I.validVals){for(K=I.validVals.length-1;K>=0;K--){if(J==I.validVals[K]){break}}if(K==-1){return null}}if(J===""&&typeof (I.defaultVal)!="undefined"){J=I.defaultVal;if(J==="{$uid}"){return this.dom.uniqueId()}return J}else{if(H=="class"&&this.processObj.get){J=J.replace(/\s?mceItem\w+\s?/g,"")}}if(J===""){return null}return J}})})();(function(){var each=tinymce.each;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return }o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone()}})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return }if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})();(function(){var B=tinymce.DOM,A=tinymce.is;tinymce.create("tinymce.ui.Control",{Control:function(D,C){this.id=D;this.settings=C=C||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix="";this.scope=C.scope||this;this.disabled=0;this.active=0},setDisabled:function(C){var D;if(C!=this.disabled){D=B.get(this.id);if(D&&this.settings.unavailable_prefix){if(C){this.prevTitle=D.title;D.title=this.settings.unavailable_prefix+": "+D.title}else{D.title=this.prevTitle}}this.setState("Disabled",C);this.setState("Enabled",!C);this.disabled=C}},isDisabled:function(){return this.disabled},setActive:function(C){if(C!=this.active){this.setState("Active",C);this.active=C}},isActive:function(){return this.active},setState:function(E,C){var D=B.get(this.id);E=this.classPrefix+E;if(C){B.addClass(D,E)}else{B.removeClass(D,E)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(C){B.setHTML(C,this.renderHTML())},postRender:function(){var D=this,C;if(A(D.disabled)){C=D.disabled;D.disabled=-1;D.setDisabled(C)}if(A(D.active)){C=D.active;D.active=-1;D.setActive(C)}},remove:function(){B.remove(this.id);this.destroy()},destroy:function(){tinymce.dom.Event.clear(this.id)}})})();tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(B,A){this.parent(B,A);this.controls=[];this.lookup={}},add:function(A){this.lookup[A.id]=A;this.controls.push(A);return A},get:function(A){return this.lookup[A]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(B,A){this.parent(B,A);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(F,E){this.parent(F,E);this.classPrefix="mceMenuItem"},setSelected:function(E){this.setState("Selected",E);this.selected=E},isSelected:function(){return this.selected},postRender:function(){var E=this;E.parent();if(C(E.selected)){E.setSelected(E.selected)}}})})();(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(G,F){var E=this;E.parent(G,F);E.items={};E.collapsed=false;E.menuCount=0;E.onAddItem=new tinymce.util.Dispatcher(this)},expand:function(F){var E=this;if(F){A(E,function(G){if(G.expand){G.expand()}},"items",E)}E.collapsed=false},collapse:function(F){var E=this;if(F){A(E,function(G){if(G.collapse){G.collapse()}},"items",E)}E.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(E){if(!E.settings){E=new tinymce.ui.MenuItem(E.id||B.uniqueId(),E)}this.onAddItem.dispatch(this,E);return this.items[E.id]=E},addSeparator:function(){return this.add({separator:true})},addMenu:function(E){if(!E.collapse){E=this.createMenu(E)}this.menuCount++;return this.add(E)},hasMenus:function(){return this.menuCount!==0},remove:function(E){delete this.items[E.id]},removeAll:function(){var E=this;A(E,function(F){if(F.removeAll){F.removeAll()}else{F.remove()}F.destroy()},"items",E);E.items={}},createMenu:function(F){var E=new tinymce.ui.Menu(F.id||B.uniqueId(),F);E.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return E}})})();(function(){var D=tinymce.is,C=tinymce.DOM,E=tinymce.each,A=tinymce.dom.Event,B=tinymce.dom.Element;tinymce.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(G,F){F=F||{};F.container=F.container||C.doc.body;F.offset_x=F.offset_x||0;F.offset_y=F.offset_y||0;F.vp_offset_x=F.vp_offset_x||0;F.vp_offset_y=F.vp_offset_y||0;if(D(F.icons)&&!F.icons){F["class"]+=" mceNoIcons"}this.parent(G,F);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix="mceMenu";this.fixIE=tinymce.isIE&&C.win.top!=C.win},createMenu:function(I){var G=this,H=G.settings,F;I.container=I.container||H.container;I.parent=G;I.constrain=I.constrain||H.constrain;I["class"]=I["class"]||H["class"];I.vp_offset_x=I.vp_offset_x||H.vp_offset_x;I.vp_offset_y=I.vp_offset_y||H.vp_offset_y;F=new tinymce.ui.DropMenu(I.id||C.uniqueId(),I);F.onAddItem.add(G.onAddItem.dispatch,G.onAddItem);return F},update:function(){var H=this,I=H.settings,F=C.get("menu_"+H.id+"_tbl"),K=C.get("menu_"+H.id+"_co"),G,J;G=I.max_width?Math.min(F.clientWidth,I.max_width):F.clientWidth;J=I.max_height?Math.min(F.clientHeight,I.max_height):F.clientHeight;if(!C.boxModel){H.element.setStyles({width:G+2,height:J+2})}else{H.element.setStyles({width:G,height:J})}if(I.max_width){C.setStyle(K,"width",G)}if(I.max_height){C.setStyle(K,"height",J);if(F.clientHeight<I.max_height){C.setStyle(K,"overflow","hidden")}}},showMenu:function(N,L,P){var S=this,T=S.settings,M,F=C.getViewPort(),Q,J,R,O,G=2,I,H,K=S.classPrefix;S.collapse(1);if(S.isMenuVisible){return }if(!S.rendered){M=C.add(S.settings.container,S.renderNode());E(S.items,function(U){U.postRender()});S.element=new B("menu_"+S.id,{blocker:1,container:T.container})}else{M=C.get("menu_"+S.id)}if(!tinymce.isOpera){C.setStyles(M,{left:-65535,top:-65535})}C.show(M);S.update();N+=T.offset_x||0;L+=T.offset_y||0;F.w-=4;F.h-=4;Q=M.clientWidth-G;J=M.clientHeight-G;if(N+Q>F.w){N=F.w-Q-40}if(T.constrain){Q=M.clientWidth-G;J=M.clientHeight-G;R=F.x+F.w;O=F.y+F.h;if((N+T.vp_offset_x+Q)>R){N=P?P-Q:Math.max(0,(R-T.vp_offset_x)-Q)}if((L+T.vp_offset_y+J)>O){L=Math.max(0,(O-T.vp_offset_y)-J)}}C.setStyles(M,{left:N,top:L});S.element.update();S.isMenuVisible=1;A.add(S.id+"_menu","mouseup",function(U){tinymce.dom.Event.cancel(U)});A.add(S.id+"_menu",S.fixIE?"click":"mousedown",function(U){tinymce.dom.Event.cancel(U)});S.mouseClickFunc=A.add(M,S.fixIE?"mousedown":"click",function(V){var U;tinymce.dom.Event.cancel(V);e=V.target;if(e&&(e=C.getParent(e,"TR"))&&!C.hasClass(e,K+"ItemSub")){U=S.items[e.id];if(U.isDisabled()){return }I=S;C.win.setTimeout(function(){while(I){if(I.hideMenu){I.hideMenu()}I=I.settings.parent}},0);if(U.settings.onclick){U.settings.onclick(e)}return A.cancel(e)}});if(S.hasMenus()){S.mouseOverFunc=A.add(M,"mouseover",function(X){var U,W,V;X=X.target;if(X&&(X=C.getParent(X,"TR"))){U=S.items[X.id];if(S.lastMenu){S.lastMenu.collapse(1)}if(U.isDisabled()){return }if(X&&C.hasClass(X,K+"ItemSub")){W=C.getRect(X);U.showMenu((W.x+W.w-G),W.y-G,W.x);S.lastMenu=U;C.addClass(C.get(U.id).firstChild,K+"ItemActive")}}})}S.onShowMenu.dispatch(S);if(T.keyboard_focus){A.add(M,"keydown",S._keyHandler,S);C.select("a","menu_"+S.id)[0].focus()}},hideMenu:function(I){var F=this,H=C.get("menu_"+F.id),G;if(!F.isMenuVisible){return }A.remove(H,"mouseover",F.mouseOverFunc);A.remove(H,F.fixIE?"mousedown":"click",F.mouseClickFunc);A.remove(H,"keydown",F._keyHandler);C.hide(H);F.isMenuVisible=0;if(!I){F.collapse(1)}if(F.element){F.element.hide()}if(G=C.get(F.id)){C.removeClass(G.firstChild,F.classPrefix+"ItemActive")}F.onHideMenu.dispatch(F)},add:function(H){var F=this,G;H=F.parent(H);if(F.isRendered&&(G=C.get("menu_"+F.id))){F._add(C.select("tbody",G)[0],H)}return H},collapse:function(F){this.parent(F);this.hideMenu(1)},remove:function(F){C.remove(F.id);this.destroy();return this.parent(F)},destroy:function(){var F=this,G=C.get("menu_"+F.id);A.remove(G,"mouseover",F.mouseOverFunc);A.remove(G,"click",F.mouseClickFunc);if(F.element){F.element.remove()}C.remove(G)},renderNode:function(){var H=this,I=H.settings,K,G,J,F;F=C.create("div",{id:"menu_"+H.id,"class":I["class"],style:"position:absolute;left:0;top:0;z-index:200000"});J=C.add(F,"div",{id:"menu_"+H.id+"_co","class":H.classPrefix+(I["class"]?" "+I["class"]:"")});H.element=new B("menu_"+H.id,{blocker:1,container:I.container});if(I.menu_line){C.add(J,"span",{"class":H.classPrefix+"Line"})}K=C.add(J,"table",{id:"menu_"+H.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});G=C.add(K,"tbody");E(H.items,function(L){H._add(G,L)});H.rendered=true;return F},_keyHandler:function(F){if(F.keyCode==27){this.hideMenu()}},_add:function(G,L){var M,I=L.settings,F,J,H,K=this.classPrefix;if(I.separator){J=C.add(G,"tr",{id:L.id,"class":K+"ItemSeparator"});C.add(J,"td",{"class":K+"ItemSeparator"});if(M=J.previousSibling){C.addClass(M,"mceLast")}return }M=J=C.add(G,"tr",{id:L.id,"class":K+"Item "+K+"ItemEnabled"});M=H=C.add(M,"td");M=F=C.add(M,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});C.addClass(H,I["class"]);C.add(M,"span",{"class":"mceIcon"+(I.icon?" mce_"+I.icon:"")});M=C.add(M,I.element||"span",{"class":"mceText",title:L.settings.title},L.settings.title);if(L.settings.style){C.setAttrib(M,"style",L.settings.style)}if(G.childNodes.length==1){C.addClass(J,"mceFirst")}if((M=J.previousSibling)&&C.hasClass(M,K+"ItemSeparator")){C.addClass(J,"mceFirst")}if(L.collapse){C.addClass(J,K+"ItemSub")}if(M=J.previousSibling){C.removeClass(M,"mceLast")}C.addClass(J,"mceLast")}})})();(function(){var A=tinymce.DOM;tinymce.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(C,B){this.parent(C,B);this.classPrefix="mceButton"},renderHTML:function(){var E=this.classPrefix,D=this.settings,C,B;B=A.encode(D.label||"");C='<a id="'+this.id+'" href="javascript:;" class="'+E+" "+E+"Enabled "+D["class"]+(B?" "+E+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+A.encode(D.title)+'">';if(D.image){C+='<img class="mceIcon" src="'+D.image+'" />'+B+"</a>"}else{C+='<span class="mceIcon '+D["class"]+'"></span>'+(B?'<span class="'+E+'Label">'+B+"</span>":"")+"</a>"}return C},postRender:function(){var B=this,C=B.settings;tinymce.dom.Event.add(B.id,"click",function(D){if(!B.isDisabled()){return C.onclick.call(C.scope,D)}})}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(G,F){var E=this;E.parent(G,F);E.items=[];E.onChange=new A(E);E.onPostRender=new A(E);E.onAdd=new A(E);E.onRenderMenu=new tinymce.util.Dispatcher(this);E.classPrefix="mceListBox"},select:function(E){var F=this,H,G;if(E!=F.selectedValue){H=C.get(F.id+"_text");F.selectedValue=E;D(F.items,function(I){if(I.value==E){C.setHTML(H,C.encode(I.title));G=1;return false}});if(!G){C.setHTML(H,C.encode(F.settings.title));C.addClass(H,"mceTitle");H=0;return }else{C.removeClass(H,"mceTitle")}}H=0},add:function(H,E,G){var F=this;G=G||{};G=tinymce.extend(G,{title:H,value:E});F.items.push(G);F.onAdd.dispatch(F,G)},getLength:function(){return this.items.length},renderHTML:function(){var G="",E=this,F=E.settings,H=E.classPrefix;G='<table id="'+E.id+'" cellpadding="0" cellspacing="0" class="'+H+" "+H+"Enabled"+(F["class"]?(" "+F["class"]):"")+'"><tbody><tr>';G+="<td>"+C.createHTML("a",{id:E.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},C.encode(E.settings.title))+"</td>";G+="<td>"+C.createHTML("a",{id:E.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";G+="</tr></tbody></table>";return G},showMenu:function(){var F=this,I,H,G=C.get(this.id),E;if(F.isDisabled()||F.items.length==0){return }if(F.menu&&F.menu.isMenuVisible){return F.hideMenu()}if(!F.isMenuRendered){F.renderMenu();F.isMenuRendered=true}I=C.getPos(this.settings.menu_container);H=C.getPos(G);E=F.menu;E.settings.offset_x=H.x;E.settings.offset_y=H.y;E.settings.keyboard_focus=F._focused;if(F.oldID){E.items[F.oldID].setSelected(0)}D(F.items,function(J){if(J.value===F.selectedValue){E.items[J.id].setSelected(1);F.oldID=J.id}});E.showMenu(0,G.clientHeight);B.add(C.doc,"mousedown",F.hideMenu,F);C.addClass(F.id,F.classPrefix+"Selected")},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&(F.target.id==E.id+"_text"||F.target.id==E.id+"_open")){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceMenu")})){C.removeClass(E.id,E.classPrefix+"Selected");B.remove(C.doc,"mousedown",E.hideMenu,E);if(E.menu){E.menu.hideMenu()}}},renderMenu:function(){var F=this,E;E=F.settings.control_manager.createDropMenu(F.id+"_menu",{menu_line:1,"class":F.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});E.onHideMenu.add(F.hideMenu,F);E.add({title:F.settings.title,"class":"mceMenuItemTitle"}).setDisabled(1);D(F.items,function(G){G.id=C.uniqueId();G.onclick=function(){if(F.settings.onselect(G.value)!==false){F.select(G.value)}};E.add(G)});F.onRenderMenu.dispatch(F,E);F.menu=E},postRender:function(){var E=this,F=E.classPrefix;B.add(E.id,"click",E.showMenu,E);B.add(E.id+"_text","focus",function(){E._focused=1});B.add(E.id+"_text","blur",function(){E._focused=0});if(tinymce.isIE6||!C.boxModel){B.add(E.id,"mouseover",function(){if(!C.hasClass(E.id,F+"Disabled")){C.addClass(E.id,F+"Hover")}});B.add(E.id,"mouseout",function(){if(!C.hasClass(E.id,F+"Disabled")){C.removeClass(E.id,F+"Hover")}})}E.onPostRender.dispatch(E,C.get(E.id))},destroy:function(){this.parent();B.clear(this.id+"_text")}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(F,E){this.parent(F,E);this.classPrefix="mceNativeListBox"},setDisabled:function(E){C.get(this.id).disabled=E},isDisabled:function(){return C.get(this.id).disabled},select:function(E){var G=C.get(this.id),F=G.options;E=""+(E||"");G.selectedIndex=0;D(F,function(I,H){if(I.value==E){G.selectedIndex=H;return false}})},add:function(I,F,E){var H,G=this;E=E||{};E.value=F;if(G.isRendered()){C.add(C.get(this.id),"option",E,I)}H={title:I,value:F,attribs:E};G.items.push(H);G.onAdd.dispatch(G,H)},getLength:function(){return C.get(this.id).options.length-1},renderHTML:function(){var F,E=this;F=C.createHTML("option",{value:""},"-- "+E.settings.title+" --");D(E.items,function(G){F+=C.createHTML("option",{value:G.value},G.title)});F=C.createHTML("select",{id:E.id,"class":"mceNativeListBox"},F);return F},postRender:function(){var F=this,G;F.rendered=true;function E(I){var H=I.target.options[I.target.selectedIndex].value;F.onChange.dispatch(F,H);if(F.settings.onselect){F.settings.onselect(H)}}B.add(F.id,"change",E);B.add(F.id,"keydown",function(I){var H;B.remove(F.id,"change",G);H=B.add(F.id,"blur",function(){B.add(F.id,"change",E);B.remove(F.id,"blur",H)});if(I.keyCode==13||I.keyCode==32){E(I);return B.cancel(I)}});F.onPostRender.dispatch(F,C.get(F.id))}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(E,D){this.parent(E,D);this.onRenderMenu=new tinymce.util.Dispatcher(this);D.menu_container=D.menu_container||B.doc.body},showMenu:function(){var E=this,H,G,F=B.get(E.id),D;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=B.getPos(E.settings.menu_container);G=B.getPos(F);D=E.menu;D.settings.offset_x=G.x;D.settings.offset_y=G.y;D.settings.vp_offset_x=G.x;D.settings.vp_offset_y=G.y;D.settings.keyboard_focus=E._focused;D.showMenu(0,F.clientHeight);A.add(B.doc,"mousedown",E.hideMenu,E);E.setState("Selected",1);E.isMenuVisible=1},renderMenu:function(){var E=this,D;D=E.settings.control_manager.createDropMenu(E.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:E.settings.icons});D.onHideMenu.add(E.hideMenu,E);E.onRenderMenu.dispatch(E,D);E.menu=D},hideMenu:function(E){var D=this;if(E&&E.type=="mousedown"&&B.getParent(E.target,function(F){return F.id===D.id||F.id===D.id+"_open"})){return }if(!E||!B.getParent(E.target,function(F){return B.hasClass(F,"mceMenu")})){D.setState("Selected",0);A.remove(B.doc,"mousedown",D.hideMenu,D);if(D.menu){D.menu.hideMenu()}}D.isMenuVisible=0},postRender:function(){var D=this,E=D.settings;A.add(D.id,"click",function(){if(!D.isDisabled()){if(E.onclick){E.onclick(D.value)}D.showMenu()}})}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(E,D){this.parent(E,D);this.classPrefix="mceSplitButton"},renderHTML:function(){var G,E=this,F=E.settings,D;G="<tbody><tr>";if(F.image){D=B.createHTML("img ",{src:F.image,"class":"mceAction "+F["class"]})}else{D=B.createHTML("span",{"class":"mceAction "+F["class"]},"")}G+="<td>"+B.createHTML("a",{id:E.id+"_action",href:"javascript:;","class":"mceAction "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";D=B.createHTML("span",{"class":"mceOpen "+F["class"]});G+="<td>"+B.createHTML("a",{id:E.id+"_open",href:"javascript:;","class":"mceOpen "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";G+="</tr></tbody>";return B.createHTML("table",{id:E.id,"class":"mceSplitButton mceSplitButtonEnabled "+F["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:F.title},G)},postRender:function(){var D=this,E=D.settings;if(E.onclick){A.add(D.id+"_action","click",function(){if(!D.isDisabled()){E.onclick(D.value)}})}A.add(D.id+"_open","click",D.showMenu,D);A.add(D.id+"_open","focus",function(){D._focused=1});A.add(D.id+"_open","blur",function(){D._focused=0});if(tinymce.isIE6||!B.boxModel){A.add(D.id,"mouseover",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.addClass(D.id,"mceSplitButtonHover")}});A.add(D.id,"mouseout",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.removeClass(D.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();A.clear(this.id+"_action");A.clear(this.id+"_open")}})})();(function(){var C=tinymce.DOM,A=tinymce.dom.Event,B=tinymce.is,D=tinymce.each;tinymce.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(G,F){var E=this;E.parent(G,F);E.settings=F=tinymce.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},E.settings);E.value=F.default_color},showMenu:function(){var E=this,F,I,H,G;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=C.get(E.id);C.show(E.id+"_menu");C.addClass(H,"mceSplitButtonSelected");G=C.getPos(H);C.setStyles(E.id+"_menu",{left:G.x,top:G.y+H.clientHeight,zIndex:200000});H=0;A.add(C.doc,"mousedown",E.hideMenu,E);if(E._focused){E._keyHandler=A.add(E.id+"_menu","keydown",function(J){if(J.keyCode==27){E.hideMenu()}});C.select("a",E.id+"_menu")[0].focus()}E.isMenuVisible=1},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&C.getParent(F.target,function(G){return G.id===E.id+"_open"})){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceSplitButtonMenu")})){C.removeClass(E.id,"mceSplitButtonSelected");A.remove(C.doc,"mousedown",E.hideMenu,E);A.remove(E.id+"_menu","keydown",E._keyHandler);C.hide(E.id+"_menu")}E.isMenuVisible=0},renderMenu:function(){var I=this,E,H=0,J=I.settings,L,G,K,F;F=C.add(J.menu_container,"div",{id:I.id+"_menu","class":J.menu_class+" "+J["class"],style:"position:absolute;left:0;top:-1000px;"});E=C.add(F,"div",{"class":J["class"]+" mceSplitButtonMenu"});C.add(E,"span",{"class":"mceMenuLine"});L=C.add(E,"table",{"class":"mceColorSplitMenu"});G=C.add(L,"tbody");H=0;D(B(J.colors,"array")?J.colors:J.colors.split(","),function(M){M=M.replace(/^#/,"");if(!H--){K=C.add(G,"tr");H=J.grid_width-1}L=C.add(K,"td");L=C.add(L,"a",{href:"javascript:;",style:{backgroundColor:"#"+M},mce_color:"#"+M})});if(J.more_colors_func){L=C.add(G,"tr");L=C.add(L,"td",{colspan:J.grid_width,"class":"mceMoreColors"});L=C.add(L,"a",{id:I.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},J.more_colors_title);A.add(L,"click",function(M){J.more_colors_func.call(J.more_colors_scope||this);return A.cancel(M)})}C.addClass(E,"mceColorSplitMenu");A.add(I.id+"_menu","mouseup",function(M){tinymce.dom.Event.cancel(M)});A.add(I.id+"_menu","mousedown",function(M){tinymce.dom.Event.cancel(M)});A.add(I.id+"_menu","click",function(M){var N;tinymce.dom.Event.cancel(M);e=M.target;if(e.nodeName=="A"&&(N=e.getAttribute("mce_color"))){I.setColor(N)}});return F},setColor:function(F){var E=this;C.setStyle(E.id+"_preview","backgroundColor",F);E.value=F;E.hideMenu();E.settings.onselect(F)},postRender:function(){var E=this,F=E.id;E.parent();C.add(F+"_action","div",{id:F+"_preview","class":"mceColorPreview"})},destroy:function(){this.parent();A.clear(this.id+"_menu");A.clear(this.id+"_more");C.remove(this.id+"_menu")}})})();tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var I=this,D="",F,G,B=tinymce.DOM,J=I.settings,C,A,E,H;H=I.controls;for(C=0;C<H.length;C++){G=H[C];A=H[C-1];E=H[C+1];if(C===0){F="mceToolbarStart";if(G.Button){F+=" mceToolbarStartButton"}else{if(G.SplitButton){F+=" mceToolbarStartSplitButton"}else{if(G.ListBox){F+=" mceToolbarStartListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"))}if(A&&G.ListBox){if(A.Button||A.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarEnd"},B.createHTML("span",null,"<!-- IE -->"))}}if(B.stdMode){D+='<td style="position: relative">'+G.renderHTML()+"</td>"}else{D+="<td>"+G.renderHTML()+"</td>"}if(E&&G.ListBox){if(E.Button||E.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarStart"},B.createHTML("span",null,"<!-- IE -->"))}}}F="mceToolbarEnd";if(G.Button){F+=" mceToolbarEndButton"}else{if(G.SplitButton){F+=" mceToolbarEndSplitButton"}else{if(G.ListBox){F+=" mceToolbarEndListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"));return B.createHTML("table",{id:I.id,"class":"mceToolbar"+(J["class"]?" "+J["class"]:""),cellpadding:"0",cellspacing:"0",align:I.settings.align||""},"<tbody><tr>"+D+"</tr></tbody>")}});(function(){var A=tinymce.util.Dispatcher,B=tinymce.each;tinymce.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new A(this),get:function(C){return this.lookup[C]},requireLangPack:function(E){var C,D;if(tinymce.EditorManager.settings){C=this.urls[E]+"/langs/"+tinymce.EditorManager.settings.language+".js";D=tinymce.EditorManager.settings;if(D){if(!tinymce.dom.Event.domLoaded&&!D.strict_mode){tinymce.ScriptLoader.load(C)}else{tinymce.ScriptLoader.add(C)}}}},add:function(D,C){this.items.push(C);this.lookup[D]=C;this.onAdd.dispatch(this,D,C);return C},load:function(G,D,C,F){var E=this;if(E.lookup[G]){return }if(E.urls[G]){return }if(D.indexOf("/")!=0&&D.indexOf("://")==-1){D=tinymce.baseURL+"/"+D}E.urls[G]=D.substring(0,D.lastIndexOf("/"));tinymce.ScriptLoader.add(D,C,F)}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager()}());(function(){var F=tinymce.each,G=tinymce.extend,E=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.ThemeManager,B=tinymce.PluginManager,D=tinymce.explode;tinymce.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var H=this,I=window.location;tinymce.documentBaseURL=I.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(tinymce.documentBaseURL)){tinymce.documentBaseURL+="/"}tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=I.hostname&&I.hostname){document.domain=tinymce.relaxedDomain=I.hostname.replace(/.*\.(.+\..+)$/,"$1")}H.onBeforeUnload=new tinymce.util.Dispatcher(H);A.add(window,"beforeunload",function(J){H.onBeforeUnload.dispatch(H,J)})},init:function(K){var I=this,J,H=tinymce.ScriptLoader,N,M;function L(Q,R,O){var P=Q[R];if(!P){return }if(tinymce.is(P,"string")){O=P.replace(/\.\w+$/,"");O=O?tinymce.resolve(O):0;P=tinymce.resolve(P)}return P.apply(O||this,Array.prototype.slice.call(arguments,2))}K=G({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},K);I.settings=K;if(!A.domLoaded&&!K.strict_loading_mode){if(K.language){H.add(tinymce.baseURL+"/langs/"+K.language+".js")}if(K.theme&&K.theme.charAt(0)!="-"&&!C.urls[K.theme]){C.load(K.theme,"themes/"+K.theme+"/editor_template"+tinymce.suffix+".js")}if(K.plugins){J=D(K.plugins);if(tinymce.inArray(J,"compat2x")!=-1){B.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js")}F(J,function(O){if(O&&O.charAt(0)!="-"&&!B.urls[O]){if(!tinymce.isWebKit&&O=="safari"){return }}})}H.loadQueue()}A.add(document,"init",function(){var O,Q;L(K,"onpageload");if(K.browsers){O=false;F(D(K.browsers),function(R){switch(R){case"ie":case"msie":if(tinymce.isIE){O=true}break;case"gecko":if(tinymce.isGecko){O=true}break;case"safari":case"webkit":if(tinymce.isWebKit){O=true}break;case"opera":if(tinymce.isOpera){O=true}break}});if(!O){return }}switch(K.mode){case"exact":O=K.elements||"";if(O.length>0){F(D(O),function(R){if(E.get(R)){new tinymce.Editor(R,K).render(1)}else{N=0;F(document.forms,function(S){F(S.elements,function(T){if(T.name===R){R="mce_editor_"+N;E.setAttrib(T,"id",R);new tinymce.Editor(R,K).render(1)}})})}})}break;case"textareas":case"specific_textareas":function P(S,R){return new RegExp("\\b"+R+"\\b","g").test(S.className)}F(E.select("textarea"),function(R){if(K.editor_deselector&&P(R,K.editor_deselector)){return }if(!K.editor_selector||P(R,K.editor_selector)){M=E.get(R.name);if(!R.id&&!M){R.id=R.name}if(!R.id||I.get(R.id)){R.id=E.uniqueId()}new tinymce.Editor(R.id,K).render(1)}});break}if(K.oninit){O=Q=0;F(I.editors,function(R){Q++;if(!R.initialized){R.onInit.add(function(){O++;if(O==Q){L(K,"oninit")}})}else{O++}if(O==Q){L(K,"oninit")}})}})},get:function(H){return this.editors[H]},getInstanceById:function(H){return this.get(H)},add:function(H){this.editors[H.id]=H;this._setActive(H);return H},remove:function(I){var H=this;if(!H.editors[I.id]){return null}delete H.editors[I.id];if(H.activeEditor==I){F(H.editors,function(J){H._setActive(J);return false})}I.destroy();return I},execCommand:function(N,L,K){var M=this,J=M.get(K),H;switch(N){case"mceFocus":J.focus();return true;case"mceAddEditor":case"mceAddControl":if(!M.get(K)){new tinymce.Editor(K,M.settings).render()}return true;case"mceAddFrameControl":H=K.window;H.tinyMCE=tinyMCE;H.tinymce=tinymce;tinymce.DOM.doc=H.document;tinymce.DOM.win=H;J=new tinymce.Editor(K.element_id,K);J.render();if(tinymce.isIE){function I(){J.destroy();H.detachEvent("onunload",I);H=H.tinyMCE=H.tinymce=null}H.attachEvent("onunload",I)}K.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":J.remove();return true;case"mceToggleEditor":if(!J){M.execCommand("mceAddControl",0,K);return true}if(J.isHidden()){J.show()}else{J.hide()}return true}if(M.activeEditor){return M.activeEditor.execCommand(N,L,K)}return false},execInstanceCommand:function(L,K,J,I){var H=this.get(L);if(H){return H.execCommand(K,J,I)}return false},triggerSave:function(){F(this.editors,function(H){H.save()})},addI18n:function(J,K){var H,I=this.i18n;if(!tinymce.is(J,"string")){F(J,function(M,L){F(M,function(O,N){F(O,function(Q,P){if(N==="common"){I[L+"."+P]=Q}else{I[L+"."+N+"."+P]=Q}})})})}else{F(K,function(M,L){I[J+"."+L]=M})}},_setActive:function(H){this.selectedInstance=this.activeEditor=H}});tinymce.EditorManager.preInit()})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var N=tinymce.DOM,K=tinymce.dom.Event,F=tinymce.extend,L=tinymce.util.Dispatcher;var J=tinymce.each,A=tinymce.isGecko,B=tinymce.isIE,E=tinymce.isWebKit;var D=tinymce.is,H=tinymce.ThemeManager,C=tinymce.PluginManager,I=tinymce.EditorManager;var O=tinymce.inArray,M=tinymce.grep,G=tinymce.explode;tinymce.create("tinymce.Editor",{Editor:function(R,Q){var P=this;P.id=P.editorId=R;P.execCommands={};P.queryStateCommands={};P.queryValueCommands={};P.plugins={};J(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(S){P[S]=new L(P)});P.settings=Q=F({id:R,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px"},Q);P.documentBaseURI=new tinymce.util.URI(Q.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});P.baseURI=I.baseURI;P.execCallback("setup",P)},render:function(R){var S=this,T=S.settings,U=S.id,P=tinymce.ScriptLoader;if(!K.domLoaded){K.add(document,"init",function(){S.render()});return }if(!R){T.strict_loading_mode=1;tinyMCE.settings=T}if(!S.getElement()){return }if(T.strict_loading_mode){P.settings.strict_mode=T.strict_loading_mode;tinymce.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(S.getElement().nodeName)&&T.hidden_input&&N.getParent(U,"form")){N.insertAfter(N.create("input",{type:"hidden",name:U}),U)}S.windowManager=new tinymce.WindowManager(S);if(T.encoding=="xml"){S.onGetContent.add(function(V,W){if(W.get){W.content=N.encode(W.content)}})}if(T.add_form_submit_trigger){S.onSubmit.addToTop(function(){if(S.initialized){S.save();S.isNotDirty=1}})}if(T.add_unload_trigger){S._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(S.initialized&&!S.destroyed&&!S.isHidden()){S.save({format:"raw",no_events:true})}})}tinymce.addUnload(S.destroy,S);if(T.submit_patch){S.onBeforeRenderUI.add(function(){var V=S.getElement().form;if(!V){return }if(V._mceOldSubmit){return }if(!V.submit.nodeType&&!V.submit.length){S.formElement=V;V._mceOldSubmit=V.submit;V.submit=function(){I.triggerSave();S.isNotDirty=1;return this._mceOldSubmit(this)}}V=null})}function Q(){if(T.language){P.add(tinymce.baseURL+"/langs/"+T.language+".js")}if(T.theme.charAt(0)!="-"&&!H.urls[T.theme]){H.load(T.theme,"themes/"+T.theme+"/editor_template"+tinymce.suffix+".js")}J(G(T.plugins),function(V){if(V&&V.charAt(0)!="-"&&!C.urls[V]){if(!E&&V=="safari"){return }C.load(V,"plugins/"+V+"/editor_plugin"+tinymce.suffix+".js")}});P.loadQueue(function(){if(T.ask){function V(){S.windowManager.confirm(S.getLang("edit_confirm"),function(W){if(W){S.init()}else{K.remove(S.id,"focus",V)}})}K.add(S.id,"focus",V);return }if(!S.removed){S.init()}})}if(T.plugins.indexOf("compat2x")!=-1){C.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js");P.loadQueue(Q)}else{Q()}},init:function(){var R,a=this,b=a.settings,X,U,W=a.getElement(),Q,P,Y,T,V,Z;I.add(a);b.theme=b.theme.replace(/-/,"");Q=H.get(b.theme);a.theme=new Q();if(a.theme.init&&b.init_theme){a.theme.init(a,H.urls[b.theme]||tinymce.documentBaseURL.replace(/\/$/,""))}J(G(b.plugins.replace(/\-/g,"")),function(g){var h=C.get(g),f=C.urls[g]||tinymce.documentBaseURL.replace(/\/$/,""),d;if(h){d=new h(a,f);a.plugins[g]=d;if(d.init){d.init(a,f)}}});if(b.popup_css){b.popup_css=a.documentBaseURI.toAbsolute(b.popup_css)}else{b.popup_css=a.baseURI.toAbsolute("themes/"+b.theme+"/skins/"+b.skin+"/dialog.css")}if(b.popup_css_add){b.popup_css+=","+a.documentBaseURI.toAbsolute(b.popup_css_add)}a.controlManager=new tinymce.ControlManager(a);a.undoManager=new tinymce.UndoManager(a);a.undoManager.onAdd.add(function(d,c){return a.onChange.dispatch(a,c,d)});a.undoManager.onUndo.add(function(d,c){return a.onUndo.dispatch(a,c,d)});a.undoManager.onRedo.add(function(d,c){return a.onRedo.dispatch(a,c,d)});if(b.custom_undo_redo){a.onExecCommand.add(function(d,g,f,h,c){if(g!="Undo"&&g!="Redo"&&g!="mceRepaint"&&(!c||!c.skip_undo)){a.undoManager.add()}})}a.onExecCommand.add(function(d,f){if(!/^(FontName|FontSize)$/.test(f)){a.nodeChanged()}});if(A){function S(c,d){if(!d||!d.initial){a.execCommand("mceRepaint")}}a.onUndo.add(S);a.onRedo.add(S);a.onSetContent.add(S)}a.onBeforeRenderUI.dispatch(a,a.controlManager);if(b.render_ui){X=b.width||W.style.width||W.clientWidth;U=b.height||W.style.height||W.clientHeight;a.orgDisplay=W.style.display;Z=/^[0-9\.]+(|px)$/i;if(Z.test(""+X)){X=Math.max(parseInt(X)+(Q.deltaWidth||0),100)}if(Z.test(""+U)){U=Math.max(parseInt(U)+(Q.deltaHeight||0),100)}Q=a.theme.renderUI({targetNode:W,width:X,height:U,deltaWidth:b.delta_width,deltaHeight:b.delta_height});a.editorContainer=Q.editorContainer}N.setStyles(Q.sizeContainer||Q.editorContainer,{width:X,height:U});U=(Q.iframeHeight||U)+((U+"").indexOf("%")==-1?(Q.deltaHeight||0):"");if(U<100){U=100}a.iframeHTML=b.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+a.documentBaseURI.getURI()+'"></base>';a.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain){a.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";<\/script>'}T=b.body_id||"tinymce";if(T.indexOf("=")!=-1){T=a.getParam("body_id","","hash");T=T[a.id]||T}V=b.body_class||"";if(V.indexOf("=")!=-1){V=a.getParam("body_class","","hash");V=V[a.id]||""}a.iframeHTML+='</head><body id="'+T+'" class="mceContentBody '+V+'"></body></html>';if(tinymce.relaxedDomain){if(B){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+a.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(tinymce.isOpera){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}R=N.add(Q.iframeContainer,"iframe",{id:a.id+"_ifr",src:Y||'javascript:""',frameBorder:"0",style:{width:"100%",height:U}});a.contentAreaContainer=Q.iframeContainer;N.get(Q.editorContainer).style.display=a.orgDisplay;N.get(a.id).style.display="none";if(tinymce.isOldWebKit){K.add(R,"load",a.setupIframe,a);R.src=tinymce.baseURL+"/plugins/safari/blank.htm"}else{if(!B||!tinymce.relaxedDomain){a.setupIframe()}W=R=Q=null}},setupIframe:function(){var S=this,U=S.settings,V=N.get(S.id),W=S.getDoc(),T,Q;if(!B||!tinymce.relaxedDomain){W.open();W.write(S.iframeHTML);W.close()}if(!B){try{W.designMode="On"}catch(R){}}if(B){Q=S.getBody();N.hide(Q);Q.contentEditable=true;N.show(Q)}S.dom=new tinymce.DOM.DOMUtils(S.getDoc(),{keep_values:true,url_converter:S.convertURL,url_converter_scope:S,hex_colors:U.force_hex_style_colors,class_filter:U.class_filter,update_styles:1,fix_ie_paragraphs:1});S.serializer=new tinymce.dom.Serializer({entity_encoding:U.entity_encoding,entities:U.entities,valid_elements:U.verify_html===false?"*[*]":U.valid_elements,extended_valid_elements:U.extended_valid_elements,valid_child_elements:U.valid_child_elements,invalid_elements:U.invalid_elements,fix_table_elements:U.fix_table_elements,fix_list_elements:U.fix_list_elements,fix_content_duplication:U.fix_content_duplication,convert_fonts_to_spans:U.convert_fonts_to_spans,font_size_classes:U.font_size_classes,font_size_style_values:U.font_size_style_values,apply_source_formatting:U.apply_source_formatting,remove_linebreaks:U.remove_linebreaks,dom:S.dom});S.selection=new tinymce.dom.Selection(S.dom,S.getWin(),S.serializer);S.forceBlocks=new tinymce.ForceBlocks(S,{forced_root_block:U.forced_root_block});S.editorCommands=new tinymce.EditorCommands(S);S.serializer.onPreProcess.add(function(X,Y){return S.onPreProcess.dispatch(S,Y,X)});S.serializer.onPostProcess.add(function(X,Y){return S.onPostProcess.dispatch(S,Y,X)});S.onPreInit.dispatch(S);if(!U.gecko_spellcheck){S.getBody().spellcheck=0}S._addEvents();S.controlManager.onPostRender.dispatch(S,S.controlManager);S.onPostRender.dispatch(S);if(U.directionality){S.getBody().dir=U.directionality}if(U.nowrap){S.getBody().style.whiteSpace="nowrap"}if(U.auto_resize){S.onNodeChange.add(S.resizeToContent,S)}if(U.custom_elements){function P(X,Y){J(G(U.custom_elements),function(Z){var a;if(Z.indexOf("~")===0){Z=Z.substring(1);a="span"}else{a="div"}Y.content=Y.content.replace(new RegExp("<("+Z+")([^>]*)>","g"),"<"+a+' mce_name="$1"$2>');Y.content=Y.content.replace(new RegExp("</("+Z+")>","g"),"</"+a+">")})}S.onBeforeSetContent.add(P);S.onPostProcess.add(function(X,Y){if(Y.set){P(X,Y)}})}if(U.handle_node_change_callback){S.onNodeChange.add(function(Y,X,Z){S.execCallback("handle_node_change_callback",S.id,Z,-1,-1,true,S.selection.isCollapsed())})}if(U.save_callback){S.onSaveContent.add(function(X,Z){var Y=S.execCallback("save_callback",S.id,Z.content,S.getBody());if(Y){Z.content=Y}})}if(U.onchange_callback){S.onChange.add(function(Y,X){S.execCallback("onchange_callback",S,X)})}if(U.convert_newlines_to_brs){S.onBeforeSetContent.add(function(X,Y){if(Y.initial){Y.content=Y.content.replace(/\r?\n/g,"<br />")}})}if(U.fix_nesting&&B){S.onBeforeSetContent.add(function(X,Y){Y.content=S._fixNesting(Y.content)})}if(U.preformatted){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^\s*<pre.*?>/,"");Y.content=Y.content.replace(/<\/pre>\s*$/,"");if(Y.set){Y.content='<pre class="mceItemHidden">'+Y.content+"</pre>"}})}if(U.verify_css_classes){S.serializer.attribValueFilter=function(a,Y){var Z,X;if(a=="class"){if(!S.classesRE){X=S.dom.getClasses();if(X.length>0){Z="";J(X,function(b){Z+=(Z?"|":"")+b["class"]});S.classesRE=new RegExp("("+Z+")","gi")}}return !S.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(Y)||S.classesRE.test(Y)?Y:""}return Y}}if(U.convert_fonts_to_spans){S._convertFonts()}if(U.inline_styles){S._convertInlineElements()}if(U.cleanup_callback){S.onBeforeSetContent.add(function(X,Y){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)});S.onPreProcess.add(function(X,Y){if(Y.set){S.execCallback("cleanup_callback","insert_to_editor_dom",Y.node,Y)}if(Y.get){S.execCallback("cleanup_callback","get_from_editor_dom",Y.node,Y)}});S.onPostProcess.add(function(X,Y){if(Y.set){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)}if(Y.get){Y.content=S.execCallback("cleanup_callback","get_from_editor",Y.content,Y)}})}if(U.save_callback){S.onGetContent.add(function(X,Y){if(Y.save){Y.content=S.execCallback("save_callback",S.id,Y.content,S.getBody())}})}if(U.handle_event_callback){S.onEvent.add(function(X,Y,Z){if(S.execCallback("handle_event_callback",Y,X,Z)===false){K.cancel(Y)}})}S.onSetContent.add(function(){S.addVisual(S.getBody())});if(U.padd_empty_editor){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^<p>(&nbsp;|#160;|\s|\u00a0)<\/p>$/,"")})}if(A){try{W.designMode="Off";W.designMode="On"}catch(R){}}setTimeout(function(){if(S.removed){return }S.load({initial:true,format:(U.cleanup_on_startup?"html":"raw")});S.startContent=S.getContent({format:"raw"});S.undoManager.add({initial:true});S.initialized=true;S.onInit.dispatch(S);S.execCallback("setupcontent_callback",S.id,S.getBody(),S.getDoc());S.execCallback("init_instance_callback",S);S.focus(true);S.nodeChanged({initial:1});if(U.content_css){tinymce.each(G(U.content_css),function(X){S.dom.loadCSS(S.documentBaseURI.toAbsolute(X))})}if(U.auto_focus){setTimeout(function(){var X=I.get(U.auto_focus);X.selection.select(X.getBody(),1);X.selection.collapse(1);X.getWin().focus()},100)}},1);V=null},focus:function(Q){var R,P=this;if(!Q){P.getWin().focus()}if(I.activeEditor!=P){if((R=I.activeEditor)!=null){R.onDeactivate.dispatch(R,P)}P.onActivate.dispatch(P,R)}I._setActive(P)},execCallback:function(S){var P=this,R=P.settings[S],Q;if(!R){return }if(P.callbackLookup&&(Q=P.callbackLookup[S])){R=Q.func;Q=Q.scope}if(D(R,"string")){Q=R.replace(/\.\w+$/,"");Q=Q?tinymce.resolve(Q):0;R=tinymce.resolve(R);P.callbackLookup=P.callbackLookup||{};P.callbackLookup[S]={func:R,scope:Q}}return R.apply(Q||P,Array.prototype.slice.call(arguments,1))},translate:function(P){var R=this.settings.language,Q=I.i18n;if(!P){return""}return Q[R+"."+P]||P.replace(/{\#([^}]+)\}/g,function(T,S){return Q[R+"."+S]||"{#"+S+"}"})},getLang:function(Q,P){return I.i18n[this.settings.language+"."+Q]||(D(P)?P:"{#"+Q+"}")},getParam:function(U,R,P){var S=tinymce.trim,Q=D(this.settings[U])?this.settings[U]:R,T;if(P==="hash"){T={};if(D(Q,"string")){J(Q.indexOf("=")>0?Q.split(/[;,](?![^=;,]*(?:[;,]|$))/):Q.split(","),function(V){V=V.split("=");if(V.length>1){T[S(V[0])]=S(V[1])}else{T[S(V[0])]=S(V)}})}else{T=Q}return T}return Q},nodeChanged:function(R){var P=this,Q=P.selection,S=Q.getNode()||P.getBody();if(P.initialized){P.onNodeChange.dispatch(P,R?R.controlManager||P.controlManager:P.controlManager,B&&S.ownerDocument!=P.getDoc()?P.getBody():S,Q.isCollapsed(),R)}},addButton:function(R,Q){var P=this;P.buttons=P.buttons||{};P.buttons[R]=Q},addCommand:function(R,Q,P){this.execCommands[R]={func:Q,scope:P||this}},addQueryStateHandler:function(R,Q,P){this.queryStateCommands[R]={func:Q,scope:P||this}},addQueryValueHandler:function(R,Q,P){this.queryValueCommands[R]={func:Q,scope:P||this}},addShortcut:function(R,T,P,S){var Q=this,U;if(!Q.settings.custom_shortcuts){return false}Q.shortcuts=Q.shortcuts||{};if(D(P,"string")){U=P;P=function(){Q.execCommand(U,false,null)}}if(D(P,"object")){U=P;P=function(){Q.execCommand(U[0],U[1],U[2])}}J(G(R),function(V){var W={func:P,scope:S||this,desc:T,alt:false,ctrl:false,shift:false};J(G(V,"+"),function(X){switch(X){case"alt":case"ctrl":case"shift":W[X]=true;break;default:W.charCode=X.charCodeAt(0);W.keyCode=X.toUpperCase().charCodeAt(0)}});Q.shortcuts[(W.ctrl?"ctrl":"")+","+(W.alt?"alt":"")+","+(W.shift?"shift":"")+","+W.keyCode]=W});return true},execCommand:function(U,T,W,P){var R=this,S=0,V,Q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(U)&&(!P||!P.skip_focus)){R.focus()}V={};R.onBeforeExecCommand.dispatch(R,U,T,W,V);if(V.terminate){return false}if(R.execCallback("execcommand_callback",R.id,R.selection.getNode(),U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(V=R.execCommands[U]){Q=V.func.call(V.scope,T,W);if(Q!==true){R.onExecCommand.dispatch(R,U,T,W,P);return Q}}J(R.plugins,function(X){if(X.execCommand&&X.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);S=1;return false}});if(S){return true}if(R.theme.execCommand&&R.theme.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(R.editorCommands.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}R.getDoc().execCommand(U,T,W);R.onExecCommand.dispatch(R,U,T,W,P)},queryCommandState:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryStateCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandState(T);if(S!==-1){return S}try{return this.getDoc().queryCommandState(T)}catch(P){}},queryCommandValue:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryValueCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandValue(T);if(D(S)){return S}try{return this.getDoc().queryCommandValue(T)}catch(P){}},show:function(){var P=this;N.show(P.getContainer());N.hide(P.id);P.load()},hide:function(){var P=this,Q=P.getDoc();if(B&&Q){Q.execCommand("SelectAll")}P.save();N.hide(P.getContainer());N.setStyle(P.id,"display",P.orgDisplay)},isHidden:function(){return !N.isHidden(this.id)},setProgressState:function(P,Q,R){this.onSetProgressState.dispatch(this,P,Q,R);return P},resizeToContent:function(){var P=this;N.setStyle(P.id+"_ifr","height",P.getBody().scrollHeight)},load:function(S){var P=this,R=P.getElement(),Q;S=S||{};S.load=true;Q=P.setContent(D(R.value)?R.value:R.innerHTML,S);S.element=R;if(!S.no_events){P.onLoadContent.dispatch(P,S)}S.element=R=null;return Q},save:function(T){var P=this,S=P.getElement(),Q,R;if(!P.initialized){return }T=T||{};T.save=true;T.element=S;Q=T.content=P.getContent(T);if(!T.no_events){P.onSaveContent.dispatch(P,T)}Q=T.content;if(!/TEXTAREA|INPUT/i.test(S.nodeName)){S.innerHTML=Q;if(R=N.getParent(P.id,"form")){J(R.elements,function(U){if(U.name==P.id){U.value=Q;return false}})}}else{S.value=Q}T.element=S=null;return Q},setContent:function(Q,R){var P=this;R=R||{};R.format=R.format||"html";R.set=true;R.content=Q;if(!R.no_events){P.onBeforeSetContent.dispatch(P,R)}if(!tinymce.isIE&&(Q.length===0||/^\s+$/.test(Q))){R.content=P.dom.setHTML(P.getBody(),'<br mce_bogus="1" />',1);R.format="raw"}R.content=P.dom.setHTML(P.getBody(),tinymce.trim(R.content));if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;R.content=P.dom.setHTML(P.getBody(),P.serializer.serialize(P.getBody(),R))}if(!R.no_events){P.onSetContent.dispatch(P,R)}return R.content},getContent:function(R){var P=this,Q;R=R||{};R.format=R.format||"html";R.get=true;if(!R.no_events){P.onBeforeGetContent.dispatch(P,R)}if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;Q=P.serializer.serialize(P.getBody(),R)}else{Q=P.getBody().innerHTML}Q=Q.replace(/^\s*|\s*$/g,"");R={content:Q};P.onGetContent.dispatch(P,R);return R.content},isDirty:function(){var P=this;return tinymce.trim(P.startContent)!=tinymce.trim(P.getContent({format:"raw",no_events:1}))&&!P.isNotDirty},getContainer:function(){var P=this;if(!P.container){P.container=N.get(P.editorContainer||P.id+"_parent")}return P.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return N.get(this.settings.content_element||this.id)},getWin:function(){var P=this,Q;if(!P.contentWindow){Q=N.get(P.id+"_ifr");if(Q){P.contentWindow=Q.contentWindow}}return P.contentWindow},getDoc:function(){var Q=this,P;if(!Q.contentDocument){P=Q.getWin();if(P){Q.contentDocument=P.document}}return Q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(P,T,S){var Q=this,R=Q.settings;if(R.urlconverter_callback){return Q.execCallback("urlconverter_callback",P,S,true,T)}if(!R.convert_urls||(S&&S.nodeName=="LINK")||P.indexOf("file:")===0){return P}if(R.relative_urls){return Q.documentBaseURI.toRelative(P)}P=Q.documentBaseURI.toAbsolute(P,R.remove_script_host);return P},addVisual:function(R){var P=this,Q=P.settings;R=R||P.getBody();if(!D(P.hasVisual)){P.hasVisual=Q.visual}J(P.dom.select("table,a",R),function(T){var S;switch(T.nodeName){case"TABLE":S=P.dom.getAttrib(T,"border");if(!S||S=="0"){if(P.hasVisual){P.dom.addClass(T,Q.visual_table_class)}else{P.dom.removeClass(T,Q.visual_table_class)}}return ;case"A":S=P.dom.getAttrib(T,"name");if(S){if(P.hasVisual){P.dom.addClass(T,"mceItemAnchor")}else{P.dom.removeClass(T,"mceItemAnchor")}}return }});P.onVisualAid.dispatch(P,R,P.hasVisual)},remove:function(){var P=this,Q=P.getContainer();P.removed=1;P.hide();P.execCallback("remove_instance_callback",P);P.onRemove.dispatch(P);P.onExecCommand.listeners=[];I.remove(P);N.remove(Q)},destroy:function(Q){var P=this;if(P.destroyed){return }if(!Q){tinymce.removeUnload(P.destroy);tinyMCE.onBeforeUnload.remove(P._beforeUnload);if(P.theme.destroy){P.theme.destroy()}P.controlManager.destroy();P.selection.destroy();P.dom.destroy();if(!P.settings.content_editable){K.clear(P.getWin());K.clear(P.getDoc())}K.clear(P.getBody());K.clear(P.formElement)}if(P.formElement){P.formElement.submit=P.formElement._mceOldSubmit;P.formElement._mceOldSubmit=null}P.contentAreaContainer=P.formElement=P.container=P.settings.content_element=P.bodyElement=P.contentDocument=P.contentWindow=null;if(P.selection){P.selection=P.selection.win=P.selection.dom=P.selection.dom.doc=null}P.destroyed=1},_addEvents:function(){var W=this,Q,X=W.settings,T={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function P(a,b){var Z=a.type;if(W.removed){return }if(W.onEvent.dispatch(W,a,b)!==false){W[T[a.fakeType||a.type]].dispatch(W,a,b)}}J(T,function(a,Z){switch(Z){case"contextmenu":if(tinymce.isOpera){K.add(W.getDoc(),"mousedown",function(b){if(b.ctrlKey){b.fakeType="contextmenu";P(b)}})}else{K.add(W.getDoc(),Z,P)}break;case"paste":K.add(W.getBody(),Z,function(g){var b,d,c,f;if(g.clipboardData){b=g.clipboardData.getData("text/plain")}else{if(tinymce.isIE){b=W.getWin().clipboardData.getData("Text")}}P(g,{text:b,html:d})});break;case"submit":case"reset":K.add(W.getElement().form||N.getParent(W.id,"form"),Z,P);break;default:K.add(X.content_editable?W.getBody():W.getDoc(),Z,P)}});K.add(X.content_editable?W.getBody():(A?W.getDoc():W.getWin()),"focus",function(Z){W.focus(true)});if(tinymce.isGecko){K.add(W.getDoc(),"DOMNodeInserted",function(a){var Z;a=a.target;if(a.nodeType===1&&a.nodeName==="IMG"&&(Z=a.getAttribute("mce_src"))){a.src=W.documentBaseURI.toAbsolute(Z)}})}if(A){function R(){var a=this,c=a.getDoc(),b=a.settings;if(A){if(a._isHidden()){try{if(!b.content_editable){c.designMode="On"}}catch(Z){}}try{c.execCommand("styleWithCSS",0,false)}catch(Z){if(!a._isHidden()){c.execCommand("useCSS",0,true)}}if(!b.table_inline_editing){try{c.execCommand("enableInlineTableEditing",false,false)}catch(Z){}}if(!b.object_resizing){try{c.execCommand("enableObjectResizing",false,false)}catch(Z){}}}}W.onBeforeExecCommand.add(R);W.onMouseDown.add(R)}W.onMouseUp.add(W.nodeChanged);W.onClick.add(W.nodeChanged);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.keyCode==46||a.keyCode==8||a.ctrlKey){W.nodeChanged()}});W.onReset.add(function(){W.setContent(W.startContent,{format:"raw"})});if(W.getParam("tab_focus")){function Y(Z,a){if(a.keyCode===9){return K.cancel(a)}}function U(b,h){var Z,c,g,d,a;function j(f){g=N.getParent(b.id,"form");d=g.elements;if(g){J(d,function(l,k){if(l.id==b.id){Z=k;return false}});if(f>0){for(c=Z+1;c<d.length;c++){if(d[c].type!="hidden"){return d[c]}}}else{for(c=Z-1;c>=0;c--){if(d[c].type!="hidden"){return d[c]}}}}return null}if(h.keyCode===9){a=G(b.getParam("tab_focus"));if(a.length==1){a[1]=a[0];a[0]=":prev"}if(h.shiftKey){if(a[0]==":prev"){d=j(-1)}else{d=N.get(a[0])}}else{if(a[1]==":next"){d=j(1)}else{d=N.get(a[1])}}if(d){if(b=I.get(d.id||d.name)){b.focus()}else{window.setTimeout(function(){window.focus();d.focus()},10)}return K.cancel(h)}}}W.onKeyUp.add(Y);if(A){W.onKeyPress.add(U);W.onKeyDown.add(Y)}else{W.onKeyDown.add(U)}}if(X.custom_shortcuts){if(X.custom_undo_redo_keyboard_shortcuts){W.addShortcut("ctrl+z",W.getLang("undo_desc"),"Undo");W.addShortcut("ctrl+y",W.getLang("redo_desc"),"Redo")}if(A){W.addShortcut("ctrl+b",W.getLang("bold_desc"),"Bold");W.addShortcut("ctrl+i",W.getLang("italic_desc"),"Italic");W.addShortcut("ctrl+u",W.getLang("underline_desc"),"Underline")}for(Q=1;Q<=6;Q++){W.addShortcut("ctrl+"+Q,"",["FormatBlock",false,"<h"+Q+">"])}W.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);W.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);W.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function S(a){var Z=null;if(!a.altKey&&!a.ctrlKey&&!a.metaKey){return Z}J(W.shortcuts,function(b){if(b.ctrl!=a.ctrlKey&&(!tinymce.isMac||b.ctrl==a.metaKey)){return }if(b.alt!=a.altKey){return }if(b.shift!=a.shiftKey){return }if(a.keyCode==b.keyCode||(a.charCode&&a.charCode==b.charCode)){Z=b;return false}});return Z}W.onKeyUp.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyPress.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyDown.add(function(Z,a){var b=S(a);if(b){b.func.call(b.scope);return K.cancel(a)}})}if(tinymce.isIE){K.add(W.getDoc(),"controlselect",function(b){var a=W.resizeInfo,Z;b=b.target;if(b.nodeName!=="IMG"){return }if(a){K.remove(a.node,a.ev,a.cb)}if(!W.dom.hasClass(b,"mceItemNoResize")){ev="resizeend";Z=K.add(b,ev,function(d){var c;d=d.target;if(c=W.dom.getStyle(d,"width")){W.dom.setAttrib(d,"width",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"width","")}if(c=W.dom.getStyle(d,"height")){W.dom.setAttrib(d,"height",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"height","")}})}else{ev="resizestart";Z=K.add(b,"resizestart",K.cancel,K)}a=W.resizeInfo={node:b,ev:ev,cb:Z}});W.onKeyDown.add(function(Z,a){switch(a.keyCode){case 8:if(W.selection.getRng().item){W.selection.getRng().item(0).removeNode();return K.cancel(a)}}})}if(tinymce.isOpera){W.onClick.add(function(Z,a){K.prevent(a)})}if(X.custom_undo_redo){function V(){W.undoManager.typing=0;W.undoManager.add()}if(tinymce.isIE){K.add(W.getWin(),"blur",function(Z){var a;if(W.selection){a=W.selection.getNode();if(!W.removed&&a.ownerDocument&&a.ownerDocument!=W.getDoc()){V()}}})}else{K.add(W.getDoc(),"blur",function(){if(W.selection&&!W.removed){V()}})}W.onMouseDown.add(V);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.ctrlKey){W.undoManager.typing=0;W.undoManager.add()}});W.onKeyDown.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45){if(W.undoManager.typing){W.undoManager.add();W.undoManager.typing=0}return }if(!W.undoManager.typing){W.undoManager.add();W.undoManager.typing=1}})}},_convertInlineElements:function(){var V=this,X=V.settings,Q=V.dom,U,S,R,W,P;function T(Y,Z){if(!X.inline_styles){return }if(Z.get){J(V.dom.select("table,u,strike",Z.node),function(a){switch(a.nodeName){case"TABLE":if(U=Q.getAttrib(a,"height")){Q.setStyle(a,"height",U);Q.setAttrib(a,"height","")}break;case"U":case"STRIKE":a.style.textDecoration=a.nodeName=="U"?"underline":"line-through";Q.setAttrib(a,"mce_style","");Q.setAttrib(a,"mce_name","span");break}})}else{if(Z.set){J(V.dom.select("table,span",Z.node).reverse(),function(a){if(a.nodeName=="TABLE"){if(U=Q.getStyle(a,"height")){Q.setAttrib(a,"height",U.replace(/[^0-9%]+/g,""))}}else{if(a.style.textDecoration=="underline"){R="u"}else{if(a.style.textDecoration=="line-through"){R="strike"}else{R=""}}if(R){a.style.textDecoration="";Q.setAttrib(a,"mce_style","");S=Q.create(R,{style:Q.getAttrib(a,"style")});Q.replace(S,a,1)}}})}}}V.onPreProcess.add(T);if(!X.cleanup_on_startup){V.onSetContent.add(function(Y,Z){if(Z.initial){T(V,{node:V.getBody(),set:1})}})}},_convertFonts:function(){var U=this,V=U.settings,W=U.dom,T,Q,P,S;if(!V.inline_styles){return }T=[8,10,12,14,18,24,36];Q=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(P=V.font_size_style_values){P=G(P)}if(S=V.font_size_classes){S=G(S)}function R(d){var g,c,Y,X,b,Z,a;if(tinymce.isWebKit||!V.inline_styles){return }Y=U.dom.select("span",d);for(X=Y.length-1;X>=0;X--){g=Y[X];c=W.create("font",{color:W.toHex(W.getStyle(g,"color")),face:W.getStyle(g,"fontFamily"),style:W.getAttrib(g,"style"),"class":W.getAttrib(g,"class")});a=c.style;if(a.color||a.fontFamily){a.color=a.fontFamily="";W.setAttrib(c,"mce_style","")}if(P){b=O(P,W.getStyle(g,"fontSize"));if(b!=-1){W.setAttrib(c,"size",""+(b+1||1));c.style.fontSize=""}}else{if(S){b=O(S,W.getAttrib(g,"class"));Z=W.getStyle(g,"fontSize");if(b==-1&&Z.indexOf("pt")>0){b=O(T,parseInt(Z))}if(b==-1){b=O(Q,Z)}if(b!=-1){W.setAttrib(c,"size",""+(b+1||1));c.style.fontSize=""}}}if(c.color||c.face||c.size){c.style.fontFamily="";W.setAttrib(c,"mce_style","");W.replace(c,g,1)}c=g=null}}U.onSetContent.add(function(X,Y){R(X.getBody())});U.onPreProcess.add(function(Z,b){var c,a,Y,X;if(!V.inline_styles){return }if(b.get){Y=U.dom.select("font",b.node);for(X=Y.length-1;X>=0;X--){c=Y[X];a=W.create("span",{style:W.getAttrib(c,"style"),"class":W.getAttrib(c,"class")});W.setStyles(a,{fontFamily:W.getAttrib(c,"face"),color:W.getAttrib(c,"color"),backgroundColor:c.style.backgroundColor});if(c.size){if(P){W.setStyle(a,"fontSize",P[parseInt(c.size)-1])}else{W.setAttrib(a,"class",S[parseInt(c.size)-1])}}W.setAttrib(a,"mce_style","");W.replace(a,c,1)}}})},_isHidden:function(){var P;if(!A){return 0}P=this.selection.getSel();return(!P||!P.rangeCount||P.rangeCount==0)},_fixNesting:function(Q){var R=[],P;Q=Q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(T,S,V){var U;if(S==="/"){if(!R.length){return""}if(V!==R[R.length-1].tag){for(P=R.length-1;P>=0;P--){if(R[P].tag===V){R[P].close=1;break}}return""}else{R.pop();if(R.length&&R[R.length-1].close){T=T+"</"+R[R.length-1].tag+">";R.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(V)){return T}if(/\/>$/.test(T)){return T}R.push({tag:V})}return T});for(P=R.length-1;P>=0;P--){Q+="</"+R[P].tag+">"}return Q}})})();(function(){var E=tinymce.each,C=tinymce.isIE,A=tinymce.isGecko,B=tinymce.isOpera,D=tinymce.isWebKit;tinymce.create("tinymce.EditorCommands",{EditorCommands:function(F){this.editor=F},execCommand:function(K,J,L){var H=this,F=H.editor,I;switch(K){case"Cut":case"Copy":case"Paste":try{F.getDoc().execCommand(K,J,L)}catch(G){if(A){F.windowManager.confirm(F.getLang("clipboard_msg"),function(M){if(M){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","mceExternal")}})}else{F.windowManager.alert(F.getLang("clipboard_no_support"))}}return true;case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":H.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":H.mceJustify(K,K.substring(7).toLowerCase());return true;case"mceEndUndoLevel":case"mceAddUndoLevel":F.undoManager.add();return true;default:I=this[K];if(I){I.call(this,J,L);return true}}return false},Indent:function(){var F=this.editor,K=F.dom,I=F.selection,J,G,H;G=F.settings.indentation;H=/[a-z%]+$/i.exec(G);G=parseInt(G);if(F.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){E(this._getSelectedBlocks(),function(L){K.setStyle(L,"paddingLeft",(parseInt(L.style.paddingLeft||0)+G)+H)});return }F.getDoc().execCommand("Indent",false,null);if(C){K.getParent(I.getNode(),function(L){if(L.nodeName=="BLOCKQUOTE"){L.dir=L.style.cssText=""}})}},Outdent:function(){var G=this.editor,L=G.dom,J=G.selection,K,F,H,I;H=G.settings.indentation;I=/[a-z%]+$/i.exec(H);H=parseInt(H);if(G.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){E(this._getSelectedBlocks(),function(M){F=Math.max(0,parseInt(M.style.paddingLeft||0)-H);L.setStyle(M,"paddingLeft",F?F+I:"")});return }G.getDoc().execCommand("Outdent",false,null)},mceSetAttribute:function(H,G){var F=this.editor,J=F.dom,I;if(I=J.getParent(F.selection.getNode(),J.isBlock)){J.setAttrib(I,G.name,G.value)}},mceSetContent:function(G,F){this.editor.setContent(F)},mceToggleVisualAid:function(){var F=this.editor;F.hasVisual=!F.hasVisual;F.addVisual()},mceReplaceContent:function(G,F){var H=this.editor.selection;H.setContent(F.replace(/\{\$selection\}/g,H.getContent({format:"text"})))},mceInsertLink:function(H,G){var F=this.editor,I=F.selection,J=F.dom.getParent(I.getNode(),"A");if(tinymce.is(G,"string")){G={href:G}}function K(L){E(G,function(N,M){F.dom.setAttrib(L,M,N)})}if(!J){F.execCommand("CreateLink",false,"javascript:mctmp(0);");E(F.dom.select("a"),function(L){if(L.href=="javascript:mctmp(0);"){K(L)}})}else{if(G.href){K(J)}else{F.dom.remove(J,1)}}},UnLink:function(){var F=this.editor,G=F.selection;if(G.isCollapsed()){G.select(G.getNode())}F.getDoc().execCommand("unlink",false,null);G.collapse(0)},FontName:function(H,G){var I=this,F=I.editor,J=F.selection,K;if(!G){if(J.isCollapsed()){J.select(J.getNode())}I.RemoveFormat()}else{F.getDoc().execCommand("FontName",false,G)}},queryCommandValue:function(G){var F=this["queryValue"+G];if(F){return F.call(this,G)}return false},queryCommandState:function(G){var F;switch(G){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(G,G.substring(7).toLowerCase());default:if(F=this["queryState"+G]){return F.call(this,G)}}return -1},_queryState:function(G){try{return this.editor.getDoc().queryCommandState(G)}catch(F){}},_queryVal:function(G){try{return this.editor.getDoc().queryCommandValue(G)}catch(F){}},queryValueFontSize:function(){var G=this.editor,F=0,H;if(B||D){if(H=G.dom.getParent(G.selection.getNode(),"FONT")){F=H.size}return F}return this._queryVal("FontSize")},queryValueFontName:function(){var G=this.editor,F=0,H;if(H=G.dom.getParent(G.selection.getNode(),"FONT")){F=H.face}if(!F){F=this._queryVal("FontName")}return F},mceJustify:function(M,N){var J=this.editor,L=J.selection,F=L.getNode(),O=F.nodeName,G,I,H=J.dom,K;if(J.settings.inline_styles&&this.queryStateJustify(M,N)){K=1}G=H.getParent(F,J.dom.isBlock);if(O=="IMG"){if(N=="full"){return }if(K){if(N=="center"){H.setStyle(F.parentNode,"textAlign","")}H.setStyle(F,"float","");this.mceRepaint();return }if(N=="center"){if(/^(TD|TH)$/.test(G.nodeName)){G=0}if(!G||G.childNodes.length>1){I=H.create("p");I.appendChild(F.cloneNode(false));if(G){H.insertAfter(I,G)}else{H.insertAfter(I,F)}H.remove(F);F=I.firstChild;G=I}H.setStyle(G,"textAlign",N);H.setStyle(F,"float","")}else{H.setStyle(F,"float",N);H.setStyle(F.parentNode,"textAlign","")}this.mceRepaint();return }if(J.settings.inline_styles&&J.settings.forced_root_block){if(K){N=""}E(this._getSelectedBlocks(H.getParent(L.getStart(),H.isBlock),H.getParent(L.getEnd(),H.isBlock)),function(P){H.setAttrib(P,"align","");H.setStyle(P,"textAlign",N=="full"?"justify":N)});return }else{if(!K){J.getDoc().execCommand(M,false,null)}}if(J.settings.inline_styles){if(K){H.getParent(J.selection.getNode(),function(P){if(P.style&&P.style.textAlign){H.setStyle(P,"textAlign","")}});return }E(H.select("*"),function(Q){var P=Q.align;if(P){if(P=="full"){P="justify"}H.setStyle(Q,"textAlign",P);H.setAttrib(Q,"align","")}})}},mceSetCSSClass:function(G,F){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:F})},getSelectedElement:function(){var T=this,N=T.editor,M=N.dom,Q=N.selection,G=Q.getRng(),K,J,R,O,I,F,P,H,U,S;if(Q.isCollapsed()||G.item){return Q.getNode()}S=N.settings.merge_styles_invalid_parents;if(tinymce.is(S,"string")){S=new RegExp(S,"i")}if(C){K=G.duplicate();K.collapse(true);R=K.parentElement();J=G.duplicate();J.collapse(false);O=J.parentElement();if(R!=O){K.move("character",1);R=K.parentElement()}if(R==O){K=G.duplicate();K.moveToElementText(R);if(K.compareEndPoints("StartToStart",G)==0&&K.compareEndPoints("EndToEnd",G)==0){return S&&S.test(R.nodeName)?null:R}}}else{function L(V){return M.getParent(V,function(W){return W.nodeType==1})}R=G.startContainer;O=G.endContainer;I=G.startOffset;F=G.endOffset;if(!G.collapsed){if(R==O){if(I-F<2){if(R.hasChildNodes()){H=R.childNodes[I];return S&&S.test(H.nodeName)?null:H}}}}if(R.nodeType!=3||O.nodeType!=3){return null}if(I==0){H=L(R);if(H&&H.firstChild!=R){H=null}}if(I==R.nodeValue.length){P=R.nextSibling;if(P&&P.nodeType==1){H=R.nextSibling}}if(F==0){P=O.previousSibling;if(P&&P.nodeType==1){U=P}}if(F==O.nodeValue.length){U=L(O);if(U&&U.lastChild!=O){U=null}}if(H==U){return S&&H&&S.test(H.nodeName)?null:H}}return null},InsertHorizontalRule:function(){if(A||C){this.editor.selection.setContent("<hr />")}else{this.editor.getDoc().execCommand("InsertHorizontalRule",false,"")}},RemoveFormat:function(){var H=this,G=H.editor,I=G.selection,F;if(D){I.setContent(I.getContent({format:"raw"}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,""),{format:"raw"})}else{G.getDoc().execCommand("RemoveFormat",false,null)}H.mceSetStyleInfo(0,{command:"removeformat"});G.addVisual()},mceSetStyleInfo:function(M,L){var P=this,G=P.editor,I=G.getDoc(),F=G.dom,H,J,Q=G.selection,O=L.wrapper||"span",J=Q.getBookmark(),N;function K(S,R){if(S.nodeType==1){switch(L.command){case"setattrib":return F.setAttrib(S,L.name,L.value);case"setstyle":return F.setStyle(S,L.name,L.value);case"removeformat":return F.setAttrib(S,"class","")}}}N=G.settings.merge_styles_invalid_parents;if(tinymce.is(N,"string")){N=new RegExp(N,"i")}if(H=P.getSelectedElement()){K(H,1)}else{I.execCommand("FontName",false,"__");E(D?F.select("span"):F.select("font"),function(T){var R,S;if(F.getAttrib(T,"face")=="__"||T.style.fontFamily==="__"){R=F.create(O,{mce_new:"1"});K(R);E(T.childNodes,function(U){R.appendChild(U.cloneNode(true))});F.replace(R,T)}})}E(F.select(O).reverse(),function(S){var R=S.parentNode;if(!F.getAttrib(S,"mce_new")){R=F.getParent(S,function(T){return T.nodeType==1&&F.getAttrib(T,"mce_new")});if(R){F.remove(S,1)}}});E(F.select(O).reverse(),function(S){var R=S.parentNode;if(!R||!F.getAttrib(S,"mce_new")){return }if(R.nodeName==O.toUpperCase()&&R.childNodes.length==1){return F.remove(R,1)}if(S.nodeType==1&&(!N||!N.test(R.nodeName))&&R.childNodes.length==1){K(R);F.setAttrib(S,"class","")}});E(F.select(O).reverse(),function(R){if(F.getAttrib(R,"mce_new")||(F.getAttribs(R).length<=1&&R.className==="")){if(!F.getAttrib(R,"class")&&!F.getAttrib(R,"style")){return F.remove(R,1)}F.setAttrib(R,"mce_new","")}});Q.moveToBookmark(J)},queryStateJustify:function(J,G){var F=this.editor,I=F.selection.getNode(),H=F.dom;if(I&&I.nodeName=="IMG"){if(H.getStyle(I,"float")==G){return 1}return I.parentNode.style.textAlign==G}I=H.getParent(F.selection.getStart(),function(K){return K.nodeType==1&&K.style.textAlign});if(G=="full"){G="justify"}if(F.settings.inline_styles){return(I&&I.style.textAlign==G)}return this._queryState(J)},HiliteColor:function(H,J){var G=this,F=G.editor,I=F.getDoc();function K(M){if(!A){return }try{I.execCommand("styleWithCSS",0,M)}catch(L){I.execCommand("useCSS",0,!M)}}if(A||B){K(true);I.execCommand("hilitecolor",false,J);K(false)}else{I.execCommand("BackColor",false,J)}},Undo:function(){var F=this.editor;if(F.settings.custom_undo_redo){F.undoManager.undo();F.nodeChanged()}else{F.getDoc().execCommand("Undo",false,null)}},Redo:function(){var F=this.editor;if(F.settings.custom_undo_redo){F.undoManager.redo();F.nodeChanged()}else{F.getDoc().execCommand("Redo",false,null)}},FormatBlock:function(H,I){var G=this,F=G.editor;I=F.settings.forced_root_block?(I||"<p>"):I;if(/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(F.selection.getNode().nodeName)){G.mceRemoveNode()}if(I.indexOf("<")==-1){I="<"+I+">"}if(tinymce.isGecko){I=I.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}F.getDoc().execCommand("FormatBlock",false,I)},mceCleanup:function(){var G=this.editor,H=G.selection,F=H.getBookmark();G.setContent(G.getContent());H.moveToBookmark(F)},mceRemoveNode:function(I,J){var G=this.editor,H=G.selection,F,K=J||H.getNode();if(K==G.getBody()){return }F=H.getBookmark();G.dom.remove(K,1);H.moveToBookmark(F);G.nodeChanged()},mceSelectNodeDepth:function(H,I){var F=this.editor,G=F.selection,J=0;F.dom.getParent(G.getNode(),function(K){if(K.nodeType==1&&J++==I){G.select(K);F.nodeChanged();return false}},F.getBody())},mceSelectNode:function(G,F){this.editor.selection.select(F)},mceInsertContent:function(F,G){this.editor.selection.setContent(G)},mceInsertRawHTML:function(G,H){var F=this.editor;F.selection.setContent("tiny_mce_marker");F.setContent(F.getContent().replace(/tiny_mce_marker/g,H))},mceRepaint:function(){var H,F,I=this.editor;if(tinymce.isGecko){try{H=I.selection;F=H.getBookmark(true);if(H.getSel()){H.getSel().selectAllChildren(I.getBody())}H.collapse(true);H.moveToBookmark(F)}catch(G){}}},queryStateUnderline:function(){var F=this.editor,G=F.selection.getNode();if(G&&G.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var F=this.editor,G;if(F.settings.inline_styles){if((G=F.dom.getParent(F.selection.getStart(),F.dom.isBlock))&&parseInt(G.style.paddingLeft)>0){return true}if((G=F.dom.getParent(F.selection.getEnd(),F.dom.isBlock))&&parseInt(G.style.paddingLeft)>0){return true}}else{return !!F.dom.getParent(F.selection.getNode(),"BLOCKQUOTE")}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"UL")},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"OL")},queryStatemceBlockQuote:function(){return !!this.editor.dom.getParent(this.editor.selection.getStart(),function(F){return F.nodeName==="BLOCKQUOTE"})},mceBlockQuote:function(){var Q=this,M=Q.editor,S=M.selection,J=M.dom,O,N,I,H,R,G,P,L,F;function K(T){return J.getParent(T,function(U){return U.nodeName==="BLOCKQUOTE"})}O=J.getParent(S.getStart(),J.isBlock);N=J.getParent(S.getEnd(),J.isBlock);if(R=K(O)){if(O!=N||O.childNodes.length>1||(O.childNodes.length==1&&O.firstChild.nodeName!="BR")){H=S.getBookmark()}if(K(N)){P=R.cloneNode(false);while(I=N.nextSibling){P.appendChild(I.parentNode.removeChild(I))}}if(P){J.insertAfter(P,R)}F=Q._getSelectedBlocks(O,N);for(L=F.length-1;L>=0;L--){J.insertAfter(F[L],R)}if(/^\s*$/.test(R.innerHTML)){J.remove(R,1)}if(P&&/^\s*$/.test(P.innerHTML)){J.remove(P,1)}if(!H){if(!C){G=M.getDoc().createRange();G.setStart(O,0);G.setEnd(O,0);S.setRng(G)}else{S.select(O);S.collapse(0);if(J.getParent(S.getStart(),J.isBlock)!=O){G=S.getRng();G.move("character",-1);G.select()}}}else{Q.editor.selection.moveToBookmark(H)}return }if(C&&!O&&!N){Q.editor.getDoc().execCommand("Indent");I=K(S.getNode());I.style.margin=I.dir="";return }if(!O||!N){return }if(O!=N||O.childNodes.length>1||(O.childNodes.length==1&&O.firstChild.nodeName!="BR")){H=S.getBookmark()}E(Q._getSelectedBlocks(K(S.getStart()),K(S.getEnd())),function(T){if(T.nodeName=="BLOCKQUOTE"&&!R){R=T;return }if(!R){R=J.create("blockquote");T.parentNode.insertBefore(R,T)}if(T.nodeName=="BLOCKQUOTE"&&R){I=T.firstChild;while(I){R.appendChild(I.cloneNode(true));I=I.nextSibling}J.remove(T);return }R.appendChild(J.remove(T))});if(!H){if(!C){G=M.getDoc().createRange();G.setStart(O,0);G.setEnd(O,0);S.setRng(G)}else{S.select(O);S.collapse(1)}}else{S.moveToBookmark(H)}},_getSelectedBlocks:function(M,F){var J=this.editor,I=J.dom,N=J.selection,L,K,H,G=[];L=I.getParent(M||N.getStart(),I.isBlock);K=I.getParent(F||N.getEnd(),I.isBlock);if(L){G.push(L)}if(L&&K&&L!=K){H=L;while((H=H.nextSibling)&&H!=K){if(I.isBlock(H)){G.push(H)}}}if(K&&L!=K){G.push(K)}return G}})})();tinymce.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(B){var C=this,A=tinymce.util.Dispatcher;C.editor=B;C.data=[];C.onAdd=new A(this);C.onUndo=new A(this);C.onRedo=new A(this)},add:function(B){var E=this,D,C=E.editor,A,F=C.settings,G;B=B||{};B.content=B.content||C.getContent({format:"raw",no_events:1});B.content=B.content.replace(/^\s*|\s*$/g,"");G=E.data[E.index>0?E.index-1:0];if(!B.initial&&G&&B.content==G.content){return null}if(F.custom_undo_redo_levels){if(E.data.length>F.custom_undo_redo_levels){for(D=0;D<E.data.length-1;D++){E.data[D]=E.data[D+1]}E.data.length--;E.index=E.data.length}}if(F.custom_undo_redo_restore_selection&&!B.initial){B.bookmark=A=B.bookmark||C.selection.getBookmark()}if(E.index<E.data.length&&E.data[E.index].initial){E.index++}if(E.data.length===0&&!B.initial){return null}E.data.length=E.index+1;E.data[E.index++]=B;if(B.initial){E.index=0}if(E.data.length==2&&E.data[0].initial){E.data[0].bookmark=A}E.onAdd.dispatch(E,B);C.isNotDirty=0;return B},undo:function(){var D=this,B=D.editor,A=A,C;if(D.typing){D.add();D.typing=0}if(D.index>0){if(D.index==D.data.length&&D.index>1){C=D.index;D.typing=0;if(!D.add()){D.index=C}--D.index}A=D.data[--D.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);D.onUndo.dispatch(D,A)}return A},redo:function(){var C=this,B=C.editor,A=null;if(C.index<C.data.length-1){A=C.data[++C.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);C.onRedo.dispatch(C,A)}return A},clear:function(){var A=this;A.data=[];A.index=0;A.typing=0;A.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}});(function(){var B,D,A,C,E,F;B=tinymce.dom.Event;D=tinymce.isIE;A=tinymce.isGecko;C=tinymce.isOpera;E=tinymce.each;F=tinymce.extend;tinymce.create("tinymce.ForceBlocks",{ForceBlocks:function(H){var I=this,J=H.settings,K;I.editor=H;I.dom=H.dom;K=(J.forced_root_block||"p").toLowerCase();J.element=K.toUpperCase();H.onPreInit.add(I.setup,I);I.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+K+">","gi");I.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR2=new RegExp("<p( )([^>]+)>(&nbsp;|&#160;)<\\/p>|<p>(&nbsp;|&#160;)<\\/p>".replace(/p/g,K),"gi");I.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");I.reTrailBr=new RegExp("\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");function G(L,M){if(C){M.content=M.content.replace(I.reOpera,"</"+K+">")}M.content=M.content.replace(I.rePadd,"<"+K+"$1$2$3$4$5$6>\u00a0</"+K+">");if(!D&&!C&&M.set){M.content=M.content.replace(I.reNbsp2BR1,"<"+K+"$1$2><br /></"+K+">");M.content=M.content.replace(I.reNbsp2BR2,"<"+K+"$1$2><br /></"+K+">")}else{M.content=M.content.replace(I.reBR2Nbsp,"<"+K+"$1$2>\u00a0</"+K+">");M.content=M.content.replace(I.reTrailBr,"</"+K+">")}}H.onBeforeSetContent.add(G);H.onPostProcess.add(G);if(J.forced_root_block){H.onInit.add(I.forceRoots,I);H.onSetContent.add(I.forceRoots,I);H.onBeforeGetContent.add(I.forceRoots,I)}},setup:function(){var H=this,G=H.editor,I=G.settings;if(I.forced_root_block){G.onKeyUp.add(H.forceRoots,H);G.onPreProcess.add(H.forceRoots,H)}if(I.force_br_newlines){if(D){G.onKeyPress.add(function(K,M){var N,L=K.selection;if(M.keyCode==13&&L.getNode().nodeName!="LI"){L.setContent('<br id="__" /> ',{format:"raw"});N=K.dom.get("__");N.removeAttribute("id");L.select(N);L.collapse();return B.cancel(M)}})}return }if(!D&&I.force_p_newlines){G.onKeyPress.add(function(K,L){if(L.keyCode==13&&!L.shiftKey){if(!H.insertPara(L)){B.cancel(L)}}});if(A){G.onKeyDown.add(function(K,L){if((L.keyCode==8||L.keyCode==46)&&!L.shiftKey){H.backspaceDelete(L,L.keyCode==8)}})}}function J(L,K){var M=G.dom.create(K);E(L.attributes,function(N){if(N.specified&&N.nodeValue){M.setAttribute(N.nodeName.toLowerCase(),N.nodeValue)}});E(L.childNodes,function(N){M.appendChild(N.cloneNode(true))});L.parentNode.replaceChild(M,L);return M}if(D&&I.element!="P"){G.onKeyPress.add(function(K,L){H.lastElm=K.selection.getNode().nodeName});G.onKeyUp.add(function(L,N){var P,M=L.selection,O=M.getNode(),K=L.getBody();if(K.childNodes.length===1&&O.nodeName=="P"){O=J(O,I.element);M.select(O);M.collapse();L.nodeChanged()}else{if(N.keyCode==13&&!N.shiftKey&&H.lastElm!="P"){P=L.dom.getParent(O,"P");if(P){J(P,I.element);L.nodeChanged()}}}})}},find:function(L,I,J){var H=this.editor,G=H.getDoc().createTreeWalker(L,4,null,false),K=-1;while(L=G.nextNode()){K++;if(I==0&&L==J){return K}if(I==1&&K==J){return L}}return -1},forceRoots:function(L,U){var M=this,L=M.editor,Y=L.getBody(),V=L.getDoc(),f=L.selection,N=f.getSel(),O=f.getRng(),Z=-2,K,S,G,H,W=-16777215;var X,I,a,R,P,J=Y.childNodes,Q;if(U&&U.keyCode==13){return true}for(Q=J.length-1;Q>=0;Q--){X=J[Q];if(X.nodeType==3||(!M.dom.isBlock(X)&&X.nodeType!=8)){if(!I){if(X.nodeType!=3||/[^\s]/g.test(X.nodeValue)){if(Z==-2&&O){if(!D){S=O.startOffset;G=O.endOffset;Z=M.find(Y,0,O.startContainer);K=M.find(Y,0,O.endContainer)}else{H=V.body.createTextRange();H.moveToElementText(Y);H.collapse(1);a=H.move("character",W)*-1;H=O.duplicate();H.collapse(1);R=H.move("character",W)*-1;H=O.duplicate();H.collapse(0);P=(H.move("character",W)*-1)-R;Z=R-a;K=P}}I=L.dom.create(L.settings.forced_root_block);I.appendChild(X.cloneNode(1));X.parentNode.replaceChild(I,X)}}else{if(I.hasChildNodes()){I.insertBefore(X,I.firstChild)}else{I.appendChild(X)}}}else{I=null}}if(Z!=-2){if(!D){I=V.getElementsByTagName(L.settings.element)[0];O=V.createRange();if(Z!=-1){O.setStart(M.find(Y,1,Z),S)}else{O.setStart(I,0)}if(K!=-1){O.setEnd(M.find(Y,1,K),G)}else{O.setEnd(I,0)}if(N){N.removeAllRanges();N.addRange(O)}}else{try{O=N.createRange();O.moveToElementText(Y);O.collapse(1);O.moveStart("character",Z);O.moveEnd("character",K);O.select()}catch(T){}}}},getParentBlock:function(H){var G=this.dom;return G.getParent(H,G.isBlock)},insertPara:function(h){var R=this,L=R.editor,a=L.dom,i=L.getDoc(),l=L.settings,T=L.selection.getSel(),U=T.getRangeAt(0),k=i.body;var X,Y,V,f,c,J,H,K,N,G,P,j,I,M,W,Z=a.getViewPort(L.getWin()),O,Q;function S(b){b=b.innerHTML;b=b.replace(/<(img|hr|table)/gi,"-");b=b.replace(/<[^>]+>/g,"");return b.replace(/[ \t\r\n]+/g,"")==""}X=i.createRange();X.setStart(T.anchorNode,T.anchorOffset);X.collapse(true);Y=i.createRange();Y.setStart(T.focusNode,T.focusOffset);Y.collapse(true);V=X.compareBoundaryPoints(X.START_TO_END,Y)<0;f=V?T.anchorNode:T.focusNode;c=V?T.anchorOffset:T.focusOffset;J=V?T.focusNode:T.anchorNode;H=V?T.focusOffset:T.anchorOffset;if(f===J&&/^(TD|TH)$/.test(f.nodeName)){a.remove(f.firstChild);L.dom.add(f,l.element,null,"<br />");j=L.dom.add(f,l.element,null,"<br />");U=i.createRange();U.selectNodeContents(j);U.collapse(1);L.selection.setRng(U);return false}if(f==k&&J==k&&k.firstChild&&L.dom.isBlock(k.firstChild)){f=J=f.firstChild;c=H=0;X=i.createRange();X.setStart(f,0);Y=i.createRange();Y.setStart(J,0)}f=f.nodeName=="HTML"?i.body:f;f=f.nodeName=="BODY"?f.firstChild:f;J=J.nodeName=="HTML"?i.body:J;J=J.nodeName=="BODY"?J.firstChild:J;K=R.getParentBlock(f);N=R.getParentBlock(J);G=K?K.nodeName:l.element;if(R.dom.getParent(K,function(b){return/OL|UL|PRE/.test(b.nodeName)})){return true}if(K&&(K.nodeName=="CAPTION"||/absolute|relative|static/gi.test(K.style.position))){G=l.element;K=null}if(N&&(N.nodeName=="CAPTION"||/absolute|relative|static/gi.test(N.style.position))){G=l.element;N=null}if(/(TD|TABLE|TH|CAPTION)/.test(G)||(K&&G=="DIV"&&/left|right/gi.test(K.style.cssFloat))){G=l.element;K=N=null}P=(K&&K.nodeName==G)?K.cloneNode(0):L.dom.create(G);j=(N&&N.nodeName==G)?N.cloneNode(0):L.dom.create(G);j.removeAttribute("id");if(/^(H[1-6])$/.test(G)&&f.nodeValue&&c==f.nodeValue.length){j=L.dom.create(l.element)}W=I=f;do{if(W==k||W.nodeType==9||R.dom.isBlock(W)||/(TD|TABLE|TH|CAPTION)/.test(W.nodeName)){break}I=W}while((W=W.previousSibling?W.previousSibling:W.parentNode));W=M=J;do{if(W==k||W.nodeType==9||R.dom.isBlock(W)||/(TD|TABLE|TH|CAPTION)/.test(W.nodeName)){break}M=W}while((W=W.nextSibling?W.nextSibling:W.parentNode));if(I.nodeName==G){X.setStart(I,0)}else{X.setStartBefore(I)}X.setEnd(f,c);P.appendChild(X.cloneContents()||i.createTextNode(""));try{Y.setEndAfter(M)}catch(g){}Y.setStart(J,H);j.appendChild(Y.cloneContents()||i.createTextNode(""));U=i.createRange();if(!I.previousSibling&&I.parentNode.nodeName==G){U.setStartBefore(I.parentNode)}else{if(X.startContainer.nodeName==G&&X.startOffset==0){U.setStartBefore(X.startContainer)}else{U.setStart(X.startContainer,X.startOffset)}}if(!M.nextSibling&&M.parentNode.nodeName==G){U.setEndAfter(M.parentNode)}else{U.setEnd(Y.endContainer,Y.endOffset)}U.deleteContents();if(C){L.getWin().scrollTo(0,Z.y)}if(P.firstChild&&P.firstChild.nodeName==G){P.innerHTML=P.firstChild.innerHTML}if(j.firstChild&&j.firstChild.nodeName==G){j.innerHTML=j.firstChild.innerHTML}if(S(P)){P.innerHTML="<br />"}if(S(j)){j.innerHTML=C?"&nbsp;":"<br />"}if(C){U.insertNode(P);U.insertNode(j)}else{U.insertNode(j);U.insertNode(P)}j.normalize();P.normalize();U=i.createRange();U.selectNodeContents(j);U.collapse(1);T.removeAllRanges();T.addRange(U);O=L.dom.getPos(j).y;Q=j.clientHeight;if(O<Z.y||O+Q>Z.y+Z.h){L.getWin().scrollTo(0,O<Z.y?O:O-Z.h+Q)}return false},backspaceDelete:function(J,P){var R=this,I=R.editor,M=I.getBody(),H,K=I.selection,G=K.getRng(),L=G.startContainer,H,N,O;if(L&&I.dom.isBlock(L)&&!/^(TD|TH)$/.test(L.nodeName)&&P){if(L.childNodes.length==0||(L.childNodes.length==1&&L.firstChild.nodeName=="BR")){H=L;while((H=H.previousSibling)&&!I.dom.isBlock(H)){}if(H){if(L!=M.firstChild){N=I.dom.doc.createTreeWalker(H,NodeFilter.SHOW_TEXT,null,false);while(O=N.nextNode()){H=O}G=I.getDoc().createRange();G.setStart(H,H.nodeValue?H.nodeValue.length:0);G.setEnd(H,H.nodeValue?H.nodeValue.length:0);K.setRng(G);I.dom.remove(L)}return B.cancel(J)}}}function Q(S){S=S.target;if(S&&S.parentNode&&S.nodeName=="BR"&&(H=R.getParentBlock(S))){B.remove(M,"DOMNodeInserted",Q);if(S.previousSibling||S.nextSibling){I.dom.remove(S)}}}B._add(M,"DOMNodeInserted",Q);window.setTimeout(function(){B._remove(M,"DOMNodeInserted",Q)},1)}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each,D=tinymce.extend;tinymce.create("tinymce.ControlManager",{ControlManager:function(E,H){var G=this,F;H=H||{};G.editor=E;G.controls={};G.onAdd=new tinymce.util.Dispatcher(G);G.onPostRender=new tinymce.util.Dispatcher(G);G.prefix=H.prefix||E.id+"_";G._cls={};G.onPostRender.add(function(){C(G.controls,function(I){I.postRender()})})},get:function(E){return this.controls[this.prefix+E]||this.controls[E]},setActive:function(G,E){var F=null;if(F=this.get(G)){F.setActive(E)}return F},setDisabled:function(G,E){var F=null;if(F=this.get(G)){F.setDisabled(E)}return F},add:function(F){var E=this;if(F){E.controls[F.id]=F;E.onAdd.dispatch(F,E)}return F},createControl:function(H){var G,F=this,E=F.editor;C(E.plugins,function(I){if(I.createControl){G=I.createControl(H,F);if(G){return false}}});switch(H){case"|":case"separator":return F.createSeparator()}if(!G&&E.buttons&&(G=E.buttons[H])){return F.createButton(H,G)}return F.add(G)},createDropMenu:function(E,M,G){var L=this,H=L.editor,I,F,J,K;M=D({"class":"mceDropDown",constrain:H.settings.constrain_menus},M);M["class"]=M["class"]+" "+H.getParam("skin")+"Skin";if(J=H.getParam("skin_variant")){M["class"]+=" "+H.getParam("skin")+"Skin"+J.substring(0,1).toUpperCase()+J.substring(1)}E=L.prefix+E;K=G||L._cls.dropmenu||tinymce.ui.DropMenu;I=L.controls[E]=new K(E,M);I.onAddItem.add(function(P,O){var N=O.settings;N.title=H.getLang(N.title,N.title);if(!N.onclick){N.onclick=function(Q){H.execCommand(N.cmd,N.ui||false,N.value)}}});H.onRemove.add(function(){I.destroy()});if(tinymce.isIE){I.onShowMenu.add(function(){var N=H.selection,O=N.getNode();if(O.nodeName=="IMG"){F=N.getBookmark()}else{F=0}});I.onHideMenu.add(function(){if(F){H.selection.moveToBookmark(F)}})}return L.add(I)},createListBox:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;if(F.settings.use_native_selects){J=new tinymce.ui.NativeListBox(L,H)}else{E=K||G._cls.listbox||tinymce.ui.ListBox;J=new E(L,H)}G.controls[L]=J;if(tinymce.isWebKit){J.onPostRender.add(function(N,M){A.add(M,"mousedown",function(){F.bookmark=F.selection.getBookmark("simple")});A.add(M,"focus",function(){F.selection.moveToBookmark(F.bookmark);F.bookmark=null})})}if(J.hideMenu){F.onMouseDown.add(J.hideMenu,J)}return G.add(J)},createButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.label=F.translate(H.label);H.scope=H.scope||F;if(!H.onclick&&!H.menu_button){H.onclick=function(){F.execCommand(H.cmd,H.ui||false,H.value)}}H=D({title:H.title,"class":"mce_"+L,unavailable_prefix:F.getLang("unavailable",""),scope:H.scope,control_manager:G},H);L=G.prefix+L;if(H.menu_button){E=K||G._cls.menubutton||tinymce.ui.MenuButton;J=new E(L,H);F.onMouseDown.add(J.hideMenu,J)}else{E=G._cls.button||tinymce.ui.Button;J=new E(L,H)}return G.add(J)},createMenuButton:function(F,E){E=E||{};E.menu_button=1;return this.createButton(F,E)},createSplitButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onclick){H.onclick=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;E=K||G._cls.splitbutton||tinymce.ui.SplitButton;J=G.add(new E(L,H));F.onMouseDown.add(J.hideMenu,J);return J},createColorSplitButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onclick){H.onclick=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,menu_class:F.getParam("skin")+"Skin",scope:H.scope,more_colors_title:F.getLang("more_colors")},H);L=G.prefix+L;E=K||G._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;J=new E(L,H);F.onMouseDown.add(J.hideMenu,J);F.onRemove.add(function(){J.destroy()});return G.add(J)},createToolbar:function(J,G,I){var H,F=this,E;J=F.prefix+J;E=I||F._cls.toolbar||tinymce.ui.Toolbar;H=new E(J,G);if(F.get(J)){return null}return F.add(H)},createSeparator:function(F){var E=F||this._cls.separator||tinymce.ui.Separator;return new E()},setControlType:function(F,E){return this._cls[F.toLowerCase()]=E},destroy:function(){C(this.controls,function(E){E.destroy()});this.controls=null}})})();(function(){var A=tinymce.util.Dispatcher,D=tinymce.each,C=tinymce.isIE,B=tinymce.isOpera;tinymce.create("tinymce.WindowManager",{WindowManager:function(E){var F=this;F.editor=E;F.onOpen=new A(F);F.onClose=new A(F);F.params={};F.features={}},open:function(Q,F){var P=this,I="",L,K,G=P.editor.settings.dialog_type=="modal",N,M,H,E=tinymce.DOM.getViewPort(),O;Q=Q||{};F=F||{};M=B?E.w:screen.width;H=B?E.h:screen.height;Q.name=Q.name||"mc_"+new Date().getTime();Q.width=parseInt(Q.width||320);Q.height=parseInt(Q.height||240);Q.resizable=true;Q.left=Q.left||parseInt(M/2)-(Q.width/2);Q.top=Q.top||parseInt(H/2)-(Q.height/2);F.inline=false;F.mce_width=Q.width;F.mce_height=Q.height;F.mce_auto_focus=Q.auto_focus;if(G){if(C){Q.center=true;Q.help=false;Q.dialogWidth=Q.width+"px";Q.dialogHeight=Q.height+"px";Q.scroll=Q.scrollbars||false}else{Q.modal=Q.alwaysRaised=Q.dialog=Q.centerscreen=Q.dependent=true}}D(Q,function(S,R){if(tinymce.is(S,"boolean")){S=S?"yes":"no"}if(!/^(name|url)$/.test(R)){if(C&&G){I+=(I?";":"")+R+":"+S}else{I+=(I?",":"")+R+"="+S}}});P.features=Q;P.params=F;P.onOpen.dispatch(P,Q,F);O=Q.url||Q.file;if(tinymce.relaxedDomain){O+=(O.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}O=tinymce._addVer(O);try{if(C&&G){N=1;window.showModalDialog(O,window,I)}else{N=window.open(O,Q.name,I)}}catch(J){}if(!N){alert(P.editor.getLang("popup_blocked"))}},close:function(E){E.close();this.onClose.dispatch(this)},createInstance:function(G,F,E,K,J,I){var H=tinymce.resolve(G);return new H(F,E,K,J,I)},confirm:function(F,E,G){E.call(G||this,confirm(this._decode(this.editor.getLang(F,F))))},alert:function(F,E,H){var G=this;alert(G._decode(G.editor.getLang(F,F)));if(E){E.call(H||G)}},_decode:function(E){return tinymce.DOM.decode(E).replace(/\\n/g,"\n")}})}());

tinyMCE.addI18n({en:{common:{edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",apply:"Apply",insert:"Insert",update:"Update",cancel:"Cancel",close:"Close",browse:"Browse",class_name:"Class",not_set:"-- Not set --",clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",invalid_data:"Error: Invalid values entered, these are marked in red.",more_colors:"More colors"},contextmenu:{align:"Alignment",left:"Left",center:"Center",right:"Right",full:"Full"},insertdatetime:{date_fmt:"%Y-%m-%d",time_fmt:"%H:%M:%S",insertdate_desc:"Insert date",inserttime_desc:"Insert time",months_long:"January,February,March,April,May,June,July,August,September,October,November,December",months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"},print:{print_desc:"Print"},preview:{preview_desc:"Preview"},directionality:{ltr_desc:"Direction left to right",rtl_desc:"Direction right to left"},layer:{insertlayer_desc:"Insert new layer",forward_desc:"Move forward",backward_desc:"Move backward",absolute_desc:"Toggle absolute positioning",content:"New layer..."},save:{save_desc:"Save",cancel_desc:"Cancel all changes"},nonbreaking:{nonbreaking_desc:"Insert non-breaking space character"},iespell:{iespell_desc:"Run spell checking",download:"ieSpell not detected. Do you want to install it now?"},advhr:{advhr_desc:"Horizontale rule"},emotions:{emotions_desc:"Emotions"},searchreplace:{search_desc:"Find",replace_desc:"Find/Replace"},advimage:{image_desc:"Insert/edit image"},advlink:{link_desc:"Insert/edit link"},xhtmlxtras:{cite_desc:"Citation",abbr_desc:"Abbreviation",acronym_desc:"Acronym",del_desc:"Deletion",ins_desc:"Insertion",attribs_desc:"Insert/Edit Attributes"},style:{desc:"Edit CSS Style"},paste:{paste_text_desc:"Paste as Plain Text",paste_word_desc:"Paste from Word",selectall_desc:"Select All"},paste_dlg:{text_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",word_title:"Use CTRL+V on your keyboard to paste the text into the window."},table:{desc:"Insert Table",row_before_desc:"Insert row before",row_after_desc:"Insert row after",delete_row_desc:"Delete row",col_before_desc:"Insert column before",col_after_desc:"Insert column after",delete_col_desc:"Remove column",split_cells_desc:"Split merged table cells",merge_cells_desc:"Merge table cells",row_desc:"Table row properties",cell_desc:"Table cell properties",props_desc:"Table properties",paste_row_before_desc:"Paste table row before",paste_row_after_desc:"Paste table row after",cut_row_desc:"Cut table row",copy_row_desc:"Copy table row",del:"Delete table",row:"Row",col:"Column",cell:"Cell",row_up:"Move Row Up",row_down:"Move Row Down",col_left:"Move Column Left",col_right:"Move Column Right"},autosave:{unload_msg:"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle fullscreen mode"},media:{desc:"Insert / edit embedded media",edit:"Edit embedded media"},fullpage:{desc:"Document properties"},template:{desc:"Insert predefined template content"},visualchars:{desc:"Visual control characters on/off."},spellchecker:{desc:"Toggle spellchecker",menu:"Spellchecker settings",ignore_word:"Ignore word",ignore_words:"Ignore all",langs:"Languages",wait:"Please wait...",sug:"Suggestions",no_sug:"No suggestions",no_mpell:"No misspellings found."},pagebreak:{desc:"Insert page break."}}});

(function(){tinymce.create("tinymce.plugins.JiveListsPlugin",{fixLists:function(C){var G=C.selection.getNode();G=C.dom.getParent(G,"li");if(G!=null&&G.nodeType==1&&G.nodeName.toLowerCase()=="li"){var B=C.dom.getParent(G,"ol,ul");if(tinymce.isGecko){for(var D=0;D<B.childNodes.length;D++){var A=B.childNodes[D];if(A.nodeType==1&&A.nodeName.toLowerCase()=="li"&&A.childNodes.length==0){A.appendChild(C.plugins.jivemacros.createMozBR(C.getDoc()))}}}if(B.parentNode.nodeName.toLowerCase()=="p"){var E=B.parentNode;E.parentNode.insertBefore(B,E);E.parentNode.removeChild(E);C.selection.select(G).collapse(true)}var F=B.previousSibling;if(F!=null&&B.nodeName==F.nodeName){var D=0;while(F.childNodes.length){B.insertBefore(F.childNodes[0],B.childNodes[D]);D++}}var F=B.nextSibling;if(F!=null&&B.nodeName==F.nodeName){while(F.childNodes.length){B.appendChild(F.childNodes[0])}}}},execCommand:function(D,I,C){var E=tinyMCE.activeEditor;if(D.indexOf("mceOLListStyle")==0){var F=parseInt(D.substr("mceOLListStyle".length));var G=E.plugins.jivelists.ol_styles;var A=G[F];var B=tinyMCE.activeEditor.selection.getNode();var H=E.dom.getParent(B,"ol");H.style.listStyleType=A[1];return true}if(D.indexOf("mceULListStyle")==0){var F=parseInt(D.substr("mceOLListStyle".length));var G=E.plugins.jivelists.ul_styles;var A=G[F];var B=tinyMCE.activeEditor.selection.getNode();var H=E.dom.getParent(B,"ul");H.style.listStyleType=A[1];return true}function J(L){var N=L.selection.getNode();N=L.dom.getParent(N,"ol,ul");var K=L.dom.getParent(N,"blockquote");if(K!=null){var M=L.getDoc().createElement(N.nodeName);K.parentNode.insertBefore(M,K);while(K.childNodes.length){M.appendChild(K.childNodes[0])}K.parentNode.removeChild(K);L.selection.select(N)}}if(D.indexOf("mceOutdent")==0){E.execCommand("Outdent");this.fixLists(E);return true}if(D.indexOf("mceIndent")==0){E.execCommand("Indent");this.fixLists(E);J(E);return true}if(D.indexOf("mceInsertUnorderedList")==0){E.execCommand("InsertUnorderedList");this.fixLists(E);return true}if(D.indexOf("mceInsertOrderedList")==0){E.execCommand("InsertOrderedList");this.fixLists(E);return true}return false},cleanList:function(B,D){if(D.nodeType!=1){return }for(var C=0;C<D.childNodes.length;C++){var A=D.childNodes[C];if(A.nodeType!=1&&A.nodeType!=3||A.nodeType==1&&(A.nodeName.toLowerCase()=="meta"||A.nodeName.toLowerCase()=="style")){D.removeChild(A);C--}this.cleanList(B,A)}},init:function(A,B){this.url=B;var C=this;this.index=0;this.ol_styles=new Array();this.ol_styles.push(["default",""]);this.ol_styles.push(["none","none"]);this.ol_styles.push(["inherit","inherit"]);this.ol_styles.push(["d","decimal"]);this.ol_styles.push(["dz","decimal-leading-zero"]);this.ol_styles.push(["ur","upper-roman"]);this.ol_styles.push(["lr","lower-roman"]);this.ol_styles.push(["ua","upper-alpha"]);this.ol_styles.push(["la","lower-alpha"]);this.ol_styles.push(["lg","lower-greek"]);this.ol_styles.push(["ki","katakana-iroha"]);this.ol_styles.push(["k","katakana"]);this.ol_styles.push(["hii","hiragana-iroha"]);this.ol_styles.push(["hi","hiragana"]);this.ol_styles.push(["ci","cjk-ideographic"]);this.ol_styles.push(["g","georgian"]);this.ol_styles.push(["a","armenian"]);this.ol_styles.push(["he","hebrew"]);this.ul_styles=new Array();this.ul_styles.push(["default",""]);this.ul_styles.push(["none","none"]);this.ul_styles.push(["inherit","inherit"]);this.ul_styles.push(["s","square"]);this.ul_styles.push(["c","circle"]);this.ul_styles.push(["di","disc"]);A.onNodeChange.add(function(D){this.fixLists(D);var E=D.selection.getNode();var F=D.dom.getParent(E,"ul,ol");if(F){this.cleanList(D,F)}},this);A.onInit.add(function(){if(A&&A.plugins.contextmenu){A.plugins.contextmenu.onContextMenu.add(function(D,G,J){var F,K=A.selection,E=K.getNode()||A.getBody();if(A.dom.getParent(J,"ol")){var M=A.dom.getParent(J,"ol");var N=A.dom.getParent(J,function(O){return $def(O.tagName)&&O.tagName.toLowerCase()=="ol"&&O!=M});G.addSeparator();F=G.addMenu({title:"jivelists.list_style",max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu"});var I=A.plugins.jivelists.ol_styles;for(var H=0;H<I.length;H++){if(N!=null||N==null&&I[H][0]!="inherit"){var L="";if(M.style.listStyleType==I[H][1]){L="mceMenuItemSelected"}else{L=""}F.add({title:"jivelists."+I[H][0],cmd:"mceOLListStyle"+H,"class":L})}if(H==2){F.addSeparator()}}}else{if(A.dom.getParent(J,"ul")){var M=A.dom.getParent(J,"ul");var N=A.dom.getParent(J,function(O){return $def(O.tagName)&&O.tagName.toLowerCase()=="ul"&&O!=M});G.addSeparator();F=G.addMenu({title:"jivelists.list_style",max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu"});var I=A.plugins.jivelists.ul_styles;for(var H=0;H<I.length;H++){if(N!=null||N==null&&I[H][0]!="inherit"){var L="";if(M.style.listStyleType==I[H][1]){L="mceMenuItemSelected"}else{L=""}F.add({title:"jivelists."+I[H][0],cmd:"mceULListStyle"+H,"class":L})}if(H==2){F.addSeparator()}}}}})}});this.prepForEnter=false;this.prepForDel=false;A.onKeyDown.addToTop(function(I,J){this.prepForEnter=false;this.prepForDel=false;if(J.keyCode==8&&I.selection.isCollapsed()){var O=I.dom.getParent(I.selection.getNode(),"li");var K=I.dom.getParent(I.selection.getNode(),"ul,ol");var F=I.selection;var Q=F.getBookmark().start==0||F.getRng().startOffset==0;if(O!=null&&O.nodeType==1&&O.previousSibling==null&&tinymce.isGecko){var P=O.childNodes.length?O.childNodes[0]:null;var N=F.getBookmark();if(Q){this.prepForDel=true;tinymce.dom.Event.cancel(J);while(O.childNodes.length){var H=O.childNodes[0];if(H.nodeType==1&&H.nodeName.toLowerCase()=="br"){var E=I.getDoc().createElement("P");E.appendChild(H);H=E}K.parentNode.insertBefore(H,K)}K.removeChild(O);if(P){I.selection.moveToBookmark(N)}}}else{if(O!=null&&O.nodeType==1&&Q){this.prepForDel=true;tinymce.dom.Event.cancel(J);I.execCommand("mceOutdent");return false}}}else{if(J.keyCode==13&&!J.shiftKey){var O=I.dom.getParent(I.selection.getNode(),"li");var K=I.dom.getParent(I.selection.getNode(),"ul,ol");if(O!=null&&O.nodeType==1&&O.nextSibling==null&&O.childNodes.length==1&&$def(O.childNodes[0].nodeName.toLowerCase())&&O.childNodes[0].nodeName.toLowerCase()=="br"){this.prepForEnter=true;tinymce.dom.Event.cancel(J);var M=K.parentNode;if(M.nodeName.toLowerCase()=="ol"||M.nodeName.toLowerCase()=="ul"){I.execCommand("mceOutdent")}else{var E=I.plugins.jivemacros.createEmptyPara(I.getDoc());if(M.childNodes[M.childNodes.length-1]==K){M.appendChild(E)}else{M.insertBefore(E,K.nextSibling)}K.removeChild(O);if(K.childNodes.length==0){K.parentNode.removeChild(K)}I.selection.select(E.childNodes[0]);I.selection.collapse(true)}}}else{if(J.keyCode==13&&J.shiftKey){window.breakNow=true;var O=I.dom.getParent(I.selection.getNode(),"li");var K=I.dom.getParent(I.selection.getNode(),"ul,ol");var F=I.selection;var L=I.plugins.jivemacros.isMacro(F.getNode())||I.plugins.jivemacros.isLink(F.getNode());var G=F.getNode();var D=F.getRng().startOffset==(F.getNode().childNodes[F.getNode().childNodes.length-1].nodeValue.length)&&G.childNodes.length>0&&G.childNodes[G.childNodes.length-1].nodeType==3&&F.getRng().startContainer==G.childNodes[G.childNodes.length-1];if(O!=null&&D){this.prepForEnter=true;tinymce.dom.Event.cancel(J);var E=I.getDoc().createElement("BR");O.appendChild(E);I.selection.select(E);I.selection.collapse()}}}}if(J.keyCode==9&&!J.ctrlKey&&!J.altKey){var E=I.dom.getParent(I.selection.getNode(),"ul,ol");if(E!=null){tinymce.dom.Event.cancel(J);return false}}},this);A.onKeyPress.add(function(D,F){if(F.keyCode==8&&this.prepForDel){tinymce.dom.Event.cancel(F);return false}if(F.keyCode==13&&this.prepForEnter){tinymce.dom.Event.cancel(F)}if(F.keyCode==9&&!F.ctrlKey&&!F.altKey){var E=D.dom.getParent(D.selection.getNode(),"ul,ol");if(E!=null){tinymce.dom.Event.cancel(F);return false}}},this);A.onKeyUp.add(function(D,F){if(F.keyCode==8&&this.prepForDel){tinymce.dom.Event.cancel(F);return false}if(F.keyCode==13&&this.prepForEnter){tinymce.dom.Event.cancel(F)}if(F.keyCode==9&&!F.ctrlKey&&!F.altKey){var E=D.dom.getParent(D.selection.getNode(),"ul,ol");if(E!=null){if(F.shiftKey){D.execCommand("mceOutdent")}else{D.execCommand("mceIndent")}tinymce.dom.Event.cancel(F);return false}}},this)},getInfo:function(){return{longname:"Jive Lists",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},createControl:function(B,A){return null}});tinymce.PluginManager.add("jivelists",tinymce.plugins.JiveListsPlugin)})();

tinyMCE.addI18n("en.jivelists",{list_style:"List Style",inherit:"Inherit",none:"None","default":"Default",ur:"Upper Roman",lr:"Lower Roman",dz:"Decimal with Leading Zero",d:"Decimal",ua:"Upper Alpha",la:"Lower Alpha",lg:"Lower Greek",ki:"Katakana-Iroha",hii:"Hiragana-Iroha",k:"Katakana",hi:"Hiragana",ci:"Cjk-Ideographic",g:"Georgian",a:"Armenian",he:"Hebrew",s:"Squares",c:"Circles",di:"Discs"});

(function(){tinymce.create("tinymce.plugins.JiveStylePlugin",{getInfo:function(){return{longname:"Image Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},isBold:false,isItalic:false,isStrikethrough:false,isColor:false,init:function(B,C){B.onInit.add(function(E){var D=document.getElementById(E.id+"_jivestyle_action");if(D){var F=D.childNodes[0];while(F.childNodes.length>0){F.removeChild(F.childNodes[0])}F.appendChild(document.createTextNode(E.getLang("jivestyle.title")))}E.plugins.jivebuttons.initToolbar(E.id)});B.onNodeChange.add(function(D){return function(J,M,G){var E=J.dom.getParent(G,J.dom.isBlock);if(E){if(D.buttons.length>0){var F=J.selection;for(var I=0;I<D.buttons.length;I++){var L=window.document;var H=new tinymce.dom.DOMUtils(L);var K=$def(E.tagName)&&E.tagName.toLowerCase()==D.tagNames[I];var O=L.getElementById(D.buttons[I].id);var N=O.cells[0];if(K&&(F.isCollapsed()||F.getStart()==F.getEnd())){H.addClass(N,"mceMenuItemSelected")}else{H.removeClass(N,"mceMenuItemSelected")}}}}}}(this));function A(I){if(I.charAt(0)=="#"){I=I.substr(1,6)}I=I.replace(/ /g,"");I=I.toLowerCase();var H=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(M){return[parseInt(M[1]),parseInt(M[2]),parseInt(M[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(M){return[parseInt(M[1],16),parseInt(M[2],16),parseInt(M[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(M){return[parseInt(M[1]+M[1],16),parseInt(M[2]+M[2],16),parseInt(M[3]+M[3],16)]}}];for(var F=0;F<H.length;F++){var L=H[F].re;var E=H[F].process;var K=L.exec(I);if(K){channels=E(K);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true}}if(!this.ok){return""}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);var D=this.r.toString(16);var G=this.g.toString(16);var J=this.b.toString(16);if(D.length==1){D="0"+D}if(G.length==1){G="0"+G}if(J.length==1){J="0"+J}return"#"+D+G+J}B.onKeyDown.addToTop(function(E,D){if(D.keyCode==13){this.isBold=E.controlManager.get("bold").isActive();this.isItalic=E.controlManager.get("italic").isActive();this.isStrikethrough=E.controlManager.get("strikethrough").isActive()}},this);B.onKeyUp.add(function(E,D){if(D.keyCode==13&&!tinymce.isIE){if(this.isBold){E.execCommand("Bold",false)}if(this.isItalic){E.execCommand("Italic",false)}if(this.isStrikethrough){E.execCommand("Strikethrough",false)}}},this);this.buttons=new Array();this.tagNames=["p","h1","h2","h3","h4","h5","h6"]},execCommand:function(C,H,A){var I=null;var F=tinyMCE.activeEditor;var G=new tinymce.EditorCommands(F);if(C=="mceJiveStyle"){var J=tinyMCE.activeEditor.controlManager;var E=J.get("jivestyle");E.showMenu();return true}else{if(C=="mceJiveStyleHeader1"){I="h1"}else{if(C=="mceJiveStyleHeader2"){I="h2"}else{if(C=="mceJiveStyleHeader3"){I="h3"}else{if(C=="mceJiveStyleHeader4"){I="h4"}else{if(C=="mceJiveStyleHeader5"){I="h5"}else{if(C=="mceJiveStyleHeader6"){I="h6"}else{if(C=="mceJiveStyleParagraph"){I="p"}}}}}}}}if(I!=null){if(tinymce.isWebKit){var D=F.getDoc().createElement(I);var B=F.dom.getParent(F.selection.getNode(),"p,h1,h2,h3,h4,h5,h6");if(B){B.parentNode.insertBefore(D,B);while(B.childNodes.length){D.appendChild(B.childNodes[0])}}B.parentNode.removeChild(B);if(D.childNodes.length){D=D.childNodes[D.childNodes.length-1]}F.selection.select(D);F.selection.collapse()}else{tinyMCE.activeEditor.execCommand("removeformat");G.FormatBlock(false,I)}return true}return false},isTag:function(B){var C=tinyMCE.activeEditor;var E=C.selection;if(E.isCollapsed()){var F=E.getNode();var D=C.dom.getParent(F,B);var A=$def(D)&&D!=null&&$def(D.tagName)&&D.tagName.toLowerCase()==B;if(A){return"mceMenuItemSelected"}else{return""}}else{return""}},addButton:function(A){this.buttons.push(A)},createControl:function(C,A){switch(C){case"jivestyle":var B=A.createSplitButton("jivestyle",{title:"jivestyle.title",cmd:"mceJiveStyle"});B.onRenderMenu.add(function(F,D){var E=tinyMCE.activeEditor.plugins.jivestyle;E.addButton(D.add({theTag:"p",title:"Paragraph",cmd:"mceJiveStyleParagraph","class":"mce_formatPreview mce_p "+tinyMCE.activeEditor.plugins.jivestyle.isTag("p")}));E.addButton(D.add({theTag:"h1",title:"Header 1",cmd:"mceJiveStyleHeader1","class":"mce_formatPreview mce_h1 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h1")}));E.addButton(D.add({theTag:"h2",title:"Header 2",cmd:"mceJiveStyleHeader2","class":"mce_formatPreview mce_h2 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h2")}));E.addButton(D.add({theTag:"h3",title:"Header 3",cmd:"mceJiveStyleHeader3","class":"mce_formatPreview mce_h3 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h3")}));E.addButton(D.add({theTag:"h4",title:"Header 4",cmd:"mceJiveStyleHeader4","class":"mce_formatPreview mce_h4 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h4")}));E.addButton(D.add({theTag:"h5",title:"Header 5",cmd:"mceJiveStyleHeader5","class":"mce_formatPreview mce_h5 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h5")}));E.addButton(D.add({theTag:"h6",title:"Header 6",cmd:"mceJiveStyleHeader6","class":"mce_formatPreview mce_h6 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h6")}))});return B}return null}});tinymce.PluginManager.add("jivestyle",tinymce.plugins.JiveStylePlugin)})();

tinyMCE.addI18n("en.jivestyle",{title:"Style"});

(function(){tinymce.PluginManager.requireLangPack("jivemacros");tinymce.create("tinymce.plugins.JiveMacrosPlugin",{_cache:new jive.ext.y.HashTable(),cache:function(E,A,C,B){var D=this._cache.get(B);if(!D){D=new jive.ext.y.HashTable();this._cache.put(B,D)}D.put(E,[C,A])},getTitleFor:function(A,C){var B=this._cache.get(A);if(!B){return false}return B.get(C)},deleteMacro:function(G,C){if(window.jiveRTE.macroEle){C=window.jiveRTE.macroEle;window.jiveRTE.macroEle=null}console.log("deleting macro "+C.nodeName);if($def(G)&&$def(C)){if(C==G.getBody()){return }var E=new tinymce.dom.DOMUtils(G.getBody());var H=E.getParent(C,function(J){return J==G.getBody()||J!=C});if(this.isExactMacro(C)){var D=this.getMacroFor(C);if(D.getMacroType()=="TEXT"||D.getMacroType()=="INLINE"){while(C.childNodes.length>0){var F=C.removeChild(C.childNodes[0]);if(F.nodeType==3){var I=F.nodeValue;while(I.indexOf("\n")>=0){var A=G.getDoc().createElement("P");A.appendChild(G.getDoc().createTextNode(I.substr(0,I.indexOf("\n"))));H.insertBefore(A,C);if(I.length>I.indexOf("\n")+1){I=I.substr(I.indexOf("\n")+1)}else{I=""}}if(I.length>0){var A=G.getDoc().createElement("P");A.appendChild(G.getDoc().createTextNode(I));H.insertBefore(A,C)}}else{H.insertBefore(F,C)}}}H.removeChild(C)}else{this.deleteMacro(G,H)}return }var G=tinyMCE.activeEditor;var B=G.selection;this.deleteMacro(G,B.getNode())},getNextSibling:function(A,B){if(B==null){return B}if(B.nextSibling!=null){return B.nextSibling}if(B==A.getBody()&&B.nextSibling==null){return null}return this.getNextSibling(A,this.getParentNode(A,B))},getParentNode:function(A,B){return(new tinymce.dom.DOMUtils(A.getDoc())).getParent(B,function(C){return C==A.getBody()||C!=B})},insertIntoPre:function(B,A){B.appendChild(A)},appendTextToPre:function(C,A,B){while(A.childNodes.length>0){C.appendChild(A.childNodes[0])}},getLineage:function(B,A){var C;if(A==B.getBody()){C=new Array();C.push(A)}else{C=this.getLineage(B,this.getParentNode(B,A));C.push(A)}return C},ageTheNodes:function(D,A,C){if(D==C.body){return false}if(A==C.body){return false}if(D.parentNode==A.parentNode){return[D,A]}var B;B=this.ageTheNodes(D.parentNode,A,C);if(B){return B}B=this.ageTheNodes(D,A.parentNode,C);if(B){return B}return false},getOldestNode:function(E,I,H){var B=this.getLineage(E,I);var A=this.getLineage(E,H);if(B.length<A.length){var G=A;A=B;B=G;G=H;H=I;I=G}for(var D=1;D<A.length;D++){if(A[D]!=B[D]){var F=A[D-1];for(var C=0;C<F.childNodes.length;C++){if(F.childNodes[C]==B[D]){return H}else{if(F.childNodes[C]==A[D]){return I}}}}}return I},appendTextToPreUntilHelper:function(B,G,A,E){var C=false;if(A==null){return true}if(A==E){C=true}var F=B.getDoc();if(A.nodeType==3){this.insertIntoPre(G,A);return false}while(A.childNodes.length>0){var D=A.childNodes[0];if(this.appendTextToPreUntilHelper(B,G,D,E)){if(D.nodeType!=3){A.removeChild(D)}return true}if(D.nodeType!=3){A.removeChild(D)}}if(this.shouldEndLine(A)){this.insertIntoPre(G,F.createTextNode("\n"))}if(C){return C}if(A.nextSibling!=null){if(this.appendTextToPreUntilHelper(B,G,A.nextSibling,E)){return true}}return false},appendTextToPreUntil:function(C,G,A,F){var H=C.dom.getParent(A,C.dom.isBlock);var B=C.dom.getParent(F,C.dom.isBlock);if(H==B){G.appendChild(H);return }if(H.parentNode!=B.parentNode){var D=this.ageTheNodes(H,B);H=D[0];B=D[1]}var E=null;while(H&&(E=H.nextSibling)&&H!=F){G.appendChild(H);H=E}G.appendChild(F);return },getNodesBetweenHelper:function(C,B,H,A,G){var D=false;if(D){return D}if(A==null){return D}if(A==G){D=true}if(A.nodeType==1&&A.nodeName.toLowerCase()==H){B.push(A)}else{if(A.nodeType==1){for(var E=0;E<A.childNodes.length;E++){var F=A.childNodes[E];D=this.getNodesBetweenHelper(C,B,H,F,G)||D}if(D){return D}if(A.nextSibling!=null){D=D||this.getNodesBetweenHelper(C,B,H,A.nextSibling,G)}}}return D},getNodesBetween:function(C,F,A,E){var B=this.ageTheNodes(A,E,C.getDoc());var D=new Array();this.getNodesBetweenHelper(C,D,F,B[0],B[1]);return D},shouldEndLine:function(A){if(A.nodeType!=3&&(A.tagName.toLowerCase()=="div"||A.tagName.toLowerCase()=="p"||A.tagName.toLowerCase()=="pre"||A.tagName.toLowerCase()=="br")){return true}return false},applyParameterSet:function(C,B,D){if(this.isMacro(C)){if(D.deleteAll){var E=B.getAllowedParameters();for(var A=0;A<E.length;A++){C.removeAttribute("_"+E[A].name)}}for(var A=0;A<D.params.length;A++){C.setAttribute("_"+D.params[A].name,D.params[A].value)}}},buildMacro:function(E,J){if(!$def(J)){J=0}var K=tinyMCE.activeEditor;var D=K.selection;var M=K.getDoc();var C=E.getName();var F;var H=D.isCollapsed();if(E.getMacroType()=="TEXT"){F=M.createElement("pre");F.setAttribute("class","jive_text_macro jive_macro_"+C);F.className="jive_text_macro jive_macro_"+C}else{if(E.getMacroType()=="INLINE"){F=M.createElement("span");F.appendChild(M.createTextNode(C));F.setAttribute("class","jive_macro jive_macro_"+C);F.className="jive_macro jive_macro_"+C}else{F=M.createElement("img");F.setAttribute("class","jive_macro jive_macro_"+C);F.className="jive_macro jive_macro_"+C;var A=window.parent.CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/jiveemoticons/images/spacer.gif";F.setAttribute("src",A);F.setAttribute("mce_src",A)}}F.setAttribute("jivemacro",C);var L;var I=null;if(!D.isCollapsed()&&E.getMacroType()!="TEXT"){H=true}else{if(!D.isCollapsed()&&E.getMacroType()=="TEXT"){H=false;var N=D.getStart();var G=D.getEnd();if(N==G){I=N;L=this.getParentNode(K,I);L.insertBefore(F,I);if(E.getMacroType()=="TEXT"){this.appendTextToPre(F,I,M)}L.removeChild(I)}else{I=this.getOldestNode(K,D.getNode(),N);var B=this.ageTheNodes(I,G,K.getDoc());I=B[0];G=B[1];L=this.getParentNode(K,I);L.insertBefore(F,I);if(E.getMacroType()=="TEXT"){this.appendTextToPreUntil(K,F,I,G)}}if(E.getMacroType()=="TEXT"){D.select(F.childNodes[0])}else{D.select(F)}D.collapse()}else{H=true;L=this.getParentNode(K,D.getNode());I=D.getNode();if(L==I){I=null}}}if(E.getMacroType()=="TEXT"&&F.childNodes.length==0){F.appendChild(this.createEmptyPara(K.getDoc()))}if(J>=0){var O=E.getParameterSets();if(J<O.length){var J=O[J];this.applyParameterSet(F,E,J)}}return F},insertMacro:function(A,B){return this.buildMacro(A,B)},execCommand:function(N,J,R){var C=tinyMCE.activeEditor;if(N.indexOf("mceMacroParamSet")==0){var D=N.substr("mceMacroParamSet".length);var P=parseInt(D.substr(0,D.indexOf("_")));var F=parseInt(D.substr(D.indexOf("_")+1));var A=jive.rte.macros[P].getParameterSets()[F];var L=C.selection.getNode();var G=C.dom.getParent(L,function(S){return $def(S.attributes.jivemacro)});if(G!=null){this.applyParameterSet(G,jive.rte.macros[P],A);C.selection.collapse()}return true}if(N.indexOf("mceAddJiveMacro")==0){var E=N.substr("mceAddJiveMacro".length);var A=0;var O=E.indexOf("_");if(O>=0){A=parseInt(E.substr(O+1));E=parseInt(E.substr(0,O))}else{E=parseInt(E)}var M=C.selection;var Q=C.getDoc();var P=jive.rte.macros[E];if(P.getUrl().length>0){window.jiveRTE=null;var H=C.windowManager.open({url:CS_BASE_URL+P.getUrl(),width:500,height:400,inline:1},{macro:P})}else{var B=C.selection.isCollapsed();var K=C.plugins.jivemacros.insertMacro(P,A);if(B){C.selection.setNode(K)}var I=C.selection.getNode();C.plugins.jivemacros.removeDuplicateMacros(C,C.getBody());this.fixBodyParagraphs()}return true}return false},isFirst:function(A,B){if(A.childNodes.length==0){return false}return(A.childNodes[0]==B||this.isFirst(A.childNodes[0],B))},isLink:function(A){if(A==null||A.nodeName.toLowerCase()=="body"){return false}if($def(A)&&$obj(A)&&A!=null&&$def(A.nodeType)&&A.nodeType!=3){if(A.nodeName.toLowerCase()=="a"){return A}else{return this.isLink(A.parentNode)}}return false},isMacro:function(A){if(A==null||A.nodeName.toLowerCase()=="body"){return false}if(A!=null&&$obj(A)&&$def(A.nodeType)&&A.nodeType==1){if($def(A.attributes.jivemacro)){return A}else{return this.isMacro(A.parentNode)}}return false},isExactMacro:function(A){if(A==null||A.nodeName.toLowerCase()=="body"){return false}if(A!=null&&$obj(A)&&$def(A.nodeType)&&A.nodeType==1){if($def(A.attributes.jivemacro)){return A}else{return false}}return false},getMacroFor:function(C){var D=this.isMacro(C);if(D){var A=D.attributes.jivemacro.nodeValue;for(var B=0;B<jive.rte.macros.length;B++){if(jive.rte.macros[B].getName()==A){return jive.rte.macros[B]}}}return null},createMozBR:function(C){var B=C.createElement("BR");var A;if($def(B.setAttribute)){B.setAttribute("_moz_dirty","");B.setAttribute("type","_moz")}else{A=C.createAttribute("_moz_dirty");A.value="";B.attributes.setNamedItem(A);A=C.createAttribute("type");A.value="_moz";B.attributes.setNamedItem(A)}return B},createEmptyPara:function(B){var A=B.createElement("P");A.appendChild(this.createMozBR(B));return A},findLastKid:function(A){if(A.nodeType==3){return null}if(A.childNodes.length==0){return null}if(this.isMacro(A)||$def(A.tagName)&&A.tagName.toLowerCase()=="table"||$def(A.tagName)&&A.tagName.toLowerCase()=="pre"){return A}return this.findLastKid(A.childNodes[A.childNodes.length-1])},isBR:function(A){if(A.nodeType==3){return false}return A.nodeName.toLowerCase()=="br"},convertDoubleLineBreaksToParagraphs:function(D,I){if(I.nodeType!=1){return }if(!D.dom.isBlock(I)&&I.nodeName.toLowerCase()!="body"){return }if(I.nodeName.toLowerCase()=="pre"){return }if(this.isExactMacro(I)){return }var B;if(I.childNodes.length>0){B=I.childNodes[I.childNodes.length-1]}for(var A=0;A<I.childNodes.length-1;A++){var C=I.childNodes[A];B=I.childNodes[A+1];if(C.nodeType==1&&C.nodeName.toLowerCase()=="ol"||C.nodeName.toLowerCase()=="ul"){if(C.childNodes.length==0){I.removeChild(C);A--}}else{if(B.nodeType==1&&B.nodeName.toLowerCase()=="ol"||B.nodeName.toLowerCase()=="ul"){if(B.childNodes.length==0){I.removeChild(B);A--}}else{if(this.isBR(C)&&this.isBR(B)){var H=D.dom.getParent(C,"li");if(H==null){var G=C.parentNode;var E=G.parentNode;var F=G.cloneNode(true);while(F.childNodes.length>0){F.removeChild(F.childNodes[0])}while(A<I.childNodes.length-2){I.childNodes[A+2];F.appendChild(I.childNodes[A+2])}this.insertAfter(E,F,G);this.insertAfter(E,this.createEmptyPara(D.getDoc()),G);G.removeChild(C);G.removeChild(B);B=F}}else{this.convertDoubleLineBreaksToParagraphs(D,C)}}}}if($def(B)){this.convertDoubleLineBreaksToParagraphs(D,B)}},fixBodyParagraphs:function(){var B=tinyMCE.activeEditor;var A=B.getBody();this.convertDoubleLineBreaksToParagraphs(B,A);var F=this.findLastKid(A);if(A.childNodes.length>0&&F){var E=B.getDoc();A.appendChild(this.createEmptyPara(E))}if(!tinymce.isIE){for(var C=0;C<A.childNodes.length;C++){var D=A.childNodes[C];if(D.nodeType==1&&D.tagName.toLowerCase()=="p"){if(D.childNodes.length==0){D.appendChild(this.createMozBR(B.getDoc()))}}}}},nodeChanged:function(B,A,D,E){this.fixBodyParagraphs();var C=this.getMacroFor(D);if(A.get("justifyleft")){if(C!=null){A.get("justifyleft").setDisabled(true);A.get("justifycenter").setDisabled(true);A.get("justifyright").setDisabled(true);A.get("justifyfull").setDisabled(true)}else{A.get("justifyleft").setDisabled(false);A.get("justifycenter").setDisabled(false);A.get("justifyright").setDisabled(false);A.get("justifyfull").setDisabled(false)}}},nextId:0,removeDuplicateMacros:function(A,E,C){if(E.nodeType==1&&(E.nodeName.toLowerCase()=="td"||E.nodeName.toLowerCase()=="th")&&E.childNodes.length==0&&!tinymce.isIE){E.appendChild(this.createMozBR(A.getDoc()))}else{if(this.isExactMacro(E)){var D=this.getMacroFor(E);if(D!=null){D.refresh(window.editor,E)}}}for(var B=0;B<E.childNodes.length;B++){this.removeDuplicateMacros(A,E.childNodes[B],C)}},collapseToStart:null,insertAfter:function(C,B,A){if(A.nextSibling){return C.insertBefore(B,A.nextSibling)}else{return C.appendChild(B)}},putCursorAfter:function(A,E){var F=A.selection;var D;if(E.nextSibling==null||E.nextSibling.nodeName.toLowerCase()=="br"){var B=A.dom.getParent(E,function(H){return function(I){return I==A.getBody()||I!=H}}(E));if(tinymce.isWebKit){var G=A.getDoc().createElement("span");G.innerHTML="&nbsp;"}else{var G=A.getDoc().createTextNode(" ")}this.insertAfter(B,G,E);D=G}else{D=E.nextSibling}F.select(D);if(D.nodeType==3&&D.nodeValue.length<=1){F.collapse(true)}else{if(D.nodeType==3&&D.nodeValue.length>1){var C=F.getRng();C.setStart(D,tinymce.isWebKit?1:0);C.setEnd(D,tinymce.isWebKit?1:0);F.setRng(C)}else{if(D.nodeType==1&&D.childNodes.length>0){var C=F.getRng();C.setStart(D,tinymce.isWebKit?1:0);C.setEnd(D,tinymce.isWebKit?1:0);F.setRng(C)}else{F.collapse(true)}}}},putCursorBefore:function(A,D){if(tinymce.isWebKit){var C;if(D.previousSibling==null){var B=A.dom.getParent(D,function(G){return function(H){return H==A.getBody()||H!=G}}(D));var F=A.getDoc().createElement("span");F.innerHTML="&nbsp;";B.insertBefore(F,D);C=F}else{C=D.previousSibling}var E=A.selection;E.select(C);E.collapse(true)}else{var E=A.selection;E.select(D);E.collapse(true)}},isLastNodeOf:function(C,B,A){if(B.childNodes.length>0&&B.childNodes[B.childNodes.length-1].nodeType==3&&C.getRng().startContainer!=B.childNodes[B.childNodes.length-1]){return false}if(B==A){return true}if(B.nextSibling!=null){return false}return this.isLastNodeOf(B.parentNode,A)},isFirstNodeOf:function(C,B,A){if(B.childNodes.length>0&&B.childNodes[0].nodeType==3&&C.getRng().startContainer!=B.childNodes[0]){return false}if(B==A){return true}if(B.previousSibling!=null){return false}return this.isLastNodeOf(B.parentNode,A)},fixParaStyleHeight:function(A,C){if(C.nodeType!=3&&C.nodeName.toLowerCase()=="p"){C.style.height=""}else{if(C.nodeType!=3){for(var B=0;B<C.childNodes.length;B++){A.plugins.jivemacros.fixParaStyleHeight(A,C.childNodes[B])}}}},init:function(A,B){this.url=B;for(var D=0;D<jive.rte.macros.length;D++){if(jive.rte.macros[D].getName()=="emoticon"){macro=jive.rte.macros[D]}}this.emoticon=macro;var C=this;A.addCommand("mceJiveMacros",function(){var E=this.controlManager;var F=E.get("jivemacros");F.showMenu()});A.addCommand("mceEditJiveMacro",function(){var G=tinyMCE.activeEditor;var H=G.plugins.jivemacros.macro;var E=H.getAllowedParameters().length*28+88;if(H.getUrl().length>0){window.jiveRTE=new Object();window.jiveRTE.macro=H;window.jiveRTE.node=G.dom.getParent(G.selection.getNode(),G.plugins.jivemacros.isExactMacro);var F=G.windowManager.open({url:CS_BASE_URL+H.getUrl(),width:500,height:400,inline:1},{macro:H})}else{G.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/jivemacros/macro.htm",width:400,height:E,inline:1},{plugin_url:B,macro:H})}});A.addCommand("mceDeleteJiveMacro",function(){var E=tinyMCE.activeEditor;this.deleteMacro(E,E.selection.getNode())},this);A.onInit.add(function(){var E=tinyMCE.activeEditor;E.plugins.jivemacros.removeDuplicateMacros(E,E.getBody());E.plugins.jivemacros.fixParaStyleHeight(E,E.getBody());E.onMouseUp.add(function(G,I){var H=I.target;if(G.selection.isCollapsed()&&H.nodeName.toLowerCase()=="html"){var F=G.getBody();if(F){if(F.childNodes.length==0){G.plugins.jivemacros.fixBodyParagraphs()}while(F.nodeType==1&&F.childNodes.length){F=F.childNodes[F.childNodes.length-1]}}G.selection.select(F);if(F.nodeType==1&&F.nodeName.toLowerCase()=="br"){G.selection.collapse(true)}else{G.selection.collapse()}}});if(E&&E.plugins.contextmenu){E.plugins.contextmenu.onContextMenu.add(function(F,K,P){var I,Q=E.selection,G=Q.getNode()||E.getBody();var M=E.dom.getParent(G,function(T){return T==E.getBody()||E.plugins.jivemacros.isExactMacro(T)});if(!E.plugins.jivemacros.isExactMacro(M)){M=null}var J=null;var N=-1;var O=false;if(M!=null){for(var L=0;L<jive.rte.macros.length;L++){if(jive.rte.macros[L].getName()==M.attributes.jivemacro.value){J=jive.rte.macros[L];N=L;if(J.getName()=="code"){if(M.attributes.___default_attr.value=="html"){O=true}}}}}window.jiveRTE=new Object();window.jiveRTE.macroEle=M;if(J!=null){E.plugins.jivemacros.macro=J;K.removeAll();if(M.nodeName.toLowerCase()=="a"&&(J.getName()=="document"||J.getName()=="blogpost"||J.getName()=="thread"||J.getName()=="message"||J.getName()=="blog"||J.getName()=="community"||J.getName()=="space"||J.getName()=="user"||J.getName()=="project"||J.getName()=="task"||J.getName()=="group")){K.add({title:"jivemacros.unlink",cmd:"mceDeleteJiveMacro"})}else{var S=J.getParameterSets();if(S.length>1){if(J.getName()!="code"||!O){var H=E.getLang("jivemacros.macro."+J.getName()+".presets","jivemacros.presets");I=K.addMenu({title:H,max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu",icon:"jiveMacroPreset"});for(var L=0;L<S.length;L++){if(J.getName()!="code"||S[L].name!="html"){var R=E.getLang("jivemacros.macro."+J.getName()+".preset."+S[L].name,S[L].name);I.add({title:R,cmd:"mceMacroParamSet"+N+"_"+L,icon:"jiveMacro_"+J.getName()+"_"+S[L].name})}}}}if(J.getAllowedParameters().length>0&&J.isShowSettings()){K.add({title:"jivemacros.properties",icon:"jiveMacroProperties",cmd:"mceEditJiveMacro",ui:true})}K.add({title:"jivemacros.remove",icon:"jiveMacroDelete",cmd:"mceDeleteJiveMacro",ui:true})}}else{this.macro=null}})}});A.onNodeChange.add(this.nodeChanged,this);A.onKeyPress.addToTop(function(F,E){if(this.collapseToEnd!=null||this.collapseToStart!=null){tinymce.dom.Event.cancel(E)}var G=this.isMacro(F.selection.getNode());if(F.dom.hasClass(G,"default_title")){F.dom.removeClass(G,"default_title")}F.selection.lastSelected=F.selection.getNode()},this);A.onKeyDown.addToTop(function(I,P){I.selection.lastSelected=I.selection.getNode();var U=I.selection;var F=this.isMacro(U.getNode())||this.isLink(U.getNode());if((P.keyCode==37)&&F){var V=0;if(tinymce.isWebKit){V=1}var W=U.getRng().startOffset==V&&this.isFirstNodeOf(U,U.getNode(),F);W=W||I.dom.hasClass(F,"default_title");if(W){this.collapseToStart=F;U.select(F);U.collapse(true);tinymce.dom.Event.cancel(P);return false}}if((P.keyCode==39)&&F){if(F.childNodes.length==0){this.collapseToEnd=F;tinymce.dom.Event.cancel(P);return false}else{var R=U.getRng().startOffset==(U.getNode().childNodes[U.getNode().childNodes.length-1].nodeValue.length)&&this.isLastNodeOf(U,U.getNode(),F);R=R||I.dom.hasClass(F,"default_title");console.log("isEndOfBlock: "+R);if(R){this.collapseToEnd=F;U.select(F);U.collapse();tinymce.dom.Event.cancel(P);return false}}}var M=I.getBody();if(M.childNodes.length>0){var S=I.selection.getNode();this.before=S;if(P.keyCode==13&&this.before.tagName=="PRE"){if(tinymce.isIE){var Q=I.dom.getParent(S,"pre");tinymce.dom.Event.cancel(P);var K=I.selection.getSel().createRange();K.text="\n ";K.select();return }else{if(tinymce.isWebKit){tinymce.dom.Event.cancel(P);var G=I.selection.getNode().childNodes;var N=I.selection.getRng();if(G.length==0){I.selection.getNode().appendChild(I.getDoc().createTextNode("\n"))}else{var T=G[0].nodeValue;var J=Math.min(N.startOffset,T.length);var H=T.substr(0,J);var E=(J<T.length)?T.substr(J):"";G[0].nodeValue=H+"\n"+E;var L=E.substr(0,1);I.getWin().find(L,true,false,false,false,false,false);var X=I.selection;if(L=="\n"||L=="\r"){var O=X.getRng().cloneRange();I.getDoc().execCommand("SelectAll",false,null);O.setEnd(O.endContainer,O.endOffset+1);O.setStart(O.startContainer,O.startOffset+1);X.setRng(O)}X.collapse(true)}}}}}},this);A.onKeyUp.add(function(L,O){if(O.keyCode==90&&O.ctrlKey&&(L.selection.getNode().nodeName.toLowerCase()=="body"&&L.selection.lastSelected&&L.selection.lastSelected.nodeName.toLowerCase()!="body")){var M=L.selection.lastSelected;if(M.childNodes.length){M=M.childNodes[M.childNodes.length-1];L.selection.select(M);L.selection.collapse(true)}else{L.selection.select(M);L.selection.collapse()}}var I=L.selection;if(this.collapseToStart!=null){this.putCursorBefore(L,this.collapseToStart);tinymce.dom.Event.cancel(O);this.collapseToStart=null;return }if(this.collapseToEnd!=null){this.putCursorAfter(L,this.collapseToEnd);tinymce.dom.Event.cancel(O);this.collapseToEnd=null;return }if(this.before!=null&&(O.keyCode==39||O.keyCode==40)){var F=L.dom.getParent(L.selection.getNode(),"PRE");if(this.before.tagName!="PRE"&&F){if(this.before.childNodes.length==1&&this.before.childNodes[0].tagName=="BR"){var N=L.dom.getParent(this.before,function(Q){return function(R){return R==L.getBody()||R!=Q}}(this.before));if(N.childNodes[0]==this.before){N.removeChild(this.before);this.before=F}}}}L.plugins.jiveemoticons.encodeSmileys(L,L.selection.getNode());if(O.keyCode==37||O.keyCode==38){var I=L.selection;var J=L.dom.getParent(I.getNode(),function(Q){return Q==L.getBody()||L.plugins.jivemacros.isExactMacro(Q)});if(!L.plugins.jivemacros.isExactMacro(J)){J=null}if(J==null){return }var K=this.isFirst(L.getBody(),J);var H=this.isMacro(J);var E=I.getBookmark().start==0||I.getRng().startOffset==0;if(K&&H&&E&&I.isCollapsed()){var G=L.getDoc().createElement("P");var P=L.getDoc().createElement("BR");G.appendChild(P);L.getBody().insertBefore(G,L.getBody().childNodes[0]);return true}}},this)},getInfo:function(){return{longname:"Jive Macros",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},generateMacroMenu:function(A,D){var C=tinyMCE.activeEditor;var F=jive.rte.macros[D];var H=F.getParameterSets();var B=C.getLang("jivemacros.macro."+F.getName(),F.getName());if(H.length>1){sm=A.addMenu({title:B,max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu",icon:"jiveMacro_"+F.getName()});for(var E=0;E<H.length;E++){var G=C.getLang("jivemacros.macro."+F.getName()+".preset."+H[E].name,H[E].name);if(H[E].name=="html"&&F.getName()=="code"){A.add({cmd:"mceAddJiveMacro"+D+"_"+E,title:G,max_height:"200",icon:"jiveMacro_"+F.getName()})}else{sm.add({title:G,cmd:"mceAddJiveMacro"+D+"_"+E,icon:F.getName()+"_"+H[E].name})}}}else{if(H.length==1){var G=C.getLang("jivemacros.macro."+F.getName()+".preset."+H[0].name,H[0].name);A.add({cmd:"mceAddJiveMacro"+D,title:G,max_height:"200",icon:"jiveMacro_"+F.getName()})}else{A.add({cmd:"mceAddJiveMacro"+D,title:B,max_height:"200",icon:"jiveMacro_"+F.getName()})}}},createControl:function(H,A){switch(H){case"jivemacros":var G=A.createSplitButton("jivemacros",{title:"jivemacros.add",cmd:"mceJiveMacros"});for(var D=0;D<jive.rte.macros.length;D++){if(jive.rte.macros[D].isShowInMacroList()&&jive.rte.macros[D].getName()!="emoticon"&&!jive.rte.macros[D].isButton()){G.onRenderMenu.add(function(I){return function(L,J){var K=tinyMCE.activeEditor;K.plugins.jivemacros.generateMacroMenu(J,I)}}(D))}}return G;case"extra":var C=tinyMCE.activeEditor;for(var D=0;D<jive.rte.macros.length;D++){if(jive.rte.macros[D].isShowInMacroList()&&jive.rte.macros[D].getName()!="emoticon"&&jive.rte.macros[D].isButton()){var E=jive.rte.macros[D];var F=E.getParameterSets();var B=C.getLang("jivemacros.macro."+E.getName(),E.getName());if(F.length>1){var G=A.createSplitButton("extra",{title:B,image:"../jscripts/tiny_mce/plugins/example/img/example.gif",icon:"jiveMacro_"+E.getName(),cmd:"mceAddJiveMacro"+D});G.onRenderMenu.add(function(I){return function(M,J){for(var K=0;K<F.length;K++){var L=C.getLang("jivemacros.macro."+E.getName()+".preset."+F[K].name,F[K].name);J.add({title:L,cmd:"mceAddJiveMacro"+I+"_"+K,icon:E.getName()+"_"+F[K].name})}}}(D));return G}else{var G=A.createButton("extra",{title:B,cmd:"mceAddJiveMacro"+D,icon:"jiveMacro_"+E.getName()});return G}}}}return null}});tinymce.PluginManager.add("jivemacros",tinymce.plugins.JiveMacrosPlugin)})();

tinyMCE.addI18n("en.jivemacros",{unlink:"Unlink",add:"Insert",remove:"Remove",properties:"Settings",title:"Settings",presets:"Presets",save:"Save","macro.toc":"Table of Contents","macro.quote":"Quote","macro.user":"User","macro.youtube":"YouTube","macro.youtube.attr.__default_attr":"URL or Video ID","macro.youtube.attr.width":"Width","macro.youtube.attr.height":"Height","macro.emoticon.presets":"Emoticons","macro.code":"Syntax Highlighting","macro.code.presets":"Format","macro.code.attr.__default_attr":"Format","macro.code.preset.plain":"Plain","macro.code.preset.sql":"SQL","macro.code.preset.java":"Java","macro.code.preset.html":"Insert Raw HTML","macro.code.preset.xml":"XML","macro.emoticon.preset.angry":"Angry","macro.emoticon.preset.blush":"Blush","macro.emoticon.preset.confused":"Confused","macro.emoticon.preset.cool":"Cool","macro.emoticon.preset.cry":"Cry","macro.emoticon.preset.devil":"Devil","macro.emoticon.preset.grin":"Grin","macro.emoticon.preset.happy":"Happy","macro.emoticon.preset.laugh":"Laugh","macro.emoticon.preset.love":"Love","macro.emoticon.preset.mischief":"Mischief","macro.emoticon.preset.plain":"Plain","macro.emoticon.preset.sad":"Sad","macro.emoticon.preset.shocked":"Shocked","macro.emoticon.preset.silly":"Silly","macro.emoticon.preset.wink":"Wink"});

tinyMCE.addI18n("en.jivemacros",{add:"Insert",remove:"Remove",properties:"Settings",title:"Settings",params:"Parameters",presets:"Presets",save:"Save"});

(function(){tinymce.PluginManager.requireLangPack("jiveemoticons");tinymce.create("tinymce.plugins.JiveEmoticonsPlugin",{before:null,macro:null,shouldEncodeHuh:function(A,D){var B=A.dom.getParent(D,function(E){return E==A.getBody()||A.plugins.jivemacros.isMacro(E)});if(!A.plugins.jivemacros.isMacro(B)){B=null}if(B!=null){var C=A.plugins.jivemacros.getMacroFor(B);if(C.getName()=="code"){return false}}return true},encodeSmileys:function(E,B){var C=new Array();var G=this;var H=[[":D","grin",":D"],[":x","love",":x"],[";\\","mischief",";\\\\"],["B-)","cool","B-\\)"],["]:)","devil","\\]:\\)"],[":p","silly",":p"],[":P","silly",":P"],["X-(","angry","X\\-\\("],[":^0","laugh",":^0"],[";)","wink",";\\)"],[":8}","blush",":8}"],[":0","laugh",":0"],[":o","shocked",":o"],[":)","happy",":\\)"],[":(","sad",":\\("]];var K="";for(var D=0;D<H.length;D++){K+=(K?"|":"")+H[D][2]}var A=new RegExp("("+K+")","g");if(!A.test(B.innerHTML)){return }function F(O){if(O.nodeType==3&&G.shouldEncodeHuh(E,O)){var U=O.nodeValue;var L=new Array();for(var Q=0;Q<H.length;Q++){var M=H[Q][1];var S='<img class="jive_macro jive_emote" jivemacro="emoticon" ___jive_emoticon_name="'+M+'" src="'+window.CS_BASE_URL+"/images/emoticons/"+M+'.gif" mce_src="'+window.CS_BASE_URL+"/images/emoticons/"+M+'.gif">';var P=new RegExp("("+H[Q][2]+")","g");var N=new RegExp("(\\S"+H[Q][2]+")","g");var R=U.indexOf(H[Q][0]);if(P.test(U)){if(R>=0&&R<(U.length-H[Q][0].length)){var T=U.substr(U.indexOf(H[Q][0])+H[Q][0].length);var V=E.getDoc().createTextNode(T);O.parentNode.insertBefore(V,O);O.parentNode.insertBefore(O,V);O.nodeValue=U.substr(0,U.indexOf(H[Q][0])+H[Q][0].length);U=O.nodeValue}if(!N.test(U)){L.push([H[Q][0],S])}}}if(L.length&&G.shouldEncodeHuh(E,O)){U=U.escapeHTML();for(var Q=0;Q<L.length;Q++){U=U.replace(L[Q][0],L[Q][1])}C.push(O.parentNode);E.dom.replace(E.dom.create("span",{"class":"remove_me"},U),O)}}else{if(G.shouldEncodeHuh(E,O)){for(var Q=0;Q<O.childNodes.length;Q++){F(O.childNodes[Q])}}}}var I=E.selection.getBookmark();F(B);if(tinymce.isWebKit){E.selection.moveToBookmark(I)}function J(N){if(N.childNodes&&N.childNodes.length>0){for(var M=0;M<N.childNodes.length;M++){if(N.className=="remove_me"){N.parentNode.insertBefore(N.childNodes[M],N);M--}else{var L=N.childNodes.length;J(N.childNodes[M]);if(L>N.childNodes.length){M-=(L-N.childNodes.length)}}}}if(N.className=="remove_me"){E.selection.select(N);E.selection.collapse();N.parentNode.removeChild(N)}}J(E.getBody())},nodeChanged:function(A){if(this.before==null){this.before=A.selection.getNode()}this.encodeSmileys(A,this.before);this.before=A.selection.getNode()},init:function(A,B){var D=null;for(var C=0;C<jive.rte.macros.length;C++){if(jive.rte.macros[C].getName()=="emoticon"){D=jive.rte.macros[C]}}if(D!=null){this.macro=D}},execCommand:function(D,C,E){if(D=="mceJiveEmoticon"){var A=tinyMCE.activeEditor.controlManager;var B=A.get("jiveemoticons");B.showMenu();return true}return false},getInfo:function(){return{longname:"Emoticons",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},createControl:function(C,A){switch(C){case"jiveemoticons":var B=A.createSplitButton("jiveemoticons",{title:"jiveemoticons.desc",cmd:"mceJiveEmoticon"});B.onRenderMenu.add(function(K,D){var E=tinyMCE.activeEditor;for(var F=0;F<jive.rte.macros.length;F++){var I=jive.rte.macros[F];if(I.isShowInMacroList()&&I.getName()=="emoticon"){var J=I.getParameterSets();for(var G=0;G<J.length;G++){var H=E.getLang("jivemacros.macro."+I.getName()+".preset."+J[G].name,J[G].name);D.add({title:H,cmd:"mceAddJiveMacro"+F+"_"+G,icon:"jiveMacro_"+I.getName()+"_"+J[G].name})}}}});return B}return null}});tinymce.PluginManager.add("jiveemoticons",tinymce.plugins.JiveEmoticonsPlugin)})();

tinyMCE.addI18n("en.jiveemoticons",{title:"Insert emoticon",desc:"Emoticons"});

(function(){tinymce.create("tinymce.plugins.JiveButtonsPlugin",{execCommand:function(B,A,C){if(B=="mceNull"){return true}return false},initToolbar:function(I){var H;if(!I||typeof (I)!="string"){var E=window.editor.toArray();for(var F=0;F<E.length;F++){if(E[F]&&E[F].getID){this.initToolbar(E[F].getID())}}return }else{H=tinyMCE.get(I)}var J=document.getElementById(I+"_magicspacer0");var G=document.getElementById(I+"_magicspacer1");var K=document.getElementById(I+"_toolbar1");if(J){var M=K.rows[0].cells;var L;var D=0;for(var F=0;F<5;F++){L=M[F];D+=jive.ext.x.xWidth(L)}K=document.getElementById(I+"_toolbar2");M=K.rows[0].cells;var C=0;for(F=0;F<7;F++){L=M[F];C+=jive.ext.x.xWidth(L)}var B=D-C;if(B<0){jive.ext.x.xDisplayNone(G);jive.ext.x.xDisplayBlock(J);jive.ext.x.xWidth(J,(B*-1)-1)}else{jive.ext.x.xDisplayNone(J);jive.ext.x.xDisplayBlock(G);jive.ext.x.xWidth(G,B-5)}}var A=document.getElementById(I+"_spellchecker");if(A!=null){var L=H.dom.getParent(A,function(N){return N!=A});L.style.width="100%"}},init:function(A,B){this.url=B;var C=this;this.index=0;this.mindex=0;A.onInit.add(function(D){if(!window.toolbarInitted){jive.ext.x.xTimer.set("timeout",D.plugins.jivebuttons,"initToolbar",33);jive.ext.x.xTimer.set("timeout",D.plugins.jivebuttons,"initToolbar",500);jive.ext.x.xTimer.set("timeout",D.plugins.jivebuttons,"initToolbar",2000);window.toolbarInitted=true}D.plugins.jivebuttons.initToolbar(D.id);var G=new jive.rte.RTEListener();G.onShow=function(H){return function(){try{tinyMCE.get(H).plugins.jivebuttons.initToolbar(H)}catch(I){}}}(D.id);G.initFinished=G.onShow;window.editor.get(D.id).addListener(G);var E=$(D.id+"_toolbar1");var F=E.parentNode;if(tinymce.isIE){F.style.height=this.settings.default_height+"px"}else{F.style.height=(this.settings.default_height-1)+"px"}F.style.bottom="0px"})},getInfo:function(){return{longname:"Jive Buttons",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},createControl:function(C,A){if(C=="spacerbutton"){var B=A.createButton("spacerbutton"+this.index,{"class":"jive_spacer_button jive_spacer_button"+this.index,cmd:"mceNull"});this.index++;return B}if(C=="magicspacer"){var B=A.createButton("magicspacer"+this.mindex,{"class":"jive_spacer_button jive_magicspacer_button",cmd:"mceNull"});this.mindex++;return B}return null}});tinymce.PluginManager.add("jivebuttons",tinymce.plugins.JiveButtonsPlugin)})();

(function(){tinymce.PluginManager.requireLangPack("jivelink");tinymce.create("tinymce.plugins.JiveLinkPlugin",{getInfo:function(){return{longname:"Content Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},init:function(A,B){A.onBeforeGetContent.add(function(){if(this.lastActive!=null){A.dom.removeClass(this.lastActive,"active_link");this.lastActive=null}},this);A.onNodeChange.add(this.nodeChanged,this)},createControl:function(C,A){switch(C){case"jivelink":var B=A.createButton("jivelink",{title:"jivelink.link_desc",cmd:"mceJiveLink"});return B}return""},execCommand:function(E,D,F){switch(E){case"mceJiveLink":var H=false;var A=tinyMCE.activeEditor;var G=A.selection.getContent();var C=A.selection.getNode();var B=A.dom.getParent(C,"a");if(B!=null){A.dom.removeClass(B,"active_link");if(A.plugins.jivemacros.isMacro(B)){A.plugins.jivemacros.deleteMacro(A,B)}else{A.execCommand("unlink")}return true}else{if(A.selection.getNode()){H=(A.selection.getNode().nodeName.toLowerCase()=="img")||(G&&G.length>0)}A.windowManager.open({url:CS_BASE_URL+"/content-picker!input.jspa?name="+escape(G)+"&instantiatedFromGUIEditor=true",width:700+A.getLang("jivelink.delta_width",0),height:480+A.getLang("jivelink.delta_height",0),inline:"yes"},{editor_id:A.id});return true}}return false},lastActive:null,nodeChanged:function(B,A,F,G){if(F==null){return }var E=B.dom.getParent(F,"a");if(E!=null){B.controlManager.get("jivelink").setActive(true)}else{B.controlManager.get("jivelink").setActive(false)}if(this.lastActive!=null&&this.lastActive!=F){B.dom.removeClass(this.lastActive,"active_link");this.lastActive=null}var C=B.dom.getParent(F,"a");if(C&&C.nodeName.toLowerCase()=="a"&&this.lastActive==null){this.lastActive=C;B.dom.addClass(this.lastActive,"active_link")}var D=B.plugins.jivemacros.getMacroFor(F);if(D!=null&&D.getMacroType()=="INLINE"){if(this.lastActive==null||this.lastActive!=F){this.lastActive=this.isMacro(F);B.dom.addClass(this.lastActive,"active_link")}if(this.lastActive.childNodes.length>0&&B.dom.hasClass(this.lastActive,"default_title")){B.selection.select(this.lastActive.childNodes[0])}}}});tinymce.PluginManager.add("jivelink",tinymce.plugins.JiveLinkPlugin)})();

tinyMCE.addI18n("en.jivelink",{link_desc:"Insert Link"});

(function(){tinymce.create("tinymce.plugins.JiveImagePlugin",{getInfo:function(){return{longname:"Image Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},init:function(A,B){A.onInit.add(function(){if(!A.settings.images_enabled){A.controlManager.get("jiveimage").setDisabled(true)}},this)},createControl:function(C,A){switch(C){case"jiveimage":var B=A.createButton("jiveimage",{title:"jiveimage.link_desc",cmd:"mceJiveImage"});return B}return""},execCommand:function(C,B,D){switch(C){case"mceJiveImage":var A=tinyMCE.activeEditor;if(tinyMCE.settings.jive_image_picker_url){A.windowManager.open({url:CS_BASE_URL+tinyMCE.settings.jive_image_picker_url+"&instantiatedFromGUIEditor=true",width:580+A.getLang("jiveimage.delta_width",0),height:425+A.getLang("jiveimage.delta_height",0),inline:"yes"},{editor_id:A.id})}else{A.execCommand("mceAdvImage")}return true}return false},handleNodeChange:function(F,D,E,C,A,B){if(D==null){return }do{if(D.nodeName=="IMG"&&tinyMCE.getAttrib(D,"src")!=""){tinyMCE.switchClass(F+"_jiveimage","mceButtonSelected");return true}}while((D=D.parentNode));if(B){tinyMCE.switchClass(F+"_jiveimage","mceButtonNormal");return true}tinyMCE.switchClass(F+"_jiveimage","mceButtonDisabled");return true}});tinymce.PluginManager.add("jiveimage",tinymce.plugins.JiveImagePlugin)})();

tinyMCE.addI18n("en.jiveimage",{link_desc:"Insert Image"});

(function(){tinymce.create("tinymce.plugins.JiveQuotePlugin",{getInfo:function(){return{longname:"Jive Quote Button",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},createControl:function(C,A){switch(C){case"jivequote":var B=A.createButton("jivequote",{title:"jivequote.link_desc",cmd:"mceJiveQuote"});return B}return""},execCommand:function(E,M,C){switch(E){case"mceJiveQuote":var J=tinyMCE.activeEditor;var B=J.selection;var F=null;var H=B.isCollapsed();for(var I=0;I<jive.rte.macros.length;I++){var D=jive.rte.macros[I];if(D.getName()=="quote"){F=J.plugins.jivemacros.buildMacro(D)}}if(F&&H){while(F.childNodes.length>0){F.removeChild(F.childNodes[0])}if($def(window._jive_gui_quote_text)){var A=J.getDoc().createElement("DIV");A.innerHTML=_jive_gui_quote_text;if(A.childNodes.length>0){for(var I=0;I<A.childNodes.length;I++){if(A.childNodes[I].nodeType==1){var O=A.childNodes[I];var G=O.childNodes[0];while(G.childNodes.length>0){if(G.childNodes[0].className=="jive-quote-header"){var L=J.getDoc().createElement("P");L.appendChild(G.childNodes[0].childNodes[0]);F.appendChild(L);F.appendChild(J.plugins.jivemacros.createEmptyPara(J.getDoc()));G.removeChild(G.childNodes[0]);G.removeChild(G.childNodes[0]);G.removeChild(G.childNodes[0])}else{F.appendChild(G.childNodes[0])}}}}}}else{F.appendChild(J.plugins.jivemacros.createEmptyPara(J.getDoc()))}var K=J.dom.getParent(B.getNode(),"PRE");var N=null;if(!K){K=B.getNode().parentNode;N=B.getNode()}else{N=J.dom.getParent(B.getNode(),function(P){return P.nodeName.toLowerCase()=="body"||P.parentNode.nodeName=="PRE"})}if(N.nodeName.toLowerCase()=="body"){N=null}if(K&&N){K.insertBefore(F,N)}else{K.appendChild(F);K.appendChild(J.plugins.jivemacros.createEmptyPara(J.getDoc()))}}else{}return true}return false}});tinymce.PluginManager.add("jivequote",tinymce.plugins.JiveQuotePlugin)})();

tinyMCE.addI18n("en.jivequote",{link_desc:"Quote Previous Message"});

(function(){tinymce.create("tinymce.plugins.JiveUtilPlugin",{getInfo:function(){return{longname:"Jive Utility Plugin",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},walkDOMTreeKids:function(A,C,D){D(A);if(A==C){return true}for(var B=0;B<A.childNodes.length;B++){if(this.walkDOMTreeKids(A.childNodes[B],C,D)){return true}}return false},walkDOMTree:function(A,B,C){if(this.walkDOMTreeKids(A,B,C)){return true}while(A.nextSibling!=null){A=A.nextSibling;if(this.walkDOMTreeKids(A,B,C)){return true}}function E(F){if(F.nodeType==1&&F.nodeName.toLowerCase()=="body"){return F}if(F.parentNode.nextSibling==null){return E(F.parentNode)}return F.parentNode.nextSibling}var D=E(A);if(D.nodeType==1&&D.nodeName.toLowerCase()=="body"){return true}return this.walkDOMTree(D,B,C)},textLengthIn:function(B){var A=0;this.walkDOMTreeKids(B,null,function(){if(B.nodeType==3){A+=B.nodeValue.length}});return A},getNodeAt:function(C,D){if(D==0){return C}if(C.nodeType!=1){return null}for(var B=0;B<C.childNodes.length;B++){var A=this.textLengthIn(C.childNodes[B]);if(D==0){return C.childNodes[B]}else{if(A>D){return this.getNodeAt(C.childNodes[B],D)}else{D-=A}}}}});tinymce.PluginManager.add("jiveutil",tinymce.plugins.JiveUtilPlugin)})();

(function(){tinymce.create("tinymce.plugins.JiveVideoPlugin",{getInfo:function(){return{longname:"Video Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},enabled:[],init:function(A,B){A.onInit.add(function(){var F=["youtube","dailymotion","veoh","vimeo","google"];var E=0;for(var D=0;D<jive.rte.macros.length;D++){for(var C=0;C<F.length;C++){if(F[C]==jive.rte.macros[D].getName()&&jive.rte.macros[D].isEnabled()){E++;this.enabled.push(jive.rte.macros[D])}}}if(E==0){A.controlManager.get("jivevideo").setDisabled(true)}},this)},createControl:function(C,A){switch(C){case"jivevideo":var B=A.createButton("jivevideo",{title:"jivevideo.link_desc",cmd:"mceJiveVideo"});return B}return""},execCommand:function(C,B,D){switch(C){case"mceJiveVideo":var A=tinyMCE.activeEditor;A.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/jivevideo/video.htm",width:550+parseInt(A.getLang("jivevideo.delta_width",0)),height:308+parseInt(A.getLang("jivevideo.delta_height",0)),inline:1});return true}return false}});tinymce.PluginManager.add("jivevideo",tinymce.plugins.JiveVideoPlugin)})();

tinyMCE.addI18n("en.jivevideo",{link_desc:"Insert Video"});

tinyMCE.addI18n("en.jivevideo",{num1:"1. ",num2:"2. ",title_new:"Insert Video",general_props:"Video Properties",site_title:"Select a Video Site",embed_title:"Enter Video Information",embed:"Video URL or Embed Code (example: http://youtube.com/watch?v=videoIdHere)",embed_error:"Please enter a valid URL or embed code",name_youtube:"YouTube",name_vimeo:"Vimeo",name_veoh:"Veoh",name_dailymotion:"Dailymotion",name_google:"Google"});

(function(){tinymce.create("tinymce.plugins.TableToolbarPlugin",{init:function(A,B){var C=this;A.onPostRender.add(function(){var H=tinymce.DOM.get(A.id+"_toolbar3");if($def(H)&&H!=null){var E=H.rows[0].cells[H.rows[0].cells.length-1];var I=H.rows[0].cells[0];H.rows[0].insertBefore(I,E);for(var G=0;G<H.rows[0].cells.length;G++){var D=H.rows[0].cells[G];var F=D.childNodes[0];if(F.nodeName.toLowerCase()=="a"){Event.observe(D,"mouseover",function(J){return function(){E.innerHTML=J.title}}(F))}}Event.observe(H,"mouseout",function(){E.innerHTML=" "})}tinymce.DOM.hide(A.id+"_toolbar3")});A.onNodeChange.add(function(D){return function(F,E,J){var G=F.dom.getParent(J,"table");if($def(G)&&G!=null&&$def(G.tagName)){D._showToolbar()}else{D._hideToolbar()}var E=F.controlManager;var J=F.selection.getNode();var H=F.dom.getParent(J,"tr");var I=F.dom.getParent(J,"td,th");if(H!=null&&I!=null){if(H.nextSibling==null){E.get("row_down").setDisabled(true)}else{E.get("row_down").setDisabled(false)}if(H.previousSibling==null){E.get("row_up").setDisabled(true)}else{E.get("row_up").setDisabled(false)}if(I.previousSibling==null){E.get("col_left").setDisabled(true)}else{E.get("col_left").setDisabled(false)}if(I.nextSibling==null){E.get("col_right").setDisabled(true)}else{E.get("col_right").setDisabled(false)}}}}(this))},_hidden:true,settings:new Object(),_showToolbar:function(){var B=tinyMCE.activeEditor;var A=B.controlManager;var D=$(B.id+"_toolbar3");if(D){if(this._hidden){tinymce.DOM.show(B.id+"_toolbar3");var E=D.parentNode;if(tinymce.isIE){E.style.height=B.settings.default_height+"px"}else{E.style.height=(B.settings.default_height-1)+"px"}tinymce.DOM.show(B.id+"_toolbar3");this._hidden=false;var C=new jive.ext.y.ySlider(300,this.settings);C.addTicker(new jive.ext.y.SlideBottomToTicker(E,31));C.go()}}},_hideToolbar:function(){var B=tinyMCE.activeEditor;var A=B.controlManager;var D=$(B.id+"_toolbar3");if(D){if(!this._hidden){var E=D.parentNode;if(tinymce.isIE){E.style.height=B.settings.default_height+"px"}else{E.style.height=(B.settings.default_height-1)+"px"}tinymce.DOM.hide(B.id+"_toolbar3");this._hidden=true;var C=new jive.ext.y.ySlider(300,this.settings);C.addTicker(new jive.ext.y.SlideBottomToTicker(E,0));C.go()}}},_resizeIframe:function(B,A){var C=B.getContentAreaContainer().firstChild;tinymce.DOM.setStyle(C,"height",C.clientHeight+A);B.theme.deltaHeight+=A},createControl:function(C,A){switch(C){case"tabletoolbar":var B=A.createButton("tabletoolbar",{title:"tabletoolbar.title",cmd:"mceInsertTable",ui:true,value:{action:"insert"}});return B}return null},getInfo:function(){return{longname:"Table Toolbar Button",author:"Adam Wulf",authorurl:"http://www.jivesoftware.com",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("tabletoolbar",tinymce.plugins.TableToolbarPlugin)})();

tinyMCE.addI18n("en.tabletoolbar",{title:"Insert Table"});

(function(){tinymce.create("tinymce.plugins.MediaToolbarPlugin",{init:function(A,B){var C=this;A.addCommand("mceHideMediaToolbar",function(){var D=this.controlManager;if(!tinymce.DOM.isHidden(A.id+"_toolbar2")){tinymce.DOM.hide(A.id+"_toolbar2");C._resizeIframe(A,28)}D.setActive("mediatoolbar",false)});A.addCommand("mceToggleMediaToolbar",function(){var D=this.controlManager;A.execCommand("mceHideTableToolbar");A.execCommand("mceHideExtraToolbar");if(!tinymce.DOM.isHidden(A.id+"_toolbar2")){A.execCommand("mceHideMediaToolbar")}else{D.setActive("mediatoolbar",true);tinymce.DOM.show(A.id+"_toolbar2");C._resizeIframe(A,-28)}});A.onPostRender.add(function(){tinymce.DOM.hide(A.id+"_toolbar2");C._resizeIframe(A,28)});this.that=this},_resizeIframe:function(B,A){var C=B.getContentAreaContainer().firstChild;tinymce.DOM.setStyle(C,"height",C.clientHeight+A);B.theme.deltaHeight+=A},createControl:function(C,A){switch(C){case"mediatoolbar":var B=A.createButton("mediatoolbar",{title:"Media Toolbar",cmd:"mceToggleMediaToolbar",image:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/mediatoolbar/img/spacer.gif"});return B}return null},getInfo:function(){return{longname:"Media Toolbar Button",author:"Adam Wulf",authorurl:"http://www.jivesoftware.com",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("mediatoolbar",tinymce.plugins.MediaToolbarPlugin)})();

(function(){tinymce.create("tinymce.plugins.ExtraToolbarPlugin",{init:function(A,B){var C=this;A.addCommand("mceHideExtraToolbar",function(){var D=this.controlManager;if(!tinymce.DOM.isHidden(A.id+"_toolbar3")){tinymce.DOM.hide(A.id+"_toolbar3");C._resizeIframe(A,28)}D.setActive("extratoolbar",false)});A.addCommand("mceToggleExtraToolbar",function(){var D=this.controlManager;A.execCommand("mceHideMediaToolbar");A.execCommand("mceHideTableToolbar");if(!tinymce.DOM.isHidden(A.id+"_toolbar3")){A.execCommand("mceHideExtraToolbar")}else{D.setActive("extratoolbar",true);tinymce.DOM.show(A.id+"_toolbar3");C._resizeIframe(A,-28)}});A.onPostRender.add(function(){tinymce.DOM.hide(A.id+"_toolbar3");C._resizeIframe(A,28)});this.that=this},_resizeIframe:function(B,A){var C=B.getContentAreaContainer().firstChild;tinymce.DOM.setStyle(C,"height",C.clientHeight+A);B.theme.deltaHeight+=A},createControl:function(C,A){switch(C){case"extratoolbar":var B=A.createButton("extratoolbar",{title:"Extra Toolbar",cmd:"mceToggleExtraToolbar",image:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/extratoolbar/img/spacer.gif"});return B}return null},getInfo:function(){return{longname:"Extra Toolbar Button",author:"Adam Wulf",authorurl:"http://www.jivesoftware.com",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("extratoolbar",tinymce.plugins.ExtraToolbarPlugin)})();

(function(){tinymce.PluginManager.requireLangPack("alignment");tinymce.create("tinymce.plugins.AlignmentPlugin",{init:function(A,B){A.addCommand("mceAlignment",function(){var C=this.controlManager;var D=C.get("mysplitbutton");D.showMenu()});A.addCommand("mceNoFloatImage",function(){var C=tinyMCE.activeEditor;var D=C.selection;var F=D.getNode();var E=C.dom;E.setStyle(F,"float","")});A.addCommand("MyJustifyLeft",function(){var C=this.selection.getNode();if(C.style.textAlign=="left"){return }C.style.textAlign="left"});A.addCommand("MyJustifyRight",function(){var C=this.selection.getNode();if(C.style.textAlign=="right"){return }C.style.textAlign="right"});A.addCommand("MyJustifyCenter",function(){var C=this.selection.getNode();if(C.style.textAlign=="center"){return }C.style.textAlign="center"});A.addCommand("MyJustifyFull",function(){var C=this.selection.getNode();if(C.style.textAlign=="justify"){return }C.style.textAlign="justify"});A.onNodeChange.add(function(C){return function(E,D,G){var F=D.get("mysplitbutton");if($def(F)){if(typeof (F.lastClass)!="undefined"&&F.lastClass!=null){F.setState(F.lastClass,false)}if(G.style.textAlign=="right"){F.lastClass="_justifyright";F.lastExec="MyJustifyRight"}else{if(G.style.textAlign=="center"){F.lastClass="_justifycenter";F.lastExec="MyJustifyCenter"}else{if(G.style.textAlign=="justify"){F.lastClass="_justifyfull";F.lastExec="MyJustifyFull"}else{if(G.style.textAlign=="left"){F.lastClass="_justifyleft";F.lastExec="MyJustifyLeft"}else{F.lastClass="_justifyleft";F.lastExec="MyJustifyLeft"}}}}if(F.lastClass!=null){F.setState(F.lastClass,true)}}}}(this));this.url=B;this.that=this},createControl:function(C,A){switch(C){case"alignment":var B=A.createSplitButton("mysplitbutton",{title:"Alignment",cmd:"mceAlignment"});B.onRenderMenu.add(function(E,D){D.add({cmd:"MyJustifyLeft","class":"mceSplitButton_justifyleft",title:"alignament.left"})});B.onRenderMenu.add(function(E,D){D.add({cmd:"MyJustifyCenter","class":"mceSplitButton_justifycenter",title:"alignment.center"})});B.onRenderMenu.add(function(E,D){D.add({cmd:"MyJustifyRight","class":"mceSplitButton_justifyright",title:"alignment.right"})});B.onRenderMenu.add(function(E,D){D.add({cmd:"MyJustifyFull","class":"mceSplitButton_justifyfull",title:"alignment.full"})});return B}return null},getInfo:function(){return{longname:"Fancy Justify Button",author:"Adam Wulf",authorurl:"http://www.jivesoftware.com",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("alignment",tinymce.plugins.AlignmentPlugin)})();

(function(){var A=tinymce.dom.Event,D=tinymce.grep,E=tinymce.each,C=tinymce.inArray,B=tinymce.isOldWebKit;tinymce.create("tinymce.plugins.Safari",{init:function(F){var G=this,H;if(!tinymce.isWebKit){return }G.editor=F;G.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];G.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];G.namedFontSizes=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];F.onPaste.add(function(I,K){function J(L){L=L.target;if(L.nodeType==1){L.style.cssText="";E(I.dom.select("*",L),function(M){M.style.cssText=""})}}A.add(I.getDoc(),"DOMNodeInserted",J);window.setTimeout(function(){A.remove(I.getDoc(),"DOMNodeInserted",J)},0)});F.onKeyUp.add(function(J,L){var K,I;if(L.keyCode==46||L.keyCode==8){I=J.getBody();K=I.innerHTML;if(I.childNodes.length==1&&!/<(img|hr)/.test(K)&&tinymce.trim(K.replace(/<[^>]+>/g,"")).length==0){J.setContent("",{format:"raw"})}}});F.addCommand("FormatBlock",function(J,I){var L=F.dom,K=L.getParent(F.selection.getNode(),L.isBlock);if(K){L.replace(L.create(I),K,1)}else{F.getDoc().execCommand("FormatBlock",false,I)}});F.addCommand("mceInsertContent",function(J,I){F.getDoc().execCommand("InsertText",false,"mce_marker");F.getBody().innerHTML=F.getBody().innerHTML.replace(/mce_marker/g,I+'<span id="_mce_tmp">XX</span>');F.selection.select(F.dom.get("_mce_tmp"));F.getDoc().execCommand("Delete",false," ")});F.onKeyPress.add(function(I,J){if(J.keyCode==13&&(J.shiftKey||I.settings.force_br_newlines&&I.selection.getNode().nodeName!="LI")){G._insertBR(I);A.cancel(J)}});F.addQueryValueHandler("FontSize",function(K,I){var L,I,J;if((L=F.dom.getParent(F.selection.getStart(),"span"))&&(I=L.style.fontSize)){J=tinymce.inArray(G.namedFontSizes,I)+1;return J}if((L=F.dom.getParent(F.selection.getEnd(),"span"))&&(I=L.style.fontSize)){J=tinymce.inArray(G.namedFontSizes,I)+1;return J}J=F.getDoc().queryCommandValue("FontSize");return J});F.addQueryValueHandler("FontName",function(J,I){var K,I;if((K=F.dom.getParent(F.selection.getStart(),"span"))&&(I=K.style.fontFamily)){return I.replace(/, /g,",")}if((K=F.dom.getParent(F.selection.getEnd(),"span"))&&(I=K.style.fontFamily)){return I.replace(/, /g,",")}return F.getDoc().queryCommandValue("FontName")});F.onClick.add(function(I,J){J=J.target;if(J.nodeName=="IMG"){G.selElm=J;I.selection.select(J)}else{G.selElm=null}});F.onInit.add(function(){G._fixWebKitSpans();if(B){G._patchSafari2x(F)}});F.onSetContent.add(function(){H=F.dom;E(["strong","b","em","u","strike","sub","sup","a"],function(I){E(D(H.select(I)).reverse(),function(L){var K=L.nodeName.toLowerCase(),J;if(K=="a"){if(L.name){H.replace(H.create("img",{mce_name:"a",name:L.name,"class":"mceItemAnchor"}),L)}return }switch(K){case"b":case"strong":if(K=="b"){K="strong"}J="font-weight: bold;";break;case"em":J="font-style: italic;";break;case"u":J="text-decoration: underline;";break;case"sub":J="vertical-align: sub;";break;case"sup":J="vertical-align: super;";break;case"strike":J="text-decoration: line-through;";break}H.replace(H.create("span",{mce_name:K,style:J,"class":"Apple-style-span"}),L,1)})})});F.onPreProcess.add(function(I,J){H=I.dom;E(D(J.node.getElementsByTagName("span")).reverse(),function(M){var K,L;if(J.get){if(H.hasClass(M,"Apple-style-span")){L=M.style.backgroundColor;switch(H.getAttrib(M,"mce_name")){case"font":if(!I.settings.convert_fonts_to_spans){H.setAttrib(M,"style","")}break;case"strong":case"em":case"sub":case"sup":H.setAttrib(M,"style","");break;case"strike":case"u":if(!I.settings.inline_styles){H.setAttrib(M,"style","")}else{H.setAttrib(M,"mce_name","")}break;default:if(!I.settings.inline_styles){H.setAttrib(M,"style","")}}if(L){M.style.backgroundColor=L}}}if(H.hasClass(M,"mceItemRemoved")){H.remove(M,1)}})});F.onPostProcess.add(function(I,J){J.content=J.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,"</$1>");J.content=J.content.replace(/ id=\"undefined\"/g,"")})},getInfo:function(){return{longname:"Safari compatibility",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_fixWebKitSpans:function(){var G=this,F=G.editor;if(!B){A.add(F.getDoc(),"DOMNodeInserted",function(H){H=H.target;if(H&&H.nodeType==1){G._fixAppleSpan(H)}})}else{F.onExecCommand.add(function(){E(F.dom.select("span"),function(H){G._fixAppleSpan(H)});F.nodeChanged()})}},_fixAppleSpan:function(L){var G=this.editor,M=G.dom,I=this.webKitFontSizes,F=this.namedFontSizes,J=G.settings,H,K;if(M.getAttrib(L,"mce_fixed")){return }if(L.nodeName=="SPAN"&&L.className=="Apple-style-span"){H=L.style;if(!J.convert_fonts_to_spans){if(H.fontSize){M.setAttrib(L,"mce_name","font");M.setAttrib(L,"size",C(I,H.fontSize)+1)}if(H.fontFamily){M.setAttrib(L,"mce_name","font");M.setAttrib(L,"face",H.fontFamily)}if(H.color){M.setAttrib(L,"mce_name","font");M.setAttrib(L,"color",M.toHex(H.color))}if(H.backgroundColor){M.setAttrib(L,"mce_name","font");M.setStyle(L,"background-color",H.backgroundColor)}}else{if(H.fontSize){M.setStyle(L,"fontSize",F[C(I,H.fontSize)])}}if(H.fontWeight=="bold"){M.setAttrib(L,"mce_name","strong")}if(H.fontStyle=="italic"){M.setAttrib(L,"mce_name","em")}if(H.textDecoration=="underline"){M.setAttrib(L,"mce_name","u")}if(H.textDecoration=="line-through"){M.setAttrib(L,"mce_name","strike")}if(H.verticalAlign=="super"){M.setAttrib(L,"mce_name","sup")}if(H.verticalAlign=="sub"){M.setAttrib(L,"mce_name","sub")}M.setAttrib(L,"mce_fixed","1")}},_patchSafari2x:function(G){var H=this,I,K,J=G.dom,F;if(G.windowManager.onBeforeOpen){G.windowManager.onBeforeOpen.add(function(){r=G.selection.getRng()})}G.selection.select=function(L){this.getSel().setBaseAndExtent(L,0,L,1)};K=G.selection.getNode;G.selection.getNode=function(){return H.selElm||K.call(this)};G.selection.getRng=function(){var M=this,N=M.getSel(),S=G.getDoc(),P,Q,R,O;if(N.anchorNode){P=S.createRange();try{Q=S.createRange();Q.setStart(N.anchorNode,N.anchorOffset);Q.collapse(1);R=S.createRange();R.setStart(N.focusNode,N.focusOffset);R.collapse(1);O=Q.compareBoundaryPoints(Q.START_TO_END,R)<0;P.setStart(O?N.anchorNode:N.focusNode,O?N.anchorOffset:N.focusOffset);P.setEnd(O?N.focusNode:N.anchorNode,O?N.focusOffset:N.anchorOffset);F=P}catch(L){}}return P||F};I=G.selection.setContent;G.selection.setContent=function(O,N){var P=this.getRng(),L;try{I.call(this,O,N)}catch(M){L=J.create("body");L.innerHTML=O;E(L.childNodes,function(Q){P.insertNode(Q.cloneNode(true))})}}},_insertBR:function(F){var J=F.dom,H=F.selection,I=H.getRng(),G;I.insertNode(G=J.create("br"));I.setStartAfter(G);I.setEndAfter(G);H.setRng(I);if(H.getSel().focusNode==G.previousSibling){H.select(J.insertAfter(J.doc.createTextNode("\u00a0"),G));H.collapse(1)}F.getWin().scrollTo(0,J.getPos(H.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})();

(function(){var A=tinymce.util.JSONRequest,C=tinymce.each,B=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com