/*  JS Resource: lib/i2rd-util.js  */

if(typeof __i2rd_initted=='undefined'){__i2rd_initted=true;if(typeof Array.prototype.push=='undefined'){Array.prototype.push=function(i){if(i){this[this.length]=i;}};}
if(typeof Array.prototype.pop=='undefined'){Array.prototype.pop=function(){if(this.length==0){return;}
var i,n=this.length -1;i=this[n];delete this[n];this.length=n;return i;};}
Array.prototype.pushAll=function(list){for(var h=0,hb=list.length;h<hb;h++){this.push(list[h]);}};if(typeof String.prototype.trim=='undefined'){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};}
if(typeof __i2rd_domupdate_event=='undefined'){__i2rd_domupdate_event="i2rd:domupdate";__i2rd_domupdate_handlers=[];__i2rd_domupdate_fire=function(element,evt){var i,h,args=[];if(evt){args.push(evt);}
for(i=0;(h=__i2rd_domupdate_handlers[i]);i++){try{h.apply(element,args);}catch(e){}}};}
var log4js={};log4js.logger={};log4js.logger.log=function(msg){if(typeof console!='undefined'&&console.log)console.log(msg);};log4js.logger.debug=log4js.logger.info=log4js.logger.warn=log4js.logger.error=log4js.logger.log;if(typeof i2rd=='undefined'){window.i2rd={};}
i2rd.isIE=!+'\v1';i2rd.getConfigMap=function(el){if(typeof el=='string')
el=document.getElementById(el);if(!el)return{};var e=el.childNodes,b={};for(var n=0,mx=e.length;n<mx;n++)b[e[n].className]=e[n].innerHTML;return b;};i2rd.xmlToString=function(xml){var str='';if(typeof xml!='string'){var i,ib;if(xml.xml){for(i=0,ib=xml.childNodes.length;i<ib;i++){str+=xml.childNodes[i].xml;}}else{var xs=new XMLSerializer();for(i=0,ib=xml.childNodes.length;i<ib;i++){str+=xs.serializeToString(xml.childNodes[i]);}}}else{str=xml;}
return str;};i2rd.scriptRX=new RegExp('<script[^>]*>([\\S\\s]*?)<\/script>','gim');i2rd.stripScripts=function(html){return{html:html.replace(i2rd.scriptRX,''),scripts:(function(){var m=[],i,arr;while((arr=i2rd.scriptRX.exec(html))){if(arr[1]){m[m.length]=arr[1].replace(/^\s*<!\[CDATA\[/,'').replace(/\]\]>\s*$/,'');}}
return m;})()};};i2rd.createElement=function(tag){var ns,de=document.documentElement;ns=(de?de.namespaceURI:false);if(ns){return document.createElementNS(ns,tag);}
else{return document.createElement(tag);}};i2rd.getBody=function(w){var doc=(w||window).document;return(doc.body||doc.getElementsByTagName("body")[0]);};i2rd.getElementsByTagName=function(tn,start){start=start||document;var r=[],els=start.getElementsByTagName(tn);if(!els||els.length==0){els=start.getElementsByTagName(tn.toUpperCase());}
r.pushAll(els);return r;};i2rd.addEvent=function(el,type,handler){if(type==__i2rd_domupdate_event){__i2rd_domupdate_handlers.push(handler);}else if(el.addEventListener){el.addEventListener(type,handler,false);}else{if(!handler.$$guid){handler.$$guid=i2rd.addEvent_guid++;}
if(!el.events){el.events={};}
var handlers=el.events[type];if(!handlers){handlers=el.events[type]={};if(el["on" +type]){handlers[0]=el["on" +type];}}
handlers[handler.$$guid]=handler;el["on" +type]=i2rd.handleEvent;}};i2rd.removeEvent=function(el,type,handler){if(type==__i2rd_domupdate_event){var hl=[];for(i=0;(h=__i2rd_domupdate_handlers[i]);i++){if(h!==handler){hl.push(h);}}
__i2rd_domupdate_handlers=hl;}else if(el.removeEventListener){el.removeEventListener(type,handler,false);}else{if(el.events&&el.events[type]){delete el.events[type][handler.$$guid];}}};i2rd.addEvent_guid=1;i2rd.handleEvent=function(event){var i,hl,rv=true;event=event||i2rd.fixEvent(((this.ownerDocument||this.document||this).parentWindow||window).event);hl=this.events[event.type];for(i in hl){this.$$handleEvent=hl[i];if(this.$$handleEvent(event)==false){rv=false;}}
return rv;};i2rd.fixEvent=function(event){event.preventDefault=i2rd.fixEvent_preventDefault;event.stopPropagation=i2rd.fixEvent_stopPropagation;return event;};i2rd.fixEvent_preventDefault=function(){this.returnValue=false;};i2rd.fixEvent_stopPropagation=function(){this.cancelBubble=true;};i2rd.getAjaxTransport=function(){try{return new XMLHttpRequest();}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
return null;};i2rd.bind=function(m,caller){var args=[],_m=m,obj=caller;if(arguments&&arguments.length>2){for(var i=2;i<arguments.length;i++){args[i -2]=arguments[i];}}
return function(){for(var i=0;i<arguments.length;i++){args[args.length]=arguments[i];}
_m.apply(obj,args);};};i2rd.bindAsEventListener=function(m,caller){var args=[],_m=m,obj=caller;if(arguments&&arguments.length>2){for(var i=2;i<arguments.length;i++){args[i -2]=arguments[i];}}
return function(evt){for(var i=0;i<arguments.length;i++){args[args.length]=arguments[i];}
_m.apply(obj,[evt||window.event].concat(args));};};i2rd.eventElement=function(evt){var e=evt||window.event;return(e.target||e.srcElement);};i2rd.getInnerText=function(el){if(typeof el=="string"){return el;}
var cn,i,str="",children=el.childNodes;for(i=0;(cn=children[i]);i++){switch(cn.nodeType){case 1:str +=i2rd.getInnerText(cn);break;case 3:case 4:str +=cn.nodeValue;break;}}
return str;};i2rd.mousex=0;i2rd.mousey=0;i2rd.mousetrack=false;i2rd.updateLoc=function(evt){var x=0,y=0;if(evt.pageX){x=evt.pageX;y=evt.pageY;}else if(evt.clientX){var de=document.documentElement;x=evt.clientX +de.scrollLeft;y=evt.clientY +de.scrollTop;}else{x=evt.screenX;y=evt.screenY;}
i2rd.mousex=x;i2rd.mousey=y;};i2rd.getMouseCoord=function(evt){if(!i2rd.mousetrack){i2rd.mousetrack=true;if((evt=evt||window.event)){i2rd.updateLoc(evt);}
i2rd.addEvent(document,'mousemove',i2rd.updateLoc);setTimeout(function(){i2rd.mousetrack=false;i2rd.removeEvent(document,'mousemove',i2rd.updateLoc);},120000);}
return{x:i2rd.mousex,y:i2rd.mousey};};i2rd.addClassName=function(el,cn){var cn=cn.trim();if(!i2rd.hasClassName(el,cn))
el.className=((el.className||'') +' ' +cn).trim();};i2rd.removeClassName=function(el,cn){if(!i2rd.hasClassName(el,cn))return;el.className=(el.className||'').replace(RegExp("(^|\\s+)" +cn.trim() +"(\\s+|$)",'g'),' ').trim();};i2rd.hasClassName=function(el,cn){var cur=(el.className||'');return cur==cn||(RegExp('\\b'+cn+'\\b').test(cur));};i2rd.getCookie=function(name){var p,b,dc=document.cookie;if(!dc){return null;}
p=name+"=";b=dc.indexOf("; "+p);if(b==-1){b=dc.indexOf(p);if(b!=0){return null;}}else{b+=2;}
var e=document.cookie.indexOf(";",b);if(e==-1){e=dc.length;}
return unescape(dc.substring(b+p.length,e));};i2rd.setCookie=function(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");};i2rd.deleteCookie=function(name,path,domain){document.cookie=name+"; expires=Thu, 01-Jan-1970 00:00:01 GMT"+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"");};i2rd.lastFocus=null;i2rd.focusListener=function(evt){var el,lf=i2rd.lastFocus;if(lf){lf.className=lf.className.replace("focused","");}
evt=evt||window.event;el=evt.target||evt.srcElement;i2rd.lastFocus=el;el.className=el.className+" focused";};i2rd.owfDefault={menubar:false,location:false,toolbar:false,scrollbars:true,statusbar:false};i2rd.openWindow=function(url,name,dim,features,pbMesg,evt){name=name||'_blank';features=features||i2rd.owfDefault;pbMesg=pbMesg||'Please disable any popup blockers for this site.';var fstr='';for(var key in features){var val=i2rd.getOWFeature(features,key);if(val!=null){fstr +=','+key+'='+(val?'yes':'no');}}
if(dim){if(dim.x&&dim.x>0){dim.x+=30;fstr+=',width='+dim.x;}
if(dim.y&&dim.y>0){dim.y+=50;fstr+=',height='+dim.y;}}
if(fstr.length>0){fstr=fstr.substring(1);}
var nw=window.open(url,name,fstr);if(name!='_top'&&name!='_parent'&&name!='_self'){if(nw.opener!=window){alert(pbMesg);}}
try{nw.focus();if(dim&&dim.x&&dim.y){if(dim.x>0&&dim.y>0){nw.resizeTo(dim.x,dim.y);}}}catch(e){}
evt=evt||window.event;if(evt){if(evt.preventDefault){evt.preventDefault();}
else{evt.canceBubble=true;}}
return false;};i2rd.getOWFeature=function(m,prop){var val=m[prop];if(typeof val=='undefined'||val==null){return null;}
else{return!!val;}};i2rd.each=function(array,fn,filter){var ct=0,all=(typeof filter!=='function');for(var i=0,mx=array.length;i<mx;i++){var el=array[i];if(all||filter.call(el,i,el,ct)){fn.call(el,i,el,ct++);}}};i2rd.addEvent(window,'load',function(){var i1,i2,fe1,f,el,fl=document.forms;if(typeof fl=='undefined'){return;}
for(f=null,i1=0;(f=fl[i1]);i1++){el=f.elements;for(fe1=null,i2=0;(fe1=el[i2]);i2++){if(fe1.type=='hidden'){continue;}
i2rd.addEvent(fe1,'focus',i2rd.focusListener);if(fe1.type&&fe1.className&&fe1.type.match(/select.*/i)&&fe1.className.match(/.*autosubmitselect.*/i)){fe1.onchange=function(evt){this.form.submit();};}}}});}
/*  JS Resource: cms/js/bean/MenuBean.js  */

if(typeof MB=='undefined'){var MB={};}
MB.lastEventTime=new Date();MB.getTarget=function(evt){evt=evt||window.event;var el=(evt.srcElement||evt.target);while(el&&el.nodeName.toLowerCase()!="li")
el=el.parentNode;return el;};MB.getTop=function(li){var parent=li;while(parent&&parent.className!='menubean'&&parent.nodeName.toLowerCase()!='div'){parent=parent.parentNode;}
if(parent==null)
throw new Error("Unable to find top of menu");return parent;};MB.GetChildUL=function(li){if(!li.className.match("mi_parent"))return null;var h,ul,hb,t;var children=li.getElementsByTagName("ul");if(!children||children.length==0){children=li.getElementsByTagName("UL");}
for(h=0,hb=children.length;(t=children[h]);h++){if(t.parentNode===li){if(ul){log4js.logger.error("Invalid DOM structure for menu. li.id = "+li.id+", children.length = " +(children==null?"null":children.length));break;}else{ul=t;}}}
return ul;};MB.SetInactiveClass=function(el){var elements=el.getElementsByTagName("li");if(!elements||elements.length==0){try{elements=el.getElementsByTagName("LI");}catch(e){}}
var liElements=[];liElements.pushAll(elements);var node=null;while((node=liElements.pop())){node.className=node.className.replace("mi_active","");node.className=node.className.replace("mi_inactive","");node.className +=" mi_inactive";}};MB.SetActive=function(li,activate){if(!li.className.match(/over/)){li.className +=" over";var ul=MB.GetChildUL(li);if(ul&&ul.className.match("_persistent")){var nodelist=MB.GetOpenState(li);var entry="," +li.id;if(nodelist.indexOf(entry)== -1){nodelist +=entry;}
MB.SetOpenState(li,nodelist)}}
if(activate){var top=MB.getTop(li);MB.SetInactiveClass(top);if(!li.className.match(/mi_active/)){li.className=li.className.replace("mi_inactive","");li.className +=" mi_active";}}
if(li.previousSibling&&!li.previousSibling.className.match(/prev_sibling/)){li.previousSibling.className+=" prev_sibling";}
if(li.nextSibling&&!li.nextSibling.className.match(/next_sibling/)){li.nextSibling.className+=" next_sibling";}};MB.SetInActive=function(li){if(!li.className.match(/over/))
return;li.className=li.className.replace("over","");var ul=MB.GetChildUL(li);if(ul&&ul.className.match("_persistent")){var nodelist=MB.GetOpenState(li);nodelist=nodelist.replace("," +li.id,"");MB.SetOpenState(li,nodelist);}
var prev=li.previousSibling;if(prev){prev.className=prev.className.replace(/ prev_sibling/g,"");}
var next=li.nextSibling;if(next){next.className=next.className.replace(/ next_sibling/g,"");}};MB.GetOpenState=function(li){var nodelist=i2rd.getCookie(MB.getTop(li).id +"-CMO");if(!nodelist)nodelist="";return nodelist;};MB.SetOpenState=function(li,nodelist){var time=new Date();time.setMonth(time.getMonth() +1);i2rd.setCookie(MB.getTop(li).id +"-CMO",nodelist,time,"/");};MB.MenuBeanInit=function(div){if(typeof div=='string')div=document.getElementById(div);if(!!div.mbinited)return;div.mbinited=true;var nodelist=i2rd.getCookie(div.id +"-CMO")||"";var item=null;var elements=div.getElementsByTagName("li");if(!elements||elements.length==0){try{elements=div.getElementsByTagName("LI");}catch(e){}}
var liElements=[];liElements.pushAll(elements);while((item=liElements.pop())){var pn=item.parentNode;if(pn&&pn.nodeName.toLowerCase()=="ul"){pn=pn.parentNode;if(pn&&pn.nodeName.toLowerCase()=="li"&&pn.className&&!pn.className.match("mi_parent")){pn.className +=" mi_parent";}}
item.onclick=function(evt){var now=new Date();if((now -MB.lastEventTime)<200)return;MB.lastEventTime=new Date();var target=MB.getTarget(evt);if(target.className.match(/over/)){MB.SetInActive(target,true);}
else{MB.SetActive(target);}};if(!item.parentNode.className.match(/persistent/)){item.onmouseover=function(evt){try{MB.SetActive(this);}catch(e){}};item.onmouseout=function(evt){try{MB.SetInActive(this);}catch(e){}};}else{var tmpId="," +item.id;if(nodelist.indexOf(tmpId)== -1){MB.SetInActive(item);}}}
if(document.getElementById){var liList=nodelist.split(",");for(var h=0;h<liList.length;h++){var id=liList[h];if(id){var li=document.getElementById(id);if(li){MB.SetActive(li);}}}}};MB.scan=function(start){if(typeof start=='string')start=document.getElementById(start);var m,div,s=(start||document),i,ib;if(document.evalute){var result=document.evaluate("//div[contains(@class,'menubean')]",s,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(i=0,ib=result.snapshotLength;i<ib;i++){m[m.length]=result.snapshotItem(i);}}else{m=s.getElementsByTagName("div");}
for(i=0,ib=m.length;i<ib;i++){div=m[i];if((div.className||'').match(/menubean/))
MB.MenuBeanInit(div);}};
/*  JS Resource: lib/sizzle.js  */

/*!
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString,hasDuplicate=false;var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}
if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,check,mode,extra,prune=true,contextXML=isXML(context);chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0] +parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector +=parts.shift();set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length -1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}
if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: " +(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}
return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}
return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length -1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: " +expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!/\W/.test(part)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" " +match[1].replace(/\\/g,"") +" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" " +elem.className +" ").indexOf(match)>=0)){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+" +match[2]||match[2]);match[2]=(test[1] +(test[2]||1)) -0;match[3]=test[3] -0;}
match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" " +match[4] +" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(chunker.exec(match[3]).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length -1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3] -0;},gt:function(elem,i,match){return i>match[3] -0;},nth:function(elem,i,match){return match[3] -0==i;},eq:function(elem,i,match){return match[3] -0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1)return false;}
if(type=='first')return true;node=elem;case'last':while((node=node.nextSibling)){if(node.nodeType===1)return false;}
return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex= ++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex -last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" " +(elem.className||elem.getAttribute("class")) +" ").indexOf(match)> -1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result +"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" " +value +" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length -check.length)===check:type==="|="?value===check||value.substr(0,check.length +1)===check +"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source +/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes,0);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true;}
return 0;}
var ret=a.compareDocumentPosition(b)&4? -1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true;}
return 0;}
var ret=a.sourceIndex -b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true;}
return 0;}
var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
return ret;};}
(function(){var form=document.createElement("div"),id="script" +(new Date).getTime();form.innerHTML="<a name='" +id +"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}
div=null;})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}
div=null;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&elem.ownerDocument.documentElement.nodeName!=="HTML";};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later +=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector +"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};window.Sizzle=Sizzle;})();
/*  JS Resource: lib/i2rd-selectors.js  */

if(typeof __i2rd_selectors=='undefined'){__i2rd_selectors=true;if(typeof i2rd=='undefined'){window.i2rd={};}
i2rd.getElements=function(selector,context){return Sizzle(selector,context);};}
/*  JS Resource: lib/logger.js  */

if(typeof log4jsdefined=='undefined'){i2rd.hasConsole=function(){return(typeof console!='undefined'&&typeof console.info!='undefined');};log4jsdefined=true;var log4js={};log4js.funcname=function(f){var s,v=/function (\w*)/.exec(f.toString());if(v&&v.length>1){s=v[1];}
if(!s||(s.length==0)){return"anonymous";}
return s;};log4js.stacktrace=function(){try{var ac,s="";for(ac=arguments.callee;!!ac;ac=ac.caller){if(ac==log4js.stacktrace||ac==log4js.logger.log){continue;}
s +=log4js.funcname(ac) +"\n";if(ac.caller==ac){break;}}
return s;}catch(ee){alert("Unable to get stack trace. " +ee.message +"\n" +ee.stack);}};log4js.LogEvent=function(logLevel,message,exceptionName,exceptionMessage,stackTrace){this.logLevel=logLevel;this.message=message;this.exceptionName=exceptionName;this.exceptionMessage=exceptionMessage;this.stackTrace=stackTrace;};log4js.LogEvent.prototype={encodeParam:function(queueId){var b="&loglevel."+queueId+"="+this.logLevel+"&message."+queueId+"="+encodeURIComponent(this.message);if(this.exceptionName){b+="&exceptionname."+queueId+"="+encodeURIComponent(this.exceptionName);}
if(this.exceptionMessage){b+="&exceptionmessage."+queueId+"="+encodeURIComponent(this.exceptionMessage);}
if(this.stackTrace){b+="&exceptionstacktrace."+queueId+"="+encodeURIComponent(this.stackTrace);}
return b;}};log4js.LogLevel={};log4js.LogLevel.FATAL="FATAL";log4js.LogLevel.ERROR="ERROR";log4js.LogLevel.WARN="WARN";log4js.LogLevel.INFO="INFO";log4js.LogLevel.DEBUG="DEBUG";log4js.__Logger=function(){this.ajaxSync=false;this.logTarget=window.location||document.location||document.URL;this.internalError=false;this.currentLevel= -1;this.timeout=null;this.lastlog=new Date();var level=i2rd.getCookie("loglevel");if(level){this.currentLevel=this.getLogLevelInt(level);}
var me=this;i2rd.addEvent(window,'unload',function(){me.cleanup();delete me;});};log4js.__Logger.queue=[];log4js.__Logger.prototype={queue:[],cleanup:function(evt){if(this.timeout){window.clearTimeout(this.timeout);}
this.ajaxSync=true;this.flushQueue(true);},getLogLevelInt:function(level){switch(level){case log4js.LogLevel.FATAL:return 50000;case log4js.LogLevel.ERROR:return 40000;case log4js.LogLevel.WARN:return 30000;case log4js.LogLevel.INFO:return 20000;case log4js.LogLevel.DEBUG:return 10000;default:return 20000;}},canLog:function(level){return this.currentLevel<=this.getLogLevelInt(level);},setLogLevel:function(level){this.currentLevel=this.getLogLevelInt(level);var now=new Date();var future=new Date(now.getTime() +(180000));i2rd.setCookie("loglevel",level,future);},setInternalError:function(){this.internalError=true;},isOn:function(){return!this.internalError;},log:function(logLevel,msg,ex){var shouldLog=this.canLog(logLevel);try{if(!msg){return;}
var level=log4js.LogLevel.INFO;if(logLevel){level=logLevel;}
if(!this.isOn()||!shouldLog){return;}
this.lastlog=new Date();var en,em,st;if(ex){if(ex.name){en=ex.name;}
if(ex.message){em=ex.message;}
if(ex.stack){st=ex.stack;}
else{st=log4js.stacktrace();}}
var le=new log4js.LogEvent(logLevel,msg,en,em,st);log4js.__Logger.queue.push(le);if(log4js.__Logger.queue.length>50){this.flushQueue(true);}
else if(!this.timeout){var me=this;this.timeout=window.setTimeout(function(){me.flushQueue();delete me;},1500);}}
catch(e){alert("Logger misconfigured: " +e.message);}},fatal:function(msg,ex){this.log(log4js.LogLevel.FATAL,msg,ex);},error:function(msg,ex){this.log(log4js.LogLevel.ERROR,msg,ex);},warn:function(msg,ex){this.log(log4js.LogLevel.WARN,msg,ex);},info:function(msg,ex){this.log(log4js.LogLevel.INFO,msg,ex);},debug:function(msg,ex){this.log(log4js.LogLevel.DEBUG,msg,ex);},clog:function(msg,ll){if(!i2rd.hasConsole()){return;}
switch(ll){case log4js.LogLevel.FATAL:case log4js.LogLevel.ERROR:console.error(msg);break;case log4js.LogLevel.WARN:console.warn(msg);break;case log4js.LogLevel.INFO:console.info(msg);break;case log4js.LogLevel.DEBUG:default:console.debug(msg);break;}},flushQueue:function(force){this.timeout=null;var size=log4js.__Logger.queue.length;if(size==0){return;}
var now=new Date();if(!force&&(now.getTime() -this.lastlog.getTime())<250){var me=this;this.timeout=window.setTimeout(function(){me.flushQueue();delete me;},500);return;}
var h,b="?log4js.queue_size=" +size;for(h=0;h<size;h++){var qe=log4js.__Logger.queue[h];try{this.clog(qe.message,qe.logLevel);if(qe.exceptionMessage){this.clog(qe.exceptionMessage,qe.logLevel);}
if(qe.stackTrace){this.clog(qe.stackTrace,qe.logLevel);}}catch(e){}
b +=qe.encodeParam(h);}
var ajax=i2rd.getAjaxTransport();if(ajax){if(!this.ajaxSync){ajax.onreadystatechange=log4js.__getReqCallback(ajax,this);}
ajax.open("POST",window.location.href,!this.ajaxSync);ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');ajax.setRequestHeader("Filter-Logging","on");ajax.setRequestHeader("Filter-Logging_Queue_Size",size);ajax.send(b);}
log4js.__Logger.queue.length=0;}};log4js.logger=new log4js.__Logger();log4js.__getReqCallback=function(ajax,log){var req=ajax,logger=log;return function(){if(req.readyState==4){if(req.status==200||req.status==0){if(req.responseText){logger.setLogLevel(req.responseText);}}else{logger.setInternalError();}
try{if(req&&req.onreadystatechange){delete req.onreadystatechange;}}catch(e){}}};};}
/*  JS Resource: cms/js/cms-contentload.js  */

if(typeof cmscl=='undefined'){cmscl=true;if(typeof cms=='undefined'){cms={};}
cms.windowObservers=[];cms.contentObservers=[];cms._WE=cms._CE=null;cms._onWLC=cms._onCLC=false;cms.fireWindowLoadEvent=function(observer){try{observer.call(null,cms._WE);}catch(e){log4js.logger.error("Unable to call observer in cms.fireWindowLoadEvent",e);}};cms.fireContentLoadEvent=function(observer){try{observer.call(null,cms._CE);}catch(e){log4js.logger.error("Unable to call observer in cms.fireContentLoadEvent",e);}};cms.executeOnContentLoadOrAfter=function(observer){if(!observer){return;}
if(cms._onCLC){cms.fireContentLoadEvent(observer);}
else{cms.contentObservers.push(observer);}};cms._onContentLoad=function(evt){if(cms._onCLC){return;}
cms._CE=evt||window.event;cms._onCLC=true;var o;while((o=cms.contentObservers.pop())){cms.fireContentLoadEvent(o);}};cms.executeOnWindowLoadOrAfter=function(observer){if(!observer){return;}
if(cms._onWLC){cms.fireWindowLoadEvent(observer);}
else{cms.windowObservers.push(observer);}};i2rd.addEvent(window,'load',function(evt){cms._WE=evt||window.event;if(!cms._onCLC){log4js.logger.debug("Firing onContentLoad late.");cms._onContentLoad(cms._WE);}
cms._onWLC=true;var o;while((o=cms.windowObservers.pop())){cms.fireWindowLoadEvent(o);}});try{var ua=navigator.userAgent;if(document.addEventListener&&(ua.match(/Firefox/)||ua.match(/SeaMonkey/))){document.addEventListener("DOMContentLoaded",cms._onContentLoad,null);}else if(document.attachEvent&&!window.opera){document.write("<script id=__cmsOnContentLoad defer " +"src='//:'><\/script>");document.getElementById("__cmsOnContentLoad").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;cms._onContentLoad();}};}else{cms._timer=setInterval(function(){var drs=document.readyState;if((drs&&/complete|loaded/.test(drs))||cms._onWLC){clearInterval(cms._timer);delete cms._timer;cms._onContentLoad();}},10);}}catch(e){log4js.logger.error("Unable to setup oncontentload check.",e);}}
/*  JS Resource: cms/js/cms-tabcontainer.js  */

if(typeof cmstabcontainer=='undefined'){cmstabcontainer=true;if(typeof cms=='undefined'){cms={};}
cms.tabcontainers=[];cms.TabContainer=function(containerDiv){this.container=containerDiv;this.tabItemList=[];this.tabs=[];this.tabItemIndexes={};this.doPersistence=!this.container.className.match(/tc_no_persist_selection/)&&!!this.container.id;this.showCallback=i2rd.bindAsEventListener(this.showTab,this);this.mouseOverCallback=i2rd.bindAsEventListener(this.mouseOver,this);this.mouseOutCallback=i2rd.bindAsEventListener(this.mouseOut,this);this.foundUL=false;};cms.TabContainer.prototype={displayFirst:function(){if(this.tabs.length===0){return;}
if(this.tabItemList.length!=this.tabs.length){log4js.logger.error("TabContainer is mismatched." +this.tabItemList.length +" != " +this.tabs.length);}
var i,index=null;if(location.hash.length>1){try{var tid,loc,locations=location.hash.substring(1).split(",");for(i=0;i<locations.length;i++){loc=locations[i];tid=loc.split(":");if(tid[0]==this.container.id){index=this.tabItemIndexes[tid[1]];if(index!=null){this.setActiveTab(index,false);return;}}}}catch(e){log4js.logger.error("Unable to set tab from location hash",e);}}
for(i=0;i<this.tabs.length;i++){if(this.tabs[i].className.match(/tab-selected/)){this.setActiveTab(i,false);return;}
if(this.tabItemList[i].className.match(/tab-selected/)){this.setActiveTab(i,false);return;}}
if(this.doPersistence){index=i2rd.getCookie(this.container.id +"-selectedtab");if(index){try{index=parseInt(index);if(this.tabItemList.length>index){this.setActiveTab(index,false);return;}}catch(e){}}}
this.setActiveTab(0,false);},setActiveTabByID:function(id,persist){this.setActiveTab(this.tabItemIndexes[id],persist);},setActiveTab:function(index,persist){var tabItem=this.tabItemList[index];if(!tabItem)tabItem=this.tabItemList[0];this._show(tabItem,persist);},persistSelection:function(index){if(!this.container.id||this.container.id.length==0)return;var time=new Date();time.setHours(time.getHours() +4);i2rd.setCookie(this.container.id +"-selectedtab",index,time,"/");},addTabItem:function(element){if(element.id){this.tabItemIndexes[element.id]=this.tabItemList.length;var idx=element.id.indexOf("_tab");if(idx!= -1&&idx==element.id.length -4){this.tabItemIndexes[element.id.substring(0,idx)]=this.tabItemList.length;}}
this.tabItemList.push(element);i2rd.addEvent(element,'click',this.showCallback);i2rd.addEvent(element,'mouseover',this.mouseOverCallback);i2rd.addEvent(element,'mouseout',this.mouseOutCallback);},addTab:function(element){this.tabs.push(element);},getEventSource:function(evt,expectedTag){var selected=i2rd.eventElement(evt);while(selected&&selected.tagName&&selected.tagName.toLowerCase()!=expectedTag){selected=selected.parentNode;}
return selected;},showElement:function(el){el.style.display='block';},hideElement:function(el){el.style.display='none';},_show:function(tabItem,persist){var h,t,ti;for(h=0;h<this.tabItemList.length;h++){ti=this.tabItemList[h];t=this.tabs[h];i2rd.removeClassName(ti,"tab-selected");if(ti==tabItem){if(persist)this.persistSelection(h);i2rd.addClassName(ti,"tab-selected");this.showElement(t);}
else this.hideElement(t);}},showTab:function(evt){var selectedTabItem=this.getEventSource(evt,"li");this._show(selectedTabItem,this.doPersistence);return false;},mouseOut:function(evt){for(var h=0;h<this.tabItemList.length;h++){var ti=this.tabItemList[h];i2rd.removeClassName(ti,"over");}},mouseOver:function(evt){this.mouseOut(evt);var overTabItem=this.getEventSource(evt,"li");i2rd.addClassName(overTabItem,"over");},lookupTabItems:function(node){var elements=i2rd.getElementsByTagName("li",node);var li,j;for(j=0;(li=elements[j]);j++){this.addTabItem(li);}},processNode:function(node){var cc=true,ncn=node.className;if(ncn){var nn=node.nodeName.toLowerCase();if(ncn.match(/tab-container/)){return;}else if(!this.foundUL&&nn=="ul"&&ncn.match(/tab-items/)){this.foundUL=true;this.lookupTabItems(node);cc=false;}else if(nn=="div"&&ncn.match(/tab-content/)){this.addTab(node);node.style.display='none';cc=false;}}
if(cc){if(this.foundUL&&this.tabItemList.length<=this.tabs.length){return;}
var children=node.childNodes;var el,h;for(h=0;(el=children[h]);h++){if(el.nodeType!=1){continue;}
this.processNode(el);}}}};cms.initTC=function(div){if(typeof div=='string')div=document.getElementById(div);if(!div){return;}
if(typeof div.tabinited!='undefined'){return;}
div.tabinited=true;var el,tc=new cms.TabContainer(div);cms.tabcontainers.push(tc);var children=div.childNodes;for(var h=0;(el=children[h]);h++){if(el.nodeType!=1){continue;}
tc.processNode(el);}
tc.displayFirst();};cms.checkTCDom=function(start){start=start||i2rd.getBody();var div,list=i2rd.getElements("div.tab-container",start);while((div=list.pop())){cms.initTC(div);}};cms.executeOnContentLoadOrAfter(function(){i2rd.addEvent(window,__i2rd_domupdate_event,cms.checkTCDom);});}
/*  JS Resource: lib/prototype.js  */

__i2rd_fixIELeakImpl=function(nodes){var i,ib,j,jb,n,a,an;for(i=0,ib=nodes.length;i<ib;i++){n=nodes[i];a=$A(n.attributes);for(j=0,jb=a.length;j<jb;j++){an=a[j].name;if((typeof n[an])=='function'){n[an]=null;}}}};__i2rd_fixIELeak=function(domNode,skipRoot){if(!domNode||!(Prototype.Browser.IE&&navigator.userAgent.match(/MSIE [4567]/))){return;}
var m,nodes,i,ib,n,nodeLists=[];nodes=domNode.getElementsByTagName('*');m=parseInt(nodes.length/400) +1;for(i=0;i<m;i++){nodeLists[i]=[];}
for(i=0,ib=nodes.length;i<ib;i++){nodeLists[(i%m)].push(nodes[i]);}
nodes=null;for(i=0;i<m;i++){(function(){var list=nodeLists[i];list.something=i;setTimeout(function(){__i2rd_fixIELeakImpl(list);},((i+1)*350) +500);})();}};if(typeof __i2rd_domupdate_event=='undefined'){__i2rd_domupdate_event="i2rd:domupdate";__i2rd_domupdate_handlers=[];__i2rd_domupdate_fire=function(element,evt){var i,h,args=[];if(evt)args.push(evt);for(i=0;h=__i2rd_domupdate_handlers[i];i++)
try{h.apply(element,args);}catch(e){}}}
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(x){return x}};if(Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions=false;var Class={create:function(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0]))
parent=properties.shift();function klass(){this.initialize.apply(this,arguments);}
Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}
for(var i=0;i<properties.length;i++)
klass.addMethods(properties[i]);if(!klass.prototype.initialize)
klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass;}};Class.Methods={addMethods:function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length)
properties.push("toString","valueOf");for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value,value=Object.extend((function(m){return function(){return ancestor[m].apply(this,arguments)};})(property).wrap(method),{valueOf:function(){return method},toString:function(){return method.toString()}});}
this.prototype[property]=value;}
return this;}};var Abstract={};Object.extend=function(destination,source){for(var property in source)
destination[property]=source[property];return destination;};Object.extend(Object,{inspect:function(object){try{if(Object.isUndefined(object))return'undefined';if(object===null)return'null';return object.inspect?object.inspect():String(object);}catch(e){if(e instanceof RangeError)return'...';throw e;}},toJSON:function(object){var type=typeof object;switch(type){case'undefined':case'function':case'unknown':return;case'boolean':return object.toString();}
if(object===null)return'null';if(object.toJSON)return object.toJSON();if(Object.isElement(object))return;var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(!Object.isUndefined(value))
results.push(property.toJSON() +': ' +value);}
return'{' +results.join(', ') +'}';},toQueryString:function(object){return $H(object).toQueryString();},toHTML:function(object){return object&&object.toHTML?object.toHTML():String.interpret(object);},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);},isElement:function(object){return object&&object.nodeType==1;},isArray:function(object){return object!=null&&typeof object=="object"&&'splice'in object&&'join'in object;},isHash:function(object){return object instanceof Hash;},isFunction:function(object){return typeof object=="function";},isString:function(object){return typeof object=="string";},isNumber:function(object){return typeof object=="number";},isUndefined:function(object){return typeof object=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var names=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return names.length==1&&!names[0]?[]:names;},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}},bindAsEventListener:function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args));}},curry:function(){if(!arguments.length)return this;var __method=this,args=$A(arguments);return function(){return __method.apply(this,args.concat($A(arguments)));}},delay:function(){var __method=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return __method.apply(__method,args);},timeout);},wrap:function(wrapper){var __method=this;return function(){return wrapper.apply(this,[__method.bind(this)].concat($A(arguments)));}},methodize:function(){if(this._methodized)return this._methodized;var __method=this;return this._methodized=function(){return __method.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 returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;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(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,{gsub:function(pattern,replacement){var result='',source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result +=source.slice(0,match.index);result +=String.interpret(replacement(match));source=source.slice(match.index +match[0].length);}else{result +=source,source='';}}
return result;},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0)return match[0];return replacement(match);});},scan:function(pattern,iterator){this.gsub(pattern,iterator);return String(this);},truncate:function(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?'...':truncation;return this.length>length?this.slice(0,length -truncation.length) +truncation: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 matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)});},escapeHTML:function(){var self=arguments.callee;self.text.data=this;return self.div.innerHTML;},unescapeHTML:function(){var div=new Element('div');div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject('',function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):'';},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join('='):pair[0];if(value!=undefined)value=decodeURIComponent(value);if(key in hash){if(!Object.isArray(hash[key]))hash[key]=[hash[key]];hash[key].push(value);}
else hash[key]=value;}
return hash;});},toArray:function(){return this.split('');},succ:function(){return this.slice(0,this.length -1) +
String.fromCharCode(this.charCodeAt(this.length -1) +1);},times:function(count){return count<1?'':new Array(count +1).join(this);},camelize:function(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase() +parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized +=parts[i].charAt(0).toUpperCase() +parts[i].substring(1);return camelized;},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(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:'\\u00' +match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"' +escapedString.replace(/"/g,'\\"') +'"';return"'" +escapedString.replace(/'/g,'\\\'') +"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,'#{1}');},isJSON:function(){var str=this;if(str.blank())return false;str=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);},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(pattern){return this.indexOf(pattern)> -1;},startsWith:function(pattern){return this.indexOf(pattern)===0;},endsWith:function(pattern){var d=this.length -pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;},empty:function(){return this=='';},blank:function(){return/^\s*$/.test(this);},interpolate:function(object,pattern){return new Template(this,pattern).evaluate(object);}});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(replacement){if(Object.isFunction(replacement))return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};};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(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){if(Object.isFunction(object.toTemplateReplacements))
object=object.toTemplateReplacements();return this.template.gsub(this.pattern,function(match){if(object==null)return'';var before=match[1]||'';if(before=='\\')return match[2];var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null)return before;while(match!=null){var comp=match[1].startsWith('[')?match[2].gsub('\\\\]',']'):match[1];ctx=ctx[comp];if(null==ctx||''==match[3])break;expr=expr.substring('['==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);}
return before +String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(iterator,context){var index=0;iterator=iterator.bind(context);try{this._each(function(value){iterator(value,index++);});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var index= -number,slices=[],array=this.toArray();while((index +=number)<array.length)
slices.push(array.slice(index,index+number));return slices.collect(iterator,context);},all:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator(value,index);if(!result)throw $break;});return result;},any:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator(value,index))
throw $break;});return result;},collect:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator,context){iterator=iterator.bind(context);var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(filter,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];if(Object.isString(filter))
filter=new RegExp(filter);this.each(function(value,index){if(filter.match(value))
results.push(iterator(value,index));});return results;},include:function(object){if(Object.isFunction(this.indexOf))
if(this.indexOf(object)!= -1)return true;var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});},inject:function(memo,iterator,context){iterator=iterator.bind(context);this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value>=result)
result=value;});return result;},min:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value<result)
result=value;});return result;},partition:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value){results.push(value[property]);});return results;},reject:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator,context){iterator=iterator.bind(context);return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b? -1:a>b?1:0;}).pluck('value');},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},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(iterable){if(!iterable)return[];if(iterable.toArray)return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;}
if(Prototype.Browser.WebKit){$A=function(iterable){if(!iterable)return[];if(!(Object.isFunction(iterable)&&iterable=='[object NodeList]')&&iterable.toArray)return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;};}
Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},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(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(Object.isArray(value)?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value)))
array.push(value);return array;});},intersect:function(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return'[' +this.map(Object.inspect).join(', ') +']';},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(!Object.isUndefined(value))results.push(value);});return'[' +results.join(', ') +']';}});if(Object.isFunction(Array.prototype.forEach))
Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(item,i){i||(i=0);var length=this.length;if(i<0)i=length +i;for(;i<length;i++)
if(this[i]===item)return i;return -1;};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(item,i){i=isNaN(i)?this.length:(i<0?this.length +i:i) +1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i -n -1;};Array.prototype.toArray=Array.prototype.clone;function $w(string){if(!Object.isString(string))return[];string=string.strip();return string?string.split(/\s+/):[];}
if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++)array.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)
array.push(arguments[i][j]);}else{array.push(arguments[i]);}}
return array;};}
Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this +1;},times:function(iterator){$R(0,this,true).each(iterator);return this;},toPaddedString:function(length,radix){var string=this.toString(radix||10);return'0'.times(length -string.length) +string;},toJSON:function(){return isFinite(this)?this.toString():'null';}});$w('abs round ceil floor').each(function(method){Number.prototype[method]=Math[method].methodize();});function $H(object){return new Hash(object);};var Hash=Class.create(Enumerable,(function(){function toQueryPair(key,value){if(Object.isUndefined(value))return key;return key +'=' +encodeURIComponent(String.interpret(value));}
return{initialize:function(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object);},_each:function(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},set:function(key,value){return this._object[key]=value;},get:function(key){return this._object[key];},unset:function(key){var value=this._object[key];delete this._object[key];return value;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},index:function(value){var match=this.detect(function(pair){return pair.value===value;});return match&&match.key;},merge:function(object){return this.clone().update(object);},update:function(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result;});},toQueryString:function(){return this.map(function(pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=='object'){if(Object.isArray(values))
return values.map(toQueryPair.curry(key)).join('&');}
return toQueryPair(key,values);}).join('&');},inspect:function(){return'#<Hash:{' +this.map(function(pair){return pair.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(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);};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(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:'',evalJSON:true,evalJS:true};Object.extend(this.options,options||{});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,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=='get')
this.url +=(this.url.include('?')?'&':'?') +params;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params +='&_=';}
try{var response=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(response);Ajax.Responders.dispatch('onCreate',this,response);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||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['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)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push))
for(var i=0,length=extras.length;i<length;i +=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){var status=this.getStatus();return!status||(status>=200&&status<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.options['on' +response.status]||this.options['on' +(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON);}catch(e){this.dispatchException(e);}
var contentType=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&this.isSameOrigin()&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
this.evalResponse();}
try{(this.options['on' +state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on' +state,this,response,response.headerJSON);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[0]=='#{protocol}//#{domain}#{port}'.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?':' +location.port:''}));},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null;}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON();}
if(readyState==4){var xml=transport.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||'';}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader('X-JSON');if(!json)return null;json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!='force'&&!(this.getHeader('Content-type')||'').include('application/json'))||this.responseText.blank())
return null;try{return this.responseText.evalJSON(options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=Object.clone(options);var onComplete=options.onComplete;options.onComplete=(function(response,json){this.updateContent(response.responseText);if(Object.isFunction(onComplete))onComplete(response,json);}).bind(this);$super(url,options);},updateContent:function(responseText){var receiver=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)responseText=responseText.stripScripts();if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion);}
else options.insertion(receiver,responseText);}
else receiver.update(responseText);}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;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(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.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 $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(Object.isString(element))
element=document.getElementById(element);return Element.extend(element);}
if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++)
results.push(Element.extend(query.snapshotItem(i)));return results;};}
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 element=this.Element;this.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(Prototype.Browser.IE&&attributes.name){tagName='<' +tagName +' name="' +attributes.name +'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes);}
if(!cache[tagName])cache[tagName]=Element.extend(document.createElement(tagName));return Element.writeAttribute(cache[tagName].cloneNode(false),attributes);};Object.extend(this.Element,element||{});}).call(window);Element.cache={};Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){$(element).style.display='none';return element;},show:function(element){$(element).style.display='';return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:function(element,content){element=$(element);try{__i2rd_fixIELeak(element,true);}catch(e){}
if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();setTimeout(function(){__i2rd_domupdate_fire(element);},10);return element;},replace:function(element,content){element=$(element);try{__i2rd_fixIELeak(element,false);}catch(e){}
if(content&&content.toElement)content=content.toElement();else if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts());}
element.parentNode.replaceChild(content,element);setTimeout(function(){__i2rd_domupdate_fire(element.parentNode);},10);return element;},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML)))
insertions={bottom:insertions};var content,insert,tagName,childNodes;for(var position in insertions){content=insertions[position];position=position.toLowerCase();insert=Element._insertionTranslations[position];if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){insert(element,content);continue;}
content=Object.toHTML(content);tagName=((position=='before'||position=='after')?element.parentNode:element).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=='top'||position=='after')childNodes.reverse();childNodes.each(insert.curry(element));content.evalScripts.bind(content).defer();}
return element;},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper))
$(wrapper).writeAttribute(attributes||{});else if(Object.isString(wrapper))wrapper=new Element(wrapper,attributes);else wrapper=new Element('div',wrapper);if(element.parentNode)
element.parentNode.replaceChild(wrapper,element);wrapper.appendChild(element);return wrapper;},inspect:function(element){element=$(element);var result='<' +element.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||'').toString();if(value)result +=' ' +attribute +'=' +value.inspect(true);});return result +'>';},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property])
if(element.nodeType==1)
elements.push(Element.extend(element));return elements;},ancestors:function(element){return $(element).recursivelyCollect('parentNode');},descendants:function(element){return $(element).select("*");},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1)element=element.nextSibling;return $(element);},immediateDescendants:function(element){if(!(element=$(element).firstChild))return[];while(element&&element.nodeType!=1)element=element.nextSibling;if(element)return[element].concat($(element).nextSiblings());return[];},previousSiblings:function(element){return $(element).recursivelyCollect('previousSibling');},nextSiblings:function(element){return $(element).recursivelyCollect('nextSibling');},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings());},match:function(element,selector){if(Object.isString(selector))
selector=new Selector(selector);return selector.match($(element));},up:function(element,expression,index){element=$(element);if(arguments.length==1)return $(element.parentNode);var ancestors=element.ancestors();return Object.isNumber(expression)?ancestors[expression]:Selector.findElement(ancestors,expression,index);},down:function(element,expression,index){element=$(element);if(arguments.length==1)return element.firstDescendant();return Object.isNumber(expression)?element.descendants()[expression]:element.select(expression)[index||0];},previous:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(element));var previousSiblings=element.previousSiblings();return Object.isNumber(expression)?previousSiblings[expression]:Selector.findElement(previousSiblings,expression,index);},next:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(element));var nextSiblings=element.nextSiblings();return Object.isNumber(expression)?nextSiblings[expression]:Selector.findElement(nextSiblings,expression,index);},select:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args);},adjacent:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element.parentNode,args).without(element);},identify:function(element){element=$(element);var id=element.readAttribute('id'),self=arguments.callee;if(id)return id;do{id='anonymous_element_' +self.counter++}while($(id));element.writeAttribute('id',id);return id;},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name])return t.values[name](element,name);if(t.names[name])name=t.names[name];if(name.include(':')){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value;}}
return element.getAttribute(name);},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=='object')attributes=name;else attributes[name]=Object.isUndefined(value)?true:value;for(var attr in attributes){name=t.names[attr]||attr;value=attributes[attr];if(t.values[attr])name=t.values[attr](element,value);if(value===false||value===null)
element.removeAttribute(name);else if(value===true)
element.setAttribute(name,name);else element.setAttribute(name,value);}
return element;},getHeight:function(element){return $(element).getDimensions().height;},getWidth:function(element){return $(element).getDimensions().width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)" +className +"(\\s|$)").test(elementClassName)));},addClassName:function(element,className){if(!(element=$(element)))return;if(!element.hasClassName(className))
element.className +=(element.className?' ':'') +className;return element;},removeClassName:function(element,className){if(!(element=$(element)))return;element.className=element.className.replace(new RegExp("(^|\\s+)" +className +"(\\s+|$)"),' ').strip();return element;},toggleClassName:function(element,className){if(!(element=$(element)))return;return element[element.hasClassName(className)?'removeClassName':'addClassName'](className);},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue))
element.removeChild(node);node=nextNode;}
return element;},empty:function(element){return $(element).innerHTML.blank();},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);var originalAncestor=ancestor;if(element.compareDocumentPosition)
return(element.compareDocumentPosition(ancestor)&8)===8;if(element.sourceIndex&&!Prototype.Browser.Opera){var e=element.sourceIndex,a=ancestor.sourceIndex,nextAncestor=ancestor.nextSibling;if(!nextAncestor){do{ancestor=ancestor.parentNode;}
while(!(nextAncestor=ancestor.nextSibling)&&ancestor.parentNode);}
if(nextAncestor&&nextAncestor.sourceIndex)
return(e>a&&e<nextAncestor.sourceIndex);}
while(element=element.parentNode)
if(element==originalAncestor)return true;return false;},scrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);style=style=='float'?'cssFloat':style.camelize();var value=element.style[style];if(!value){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}
if(style=='opacity')return value?parseFloat(value):1.0;return value=='auto'?null:value;},getOpacity:function(element){return $(element).getStyle('opacity');},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText +=';' +styles;return styles.include('opacity')?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element;}
for(var property in styles)
if(property=='opacity')element.setOpacity(styles[property]);else
elementStyle[(property=='float'||property=='cssFloat')?(Object.isUndefined(elementStyle.styleFloat)?'cssFloat':'styleFloat'):property]=styles[property];return element;},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;return element;},getDimensions:function(element){element=$(element);var display=Element.getStyle(element,'display');if(display!='none'&&display!=null)
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}
return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}
return element;},makeClipping:function(element){element=$(element);if(element._overflow)return element;element._overflow=Element.getStyle(element,'overflow')||'auto';if(element._overflow!=='hidden')
element.style.overflow='hidden';return element;},undoClipping:function(element){element=$(element);if(!element._overflow)return element;element.style.overflow=element._overflow=='auto'?'':element._overflow;element._overflow=null;return element;},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT +=element.offsetTop||0;valueL +=element.offsetLeft||0;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT +=element.offsetTop||0;valueL +=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p!=='static')break;}}while(element);return Element._returnOffset(valueL,valueT);},absolutize:function(element){element=$(element);if(Element.getStyle(element,'position')=='absolute')return;var offsets=Element.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left -parseFloat(element.style.left||0);element._originalTop=top -parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top +'px';element.style.left=left +'px';element.style.width=width +'px';element.style.height=height +'px';return element;},relativize:function(element){element=$(element);if(Element.getStyle(element,'position')=='relative')return;element.style.position='relative';var top=parseFloat(element.style.top||0) -(element._originalTop||0);var left=parseFloat(element.style.left||0) -(element._originalLeft||0);element.style.top=top +'px';element.style.left=left +'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element;},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT +=element.scrollTop||0;valueL +=element.scrollLeft||0;element=element.parentNode;}while(element);return Element._returnOffset(valueL,valueT);},getOffsetParent:function(element){if(element.offsetParent)return $(element.offsetParent);if(element==document.body)return $(element);while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return $(element);return $(document.body);},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT +=element.offsetTop||0;valueL +=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||element.tagName=='BODY'){valueT -=element.scrollTop||0;valueL -=element.scrollLeft||0;}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT);},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=source.viewportOffset();element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,'position')=='absolute'){parent=element.getOffsetParent();delta=parent.viewportOffset();}
if(parent==document.body){delta[0] -=document.body.offsetLeft;delta[1] -=document.body.offsetTop;}
if(options.setLeft)element.style.left=(p[0] -delta[0] +options.offsetLeft) +'px';if(options.setTop)element.style.top=(p[1] -delta[1] +options.offsetTop) +'px';if(options.setWidth)element.style.width=source.offsetWidth +'px';if(options.setHeight)element.style.height=source.offsetHeight +'px';return element;}};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(proceed,element,style){switch(style){case'left':case'top':case'right':case'bottom':if(proceed(element,'position')==='static')return null;case'height':case'width':if(!Element.visible(element))return null;var dim=parseInt(proceed(element,style),10);if(dim!==element['offset' +style.capitalize()])
return dim +'px';var properties;if(style==='height'){properties=['border-top-width','padding-top','padding-bottom','border-bottom-width'];}
else{properties=['border-left-width','padding-left','padding-right','border-right-width'];}
return properties.inject(dim,function(memo,property){var val=proceed(element,property);return val===null?memo:memo -parseInt(val,10);}) +'px';default:return proceed(element,style);}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(proceed,element,attribute){if(attribute==='title')return element.title;return proceed(element,attribute);});}
else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!=='static')return proceed(element);element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});$w('positionedOffset viewportOffset').each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!=='static')return proceed(element);var offsetParent=element.getOffsetParent();if(offsetParent&&offsetParent.getStyle('position')==='fixed')
offsetParent.setStyle({zoom:1});element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=='float'||style=='cssFloat')?'styleFloat':style.camelize();var value=element.style[style];if(!value&&element.currentStyle)value=element.currentStyle[style];if(style=='opacity'){if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
if(value=='auto'){if((style=='width'||style=='height')&&(element.getStyle('display')!='none'))
return element['offset' +style.capitalize()] +'px';return null;}
return value;};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,'');}
element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=='normal'))
element.style.zoom=1;var filter=element.getStyle('filter'),style=element.style;if(value==1||value===''){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute('filter');return element;}else if(value<0.00001)value=0;style.filter=stripAlpha(filter) +'alpha(opacity=' +(value*100) +')';return element;};Element._attributeTranslations={read:{names:{'class':'className','for':'htmlFor'},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2);},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:"";},_getEv:function(element,attribute){attribute=element.getAttribute(attribute);return attribute?attribute.toString().slice(23, -2):null;},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){return element.title;}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:'cellPadding',cellspacing:'cellSpacing'},Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value;},style:function(element,value){element.style.cssText=value?value:'';}}};Element._attributeTranslations.has={};$w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +'encType maxLength readOnly longDesc').each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);}
else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value;return element;};}
else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;if(value==1)
if(element.tagName=='IMG'&&element.width){element.width++;element.width--;}else try{var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}
return element;};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT +=element.offsetTop||0;valueL +=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);};}
if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(element,content){element=$(element);try{__i2rd_fixIELeak(element,false);}catch(e){}
if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName in Element._insertionTranslations.tags){$A(element.childNodes).each(function(node){element.removeChild(node)});Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node)});}
else element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();setTimeout(function(){__i2rd_domupdate_fire(element);},10);return element;};}
if('outerHTML'in document.createElement('div')){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element;}
content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling)
fragments.each(function(node){parent.insertBefore(node,nextSibling)});else
fragments.each(function(node){parent.appendChild(node)});}
else element.outerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result;};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element('div'),t=Element._insertionTranslations.tags[tagName];if(t){div.innerHTML=t[0] +html +t[1];t[2].times(function(){div=div.firstChild});}else div.innerHTML=html;return $A(div.childNodes);};Element._insertionTranslations={before:function(element,node){element.parentNode.insertBefore(node,element);},top:function(element,node){element.insertBefore(node,element.firstChild);},bottom:function(element,node){element.appendChild(node);},after:function(element,node){element.parentNode.insertBefore(node,element.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(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return node&&node.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 Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||element._extendedByPrototype||element.nodeType!=1||element==window)return element;var methods=Object.clone(Methods),tagName=element.tagName,property,value;if(ByTag[tagName])Object.extend(methods,ByTag[tagName]);for(property in methods){value=methods[property];if(Object.isFunction(value)&&!(property in element))
element[property]=value.methodize();}
element._extendedByPrototype=Prototype.emptyFunction;return element;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated);}}});extend.refresh();return extend;})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute)return element.hasAttribute(attribute);return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){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 tagName=methods;methods=arguments[1];}
if(!tagName)Object.extend(Element.Methods,methods||{});else{if(Object.isArray(tagName))tagName.each(extend);else extend(tagName);}
function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName])
Element.Methods.ByTag[tagName]={};Object.extend(Element.Methods.ByTag[tagName],methods);}
function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value))continue;if(!onlyIfAbsent||!(property in destination))
destination[property]=value.methodize();}}
function findDOMClass(tagName){var klass;var trans={"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(trans[tagName])klass='HTML' +trans[tagName] +'Element';if(window[klass])return window[klass];klass='HTML' +tagName +'Element';if(window[klass])return window[klass];klass='HTML' +tagName.capitalize() +'Element';if(window[klass])return window[klass];window[klass]={};window[klass].prototype=document.createElement(tagName).__proto__;return window[klass];}
if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}
if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass))continue;copy(T[tag],klass.prototype);}}
Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={};};document.viewport={getDimensions:function(){var dimensions={};var B=Prototype.Browser;$w('width height').each(function(d){var D=d.capitalize();dimensions[d]=(B.WebKit&&!document.evaluate)?self['inner' +D]:(B.Opera)?document.body['client' +D]:document.documentElement['client' +D];});return dimensions;},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(expression){this.expression=expression.strip();this.compileMatcher();},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath)return false;var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.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,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}
this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath)return document._getElementsByXPath(this.xpath,root);return this.matcher(root);},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],'');}else{return this.findElements(document).include(element);}}}}
var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break;}}
return match;},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(m){if(m[1]=='*')return'';return"[local-name()='" +m[1].toLowerCase() +"' or local-name()='" +m[1].toUpperCase() +"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m);},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},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(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("(" +v.substring(1,v.length -1) +")");e=e.replace(m[0],'');break;}}}
return"[not(" +exclusion.join(" and ") +")]";},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m);},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m);},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m);},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m) +p['last-of-type'](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(mm=formula.match(/^(\d+)$/))
return'[' +fragment +"= " +mm[1] +']';if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-")mm[1]= -1;var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and " +"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},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(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},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(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase();},className:function(element,matches){return Element.hasClassName(element,matches[1]);},id:function(element,matches){return element.id===matches[1];},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1]);},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return nodeValue&&Selector.operators[matches[2]](nodeValue,matches[5]||matches[6]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)
a.push(node);return a;},mark:function(nodes){var _true=Prototype.emptyFunction;for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=_true;return nodes;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=undefined;return nodes;},index:function(parentNode,reverse,ofType){parentNode._countedByPrototype=Prototype.emptyFunction;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length -1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++)
if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}},unique:function(nodes){if(nodes.length==0)return nodes;var results=[],n;for(var i=0,l=nodes.length;i<l;i++)
if(!(n=nodes[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;results.push(Element.extend(n));}
return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName('*'));return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,child;child=node.childNodes[j];j++)
if(child.nodeType==1&&child.tagName!='!')results.push(child);}
return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next)results.push(next);}
return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,Element.nextSiblings(node));return results;},nextElementSibling:function(node){while(node=node.nextSibling)
if(node.nodeType==1)return node;return null;},previousElementSibling:function(node){while(node=node.previousSibling)
if(node.nodeType==1)return node;return null;},tagName:function(nodes,root,tagName,combinator){var uTagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName(tagName));return results;}else nodes=this[combinator](nodes);if(tagName=="*")return nodes;}
for(var i=0,node;node=nodes[i];i++)
if(node.tagName.toUpperCase()===uTagName)results.push(node);return results;}else return root.getElementsByTagName(tagName);},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!targetNode)return[];if(!nodes&&root==document)return[targetNode];if(nodes){if(combinator){if(combinator=='child'){for(var i=0,node;node=nodes[i];i++)
if(targetNode.parentNode==node)return[targetNode];}else if(combinator=='descendant'){for(var i=0,node;node=nodes[i];i++)
if(Element.descendantOf(targetNode,node))return[targetNode];}else if(combinator=='adjacent'){for(var i=0,node;node=nodes[i];i++)
if(Selector.handlers.previousElementSibling(targetNode)==node)
return[targetNode];}else nodes=h[combinator](nodes);}
for(var i=0,node;node=nodes[i];i++)
if(node==targetNode)return[targetNode];return[];}
return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes)nodes=Selector.handlers.descendant([root]);var needle=' ' +className +' ';for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==className||(' ' +nodeClassName +' ').include(needle))
results.push(node);}
return results;},attrPresence:function(nodes,root,attr,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var results=[];for(var i=0,node;node=nodes[i];i++)
if(Element.hasAttribute(node,attr))results.push(node);return results;},attr:function(nodes,root,attr,value,operator,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null)continue;if(handler(nodeValue,value))results.push(node);}
return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);if(!nodes)nodes=root.getElementsByTagName("*");return Selector.pseudos[name](nodes,value,root);}},pseudos:{'first-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node);}
return results;},'last-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node);}
return results;},'only-child':function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))
results.push(node);return results;},'nth-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},'nth-last-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},'nth-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},'nth-last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},'first-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},'last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},'only-of-type':function(nodes,formula,root){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0)return b>0?[b]:[];return $R(1,total).inject([],function(memo,i){if(0==(i -b)%a&&(i -b)/a>=0)memo.push(i);return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0)return[];if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}
if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++)
if(node.nodeIndex==formula)results.push(node);}else if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]= -1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++)
if(node.nodeIndex==indices[j])results.push(node);}}
h.unmark(nodes);h.unmark(indexed);return results;},'empty':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node);}
return results;},'not':function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++)
if(!node._countedByPrototype)results.push(node);h.unmark(exclusions);return results;},'enabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(!node.disabled)results.push(node);return results;},'disabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.disabled)results.push(node);return results;},'checked':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.checked)results.push(node);return results;}},operators:{'=':function(nv,v){return nv==v;},'!=':function(nv,v){return nv!=v;},'^=':function(nv,v){return nv.startsWith(v);},'$=':function(nv,v){return nv.endsWith(v);},'*=':function(nv,v){return nv.include(v);},'~=':function(nv,v){return(' ' +nv +' ').include(' ' +v +' ');},'|=':function(nv,v){return('-' +nv.toUpperCase() +'-').include('-' +v.toUpperCase() +'-');}},split:function(expression){var expressions=[];expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});return expressions;},matchElements:function(elements,expression){var matches=$$(expression),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++)
if(element._countedByPrototype)results.push(element);h.unmark(matches);return results;},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false;}
return Selector.matchElements(elements,expression||'*')[index||0];},findChildElements:function(element,expressions){expressions=Selector.split(expressions.join(','));var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}
return(l>1)?h.unique(results):results;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++)
if(node.tagName!=="!")a.push(node);return a;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node.removeAttribute('_countedByPrototype');return nodes;}});}
function $$(){return Selector.findChildElements(document,$A(arguments));}
var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(elements,options){if(typeof options!='object')options={hash:!!options};else if(Object.isUndefined(options.hash))options.hash=true;var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&(element.type!='submit'||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key]))result[key]=[result[key]];result[key].push(value);}
else result[key]=value;}}
return result;});return options.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options);},getElements:function(form){return $A($(form).getElementsByTagName('*')).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));return elements;});},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)return $A(inputs).map(Element.extend);for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(Element.extend(input));}
return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke('disable');return form;},enable:function(form){form=$(form);Form.getElements(form).invoke('enable');return form;},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return'hidden'!=element.type&&!element.disabled;});var firstByIndex=elements.findAll(function(element){return element.hasAttribute('tabIndex')&&element.tabIndex>=0;}).sortBy(function(element){return element.tabIndex}).first();return firstByIndex?firstByIndex:elements.find(function(element){return['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute('action')||'';if(action.blank())action=window.location.href;options.parameters=form.serialize(true);if(params){if(Object.isString(params))params=params.toQueryParams();Object.extend(options.parameters,params);}
if(form.hasAttribute('method')&&!options.method)
options.method=form.method;return new Ajax.Request(action,options);}};Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair);}}
return'';},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element;},clear:function(element){$(element).value='';return element;},present:function(element){return $(element).value!='';},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(element.type)))
element.select();}catch(e){}
return element;},disable:function(element){element=$(element);element.blur();element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(Object.isUndefined(value))return element.checked?element.value:null;else element.checked=!!value;},textarea:function(element,value){if(Object.isUndefined(value))return element.value;else element.value=value;},select:function(element,index){if(Object.isUndefined(index))
return this[element.type=='select-one'?'selectOne':'selectMany'](element);else{var opt,value,single=!Object.isArray(index);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];value=this.optionValue(opt);if(single){if(value==index){opt.selected=true;return;}}
else opt.selected=index.include(value);}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length)return null;for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected)values.push(this.optionValue(opt));}
return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute('value')?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue();},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value;}}});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(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;default:Event.observe(element,'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(event){var element;switch(event.type){case'mouseover':element=event.fromElement;break;case'mouseout':element=event.toElement;break;default:return null;}
return Element.extend(element);}});Event.Methods=(function(){var isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};isButton=function(event,code){return event.button==buttonMap[code];};}else if(Prototype.Browser.WebKit){isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false;}};}else{isButton=function(event,code){return event.which?(event.which===code +1):(event.button===code);};}
return{isLeftClick:function(event){return isButton(event,0)},isMiddleClick:function(event){return isButton(event,1)},isRightClick:function(event){return isButton(event,2)},element:function(event){var node=Event.extend(event).target;return!!node?Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node):null;},findElement:function(event,expression){var element=Event.element(event);if(!expression)return element;var elements=[element].concat(element.ancestors());return Selector.findElement(elements,expression,0);},pointer:function(event){return{x:event.pageX||(event.clientX +
(document.documentElement.scrollLeft||document.body.scrollLeft)),y:event.pageY||(event.clientY +
(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(event){return Event.pointer(event).x},pointerY:function(event){return Event.pointer(event).y},stop:function(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true;}};})();Event.extend=(function(){var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(event){if(!event)return false;if(event._extendedByPrototype)return event;event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement,relatedTarget:Event.relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,methods);return Prototype.K;}})();Object.extend(Event,(function(){var cache=Event.cache;function getEventID(element){if(element._prototypeEventID)return element._prototypeEventID[0];arguments.callee.id=arguments.callee.id||1;return element._prototypeEventID=[++arguments.callee.id];}
function getDOMEventName(eventName){if(eventName&&eventName.include(':'))return"dataavailable";return eventName;}
function getCacheForID(id){return cache[id]=cache[id]||{};}
function getWrappersForEventName(id,eventName){var c=getCacheForID(id);return c[eventName]=c[eventName]||[];}
function createWrapper(element,eventName,handler){var id=getEventID(element);var c=getWrappersForEventName(id,eventName);if(c.pluck("handler").include(handler))return false;var wrapper=function(event){if(!Event||!Event.extend||(event.eventName&&event.eventName!=eventName))
return false;Event.extend(event);handler.call(element,event);};wrapper.handler=handler;c.push(wrapper);return wrapper;}
function findWrapper(id,eventName,handler){var c=getWrappersForEventName(id,eventName);return c.find(function(wrapper){return wrapper.handler==handler});}
function destroyWrapper(id,eventName,handler){var c=getCacheForID(id);if(!c[eventName])return false;c[eventName]=c[eventName].without(findWrapper(id,eventName,handler));}
function destroyCache(){for(var id in cache)
for(var eventName in cache[id])
cache[id][eventName]=null;}
if(window.attachEvent){window.attachEvent("onunload",destroyCache);}
return{observe:function(element,eventName,handler){element=$(element);if(eventName==__i2rd_domupdate_event){__i2rd_domupdate_handlers.push(handler);return;}
var name=getDOMEventName(eventName);var wrapper=createWrapper(element,eventName,handler);if(!wrapper)return element;if(element.addEventListener){element.addEventListener(name,wrapper,false);}else{element.attachEvent("on" +name,wrapper);}
return element;},stopObserving:function(element,eventName,handler){element=$(element);if(eventName==__i2rd_domupdate_event){__i2rd_domupdate_handlers=__i2rd_domupdate_handlers.without(handler);return;}
var id=getEventID(element),name=getDOMEventName(eventName);if(!handler&&eventName){getWrappersForEventName(id,eventName).each(function(wrapper){element.stopObserving(eventName,wrapper.handler);});return element;}else if(!eventName){Object.keys(getCacheForID(id)).each(function(eventName){element.stopObserving(eventName);});return element;}
var wrapper=findWrapper(id,eventName,handler);if(!wrapper)return element;if(element.removeEventListener){element.removeEventListener(name,wrapper,false);}else{element.detachEvent("on" +name,wrapper);}
destroyWrapper(id,eventName,handler);return element;},fire:function(element,eventName,memo){element=$(element);if(element==document&&document.createEvent&&!element.dispatchEvent)
element=document.documentElement;var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent("dataavailable",true,true);}else{event=document.createEventObject();event.eventType="ondataavailable";}
event.eventName=eventName;event.memo=memo||{};if(document.createEvent){element.dispatchEvent(event);}else{element.fireEvent(event.eventType,event);}
return Event.extend(event);}};})());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 timer;function fireContentLoadedEvent(){if(document.loaded)return;if(timer)window.clearInterval(timer);document.fire("dom:loaded");document.loaded=true;}
if(document.addEventListener){if(Prototype.Browser.WebKit){timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState))
fireContentLoadedEvent();},0);Event.observe(window,"load",fireContentLoadedEvent);}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content});},Top:function(element,content){return Element.insert(element,{top:content});},Bottom:function(element,content){return Element.insert(element,{bottom:content});},After:function(element,content){return Element.insert(element,{after:content});}};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(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1] +element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0] +element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x +offsetcache[0] -this.deltaX;this.ycomp=y +offsetcache[1] -this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1] +element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0] +element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1] +element.offsetHeight) -this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0] +element.offsetWidth) -this.xcomp)/element.offsetWidth;},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element);},relativize:function(element){Position.prepare();return Element.relativize(element);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options);}};if(!document.getElementsByClassName)document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' " +name +" ')]";}
instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(''):iter(className);return cond?document._getElementsByXPath('.//*' +cond,element):[];}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className)return elements;var nodes=$(element).getElementsByTagName('*');className=' ' +className +' ';for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=' ' +child.className +' ')&&(cn.include(className)||(classNames&&classNames.all(function(name){return!name.toString().blank()&&cn.include(' ' +name +' ');}))))
elements.push(Element.extend(child));}
return elements;};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className);};}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();
/*  JS Resource: lib/miwt/dc_release.js  */

if(typeof deploymentcontext=='undefined'){deploymentcontext={};deploymentcontext.doAjaxTimeout=true;}
/*  JS Resource: Javascript__Path  */

var resourcesPath='/resources/dyn/docroot/';
/*  JS Resource: FCKeditor/ckeditor.js  */

if(typeof CKEDITOR_BASEPATH=="undefined"){var CKEDITOR_BASEPATH=resourcesPath +"FCKeditor/";}
(function(){if(!window.CKEDITOR)window.CKEDITOR=(function(){var d={timestamp:'A06B',version:'3.1',revision:'4891',_:{},status:'unloaded',basePath:(function(){var g=window.CKEDITOR_BASEPATH||'';if(!g){var h=document.getElementsByTagName('script');for(var i=0;i<h.length;i++){var j=h[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(j){g=j[1];break;}}}if(g.indexOf('://')==-1)if(g.indexOf('/')===0)g=location.href.match(/^.*?:\/\/[^\/]*/)[0]+g;else g=location.href.match(/^[^\?]*\/(?:)/)[0]+g;return g;})(),getUrl:function(g){if(g.indexOf('://')==-1&&g.indexOf('/')!==0)g=this.basePath+g;if(this.timestamp&&g.charAt(g.length-1)!='/')g+=(g.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return g;}},e=window.CKEDITOR_GETURL;if(e){var f=d.getUrl;d.getUrl=function(g){return e.call(d,g)||f.call(d,g);};}return d;})();var d=CKEDITOR;if(!d.event){d.event=function(){};d.event.implementOn=function(e,f){var g=d.event.prototype;for(var h in g)if(e[h]==undefined)e[h]=g[h];};d.event.prototype=(function(){var e=function(g){var h=g.getPrivate&&g.getPrivate()||g._||(g._={});return h.events||(h.events={});},f=function(g){this.name=g;this.listeners=[];};f.prototype={getListenerIndex:function(g){for(var h=0,i=this.listeners;h<i.length;h++)if(i[h].fn==g)return h;return-1;}};return{on:function(g,h,i,j,k){var l=e(this),m=l[g]||(l[g]=new f(g));if(m.getListenerIndex(h)<0){var n=m.listeners;if(!i)i=this;if(isNaN(k))k=10;var o=this,p=function(r,s,t,u){var v={name:g,sender:this,editor:r,data:s,listenerData:j,stop:t,cancel:u,removeListener:function(){o.removeListener(g,h);}};h.call(i,v);return v.data;};p.fn=h;p.priority=k;for(var q=n.length-1;q>=0;q--)if(n[q].priority<=k){n.splice(q+1,0,p);return;}n.unshift(p);}},fire:(function(){var g=false,h=function(){g=true;},i=false,j=function(){i=true;};return function(k,l,m){var n=e(this)[k],o=g,p=i;g=i=false;if(n){var q=n.listeners;if(q.length){q=q.slice(0);for(var r=0;r<q.length;r++){var s=q[r].call(this,m,l,h,j);if(typeof s!='undefined')l=s;if(g||i)break;}}}var t=i||(typeof l=='undefined'?false:l);g=o;i=p;return t;};})(),fireOnce:function(g,h,i){var j=this.fire(g,h,i);delete e(this)[g];return j;},removeListener:function(g,h){var i=e(this)[g];if(i){var j=i.getListenerIndex(h);if(j>=0)i.listeners.splice(j,1);}},hasListeners:function(g){var h=e(this)[g];return h&&h.listeners.length>0;}};})();}if(!d.editor){d.ELEMENT_MODE_NONE=0;d.ELEMENT_MODE_REPLACE=1;d.ELEMENT_MODE_APPENDTO=2;d.editor=function(e,f,g){var h=this;h._={instanceConfig:e,element:f};h.elementMode=g||0;d.event.call(h);h._init();};d.editor.replace=function(e,f){var g=e;if(typeof g!='object'){g=document.getElementById(e);if(!g){var h=0,i=document.getElementsByName(e);while((g=i[h++])&&(g.tagName.toLowerCase()!='textarea')){}}if(!g)throw'[CKEDITOR.editor.replace] The element with id or name "'+e+'" was not found.';}g.style.visibility='hidden';return new d.editor(f,g,1);};d.editor.appendTo=function(e,f){var g=e;if(typeof g!='object'){g=document.getElementById(e);if(!g)throw'[CKEDITOR.editor.appendTo] The element with id "'+e+'" was not found.';}return new d.editor(f,g,2);};d.editor.prototype={_init:function(){var e=d.editor._pending||(d.editor._pending=[]);e.push(this);},fire:function(e,f){return d.event.prototype.fire.call(this,e,f,this);},fireOnce:function(e,f){return d.event.prototype.fireOnce.call(this,e,f,this);}};d.event.implementOn(d.editor.prototype,true);}if(!d.env)d.env=(function(){var e=navigator.userAgent.toLowerCase(),f=window.opera,g={ie:/*@cc_on!@*/false,opera:!!f&&f.version,webkit:e.indexOf(' applewebkit/')>-1,air:e.indexOf(' adobeair/')>-1,mac:e.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',isCustomDomain:function(){return this.ie&&document.domain!=window.location.hostname;}};g.gecko=navigator.product=='Gecko'&&!g.webkit&&!g.opera;var h=0;if(g.ie){h=parseFloat(e.match(/msie (\d+)/)[1]);g.ie8=!!document.documentMode;g.ie8Compat=document.documentMode==8;g.ie7Compat=h==7&&!document.documentMode||document.documentMode==7;g.ie6Compat=h<7||g.quirks;}if(g.gecko){var i=e.match(/rv:([\d\.]+)/);if(i){i=i[1].split('.');h=i[0]*10000+(i[1]||0)*(100)+ +(i[2]||0);}}if(g.opera)h=parseFloat(f.version());if(g.air)h=parseFloat(e.match(/ adobeair\/(\d+)/)[1]);if(g.webkit)h=parseFloat(e.match(/ applewebkit\/(\d+)/)[1]);g.version=h;g.isCompatible=g.ie&&h>=6||g.gecko&&h>=10801||g.opera&&h>=9.5||g.air&&h>=1||g.webkit&&h>=522||false;g.cssClass='cke_browser_'+(g.ie?'ie':g.gecko?'gecko':g.opera?'opera':g.air?'air':g.webkit?'webkit':'unknown');if(g.quirks)g.cssClass+=' cke_browser_quirks';if(g.ie){g.cssClass+=' cke_browser_ie'+(g.version<7?'6':g.version>=8?'8':'7');if(g.quirks)g.cssClass+=' cke_browser_iequirks';}if(g.gecko&&h<10900)g.cssClass+=' cke_browser_gecko18';return g;})();var e=d.env;var f=e.ie;if(d.status=='unloaded')(function(){d.event.implementOn(d);d.loadFullCore=function(){if(d.status!='basic_ready'){d.loadFullCore._load=true;return;}delete d.loadFullCore;var h=document.createElement('script');h.type='text/javascript';h.src=d.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(h);};d.loadFullCoreTimeout=0;d.replaceClass='ckeditor';d.replaceByClassEnabled=true;var g=function(h,i,j){if(e.isCompatible){if(d.loadFullCore)d.loadFullCore();var k=j(h,i);d.add(k);return k;}return null;};d.replace=function(h,i){return g(h,i,d.editor.replace);};d.appendTo=function(h,i){return g(h,i,d.editor.appendTo);};d.add=function(h){var i=this._.pending||(this._.pending=[]);i.push(h);};d.replaceAll=function(){var h=document.getElementsByTagName('textarea');for(var i=0;i<h.length;i++){var j=null,k=h[i],l=k.name;if(!k.name&&!k.id)continue;if(typeof arguments[0]=='string'){var m=new RegExp('(?:^| )'+arguments[0]+'(?:$| )');if(!m.test(k.className))continue;}else if(typeof arguments[0]=='function'){j={};if(arguments[0](k,j)===false)continue;}this.replace(k,j);}};(function(){var h=function(){var i=d.loadFullCore,j=d.loadFullCoreTimeout;if(d.replaceByClassEnabled)d.replaceAll(d.replaceClass);d.status='basic_ready';if(i&&i._load)i();else if(j)setTimeout(function(){if(d.loadFullCore)d.loadFullCore();},j*1000);};if(window.addEventListener)window.addEventListener('load',h,false);else if(window.attachEvent)window.attachEvent('onload',h);})();d.status='basic_loaded';})();d.dom={};var g=d.dom;(function(){var h=[];d.tools={arrayCompare:function(i,j){if(!i&&!j)return true;if(!i||!j||i.length!=j.length)return false;for(var k=0;k<i.length;k++)if(i[k]!=j[k])return false;return true;},clone:function(i){var j;if(i&&i instanceof Array){j=[];for(var k=0;k<i.length;k++)j[k]=this.clone(i[k]);return j;}if(i===null||typeof i!='object'||i instanceof String||i instanceof Number||i instanceof Boolean||i instanceof Date||i instanceof RegExp)return i;j=new i.constructor();for(var l in i){var m=i[l];j[l]=this.clone(m);}return j;},capitalize:function(i){return i.charAt(0).toUpperCase()+i.substring(1).toLowerCase();},extend:function(i){var j=arguments.length,k,l;if(typeof(k=arguments[j-1])=='boolean')j--;else if(typeof(k=arguments[j-2])=='boolean'){l=arguments[j-1];j-=2;}for(var m=1;m<j;m++){var n=arguments[m];for(var o in n)if(k===true||i[o]==undefined)if(!l||o in l)i[o]=n[o];}return i;},prototypedCopy:function(i){var j=function(){};j.prototype=i;return new j();},isArray:function(i){return!!i&&i instanceof Array;},isEmpty:function(i){for(var j in i)if(i.hasOwnProperty(j))return false;return true;},cssStyleToDomStyle:(function(){var i=document.createElement('div').style,j=typeof i.cssFloat!='undefined'?'cssFloat':typeof i.styleFloat!='undefined'?'styleFloat':'float';return function(k){if(k=='float')return j;else return k.replace(/-./g,function(l){return l.substr(1).toUpperCase();});};})(),buildStyleHtml:function(i){i=[].concat(i);var j,k=[];for(var l=0;l<i.length;l++){j=i[l];if(/@import|[{}]/.test(j))k.push('<style>'+j+'</style>');else k.push('<link type="text/css" rel=stylesheet href="'+j+'">');}return k.join('');},htmlEncode:function(i){var j=function(n){var o=new g.element('span');o.setText(n);return o.getHtml();},k=j('\n').toLowerCase()=='<br>'?function(n){return j(n).replace(/<br>/gi,'\n');}:j,l=j('>')=='>'?function(n){return k(n).replace(/>/g,'&gt;');}:k,m=j('  ')=='&nbsp; '?function(n){return l(n).replace(/&nbsp;/g,' ');}:l;this.htmlEncode=m;return this.htmlEncode(i);},escapeCssSelector:function(i){return i.replace(/[\s#:.,$*^\[\]()~=+>]/g,'\\$&');},getNextNumber:(function(){var i=0;return function(){return++i;};})(),override:function(i,j){return j(i);},setTimeout:function(i,j,k,l,m){if(!m)m=window;if(!k)k=m;return m.setTimeout(function(){if(l)i.apply(k,[].concat(l));else i.apply(k);},j||0);},trim:(function(){var i=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(j){return j.replace(i,'');};})(),ltrim:(function(){var i=/^[ \t\n\r]+/g;return function(j){return j.replace(i,'');};})(),rtrim:(function(){var i=/[ \t\n\r]+$/g;return function(j){return j.replace(i,'');};})(),indexOf:Array.prototype.indexOf?function(i,j){return i.indexOf(j);}:function(i,j){for(var k=0,l=i.length;k<l;k++)if(i[k]===j)return k;return-1;},bind:function(i,j){return function(){return i.apply(j,arguments);};},createClass:function(i){var j=i.$,k=i.base,l=i.privates||i._,m=i.proto,n=i.statics;if(l){var o=j;j=function(){var s=this;var p=s._||(s._={});for(var q in l){var r=l[q];p[q]=typeof r=='function'?d.tools.bind(r,s):r;}o.apply(s,arguments);};}if(k){j.prototype=this.prototypedCopy(k.prototype);j.prototype['constructor']=j;j.prototype.base=function(){this.base=k.prototype.base;k.apply(this,arguments);this.base=arguments.callee;};}if(m)this.extend(j.prototype,m,true);if(n)this.extend(j,n,true);return j;},addFunction:function(i,j){return h.push(function(){i.apply(j||this,arguments);})-1;},callFunction:function(i){var j=h[i];return j&&j.apply(window,Array.prototype.slice.call(arguments,1));},cssLength:(function(){var i=/^\d+(?:\.\d+)?$/;return function(j){return j+(i.test(j)?'px':'');};})(),repeat:function(i,j){return new Array(j+1).join(i);},tryThese:function(){var i;for(var j=0,k=arguments.length;j<k;j++){var l=arguments[j];try{i=l();break;}catch(m){}}return i;}};})();var h=d.tools;d.dtd=(function(){var i=h.extend,j={isindex:1,fieldset:1},k={input:1,button:1,select:1,textarea:1,label:1},l=i({a:1},k),m=i({iframe:1},l),n={hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1},o={ins:1,del:1,script:1},p=i({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},o),q=i({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},p),r=i({p:1},q),s=i({iframe:1},q,k),t={img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},u=i({a:1},s),v={tr:1},w={'#':1},x=i({param:1},t),y=i({form:1},j,m,n,r),z={li:1},A={style:1,script:1},B={base:1,link:1,meta:1,title:1},C=i(B,A),D={head:1,body:1},E={html:1},F={address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1};return{$nonBodyContent:i(E,D,B),$block:F,$blockLimit:{body:1,div:1,td:1,th:1,caption:1,form:1},$inline:u,$body:i({script:1,style:1},F),$cdata:{script:1,style:1},$empty:{area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1},$listItem:{dd:1,dt:1,li:1},$list:{ul:1,ol:1,dl:1},$nonEditable:{applet:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,script:1,textarea:1,param:1},$removeEmpty:{abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},html:D,head:C,style:w,script:w,body:y,base:{},link:{},meta:{},title:w,col:{},tr:{td:1,th:1},img:{},colgroup:{col:1},noscript:y,td:y,br:{},th:y,center:y,kbd:u,button:i(r,n),basefont:{},h5:u,h4:u,samp:u,h6:u,ol:z,h1:u,h3:u,option:w,h2:u,form:i(j,m,n,r),select:{optgroup:1,option:1},font:u,ins:u,menu:z,abbr:u,label:u,table:{thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},code:u,script:w,tfoot:v,cite:u,li:y,input:{},iframe:y,strong:u,textarea:w,noframes:y,big:u,small:u,span:u,hr:{},dt:u,sub:u,optgroup:{option:1},param:{},bdo:u,'var':u,div:y,object:x,sup:u,dd:y,strike:u,area:{},dir:z,map:i({area:1,form:1,p:1},j,o,n),applet:x,dl:{dt:1,dd:1},del:u,isindex:{},fieldset:i({legend:1},t),thead:v,ul:z,acronym:u,b:u,a:s,blockquote:y,caption:u,i:u,u:u,tbody:v,s:u,address:i(m,r),tt:u,legend:u,q:u,pre:i(p,l),p:u,em:u,dfn:u};})();var i=d.dtd;g.event=function(j){this.$=j;};g.event.prototype={getKey:function(){return this.$.keyCode||this.$.which;},getKeystroke:function(){var k=this;var j=k.getKey();if(k.$.ctrlKey||k.$.metaKey)j+=1000;if(k.$.shiftKey)j+=2000;if(k.$.altKey)j+=4000;return j;},preventDefault:function(j){var k=this.$;if(k.preventDefault)k.preventDefault();else k.returnValue=false;if(j)this.stopPropagation();},stopPropagation:function(){var j=this.$;if(j.stopPropagation)j.stopPropagation();else j.cancelBubble=true;},getTarget:function(){var j=this.$.target||this.$.srcElement;return j?new g.node(j):null;}};d.CTRL=1000;d.SHIFT=2000;d.ALT=4000;g.domObject=function(j){if(j)this.$=j;};g.domObject.prototype=(function(){var j=function(k,l){return function(m){if(typeof d!='undefined')k.fire(l,new g.event(m));};};return{getPrivate:function(){var k;if(!(k=this.getCustomData('_')))this.setCustomData('_',k={});return k;},on:function(k){var n=this;var l=n.getCustomData('_cke_nativeListeners');if(!l){l={};n.setCustomData('_cke_nativeListeners',l);}if(!l[k]){var m=l[k]=j(n,k);if(n.$.addEventListener)n.$.addEventListener(k,m,!!d.event.useCapture);else if(n.$.attachEvent)n.$.attachEvent('on'+k,m);}return d.event.prototype.on.apply(n,arguments);},removeListener:function(k){var n=this;d.event.prototype.removeListener.apply(n,arguments);if(!n.hasListeners(k)){var l=n.getCustomData('_cke_nativeListeners'),m=l&&l[k];if(m){if(n.$.removeEventListener)n.$.removeEventListener(k,m,false);else if(n.$.detachEvent)n.$.detachEvent('on'+k,m);delete l[k];}}}};})();(function(j){var k={};j.equals=function(l){return l&&l.$===this.$;};j.setCustomData=function(l,m){var n=this.getUniqueId(),o=k[n]||(k[n]={});o[l]=m;return this;};j.getCustomData=function(l){var m=this.$._cke_expando,n=m&&k[m];return n&&n[l];};j.removeCustomData=function(l){var m=this.$._cke_expando,n=m&&k[m],o=n&&n[l];if(typeof o!='undefined')delete n[l];return o||null;};j.getUniqueId=function(){return this.$._cke_expando||(this.$._cke_expando=h.getNextNumber());};d.event.implementOn(j);})(g.domObject.prototype);g.window=function(j){g.domObject.call(this,j);};g.window.prototype=new g.domObject();h.extend(g.window.prototype,{focus:function(){if(e.webkit&&this.$.parent)this.$.parent.focus();this.$.focus();},getViewPaneSize:function(){var j=this.$.document,k=j.compatMode=='CSS1Compat';return{width:(k?j.documentElement.clientWidth:j.body.clientWidth)||(0),height:(k?j.documentElement.clientHeight:j.body.clientHeight)||(0)};},getScrollPosition:function(){var j=this.$;if('pageXOffset'in j)return{x:j.pageXOffset||0,y:j.pageYOffset||0};else{var k=j.document;return{x:k.documentElement.scrollLeft||k.body.scrollLeft||0,y:k.documentElement.scrollTop||k.body.scrollTop||0};}}});g.document=function(j){g.domObject.call(this,j);};var j=g.document;j.prototype=new g.domObject();h.extend(j.prototype,{appendStyleSheet:function(k){if(this.$.createStyleSheet)this.$.createStyleSheet(k);else{var l=new g.element('link');l.setAttributes({rel:'stylesheet',type:'text/css',href:k});this.getHead().append(l);}},appendStyleText:function(k){var n=this;if(n.$.createStyleSheet){var l=n.$.createStyleSheet('');l.cssText=k;}else{var m=new g.element('style',n);m.append(new g.text(k,n));n.getHead().append(m);}},createElement:function(k,l){var m=new g.element(k,this);if(l){if(l.attributes)m.setAttributes(l.attributes);if(l.styles)m.setStyles(l.styles);}return m;},createText:function(k){return new g.text(k,this);},focus:function(){this.getWindow().focus();},getById:function(k){var l=this.$.getElementById(k);return l?new g.element(l):null;},getByAddress:function(k,l){var m=this.$.documentElement;for(var n=0;m&&n<k.length;n++){var o=k[n];if(!l){m=m.childNodes[o];continue;}var p=-1;for(var q=0;q<m.childNodes.length;q++){var r=m.childNodes[q];if(l===true&&r.nodeType==3&&r.previousSibling&&r.previousSibling.nodeType==3)continue;p++;if(p==o){m=r;break;}}}return m?new g.node(m):null;},getElementsByTag:function(k,l){if(!f&&l)k=l+':'+k;return new g.nodeList(this.$.getElementsByTagName(k));},getHead:function(){var k=this.$.getElementsByTagName('head')[0];k=new g.element(k);return(this.getHead=function(){return k;})();},getBody:function(){var k=new g.element(this.$.body);return(this.getBody=function(){return k;})();},getDocumentElement:function(){var k=new g.element(this.$.documentElement);return(this.getDocumentElement=function(){return k;})();},getWindow:function(){var k=new g.window(this.$.parentWindow||this.$.defaultView);return(this.getWindow=function(){return k;})();}});g.node=function(k){if(k){switch(k.nodeType){case 1:return new g.element(k);case 3:return new g.text(k);}g.domObject.call(this,k);}return this;};g.node.prototype=new g.domObject();d.NODE_ELEMENT=1;d.NODE_TEXT=3;d.NODE_COMMENT=8;d.NODE_DOCUMENT_FRAGMENT=11;d.POSITION_IDENTICAL=0;d.POSITION_DISCONNECTED=1;d.POSITION_FOLLOWING=2;d.POSITION_PRECEDING=4;d.POSITION_IS_CONTAINED=8;d.POSITION_CONTAINS=16;h.extend(g.node.prototype,{appendTo:function(k,l){k.append(this,l);return k;},clone:function(k,l){var m=this.$.cloneNode(k);if(!l){var n=function(o){if(o.nodeType!=1)return;o.removeAttribute('id',false);o.removeAttribute('_cke_expando',false);var p=o.childNodes;for(var q=0;q<p.length;q++)n(p[q]);};n(m);}return new g.node(m);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(k){k.$.parentNode.insertBefore(this.$,k.$.nextSibling);return k;},insertBefore:function(k){k.$.parentNode.insertBefore(this.$,k.$);return k;},insertBeforeMe:function(k){this.$.parentNode.insertBefore(k.$,this.$);return k;},getAddress:function(k){var l=[],m=this.getDocument().$.documentElement,n=this.$;while(n&&n!=m){var o=n.parentNode,p=-1;for(var q=0;q<o.childNodes.length;q++){var r=o.childNodes[q];if(k&&r.nodeType==3&&r.previousSibling&&r.previousSibling.nodeType==3)continue;p++;if(r==n)break;}l.unshift(p);n=n.parentNode;}return l;},getDocument:function(){var k=new j(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return k;})();},getIndex:function(){var k=this.$,l=k.parentNode&&k.parentNode.firstChild,m=-1;while(l){m++;if(l==k)return m;l=l.nextSibling;}return-1;},getNextSourceNode:function(k,l,m){if(m&&!m.call){var n=m;m=function(q){return!q.equals(n);};}var o=!k&&this.getFirst&&this.getFirst(),p;if(!o){if(this.type==1&&m&&m(this,true)===false)return null;o=this.getNext();}while(!o&&(p=(p||this).getParent())){if(m&&m(p,true)===false)return null;o=p.getNext();}if(!o)return null;if(m&&m(o)===false)return null;if(l&&l!=o.type)return o.getNextSourceNode(false,l,m);return o;},getPreviousSourceNode:function(k,l,m){if(m&&!m.call){var n=m;m=function(q){return!q.equals(n);};}var o=!k&&this.getLast&&this.getLast(),p;if(!o){if(this.type==1&&m&&m(this,true)===false)return null;o=this.getPrevious();}while(!o&&(p=(p||this).getParent())){if(m&&m(p,true)===false)return null;o=p.getPrevious();}if(!o)return null;if(m&&m(o)===false)return null;if(l&&o.type!=l)return o.getPreviousSourceNode(false,l,m);return o;},getPrevious:function(k){var l=this.$,m;do{l=l.previousSibling;m=l&&new g.node(l);}while(m&&k&&!k(m))return m;},getNext:function(k){var l=this.$,m;do{l=l.nextSibling;m=l&&new g.node(l);}while(m&&k&&!k(m))return m;},getParent:function(){var k=this.$.parentNode;return k&&k.nodeType==1?new g.node(k):null;},getParents:function(k){var l=this,m=[];do m[k?'push':'unshift'](l);while(l=l.getParent())return m;},getCommonAncestor:function(k){var m=this;if(k.equals(m))return m;if(k.contains&&k.contains(m))return k;var l=m.contains?m:m.getParent();do if(l.contains(k))return l;while(l=l.getParent())return null;},getPosition:function(k){var l=this.$,m=k.$;if(l.compareDocumentPosition)return l.compareDocumentPosition(m);if(l==m)return 0;if(this.type==1&&k.type==1){if(l.contains){if(l.contains(m))return 16+4;if(m.contains(l))return 8+2;}if('sourceIndex'in l)return l.sourceIndex<0||m.sourceIndex<0?1:l.sourceIndex<m.sourceIndex?4:2;}var n=this.getAddress(),o=k.getAddress(),p=Math.min(n.length,o.length);for(var q=0;q<=p-1;q++)if(n[q]!=o[q]){if(q<p)return n[q]<o[q]?4:2;break;}return n.length<o.length?16+4:8+2;},getAscendant:function(k,l){var m=this.$;if(!l)m=m.parentNode;while(m){if(m.nodeName&&m.nodeName.toLowerCase()==k)return new g.node(m);m=m.parentNode;}return null;},hasAscendant:function(k,l){var m=this.$;if(!l)m=m.parentNode;while(m){if(m.nodeName&&m.nodeName.toLowerCase()==k)return true;m=m.parentNode;}return false;},move:function(k,l){k.append(this.remove(),l);},remove:function(k){var l=this.$,m=l.parentNode;if(m){if(k)for(var n;n=l.firstChild;)m.insertBefore(l.removeChild(n),l);m.removeChild(l);}return this;},replace:function(k){this.insertBefore(k);k.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var n=this;var k;while(n.getFirst&&(k=n.getFirst())){if(k.type==3){var l=h.ltrim(k.getText()),m=k.getLength();if(!l){k.remove();continue;}else if(l.length<m){k.split(m-l.length);n.$.removeChild(n.$.firstChild);}}break;}},rtrim:function(){var n=this;var k;while(n.getLast&&(k=n.getLast())){if(k.type==3){var l=h.rtrim(k.getText()),m=k.getLength();if(!l){k.remove();continue;}else if(l.length<m){k.split(l.length);n.$.lastChild.parentNode.removeChild(n.$.lastChild);}}break;}if(!f&&!e.opera){k=n.$.lastChild;if(k&&k.type==1&&k.nodeName.toLowerCase()=='br')k.parentNode.removeChild(k);}}});g.nodeList=function(k){this.$=k;};g.nodeList.prototype={count:function(){return this.$.length;},getItem:function(k){var l=this.$[k];return l?new g.node(l):null;}};g.element=function(k,l){if(typeof k=='string')k=(l?l.$:document).createElement(k);g.domObject.call(this,k);};var k=g.element;k.get=function(l){return l&&(l.$?l:new k(l));};k.prototype=new g.node();k.createFromHtml=function(l,m){var n=new k('div',m);n.setHtml(l);return n.getFirst().remove();};k.setMarker=function(l,m,n,o){var p=m.getCustomData('list_marker_id')||m.setCustomData('list_marker_id',h.getNextNumber()).getCustomData('list_marker_id'),q=m.getCustomData('list_marker_names')||m.setCustomData('list_marker_names',{}).getCustomData('list_marker_names');l[p]=m;q[n]=1;return m.setCustomData(n,o);};k.clearAllMarkers=function(l){for(var m in l)k.clearMarkers(l,l[m],true);};k.clearMarkers=function(l,m,n){var o=m.getCustomData('list_marker_names'),p=m.getCustomData('list_marker_id');for(var q in o)m.removeCustomData(q);m.removeCustomData('list_marker_names');if(n){m.removeCustomData('list_marker_id');delete l[p];}};h.extend(k.prototype,{type:1,addClass:function(l){var m=this.$.className;if(m){var n=new RegExp('(?:^|\\s)'+l+'(?:\\s|$)','');if(!n.test(m))m+=' '+l;}this.$.className=m||l;},removeClass:function(l){var m=this.getAttribute('class');if(m){var n=new RegExp('(?:^|\\s+)'+l+'(?=\\s|$)','i');if(n.test(m)){m=m.replace(n,'').replace(/^\s+/,'');if(m)this.setAttribute('class',m);else this.removeAttribute('class');}}},hasClass:function(l){var m=new RegExp('(?:^|\\s+)'+l+'(?=\\s|$)','');return m.test(this.getAttribute('class'));},append:function(l,m){var n=this;if(typeof l=='string')l=n.getDocument().createElement(l);if(m)n.$.insertBefore(l.$,n.$.firstChild);else n.$.appendChild(l.$);return l;},appendHtml:function(l){var n=this;if(!n.$.childNodes.length)n.setHtml(l);else{var m=new k('div',n.getDocument());m.setHtml(l);m.moveChildren(n);}},appendText:function(l){if(this.$.text!=undefined)this.$.text+=l;else this.append(new g.text(l));},appendBogus:function(){var m=this;var l=m.getLast();while(l&&l.type==3&&!h.rtrim(l.getText()))l=l.getPrevious();if(!l||!l.is||!l.is('br'))m.append(e.opera?m.getDocument().createText(''):m.getDocument().createElement('br'));},breakParent:function(l){var o=this;var m=new g.range(o.getDocument());m.setStartAfter(o);m.setEndAfter(l);var n=m.extractContents();m.insertNode(o.remove());n.insertAfterNode(o);},contains:f||e.webkit?function(l){var m=this.$;return l.type!=1?m.contains(l.getParent().$):m!=l.$&&m.contains(l.$);}:function(l){return!!(this.$.compareDocumentPosition(l.$)&16);},focus:function(){try{this.$.focus();}catch(l){}},getHtml:function(){var l=this.$.innerHTML;return f?l.replace(/<\?[^>]*>/g,''):l;},getOuterHtml:function(){var m=this;if(m.$.outerHTML)return m.$.outerHTML.replace(/<\?[^>]*>/,'');var l=m.$.ownerDocument.createElement('div');l.appendChild(m.$.cloneNode(true));return l.innerHTML;},setHtml:function(l){return this.$.innerHTML=l;},setText:function(l){k.prototype.setText=this.$.innerText!=undefined?function(m){return this.$.innerText=m;}:function(m){return this.$.textContent=m;};return this.setText(l);},getAttribute:(function(){var l=function(m){return this.$.getAttribute(m,2);};if(f&&(e.ie7Compat||e.ie6Compat))return function(m){var q=this;switch(m){case'class':m='className';break;case'tabindex':var n=l.call(q,m);if(n!==0&&q.$.tabIndex===0)n=null;return n;break;case'checked':var o=q.$.attributes.getNamedItem(m),p=o.specified?o.nodeValue:q.$.checked;return p?'checked':null;case'hspace':return q.$.hspace;case'style':return q.$.style.cssText;}return l.call(q,m);};else return l;})(),getChildren:function(){return new g.nodeList(this.$.childNodes);},getComputedStyle:f?function(l){return this.$.currentStyle[h.cssStyleToDomStyle(l)];}:function(l){return this.getWindow().$.getComputedStyle(this.$,'').getPropertyValue(l);},getDtd:function(){var l=i[this.getName()];this.getDtd=function(){return l;};return l;},getElementsByTag:j.prototype.getElementsByTag,getTabIndex:f?function(){var l=this.$.tabIndex;if(l===0&&!i.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)l=-1;return l;}:e.webkit?function(){var l=this.$.tabIndex;if(l==undefined){l=parseInt(this.getAttribute('tabindex'),10);if(isNaN(l))l=-1;}return l;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var l=this.$.nodeName.toLowerCase();if(f){var m=this.$.scopeName;if(m!='HTML')l=m.toLowerCase()+':'+l;}return(this.getName=function(){return l;})();},getValue:function(){return this.$.value;},getFirst:function(l){var m=this.$.firstChild,n=m&&new g.node(m);if(n&&l&&!l(n))n=n.getNext(l);return n;},getLast:function(l){var m=this.$.lastChild,n=m&&new g.node(m);if(n&&l&&!l(n))n=n.getPrevious(l);return n;},getStyle:function(l){return this.$.style[h.cssStyleToDomStyle(l)];},is:function(){var l=this.getName();for(var m=0;m<arguments.length;m++)if(arguments[m]==l)return true;return false;},isEditable:function(){var l=this.getName(),m=!i.$nonEditable[l]&&(i[l]||i.span);return m&&m['#'];},isIdentical:function(l){if(this.getName()!=l.getName())return false;var m=this.$.attributes,n=l.$.attributes,o=m.length,p=n.length;if(!f&&o!=p)return false;for(var q=0;q<o;q++){var r=m[q];if((!f||r.specified&&r.nodeName!='_cke_expando')&&(r.nodeValue!=l.getAttribute(r.nodeName)))return false;}if(f)for(q=0;q<p;q++){r=n[q];if(r.specified&&r.nodeName!='_cke_expando'&&r.nodeValue!=this.getAttribute(r.nodeName))return false;}return true;},isVisible:function(){var l=!!this.$.offsetHeight&&this.getComputedStyle('visibility')!='hidden',m,n;if(l&&(e.webkit||e.opera)){m=this.getWindow();if(!m.equals(d.document.getWindow())&&(n=m.$.frameElement))l=new k(n).isVisible();}return l;},hasAttributes:f&&(e.ie7Compat||e.ie6Compat)?function(){var l=this.$.attributes;for(var m=0;m<l.length;m++){var n=l[m];switch(n.nodeName){case'class':if(this.getAttribute('class'))return true;case'_cke_expando':continue;default:if(n.specified)return true;}}return false;}:function(){var l=this.$.attributes;return l.length>1||l.length==1&&l[0].nodeName!='_cke_expando';},hasAttribute:function(l){var m=this.$.attributes.getNamedItem(l);return!!(m&&m.specified);},hide:function(){this.setStyle('display','none');},moveChildren:function(l,m){var n=this.$;l=l.$;if(n==l)return;var o;if(m)while(o=n.lastChild)l.insertBefore(n.removeChild(o),l.firstChild);else while(o=n.firstChild)l.appendChild(n.removeChild(o));},show:function(){this.setStyles({display:'',visibility:''});},setAttribute:(function(){var l=function(m,n){this.$.setAttribute(m,n);return this;};if(f&&(e.ie7Compat||e.ie6Compat))return function(m,n){var o=this;if(m=='class')o.$.className=n;else if(m=='style')o.$.style.cssText=n;else if(m=='tabindex')o.$.tabIndex=n;else if(m=='checked')o.$.checked=n;else l.apply(o,arguments);return o;};else return l;})(),setAttributes:function(l){for(var m in l)this.setAttribute(m,l[m]);return this;},setValue:function(l){this.$.value=l;return this;},removeAttribute:(function(){var l=function(m){this.$.removeAttribute(m);};if(f&&(e.ie7Compat||e.ie6Compat))return function(m){if(m=='class')m='className';else if(m=='tabindex')m='tabIndex';l.call(this,m);};else return l;})(),removeAttributes:function(l){for(var m=0;m<l.length;m++)this.removeAttribute(l[m]);},removeStyle:function(l){var m=this;m.setStyle(l,'');if(m.$.style.removeAttribute)m.$.style.removeAttribute(h.cssStyleToDomStyle(l));if(!m.$.style.cssText)m.removeAttribute('style');},setStyle:function(l,m){this.$.style[h.cssStyleToDomStyle(l)]=m;return this;},setStyles:function(l){for(var m in l)this.setStyle(m,l[m]);return this;},setOpacity:function(l){if(f){l=Math.round(l*100);this.setStyle('filter',l>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+l+')');}else this.setStyle('opacity',l);},unselectable:e.gecko?function(){this.$.style.MozUserSelect='none';}:e.webkit?function(){this.$.style.KhtmlUserSelect='none';}:function(){if(f||e.opera){var l=this.$,m,n=0;l.unselectable='on';while(m=l.all[n++])switch(m.tagName.toLowerCase()){case'iframe':case'textarea':case'input':case'select':break;default:m.unselectable='on';}}},getPositionedAncestor:function(){var l=this;while(l.getName()!='html'){if(l.getComputedStyle('position')!='static')return l;l=l.getParent();}return null;},getDocumentPosition:function(l){var G=this;var m=0,n=0,o=G.getDocument().getBody(),p=G.getDocument().$.compatMode=='BackCompat',q=G.getDocument();if(document.documentElement.getBoundingClientRect){var r=G.$.getBoundingClientRect(),s=q.$,t=s.documentElement,u=t.clientTop||o.$.clientTop||0,v=t.clientLeft||o.$.clientLeft||0,w=true;if(f){var x=q.getDocumentElement().contains(G),y=q.getBody().contains(G);w=p&&y||!p&&x;}if(w){m=r.left+(!p&&t.scrollLeft||o.$.scrollLeft);m-=v;n=r.top+(!p&&t.scrollTop||o.$.scrollTop);n-=u;}}else{var z=G,A=null,B;while(z&&!(z.getName()=='body'||z.getName()=='html')){m+=z.$.offsetLeft-z.$.scrollLeft;n+=z.$.offsetTop-z.$.scrollTop;if(!z.equals(G)){m+=z.$.clientLeft||0;n+=z.$.clientTop||0;}var C=A;while(C&&!C.equals(z)){m-=C.$.scrollLeft;n-=C.$.scrollTop;C=C.getParent();}A=z;z=(B=z.$.offsetParent)?new k(B):null;}}if(l){var D=G.getWindow(),E=l.getWindow();if(!D.equals(E)&&D.$.frameElement){var F=new k(D.$.frameElement).getDocumentPosition(l);m+=F.x;n+=F.y;}}if(!document.documentElement.getBoundingClientRect)if(e.gecko&&!p){m+=G.$.clientLeft?1:0;n+=G.$.clientTop?1:0;}return{x:m,y:n};},scrollIntoView:function(l){var r=this;var m=r.getWindow(),n=m.getViewPaneSize().height,o=n*-1;if(l)o+=n;else{o+=r.$.offsetHeight||0;o+=parseInt(r.getComputedStyle('marginBottom')||0,10)||0;}var p=r.getDocumentPosition();o+=p.y;o=o<0?0:o;var q=m.getScrollPosition().y;if(o>q||o<q-n)m.$.scrollTo(0,o);},setState:function(l){var m=this;switch(l){case 1:m.addClass('cke_on');m.removeClass('cke_off');m.removeClass('cke_disabled');break;case 0:m.addClass('cke_disabled');m.removeClass('cke_off');m.removeClass('cke_on');break;default:m.addClass('cke_off');m.removeClass('cke_on');m.removeClass('cke_disabled');break;}},getFrameDocument:function(){var l=this.$;try{l.contentWindow.document;}catch(m){l.src=l.src;if(f&&e.version<7)window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);</script>")');}return l&&new j(l.contentWindow.document);},copyAttributes:function(l,m){var s=this;var n=s.$.attributes;m=m||{};for(var o=0;o<n.length;o++){var p=n[o],q=p.nodeName.toLowerCase(),r;if(q in m)continue;if(q=='checked'&&(r=s.getAttribute(q)))l.setAttribute(q,r);else if(p.specified||f&&p.nodeValue&&q=='value'){r=s.getAttribute(q);if(r===null)r=p.nodeValue;l.setAttribute(q,r);}}if(s.$.style.cssText!=='')l.$.style.cssText=s.$.style.cssText;},renameNode:function(l){var o=this;if(o.getName()==l)return;var m=o.getDocument(),n=new k(l,m);o.copyAttributes(n);o.moveChildren(n);o.$.parentNode.replaceChild(n.$,o.$);n.$._cke_expando=o.$._cke_expando;o.$=n.$;},getChild:function(l){var m=this.$;if(!l.slice)m=m.childNodes[l];else while(l.length>0&&m)m=m.childNodes[l.shift()];return m?new g.node(m):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(l){if(!l.data.getTarget().hasClass('cke_enable_context_menu'))l.data.preventDefault();});}});d.command=function(l,m){this.uiItems=[];this.exec=function(n){if(this.state==0)return false;if(this.editorFocus)l.focus();return m.exec.call(this,l,n)!==false;};h.extend(this,m,{modes:{wysiwyg:1},editorFocus:true,state:2});d.event.call(this);};d.command.prototype={enable:function(){var l=this;if(l.state==0)l.setState(!l.preserveState||typeof l.previousState=='undefined'?2:l.previousState);},disable:function(){this.setState(0);},setState:function(l){var m=this;if(m.state==l)return false;m.previousState=m.state;m.state=l;m.fire('state');return true;},toggleState:function(){var l=this;if(l.state==2)l.setState(1);else if(l.state==1)l.setState(2);}};d.event.implementOn(d.command.prototype,true);d.ENTER_P=1;d.ENTER_BR=2;d.ENTER_DIV=3;d.config={customConfig:'config.js',autoUpdateElement:true,baseHref:'',contentsCss:d.basePath+'contents.css',contentsLangDirection:'ltr',language:'',defaultLanguage:'en',enterMode:1,shiftEnterMode:2,corePlugins:'',docType:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};var l=d.config;d.focusManager=function(m){if(m.focusManager)return m.focusManager;this.hasFocus=false;this._={editor:m};return this;};d.focusManager.prototype={focus:function(){var n=this;if(n._.timer)clearTimeout(n._.timer);if(!n.hasFocus){if(d.currentInstance)d.currentInstance.focusManager.forceBlur();var m=n._.editor;m.container.getFirst().addClass('cke_focus');n.hasFocus=true;m.fire('focus');}},blur:function(){var m=this;if(m._.timer)clearTimeout(m._.timer);m._.timer=setTimeout(function(){delete m._.timer;m.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var m=this._.editor;m.container.getFirst().removeClass('cke_focus');this.hasFocus=false;m.fire('blur');}}};(function(){var m={};d.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-uk':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(n,o,p){if(!n||!d.lang.languages[n])n=this.detect(o,n);if(!this[n])d.scriptLoader.load(d.getUrl('lang/'+n+'.js'),function(){p(n,this[n]);},this);else p(n,this[n]);},detect:function(n,o){var p=this.languages;o=o||navigator.userLanguage||navigator.language;var q=o.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),r=q[1],s=q[2];if(p[r+'-'+s])r=r+'-'+s;else if(!p[r])r=null;d.lang.detect=r?function(){return r;}:function(t){return t;};return r||n;}};})();d.scriptLoader=(function(){var m={},n={};return{load:function(o,p,q,r,s){var t=typeof o=='string';if(t)o=[o];if(!q)q=d;var u=o.length,v=[],w=[],x=function(C){if(p)if(t)p.call(q,C);else p.call(q,v,w);};if(u===0){x(true);return;}var y=function(C,D){(D?v:w).push(C);if(--u<=0){s&&d.document.getDocumentElement().removeStyle('cursor');x(D);}},z=function(C,D){m[C]=1;var E=n[C];delete n[C];for(var F=0;F<E.length;F++)E[F](C,D);},A=function(C){if(r!==true&&m[C]){y(C,true);return;}var D=n[C]||(n[C]=[]);D.push(y);if(D.length>1)return;var E=new k('script');E.setAttributes({type:'text/javascript',src:C});if(p)if(f)E.$.onreadystatechange=function(){if(E.$.readyState=='loaded'||E.$.readyState=='complete'){E.$.onreadystatechange=null;z(C,true);}};else{E.$.onload=function(){setTimeout(function(){z(C,true);},0);};E.$.onerror=function(){z(C,false);};}E.appendTo(d.document.getHead());};s&&d.document.getDocumentElement().setStyle('cursor','wait');for(var B=0;B<u;B++)A(o[B]);},loadCode:function(o){var p=new k('script');p.setAttribute('type','text/javascript');p.appendText(o);p.appendTo(d.document.getHead());}};})();d.resourceManager=function(m,n){var o=this;o.basePath=m;o.fileName=n;o.registered={};o.loaded={};o.externals={};o._={waitingList:{}};};d.resourceManager.prototype={add:function(m,n){if(this.registered[m])throw'[CKEDITOR.resourceManager.add] The resource name "'+m+'" is already registered.';d.fire(m+h.capitalize(this.fileName)+'Ready',this.registered[m]=n||{});},get:function(m){return this.registered[m]||null;},getPath:function(m){var n=this.externals[m];return d.getUrl(n&&n.dir||this.basePath+m+'/');},getFilePath:function(m){var n=this.externals[m];return d.getUrl(this.getPath(m)+(n&&n.file||this.fileName+'.js'));},addExternal:function(m,n,o){m=m.split(',');for(var p=0;p<m.length;p++){var q=m[p];this.externals[q]={dir:n,file:o};}},load:function(m,n,o){if(!h.isArray(m))m=m?[m]:[];var p=this.loaded,q=this.registered,r=[],s={},t={};for(var u=0;u<m.length;u++){var v=m[u];if(!v)continue;if(!p[v]&&!q[v]){var w=this.getFilePath(v);r.push(w);if(!(w in s))s[w]=[];s[w].push(v);}else t[v]=this.get(v);}d.scriptLoader.load(r,function(x,y){if(y.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+s[y[0]].join(',')+'" was not found at "'+y[0]+'".';for(var z=0;z<x.length;z++){var A=s[x[z]];for(var B=0;B<A.length;B++){var C=A[B];t[C]=this.get(C);p[C]=1;}}n.call(o,t);},this);}};d.plugins=new d.resourceManager('plugins/','plugin');var m=d.plugins;m.load=h.override(m.load,function(n){return function(o,p,q){var r={},s=function(t){n.call(this,t,function(u){h.extend(r,u);var v=[];for(var w in u){var x=u[w],y=x&&x.requires;if(y)for(var z=0;z<y.length;z++)if(!r[y[z]])v.push(y[z]);}if(v.length)s.call(this,v);else{for(w in r){x=r[w];if(x.onLoad&&!x.onLoad._called){x.onLoad();x.onLoad._called=1;}}if(p)p.call(q||window,r);}},this);};s.call(this,o);};});m.setLang=function(n,o,p){var q=this.get(n);q.lang[o]=p;};(function(){var n={},o=function(p,q){var r=function(){n[p]=1;q();},s=new k('img');s.on('load',r);s.on('error',r);s.setAttribute('src',p);};d.imageCacher={load:function(p,q){var r=p.length,s=function(){if(--r===0)q();};for(var t=0;t<p.length;t++){var u=p[t];if(n[u])s();else o(u,s);}}};})();d.skins=(function(){var n={},o={},p={},q=function(r,s,t,u){var v=n[s];if(!r.skin){r.skin=v;if(v.init)v.init(r);}var w=function(G){for(var H=0;H<G.length;H++)G[H]=d.getUrl(p[s]+G[H]);};function x(G,H){return G.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(I,J,K,L){if(/^\/|^\w?:/.test(K))return I;else return'url('+H+J+K+L+')';});};if(!o[s]){var y=v.preload;if(y&&y.length>0){w(y);d.imageCacher.load(y,function(){o[s]=1;q(r,s,t,u);});return;}o[s]=1;}t=v[t];var z=!t||!!t._isLoaded;if(z)u&&u();else{var A=t._pending||(t._pending=[]);A.push(u);if(A.length>1)return;var B=!t.css||!t.css.length,C=!t.js||!t.js.length,D=function(){if(B&&C){t._isLoaded=1;for(var G=0;G<A.length;G++)if(A[G])A[G]();}};if(!B){var E=t.css;if(h.isArray(E)){w(E);for(var F=0;F<E.length;F++)d.document.appendStyleSheet(E[F]);}else{E=x(E,d.getUrl(p[s]));d.document.appendStyleText(E);}t.css=E;B=1;}if(!C){w(t.js);d.scriptLoader.load(t.js,function(){C=1;D();});}D();}};return{add:function(r,s){n[r]=s;s.skinPath=p[r]||(p[r]=d.getUrl('skins/'+r+'/'));},load:function(r,s,t){var u=r.skinName,v=r.skinPath;if(n[u])q(r,u,s,t);else{p[u]=v;d.scriptLoader.load(v+'skin.js',function(){q(r,u,s,t);});}}};})();d.themes=new d.resourceManager('themes/','theme');d.ui=function(n){if(n.ui)return n.ui;this._={handlers:{},items:{},editor:n};return this;};var n=d.ui;n.prototype={add:function(o,p,q){this._.items[o]={type:p,command:q.command||null,args:Array.prototype.slice.call(arguments,2)};},create:function(o){var t=this;var p=t._.items[o],q=p&&t._.handlers[p.type],r=p&&p.command&&t._.editor.getCommand(p.command),s=q&&q.create.apply(t,p.args);if(r)r.uiItems.push(s);return s;},addHandler:function(o,p){this._.handlers[o]=p;}};(function(){var o=0,p=function(){var A='editor'+ ++o;return d.instances&&d.instances[A]?p():A;},q={},r=function(A){var B=A.config.customConfig;if(!B)return false;B=d.getUrl(B);var C=q[B]||(q[B]={});if(C.fn){C.fn.call(A,A.config);if(d.getUrl(A.config.customConfig)==B||!r(A))A.fireOnce('customConfigLoaded');}else d.scriptLoader.load(B,function(){if(d.editorConfig)C.fn=d.editorConfig;else C.fn=function(){};r(A);});return true;},s=function(A,B){A.on('customConfigLoaded',function(){if(B){if(B.on)for(var C in B.on)A.on(C,B.on[C]);h.extend(A.config,B,true);delete A.config.on;}t(A);});if(B&&B.customConfig!=undefined)A.config.customConfig=B.customConfig;if(!r(A))A.fireOnce('customConfigLoaded');},t=function(A){var B=A.config.skin.split(','),C=B[0],D=d.getUrl(B[1]||'skins/'+C+'/');A.skinName=C;A.skinPath=D;A.skinClass='cke_skin_'+C;A.fireOnce('configLoaded');w(A);},u=function(A){d.lang.load(A.config.language,A.config.defaultLanguage,function(B,C){A.langCode=B;A.lang=h.prototypedCopy(C);if(e.gecko&&e.version<10900&&A.lang.dir=='rtl')A.lang.dir='ltr';v(A);});},v=function(A){var B=A.config,C=B.plugins,D=B.extraPlugins,E=B.removePlugins;if(D){var F=new RegExp('(?:^|,)(?:'+D.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');C=C.replace(F,'');C+=','+D;}if(E){F=new RegExp('(?:^|,)(?:'+E.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');C=C.replace(F,'');}m.load(C.split(','),function(G){var H=[],I=[],J=[];A.plugins=G;for(var K in G){var L=G[K],M=L.lang,N=m.getPath(K),O=null;L.path=N;if(M){O=h.indexOf(M,A.langCode)>=0?A.langCode:M[0];if(!L.lang[O])J.push(d.getUrl(N+'lang/'+O+'.js'));else{h.extend(A.lang,L.lang[O]);O=null;}}I.push(O);H.push(L);}d.scriptLoader.load(J,function(){var P=['beforeInit','init','afterInit'];for(var Q=0;Q<P.length;Q++)for(var R=0;R<H.length;R++){var S=H[R];if(Q===0&&I[R]&&S.lang)h.extend(A.lang,S.lang[I[R]]);if(S[P[Q]])S[P[Q]](A);}A.fire('pluginsLoaded');x(A);});});},w=function(A){d.skins.load(A,'editor',function(){u(A);});},x=function(A){var B=A.config.theme;d.themes.load(B,function(){var C=A.theme=d.themes.get(B);C.path=d.themes.getPath(B);C.build(A);if(A.config.autoUpdateElement)y(A);});},y=function(A){var B=A.element;if(A.elementMode==1&&B.is('textarea')){var C=B.$.form&&new k(B.$.form);if(C){function D(){A.updateElement();};C.on('submit',D);if(!C.$.submit.nodeName)C.$.submit=h.override(C.$.submit,function(E){return function(){A.updateElement();if(E.apply)E.apply(this,arguments);else E();};});A.on('destroy',function(){C.removeListener('submit',D);});}}};function z(){var A,B=this._.commands,C=this.mode;for(var D in B){A=B[D];A[A.modes[C]?'enable':'disable']();}};d.editor.prototype._init=function(){var C=this;var A=k.get(C._.element),B=C._.instanceConfig;delete C._.element;delete C._.instanceConfig;C._.commands={};C._.styles=[];C.element=A;C.name=A&&C.elementMode==1&&(A.getId()||A.getNameAtt())||p();if(C.name in d.instances)throw'[CKEDITOR.editor] The instance "'+C.name+'" already exists.';C.config=h.prototypedCopy(l);C.ui=new n(C);C.focusManager=new d.focusManager(C);d.fire('instanceCreated',null,C);C.on('mode',z,null,null,1);s(C,B);};})();h.extend(d.editor.prototype,{addCommand:function(o,p){return this._.commands[o]=new d.command(this,p);},addCss:function(o){this._.styles.push(o);},destroy:function(o){var p=this;if(!o)p.updateElement();p.theme.destroy(p);p.fire('destroy');d.remove(p);d.fire('instanceDestroyed',null,p);},execCommand:function(o,p){var q=this.getCommand(o),r={name:o,commandData:p,command:q};if(q&&q.state!=0)if(this.fire('beforeCommandExec',r)!==true){r.returnValue=q.exec(r.commandData);if(!q.async&&this.fire('afterCommandExec',r)!==true)return r.returnValue;}return false;},getCommand:function(o){return this._.commands[o];},getData:function(){var q=this;q.fire('beforeGetData');var o=q._.data;if(typeof o!='string'){var p=q.element;if(p&&q.elementMode==1)o=p.is('textarea')?p.getValue():p.getHtml();else o='';}o={dataValue:o};q.fire('getData',o);return o.dataValue;},getSnapshot:function(){var o=this.fire('getSnapshot');if(typeof o!='string'){var p=this.element;if(p&&this.elementMode==1)o=p.is('textarea')?p.getValue():p.getHtml();}return o;},loadSnapshot:function(o){this.fire('loadSnapshot',o);},setData:function(o,p){if(p)this.on('dataReady',function(r){r.removeListener();p.call(r.editor);});var q={dataValue:o};this.fire('setData',q);this._.data=q.dataValue;this.fire('afterSetData',q);},insertHtml:function(o){this.fire('insertHtml',o);},insertElement:function(o){this.fire('insertElement',o);},checkDirty:function(){return this.mayBeDirty&&this._.previousValue!==this.getSnapshot();},resetDirty:function(){if(this.mayBeDirty)this._.previousValue=this.getSnapshot();},updateElement:function(){var q=this;var o=q.element;if(o&&q.elementMode==1){var p=q.getData();if(q.config.htmlEncodeOutput)p=h.htmlEncode(p);if(o.is('textarea'))o.setValue(p);else o.setHtml(p);}}});d.on('loaded',function(){var o=d.editor._pending;if(o){delete d.editor._pending;for(var p=0;p<o.length;p++)o[p]._init();}});d.htmlParser=function(){this._={htmlPartsRegex:new RegExp("<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^\"'>]+)|(?:\"[^\"]*\")|(?:'[^']*'))*)\\/?>))",'g')};};(function(){var o=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,p={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};d.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(q){var D=this;var r,s,t=0,u;while(r=D._.htmlPartsRegex.exec(q)){var v=r.index;if(v>t){var w=q.substring(t,v);if(u)u.push(w);else D.onText(w);}t=D._.htmlPartsRegex.lastIndex;if(s=r[1]){s=s.toLowerCase();if(u&&i.$cdata[s]){D.onCDATA(u.join(''));u=null;}if(!u){D.onTagClose(s);continue;}}if(u){u.push(r[0]);continue;}if(s=r[3]){s=s.toLowerCase();var x={},y,z=r[4],A=!!(z&&z.charAt(z.length-1)=='/');if(z)while(y=o.exec(z)){var B=y[1].toLowerCase(),C=y[2]||y[3]||y[4]||'';if(!C&&p[B])x[B]=B;else x[B]=C;}D.onTagOpen(s,x,A);if(!u&&i.$cdata[s])u=[];continue;}if(s=r[2])D.onComment(s);}if(q.length>t)D.onText(q.substring(t,q.length));}};})();d.htmlParser.comment=function(o){this.value=o;this._={isBlockLike:false};};d.htmlParser.comment.prototype={type:8,writeHtml:function(o,p){var q=this.value;if(p){if(!(q=p.onComment(q,this)))return;if(typeof q!='string'){q.parent=this.parent;q.writeHtml(o,p);return;}}o.comment(q);}};(function(){var o=/[\t\r\n ]{2,}|[\t\r\n]/g;d.htmlParser.text=function(p){this.value=p;this._={isBlockLike:false};};d.htmlParser.text.prototype={type:3,writeHtml:function(p,q){var r=this.value;if(q&&!(r=q.onText(r,this)))return;p.text(r);}};})();(function(){d.htmlParser.cdata=function(o){this.value=o;};d.htmlParser.cdata.prototype={type:3,writeHtml:function(o){o.write(this.value);}};})();d.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var o={colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1},p=h.extend({table:1,ul:1,ol:1,dl:1},i.table,i.ul,i.ol,i.dl),q=i.$list,r=i.$listItem;d.htmlParser.fragment.fromHtml=function(s,t){var u=new d.htmlParser(),v=[],w=new d.htmlParser.fragment(),x=[],y=w,z=false,A;function B(F){if(x.length>0)for(var G=0;G<x.length;G++){var H=x[G],I=H.name,J=i[I],K=y.name&&i[y.name];if((!K||K[I])&&(!F||!J||J[F]||!i[F])){H=H.clone();H.parent=y;y=H;x.splice(G,1);G--;}}};function C(F,G,H){G=G||y||w;if(t&&!G.type){var I,J;if(F.attributes&&(J=F.attributes._cke_real_element_type))I=J;else I=F.name;if(I&&!(I in i.$body)&&!(I in i.$nonBodyContent)){var K=y;y=G;u.onTagOpen(t,{});G=y;if(H)y=K;}}if(F._.isBlockLike&&F.name!='pre'){var L=F.children.length,M=F.children[L-1],N;if(M&&M.type==3)if(!(N=h.rtrim(M.value)))F.children.length=L-1;else M.value=N;}G.add(F);if(F.returnPoint){y=F.returnPoint;delete F.returnPoint;}};u.onTagOpen=function(F,G,H){var I=new d.htmlParser.element(F,G);if(I.isUnknown&&H)I.isEmpty=true;if(i.$removeEmpty[F]){x.push(I);return;}else if(F=='pre')z=true;else if(F=='br'&&z){y.add(new d.htmlParser.text('\n'));return;}var J=y.name,K=J&&(i[J]||(y._.isBlockLike?i.div:i.span));if(K&&!I.isUnknown&&!y.isUnknown&&!K[F]){var L=false,M;if(F in q&&J in q){var N=y.children,O=N[N.length-1];if(!(O&&O.name in r))C(O=new d.htmlParser.element('li'),y);A=y,M=O;}else if(F==J)C(y,y.parent);else{if(p[J]){if(!A)A=y;}else{C(y,y.parent,true);if(!o[J])x.unshift(y);}L=true;}if(M)y=M;else y=y.returnPoint||y.parent;if(L){u.onTagOpen.apply(this,arguments);return;}}B(F);I.parent=y;I.returnPoint=A;A=0;if(I.isEmpty)C(I);else y=I;};u.onTagClose=function(F){for(var G=x.length-1;G>=0;G--)if(F==x[G].name){x.splice(G,1);return;}var H=[],I=[],J=y;while(J.type&&J.name!=F){if(!J._.isBlockLike)I.unshift(J);H.push(J);J=J.parent;}if(J.type){for(G=0;G<H.length;G++){var K=H[G];C(K,K.parent);}y=J;if(y.name=='pre')z=false;C(J,J.parent);if(J==y)y=y.parent;x=x.concat(I);}if(F=='body')t=false;};u.onText=function(F){if(!y._.hasInlineStarted&&!z){F=h.ltrim(F);if(F.length===0)return;}B();if(t&&(!y.type||y.name=='body')&&(h.trim(F)))this.onTagOpen(t,{});if(!z)F=F.replace(/[\t\r\n ]{2,}|[\t\r\n]/g,' ');y.add(new d.htmlParser.text(F));};u.onCDATA=function(F){y.add(new d.htmlParser.cdata(F));};u.onComment=function(F){y.add(new d.htmlParser.comment(F));};u.parse(s);while(y.type){var D=y.parent,E=y;if(t&&(!D.type||D.name=='body')&&(!i.$body[E.name])){y=D;u.onTagOpen(t,{});D=y;}D.add(E);y=D;}return w;};d.htmlParser.fragment.prototype={add:function(s){var v=this;var t=v.children.length,u=t>0&&v.children[t-1]||null;if(u){if(s._.isBlockLike&&u.type==3){u.value=h.rtrim(u.value);if(u.value.length===0){v.children.pop();v.add(s);return;}}u.next=s;}s.previous=u;s.parent=v;v.children.push(s);v._.hasInlineStarted=s.type==3||s.type==1&&!s._.isBlockLike;},writeHtml:function(s,t){var u;this.filterChildren=function(){var v=new d.htmlParser.basicWriter();this.writeChildrenHtml.call(this,v,t,true);var w=v.getHtml();this.children=new d.htmlParser.fragment.fromHtml(w).children;u=1;};!this.name&&t&&t.onFragment(this);this.writeChildrenHtml(s,u?null:t);},writeChildrenHtml:function(s,t){for(var u=0;u<this.children.length;u++)this.children[u].writeHtml(s,t);}};})();d.htmlParser.element=function(o,p){var u=this;u.name=o;u.attributes=p||(p={});u.children=[];var q=p._cke_real_element_type||o,r=i,s=!!(r.$nonBodyContent[q]||r.$block[q]||r.$listItem[q]||r.$tableContent[q]||r.$nonEditable[q]||q=='br'),t=!!r.$empty[o];u.isEmpty=t;u.isUnknown=!r[o];u._={isBlockLike:s,hasInlineStarted:t||!s};};(function(){var o=function(p,q){p=p[0];q=q[0];return p<q?-1:p>q?1:0;};d.htmlParser.element.prototype={type:1,add:d.htmlParser.fragment.prototype.add,clone:function(){return new d.htmlParser.element(this.name,this.attributes);},writeHtml:function(p,q){var r=this.attributes,s=this,t=s.name,u,v,w,x;s.filterChildren=function(){if(!x){var C=new d.htmlParser.basicWriter();d.htmlParser.fragment.prototype.writeChildrenHtml.call(s,C,q);s.children=new d.htmlParser.fragment.fromHtml(C.getHtml()).children;x=1;}};if(q){for(;;){if(!(t=q.onElementName(t)))return;s.name=t;if(!(s=q.onElement(s)))return;s.parent=this.parent;if(s.name==t)break;if(s.type!=1){s.writeHtml(p,q);return;}t=s.name;if(!t){this.writeChildrenHtml.call(s,p,x?null:q);return;}}r=s.attributes;}p.openTag(t,r);var y=[];for(var z=0;z<2;z++)for(u in r){v=u;w=r[u];if(z==1)y.push([u,w]);else if(q){for(;;)if(!(v=q.onAttributeName(u))){delete r[u];break;}else if(v!=u){delete r[u];u=v;continue;}else break;if(v)if((w=q.onAttribute(s,v,w))===(false))delete r[v];else r[v]=w;}}if(p.sortAttributes)y.sort(o);var A=y.length;for(z=0;z<A;z++){var B=y[z];p.attribute(B[0],B[1]);}p.openTagClose(t,s.isEmpty);if(!s.isEmpty){this.writeChildrenHtml.call(s,p,x?null:q);p.closeTag(t);}},writeChildrenHtml:function(p,q){d.htmlParser.fragment.prototype.writeChildrenHtml.apply(this,arguments);}};})();(function(){d.htmlParser.filter=h.createClass({$:function(t){this._={elementNames:[],attributeNames:[],elements:{$length:0},attributes:{$length:0}};if(t)this.addRules(t,10);},proto:{addRules:function(t,u){var v=this;if(typeof u!='number')u=10;p(v._.elementNames,t.elementNames,u);p(v._.attributeNames,t.attributeNames,u);q(v._.elements,t.elements,u);q(v._.attributes,t.attributes,u);v._.text=r(v._.text,t.text,u)||v._.text;v._.comment=r(v._.comment,t.comment,u)||v._.comment;v._.root=r(v._.root,t.root,u)||v._.root;},onElementName:function(t){return o(t,this._.elementNames);},onAttributeName:function(t){return o(t,this._.attributeNames);},onText:function(t){var u=this._.text;return u?u.filter(t):t;},onComment:function(t,u){var v=this._.comment;return v?v.filter(t,u):t;},onFragment:function(t){var u=this._.root;return u?u.filter(t):t;},onElement:function(t){var y=this;var u=[y._.elements['^'],y._.elements[t.name],y._.elements.$],v,w;for(var x=0;x<3;x++){v=u[x];if(v){w=v.filter(t,y);if(w===false)return null;if(w&&w!=t)return y.onNode(w);if(t.parent&&!t.name)break;}}return t;},onNode:function(t){var u=t.type;return u==1?this.onElement(t):u==3?new d.htmlParser.text(this.onText(t.value)):u==8?new d.htmlParser.comment(this.onComment(t.value)):null;},onAttribute:function(t,u,v){var w=this._.attributes[u];if(w){var x=w.filter(v,t,this);if(x===false)return false;if(typeof x!='undefined')return x;}return v;}}});function o(t,u){for(var v=0;t&&v<u.length;v++){var w=u[v];t=t.replace(w[0],w[1]);}return t;};function p(t,u,v){if(typeof u=='function')u=[u];var w,x,y=t.length,z=u&&u.length;if(z){for(w=0;w<y&&t[w].pri<v;w++){}for(x=z-1;x>=0;x--){var A=u[x];if(A){A.pri=v;t.splice(w,0,A);}}}};function q(t,u,v){if(u)for(var w in u){var x=t[w];t[w]=r(x,u[w],v);if(!x)t.$length++;}};function r(t,u,v){if(u){u.pri=v;if(t){if(!t.splice){if(t.pri>v)t=[u,t];else t=[t,u];t.filter=s;}else p(t,u,v);return t;}else{u.filter=u;return u;}}};function s(t){var u=typeof t=='object';for(var v=0;v<this.length;v++){var w=this[v],x=w.apply(window,arguments);if(typeof x!='undefined'){if(x===false)return false;if(u&&x!=t)return x;}}return null;};})();d.htmlParser.basicWriter=h.createClass({$:function(){this._={output:[]};},proto:{openTag:function(o,p){this._.output.push('<',o);},openTagClose:function(o,p){if(p)this._.output.push(' />');else this._.output.push('>');},attribute:function(o,p){this._.output.push(' ',o,'="',p,'"');},closeTag:function(o){this._.output.push('</',o,'>');},text:function(o){this._.output.push(o);},comment:function(o){this._.output.push('<!--',o,'-->');},write:function(o){this._.output.push(o);},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(o){var p=this._.output.join('');if(o)this.reset();return p;}}});delete d.loadFullCore;d.instances={};d.document=new j(document);d.add=function(o){d.instances[o.name]=o;o.on('focus',function(){if(d.currentInstance!=o){d.currentInstance=o;d.fire('currentInstance');}});o.on('blur',function(){if(d.currentInstance==o){d.currentInstance=null;d.fire('currentInstance');}});};d.remove=function(o){delete d.instances[o.name];};d.TRISTATE_ON=1;d.TRISTATE_OFF=2;d.TRISTATE_DISABLED=0;g.comment=h.createClass({base:g.node,$:function(o,p){if(typeof o=='string')o=(p?p.$:document).createComment(o);this.base(o);},proto:{type:8,getOuterHtml:function(){return'<!--'+this.$.nodeValue+'-->';}}});(function(){var o={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1},p={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1},q=function(r){var s=r.getChildren();for(var t=0,u=s.count();t<u;t++){var v=s.getItem(t);if(v.type==1&&i.$block[v.getName()])return true;}return false;};g.elementPath=function(r){var x=this;var s=null,t=null,u=[],v=r;while(v){if(v.type==1){if(!x.lastElement)x.lastElement=v;var w=v.getName();if(f&&v.$.scopeName!='HTML')w=v.$.scopeName.toLowerCase()+':'+w;if(!t){if(!s&&o[w])s=v;if(p[w])if(!s&&w=='div'&&!q(v))s=v;else t=v;}u.push(v);if(w=='body')break;}v=v.getParent();}x.block=s;x.blockLimit=t;x.elements=u;};})();g.elementPath.prototype={compare:function(o){var p=this.elements,q=o&&o.elements;if(!q||p.length!=q.length)return false;for(var r=0;r<p.length;r++)if(!p[r].equals(q[r]))return false;return true;}};g.text=function(o,p){if(typeof o=='string')o=(p?p.$:document).createTextNode(o);this.$=o;};g.text.prototype=new g.node();h.extend(g.text.prototype,{type:3,getLength:function(){return this.$.nodeValue.length;},getText:function(){return this.$.nodeValue;},split:function(o){var t=this;if(f&&o==t.getLength()){var p=t.getDocument().createText('');p.insertAfter(t);return p;}var q=t.getDocument(),r=new g.text(t.$.splitText(o),q);if(e.ie8){var s=new g.text('',q);s.insertAfter(r);s.remove();}return r;},substring:function(o,p){if(typeof p!='number')return this.$.nodeValue.substr(o);else return this.$.nodeValue.substring(o,p);}});g.documentFragment=function(o){o=o||d.document;this.$=o.$.createDocumentFragment();};h.extend(g.documentFragment.prototype,k.prototype,{type:11,insertAfterNode:function(o){o=o.$;o.parentNode.insertBefore(this.$,o.nextSibling);}},true,{append:1,appendBogus:1,getFirst:1,getLast:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});(function(){function o(w,x){if(this._.end)return null;var y,z=this.range,A,B=this.guard,C=this.type,D=w?'getPreviousSourceNode':'getNextSourceNode';if(!this._.start){this._.start=1;z.trim();if(z.collapsed){this.end();return null;}}if(!w&&!this._.guardLTR){var E=z.endContainer,F=E.getChild(z.endOffset);this._.guardLTR=function(J,K){return(!K||!E.equals(J))&&((!F||!J.equals(F))&&(J.type!=1||!K||J.getName()!='body'));};}if(w&&!this._.guardRTL){var G=z.startContainer,H=z.startOffset>0&&G.getChild(z.startOffset-1);this._.guardRTL=function(J,K){return(!K||!G.equals(J))&&((!H||!J.equals(H))&&(J.type!=1||!K||J.getName()!='body'));};}var I=w?this._.guardRTL:this._.guardLTR;if(B)A=function(J,K){if(I(J,K)===false)return false;return B(J,K);};else A=I;if(this.current)y=this.current[D](false,C,A);else if(w){y=z.endContainer;if(z.endOffset>0){y=y.getChild(z.endOffset-1);if(A(y)===false)y=null;}else y=A(y)===false?null:y.getPreviousSourceNode(true,C,A);}else{y=z.startContainer;y=y.getChild(z.startOffset);if(y){if(A(y)===false)y=null;}else y=A(z.startContainer)===false?null:z.startContainer.getNextSourceNode(true,C,A);}while(y&&!this._.end){this.current=y;if(!this.evaluator||this.evaluator(y)!==false){if(!x)return y;}else if(x&&this.evaluator)return false;y=y[D](false,C,A);}this.end();return this.current=null;};function p(w){var x,y=null;while(x=o.call(this,w))y=x;return y;};g.walker=h.createClass({$:function(w){this.range=w;this._={};},proto:{end:function(){this._.end=1;},next:function(){return o.call(this);},previous:function(){return o.call(this,true);},checkForward:function(){return o.call(this,false,true)!==false;},checkBackward:function(){return o.call(this,true,true)!==false;},lastForward:function(){return p.call(this);},lastBackward:function(){return p.call(this,true);},reset:function(){delete this.current;this._={};}}});var q={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1},r={hr:1};k.prototype.isBlockBoundary=function(w){var x=h.extend({},r,w||{});return q[this.getComputedStyle('display')]||x[this.getName()];};g.walker.blockBoundary=function(w){return function(x,y){return!(x.type==1&&x.isBlockBoundary(w));};};g.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};g.walker.bookmarkContents=function(w){},g.walker.bookmark=function(w,x){function y(z){return z&&z.getName&&z.getName()=='span'&&z.hasAttribute('_fck_bookmark');};return function(z){var A,B;A=z&&!z.getName&&(B=z.getParent())&&(y(B));A=w?A:A||y(z);return x^A;};};g.walker.whitespaces=function(w){return function(x){var y=x&&x.type==3&&!h.trim(x.getText());return w^y;};};g.walker.invisible=function(w){var x=g.walker.whitespaces();return function(y){var z=x(y)||y.is&&!y.$.offsetHeight;return w^z;};};var s=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,t=g.walker.whitespaces(true),u=g.walker.bookmark(false,true),v=function(w){return u(w)&&t(w);};k.prototype.getBogus=function(){var w=this.getLast(v);if(w&&(!f?w.is&&w.is('br'):w.getText&&s.test(w.getText())))return w;return false;};})();g.range=function(o){var p=this;p.startContainer=null;p.startOffset=null;p.endContainer=null;p.endOffset=null;p.collapsed=true;p.document=o;};(function(){var o=function(w){w.collapsed=w.startContainer&&w.endContainer&&w.startContainer.equals(w.endContainer)&&w.startOffset==w.endOffset;},p=function(w,x,y){w.optimizeBookmark();var z=w.startContainer,A=w.endContainer,B=w.startOffset,C=w.endOffset,D,E;if(A.type==3)A=A.split(C);else if(A.getChildCount()>0)if(C>=A.getChildCount()){A=A.append(w.document.createText(''));E=true;}else A=A.getChild(C);if(z.type==3){z.split(B);if(z.equals(A))A=z.getNext();}else if(!B){z=z.getFirst().insertBeforeMe(w.document.createText(''));D=true;}else if(B>=z.getChildCount()){z=z.append(w.document.createText(''));D=true;}else z=z.getChild(B).getPrevious();var F=z.getParents(),G=A.getParents(),H,I,J;for(H=0;H<F.length;H++){I=F[H];J=G[H];if(!I.equals(J))break;}var K=y,L,M,N,O;for(var P=H;P<F.length;P++){L=F[P];if(K&&!L.equals(z))M=K.append(L.clone());N=L.getNext();while(N){if(N.equals(G[P])||N.equals(A))break;O=N.getNext();if(x==2)K.append(N.clone(true));else{N.remove();if(x==1)K.append(N);}N=O;}if(K)K=M;}K=y;for(var Q=H;Q<G.length;Q++){L=G[Q];if(x>0&&!L.equals(A))M=K.append(L.clone());if(!F[Q]||L.$.parentNode!=F[Q].$.parentNode){N=L.getPrevious();while(N){if(N.equals(F[Q])||N.equals(z))break;O=N.getPrevious();if(x==2)K.$.insertBefore(N.$.cloneNode(true),K.$.firstChild);else{N.remove();if(x==1)K.$.insertBefore(N.$,K.$.firstChild);}N=O;}}if(K)K=M;}if(x==2){var R=w.startContainer;if(R.type==3){R.$.data+=R.$.nextSibling.data;R.$.parentNode.removeChild(R.$.nextSibling);}var S=w.endContainer;if(S.type==3&&S.$.nextSibling){S.$.data+=S.$.nextSibling.data;S.$.parentNode.removeChild(S.$.nextSibling);}}else{if(I&&J&&(z.$.parentNode!=I.$.parentNode||A.$.parentNode!=J.$.parentNode)){var T=J.getIndex();if(D&&J.$.parentNode==z.$.parentNode)T--;w.setStart(J.getParent(),T);}w.collapse(true);}if(D)z.remove();if(E&&A.$.parentNode)A.remove();},q={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function r(w){var x=false,y=g.walker.bookmark(true);return function(z){if(y(z))return true;if(z.type==3){if(h.trim(z.getText()).length)return false;}else if(z.type==1)if(!q[z.getName()])if(!w&&!f&&z.getName()=='br'&&!x)x=true;else return false;return true;};};function s(w){return w.type!=3&&w.getName()in i.$removeEmpty||!h.trim(w.getText())||w.getParent().hasAttribute('_fck_bookmark');};var t=new g.walker.whitespaces(),u=new g.walker.bookmark();function v(w){return!t(w)&&!u(w);};g.range.prototype={clone:function(){var x=this;var w=new g.range(x.document);w.startContainer=x.startContainer;w.startOffset=x.startOffset;w.endContainer=x.endContainer;w.endOffset=x.endOffset;w.collapsed=x.collapsed;return w;},collapse:function(w){var x=this;if(w){x.endContainer=x.startContainer;x.endOffset=x.startOffset;}else{x.startContainer=x.endContainer;x.startOffset=x.endOffset;}x.collapsed=true;},cloneContents:function(){var w=new g.documentFragment(this.document);if(!this.collapsed)p(this,2,w);return w;},deleteContents:function(){if(this.collapsed)return;p(this,0);},extractContents:function(){var w=new g.documentFragment(this.document);if(!this.collapsed)p(this,1,w);return w;},createBookmark:function(w){var B=this;var x,y,z,A;x=B.document.createElement('span');x.setAttribute('_fck_bookmark',1);x.setStyle('display','none');x.setHtml('&nbsp;');if(w){z='cke_bm_'+h.getNextNumber();x.setAttribute('id',z+'S');}if(!B.collapsed){y=x.clone();y.setHtml('&nbsp;');if(w)y.setAttribute('id',z+'E');A=B.clone();A.collapse();A.insertNode(y);}A=B.clone();A.collapse(true);A.insertNode(x);if(y){B.setStartAfter(x);B.setEndBefore(y);}else B.moveToPosition(x,4);return{startNode:w?z+'S':x,endNode:w?z+'E':y,serializable:w};},createBookmark2:function(w){var D=this;var x=D.startContainer,y=D.endContainer,z=D.startOffset,A=D.endOffset,B,C;if(!x||!y)return{start:0,end:0};if(w){if(x.type==1){B=x.getChild(z);if(B&&B.type==3&&z>0&&B.getPrevious().type==3){x=B;z=0;}}while(x.type==3&&(C=x.getPrevious())&&(C.type==3)){x=C;z+=C.getLength();}if(!D.isCollapsed){if(y.type==1){B=y.getChild(A);if(B&&B.type==3&&A>0&&B.getPrevious().type==3){y=B;A=0;}}while(y.type==3&&(C=y.getPrevious())&&(C.type==3)){y=C;A+=C.getLength();}}}return{start:x.getAddress(w),end:D.isCollapsed?null:y.getAddress(w),startOffset:z,endOffset:A,normalized:w,is2:true};},moveToBookmark:function(w){var E=this;if(w.is2){var x=E.document.getByAddress(w.start,w.normalized),y=w.startOffset,z=w.end&&E.document.getByAddress(w.end,w.normalized),A=w.endOffset;E.setStart(x,y);if(z)E.setEnd(z,A);else E.collapse(true);}else{var B=w.serializable,C=B?E.document.getById(w.startNode):w.startNode,D=B?E.document.getById(w.endNode):w.endNode;E.setStartBefore(C);C.remove();if(D){E.setEndBefore(D);D.remove();}else E.collapse(true);}},getBoundaryNodes:function(){var B=this;var w=B.startContainer,x=B.endContainer,y=B.startOffset,z=B.endOffset,A;if(w.type==1){A=w.getChildCount();if(A>y)w=w.getChild(y);else if(A<1)w=w.getPreviousSourceNode();else{w=w.$;while(w.lastChild)w=w.lastChild;w=new g.node(w);w=w.getNextSourceNode()||w;}}if(x.type==1){A=x.getChildCount();if(A>z)x=x.getChild(z).getPreviousSourceNode(true);else if(A<1)x=x.getPreviousSourceNode();else{x=x.$;while(x.lastChild)x=x.lastChild;x=new g.node(x);}}if(w.getPosition(x)&2)w=x;return{startNode:w,endNode:x};},getCommonAncestor:function(w,x){var B=this;var y=B.startContainer,z=B.endContainer,A;if(y.equals(z)){if(w&&y.type==1&&B.startOffset==B.endOffset-1)A=y.getChild(B.startOffset);else A=y;}else A=y.getCommonAncestor(z);return x&&!A.is?A.getParent():A;},optimize:function(){var y=this;var w=y.startContainer,x=y.startOffset;if(w.type!=1)if(!x)y.setStartBefore(w);else if(x>=w.getLength())y.setStartAfter(w);w=y.endContainer;x=y.endOffset;if(w.type!=1)if(!x)y.setEndBefore(w);else if(x>=w.getLength())y.setEndAfter(w);},optimizeBookmark:function(){var y=this;var w=y.startContainer,x=y.endContainer;if(w.is&&w.is('span')&&w.hasAttribute('_fck_bookmark'))y.setStartAt(w,3);if(x&&x.is&&x.is('span')&&x.hasAttribute('_fck_bookmark'))y.setEndAt(x,4);},trim:function(w,x){var E=this;var y=E.startContainer,z=E.startOffset,A=E.collapsed;if((!w||A)&&(y&&y.type==3)){if(!z){z=y.getIndex();y=y.getParent();}else if(z>=y.getLength()){z=y.getIndex()+1;y=y.getParent();}else{var B=y.split(z);z=y.getIndex()+1;y=y.getParent();if(!A&&E.startContainer.equals(E.endContainer))E.setEnd(B,E.endOffset-E.startOffset);}E.setStart(y,z);if(A)E.collapse(true);}var C=E.endContainer,D=E.endOffset;if(!(x||A)&&C&&C.type==3){if(!D){D=C.getIndex();C=C.getParent();}else if(D>=C.getLength()){D=C.getIndex()+1;C=C.getParent();}else{C.split(D);D=C.getIndex()+1;C=C.getParent();}E.setEnd(C,D);}},enlarge:function(w){switch(w){case 1:if(this.collapsed)return;var x=this.getCommonAncestor(),y=this.document.getBody(),z,A,B,C,D,E=false,F,G,H=this.startContainer,I=this.startOffset;if(H.type==3){if(I){H=!h.trim(H.substring(0,I)).length&&H;E=!!H;}if(H)if(!(C=H.getPrevious()))B=H.getParent();}else{if(I)C=H.getChild(I-1)||H.getLast();if(!C)B=H;}while(B||C){if(B&&!C){if(!D&&B.equals(x))D=true;if(!y.contains(B))break;if(!E||B.getComputedStyle('display')!='inline'){E=false;if(D)z=B;else this.setStartBefore(B);}C=B.getPrevious();}while(C){F=false;if(C.type==3){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;F=/[\s\ufeff]$/.test(G);}else if(C.$.offsetWidth>0&&!C.getAttribute('_fck_bookmark'))if(E&&i.$removeEmpty[C.getName()]){G=C.getText();if(!/[^\s\ufeff]/.test(G))C=null;else{var J=C.$.all||C.$.getElementsByTagName('*');for(var K=0,L;L=J[K++];)if(!i.$removeEmpty[L.nodeName.toLowerCase()]){C=null;break;}}if(C)F=!!G.length;}else C=null;if(F)if(E){if(D)z=B;else if(B)this.setStartBefore(B);}else E=true;if(C){var M=C.getPrevious();if(!B&&!M){B=C;C=null;break;}C=M;}else B=null;}if(B)B=B.getParent();}H=this.endContainer;I=this.endOffset;B=C=null;D=E=false;if(H.type==3){H=!h.trim(H.substring(I)).length&&H;E=!(H&&H.getLength());if(H)if(!(C=H.getNext()))B=H.getParent();}else{C=H.getChild(I);if(!C)B=H;}while(B||C){if(B&&!C){if(!D&&B.equals(x))D=true;if(!y.contains(B))break;if(!E||B.getComputedStyle('display')!='inline'){E=false;if(D)A=B;else if(B)this.setEndAfter(B);}C=B.getNext();}while(C){F=false;if(C.type==3){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;F=/^[\s\ufeff]/.test(G);}else if(C.$.offsetWidth>0&&!C.getAttribute('_fck_bookmark'))if(E&&i.$removeEmpty[C.getName()]){G=C.getText();if(!/[^\s\ufeff]/.test(G))C=null;else{J=C.$.all||C.$.getElementsByTagName('*');for(K=0;L=J[K++];)if(!i.$removeEmpty[L.nodeName.toLowerCase()]){C=null;break;}}if(C)F=!!G.length;}else C=null;if(F)if(E)if(D)A=B;else this.setEndAfter(B);if(C){M=C.getNext();if(!B&&!M){B=C;C=null;break;}C=M;}else B=null;}if(B)B=B.getParent();}if(z&&A){x=z.contains(A)?A:z;this.setStartBefore(x);this.setEndAfter(x);}break;case 2:case 3:var N=new g.range(this.document);y=this.document.getBody();N.setStartAt(y,1);N.setEnd(this.startContainer,this.startOffset);var O=new g.walker(N),P,Q,R=g.walker.blockBoundary(w==3?{br:1}:null),S=function(U){var V=R(U);if(!V)P=U;return V;},T=function(U){var V=S(U);if(!V&&U.is&&U.is('br'))Q=U;return V;};O.guard=S;B=O.lastBackward();P=P||y;this.setStartAt(P,!P.is('br')&&(!B&&this.checkStartOfBlock()||B&&P.contains(B))?1:4);N=this.clone();N.collapse();N.setEndAt(y,2);O=new g.walker(N);O.guard=w==3?T:S;P=null;B=O.lastForward();P=P||y;this.setEndAt(P,!B&&this.checkEndOfBlock()||B&&P.contains(B)?2:3);if(Q)this.setEndAfter(Q);}},insertNode:function(w){var A=this;A.optimizeBookmark();A.trim(false,true);var x=A.startContainer,y=A.startOffset,z=x.getChild(y);if(z)w.insertBefore(z);else x.append(w);if(w.getParent().equals(A.endContainer))A.endOffset++;A.setStartBefore(w);},moveToPosition:function(w,x){this.setStartAt(w,x);this.collapse(true);},selectNodeContents:function(w){this.setStart(w,0);this.setEnd(w,w.type==3?w.getLength():w.getChildCount());},setStart:function(w,x){var y=this;y.startContainer=w;y.startOffset=x;if(!y.endContainer){y.endContainer=w;y.endOffset=x;}o(y);},setEnd:function(w,x){var y=this;y.endContainer=w;y.endOffset=x;if(!y.startContainer){y.startContainer=w;y.startOffset=x;}o(y);},setStartAfter:function(w){this.setStart(w.getParent(),w.getIndex()+1);},setStartBefore:function(w){this.setStart(w.getParent(),w.getIndex());},setEndAfter:function(w){this.setEnd(w.getParent(),w.getIndex()+1);},setEndBefore:function(w){this.setEnd(w.getParent(),w.getIndex());},setStartAt:function(w,x){var y=this;switch(x){case 1:y.setStart(w,0);break;case 2:if(w.type==3)y.setStart(w,w.getLength());else y.setStart(w,w.getChildCount());break;case 3:y.setStartBefore(w);break;case 4:y.setStartAfter(w);}o(y);},setEndAt:function(w,x){var y=this;switch(x){case 1:y.setEnd(w,0);break;case 2:if(w.type==3)y.setEnd(w,w.getLength());else y.setEnd(w,w.getChildCount());break;case 3:y.setEndBefore(w);break;case 4:y.setEndAfter(w);}o(y);},fixBlock:function(w,x){var A=this;var y=A.createBookmark(),z=A.document.createElement(x);A.collapse(w);A.enlarge(2);A.extractContents().appendTo(z);z.trim();if(!f)z.appendBogus();A.insertNode(z);A.moveToBookmark(y);return z;},splitBlock:function(w){var G=this;var x=new g.elementPath(G.startContainer),y=new g.elementPath(G.endContainer),z=x.blockLimit,A=y.blockLimit,B=x.block,C=y.block,D=null;if(!z.equals(A))return null;if(w!='br'){if(!B){B=G.fixBlock(true,w);C=new g.elementPath(G.endContainer).block;}if(!C)C=G.fixBlock(false,w);}var E=B&&G.checkStartOfBlock(),F=C&&G.checkEndOfBlock();G.deleteContents();if(B&&B.equals(C))if(F){D=new g.elementPath(G.startContainer);G.moveToPosition(C,4);C=null;}else if(E){D=new g.elementPath(G.startContainer);G.moveToPosition(B,3);B=null;}else{C=G.splitElement(B);if(!f&&!B.is('ul','ol'))B.appendBogus();}return{previousBlock:B,nextBlock:C,wasStartOfBlock:E,wasEndOfBlock:F,elementPath:D};},splitElement:function(w){var z=this;if(!z.collapsed)return null;z.setEndAt(w,2);var x=z.extractContents(),y=w.clone(false);x.appendTo(y);y.insertAfter(w);z.moveToPosition(w,4);return y;},checkBoundaryOfElement:function(w,x){var y=this.clone();y[x==1?'setStartAt':'setEndAt'](w,x==1?1:2);var z=new g.walker(y),A=false;z.evaluator=s;return z[x==1?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var C=this;var w=C.startContainer,x=C.startOffset;if(x&&w.type==3){var y=h.ltrim(w.substring(0,x));if(y.length)return false;}C.trim();var z=new g.elementPath(C.startContainer),A=C.clone();A.collapse(true);A.setStartAt(z.block||z.blockLimit,1);var B=new g.walker(A);B.evaluator=r(true);return B.checkBackward();},checkEndOfBlock:function(){var C=this;var w=C.endContainer,x=C.endOffset;if(w.type==3){var y=h.rtrim(w.substring(x));if(y.length)return false;}C.trim();var z=new g.elementPath(C.endContainer),A=C.clone();A.collapse(false);A.setEndAt(z.block||z.blockLimit,2);var B=new g.walker(A);B.evaluator=r(false);return B.checkForward();},moveToElementEditablePosition:function(w,x){var y;while(w&&w.type==1){y=w.isEditable();if(y)this.moveToPosition(w,x?2:1);else if(i.$inline[w.getName()]){this.moveToPosition(w,x?4:3);return true;}if(i.$empty[w.getName()])w=w[x?'getPrevious':'getNext'](v);else w=w[x?'getLast':'getFirst'](v);if(w&&w.type==3){this.moveToPosition(w,x?4:3);return true;}}return y;},moveToElementEditStart:function(w){return this.moveToElementEditablePosition(w);},moveToElementEditEnd:function(w){return this.moveToElementEditablePosition(w,true);},getEnclosedNode:function(){var w=this.clone(),x=new g.walker(w),y=g.walker.bookmark(true),z=g.walker.whitespaces(true),A=function(C){return z(C)&&y(C);};w.evaluator=A;var B=x.next();x.reset();return B&&B.equals(x.previous())?B:null;},getTouchedStartNode:function(){var w=this.startContainer;if(this.collapsed||w.type!=1)return w;return w.getChild(this.startOffset)||w;},getTouchedEndNode:function(){var w=this.endContainer;if(this.collapsed||w.type!=1)return w;return w.getChild(this.endOffset-1)||w;}};})();d.POSITION_AFTER_START=1;d.POSITION_BEFORE_END=2;d.POSITION_BEFORE_START=3;d.POSITION_AFTER_END=4;d.ENLARGE_ELEMENT=1;d.ENLARGE_BLOCK_CONTENTS=2;d.ENLARGE_LIST_ITEM_CONTENTS=3;d.START=1;d.END=2;d.STARTEND=3;(function(){var o=f&&e.version<7,p=f&&e.version==7,q=o?d.basePath+'images/spacer.gif':p?'about:blank':'data:image/png;base64,',r=k.createFromHtml('<div style="width:0px;height:0px;position:absolute;left:-10000px;background-image:url('+q+')"></div>',d.document);r.appendTo(d.document.getHead());try{e.hc=r.getComputedStyle('background-image')=='none';}catch(s){e.hc=false;}if(e.hc)e.cssClass+=' cke_hc';r.remove();})();m.load(l.corePlugins.split(','),function(){d.status='loaded';d.fire('loaded');var o=d._.pending;if(o){delete d._.pending;for(var p=0;p<o.length;p++)d.add(o[p]);}});m.add('about',{init:function(o){var p=o.addCommand('about',new d.dialogCommand('about'));p.modes={wysiwyg:1,source:1};p.canUndo=false;o.ui.addButton('About',{label:o.lang.about.title,command:'about'});d.dialog.add('about',this.path+'dialogs/about.js');}});m.add('basicstyles',{requires:['styles','button'],init:function(o){var p=function(s,t,u,v){var w=new d.style(v);o.attachStyleStateChange(w,function(x){o.getCommand(u).setState(x);});o.addCommand(u,new d.styleCommand(w));o.ui.addButton(s,{label:t,command:u});},q=o.config,r=o.lang;p('Bold',r.bold,'bold',q.coreStyles_bold);p('Italic',r.italic,'italic',q.coreStyles_italic);p('Underline',r.underline,'underline',q.coreStyles_underline);p('Strike',r.strike,'strike',q.coreStyles_strike);p('Subscript',r.subscript,'subscript',q.coreStyles_subscript);p('Superscript',r.superscript,'superscript',q.coreStyles_superscript);}});l.coreStyles_bold={element:'strong',overrides:'b'};l.coreStyles_italic={element:'em',overrides:'i'};l.coreStyles_underline={element:'u'};l.coreStyles_strike={element:'strike'};l.coreStyles_subscript={element:'sub'};l.coreStyles_superscript={element:'sup'};(function(){function o(s,t){var u=t.block||t.blockLimit;if(!u||u.getName()=='body')return 2;if(u.getAscendant('blockquote',true))return 1;return 2;};function p(s){var t=s.editor,u=t.getCommand('blockquote');u.state=o(t,s.data.path);u.fire('state');};function q(s){for(var t=0,u=s.getChildCount(),v;t<u&&(v=s.getChild(t));t++)if(v.type==1&&v.isBlockBoundary())return false;return true;};var r={exec:function(s){var t=s.getCommand('blockquote').state,u=s.getSelection(),v=u&&u.getRanges()[0];if(!v)return;var w=u.createBookmarks();if(f){var x=w[0].startNode,y=w[0].endNode,z;if(x&&x.getParent().getName()=='blockquote'){z=x;while(z=z.getNext())if(z.type==1&&z.isBlockBoundary()){x.move(z,true);break;}}if(y&&y.getParent().getName()=='blockquote'){z=y;while(z=z.getPrevious())if(z.type==1&&z.isBlockBoundary()){y.move(z);break;}}}var A=v.createIterator(),B;if(t==2){var C=[];while(B=A.getNextParagraph())C.push(B);if(C.length<1){var D=s.document.createElement(s.config.enterMode==1?'p':'div'),E=w.shift();v.insertNode(D);D.append(new g.text('',s.document));v.moveToBookmark(E);v.selectNodeContents(D);v.collapse(true);E=v.createBookmark();C.push(D);w.unshift(E);}var F=C[0].getParent(),G=[];for(var H=0;H<C.length;H++){B=C[H];F=F.getCommonAncestor(B.getParent());}var I={table:1,tbody:1,tr:1,ol:1,ul:1};while(I[F.getName()])F=F.getParent();var J=null;while(C.length>0){B=C.shift();while(!B.getParent().equals(F))B=B.getParent();if(!B.equals(J))G.push(B);J=B;}while(G.length>0){B=G.shift();if(B.getName()=='blockquote'){var K=new g.documentFragment(s.document);while(B.getFirst()){K.append(B.getFirst().remove());C.push(K.getLast());}K.replace(B);}else C.push(B);}var L=s.document.createElement('blockquote');L.insertBefore(C[0]);while(C.length>0){B=C.shift();L.append(B);}}else if(t==1){var M=[],N={};while(B=A.getNextParagraph()){var O=null,P=null;while(B.getParent()){if(B.getParent().getName()=='blockquote'){O=B.getParent();P=B;break;}B=B.getParent();}if(O&&P&&!P.getCustomData('blockquote_moveout')){M.push(P);k.setMarker(N,P,'blockquote_moveout',true);}}k.clearAllMarkers(N);var Q=[],R=[];N={};while(M.length>0){var S=M.shift();L=S.getParent();if(!S.getPrevious())S.remove().insertBefore(L);else if(!S.getNext())S.remove().insertAfter(L);else{S.breakParent(S.getParent());R.push(S.getNext());}if(!L.getCustomData('blockquote_processed')){R.push(L);k.setMarker(N,L,'blockquote_processed',true);}Q.push(S);}k.clearAllMarkers(N);for(H=R.length-1;H>=0;H--){L=R[H];if(q(L))L.remove();}if(s.config.enterMode==2){var T=true;while(Q.length){S=Q.shift();if(S.getName()=='div'){K=new g.documentFragment(s.document);var U=T&&S.getPrevious()&&!(S.getPrevious().type==1&&S.getPrevious().isBlockBoundary());if(U)K.append(s.document.createElement('br'));var V=S.getNext()&&!(S.getNext().type==1&&S.getNext().isBlockBoundary());while(S.getFirst())S.getFirst().remove().appendTo(K);if(V)K.append(s.document.createElement('br'));K.replace(S);T=false;}}}}u.selectBookmarks(w);s.focus();}};m.add('blockquote',{init:function(s){s.addCommand('blockquote',r);s.ui.addButton('Blockquote',{label:s.lang.blockquote,command:'blockquote'});s.on('selectionChange',p);},requires:['domiterator']});})();m.add('button',{beforeInit:function(o){o.ui.addHandler(1,n.button.handler);}});d.UI_BUTTON=1;n.button=function(o){h.extend(this,o,{title:o.label,className:o.className||o.command&&'cke_button_'+o.command||'',click:o.click||(function(p){p.execCommand(o.command);})});this._={};};n.button.handler={create:function(o){return new n.button(o);}};n.button.prototype={canGroup:true,render:function(o,p){var q=e,r=this._.id='cke_'+h.getNextNumber();this._.editor=o;var s={id:r,button:this,editor:o,focus:function(){var y=d.document.getById(r);y.focus();},execute:function(){this.button.click(o);}},t=h.addFunction(s.execute,s),u=n.button._.instances.push(s)-1,v='',w=this.command;if(this.modes)o.on('mode',function(){this.setState(this.modes[o.mode]?2:0);},this);else if(w){w=o.getCommand(w);if(w){w.on('state',function(){this.setState(w.state);},this);v+='cke_'+(w.state==1?'on':w.state==0?'disabled':'off');}}if(!w)v+='cke_off';if(this.className)v+=' '+this.className;p.push('<span class="cke_button">','<a id="',r,'" class="',v,'" href="javascript:void(\'',(this.title||'').replace("'",''),'\')" title="',this.title,'" tabindex="-1" hidefocus="true"');if(q.opera||q.gecko&&q.mac)p.push(' onkeypress="return false;"');if(q.gecko)p.push(' onblur="this.style.cssText = this.style.cssText;"');p.push(' onkeydown="return CKEDITOR.ui.button._.keydown(',u,', event);" onfocus="return CKEDITOR.ui.button._.focus(',u,', event);" onclick="CKEDITOR.tools.callFunction(',t,', this); return false;"><span class="cke_icon"');if(this.icon){var x=(this.iconOffset||0)*(-16);p.push(' style="background-image:url(',d.getUrl(this.icon),');background-position:0 '+x+'px;"');}p.push('></span><span class="cke_label">',this.label,'</span>');if(this.hasArrow)p.push('<span class="cke_buttonarrow"></span>');p.push('</a>','</span>');if(this.onRender)this.onRender();return s;},setState:function(o){var t=this;if(t._.state==o)return;var p=d.document.getById(t._.id);if(p){p.setState(o);var q=t.title,r=t._.editor.lang.common.unavailable,s=p.getChild(1);if(o==0)q=r.replace('%1',t.title);s.setHtml(q);}t._.state=o;}};n.button._={instances:[],keydown:function(o,p){var q=n.button._.instances[o];if(q.onkey){p=new g.event(p);return q.onkey(q,p.getKeystroke())!==false;}},focus:function(o,p){var q=n.button._.instances[o],r;if(q.onfocus)r=q.onfocus(q,new g.event(p))!==false;if(e.gecko&&e.version<10900)p.preventBubble();return r;}};n.prototype.addButton=function(o,p){this.add(o,1,p);};(function(){var o=function(u,v){var w=u.document,x=w.getBody(),y=false,z=function(){y=true;};x.on(v,z);w.$.execCommand(v);x.removeListener(v,z);return y;},p=f?function(u,v){return o(u,v);}:function(u,v){try{return u.document.$.execCommand(v);}catch(w){return false;}},q=function(u){this.type=u;this.canUndo=this.type=='cut';};q.prototype={exec:function(u,v){var w=p(u,this.type);if(!w)alert(u.lang.clipboard[this.type+'Error']);return w;}};var r={canUndo:false,exec:f?function(u){u.focus();if(!u.document.getBody().fire('beforepaste')&&!o(u,'paste')){u.fire('pasteDialog');return false;}}:function(u){try{if(!u.document.getBody().fire('beforepaste')&&!u.document.$.execCommand('Paste',false,null))throw 0;}catch(v){setTimeout(function(){u.fire('pasteDialog');},0);return false;}}},s=function(u){if(this.mode!='wysiwyg')return;switch(u.data.keyCode){case 1000+86:case 2000+45:var v=this.document.getBody();if(!f&&v.fire('beforepaste'))u.cancel();else if(e.opera||e.gecko&&e.version<10900)v.fire('paste');return;case 1000+88:case 2000+46:var w=this;this.fire('saveSnapshot');setTimeout(function(){w.fire('saveSnapshot');},0);}};function t(u,v,w){var x=this.document;if(f&&x.getById('cke_pastebin'))return;var y=this.getSelection(),z=new g.range(x),A=new k(v=='text'?'textarea':'div',x);A.setAttribute('id','cke_pastebin');e.webkit&&A.append(x.createText('\xa0'));x.getBody().append(A);if(!f&&v!='html')A.setStyles({position:'absolute',left:'-1000px',top:y.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});var B=y.createBookmarks();if(v=='text'){if(f){var C=x.getBody().$.createTextRange();C.moveToElementText(A.$);C.execCommand('Paste');u.data.preventDefault();}else{x.$.designMode='off';A.$.focus();}}else{z.setStartAt(A,1);z.setEndAt(A,2);z.select(true);}window.setTimeout(function(){v=='text'&&!f&&(x.$.designMode='on');A.remove();var D;A=e.webkit&&(D=A.getFirst())&&(D.is&&D.hasClass('Apple-style-span'))?D:A;y.selectBookmarks(B);w(A['get'+(v=='text'?'Value':'Html')]());},0);};m.add('clipboard',{requires:['htmldataprocessor'],init:function(u){u.on('paste',function(z){var A=z.data;if(A.html)u.insertHtml(A.html);else if(A.text)u.insertText(A.text);},null,null,1000);u.on('pasteDialog',function(z){setTimeout(function(){u.openDialog('paste');},0);});function v(z,A,B,C){var D=u.lang[A];u.addCommand(A,B);u.ui.addButton(z,{label:D,command:A});if(u.addMenuItems)u.addMenuItem(A,{label:D,command:A,group:'clipboard',order:C});};v('Cut','cut',new q('cut'),1);v('Copy','copy',new q('copy'),4);v('Paste','paste',r,8);d.dialog.add('paste',d.getUrl(this.path+'dialogs/paste.js'));u.on('key',s,u);var w=u.config.forcePasteAsPlainText?'text':'html';u.on('contentDom',function(){var z=u.document.getBody();z.on(w=='text'&&f?'paste':'beforepaste',function(A){if(x)return;t.call(u,A,w,function(B){if(!B)return;var C={};C[w]=B;u.fire('paste',C);});});});if(u.contextMenu){var x;function y(z){f&&z=='Paste'&&(x=1);var A=u.document.$.queryCommandEnabled(z)?2:0;x=0;return A;};u.contextMenu.addListener(function(){return{cut:y('Cut'),copy:y('Cut'),paste:e.webkit?2:y('Paste')};});}}});})();m.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(o){var p=o.config,q=o.lang.colorButton,r;if(!e.hc){s('TextColor','fore',q.textColorTitle);s('BGColor','back',q.bgColorTitle);}function s(u,v,w){o.ui.add(u,4,{label:w,title:w,className:'cke_button_'+u.toLowerCase(),modes:{wysiwyg:1},panel:{css:o.skin.editor.css},onBlock:function(x,y){var z=x.addBlock(y);z.autoSize=true;z.element.addClass('cke_colorblock');z.element.setHtml(t(x,v));var A=z.keys;A[39]='next';A[9]='next';A[37]='prev';A[2000+9]='prev';A[32]='click';}});};function t(u,v){var w=[],x=p.colorButton_colors.split(','),y=h.addFunction(function(C,D){if(C=='?'){var E=arguments.callee;function F(H){this.removeListener('ok',F);this.removeListener('cancel',F);H.name=='ok'&&E(this.getContentElement('picker','selectedColor').getValue(),D);};o.openDialog('colordialog',function(){this.on('ok',F);this.on('cancel',F);});return;}o.focus();u.hide();var G=new d.style(p['colorButton_'+D+'Style'],C&&{color:C});o.fire('saveSnapshot');if(C)G.apply(o.document);else G.remove(o.document);o.fire('saveSnapshot');});w.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',q.auto,'" onclick="CKEDITOR.tools.callFunction(',y,",null,'",v,"');return false;\" href=\"javascript:void('",q.auto,'\')"><table cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" style="background-color:#000"></span></td><td colspan=7 align=center>',q.auto,'</td></tr></table></a><table cellspacing=0 cellpadding=0 width="100%">');for(var z=0;z<x.length;z++){if(z%8===0)w.push('</tr><tr>');var A=x[z],B=o.lang.colors[A]||A;w.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',B,'" onclick="CKEDITOR.tools.callFunction(',y,",'#",A,"','",v,"'); return false;\" href=\"javascript:void('",B,'\')"><span class="cke_colorbox" style="background-color:#',A,'"></span></a></td>');}if(p.colorButton_enableMore)w.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',q.more,'" onclick="CKEDITOR.tools.callFunction(',y,",'?','",v,"');return false;\" href=\"javascript:void('",q.more,"')\">",q.more,'</a></td>');w.push('</tr></table>');return w.join('');};}});l.colorButton_enableMore=true;l.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';l.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};l.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};(function(){m.colordialog={init:function(o){o.addCommand('colordialog',new d.dialogCommand('colordialog'));d.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};m.add('colordialog',m.colordialog);})();m.add('contextmenu',{requires:['menu'],beforeInit:function(o){o.contextMenu=new m.contextMenu(o);o.addCommand('contextMenu',{exec:function(){o.contextMenu.show(o.document.getBody());}});}});m.contextMenu=h.createClass({$:function(o){this.id='cke_'+h.getNextNumber();this.editor=o;this._.listeners=[];this._.functionId=h.addFunction(function(p){this._.panel.hide();o.focus();o.execCommand(p);},this);},_:{onMenu:function(o,p,q,r){var s=this._.menu,t=this.editor;if(s){s.hide();s.removeAll();}else{s=this._.menu=new d.menu(t);s.onClick=h.bind(function(C){var D=true;s.hide();if(f)s.onEscape();if(C.onClick)C.onClick();else if(C.command)t.execCommand(C.command);D=false;},this);s.onEscape=function(){t.focus();if(f)t.getSelection().unlock(true);};}var u=this._.listeners,v=[],w=this.editor.getSelection(),x=w&&w.getStartElement();s.onHide=h.bind(function(){s.onHide=null;if(f){var C=t.getSelection();C&&C.unlock();}this.onHide&&this.onHide();},this);for(var y=0;y<u.length;y++){var z=u[y](x,w);if(z)for(var A in z){var B=this.editor.getMenuItem(A);if(B){B.state=z[A];s.add(B);}}}s.items.length&&s.show(o,p||(t.lang.dir=='rtl'?2:1),q,r);}},proto:{addTarget:function(o,p){if(e.opera){var q;o.on('mousedown',function(u){u=u.data;if(u.$.button!=2){if(u.getKeystroke()==1000+1)o.fire('contextmenu',u);return;}if(p&&(u.$.ctrlKey||u.$.metaKey))return;var v=u.getTarget();if(!q){var w=v.getDocument();q=w.createElement('input');q.$.type='button';w.getBody().append(q);}q.setAttribute('style','position:absolute;top:'+(u.$.clientY-2)+'px;left:'+(u.$.clientX-2)+'px;width:5px;height:5px;opacity:0.01');});o.on('mouseup',function(u){if(q){q.remove();q=undefined;o.fire('contextmenu',u.data);}});}o.on('contextmenu',function(u){var v=u.data;if(p&&(e.webkit?r:v.$.ctrlKey||v.$.metaKey))return;if(f){var w=this.editor.getSelection();w&&w.lock();}v.preventDefault();var x=v.getTarget().getDocument().getDocumentElement(),y=v.$.clientX,z=v.$.clientY;h.setTimeout(function(){this._.onMenu(x,null,y,z);},0,this);},this);if(e.webkit){var r,s=function(u){r=u.data.$.ctrlKey||u.data.$.metaKey;},t=function(){r=0;};o.on('keydown',s);o.on('keyup',t);o.on('contextmenu',t);}},addListener:function(o){this._.listeners.push(o);},show:function(o,p,q,r){this.editor.focus();this._.onMenu(o||d.document.getDocumentElement(),p,q||0,r||0);}}});(function(){m.add('div',{requires:['editingblock','domiterator'],init:function(o){var p=o.lang.div;o.addCommand('creatediv',new d.dialogCommand('creatediv'));o.addCommand('editdiv',new d.dialogCommand('editdiv'));o.addCommand('removediv',{exec:function(q){var r=q.getSelection(),s=r&&r.getRanges(),t,u=r.createBookmarks(),v,w=[];function x(z){var A=new g.elementPath(z),B=A.blockLimit,C=B.is('div')&&B;if(C&&!C.getAttribute('_cke_div_added')){w.push(C);C.setAttribute('_cke_div_added');}};for(var y=0;y<s.length;y++){t=s[y];if(t.collapsed)x(r.getStartElement());else{v=new g.walker(t);v.evaluator=x;v.lastForward();}}for(y=0;y<w.length;y++)w[y].remove(true);r.selectBookmarks(u);}});o.ui.addButton('CreateDiv',{label:p.toolbar,command:'creatediv'});if(o.addMenuItems){o.addMenuItems({editdiv:{label:p.edit,command:'editdiv',group:'div',order:1},removediv:{label:p.remove,command:'removediv',group:'div',order:5}});if(o.contextMenu)o.contextMenu.addListener(function(q,r){if(!q)return null;var s=new g.elementPath(q),t=s.blockLimit;if(t&&t.getAscendant('div',true))return{editdiv:2,removediv:2};return null;});}d.dialog.add('creatediv',this.path+'dialogs/div.js');d.dialog.add('editdiv',this.path+'dialogs/div.js');}});})();(function(){var o={toolbarFocus:{exec:function(q){var r=q._.elementsPath.idBase,s=d.document.getById(r+'0');if(s)s.focus();}}},p='<span class="cke_empty">&nbsp;</span>';m.add('elementspath',{requires:['selection'],init:function(q){var r='cke_path_'+q.name,s,t=function(){if(!s)s=d.document.getById(r);return s;},u='cke_elementspath_'+h.getNextNumber()+'_';q._.elementsPath={idBase:u};q.on('themeSpace',function(v){if(v.data.space=='bottom')v.data.html+='<div id="'+r+'" class="cke_path">'+p+'</div>';});q.on('selectionChange',function(v){var w=e,x=v.data.selection,y=x.getStartElement(),z=[],A=this._.elementsPath.list=[];while(y){var B=A.push(y)-1,C;if(y.getAttribute('_cke_real_element_type'))C=y.getAttribute('_cke_real_element_type');else C=y.getName();var D='';if(w.opera||w.gecko&&w.mac)D+=' onkeypress="return false;"';if(w.gecko)D+=' onblur="this.style.cssText = this.style.cssText;"';z.unshift('<a id="',u,B,'" href="javascript:void(\'',C,'\')" tabindex="-1" title="',q.lang.elementsPath.eleTitle.replace(/%1/,C),'"'+(e.gecko&&e.version<10900?' onfocus="event.preventBubble();"':'')+' hidefocus="true" '+" onkeydown=\"return CKEDITOR._.elementsPath.keydown('",this.name,"',",B,', event);"'+D," onclick=\"return CKEDITOR._.elementsPath.click('",this.name,"',",B,');">',C,'</a>');if(C=='body')break;y=y.getParent();}t().setHtml(z.join('')+p);});q.on('contentDomUnload',function(){t().setHtml(p);});q.addCommand('elementsPathFocus',o.toolbarFocus);}});})();d._.elementsPath={click:function(o,p){var q=d.instances[o];q.focus();var r=q._.elementsPath.list[p];q.getSelection().selectElement(r);return false;},keydown:function(o,p,q){var r=n.button._.instances[p],s=d.instances[o],t=s._.elementsPath.idBase,u;q=new g.event(q);switch(q.getKeystroke()){case 37:case 9:u=d.document.getById(t+(p+1));if(!u)u=d.document.getById(t+'0');u.focus();return false;case 39:case 2000+9:u=d.document.getById(t+(p-1));if(!u)u=d.document.getById(t+(s._.elementsPath.list.length-1));u.focus();return false;case 27:s.focus();return false;case 13:case 32:this.click(o,p);return false;}return true;}};(function(){m.add('enterkey',{requires:['keystrokes','indent'],init:function(v){var w=v.specialKeys;w[13]=t;w[2000+13]=s;}});m.enterkey={enterBlock:function(v,w,x,y){x=x||u(v);var z=x.document,A=w==3?'div':'p',B=x.splitBlock(A);if(!B)return;var C=B.previousBlock,D=B.nextBlock,E=B.wasStartOfBlock,F=B.wasEndOfBlock,G;if(D){G=D.getParent();if(G.is('li')){D.breakParent(G);D.move(D.getNext(),true);}}else if(C&&(G=C.getParent())&&(G.is('li'))){C.breakParent(G);x.moveToElementEditStart(C.getNext());C.move(C.getPrevious());}if(!E&&!F){if(D.is('li')&&(G=D.getFirst(g.walker.invisible(true)))&&(G.is&&G.is('ul','ol')))(f?z.createText('\xa0'):z.createElement('br')).insertBefore(G);if(D)x.moveToElementEditStart(D);}else{if(E&&F&&C.is('li')){v.execCommand('outdent');return;}var H;if(C){if(!y&&!r.test(C.getName()))H=C.clone();}else if(D)H=D.clone();if(!H)H=z.createElement(A);var I=B.elementPath;if(I)for(var J=0,K=I.elements.length;J<K;J++){var L=I.elements[J];if(L.equals(I.block)||L.equals(I.blockLimit))break;if(i.$removeEmpty[L.getName()]){L=L.clone();H.moveChildren(L);H.append(L);}}if(!f)H.appendBogus();x.insertNode(H);if(f&&E&&(!F||!C.getChildCount())){x.moveToElementEditStart(F?C:H);x.select();}x.moveToElementEditStart(E&&!F?D:H);}if(!f)if(D){var M=z.createElement('span');M.setHtml('&nbsp;');x.insertNode(M);M.scrollIntoView();x.deleteContents();}else H.scrollIntoView();x.select();},enterBr:function(v,w,x,y){x=x||u(v);var z=x.document,A=w==3?'div':'p',B=x.checkEndOfBlock(),C=new g.elementPath(v.getSelection().getStartElement()),D=C.block,E=D&&C.block.getName(),F=false;if(!y&&E=='li'){q(v,w,x,y);return;}if(!y&&B&&r.test(E)){z.createElement('br').insertAfter(D);if(e.gecko)z.createText('').insertAfter(D);x.setStartAt(D.getNext(),f?3:1);}else{var G;F=E=='pre';if(F)G=z.createText(f?'\r':'\n');else G=z.createElement('br');x.deleteContents();x.insertNode(G);if(!f)z.createText('').insertAfter(G);if(B&&!f)G.getParent().appendBogus();if(!f)G.getNext().$.nodeValue='';if(f)x.setStartAt(G,4);else x.setStartAt(G.getNext(),1);if(!f){var H=null;if(!e.gecko){H=z.createElement('span');H.setHtml('&nbsp;');}else H=z.createElement('br');H.insertBefore(G.getNext());H.scrollIntoView();H.remove();}}x.collapse(true);x.select(F);}};var o=m.enterkey,p=o.enterBr,q=o.enterBlock,r=/^h[1-6]$/;function s(v){return t(v,v.config.shiftEnterMode,true);};function t(v,w,x){if(v.mode!='wysiwyg')return false;if(!w)w=v.config.enterMode;setTimeout(function(){v.fire('saveSnapshot');if(w==2||v.getSelection().getStartElement().hasAscendant('pre',true))p(v,w,null,x);else q(v,w,null,x);},0);return true;};function u(v){var w=v.getSelection().getRanges();for(var x=w.length-1;x>0;x--)w[x].deleteContents();return w[0];};})();(function(){var o='nbsp,gt,lt,quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',p='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',q='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv';function r(s){var t={},u=[],v={nbsp:'\xa0',shy:'­',gt:'>',lt:'<'};s=s.replace(/\b(nbsp|shy|gt|lt|amp)(?:,|$)/g,function(A,B){t[v[B]]='&'+B+';';u.push(v[B]);return'';});s=s.split(',');var w=document.createElement('div'),x;w.innerHTML='&'+s.join(';&')+';';x=w.innerHTML;w=null;for(var y=0;y<x.length;y++){var z=x.charAt(y);t[z]='&'+s[y]+';';u.push(z);}t.regex=u.join('');return t;};m.add('entities',{afterInit:function(s){var t=s.config;if(!t.entities)return;var u=s.dataProcessor,v=u&&u.htmlFilter;if(v){var w=o;if(t.entities_latin)w+=','+p;if(t.entities_greek)w+=','+q;if(t.entities_additional)w+=','+t.entities_additional;var x=r(w),y='['+x.regex+']';delete x.regex;if(t.entities_processNumerical)y='[^ -~]|'+y;y=new RegExp(y,'g');function z(A){return x[A]||'&#'+A.charCodeAt(0)+';';};v.addRules({text:function(A){return A.replace(y,z);}});}}});})();l.entities=true;l.entities_latin=true;l.entities_greek=true;l.entities_processNumerical=false;l.entities_additional='#39';(function(){function o(x,y){var z=[];if(!y)return x;else for(var A in y)z.push(A+'='+encodeURIComponent(y[A]));return x+(x.indexOf('?')!=-1?'&':'?')+z.join('&');};function p(x){x+='';var y=x.charAt(0).toUpperCase();return y+x.substr(1);};function q(x){var E=this;var y=E.getDialog(),z=y.getParentEditor();z._.filebrowserSe=E;var A=z.config['filebrowser'+p(y.getName())+'WindowWidth']||z.config.filebrowserWindowWidth||'80%',B=z.config['filebrowser'+p(y.getName())+'WindowHeight']||z.config.filebrowserWindowHeight||'70%',C=E.filebrowser.params||{};C.CKEditor=z.name;C.CKEditorFuncNum=z._.filebrowserFn;if(!C.langCode)C.langCode=z.langCode;var D=o(E.filebrowser.url,C);z.popup(D,A,B);};function r(x){var A=this;var y=A.getDialog(),z=y.getParentEditor();z._.filebrowserSe=A;if(!y.getContentElement(A['for'][0],A['for'][1]).getInputElement().$.value)return false;if(!y.getContentElement(A['for'][0],A['for'][1]).getAction())return false;return true;};function s(x,y,z){var A=z.params||{};A.CKEditor=x.name;A.CKEditorFuncNum=x._.filebrowserFn;if(!A.langCode)A.langCode=x.langCode;y.action=o(z.url,A);y.filebrowser=z;};function t(x,y,z,A){var B,C;for(var D in A){B=A[D];if(B.type=='hbox'||B.type=='vbox')t(x,y,z,B.children);if(!B.filebrowser)continue;if(typeof B.filebrowser=='string'){var E={action:B.type=='fileButton'?'QuickUpload':'Browse',target:B.filebrowser};B.filebrowser=E;}if(B.filebrowser.action=='Browse'){var F=B.filebrowser.url||x.config['filebrowser'+p(y)+'BrowseUrl']||x.config.filebrowserBrowseUrl;if(F){B.onClick=q;B.filebrowser.url=F;B.hidden=false;}}else if(B.filebrowser.action=='QuickUpload'&&B['for']){F=B.filebrowser.url||x.config['filebrowser'+p(y)+'UploadUrl']||x.config.filebrowserUploadUrl;if(F){B.onClick=r;B.filebrowser.url=F;B.hidden=false;s(x,z.getContents(B['for'][0]).get(B['for'][1]),B.filebrowser);}}}};function u(x,y){var z=y.getDialog(),A=y.filebrowser.target||null;x=x.replace(/#/g,'%23');if(A){var B=A.split(':'),C=z.getContentElement(B[0],B[1]);if(C){C.setValue(x);z.selectPage(B[0]);}}};function v(x,y,z){if(z.indexOf(';')!==-1){var A=z.split(';');for(var B=0;B<A.length;B++)if(v(x,y,A[B]))return true;return false;}return x.getContents(y).get(z).filebrowser&&x.getContents(y).get(z).filebrowser.url;};function w(x,y){var C=this;var z=C._.filebrowserSe.getDialog(),A=C._.filebrowserSe['for'],B=C._.filebrowserSe.filebrowser.onSelect;if(A)z.getContentElement(A[0],A[1]).reset();if(B&&B.call(C._.filebrowserSe,x,y)===false)return;if(typeof y=='string'&&y)alert(y);if(x)u(x,C._.filebrowserSe);};m.add('filebrowser',{init:function(x,y){x._.filebrowserFn=h.addFunction(w,x);d.on('dialogDefinition',function(z){for(var A in z.data.definition.contents){t(z.editor,z.data.name,z.data.definition,z.data.definition.contents[A].elements);if(z.data.definition.contents[A].hidden&&z.data.definition.contents[A].filebrowser)z.data.definition.contents[A].hidden=!v(z.data.definition,z.data.definition.contents[A].id,z.data.definition.contents[A].filebrowser);}});}});})();m.add('find',{init:function(o){var p=m.find;o.ui.addButton('Find',{label:o.lang.findAndReplace.find,command:'find'});var q=o.addCommand('find',new d.dialogCommand('find'));q.canUndo=false;o.ui.addButton('Replace',{label:o.lang.findAndReplace.replace,command:'replace'});var r=o.addCommand('replace',new d.dialogCommand('replace'));r.canUndo=false;d.dialog.add('find',this.path+'dialogs/find.js');d.dialog.add('replace',this.path+'dialogs/find.js');},requires:['styles']});l.find_highlight={element:'span',styles:{'background-color':'#004',color:'#fff'}};(function(){var o=/\.swf(?:$|\?)/i,p=/^\d+(?:\.\d+)?$/;function q(t){if(p.test(t))return t+'px';return t;};function r(t){var u=t.attributes;return u.type=='application/x-shockwave-flash'||o.test(u.src||'');};function s(t,u){var v=t.createFakeParserElement(u,'cke_flash','flash',true),w=v.attributes.style||'',x=u.attributes.width,y=u.attributes.height;if(typeof x!='undefined')w=v.attributes.style=w+'width:'+q(x)+';';if(typeof y!='undefined')w=v.attributes.style=w+'height:'+q(y)+';';return v;};m.add('flash',{init:function(t){t.addCommand('flash',new d.dialogCommand('flash'));t.ui.addButton('Flash',{label:t.lang.common.flash,command:'flash'});d.dialog.add('flash',this.path+'dialogs/flash.js');t.addCss('img.cke_flash{background-image: url('+d.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');if(t.addMenuItems)t.addMenuItems({flash:{label:t.lang.flash.properties,command:'flash',group:'flash'}});if(t.contextMenu)t.contextMenu.addListener(function(u,v){if(u&&u.is('img')&&u.getAttribute('_cke_real_element_type')=='flash')return{flash:2};});},afterInit:function(t){var u=t.dataProcessor,v=u&&u.dataFilter;if(v)v.addRules({elements:{'cke:object':function(w){var x=w.attributes,y=x.classid&&String(x.classid).toLowerCase();if(!y){for(var z=0;z<w.children.length;z++)if(w.children[z].name=='cke:embed'){if(!r(w.children[z]))return null;return s(t,w);}return null;}return s(t,w);},'cke:embed':function(w){if(!r(w))return null;return s(t,w);}}},5);},requires:['fakeobjects']});})();h.extend(l,{flashEmbedTagOnly:false,flashAddEmbedTag:true,flashConvertOnEdit:false});(function(){function o(p,q,r,s,t,u,v){var w=p.config,x=t.split(';'),y=[],z={};for(var A=0;A<x.length;A++){var B={},C=x[A].split('/'),D=x[A]=C[0];B[r]=y[A]=C[1]||D;z[D]=new d.style(v,B);}p.ui.addRichCombo(q,{label:s.label,title:s.panelTitle,voiceLabel:s.voiceLabel,className:'cke_'+(r=='size'?'fontSize':'font'),multiSelect:false,panel:{css:p.skin.editor.css.concat(w.contentsCss),voiceLabel:s.panelVoiceLabel},init:function(){this.startGroup(s.panelTitle);for(var E=0;E<x.length;E++){var F=x[E];this.add(F,'<span style="font-'+r+':'+y[E]+'">'+F+'</span>',F);}},onClick:function(E){p.focus();p.fire('saveSnapshot');var F=z[E];if(this.getValue()==E)F.remove(p.document);else F.apply(p.document);p.fire('saveSnapshot');},onRender:function(){p.on('selectionChange',function(E){var F=this.getValue(),G=E.data.path,H=G.elements;for(var I=0,J;I<H.length;I++){J=H[I];for(var K in z)if(z[K].checkElementRemovable(J,true)){if(K!=F)this.setValue(K);return;}}this.setValue('',u);},this);}});};m.add('font',{requires:['richcombo','styles'],init:function(p){var q=p.config;o(p,'Font','family',p.lang.font,q.font_names,q.font_defaultLabel,q.font_style);o(p,'FontSize','size',p.lang.fontSize,q.fontSize_sizes,q.fontSize_defaultLabel,q.fontSize_style);}});})();l.font_names='Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';l.font_defaultLabel='';l.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};l.fontSize_sizes='8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px';l.fontSize_defaultLabel='';l.fontSize_style={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};m.add('format',{requires:['richcombo','styles'],init:function(o){var p=o.config,q=o.lang.format,r=p.format_tags.split(';'),s={};for(var t=0;t<r.length;t++){var u=r[t];s[u]=new d.style(p['format_'+u]);}o.ui.addRichCombo('Format',{label:q.label,title:q.panelTitle,voiceLabel:q.voiceLabel,className:'cke_format',multiSelect:false,panel:{css:o.skin.editor.css.concat(p.contentsCss),voiceLabel:q.panelVoiceLabel},init:function(){this.startGroup(q.panelTitle);for(var v in s){var w=q['tag_'+v];this.add(v,'<'+v+'>'+w+'</'+v+'>',w);}},onClick:function(v){o.focus();o.fire('saveSnapshot');s[v].apply(o.document);setTimeout(function(){o.fire('saveSnapshot');},0);},onRender:function(){o.on('selectionChange',function(v){var w=this.getValue(),x=v.data.path;for(var y in s)if(s[y].checkActive(x)){if(y!=w)this.setValue(y,o.lang.format['tag_'+y]);return;}this.setValue('');},this);}});}});l.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address;div';l.format_p={element:'p'};l.format_div={element:'div'};l.format_pre={element:'pre'};l.format_address={element:'address'};l.format_h1={element:'h1'};l.format_h2={element:'h2'};l.format_h3={element:'h3'};l.format_h4={element:'h4'};l.format_h5={element:'h5'};l.format_h6={element:'h6'};m.add('forms',{init:function(o){var p=o.lang;o.addCss('form{border: 1px dotted #FF0000;padding: 2px;}');var q=function(s,t,u){o.addCommand(t,new d.dialogCommand(t));o.ui.addButton(s,{label:p.common[s.charAt(0).toLowerCase()+s.slice(1)],command:t});d.dialog.add(t,u);},r=this.path+'dialogs/';q('Form','form',r+'form.js');q('Checkbox','checkbox',r+'checkbox.js');q('Radio','radio',r+'radio.js');q('TextField','textfield',r+'textfield.js');q('Textarea','textarea',r+'textarea.js');q('Select','select',r+'select.js');q('Button','button',r+'button.js');q('ImageButton','imagebutton',m.getPath('image')+'dialogs/image.js');q('HiddenField','hiddenfield',r+'hiddenfield.js');if(o.addMenuItems)o.addMenuItems({form:{label:p.form.menu,command:'form',group:'form'},checkbox:{label:p.checkboxAndRadio.checkboxTitle,command:'checkbox',group:'checkbox'},radio:{label:p.checkboxAndRadio.radioTitle,command:'radio',group:'radio'},textfield:{label:p.textfield.title,command:'textfield',group:'textfield'},hiddenfield:{label:p.hidden.title,command:'hiddenfield',group:'hiddenfield'},imagebutton:{label:p.image.titleButton,command:'imagebutton',group:'imagebutton'},button:{label:p.button.title,command:'button',group:'button'},select:{label:p.select.title,command:'select',group:'select'},textarea:{label:p.textarea.title,command:'textarea',group:'textarea'}});if(o.contextMenu){o.contextMenu.addListener(function(s){if(s&&s.hasAscendant('form',true))return{form:2};});o.contextMenu.addListener(function(s){if(s){var t=s.getName();if(t=='select')return{select:2};if(t=='textarea')return{textarea:2};if(t=='input'){var u=s.getAttribute('type');if(u=='text'||u=='password')return{textfield:2};if(u=='button'||u=='submit'||u=='reset')return{button:2};if(u=='checkbox')return{checkbox:2};if(u=='radio')return{radio:2};if(u=='image')return{imagebutton:2};}if(t=='img'&&s.getAttribute('_cke_real_element_type')=='hiddenfield')return{hiddenfield:2};}});}},afterInit:function(o){if(f){var p=o.dataProcessor,q=p&&p.htmlFilter;q&&q.addRules({elements:{input:function(r){var s=r.attributes,t=s.type;if(t=='checkbox'||t=='radio')s.value=='on'&&delete s.value;}}});}},requires:['image']});if(f)k.prototype.hasAttribute=function(o){var r=this;var p=r.$.attributes.getNamedItem(o);if(r.getName()=='input')switch(o){case'class':return r.$.className.length>0;case'checked':return!!r.$.checked;case'value':var q=r.getAttribute('type');if(q=='checkbox'||q=='radio')return r.$.value!='on';break;default:}return!!(p&&p.specified);};(function(){var o={canUndo:false,exec:function(q){q.insertElement(q.document.createElement('hr'));}},p='horizontalrule';m.add(p,{init:function(q){q.addCommand(p,o);q.ui.addButton('HorizontalRule',{label:q.lang.horizontalrule,command:p});}});})();(function(){var o=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,p='{cke_protected}';function q(R){var S=R.children.length,T=R.children[S-1];while(T&&T.type==3&&!h.trim(T.value))T=R.children[--S];return T;};function r(R,S){var T=R.children,U=q(R);if(U){if((S||!f)&&(U.type==1&&U.name=='br'))T.pop();if(U.type==3&&o.test(U.value))T.pop();}};function s(R){var S=q(R);return!S||S.type==1&&S.name=='br';};function t(R){r(R,true);if(s(R))if(f)R.add(new d.htmlParser.text('\xa0'));else R.add(new d.htmlParser.element('br',{}));};function u(R){r(R);if(s(R))R.add(new d.htmlParser.text('\xa0'));};var v=i,w=h.extend({},v.$block,v.$listItem,v.$tableContent);for(var x in w)if(!('br'in v[x]))delete w[x];delete w.pre;var y={attributeNames:[[/^on/,'_cke_pa_on']]},z={elements:{}};for(x in w)z.elements[x]=t;var A={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^_cke_(saved|pa)_/,''],[/^_cke.*/,''],['hidefocus','']],elements:{$:function(R){var S=R.attributes;if(S){if(S.cke_temp)return false;var T=['name','href','src'],U;for(var V=0;V<T.length;V++){U='_cke_saved_'+T[V];U in S&&delete S[T[V]];}}return R;},embed:function(R){var S=R.parent;if(S&&S.name=='object'){var T=S.attributes.width,U=S.attributes.height;T&&(R.attributes.width=T);U&&(R.attributes.height=U);}},param:function(R){R.children=[];R.isEmpty=true;return R;},a:function(R){if(!(R.children.length||R.attributes.name||R.attributes._cke_saved_name))return false;},body:function(R){delete R.attributes.spellcheck;delete R.attributes.contenteditable;},style:function(R){var S=R.children[0];S&&S.value&&(S.value=h.trim(S.value));if(!R.attributes.type)R.attributes.type='text/css';}},attributes:{'class':function(R,S){return h.ltrim(R.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}},comment:function(R){if(R.substr(0,p.length)==p){if(R.substr(p.length,3)=='{C}')R=R.substr(p.length+3);else R=R.substr(p.length);return new d.htmlParser.cdata(decodeURIComponent(R));}return R;}},B={elements:{}};for(x in w)B.elements[x]=u;if(f)A.attributes.style=function(R,S){return R.toLowerCase();};var C=/<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi,D=/(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,E=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,F=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,G=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,H=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;function I(R){return R.replace(C,'$& _cke_saved_$1');};function J(R){return R.replace(D,function(S){return'<cke:encoded>'+encodeURIComponent(S)+'</cke:encoded>';});};function K(R){return R.replace(E,function(S,T){return decodeURIComponent(T);});};function L(R){return R.replace(F,'$1cke:$2');};function M(R){return R.replace(G,'$1$2');};function N(R){return R.replace(H,'<cke:$1$2></cke:$1>');};function O(R){return R.replace(/<!--(?!{cke_protected})[\s\S]+?-->/g,function(S){return'<!--'+p+'{C}'+encodeURIComponent(S).replace(/--/g,'%2D%2D')+'-->';});};function P(R){return R.replace(/<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,function(S,T){return decodeURIComponent(T);});};function Q(R,S){var T=[],U=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,V=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(S);R=R.replace(/<!--[\s\S]*?-->/g,function(X){return'<!--{cke_tempcomment}'+(T.push(X)-1)+'-->';});for(var W=0;W<V.length;W++)R=R.replace(V[W],function(X){X=X.replace(U,function(Y,Z,aa){return T[aa];});return'<!--{cke_temp}'+(T.push(X)-1)+'-->';});R=R.replace(U,function(X,Y,Z){return'<!--'+p+(Y?'{C}':'')+encodeURIComponent(T[Z]).replace(/--/g,'%2D%2D')+'-->';});return R;};m.add('htmldataprocessor',{requires:['htmlwriter'],init:function(R){var S=R.dataProcessor=new d.htmlDataProcessor(R);S.writer.forceSimpleAmpersand=R.config.forceSimpleAmpersand;S.dataFilter.addRules(y);S.dataFilter.addRules(z);S.htmlFilter.addRules(A);S.htmlFilter.addRules(B);}});d.htmlDataProcessor=function(R){var S=this;S.editor=R;S.writer=new d.htmlWriter();S.dataFilter=new d.htmlParser.filter();S.htmlFilter=new d.htmlParser.filter();};d.htmlDataProcessor.prototype={toHtml:function(R,S){R=Q(R,this.editor.config.protectedSource);R=I(R);R=J(R);R=L(R);R=N(R);var T=new k('div');T.setHtml('a'+R);R=T.getHtml().substr(1);R=M(R);R=K(R);R=P(R);var U=d.htmlParser.fragment.fromHtml(R,S),V=new d.htmlParser.basicWriter();U.writeHtml(V,this.dataFilter);R=V.getHtml(true);R=O(R);return R;},toDataFormat:function(R,S){var T=this.writer,U=d.htmlParser.fragment.fromHtml(R,S);T.reset();U.writeHtml(T,this.htmlFilter);return T.getHtml(true);}};})();l.forceSimpleAmpersand=false;m.add('image',{init:function(o){var p='image';d.dialog.add(p,this.path+'dialogs/image.js');o.addCommand(p,new d.dialogCommand(p));o.ui.addButton('Image',{label:o.lang.common.image,command:p});if(o.addMenuItems)o.addMenuItems({image:{label:o.lang.image.menu,command:'image',group:'image'}});if(o.contextMenu)o.contextMenu.addListener(function(q,r){if(!q||!q.is('img')||q.getAttribute('_cke_realelement'))return null;return{image:2};});}});l.image_removeLinkByEmptyURL=true;(function(){var o={ol:1,ul:1};function p(u,v){u.getCommand(this.name).setState(v);};function q(u){var F=this;var v=u.data.path.elements,w,x,y=u.editor;for(var z=0;z<v.length;z++){if(v[z].getName()=='li'){x=v[z];continue;}if(o[v[z].getName()]){w=v[z];break;}}if(w)if(F.name=='outdent')return p.call(F,y,2);else{while(x&&(x=x.getPrevious(g.walker.whitespaces(true))))if(x.getName&&x.getName()=='li')return p.call(F,y,2);return p.call(F,y,0);}if(!F.useIndentClasses&&F.name=='indent')return p.call(F,y,2);var A=u.data.path,B=A.block||A.blockLimit;if(!B)return p.call(F,y,0);if(F.useIndentClasses){var C=B.$.className.match(F.classNameRegex),D=0;if(C){C=C[1];D=F.indentClassMap[C];}if(F.name=='outdent'&&!D||F.name=='indent'&&D==y.config.indentClasses.length)return p.call(F,y,0);return p.call(F,y,2);}else{var E=parseInt(B.getStyle(F.indentCssProperty),10);if(isNaN(E))E=0;if(E<=0)return p.call(F,y,0);return p.call(F,y,2);}};function r(u,v,w){var x=v.startContainer,y=v.endContainer;while(x&&!x.getParent().equals(w))x=x.getParent();while(y&&!y.getParent().equals(w))y=y.getParent();if(!x||!y)return;var z=x,A=[],B=false;while(!B){if(z.equals(y))B=true;A.push(z);z=z.getNext();}if(A.length<1)return;var C=w.getParents(true);for(var D=0;D<C.length;D++)if(C[D].getName&&o[C[D].getName()]){w=C[D];break;}var E=this.name=='indent'?1:-1,F=A[0],G=A[A.length-1],H={},I=m.list.listToArray(w,H),J=I[G.getCustomData('listarray_index')].indent;for(D=F.getCustomData('listarray_index');D<=G.getCustomData('listarray_index');D++)I[D].indent+=E;for(D=G.getCustomData('listarray_index')+1;D<I.length&&I[D].indent>J;D++)I[D].indent+=E;var K=m.list.arrayToList(I,H,null,u.config.enterMode,0);if(this.name=='outdent'){var L;if((L=w.getParent())&&(L.is('li'))){var M=K.listNode.getChildren(),N=[],O=M.count(),P;for(D=O-1;D>=0;D--)if((P=M.getItem(D))&&(P.is&&P.is('li')))N.push(P);}}if(K)K.listNode.replace(w);if(N&&N.length)for(D=0;D<N.length;D++){var Q=N[D],R=Q;while((R=R.getNext())&&(R.is&&R.getName()in o))Q.append(R);Q.insertAfter(L);}k.clearAllMarkers(H);};function s(u,v){var D=this;var w=v.createIterator(),x=u.config.enterMode;w.enforceRealBlocks=true;w.enlargeBr=x!=2;var y;while(y=w.getNextParagraph())if(D.useIndentClasses){var z=y.$.className.match(D.classNameRegex),A=0;if(z){z=z[1];A=D.indentClassMap[z];}if(D.name=='outdent')A--;else A++;A=Math.min(A,u.config.indentClasses.length);A=Math.max(A,0);var B=h.ltrim(y.$.className.replace(D.classNameRegex,''));if(A<1)y.$.className=B;else y.addClass(u.config.indentClasses[A-1]);}else{var C=parseInt(y.getStyle(D.indentCssProperty),10);if(isNaN(C))C=0;C+=(D.name=='indent'?1:-1)*(u.config.indentOffset);C=Math.max(C,0);C=Math.ceil(C/u.config.indentOffset)*u.config.indentOffset;y.setStyle(D.indentCssProperty,C?C+u.config.indentUnit:'');if(y.getAttribute('style')==='')y.removeAttribute('style');}};function t(u,v){var x=this;x.name=v;x.useIndentClasses=u.config.indentClasses&&u.config.indentClasses.length>0;if(x.useIndentClasses){x.classNameRegex=new RegExp('(?:^|\\s+)('+u.config.indentClasses.join('|')+')(?=$|\\s)');x.indentClassMap={};for(var w=0;w<u.config.indentClasses.length;w++)x.indentClassMap[u.config.indentClasses[w]]=w+1;}else x.indentCssProperty=u.config.contentsLangDirection=='ltr'?'margin-left':'margin-right';};t.prototype={exec:function(u){var v=u.getSelection(),w=v&&v.getRanges()[0];if(!v||!w)return;var x=v.createBookmarks(true),y=w.getCommonAncestor();while(y&&!(y.type==1&&o[y.getName()]))y=y.getParent();if(y)r.call(this,u,w,y);else s.call(this,u,w);u.focus();u.forceNextSelectionCheck();v.selectBookmarks(x);}};m.add('indent',{init:function(u){var v=new t(u,'indent'),w=new t(u,'outdent');u.addCommand('indent',v);u.addCommand('outdent',w);u.ui.addButton('Indent',{label:u.lang.indent,command:'indent'});u.ui.addButton('Outdent',{label:u.lang.outdent,command:'outdent'});u.on('selectionChange',h.bind(q,v));u.on('selectionChange',h.bind(q,w));},requires:['domiterator','list']});})();h.extend(l,{indentOffset:40,indentUnit:'px',indentClasses:null});(function(){var o=/(-moz-|-webkit-|start|auto)/i;function p(s,t){var u=t.block||t.blockLimit;if(!u||u.getName()=='body')return 2;var v=u.getComputedStyle('text-align').replace(o,'');if(!v&&this.isDefaultAlign||v==this.value)return 1;return 2;};function q(s){var t=s.editor.getCommand(this.name);t.state=p.call(this,s.editor,s.data.path);t.fire('state');};function r(s,t,u){var x=this;x.name=t;x.value=u;var v=s.config.contentsLangDirection;x.isDefaultAlign=u=='left'&&v=='ltr'||u=='right'&&v=='rtl';var w=s.config.justifyClasses;if(w){switch(u){case'left':x.cssClassName=w[0];break;case'center':x.cssClassName=w[1];break;case'right':x.cssClassName=w[2];break;case'justify':x.cssClassName=w[3];break;}x.cssClassRegex=new RegExp('(?:^|\\s+)(?:'+w.join('|')+')(?=$|\\s)');}};r.prototype={exec:function(s){var B=this;var t=s.getSelection();if(!t)return;var u=t.createBookmarks(),v=t.getRanges(),w=B.cssClassName,x,y;for(var z=v.length-1;z>=0;z--){x=v[z].createIterator();while(y=x.getNextParagraph()){y.removeAttribute('align');if(w){var A=y.$.className=h.ltrim(y.$.className.replace(B.cssClassRegex,''));if(B.state==2&&!B.isDefaultAlign)y.addClass(w);else if(!A)y.removeAttribute('class');}else if(B.state==2&&!B.isDefaultAlign)y.setStyle('text-align',B.value);else y.removeStyle('text-align');}}s.focus();s.forceNextSelectionCheck();t.selectBookmarks(u);}};m.add('justify',{init:function(s){var t=new r(s,'justifyleft','left'),u=new r(s,'justifycenter','center'),v=new r(s,'justifyright','right'),w=new r(s,'justifyblock','justify');s.addCommand('justifyleft',t);s.addCommand('justifycenter',u);s.addCommand('justifyright',v);s.addCommand('justifyblock',w);s.ui.addButton('JustifyLeft',{label:s.lang.justify.left,command:'justifyleft'});s.ui.addButton('JustifyCenter',{label:s.lang.justify.center,command:'justifycenter'});s.ui.addButton('JustifyRight',{label:s.lang.justify.right,command:'justifyright'});s.ui.addButton('JustifyBlock',{label:s.lang.justify.block,command:'justifyblock'});s.on('selectionChange',h.bind(q,t));s.on('selectionChange',h.bind(q,v));s.on('selectionChange',h.bind(q,u));s.on('selectionChange',h.bind(q,w));},requires:['domiterator']});})();h.extend(l,{justifyClasses:null});m.add('keystrokes',{beforeInit:function(o){o.keystrokeHandler=new d.keystrokeHandler(o);o.specialKeys={};},init:function(o){var p=o.config.keystrokes,q=o.config.blockedKeystrokes,r=o.keystrokeHandler.keystrokes,s=o.keystrokeHandler.blockedKeystrokes;for(var t=0;t<p.length;t++)r[p[t][0]]=p[t][1];for(t=0;t<q.length;t++)s[q[t]]=1;}});d.keystrokeHandler=function(o){var p=this;if(o.keystrokeHandler)return o.keystrokeHandler;p.keystrokes={};p.blockedKeystrokes={};p._={editor:o};return p;};(function(){var o,p=function(r){r=r.data;var s=r.getKeystroke(),t=this.keystrokes[s],u=this._.editor;o=u.fire('key',{keyCode:s})===true;if(!o){if(t){var v={from:'keystrokeHandler'};o=u.execCommand(t,v)!==false;}if(!o){var w=u.specialKeys[s];o=w&&w(u)===true;if(!o)o=!!this.blockedKeystrokes[s];}}if(o)r.preventDefault(true);return!o;},q=function(r){if(o){o=false;r.data.preventDefault(true);}};d.keystrokeHandler.prototype={attach:function(r){r.on('keydown',p,this);if(e.opera||e.gecko&&e.mac)r.on('keypress',q,this);}};})();l.blockedKeystrokes=[1000+66,1000+73,1000+85];l.keystrokes=[[4000+121,'toolbarFocus'],[4000+122,'elementsPathFocus'],[2000+121,'contextMenu'],[1000+2000+121,'contextMenu'],[1000+90,'undo'],[1000+89,'redo'],[1000+2000+90,'redo'],[1000+76,'link'],[1000+66,'bold'],[1000+73,'italic'],[1000+85,'underline'],[4000+109,'toolbarCollapse']];m.add('link',{init:function(o){o.addCommand('link',new d.dialogCommand('link'));o.addCommand('anchor',new d.dialogCommand('anchor'));o.addCommand('unlink',new d.unlinkCommand());o.ui.addButton('Link',{label:o.lang.link.toolbar,command:'link'});o.ui.addButton('Unlink',{label:o.lang.unlink,command:'unlink'});o.ui.addButton('Anchor',{label:o.lang.anchor.toolbar,command:'anchor'});d.dialog.add('link',this.path+'dialogs/link.js');d.dialog.add('anchor',this.path+'dialogs/anchor.js');o.addCss('img.cke_anchor{background-image: url('+d.getUrl(this.path+'images/anchor.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 18px;'+'height: 18px;'+'}\n'+'a.cke_anchor'+'{'+'background-image: url('+d.getUrl(this.path+'images/anchor.gif')+');'+'background-position: 0 center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'padding-left: 18px;'+'}');o.on('selectionChange',function(p){var q=o.getCommand('unlink'),r=p.data.path.lastElement.getAscendant('a',true);if(r&&r.getName()=='a'&&r.getAttribute('href'))q.setState(2);else q.setState(0);});if(o.addMenuItems)o.addMenuItems({anchor:{label:o.lang.anchor.menu,command:'anchor',group:'anchor'},link:{label:o.lang.link.menu,command:'link',group:'link',order:1},unlink:{label:o.lang.unlink,command:'unlink',group:'link',order:5}});if(o.contextMenu)o.contextMenu.addListener(function(p,q){if(!p)return null;var r=p.is('img')&&p.getAttribute('_cke_real_element_type')=='anchor';if(!r){if(!(p=p.getAscendant('a',true)))return null;r=p.getAttribute('name')&&!p.getAttribute('href');}return r?{anchor:2}:{link:2,unlink:2};});},afterInit:function(o){var p=o.dataProcessor,q=p&&p.dataFilter;if(q)q.addRules({elements:{a:function(r){var s=r.attributes;if(s.name&&!s.href)return o.createFakeParserElement(r,'cke_anchor','anchor');}}});},requires:['fakeobjects']});d.unlinkCommand=function(){};d.unlinkCommand.prototype={exec:function(o){var p=o.getSelection(),q=p.createBookmarks(),r=p.getRanges(),s,t;for(var u=0;u<r.length;u++){s=r[u].getCommonAncestor(true);t=s.getAscendant('a',true);if(!t)continue;r[u].selectNodeContents(t);}p.selectRanges(r);o.document.$.execCommand('unlink',false,null);p.selectBookmarks(q);}};h.extend(l,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var o={ol:1,ul:1},p=/^[\n\r\t ]*$/;m.list={listToArray:function(D,E,F,G,H){if(!o[D.getName()])return[];if(!G)G=0;if(!F)F=[];for(var I=0,J=D.getChildCount();I<J;I++){var K=D.getChild(I);if(K.$.nodeName.toLowerCase()!='li')continue;var L={parent:D,indent:G,contents:[]};if(!H){L.grandparent=D.getParent();if(L.grandparent&&L.grandparent.$.nodeName.toLowerCase()=='li')L.grandparent=L.grandparent.getParent();}else L.grandparent=H;if(E)k.setMarker(E,K,'listarray_index',F.length);F.push(L);for(var M=0,N=K.getChildCount();M<N;M++){var O=K.getChild(M);if(O.type==1&&o[O.getName()])m.list.listToArray(O,E,F,G+1,L.grandparent);else L.contents.push(O);}}return F;},arrayToList:function(D,E,F,G){if(!F)F=0;if(!D||D.length<F+1)return null;var H=D[F].parent.getDocument(),I=new g.documentFragment(H),J=null,K=F,L=Math.max(D[F].indent,0),M=null,N=G==1?'p':'div';for(;;){var O=D[K];if(O.indent==L){if(!J||D[K].parent.getName()!=J.getName()){J=D[K].parent.clone(false,true);I.append(J);}M=J.append(H.createElement('li'));for(var P=0;P<O.contents.length;P++)M.append(O.contents[P].clone(true,true));K++;}else if(O.indent==Math.max(L,0)+1){var Q=m.list.arrayToList(D,null,K,G);M.append(Q.listNode);K=Q.nextIndex;}else if(O.indent==-1&&!F&&O.grandparent){M;if(o[O.grandparent.getName()])M=H.createElement('li');else if(G!=2&&O.grandparent.getName()!='td')M=H.createElement(N);else M=new g.documentFragment(H);for(P=0;P<O.contents.length;P++)M.append(O.contents[P].clone(true,true));if(M.type==11&&K!=D.length-1){if(M.getLast()&&M.getLast().type==1&&M.getLast().getAttribute('type')=='_moz')M.getLast().remove();M.appendBogus();}if(M.type==1&&M.getName()==N&&M.$.firstChild){M.trim();var R=M.getFirst();if(R.type==1&&R.isBlockBoundary()){var S=new g.documentFragment(H);M.moveChildren(S);M=S;}}var T=M.$.nodeName.toLowerCase();if(!f&&(T=='div'||T=='p'))M.appendBogus();I.append(M);J=null;K++;}else return null;if(D.length<=K||Math.max(D[K].indent,0)<L)break;}if(E){var U=I.getFirst();while(U){if(U.type==1)k.clearMarkers(E,U);U=U.getNextSourceNode();}}return{listNode:I,nextIndex:K};}};function q(D,E){D.getCommand(this.name).setState(E);};function r(D){var E=D.data.path,F=E.blockLimit,G=E.elements,H;for(var I=0;I<G.length&&(H=G[I])&&(!H.equals(F));I++)if(o[G[I].getName()])return q.call(this,D.editor,this.type==G[I].getName()?1:2);return q.call(this,D.editor,2);};function s(D,E,F,G){var H=m.list.listToArray(E.root,F),I=[];for(var J=0;J<E.contents.length;J++){var K=E.contents[J];K=K.getAscendant('li',true);if(!K||K.getCustomData('list_item_processed'))continue;I.push(K);k.setMarker(F,K,'list_item_processed',true);}var L=E.root.getDocument().createElement(this.type);for(J=0;J<I.length;J++){var M=I[J].getCustomData('listarray_index');H[M].parent=L;}var N=m.list.arrayToList(H,F,null,D.config.enterMode),O,P=N.listNode.getChildCount();for(J=0;J<P&&(O=N.listNode.getChild(J));J++)if(O.getName()==this.type)G.push(O);N.listNode.replace(E.root);};function t(D,E,F){var G=E.contents,H=E.root.getDocument(),I=[];if(G.length==1&&G[0].equals(E.root)){var J=H.createElement('div');G[0].moveChildren&&G[0].moveChildren(J);G[0].append(J);G[0]=J;}var K=E.contents[0].getParent();for(var L=0;L<G.length;L++)K=K.getCommonAncestor(G[L].getParent());for(L=0;L<G.length;L++){var M=G[L],N;while(N=M.getParent()){if(N.equals(K)){I.push(M);break;}M=N;}}if(I.length<1)return;var O=I[I.length-1].getNext(),P=H.createElement(this.type);F.push(P);while(I.length){var Q=I.shift(),R=H.createElement('li');Q.moveChildren(R);Q.remove();R.appendTo(P);if(!f)R.appendBogus();}if(O)P.insertBefore(O);else P.appendTo(K);};function u(D,E,F){var G=m.list.listToArray(E.root,F),H=[];for(var I=0;I<E.contents.length;I++){var J=E.contents[I];J=J.getAscendant('li',true);if(!J||J.getCustomData('list_item_processed'))continue;H.push(J);k.setMarker(F,J,'list_item_processed',true);}var K=null;for(I=0;I<H.length;I++){var L=H[I].getCustomData('listarray_index');G[L].indent=-1;K=L;}for(I=K+1;I<G.length;I++)if(G[I].indent>G[I-1].indent+1){var M=G[I-1].indent+1-G[I].indent,N=G[I].indent;while(G[I]&&G[I].indent>=N){G[I].indent+=M;I++;}I--;}var O=m.list.arrayToList(G,F,null,D.config.enterMode),P=O.listNode,Q,R;function S(T){if((Q=P[T?'getFirst':'getLast']())&&(!(Q.is&&Q.isBlockBoundary())&&(R=E.root[T?'getPrevious':'getNext'](g.walker.whitespaces(true)))&&(!(R.is&&R.isBlockBoundary({br:1})))))D.document.createElement('br')[T?'insertBefore':'insertAfter'](Q);};S(true);S();P.replace(E.root);};function v(D,E){this.name=D;this.type=E;};v.prototype={exec:function(D){D.focus();var E=D.document,F=D.getSelection(),G=F&&F.getRanges();if(!G||G.length<1)return;if(this.state==2){var H=E.getBody();H.trim();if(!H.getFirst()){var I=E.createElement(D.config.enterMode==1?'p':D.config.enterMode==3?'div':'br');I.appendTo(H);G=[new g.range(E)];if(I.is('br')){G[0].setStartBefore(I);G[0].setEndAfter(I);}else G[0].selectNodeContents(I);F.selectRanges(G);}else{var J=G.length==1&&G[0],K=J&&J.getEnclosedNode();if(K&&K.is&&this.type==K.getName())q.call(this,D,1);}}var L=F.createBookmarks(true),M=[],N={};while(G.length>0){J=G.shift();var O=J.getBoundaryNodes(),P=O.startNode,Q=O.endNode;if(P.type==1&&P.getName()=='td')J.setStartAt(O.startNode,1);if(Q.type==1&&Q.getName()=='td')J.setEndAt(O.endNode,2);var R=J.createIterator(),S;R.forceBrBreak=this.state==2;while(S=R.getNextParagraph()){var T=new g.elementPath(S),U=T.elements,V=U.length,W=null,X=false,Y=T.blockLimit,Z;for(var aa=V-1;aa>=0&&(Z=U[aa]);aa--)if(o[Z.getName()]&&Y.contains(Z)){Y.removeCustomData('list_group_object');var ab=Z.getCustomData('list_group_object');if(ab)ab.contents.push(S);else{ab={root:Z,contents:[S]};M.push(ab);k.setMarker(N,Z,'list_group_object',ab);}X=true;break;}if(X)continue;var ac=Y;if(ac.getCustomData('list_group_object'))ac.getCustomData('list_group_object').contents.push(S);else{ab={root:ac,contents:[S]};k.setMarker(N,ac,'list_group_object',ab);M.push(ab);}}}var ad=[];while(M.length>0){ab=M.shift();if(this.state==2){if(o[ab.root.getName()])s.call(this,D,ab,N,ad);else t.call(this,D,ab,ad);}else if(this.state==1&&o[ab.root.getName()])u.call(this,D,ab,N);}for(aa=0;aa<ad.length;aa++){W=ad[aa];var ae,af=this;(ae=function(ag){var ah=W[ag?'getPrevious':'getNext'](g.walker.whitespaces(true));if(ah&&ah.getName&&ah.getName()==af.type){ah.remove();ah.moveChildren(W,ag?true:false);}})();ae(true);}k.clearAllMarkers(N);F.selectBookmarks(L);D.focus();}};var w=i,x=/[\t\r\n ]*(?:&nbsp;|\xa0)$/;function y(D,E){var F,G=D.children,H=G.length;for(var I=0;I<H;I++){F=G[I];if(F.name&&F.name in E)return I;}return H;};function z(D){return function(E){var F=E.children,G=y(E,w.$list),H=F[G],I=H&&H.previous,J;if(I&&(I.name&&I.name=='br'||I.value&&(J=I.value.match(x)))){var K=I;if(!(J&&J.index)&&K==F[0])F[0]=D||f?new d.htmlParser.text('\xa0'):new d.htmlParser.element('br',{});else if(K.name=='br')F.splice(G-1,1);else K.value=K.value.replace(x,'');}};};var A={elements:{}};for(var B in w.$listItem)A.elements[B]=z();var C={elements:{}};for(B in w.$listItem)C.elements[B]=z(true);m.add('list',{init:function(D){var E=new v('numberedlist','ol'),F=new v('bulletedlist','ul');D.addCommand('numberedlist',E);D.addCommand('bulletedlist',F);D.ui.addButton('NumberedList',{label:D.lang.numberedlist,command:'numberedlist'});D.ui.addButton('BulletedList',{label:D.lang.bulletedlist,command:'bulletedlist'});D.on('selectionChange',h.bind(r,E));D.on('selectionChange',h.bind(r,F));},afterInit:function(D){var E=D.dataProcessor;if(E){E.dataFilter.addRules(A);E.htmlFilter.addRules(C);}},requires:['domiterator']});})();(function(){function o(t){if(!t||t.type!=1||t.getName()!='form')return[];var u=[],v=['style','className'];for(var w=0;w<v.length;w++){var x=v[w],y=t.$.elements.namedItem(x);if(y){var z=new k(y);u.push([z,z.nextSibling]);z.remove();}}return u;};function p(t,u){if(!t||t.type!=1||t.getName()!='form')return;if(u.length>0)for(var v=u.length-1;v>=0;v--){var w=u[v][0],x=u[v][1];if(x)w.insertBefore(x);else w.appendTo(t);}};function q(t,u){var v=o(t),w={},x=t.$;if(!u){w['class']=x.className||'';x.className='';}w.inline=x.style.cssText||'';if(!u)x.style.cssText='position: static; overflow: visible';p(v);return w;};function r(t,u){var v=o(t),w=t.$;if('class'in u)w.className=u['class'];if('inline'in u)w.style.cssText=u.inline;p(v);};function s(t,u){return function(){var v=t.getViewPaneSize();u.resize(v.width,v.height,null,true);};};m.add('maximize',{init:function(t){var u=t.lang,v=d.document,w=v.getWindow(),x,y,z,A=s(w,t),B=2;t.addCommand('maximize',{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var C=t.container.getChild(0),D=t.getThemeSpace('contents');if(t.mode=='wysiwyg'){var E=t.getSelection();x=E&&E.getRanges();y=w.getScrollPosition();}else{var F=t.textarea.$;x=!f&&[F.selectionStart,F.selectionEnd];y=[F.scrollLeft,F.scrollTop];}if(this.state==2){w.on('resize',A);z=w.getScrollPosition();var G=t.container;while(G=G.getParent()){G.setCustomData('maximize_saved_styles',q(G));G.setStyle('z-index',t.config.baseFloatZIndex-1);}D.setCustomData('maximize_saved_styles',q(D,true));C.setCustomData('maximize_saved_styles',q(C,true));if(f)v.$.documentElement.style.overflow=v.getBody().$.style.overflow='hidden';else v.getBody().setStyles({overflow:'hidden',width:'0px',height:'0px'});f?setTimeout(function(){w.$.scrollTo(0,0);},0):w.$.scrollTo(0,0);var H=w.getViewPaneSize();C.setStyle('position','absolute');C.$.offsetLeft;C.setStyles({'z-index':t.config.baseFloatZIndex-1,left:'0px',top:'0px'});t.resize(H.width,H.height,null,true);var I=C.getDocumentPosition();C.setStyles({left:-1*I.x+'px',top:-1*I.y+'px'});C.addClass('cke_maximized');}else if(this.state==1){w.removeListener('resize',A);var J=[D,C];for(var K=0;K<J.length;K++){r(J[K],J[K].getCustomData('maximize_saved_styles'));J[K].removeCustomData('maximize_saved_styles');}G=t.container;while(G=G.getParent()){r(G,G.getCustomData('maximize_saved_styles'));G.removeCustomData('maximize_saved_styles');}f?setTimeout(function(){w.$.scrollTo(z.x,z.y);},0):w.$.scrollTo(z.x,z.y);C.removeClass('cke_maximized');t.fire('resize');}this.toggleState();var L=this.uiItems[0],M=this.state==2?u.maximize:u.minimize,N=t.element.getDocument().getById(L._.id);N.getChild(1).setHtml(M);N.setAttribute('title',M);N.setAttribute('href','javascript:void("'+M+'");');if(t.mode=='wysiwyg'){if(x){t.getSelection().selectRanges(x);var O=t.getSelection().getStartElement();O&&O.scrollIntoView(true);}else w.$.scrollTo(y.x,y.y);}else{if(x){F.selectionStart=x[0];F.selectionEnd=x[1];}F.scrollLeft=y[0];F.scrollTop=y[1];}x=y=null;B=this.state;},canUndo:false});t.ui.addButton('Maximize',{label:u.maximize,command:'maximize'});t.on('mode',function(){t.getCommand('maximize').setState(B);},null,null,100);}});})();m.add('newpage',{init:function(o){o.addCommand('newpage',{modes:{wysiwyg:1,source:1},exec:function(p){var q=this;p.setData(p.config.newpage_html,function(){setTimeout(function(){p.fire('afterCommandExec',{name:q.name,command:q});},200);});p.focus();},async:true});o.ui.addButton('NewPage',{label:o.lang.newPage,command:'newpage'});}});l.newpage_html='';m.add('pagebreak',{init:function(o){o.addCommand('pagebreak',m.pagebreakCmd);o.ui.addButton('PageBreak',{label:o.lang.pagebreak,command:'pagebreak'});o.addCss('img.cke_pagebreak{background-image: url('+d.getUrl(this.path+'images/pagebreak.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'clear: both;'+'display: block;'+'float: none;'+'width: 100%;'+'border-top: #999999 1px dotted;'+'border-bottom: #999999 1px dotted;'+'height: 5px;'+'}');},afterInit:function(o){var p=o.dataProcessor,q=p&&p.dataFilter;if(q)q.addRules({elements:{div:function(r){var s=r.attributes,t=s&&s.style,u=t&&r.children.length==1&&r.children[0],v=u&&u.name=='span'&&u.attributes.style;if(v&&/page-break-after\s*:\s*always/i.test(t)&&/display\s*:\s*none/i.test(v))return o.createFakeParserElement(r,'cke_pagebreak','div');}}});},requires:['fakeobjects']});m.pagebreakCmd={exec:function(o){var p=k.createFromHtml('<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>');p=o.createFakeElement(p,'cke_pagebreak','div');var q=o.getSelection().getRanges();for(var r,s=0;s<q.length;s++){r=q[s];if(s>0)p=p.clone(true);r.splitBlock('p');r.insertNode(p);}}};(function(){m.add('pastefromword',{init:function(o){var p=0,q=function(){setTimeout(function(){p=0;},0);};o.addCommand('pastefromword',{canUndo:false,exec:function(){p=1;if(o.execCommand('paste')===false)o.on('dialogHide',function(r){r.removeListener();q();});}});o.ui.addButton('PasteFromWord',{label:o.lang.pastefromword.toolbar,command:'pastefromword'});o.on('paste',function(r){var s=r.data,t;if((t=s.html)&&(p||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(t))){var u=this.loadFilterRules(function(){if(u)o.fire('paste',s);else if(!o.config.pasteFromWordPromptCleanup||p||confirm(o.lang.pastefromword.confirmCleanup))s.html=d.cleanWord(t,o);});u&&r.cancel();}},this);},loadFilterRules:function(o){var p=d.cleanWord;if(p)o();else{var q=d.getUrl(l.pasteFromWordCleanupFile||this.path+'filter/default.js');d.scriptLoader.load(q,o,null,false,true);}return!p;}});})();(function(){var o={exec:function(r){var s=h.tryThese(function(){var t=window.clipboardData.getData('Text');if(!t)throw 0;return t;},function(){window.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var t=window.Components.classes['@mozilla.org/widget/clipboard;1'].getService(window.Components.interfaces.nsIClipboard),u=window.Components.classes['@mozilla.org/widget/transferable;1'].createInstance(window.Components.interfaces.nsITransferable);u.addDataFlavor('text/unicode');t.getData(u,t.kGlobalClipboard);var v={},w={},x;u.getTransferData('text/unicode',v,w);v=v.value.QueryInterface(window.Components.interfaces.nsISupportsString);x=v.data.substring(0,w.value/2);return x;});if(!s){r.openDialog('pastetext');return false;}else r.fire('paste',{text:s});return true;}};function p(r,s){if(f){var t=r.selection;if(t.type=='Control')t.clear();t.createRange().pasteHTML(s);}else r.execCommand('inserthtml',false,s);};m.add('pastetext',{init:function(r){var s='pastetext',t=r.addCommand(s,o);r.ui.addButton('PasteText',{label:r.lang.pasteText.button,command:s});d.dialog.add(s,d.getUrl(this.path+'dialogs/pastetext.js'));if(r.config.forcePasteAsPlainText)r.on('beforeCommandExec',function(u){if(u.data.name=='paste'){r.execCommand('pastetext');u.cancel();}},null,null,0);},requires:['clipboard']});function q(r,s,t,u){while(t--)m.enterkey[s==2?'enterBr':'enterBlock'](r,s,null,u);};d.editor.prototype.insertText=function(r){this.focus();this.fire('saveSnapshot');var s=this.getSelection().getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,t=s==2,u=this.document.$,v=this,w;r=h.htmlEncode(r.replace(/\r\n|\r/g,'\n'));var x=0;r.replace(/\n+/g,function(y,z){w=r.substring(x,z);x=z+y.length;w.length&&p(u,w);var A=y.length,B=t?0:Math.floor(A/2),C=t?A:A%2;q(v,s,B);q(v,2,C,t?false:true);});w=r.substring(x,r.length);w.length&&p(u,w);this.fire('saveSnapshot');};})();m.add('popup');h.extend(d.editor.prototype,{popup:function(o,p,q){p=p||'80%';q=q||'70%';if(typeof p=='string'&&p.length>1&&p.substr(p.length-1,1)=='%')p=parseInt(window.screen.width*parseInt(p,10)/100,10);if(typeof q=='string'&&q.length>1&&q.substr(q.length-1,1)=='%')q=parseInt(window.screen.height*parseInt(q,10)/100,10);if(p<640)p=640;if(q<420)q=420;var r=parseInt((window.screen.height-q)/(2),10),s=parseInt((window.screen.width-p)/(2),10),t='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,width='+p+',height='+q+',top='+r+',left='+s,u=window.open('',null,t,true);if(!u)return false;try{u.moveTo(s,r);u.resizeTo(p,q);u.focus();u.location.href=o;}catch(v){u=window.open(o,null,t,true);}return true;}});(function(){var o={modes:{wysiwyg:1,source:1},canUndo:false,exec:function(q){var r,s=q.config,t=s.baseHref?'<base href="'+s.baseHref+'"/>':'',u=e.isCustomDomain();if(s.fullPage)r=q.getData().replace(/<head>/,'$&'+t).replace(/[^>]*(?=<\/title>)/,q.lang.preview);else{var v='<body ',w=q.document&&q.document.getBody();if(w){if(w.getAttribute('id'))v+='id="'+w.getAttribute('id')+'" ';if(w.getAttribute('class'))v+='class="'+w.getAttribute('class')+'" ';}v+='>';r=q.config.docType+'<html dir="'+q.config.contentsLangDirection+'">'+'<head>'+t+'<title>'+q.lang.preview+'</title>'+h.buildStyleHtml(q.config.contentsCss)+'</head>'+v+q.getData()+'</body></html>';}var x=640,y=420,z=80;try{var A=window.screen;x=Math.round(A.width*0.8);y=Math.round(A.height*0.7);z=Math.round(A.width*0.1);}catch(D){}var B='';if(u){window._cke_htmlToLoad=r;B='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}var C=window.open(B,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+x+',height='+y+',left='+z);if(!u){C.document.open();C.document.write(r);C.document.close();}}},p='preview';m.add(p,{init:function(q){q.addCommand(p,o);q.ui.addButton('Preview',{label:q.lang.preview,command:p});}});})();m.add('print',{init:function(o){var p='print',q=o.addCommand(p,m.print);o.ui.addButton('Print',{label:o.lang.print,command:p});}});m.print={exec:function(o){if(e.opera)return;else if(e.gecko)o.window.$.print();else o.document.$.execCommand('Print');},canUndo:false,modes:{wysiwyg:!e.opera}};m.add('removeformat',{requires:['selection'],init:function(o){o.addCommand('removeFormat',m.removeformat.commands.removeformat);o.ui.addButton('RemoveFormat',{label:o.lang.removeFormat,command:'removeFormat'});}});m.removeformat={commands:{removeformat:{exec:function(o){var p=o._.removeFormatRegex||(o._.removeFormatRegex=new RegExp('^(?:'+o.config.removeFormatTags.replace(/,/g,'|')+')$','i')),q=o._.removeAttributes||(o._.removeAttributes=o.config.removeFormatAttributes.split(',')),r=o.getSelection().getRanges();for(var s=0,t;t=r[s];s++){if(t.collapsed)continue;t.enlarge(1);var u=t.createBookmark(),v=u.startNode,w=u.endNode,x=function(A){var B=new g.elementPath(A),C=B.elements;for(var D=1,E;E=C[D];D++){if(E.equals(B.block)||E.equals(B.blockLimit))break;if(p.test(E.getName()))A.breakParent(E);}};x(v);x(w);var y=v.getNextSourceNode(true,1);while(y){if(y.equals(w))break;var z=y.getNextSourceNode(false,1);if(!(y.getName()=='img'&&y.getAttribute('_cke_realelement')))if(p.test(y.getName()))y.remove(true);else y.removeAttributes(q);y=z;}t.moveToBookmark(u);}o.getSelection().selectRanges(r);}}}};l.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';l.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';m.add('resize',{init:function(o){var p=o.config;if(p.resize_enabled){var q=null,r,s;function t(w){var x=w.data.$.screenX-r.x,y=w.data.$.screenY-r.y,z=s.width+x*(o.lang.dir=='rtl'?-1:1),A=s.height+y;o.resize(Math.max(p.resize_minWidth,Math.min(z,p.resize_maxWidth)),Math.max(p.resize_minHeight,Math.min(A,p.resize_maxHeight)));};function u(w){d.document.removeListener('mousemove',t);d.document.removeListener('mouseup',u);if(o.document){o.document.removeListener('mousemove',t);o.document.removeListener('mouseup',u);}};var v=h.addFunction(function(w){if(!q)q=o.getResizable();s={width:q.$.offsetWidth||0,height:q.$.offsetHeight||0};r={x:w.screenX,y:w.screenY};d.document.on('mousemove',t);d.document.on('mouseup',u);if(o.document){o.document.on('mousemove',t);o.document.on('mouseup',u);}});o.on('themeSpace',function(w){if(w.data.space=='bottom')w.data.html+='<div class="cke_resizer" title="'+h.htmlEncode(o.lang.resize)+'"'+' onmousedown="CKEDITOR.tools.callFunction('+v+', event)"'+'></div>';},o,null,100);}}});l.resize_minWidth=750;l.resize_minHeight=250;l.resize_maxWidth=3000;l.resize_maxHeight=3000;l.resize_enabled=true;(function(){var o={modes:{wysiwyg:1,source:1},exec:function(q){var r=q.element.$.form;if(r)try{r.submit();}catch(s){if(r.submit.click)r.submit.click();}}},p='save';m.add(p,{init:function(q){var r=q.addCommand(p,o);r.modes={wysiwyg:!!q.element.$.form};q.ui.addButton('Save',{label:q.lang.save,command:p});}});})();(function(){var o='scaytcheck',p='',q=null;function r(w,x){var y=false,z;for(z in x)if(x[z]===w||x[z]==w){y=true;break;}return y;};var s=function(){var w=this,x=function(){var A={};A.srcNodeRef=w.document.getWindow().$.frameElement;A.assocApp='CKEDITOR.'+d.version+'@'+d.revision;A.customerid=w.config.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';A.customDictionaryIds=w.config.scayt_customDictionaryIds;A.userDictionaryName=w.config.scayt_userDictionaryName;A.sLang=w.config.scayt_sLang||'en_US';if(d._scaytParams)for(var B in d._scaytParams)A[B]=d._scaytParams[B];var C=new window.scayt(A),D=t.instances[w.name];if(D){C.sLang=D.sLang;C.option(D.option());C.paused=D.paused;}t.instances[w.name]=C;var E='scaytButton',F=window.scayt.uiTags,G=[];for(var H=0,I=4;H<I;H++)G.push(F[H]&&t.uiTabs[H]);t.uiTabs=G;try{C.setDisabled(q===false);}catch(J){}w.fire('showScaytState');};w.on('contentDom',x);w.on('contentDomUnload',function(){var A=d.document.getElementsByTag('script'),B=/^dojoIoScript(\d+)$/i,C=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var D=0;D<A.count();D++){var E=A.getItem(D),F=E.getId(),G=E.getAttribute('src');if(F&&G&&F.match(B)&&G.match(C))E.remove();}});w.on('beforeCommandExec',function(A){if((A.data.name=='source'||A.data.name=='newpage')&&(w.mode=='wysiwyg')){var B=t.getScayt(w);if(B){q=B.paused=!B.disabled;B.destroy();delete t.instances[w.name];}}});w.on('destroy',function(){t.getScayt(w).destroy();});w.on('afterSetData',function(){if(t.isScaytEnabled(w))t.getScayt(w).refresh();});w.on('insertElement',function(){var A=t.getScayt(w);if(t.isScaytEnabled(w)){if(f)w.getSelection().unlock(true);try{A.refresh();}catch(B){}}},this,null,50);w.on('insertHtml',function(){var A=t.getScayt(w);if(t.isScaytEnabled(w)){if(f)w.getSelection().unlock(true);try{A.refresh();}catch(B){}}},this,null,50);w.on('scaytDialog',function(A){A.data.djConfig=window.djConfig;A.data.scayt_control=t.getScayt(w);A.data.tab=p;A.data.scayt=window.scayt;});var y=w.dataProcessor,z=y&&y.htmlFilter;if(z)z.addRules({elements:{span:function(A){if(A.attributes.scayt_word&&A.attributes.scaytid){delete A.name;return A;}}}});if(w.document)x();};m.scayt={engineLoaded:false,instances:{},getScayt:function(w){return this.instances[w.name];},isScaytReady:function(w){return this.engineLoaded===true&&'undefined'!==typeof window.scayt&&this.getScayt(w);},isScaytEnabled:function(w){var x=this.getScayt(w);return x?x.disabled===false:false;},loadEngine:function(w){if(this.engineLoaded===true)return s.apply(w);else if(this.engineLoaded==-1)return d.on('scaytReady',function(){s.apply(w);});d.on('scaytReady',s,w);d.on('scaytReady',function(){this.engineLoaded=true;},this,null,0);this.engineLoaded=-1;var x=document.location.protocol;x=x.search(/https?:/)!=-1?x:'http:';var y='svc.spellchecker.net/spellcheck3/lf/scayt/scayt21.js',z=w.config.scayt_srcUrl||x+'//'+y,A=t.parseUrl(z).path+'/';d._djScaytConfig={baseUrl:A,addOnLoad:[function(){d.fireOnce('scaytReady');}],isDebug:false};d.document.getHead().append(d.document.createElement('script',{attributes:{type:'text/javascript',src:z}}));return null;},parseUrl:function(w){var x;if(w.match&&(x=w.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:x[1],file:x[2]};else return w;}};var t=m.scayt,u=function(w,x,y,z,A,B,C){w.addCommand(z,A);w.addMenuItem(z,{label:y,command:z,group:B,order:C});},v={preserveState:true,editorFocus:false,exec:function(w){if(t.isScaytReady(w)){var x=t.isScaytEnabled(w);this.setState(x?2:1);var y=t.getScayt(w);y.setDisabled(x);}else if(!w.config.scayt_autoStartup&&t.engineLoaded>=0){this.setState(0);w.on('showScaytState',function(){this.removeListener();this.setState(t.isScaytEnabled(w)?1:2);},this);t.loadEngine(w);}}};m.add('scayt',{requires:['menubutton'],beforeInit:function(w){w.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+w.config.menu_groups;},init:function(w){var x={},y={},z=w.addCommand(o,v);d.dialog.add(o,d.getUrl(this.path+'dialogs/options.js'));var A=w.config.scayt_uiTabs||'1,1,1',B=[];A=A.split(',');for(var C=0,D=3;C<D;C++){var E=parseInt(A[C]||'1',10);B.push(E);}var F='scaytButton';w.addMenuGroup(F);var G={};G.scaytToggle={label:w.lang.scayt.enable,command:o,group:F};if(B[0]==1)G.scaytOptions={label:w.lang.scayt.options,group:F,onClick:function(){p='options';w.openDialog(o);}};if(B[1]==1)G.scaytLangs={label:w.lang.scayt.langs,group:F,onClick:function(){p='langs';w.openDialog(o);}};if(B[2]==1)G.scaytDict={label:w.lang.scayt.dictionariesTab,group:F,onClick:function(){p='dictionaries';w.openDialog(o);}};G.scaytAbout={label:w.lang.scayt.about,group:F,onClick:function(){p='about';w.openDialog(o);}};B[3]=1;t.uiTabs=B;w.addMenuItems(G);w.ui.add('Scayt',5,{label:w.lang.scayt.title,title:w.lang.scayt.title,className:'cke_button_scayt',onRender:function(){z.on('state',function(){this.setState(z.state);},this);},onMenu:function(){var I=t.isScaytEnabled(w);w.getMenuItem('scaytToggle').label=w.lang.scayt[I?'disable':'enable'];return{scaytToggle:2,scaytOptions:I&&t.uiTabs[0]?2:0,scaytLangs:I&&t.uiTabs[1]?2:0,scaytDict:I&&t.uiTabs[2]?2:0,scaytAbout:I&&t.uiTabs[3]?2:0};}});if(w.contextMenu&&w.addMenuItems)w.contextMenu.addListener(function(I){if(!(t.isScaytEnabled(w)&&I))return null;var J=t.getScayt(w),K=J.getWord(I.$);if(!K)return null;var L=J.getLang(),M={},N=window.scayt.getSuggestion(K,L);if(!N||!N.length)return null;for(C in x){delete w._.menuItems[C];delete w._.commands[C];}for(C in y){delete w._.menuItems[C];delete w._.commands[C];}x={};y={};var O=w.config.scayt_moreSuggestions||'on',P=false,Q=w.config.scayt_maxSuggestions;typeof Q!='number'&&(Q=5);!Q&&(Q=N.length);var R=w.config.scayt_contextCommands||'all';R=R.split('|');for(var S=0,T=N.length;S<T;S+=1){var U='scayt_suggestion_'+N[S].replace(' ','_'),V=(function(Z,aa){return{exec:function(){J.replace(Z,aa);}};})(I.$,N[S]);if(S<Q){u(w,'button_'+U,N[S],U,V,'scayt_suggest',S+1);M[U]=2;y[U]=2;}else if(O=='on'){u(w,'button_'+U,N[S],U,V,'scayt_moresuggest',S+1);x[U]=2;P=true;}}if(P){w.addMenuItem('scayt_moresuggest',{label:w.lang.scayt.moreSuggestions,group:'scayt_moresuggest',order:10,getItems:function(){return x;}});y.scayt_moresuggest=2;}if(r('all',R)||r('ignore',R)){var W={exec:function(){J.ignore(I.$);}};u(w,'ignore',w.lang.scayt.ignore,'scayt_ignore',W,'scayt_control',1);y.scayt_ignore=2;}if(r('all',R)||r('ignoreall',R)){var X={exec:function(){J.ignoreAll(I.$);}};u(w,'ignore_all',w.lang.scayt.ignoreAll,'scayt_ignore_all',X,'scayt_control',2);y.scayt_ignore_all=2;}if(r('all',R)||r('add',R)){var Y={exec:function(){window.scayt.addWordToUserDictionary(I.$);}};u(w,'add_word',w.lang.scayt.addWord,'scayt_add_word',Y,'scayt_control',3);y.scayt_add_word=2;}if(J.fireOnContextMenu)J.fireOnContextMenu(w);return y;});if(w.config.scayt_autoStartup){var H=function(){w.removeListener('showScaytState',H);z.setState(t.isScaytEnabled(w)?1:2);};w.on('showScaytState',H);t.loadEngine(w);}}});})();m.add('smiley',{requires:['dialog'],init:function(o){o.addCommand('smiley',new d.dialogCommand('smiley'));o.ui.addButton('Smiley',{label:o.lang.smiley.toolbar,command:'smiley'});d.dialog.add('smiley',this.path+'dialogs/smiley.js');}});l.smiley_path=d.basePath+'plugins/smiley/images/';l.smiley_images=['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'];l.smiley_descriptions=[':)',':(',';)',':D',':/',':P','','','','','','','',';(','','','','','',':kiss',''];(function(){var o='.%2 p,.%2 div,.%2 pre,.%2 address,.%2 blockquote,.%2 h1,.%2 h2,.%2 h3,.%2 h4,.%2 h5,.%2 h6{background-repeat: no-repeat;border: 1px dotted gray;padding-top: 8px;padding-left: 8px;}.%2 p{%1p.png);}.%2 div{%1div.png);}.%2 pre{%1pre.png);}.%2 address{%1address.png);}.%2 blockquote{%1blockquote.png);}.%2 h1{%1h1.png);}.%2 h2{%1h2.png);}.%2 h3{%1h3.png);}.%2 h4{%1h4.png);}.%2 h5{%1h5.png);}.%2 h6{%1h6.png);}',p=/%1/g,q=/%2/g,r={preserveState:true,editorFocus:false,exec:function(s){this.toggleState();this.refresh(s);},refresh:function(s){var t=this.state==1?'addClass':'removeClass';s.document.getBody()[t]('cke_show_blocks');}};m.add('showblocks',{requires:['wysiwygarea'],init:function(s){var t=s.addCommand('showblocks',r);t.canUndo=false;if(s.config.startupOutlineBlocks)t.setState(1);s.addCss(o.replace(p,'background-image: url('+d.getUrl(this.path)+'images/block_').replace(q,'cke_show_blocks '));s.ui.addButton('ShowBlocks',{label:s.lang.showBlocks,command:'showblocks'});s.on('mode',function(){if(t.state!=0)t.refresh(s);});s.on('contentDom',function(){if(t.state!=0)t.refresh(s);});}});})();l.startupOutlineBlocks=false;(function(){var o='cke_show_border',p,q=(e.ie6Compat?['.%1 table.%2,','.%1 table.%2 td, .%1 table.%2 th,','{','border : #d3d3d3 1px dotted','}']:['.%1 table.%2,','.%1 table.%2 > tr > td, .%1 table.%2 > tr > th,','.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,','.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,','.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th','{','border : #d3d3d3 1px dotted','}']).join('');p=q.replace(/%2/g,o).replace(/%1/g,'cke_show_borders ');var r={preserveState:true,editorFocus:false,exec:function(s){this.toggleState();this.refresh(s);},refresh:function(s){var t=this.state==1?'addClass':'removeClass';s.document.getBody()[t]('cke_show_borders');}};m.add('showborders',{requires:['wysiwygarea'],modes:{wysiwyg:1},init:function(s){var t=s.addCommand('showborders',r);t.canUndo=false;if(s.config.startupShowBorders!==false)t.setState(1);s.addCss(p);s.on('mode',function(){if(t.state!=0)t.refresh(s);},null,null,100);s.on('contentDom',function(){if(t.state!=0)t.refresh(s);});},afterInit:function(s){var t=s.dataProcessor,u=t&&t.dataFilter,v=t&&t.htmlFilter;if(u)u.addRules({elements:{table:function(w){var x=w.attributes,y=x['class'],z=parseInt(x.border,10);if(!z||z<=0)x['class']=(y||'')+(' ')+o;}}});if(v)v.addRules({elements:{table:function(w){var x=w.attributes,y=x['class'];y&&(x['class']=y.replace(o,'').replace(/\s{2}/,' ').replace(/^\s+|\s+$/,''));}}});d.on('dialogDefinition',function(w){if(w.editor!=s)return;var x=w.data.name;if(x=='table'||x=='tableProperties'){var y=w.data.definition,z=y.getContents('info'),A=z.get('txtBorder'),B=A.commit;A.commit=h.override(B,function(C){return function(D,E){C.apply(this,arguments);var F=parseInt(this.getValue(),10);E[!F||F<=0?'addClass':'removeClass'](o);};});}});}});})();m.add('sourcearea',{requires:['editingblock'],init:function(o){var p=m.sourcearea;o.on('editingBlockReady',function(){var q,r;o.addMode('source',{load:function(s,t){if(f&&e.version<8)s.setStyle('position','relative');o.textarea=q=new k('textarea');q.setAttributes({dir:'ltr',tabIndex:-1});q.addClass('cke_source');q.addClass('cke_enable_context_menu');var u={width:e.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(f){if(!e.ie8Compat){r=function(){q.hide();q.setStyle('height',s.$.clientHeight+'px');q.show();};o.on('resize',r);o.on('afterCommandExec',function(w){if(w.data.name=='toolbarCollapse')r();});u.height=s.$.clientHeight+'px';}}else q.on('mousedown',function(w){w.data.stopPropagation();});s.setHtml('');s.append(q);q.setStyles(u);q.on('blur',function(){o.focusManager.blur();});q.on('focus',function(){o.focusManager.focus();});o.mayBeDirty=true;this.loadData(t);var v=o.keystrokeHandler;if(v)v.attach(q);setTimeout(function(){o.mode='source';o.fire('mode');},e.gecko||e.webkit?100:0);},loadData:function(s){q.setValue(s);o.fire('dataReady');},getData:function(){return q.getValue();},getSnapshotData:function(){return q.getValue();},unload:function(s){o.textarea=q=null;if(r)o.removeListener('resize',r);if(f&&e.version<8)s.removeStyle('position');},focus:function(){q.focus();}});});o.addCommand('source',p.commands.source);if(o.ui.addButton)o.ui.addButton('Source',{label:o.lang.source,command:'source'});o.on('mode',function(){o.getCommand('source').setState(o.mode=='source'?1:2);});}});m.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},exec:function(o){if(o.mode=='wysiwyg')o.fire('saveSnapshot');o.getCommand('source').setState(0);o.setMode(o.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){m.add('stylescombo',{requires:['richcombo','styles'],init:function(r){var s=r.config,t=r.lang.stylesCombo,u=this.path,v;r.ui.addRichCombo('Styles',{label:t.label,title:t.panelTitle,voiceLabel:t.voiceLabel,className:'cke_styles',multiSelect:true,panel:{css:r.skin.editor.css.concat(s.contentsCss),voiceLabel:t.panelVoiceLabel},init:function(){var w=this,x=s.stylesCombo_stylesSet.split(':'),y=x[1]?x.slice(1).join(':'):d.getUrl(u+'styles/'+x[0]+'.js');x=x[0];d.loadStylesSet(x,y,function(z){var A,B,C=[];v={};for(var D=0;D<z.length;D++){var E=z[D];B=E.name;A=v[B]=new d.style(E);A._name=B;C.push(A);}C.sort(q);var F;for(D=0;D<C.length;D++){A=C[D];B=A._name;var G=A.type;if(G!=F){w.startGroup(t['panelTitle'+String(G)]);F=G;}w.add(B,A.type==3?B:p(A._.definition),B);}w.commit();w.onOpen();});},onClick:function(w){r.focus();r.fire('saveSnapshot');var x=v[w],y=r.getSelection();if(x.type==3){var z=y.getSelectedElement();if(z)x.applyToObject(z);return;}var A=new g.elementPath(y.getStartElement());if(x.type==2&&x.checkActive(A))x.remove(r.document);else x.apply(r.document);r.fire('saveSnapshot');},onRender:function(){r.on('selectionChange',function(w){var x=this.getValue(),y=w.data.path,z=y.elements;for(var A=0,B;A<z.length;A++){B=z[A];for(var C in v)if(v[C].checkElementRemovable(B,true)){if(C!=x)this.setValue(C);return;}}this.setValue('');},this);},onOpen:function(){var E=this;if(f)r.focus();var w=r.getSelection(),x=w.getSelectedElement(),y=x&&x.getName(),z=new g.elementPath(x||w.getStartElement()),A=[0,0,0,0];E.showAll();E.unmarkAll();for(var B in v){var C=v[B],D=C.type;if(D==3){if(x&&C.element==y){if(C.checkElementRemovable(x,true))E.mark(B);A[D]++;}else E.hideItem(B);}else{if(C.checkActive(z))E.mark(B);A[D]++;}}if(!A[1])E.hideGroup(t['panelTitle'+String(1)]);if(!A[2])E.hideGroup(t['panelTitle'+String(2)]);if(!A[3])E.hideGroup(t['panelTitle'+String(3)]);}});}});var o={};d.addStylesSet=function(r,s){o[r]=s;};d.loadStylesSet=function(r,s,t){var u=o[r];if(u){t(u);return;}d.scriptLoader.load(s,function(){t(o[r]);});};function p(r){var s=[],t=r.element;if(t=='bdo')t='span';s=['<',t];var u=r.attributes;if(u)for(var v in u)s.push(' ',v,'="',u[v],'"');var w=d.style.getStyleText(r);if(w)s.push(' style="',w,'"');s.push('>',r.name,'</',t,'>');return s.join('');};function q(r,s){var t=r.type,u=s.type;return t==u?0:t==3?-1:u==3?1:u==1?1:-1;};})();l.stylesCombo_stylesSet='default';m.add('table',{init:function(o){var p=m.table,q=o.lang.table;o.addCommand('table',new d.dialogCommand('table'));o.addCommand('tableProperties',new d.dialogCommand('tableProperties'));o.ui.addButton('Table',{label:q.toolbar,command:'table'});d.dialog.add('table',this.path+'dialogs/table.js');d.dialog.add('tableProperties',this.path+'dialogs/table.js');if(o.addMenuItems)o.addMenuItems({table:{label:q.menu,command:'tableProperties',group:'table',order:5},tabledelete:{label:q.deleteTable,command:'tableDelete',group:'table',order:1}});if(o.contextMenu)o.contextMenu.addListener(function(r,s){if(!r)return null;var t=r.is('table')||r.hasAscendant('table');if(t)return{tabledelete:2,table:2};return null;});}});(function(){function o(H,I){if(f)H.removeAttribute(I);else delete H[I];};var p=/^(?:td|th)$/;function q(H){var I=H.createBookmarks(),J=H.getRanges(),K=[],L={};function M(U){if(K.length>0)return;if(U.type==1&&p.test(U.getName())&&!U.getCustomData('selected_cell')){k.setMarker(L,U,'selected_cell',true);K.push(U);}};for(var N=0;N<J.length;N++){var O=J[N];if(O.collapsed){var P=O.getCommonAncestor(),Q=P.getAscendant('td',true)||P.getAscendant('th',true);if(Q)K.push(Q);}else{var R=new g.walker(O),S;R.guard=M;while(S=R.next()){var T=S.getParent();if(T&&p.test(T.getName())&&!T.getCustomData('selected_cell')){k.setMarker(L,T,'selected_cell',true);K.push(T);}}}}k.clearAllMarkers(L);H.selectBookmarks(I);return K;};function r(H){var I=H.cells;for(var J=0;J<I.length;J++){I[J].innerHTML='';if(!f)new k(I[J]).appendBogus();}};function s(H,I){var J=H.getStartElement().getAscendant('tr');if(!J)return;var K=J.clone(true);K.insertBefore(J);r(I?K.$:J.$);};function t(H){if(H instanceof g.selection){var I=q(H),J=[];for(var K=0;K<I.length;K++){var L=I[K].getParent();J[L.$.rowIndex]=L;}for(K=J.length;K>=0;K--)if(J[K])t(J[K]);}else if(H instanceof k){var M=H.getAscendant('table');if(M.$.rows.length==1)M.remove();else H.remove();}};function u(H,I){var J=H.getStartElement(),K=J.getAscendant('td',true)||J.getAscendant('th',true);if(!K)return;var L=K.getAscendant('table'),M=K.$.cellIndex;for(var N=0;N<L.$.rows.length;N++){var O=L.$.rows[N];if(O.cells.length<M+1)continue;K=new k(O.cells[M].cloneNode(false));if(!f)K.appendBogus();var P=new k(O.cells[M]);if(I)K.insertBefore(P);else K.insertAfter(P);}};function v(H){if(H instanceof g.selection){var I=q(H);for(var J=I.length;J>=0;J--)if(I[J])v(I[J]);}else if(H instanceof k){var K=H.getAscendant('table'),L=H.$.cellIndex;for(J=K.$.rows.length-1;J>=0;J--){var M=new k(K.$.rows[J]);if(!L&&M.$.cells.length==1){t(M);continue;}if(M.$.cells[L])M.$.removeChild(M.$.cells[L]);}}};function w(H,I){var J=H.getStartElement(),K=J.getAscendant('td',true)||J.getAscendant('th',true);if(!K)return;var L=K.clone();if(!f)L.appendBogus();if(I)L.insertBefore(K);else L.insertAfter(K);};function x(H){if(H instanceof g.selection){var I=q(H);for(var J=I.length-1;J>=0;J--)x(I[J]);}else if(H instanceof k)if(H.getParent().getChildCount()==1)H.getParent().remove();else H.remove();};function y(H){var I=H.getBogus();I&&I.remove();H.trim();};function z(H,I){var J=new g.range(H.getDocument());if(!J['moveToElementEdit'+(I?'End':'Start')](H)){J.selectNodeContents(H);J.collapse(I?false:true);}J.select(true);};function A(H){var I=H.$.rows,J=-1,K=[];for(var L=0;L<I.length;L++){J++;!K[J]&&(K[J]=[]);var M=-1;for(var N=0;N<I[L].cells.length;N++){var O=I[L].cells[N];M++;while(K[J][M])M++;var P=isNaN(O.colSpan)?1:O.colSpan,Q=isNaN(O.rowSpan)?1:O.rowSpan;for(var R=0;R<Q;R++){if(!K[J+R])K[J+R]=[];for(var S=0;S<P;S++)K[J+R][M+S]=I[L].cells[N];}M+=P-1;}}return K;};function B(H,I,J){var K=H[I];if(typeof J=='undefined')return K;for(var L=0;K&&L<K.length;L++)if(J.is&&K[L]==J.$)return L;else if(L==J)return new k(K[L]);return J.is?-1:null;};function C(H,I,J){var K=[];for(var L=0;L<H.length;L++){var M=H[L];if(typeof J=='undefined')K.push(M[I]);else if(J.is&&M[I]==J.$)return L;else if(L==J)return new k(M[I]);}return typeof J=='undefined'?K:J.is?-1:null;};function D(H,I,J){var K=q(H),L;if((I?K.length!=1:K.length<2)||((L=H.getCommonAncestor())&&(L.type==1&&L.is('table'))))return false;var M,N=K[0],O=N.getAscendant('table'),P=A(O),Q=P.length,R=P[0].length,S=N.getParent().$.rowIndex,T=B(P,S,N);if(I){var U;try{U=P[I=='up'?S-1:I=='down'?S+1:S][I=='left'?T-1:I=='right'?T+1:T];}catch(am){return false;}if(!U||N.$==U)return false;K[I=='up'||I=='left'?'unshift':'push'](new k(U));}var V=N.getDocument(),W=S,X=0,Y=0,Z=!J&&new g.documentFragment(V),aa=0;for(var ab=0;ab<K.length;ab++){M=K[ab];var ac=M.getParent(),ad=M.getFirst(),ae=M.$.colSpan,af=M.$.rowSpan,ag=ac.$.rowIndex,ah=B(P,ag,M);aa+=ae*af;Y=Math.max(Y,ah-T+ae);X=Math.max(X,ag-S+af);if(!J){if(y(M),M.getChildren().count()){if(ag!=W&&ad&&!(ad.isBlockBoundary&&ad.isBlockBoundary({br:1}))){var ai=Z.getLast(g.walker.whitespaces(true));if(ai&&!(ai.is&&ai.is('br')))Z.append(new k('br'));}M.moveChildren(Z);}ab?M.remove():M.setHtml('');}W=ag;}if(!J){Z.moveChildren(N);if(!f)N.appendBogus();if(Y>=R)N.removeAttribute('rowSpan');else N.$.rowSpan=X;if(X>=Q)N.removeAttribute('colSpan');else N.$.colSpan=Y;var aj=new g.nodeList(O.$.rows),ak=aj.count();for(ab=ak-1;ab>=0;ab--){var al=aj.getItem(ab);if(!al.$.cells.length){al.remove();ak++;continue;}}return N;}else return X*Y==aa;};function E(H,I){var J=q(H);if(J.length>1)return false;else if(I)return true;var K=J[0],L=K.getParent(),M=L.getAscendant('table'),N=A(M),O=L.$.rowIndex,P=B(N,O,K),Q=K.$.rowSpan,R,S,T,U;if(Q>1){S=Math.ceil(Q/2);T=Math.floor(Q/2);U=O+S;var V=new k(M.$.rows[U]),W=B(N,U),X;R=K.clone();for(var Y=0;Y<W.length;Y++){X=W[Y];if(X.parentNode==V.$&&Y>P){R.insertBefore(new k(X));break;}else X=null;}if(!X)V.append(R,true);}else{T=S=1;V=L.clone();V.insertAfter(L);V.append(R=K.clone());var Z=B(N,O);for(var aa=0;aa<Z.length;aa++)Z[aa].rowSpan++;}if(!f)R.appendBogus();K.$.rowSpan=S;R.$.rowSpan=T;if(S==1)K.removeAttribute('rowSpan');if(T==1)R.removeAttribute('rowSpan');return R;};function F(H,I){var J=q(H);if(J.length>1)return false;else if(I)return true;var K=J[0],L=K.getParent(),M=L.getAscendant('table'),N=A(M),O=L.$.rowIndex,P=B(N,O,K),Q=K.$.colSpan,R,S,T;if(Q>1){S=Math.ceil(Q/2);T=Math.floor(Q/2);}else{T=S=1;var U=C(N,P);for(var V=0;V<U.length;V++)U[V].colSpan++;}R=K.clone();R.insertAfter(K);if(!f)R.appendBogus();K.$.colSpan=S;R.$.colSpan=T;if(S==1)K.removeAttribute('colSpan');if(T==1)R.removeAttribute('colSpan');return R;};var G={thead:1,tbody:1,tfoot:1,td:1,tr:1,th:1};m.tabletools={init:function(H){var I=H.lang.table;H.addCommand('cellProperties',new d.dialogCommand('cellProperties'));d.dialog.add('cellProperties',this.path+'dialogs/tableCell.js');H.addCommand('tableDelete',{exec:function(J){var K=J.getSelection(),L=K&&K.getStartElement(),M=L&&L.getAscendant('table',true);if(!M)return;K.selectElement(M);var N=K.getRanges()[0];N.collapse();K.selectRanges([N]);if(M.getParent().getChildCount()==1)M.getParent().remove();else M.remove();}});H.addCommand('rowDelete',{exec:function(J){var K=J.getSelection();t(K);}});H.addCommand('rowInsertBefore',{exec:function(J){var K=J.getSelection();s(K,true);}});H.addCommand('rowInsertAfter',{exec:function(J){var K=J.getSelection();s(K);}});H.addCommand('columnDelete',{exec:function(J){var K=J.getSelection();v(K);}});H.addCommand('columnInsertBefore',{exec:function(J){var K=J.getSelection();u(K,true);}});H.addCommand('columnInsertAfter',{exec:function(J){var K=J.getSelection();u(K);}});H.addCommand('cellDelete',{exec:function(J){var K=J.getSelection();x(K);}});H.addCommand('cellMerge',{exec:function(J){z(D(J.getSelection()),true);}});H.addCommand('cellMergeRight',{exec:function(J){z(D(J.getSelection(),'right'),true);}});H.addCommand('cellMergeDown',{exec:function(J){z(D(J.getSelection(),'down'),true);}});H.addCommand('cellVerticalSplit',{exec:function(J){z(E(J.getSelection()));}});H.addCommand('cellHorizontalSplit',{exec:function(J){z(F(J.getSelection()));}});H.addCommand('cellInsertBefore',{exec:function(J){var K=J.getSelection();w(K,true);}});H.addCommand('cellInsertAfter',{exec:function(J){var K=J.getSelection();w(K);}});if(H.addMenuItems)H.addMenuItems({tablecell:{label:I.cell.menu,group:'tablecell',order:1,getItems:function(){var J=H.getSelection(),K=q(J);return{tablecell_insertBefore:2,tablecell_insertAfter:2,tablecell_delete:2,tablecell_merge:D(J,null,true)?2:0,tablecell_merge_right:D(J,'right',true)?2:0,tablecell_merge_down:D(J,'down',true)?2:0,tablecell_split_vertical:E(J,true)?2:0,tablecell_split_horizontal:F(J,true)?2:0,tablecell_properties:K.length>0?2:0};}},tablecell_insertBefore:{label:I.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:I.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:I.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:I.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:I.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:I.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:I.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:I.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:I.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:I.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:I.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:I.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:I.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:I.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2};}},tablecolumn_insertBefore:{label:I.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:I.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:I.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(H.contextMenu)H.contextMenu.addListener(function(J,K){if(!J)return null;while(J){if(J.getName()in G)return{tablecell:2,tablerow:2,tablecolumn:2};J=J.getParent();}return null;});},getSelectedCells:q};m.add('tabletools',m.tabletools);})();m.add('specialchar',{init:function(o){var p='specialchar';d.dialog.add(p,this.path+'dialogs/specialchar.js');o.addCommand(p,new d.dialogCommand(p));o.ui.addButton('SpecialChar',{label:o.lang.specialChar.toolbar,command:p});}});(function(){var o={exec:function(q){q.container.focusNext(true);}},p={exec:function(q){q.container.focusPrevious(true);}};m.add('tab',{requires:['keystrokes'],init:function(q){var r=q.keystrokeHandler.keystrokes;r[9]='tab';r[2000+9]='shiftTab';var s=q.config.tabSpaces,t='';while(s--)t+='\xa0';q.addCommand('tab',{exec:function(u){if(!u.fire('tab'))if(t.length>0)u.insertHtml(t);else return u.execCommand('blur');return true;}});q.addCommand('shiftTab',{exec:function(u){if(!u.fire('shiftTab'))return u.execCommand('blurBack');return true;}});q.addCommand('blur',o);q.addCommand('blurBack',p);}});})();k.prototype.focusNext=function(o){var x=this;var p=x.$,q=x.getTabIndex(),r,s,t,u,v,w;if(q<=0){v=x.getNextSourceNode(o,1);while(v){if(v.isVisible()&&v.getTabIndex()===0){t=v;break;}v=v.getNextSourceNode(false,1);}}else{v=x.getDocument().getBody().getFirst();while(v=v.getNextSourceNode(false,1)){if(!r)if(!s&&v.equals(x)){s=true;if(o){if(!(v=v.getNextSourceNode(true,1)))break;r=1;}}else if(s&&!x.contains(v))r=1;if(!v.isVisible()||(w=v.getTabIndex())<(0))continue;if(r&&w==q){t=v;break;}if(w>q&&(!t||!u||w<u)){t=v;u=w;}else if(!t&&w===0){t=v;u=w;}}}if(t)t.focus();};k.prototype.focusPrevious=function(o){var x=this;var p=x.$,q=x.getTabIndex(),r,s,t,u=0,v,w=x.getDocument().getBody().getLast();while(w=w.getPreviousSourceNode(false,1)){if(!r)if(!s&&w.equals(x)){s=true;if(o){if(!(w=w.getPreviousSourceNode(true,1)))break;r=1;}}else if(s&&!x.contains(w))r=1;if(!w.isVisible()||(v=w.getTabIndex())<(0))continue;if(q<=0){if(r&&v===0){t=w;break;}if(v>u){t=w;u=v;}}else{if(r&&v==q){t=w;break;}if(v<q&&(!t||v>u)){t=w;u=v;}}}if(t)t.focus();};l.tabSpaces=0;(function(){m.add('templates',{requires:['dialog'],init:function(q){d.dialog.add('templates',d.getUrl(this.path+'dialogs/templates.js'));q.addCommand('templates',new d.dialogCommand('templates'));q.ui.addButton('Templates',{label:q.lang.templates.button,command:'templates'});}});var o={},p={};d.addTemplates=function(q,r){o[q]=r;};d.getTemplates=function(q){return o[q];};d.loadTemplates=function(q,r){var s=[];for(var t=0;t<q.length;t++)if(!p[q[t]]){s.push(q[t]);p[q[t]]=1;}if(s.length>0)d.scriptLoader.load(s,r);else setTimeout(r,0);};})();l.templates='default';l.templates_files=[d.getUrl('plugins/templates/templates/default.js')];l.templates_replaceContent=true;(function(){var o=function(){this.toolbars=[];this.focusCommandExecuted=false;};o.prototype.focus=function(){for(var q=0,r;r=this.toolbars[q++];)for(var s=0,t;t=r.items[s++];)if(t.focus){t.focus();return;}};var p={toolbarFocus:{modes:{wysiwyg:1,source:1},exec:function(q){if(q.toolbox){q.toolbox.focusCommandExecuted=true;if(f)setTimeout(function(){q.toolbox.focus();},100);else q.toolbox.focus();}}}};m.add('toolbar',{init:function(q){var r=function(s,t){switch(t){case 39:case 9:while((s=s.next||s.toolbar.next&&s.toolbar.next.items[0])&&(!s.focus)){}if(s)s.focus();else q.toolbox.focus();return false;case 37:case 2000+9:while((s=s.previous||s.toolbar.previous&&s.toolbar.previous.items[s.toolbar.previous.items.length-1])&&(!s.focus)){}if(s)s.focus();else{var u=q.toolbox.toolbars[q.toolbox.toolbars.length-1].items;u[u.length-1].focus();}return false;case 27:q.focus();return false;case 13:case 32:s.execute();return false;}return true;};q.on('themeSpace',function(s){if(s.data.space==q.config.toolbarLocation){q.toolbox=new o();var t=['<div class="cke_toolbox"'],u=q.config.toolbarStartupExpanded!==false,v;t.push(u?'>':' style="display:none">');var w=q.toolbox.toolbars,x=q.config.toolbar instanceof Array?q.config.toolbar:q.config['toolbar_'+q.config.toolbar];for(var y=0;y<x.length;y++){var z=x[y];if(!z)continue;var A='cke_'+h.getNextNumber(),B={id:A,items:[]};if(v){t.push('</div>');v=0;}if(z==='/'){t.push('<div class="cke_break"></div>');continue;}t.push('<span id="',A,'" class="cke_toolbar"><span class="cke_toolbar_start"></span>');var C=w.push(B)-1;if(C>0){B.previous=w[C-1];B.previous.next=B;}for(var D=0;D<z.length;D++){var E,F=z[D];if(F=='-')E=n.separator;else E=q.ui.create(F);if(E){if(E.canGroup){if(!v){t.push('<span class="cke_toolgroup">');v=1;}}else if(v){t.push('</span>');v=0;}var G=E.render(q,t);C=B.items.push(G)-1;if(C>0){G.previous=B.items[C-1];G.previous.next=G;}G.toolbar=B;G.onkey=r;G.onfocus=function(){if(!q.toolbox.focusCommandExecuted)q.focus();};}}if(v){t.push('</span>');v=0;}t.push('<span class="cke_toolbar_end"></span></span>');}t.push('</div>');if(q.config.toolbarCanCollapse){var H=h.addFunction(function(){q.execCommand('toolbarCollapse');}),I='cke_'+h.getNextNumber();q.addCommand('toolbarCollapse',{exec:function(J){var K=d.document.getById(I),L=K.getPrevious(),M=J.getThemeSpace('contents'),N=L.getParent(),O=parseInt(M.$.style.height,10),P=N.$.offsetHeight;if(L.isVisible()){L.hide();K.addClass('cke_toolbox_collapser_min');K.setAttribute('title',J.lang.toolbarExpand);}else{L.show();K.removeClass('cke_toolbox_collapser_min');K.setAttribute('title',J.lang.toolbarCollapse);}var Q=N.$.offsetHeight-P;M.setStyle('height',O-Q+'px');},modes:{wysiwyg:1,source:1}});t.push('<a title="'+(u?q.lang.toolbarCollapse:q.lang.toolbarExpand)+'" id="'+I+'" class="cke_toolbox_collapser');if(!u)t.push(' cke_toolbox_collapser_min');t.push('" onclick="CKEDITOR.tools.callFunction('+H+')"></a>');}s.data.html+=t.join('');}});q.addCommand('toolbarFocus',p.toolbarFocus);}});})();n.separator={render:function(o,p){p.push('<span class="cke_separator"></span>');return{};}};l.toolbarLocation='top';l.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];l.toolbar_Full=[['Source','-','Save','NewPage','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Anchor'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']];l.toolbar='Full';l.toolbarCanCollapse=true;(function(){m.add('undo',{requires:['selection','wysiwygarea'],init:function(u){var v=new q(u),w=u.addCommand('undo',{exec:function(){if(v.undo()){u.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),x=u.addCommand('redo',{exec:function(){if(v.redo()){u.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});v.onChange=function(){w.setState(v.undoable()?2:0);x.setState(v.redoable()?2:0);};function y(z){if(v.enabled&&z.data.command.canUndo!==false)v.save();};u.on('beforeCommandExec',y);u.on('afterCommandExec',y);u.on('saveSnapshot',function(){v.save();});u.on('contentDom',function(){u.document.on('keydown',function(z){if(!z.data.$.ctrlKey&&!z.data.$.metaKey)v.type(z);});});u.on('beforeModeUnload',function(){u.mode=='wysiwyg'&&v.save(true);});u.on('mode',function(){v.enabled=u.mode=='wysiwyg';v.onChange();});u.ui.addButton('Undo',{label:u.lang.undo,command:'undo'});u.ui.addButton('Redo',{label:u.lang.redo,command:'redo'});u.resetUndo=function(){v.reset();u.fire('saveSnapshot');};}});function o(u){var w=this;var v=u.getSelection();w.contents=u.getSnapshot();w.bookmarks=v&&v.createBookmarks2(true);if(f)w.contents=w.contents.replace(/\s+_cke_expando=".*?"/g,'');};var p=/\b(?:href|src|name)="[^"]*?"/gi;o.prototype={equals:function(u,v){var w=this.contents,x=u.contents;if(f&&(e.ie7Compat||e.ie6Compat)){w=w.replace(p,'');x=x.replace(p,'');}if(w!=x)return false;if(v)return true;var y=this.bookmarks,z=u.bookmarks;if(y||z){if(!y||!z||y.length!=z.length)return false;for(var A=0;A<y.length;A++){var B=y[A],C=z[A];if(B.startOffset!=C.startOffset||B.endOffset!=C.endOffset||!h.arrayCompare(B.start,C.start)||!h.arrayCompare(B.end,C.end))return false;}}return true;}};function q(u){this.editor=u;this.reset();};var r={8:1,46:1},s={16:1,17:1,18:1},t={37:1,38:1,39:1,40:1};q.prototype={type:function(u){var v=u&&u.data.getKey(),w=v in s,x=v in r,y=this.lastKeystroke in r,z=x&&v==this.lastKeystroke,A=v in t,B=this.lastKeystroke in t,C=!x&&!A,D=x&&!z,E=!(w||this.typing)||C&&(y||B);if(E||D){var F=new o(this.editor);h.setTimeout(function(){var H=this;var G=H.editor.getSnapshot();if(f)G=G.replace(/\s+_cke_expando=".*?"/g,'');if(F.contents!=G){H.typing=true;if(!H.save(false,F,false))H.snapshots.splice(H.index+1,H.snapshots.length-H.index-1);H.hasUndo=true;H.hasRedo=false;H.typesCount=1;H.modifiersCount=1;H.onChange();}},0,this);}this.lastKeystroke=v;if(x){this.typesCount=0;this.modifiersCount++;if(this.modifiersCount>25){this.save(false,null,false);this.modifiersCount=1;}}else if(!A){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var u=this;u.lastKeystroke=0;u.snapshots=[];u.index=-1;u.limit=u.editor.config.undoStackSize;u.currentImage=null;u.hasUndo=false;u.hasRedo=false;u.resetType();},resetType:function(){var u=this;u.typing=false;delete u.lastKeystroke;u.typesCount=0;u.modifiersCount=0;},fireChange:function(){var u=this;u.hasUndo=!!u.getNextImage(true);u.hasRedo=!!u.getNextImage(false);u.resetType();u.onChange();},save:function(u,v,w){var y=this;var x=y.snapshots;if(!v)v=new o(y.editor);if(y.currentImage&&v.equals(y.currentImage,u))return false;x.splice(y.index+1,x.length-y.index-1);if(x.length==y.limit)x.shift();y.index=x.push(v)-1;y.currentImage=v;if(w!==false)y.fireChange();return true;},restoreImage:function(u){var w=this;w.editor.loadSnapshot(u.contents);if(u.bookmarks)w.editor.getSelection().selectBookmarks(u.bookmarks);else if(f){var v=w.editor.document.getBody().$.createTextRange();v.collapse(true);v.select();}w.index=u.index;w.currentImage=u;w.fireChange();},getNextImage:function(u){var z=this;var v=z.snapshots,w=z.currentImage,x,y;if(w)if(u)for(y=z.index-1;y>=0;y--){x=v[y];if(!w.equals(x,true)){x.index=y;return x;}}else for(y=z.index+1;y<v.length;y++){x=v[y];if(!w.equals(x,true)){x.index=y;return x;}}return null;},redoable:function(){return this.enabled&&this.hasRedo;},undoable:function(){return this.enabled&&this.hasUndo;},undo:function(){var v=this;if(v.undoable()){v.save(true);var u=v.getNextImage(true);if(u)return v.restoreImage(u),true;}return false;},redo:function(){var v=this;if(v.redoable()){v.save(true);if(v.redoable()){var u=v.getNextImage(false);if(u)return v.restoreImage(u),true;}}return false;}};})();l.undoStackSize=20;(function(){var o={table:1,pre:1},p=/\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi;function q(z){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var A=this.getSelection(),B=z.data;if(this.dataProcessor)B=this.dataProcessor.toHtml(B);if(f){var C=A.isLocked;if(C)A.unlock();var D=A.getNative();if(D.type=='Control')D.clear();D.createRange().pasteHTML(B);if(C)this.getSelection().lock();}else this.document.$.execCommand('inserthtml',false,B);h.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function r(z){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var A=z.data,B=A.getName(),C=i.$block[B],D=this.getSelection(),E=D.getRanges(),F=D.isLocked;if(F)D.unlock();var G,H,I,J;for(var K=E.length-1;K>=0;K--){G=E[K];G.deleteContents();H=!K&&A||A.clone(true);var L,M;if(C)while((L=G.getCommonAncestor(false,true))&&((M=i[L.getName()])&&(!(M&&M[B]))))if(L.getName()in i.span)G.splitElement(L);else if(G.checkStartOfBlock()&&G.checkEndOfBlock()){G.setStartBefore(L);G.collapse(true);L.remove();}else G.splitBlock();G.insertNode(H);if(!I)I=H;}G.moveToPosition(I,4);var N=I.getNextSourceNode(true);if(N&&N.type==1)G.moveToElementEditStart(N);D.selectRanges([G]);if(F)this.getSelection().lock();h.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function s(z){if(!z.checkDirty())setTimeout(function(){z.resetDirty();});};var t=g.walker.whitespaces(true),u=g.walker.bookmark(false,true);function v(z){return t(z)&&u(z);};function w(z){return z.type==3&&h.trim(z.getText()).match(/^(?:&nbsp;|\xa0)$/);};function x(z){var A=z.editor,B=z.data.path,C=B.blockLimit,D=z.data.selection,E=D.getRanges()[0],F=A.document.getBody(),G=A.config.enterMode;if(G!=2&&E.collapsed&&C.getName()=='body'&&!B.block){s(A);var H=E.fixBlock(true,A.config.enterMode==3?'div':'p');if(f){var I=H.getFirst(v);I&&w(I)&&I.remove();}if(H.getOuterHtml().match(p)){var J=H.getPrevious(t),K=H.getNext(t);if(J&&J.getName&&!(J.getName()in o)&&E.moveToElementEditStart(J)||K&&K.getName&&!(K.getName()in o)&&E.moveToElementEditStart(K))H.remove();}E.select();if(!f)A.selectionChange();}var L=F.getLast(g.walker.whitespaces(true));if(L&&L.getName&&L.getName()in o){s(A);if(!f)F.appendBogus();else F.append(A.document.createText('\xa0'));}};m.add('wysiwygarea',{requires:['editingblock'],init:function(z){var A=z.config.enterMode!=2?z.config.enterMode==3?'div':'p':false;z.on('editingBlockReady',function(){var C,D,E,F,G,H,I,J=e.isCustomDomain(),K=function(N){if(E)E.remove();if(D)D.remove();H=0;E=k.createFromHtml('<iframe style="width:100%;height:100%" frameBorder="0"'+(J?" src=\"javascript:void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())"':'')+' tabIndex="-1"'+' allowTransparency="true"'+'></iframe>');E.on('load',function(P){P.removeListener();var Q=E.getFrameDocument().$;Q.open();if(J)Q.domain=document.domain;Q.write(N);Q.close();});var O=z.lang.editorTitle.replace('%1',z.name);if(e.gecko){C.setAttributes({role:'region',title:O});E.setAttributes({role:'region',title:' '});}else if(e.webkit){E.setAttribute('title',O);E.setAttribute('name',O);}else if(f){D=k.createFromHtml('<fieldset style="height:100%'+(f&&e.quirks?';position:relative':'')+'">'+'<legend style="display:block;width:0;height:0;overflow:hidden;'+(f&&e.quirks?'position:absolute':'')+'">'+h.htmlEncode(O)+'</legend>'+'</fieldset>',d.document);E.appendTo(D);D.appendTo(C);}if(!f)C.append(E);},L='<script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR._["contentDomReady'+z.name+'"]( window );'+'</script>',M=function(N){if(H)return;H=1;var O=N.document,P=O.body,Q=O.getElementById('cke_actscrpt');Q.parentNode.removeChild(Q);delete d._['contentDomReady'+z.name];P.spellcheck=!z.config.disableNativeSpellChecker;if(f){P.hideFocus=true;P.disabled=true;P.contentEditable=true;P.removeAttribute('disabled');}else O.designMode='on';try{O.execCommand('enableObjectResizing',false,!z.config.disableObjectResizing);}catch(V){}try{O.execCommand('enableInlineTableEditing',false,!z.config.disableNativeTableHandles);}catch(W){}N=z.window=new g.window(N);O=z.document=new j(O);if(!(f||e.opera))O.on('mousedown',function(X){var Y=X.data.getTarget();if(Y.is('img','hr','input','textarea','select'))z.getSelection().selectElement(Y);});if(e.webkit){O.on('click',function(X){if(X.data.getTarget().is('input','select'))X.data.preventDefault();});O.on('mouseup',function(X){if(X.data.getTarget().is('input','textarea'))X.data.preventDefault();});}if(f&&O.$.compatMode=='CSS1Compat'){var R=O.getDocumentElement();R.on('mousedown',function(X){if(X.data.getTarget().equals(R))B.focus();});}var S=f||e.webkit?N:O;S.on('blur',function(){z.focusManager.blur();});S.on('focus',function(){if(e.gecko){var X=P;while(X.firstChild)X=X.firstChild;if(!X.nextSibling&&'BR'==X.tagName&&X.hasAttribute('_moz_editor_bogus_node')){var Y=O.$.createEvent('KeyEvents');Y.initKeyEvent('keypress',true,true,N.$,false,false,false,false,0,32);O.$.dispatchEvent(Y);var Z=O.getBody().getFirst();if(z.config.enterMode==2)O.createElement('br',{attributes:{_moz_dirty:''}}).replace(Z);else Z.remove();}}z.focusManager.focus();});var T=z.keystrokeHandler;if(T)T.attach(O);if(f){O.on('keydown',function(X){var Y=X.data.getKeystroke()==8&&z.getSelection().getSelectedElement();if(Y){z.fire('saveSnapshot');Y.remove();z.fire('saveSnapshot');X.cancel();}});if(O.$.compatMode=='CSS1Compat'){var U={33:1,34:1};O.on('keydown',function(X){if(X.data.getKeystroke()in U)setTimeout(function(){z.getSelection().scrollIntoView();},0);});}}if(z.contextMenu)z.contextMenu.addTarget(O,z.config.browserContextMenuOnCtrl!==false);setTimeout(function(){z.fire('contentDom');if(I){z.mode='wysiwyg';z.fire('mode');I=false;}F=false;if(G){z.focus();G=false;}setTimeout(function(){z.fire('dataReady');},0);if(f)setTimeout(function(){if(z.document){var X=z.document.$.body;X.runtimeStyle.marginBottom='0px';X.runtimeStyle.marginBottom='';}},1000);},0);};z.addMode('wysiwyg',{load:function(N,O,P){C=N;if(f&&e.quirks)N.setStyle('position','relative');z.mayBeDirty=true;I=true;if(P)this.loadSnapshotData(O);else this.loadData(O);},loadData:function(N){F=true;var O=z.config,P=O.fullPage,Q=O.docType,R='<style type="text/css" cke_temp="1">'+z._.styles.join('\n')+'</style>';!P&&(R=h.buildStyleHtml(z.config.contentsCss)+R);var S=O.baseHref?'<base href="'+O.baseHref+'" cke_temp="1" />':'';if(P)N=N.replace(/<!DOCTYPE[^>]*>/i,function(T){z.docType=Q=T;return'';});if(z.dataProcessor)N=z.dataProcessor.toHtml(N,A);if(P){if(!/<body[\s|>]/.test(N))N='<body>'+N;if(!/<html[\s|>]/.test(N))N='<html>'+N+'</html>';if(!/<head[\s|>]/.test(N))N=N.replace(/<html[^>]*>/,'$&<head><title></title></head>');S&&(N=N.replace(/<head>/,'$&'+S));N=N.replace(/<\/head\s*>/,R+'$&');N=Q+N;}else N=O.docType+'<html dir="'+O.contentsLangDirection+'">'+'<head>'+S+R+'</head>'+'<body'+(O.bodyId?' id="'+O.bodyId+'"':'')+(O.bodyClass?' class="'+O.bodyClass+'"':'')+'>'+N+'</html>';N+=L;d._['contentDomReady'+z.name]=M;K(N);},getData:function(){var N=z.config,O=N.fullPage,P=O&&z.docType,Q=E.getFrameDocument(),R=O?Q.getDocumentElement().getOuterHtml():Q.getBody().getHtml();if(z.dataProcessor)R=z.dataProcessor.toDataFormat(R,A);if(N.ignoreEmptyParagraph)R=R.replace(p,'');if(P)R=P+'\n'+R;return R;},getSnapshotData:function(){return E.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(N){E.getFrameDocument().getBody().setHtml(N);},unload:function(N){z.window=z.document=E=C=G=null;z.fire('contentDomUnload');},focus:function(){if(F)G=true;else if(z.window){z.window.focus();if(f)try{var N=z.getSelection();N=N&&N.getNative();var O=N&&N.type&&N.createRange();if(O){N.empty();O.select();}}catch(P){}z.selectionChange();}}});z.on('insertHtml',q,null,null,20);z.on('insertElement',r,null,null,20);z.on('selectionChange',x,null,null,1);});if(f){var B;z.on('uiReady',function(){B=z.container.append(k.createFromHtml('<input tabindex="-1" style="position:absolute; left:-10000">'));B.on('focus',function(){z.focus();});});}}});if(e.gecko){var y=window.top;(function(){var z=y.document.body;if(!z)y.addEventListener('load',arguments.callee,false);else z.setAttribute('onpageshow',z.getAttribute('onpageshow')+';event.persisted && CKEDITOR.tools.callFunction('+h.addFunction(function(){var A=d.instances,B,C;for(var D in A){B=A[D];C=B.document;if(C){C.$.designMode='off';C.$.designMode='on';}}})+')');})();}})();l.disableObjectResizing=false;l.disableNativeTableHandles=true;l.disableNativeSpellChecker=true;l.ignoreEmptyParagraph=true;m.add('wsc',{init:function(o){var p='checkspell',q=o.addCommand(p,new d.dialogCommand(p));q.modes={wysiwyg:!e.opera&&document.domain==window.location.hostname};o.ui.addButton('SpellChecker',{label:o.lang.spellCheck.toolbar,command:p});d.dialog.add(p,this.path+'dialogs/wsc.js');}});l.wsc_customerId=l.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';l.wsc_customLoaderScript=l.wsc_customLoaderScript||null;m.add('styles',{requires:['selection']});d.editor.prototype.attachStyleStateChange=function(o,p){var q=this._.styleStateChangeCallbacks;if(!q){q=this._.styleStateChangeCallbacks=[];this.on('selectionChange',function(r){for(var s=0;s<q.length;s++){var t=q[s],u=t.style.checkActive(r.data.path)?1:2;if(t.state!==u){t.fn.call(this,u);t.state!==u;}}});}q.push({style:o,fn:p});};d.STYLE_BLOCK=1;d.STYLE_INLINE=2;d.STYLE_OBJECT=3;(function(){var o={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1},p={a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,ul:1},q=/\s*(?:;\s*|$)/;d.style=function(O,P){if(P){O=h.clone(O);J(O.attributes,P);J(O.styles,P);}var Q=this.element=(O.element||'*').toLowerCase();this.type=Q=='#'||o[Q]?1:p[Q]?3:2;this._={definition:O};};d.style.prototype={apply:function(O){N.call(this,O,false);},remove:function(O){N.call(this,O,true);},applyToRange:function(O){var P=this;return(P.applyToRange=P.type==2?r:P.type==1?t:null).call(P,O);},removeFromRange:function(O){return(this.removeFromRange=this.type==2?s:null).call(this,O);},applyToObject:function(O){H(O,this);},checkActive:function(O){switch(this.type){case 1:return this.checkElementRemovable(O.block||O.blockLimit,true);case 2:var P=O.elements;for(var Q=0,R;Q<P.length;Q++){R=P[Q];if(R==O.block||R==O.blockLimit)continue;if(this.checkElementRemovable(R,true))return true;}}return false;},checkElementRemovable:function(O,P){if(!O)return false;var Q=this._.definition,R;if(O.getName()==this.element){if(!P&&!O.hasAttributes())return true;R=K(Q);if(R._length){for(var S in R){if(S=='_length')continue;var T=O.getAttribute(S)||'';if(R[S]==(S=='style'?M(T,false):T)){if(!P)return true;}else if(P)return false;}if(P)return true;}else return true;}var U=L(this)[O.getName()];if(U){if(!(R=U.attributes))return true;for(var V=0;V<R.length;V++){S=R[V][0];var W=O.getAttribute(S);if(W){var X=R[V][1];if(X===null||typeof X=='string'&&W==X||X.test(W))return true;}}}return false;}};d.style.getStyleText=function(O){var P=O._ST;if(P)return P;P=O.styles;var Q=O.attributes&&O.attributes.style||'';if(Q.length)Q=Q.replace(q,';');for(var R in P)Q+=(R+':'+P[R]).replace(q,';');if(Q.length)Q=M(Q);return O._ST=Q;};function r(O){var ao=this;var P=O.document;if(O.collapsed){var Q=G(ao,P);O.insertNode(Q);O.moveToPosition(Q,2);return;}var R=ao.element,S=ao._.definition,T,U=i[R]||(T=true,i.span),V=O.createBookmark();O.enlarge(1);O.trim();var W=O.getBoundaryNodes(),X=W.startNode,Y=W.endNode.getNextSourceNode(true);if(!Y){var Z;Y=Z=P.createText('');Y.insertAfter(O.endContainer);}var aa=Y.getParent();if(aa&&aa.getAttribute('_fck_bookmark'))Y=aa;if(Y.equals(X)){Y=Y.getNextSourceNode(true);if(!Y){Y=Z=P.createText('');Y.insertAfter(X);}}var ab=X,ac,ad;while(ab){var ae=false;if(ab.equals(Y)){ab=null;ae=true;}else{var af=ab.type,ag=af==1?ab.getName():null;if(ag&&ab.getAttribute('_fck_bookmark')){ab=ab.getNextSourceNode(true);continue;}if(!ag||U[ag]&&(ab.getPosition(Y)|4|0|8)==(4+0+8)){var ah=ab.getParent();if(ah&&((ah.getDtd()||i.span)[R]||T)){if(!ac&&(!ag||!i.$removeEmpty[ag]||(ab.getPosition(Y)|4|0|8)==(4+0+8))){ac=new g.range(P);ac.setStartBefore(ab);}if(af==3||af==1&&!ab.getChildCount()){var ai=ab,aj;while(!ai.$.nextSibling&&(aj=ai.getParent(),U[aj.getName()])&&((aj.getPosition(X)|2|0|8)==(2+0+8)))ai=aj;ac.setEndAfter(ai);if(!ai.$.nextSibling)ae=true;if(!ad)ad=af!=3||/[^\s\ufeff]/.test(ab.getText());}}else ae=true;}else ae=true;ab=ab.getNextSourceNode();}if(ae&&ad&&ac&&!ac.collapsed){var ak=G(ao,P),al=ac.getCommonAncestor();while(ak&&al){if(al.getName()==R){for(var am in S.attributes)if(ak.getAttribute(am)==al.getAttribute(am))ak.removeAttribute(am);for(var an in S.styles)if(ak.getStyle(an)==al.getStyle(an))ak.removeStyle(an);if(!ak.hasAttributes()){ak=null;break;}}al=al.getParent();}if(ak){ac.extractContents().appendTo(ak);B(ao,ak);ac.insertNode(ak);E(ak);if(!f)ak.$.normalize();}ac=null;}}Z&&Z.remove();O.moveToBookmark(V);};function s(O){O.enlarge(1);var P=O.createBookmark(),Q=P.startNode;if(O.collapsed){var R=new g.elementPath(Q.getParent()),S;for(var T=0,U;T<R.elements.length&&(U=R.elements[T]);T++){if(U==R.block||U==R.blockLimit)break;if(this.checkElementRemovable(U)){var V=O.checkBoundaryOfElement(U,2),W=!V&&O.checkBoundaryOfElement(U,1);if(W||V){S=U;S.match=W?'start':'end';}else{E(U);A(this,U);}}}if(S){var X=Q;for(T=0;true;T++){var Y=R.elements[T];if(Y.equals(S))break;else if(Y.match)continue;else Y=Y.clone();Y.append(X);X=Y;}X[S.match=='start'?'insertBefore':'insertAfter'](S);}}else{var Z=P.endNode,aa=this;function ab(){var ae=new g.elementPath(Q.getParent()),af=new g.elementPath(Z.getParent()),ag=null,ah=null;for(var ai=0;ai<ae.elements.length;ai++){var aj=ae.elements[ai];if(aj==ae.block||aj==ae.blockLimit)break;if(aa.checkElementRemovable(aj))ag=aj;}for(ai=0;ai<af.elements.length;ai++){aj=af.elements[ai];if(aj==af.block||aj==af.blockLimit)break;if(aa.checkElementRemovable(aj))ah=aj;}if(ah)Z.breakParent(ah);if(ag)Q.breakParent(ag);};ab();var ac=Q.getNext();while(!ac.equals(Z)){var ad=ac.getNextSourceNode();if(ac.type==1&&this.checkElementRemovable(ac)){if(ac.getName()==this.element)A(this,ac);else C(ac,L(this)[ac.getName()]);if(ad.type==1&&ad.contains(Q)){ab();ad=Q.getNext();}}ac=ad;}}O.moveToBookmark(P);};function t(O){var P=O.createBookmark(true),Q=O.createIterator();Q.enforceRealBlocks=true;var R,S=O.document,T;while(R=Q.getNextParagraph()){var U=G(this,S);u(R,U);}O.moveToBookmark(P);};function u(O,P){var Q=P.is('pre'),R=O.is('pre'),S=Q&&!R,T=!Q&&R;if(S)P=z(O,P);else if(T)P=y(w(O),P);else O.moveChildren(P);P.replace(O);if(Q)v(P);};function v(O){var P;if(!((P=O.getPreviousSourceNode(true,1))&&(P.is&&P.is('pre'))))return;var Q=x(P.getHtml(),/\n$/,'')+'\n\n'+x(O.getHtml(),/^\n/,'');if(f)O.$.outerHTML='<pre>'+Q+'</pre>';else O.setHtml(Q);P.remove();};function w(O){var P=/(\S\s*)\n(?:\s|(<span[^>]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,Q=O.getName(),R=x(O.getOuterHtml(),P,function(T,U,V){return U+'</pre>'+V+'<pre>';}),S=[];R.replace(/<pre>([\s\S]*?)<\/pre>/gi,function(T,U){S.push(U);});return S;};function x(O,P,Q){var R='',S='';O=O.replace(/(^<span[^>]+_fck_bookmark.*?\/span>)|(<span[^>]+_fck_bookmark.*?\/span>$)/gi,function(T,U,V){U&&(R=U);V&&(S=V);return'';});return R+O.replace(P,Q)+S;};function y(O,P){var Q=new g.documentFragment(P.getDocument());for(var R=0;R<O.length;R++){var S=O[R];S=S.replace(/(\r\n|\r)/g,'\n');S=x(S,/^[ \t]*\n/,'');S=x(S,/\n$/,'');S=x(S,/^[ \t]+|[ \t]+$/g,function(U,V,W){if(U.length==1)return'&nbsp;';else if(!V)return h.repeat('&nbsp;',U.length-1)+' ';else return' '+h.repeat('&nbsp;',U.length-1);});S=S.replace(/\n/g,'<br>');S=S.replace(/[ \t]{2,}/g,function(U){return h.repeat('&nbsp;',U.length-1)+' ';});var T=P.clone();T.setHtml(S);Q.append(T);}return Q;};function z(O,P){var Q=O.getHtml();Q=x(Q,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');Q=Q.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,'$1');Q=Q.replace(/([ \t\n\r]+|&nbsp;)/g,' ');Q=Q.replace(/<br\b[^>]*>/gi,'\n');if(f){var R=O.getDocument().createElement('div');R.append(P);P.$.outerHTML='<pre>'+Q+'</pre>';P=R.getFirst().remove();}else P.setHtml(Q);return P;};function A(O,P){var Q=O._.definition,R=Q.attributes,S=Q.styles,T=L(O);function U(){for(var W in R){if(W=='class'&&P.getAttribute(W)!=R[W])continue;P.removeAttribute(W);}};U();for(var V in S)P.removeStyle(V);R=T[P.getName()];if(R)U();D(P);};function B(O,P){var Q=O._.definition,R=Q.attributes,S=Q.styles,T=L(O),U=P.getElementsByTag(O.element);for(var V=U.count();--V>=0;)A(O,U.getItem(V));for(var W in T)if(W!=O.element){U=P.getElementsByTag(W);for(V=U.count()-1;V>=0;V--){var X=U.getItem(V);C(X,T[W]);}}};function C(O,P){var Q=P&&P.attributes;if(Q)for(var R=0;R<Q.length;R++){var S=Q[R][0],T;if(T=O.getAttribute(S)){var U=Q[R][1];if(U===null||U.test&&U.test(T)||typeof U=='string'&&T==U)O.removeAttribute(S);}}D(O);};function D(O){if(!O.hasAttributes()){var P=O.getFirst(),Q=O.getLast();O.remove(true);if(P){E(P);if(Q&&!P.equals(Q))E(Q);}}};function E(O){if(!O||O.type!=1||!i.$removeEmpty[O.getName()])return;F(O,O.getNext(),true);F(O,O.getPrevious());};function F(O,P,Q){if(P&&P.type==1){var R=P.getAttribute('_fck_bookmark');if(R)P=Q?P.getNext():P.getPrevious();if(P&&P.type==1&&O.isIdentical(P)){var S=Q?O.getLast():O.getFirst();if(R)(Q?P.getPrevious():P.getNext()).move(O,!Q);P.moveChildren(O,!Q);P.remove();if(S)E(S);}}};function G(O,P){var Q,R=O._.definition,S=O.element;if(S=='*')S='span';Q=new k(S,P);return H(Q,O);};function H(O,P){var Q=P._.definition,R=Q.attributes,S=d.style.getStyleText(Q);if(R)for(var T in R)O.setAttribute(T,R[T]);if(S)O.setAttribute('style',S);return O;};var I=/#\((.+?)\)/g;function J(O,P){for(var Q in O)O[Q]=O[Q].replace(I,function(R,S){return P[S];});};function K(O){var P=O._AC;if(P)return P;P={};var Q=0,R=O.attributes;if(R)for(var S in R){Q++;P[S]=R[S];}var T=d.style.getStyleText(O);if(T){if(!P.style)Q++;P.style=T;}P._length=Q;return O._AC=P;};function L(O){if(O._.overrides)return O._.overrides;var P=O._.overrides={},Q=O._.definition.overrides;if(Q){if(!h.isArray(Q))Q=[Q];for(var R=0;R<Q.length;R++){var S=Q[R],T,U,V;if(typeof S=='string')T=S.toLowerCase();else{T=S.element?S.element.toLowerCase():O.element;V=S.attributes;}U=P[T]||(P[T]={});if(V){var W=U.attributes=U.attributes||[];for(var X in V)W.push([X.toLowerCase(),V[X]]);}}}return P;};function M(O,P){var Q;if(P!==false){var R=new k('span');R.setAttribute('style',O);Q=R.getAttribute('style');}else Q=O;return Q.replace(/\s*([;:])\s*/,'$1').replace(/([^\s;])$/,'$1;').replace(/,\s+/g,',').toLowerCase();};function N(O,P){var Q=O.getSelection(),R=Q.getRanges(),S=P?this.removeFromRange:this.applyToRange;for(var T=0;T<R.length;T++)S.call(this,R[T]);Q.selectRanges(R);};})();d.styleCommand=function(o){this.style=o;};d.styleCommand.prototype.exec=function(o){var q=this;o.focus();var p=o.document;if(p)if(q.state==2)q.style.apply(p);else if(q.state==1)q.style.remove(p);return!!p;};m.add('domiterator');(function(){function o(r){var s=this;if(arguments.length<1)return;s.range=r;s.forceBrBreak=false;s.enlargeBr=true;s.enforceRealBlocks=false;s._||(s._={});};var p=/^[\r\n\t ]+$/,q=g.walker.bookmark();o.prototype={getNextParagraph:function(r){var R=this;var s,t,u,v,w;if(!R._.lastNode){t=R.range.clone();t.enlarge(R.forceBrBreak||!R.enlargeBr?3:2);var x=new g.walker(t),y=g.walker.bookmark(true,true);x.evaluator=y;R._.nextNode=x.next();x=new g.walker(t);x.evaluator=y;var z=x.previous();R._.lastNode=z.getNextSourceNode(true);if(R._.lastNode&&R._.lastNode.type==3&&!h.trim(R._.lastNode.getText())&&R._.lastNode.getParent().isBlockBoundary()){var A=new g.range(t.document);A.moveToPosition(R._.lastNode,4);if(A.checkEndOfBlock()){var B=new g.elementPath(A.endContainer),C=B.block||B.blockLimit;R._.lastNode=C.getNextSourceNode(true);}}if(!R._.lastNode){R._.lastNode=R._.docEndMarker=t.document.createText('');R._.lastNode.insertAfter(z);}t=null;}var D=R._.nextNode;z=R._.lastNode;R._.nextNode=null;while(D){var E=false,F=D.type!=1,G=false;if(!F){var H=D.getName();if(D.isBlockBoundary(R.forceBrBreak&&{br:1})){if(H=='br')F=true;else if(!t&&!D.getChildCount()&&H!='hr'){s=D;u=D.equals(z);break;}if(t){t.setEndAt(D,3);if(H!='br')R._.nextNode=D;}E=true;}else{if(D.getFirst()){if(!t){t=new g.range(R.range.document);t.setStartAt(D,3);}D=D.getFirst();continue;}F=true;}}else if(D.type==3)if(p.test(D.getText()))F=false;if(F&&!t){t=new g.range(R.range.document);t.setStartAt(D,3);}u=(!E||F)&&(D.equals(z));if(t&&!E)while(!D.getNext()&&!u){var I=D.getParent();if(I.isBlockBoundary(R.forceBrBreak&&{br:1})){E=true;u=u||I.equals(z);break;}D=I;F=true;u=D.equals(z);G=true;}if(F)t.setEndAt(D,4);D=D.getNextSourceNode(G,null,z);u=!D;if((E||u)&&(t)){var J=t.getBoundaryNodes(),K=new g.elementPath(t.startContainer);if(J.startNode.getParent().equals(K.blockLimit)&&q(J.startNode)&&q(J.endNode)){t=null;R._.nextNode=null;}else break;}if(u)break;}if(!s){if(!t){R._.docEndMarker&&R._.docEndMarker.remove();R._.nextNode=null;return null;}K=new g.elementPath(t.startContainer);var L=K.blockLimit,M={div:1,th:1,td:1};s=K.block;if(!s&&!R.enforceRealBlocks&&M[L.getName()]&&t.checkStartOfBlock()&&t.checkEndOfBlock())s=L;else if(!s||R.enforceRealBlocks&&s.getName()=='li'){s=R.range.document.createElement(r||'p');t.extractContents().appendTo(s);s.trim();t.insertNode(s);v=w=true;}else if(s.getName()!='li'){if(!t.checkStartOfBlock()||!t.checkEndOfBlock()){s=s.clone(false);t.extractContents().appendTo(s);s.trim();var N=t.splitBlock();v=!N.wasStartOfBlock;w=!N.wasEndOfBlock;t.insertNode(s);}}else if(!u)R._.nextNode=s.equals(z)?null:t.getBoundaryNodes().endNode.getNextSourceNode(true,null,z);}if(v){var O=s.getPrevious();if(O&&O.type==1)if(O.getName()=='br')O.remove();else if(O.getLast()&&O.getLast().$.nodeName.toLowerCase()=='br')O.getLast().remove();}if(w){var P=g.walker.bookmark(false,true),Q=s.getLast();if(Q&&Q.type==1&&Q.getName()=='br')if(f||Q.getPrevious(P)||Q.getNext(P))Q.remove();}if(!R._.nextNode)R._.nextNode=u||s.equals(z)?null:s.getNextSourceNode(true,null,z);return s;}};g.range.prototype.createIterator=function(){return new o(this);};})();m.add('panelbutton',{requires:['button'],beforeInit:function(o){o.ui.addHandler(4,n.panelButton.handler);}});d.UI_PANELBUTTON=4;(function(){var o=function(p){var r=this;var q=r._;if(q.state==0)return;r.createPanel(p);if(q.on){q.panel.hide();return;}q.panel.showBlock(r._.id,r.document.getById(r._.id),4);};n.panelButton=h.createClass({base:n.button,$:function(p){var r=this;var q=p.panel;delete p.panel;r.base(p);r.document=q&&q.parent&&q.parent.getDocument()||d.document;r.hasArrow=true;r.click=o;r._={panelDefinition:q};},statics:{handler:{create:function(p){return new n.panelButton(p);}}},proto:{createPanel:function(p){var q=this._;if(q.panel)return;var r=this._.panelDefinition||{},s=r.parent||d.document.getBody(),t=this._.panel=new n.floatPanel(p,s,r),u=this;t.onShow=function(){if(u.className)this.element.getFirst().addClass(u.className+'_panel');q.oldState=u._.state;u.setState(1);q.on=1;if(u.onOpen)u.onOpen();};t.onHide=function(){if(u.className)this.element.getFirst().removeClass(u.className+'_panel');u.setState(q.oldState);q.on=0;if(u.onClose)u.onClose();};t.onEscape=function(){t.hide();u.document.getById(q.id).focus();};if(this.onBlock)this.onBlock(t,q.id);t.getBlock(q.id).onHide=function(){q.on=0;u.setState(2);};}}});})();m.add('floatpanel',{requires:['panel']});(function(){var o={},p=false;function q(r,s,t,u,v){var w=s.getUniqueId()+'-'+t.getUniqueId()+'-'+r.skinName+'-'+r.lang.dir+(r.uiColor&&'-'+r.uiColor||'')+(u.css&&'-'+u.css||'')+(v&&'-'+v||''),x=o[w];if(!x){x=o[w]=new n.panel(s,u);x.element=t.append(k.createFromHtml(x.renderHtml(r),s));x.element.setStyles({display:'none',position:'absolute'});}return x;};n.floatPanel=h.createClass({$:function(r,s,t,u){t.forceIFrame=true;var v=s.getDocument(),w=q(r,v,s,t,u||0),x=w.element,y=x.getFirst().getFirst();this.element=x;this._={panel:w,parentElement:s,definition:t,document:v,iframe:y,children:[],dir:r.lang.dir};},proto:{addBlock:function(r,s){return this._.panel.addBlock(r,s);},addListBlock:function(r,s){return this._.panel.addListBlock(r,s);},getBlock:function(r){return this._.panel.getBlock(r);},showBlock:function(r,s,t,u,v){var w=this._.panel,x=w.showBlock(r);this.allowBlur(false);p=true;var y=this.element,z=this._.iframe,A=this._.definition,B=s.getDocumentPosition(y.getDocument()),C=this._.dir=='rtl',D=B.x+(u||0),E=B.y+(v||0);if(C&&(t==1||t==4))D+=s.$.offsetWidth;else if(!C&&(t==2||t==3))D+=s.$.offsetWidth-1;if(t==3||t==4)E+=s.$.offsetHeight-1;this._.panel._.offsetParentId=s.getId();y.setStyles({top:E+'px',left:'-3000px',opacity:'0',display:''});if(!this._.blurSet){var F=f?z:new g.window(z.$.contentWindow);d.event.useCapture=true;F.on('blur',function(G){var J=this;if(!J.allowBlur())return;var H=G.data.getTarget(),I=H.getWindow&&H.getWindow();if(I&&I.equals(F))return;if(J.visible&&!J._.activeChild&&!p)J.hide();},this);F.on('focus',function(){this._.focused=true;this.hideChild();this.allowBlur(true);},this);d.event.useCapture=false;this._.blurSet=1;}w.onEscape=h.bind(function(){this.onEscape&&this.onEscape();},this);h.setTimeout(function(){if(C)D-=y.$.offsetWidth;var G=h.bind(function(){if(x.autoSize){var H=y.getFirst(),I=x.element.$.scrollHeight;if(f&&e.quirks&&I>0)I+=(H.$.offsetHeight||0)-(H.$.clientHeight||0);H.setStyle('height',I+'px');w._.currentBlock.element.setStyle('display','none').removeStyle('display');}else y.getFirst().removeStyle('height');var J=w.element,K=J.getWindow(),L=K.getScrollPosition(),M=K.getViewPaneSize(),N={height:J.$.offsetHeight,width:J.$.offsetWidth};if(C?D<0:D+N.width>M.width+L.x)D+=N.width*(C?1:-1);if(E+N.height>M.height+L.y)E-=N.height;y.setStyles({top:E+'px',left:D+'px',opacity:'1'});},this);w.isLoaded?G():w.onLoad=G;h.setTimeout(function(){if(A.voiceLabel)if(e.gecko){var H=z.getParent();H.setAttribute('role','region');H.setAttribute('title',A.voiceLabel);z.setAttribute('role','region');z.setAttribute('title',' ');}z.$.contentWindow.focus();this.allowBlur(true);},0,this);},0,this);this.visible=1;if(this.onShow)this.onShow.call(this);p=false;},hide:function(){var r=this;if(r.visible&&(!r.onHide||r.onHide.call(r)!==true)){r.hideChild();r.element.setStyle('display','none');r.visible=0;}},allowBlur:function(r){var s=this._.panel;if(r!=undefined)s.allowBlur=r;return s.allowBlur;},showAsChild:function(r,s,t,u,v,w){if(this._.activeChild==r&&r._.panel._.offsetParentId==t.getId())return;this.hideChild();r.onHide=h.bind(function(){h.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=r;this._.focused=false;r.showBlock(s,t,u,v,w);if(e.ie7Compat||e.ie8&&e.ie6Compat)setTimeout(function(){r.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var r=this._.activeChild;if(r){delete r.onHide;delete this._.activeChild;r.hide();}}}});d.on('instanceDestroyed',function(){var r=h.isEmpty(d.instances);for(var s in o){var t=o[s];if(r)t.destroy();else t.element.hide();}r&&(o={});});})();m.add('menu',{beforeInit:function(o){var p=o.config.menu_groups.split(','),q={};for(var r=0;r<p.length;r++)q[p[r]]=r+1;o._.menuGroups=q;o._.menuItems={};},requires:['floatpanel']});h.extend(d.editor.prototype,{addMenuGroup:function(o,p){this._.menuGroups[o]=p||100;},addMenuItem:function(o,p){if(this._.menuGroups[p.group])this._.menuItems[o]=new d.menuItem(this,o,p);},addMenuItems:function(o){for(var p in o)this.addMenuItem(p,o[p]);},getMenuItem:function(o){return this._.menuItems[o];}});(function(){d.menu=h.createClass({$:function(p,q){var r=this;r.id='cke_'+h.getNextNumber();r.editor=p;r.items=[];r._.level=q||1;},_:{showSubMenu:function(p){var w=this;var q=w._.subMenu,r=w.items[p],s=r.getItems&&r.getItems();if(!s){w._.panel.hideChild();return;}if(q)q.removeAll();else{q=w._.subMenu=new d.menu(w.editor,w._.level+1);q.parent=w;q.onClick=h.bind(w.onClick,w);}for(var t in s){var u=w.editor.getMenuItem(t);if(u){u.state=s[t];q.add(u);}}var v=w._.panel.getBlock(w.id).element.getDocument().getById(w.id+String(p));q.show(v,2);}},proto:{add:function(p){if(!p.order)p.order=this.items.length;this.items.push(p);},removeAll:function(){this.items=[];},show:function(p,q,r,s){var t=this.items,u=this.editor,v=this._.panel,w=this._.element;if(!v){v=this._.panel=new n.floatPanel(this.editor,d.document.getBody(),{css:u.skin.editor.css,level:this._.level-1,className:u.skinClass+' cke_contextmenu'},this._.level);v.onEscape=h.bind(function(){this.onEscape&&this.onEscape();this.hide();},this);v.onHide=h.bind(function(){this.onHide&&this.onHide();},this);var x=v.addBlock(this.id);x.autoSize=true;var y=x.keys;y[40]='next';y[9]='next';y[38]='prev';y[2000+9]='prev';y[32]='click';y[39]='click';w=this._.element=x.element;w.addClass(u.skinClass);var z=w.getDocument();z.getBody().setStyle('overflow','hidden');z.getElementsByTag('html').getItem(0).setStyle('overflow','hidden');this._.itemOverFn=h.addFunction(function(F){var G=this;clearTimeout(G._.showSubTimeout);G._.showSubTimeout=h.setTimeout(G._.showSubMenu,u.config.menu_subMenuDelay,G,[F]);},this);this._.itemOutFn=h.addFunction(function(F){clearTimeout(this._.showSubTimeout);},this);this._.itemClickFn=h.addFunction(function(F){var H=this;var G=H.items[F];if(G.state==0){H.hide();return;}if(G.getItems)H._.showSubMenu(F);else H.onClick&&H.onClick(G);},this);}o(t);var A=['<div class="cke_menu">'],B=t.length,C=B&&t[0].group;for(var D=0;D<B;D++){var E=t[D];if(C!=E.group){A.push('<div class="cke_menuseparator"></div>');C=E.group;}E.render(this,D,A);}A.push('</div>');w.setHtml(A.join(''));if(this.parent)this.parent._.panel.showAsChild(v,this.id,p,q,r,s);else v.showBlock(this.id,p,q,r,s);u.fire('menuShow',[v]);},hide:function(){this._.panel&&this._.panel.hide();}}});function o(p){p.sort(function(q,r){if(q.group<r.group)return-1;else if(q.group>r.group)return 1;return q.order<r.order?-1:q.order>r.order?1:0;});};})();d.menuItem=h.createClass({$:function(o,p,q){var r=this;h.extend(r,q,{order:0,className:'cke_button_'+p});r.group=o._.menuGroups[r.group];r.editor=o;r.name=p;},proto:{render:function(o,p,q){var w=this;var r=o.id+String(p),s=typeof w.state=='undefined'?2:w.state,t=' cke_'+(s==1?'on':s==0?'disabled':'off'),u=w.label;if(s==0)u=w.editor.lang.common.unavailable.replace('%1',u);if(w.className)t+=' '+w.className;q.push('<span class="cke_menuitem"><a id="',r,'" class="',t,'" href="javascript:void(\'',(w.label||'').replace("'",''),'\')" title="',w.label,'" tabindex="-1"_cke_focus=1 hidefocus="true"');if(e.opera||e.gecko&&e.mac)q.push(' onkeypress="return false;"');if(e.gecko)q.push(' onblur="this.style.cssText = this.style.cssText;"');var v=(w.iconOffset||0)*(-16);q.push(' onmouseover="CKEDITOR.tools.callFunction(',o._.itemOverFn,',',p,');" onmouseout="CKEDITOR.tools.callFunction(',o._.itemOutFn,',',p,');" onclick="CKEDITOR.tools.callFunction(',o._.itemClickFn,',',p,'); return false;"><span class="cke_icon_wrapper"><span class="cke_icon"'+(w.icon?' style="background-image:url('+d.getUrl(w.icon)+');background-position:0 '+v+'px;"':'')+'></span></span>'+'<span class="cke_label">');if(w.getItems)q.push('<span class="cke_menuarrow"></span>');q.push(u,'</span></a></span>');}}});l.menu_subMenuDelay=400;l.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var o=function(q,r){return q._.modes&&q._.modes[r||q.mode];},p;m.add('editingblock',{init:function(q){if(!q.config.editingBlock)return;q.on('themeSpace',function(r){if(r.data.space=='contents')r.data.html+='<br>';});q.on('themeLoaded',function(){q.fireOnce('editingBlockReady');});q.on('uiReady',function(){q.setMode(q.config.startupMode);});q.on('afterSetData',function(){if(!p){function r(){p=true;o(q).loadData(q.getData());p=false;};if(q.mode)r();else q.on('mode',function(){r();q.removeListener('mode',arguments.callee);});}});q.on('beforeGetData',function(){if(!p&&q.mode){p=true;q.setData(o(q).getData());p=false;}});q.on('getSnapshot',function(r){if(q.mode)r.data=o(q).getSnapshotData();});q.on('loadSnapshot',function(r){if(q.mode)o(q).loadSnapshotData(r.data);});q.on('mode',function(r){r.removeListener();var s=q.container;if(e.webkit&&e.version<528){var t=q.config.tabIndex||q.element.getAttribute('tabindex')||0;s=s.append(k.createFromHtml('<input tabindex="'+t+'"'+' style="position:absolute; left:-10000">'));}s.on('focus',function(){q.focus();});if(q.config.startupFocus)q.focus();setTimeout(function(){q.fireOnce('instanceReady');d.fire('instanceReady',null,q);});});}});d.editor.prototype.mode='';d.editor.prototype.addMode=function(q,r){r.name=q;(this._.modes||(this._.modes={}))[q]=r;};d.editor.prototype.setMode=function(q){var r,s=this.getThemeSpace('contents'),t=this.checkDirty();if(this.mode){if(q==this.mode)return;this.fire('beforeModeUnload');var u=o(this);r=u.getData();u.unload(s);this.mode='';}s.setHtml('');var v=o(this,q);if(!v)throw'[CKEDITOR.editor.setMode] Unknown mode "'+q+'".';if(!t)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});v.load(s,typeof r!='string'?this.getData():r);};d.editor.prototype.focus=function(){var q=o(this);if(q)q.focus();};})();l.startupMode='wysiwyg';l.startupFocus=false;l.editingBlock=true;(function(){function o(){var y=this;try{var v=y.getSelection();if(!v)return;var w=v.getStartElement(),x=new g.elementPath(w);if(!x.compare(y._.selectionPreviousPath)){y._.selectionPreviousPath=x;y.fire('selectionChange',{selection:v,path:x,element:w});}}catch(z){}};var p,q;function r(){q=true;if(p)return;s.call(this);p=h.setTimeout(s,200,this);};function s(){p=null;if(q){h.setTimeout(o,0,this);q=false;}};var t={exec:function(v){switch(v.mode){case'wysiwyg':v.document.$.execCommand('SelectAll',false,null);break;case'source':}},canUndo:false};m.add('selection',{init:function(v){v.on('contentDom',function(){var w=v.document,x=w.getBody();if(f){var y,z;x.on('focusin',function(){if(y){try{y.select();}catch(C){}y=null;}});v.window.on('focus',function(){z=true;B();});x.on('beforedeactivate',function(){z=false;});x.on('mousedown',A);x.on('mouseup',function(){z=true;setTimeout(function(){B(true);},0);});x.on('keydown',A);x.on('keyup',function(){z=true;B();});w.on('selectionchange',B);function A(){z=false;};function B(C){if(z){var D=v.document,E=D&&D.$.selection;if(C&&E&&E.type=='None')if(!D.$.queryCommandEnabled('InsertImage')){h.setTimeout(B,50,this,true);return;}y=E&&E.createRange();r.call(v);}};}else{w.on('mouseup',r,v);w.on('keyup',r,v);}});v.addCommand('selectAll',t);v.ui.addButton('SelectAll',{label:v.lang.selectAll,command:'selectAll'});v.selectionChange=r;}});d.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection();};d.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath;};j.prototype.getSelection=function(){var v=new g.selection(this);return!v||v.isInvalid?null:v;};d.SELECTION_NONE=1;d.SELECTION_TEXT=2;d.SELECTION_ELEMENT=3;g.selection=function(v){var y=this;var w=v.getCustomData('cke_locked_selection');if(w)return w;y.document=v;y.isLocked=false;y._={cache:{}};if(f){var x=y.getNative().createRange();if(!x||x.item&&x.item(0).ownerDocument!=y.document.$||x.parentElement&&x.parentElement().ownerDocument!=y.document.$)y.isInvalid=true;}return y;};var u={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1};g.selection.prototype={getNative:f?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection);}:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection());},getType:f?function(){var v=this._.cache;if(v.type)return v.type;var w=1;try{var x=this.getNative(),y=x.type;if(y=='Text')w=2;if(y=='Control')w=3;if(x.createRange().parentElement)w=2;}catch(z){}return v.type=w;}:function(){var v=this._.cache;if(v.type)return v.type;var w=2,x=this.getNative();if(!x)w=1;else if(x.rangeCount==1){var y=x.getRangeAt(0),z=y.startContainer;if(z==y.endContainer&&z.nodeType==1&&y.endOffset-y.startOffset==1&&u[z.childNodes[y.startOffset].nodeName.toLowerCase()])w=3;}return v.type=w;},getRanges:f?(function(){var v=function(w,x){w=w.duplicate();w.collapse(x);var y=w.parentElement(),z=y.childNodes,A;for(var B=0;B<z.length;B++){var C=z[B];if(C.nodeType==1){A=w.duplicate();A.moveToElementText(C);A.collapse();var D=A.compareEndPoints('StartToStart',w);if(D>0)break;else if(D===0)return{container:y,offset:B};A=null;}}if(!A){A=w.duplicate();A.moveToElementText(y);A.collapse(false);}A.setEndPoint('StartToStart',w);var E=A.text.replace(/(\r\n|\r)/g,'\n').length;while(E>0)E-=z[--B].nodeValue.length;if(E===0)return{container:y,offset:B};else return{container:z[B],offset:-E};};return function(){var H=this;var w=H._.cache;if(w.ranges)return w.ranges;var x=H.getNative(),y=x&&x.createRange(),z=H.getType(),A;if(!x)return[];if(z==2){A=new g.range(H.document);var B=v(y,true);A.setStart(new g.node(B.container),B.offset);B=v(y);A.setEnd(new g.node(B.container),B.offset);return w.ranges=[A];}else if(z==3){var C=H._.cache.ranges=[];for(var D=0;D<y.length;D++){var E=y.item(D),F=E.parentNode,G=0;A=new g.range(H.document);for(;G<F.childNodes.length&&F.childNodes[G]!=E;G++){}A.setStart(new g.node(F),G);A.setEnd(new g.node(F),G+1);C.push(A);}return C;}return w.ranges=[];};})():function(){var v=this._.cache;if(v.ranges)return v.ranges;var w=[],x=this.getNative();if(!x)return[];for(var y=0;y<x.rangeCount;y++){var z=x.getRangeAt(y),A=new g.range(this.document);A.setStart(new g.node(z.startContainer),z.startOffset);A.setEnd(new g.node(z.endContainer),z.endOffset);w.push(A);}return v.ranges=w;},getStartElement:function(){var C=this;var v=C._.cache;if(v.startElement!==undefined)return v.startElement;var w,x=C.getNative();switch(C.getType()){case 3:return C.getSelectedElement();case 2:var y=C.getRanges()[0];if(y)if(!y.collapsed){y.optimize();for(;;){var z=y.startContainer,A=y.startOffset;if(A==(z.getChildCount?z.getChildCount():z.getLength())&&!z.isBlockBoundary())y.setStartAfter(z);else break;}w=y.startContainer;if(w.type!=1)return w.getParent();w=w.getChild(y.startOffset);if(!w||w.type!=1)return y.startContainer;var B=w.getFirst();while(B&&B.type==1){w=B;B=B.getFirst();}return w;}if(f){y=x.createRange();y.collapse(true);w=y.parentElement();}else{w=x.anchorNode;if(w&&w.nodeType!=1)w=w.parentNode;}}return v.startElement=w?new k(w):null;},getSelectedElement:function(){var v=this._.cache;if(v.selectedElement!==undefined)return v.selectedElement;var w;if(this.getType()==3){var x=this.getNative();if(f)try{w=x.createRange().item(0);}catch(z){}else{var y=x.getRangeAt(0);w=y.startContainer.childNodes[y.startOffset];}}return v.selectedElement=w?new k(w):null;},lock:function(){var v=this;v.getRanges();v.getStartElement();v.getSelectedElement();v._.cache.nativeSel={};v.isLocked=true;v.document.setCustomData('cke_locked_selection',v);},unlock:function(v){var A=this;var w=A.document,x=w.getCustomData('cke_locked_selection');if(x){w.setCustomData('cke_locked_selection',null);if(v){var y=x.getSelectedElement(),z=!y&&x.getRanges();A.isLocked=false;A.reset();w.getBody().focus();if(y)A.selectElement(y);else A.selectRanges(z);}}if(!x||!v){A.isLocked=false;A.reset();}},reset:function(){this._.cache={};},selectElement:function(v){var y=this;if(y.isLocked){var w=new g.range(y.document);w.setStartBefore(v);w.setEndAfter(v);y._.cache.selectedElement=v;y._.cache.startElement=v;y._.cache.ranges=[w];y._.cache.type=3;return;}if(f){y.getNative().empty();try{w=y.document.$.body.createControlRange();w.addElement(v.$);w.select();}catch(z){w=y.document.$.body.createTextRange();w.moveToElementText(v.$);w.select();}y.reset();}else{w=y.document.$.createRange();w.selectNode(v.$);var x=y.getNative();x.removeAllRanges();x.addRange(w);y.reset();}},selectRanges:function(v){var B=this;if(B.isLocked){B._.cache.selectedElement=null;B._.cache.startElement=v[0].getTouchedStartNode();B._.cache.ranges=v;B._.cache.type=2;return;}if(f){if(v[0])v[0].select();B.reset();}else{var w=B.getNative();w.removeAllRanges();for(var x=0;x<v.length;x++){var y=v[x],z=B.document.$.createRange(),A=y.startContainer;if(y.collapsed&&e.gecko&&e.version<10900&&A.type==1&&!A.getChildCount())A.appendText('');z.setStart(A.$,y.startOffset);z.setEnd(y.endContainer.$,y.endOffset);w.addRange(z);}B.reset();}},createBookmarks:function(v){var w=[],x=this.getRanges(),y=x.length,z;for(var A=0;A<y;A++){w.push(z=x[A].createBookmark(v,true));v=z.serializable;var B=v?this.document.getById(z.startNode):z.startNode,C=v?this.document.getById(z.endNode):z.endNode;for(var D=A+1;D<y;D++){var E=x[D],F=E.startContainer,G=E.endContainer;F.equals(B.getParent())&&E.startOffset++;F.equals(C.getParent())&&E.startOffset++;G.equals(B.getParent())&&E.endOffset++;G.equals(C.getParent())&&E.endOffset++;}}return w;},createBookmarks2:function(v){var w=[],x=this.getRanges();for(var y=0;y<x.length;y++)w.push(x[y].createBookmark2(v));return w;},selectBookmarks:function(v){var w=[];for(var x=0;x<v.length;x++){var y=new g.range(this.document);y.moveToBookmark(v[x]);w.push(y);}this.selectRanges(w);return this;},getCommonAncestor:function(){var v=this.getRanges(),w=v[0].startContainer,x=v[v.length-1].endContainer;return w.getCommonAncestor(x);},scrollIntoView:function(){var v=this.getStartElement();v.scrollIntoView();}};})();(function(){var o=g.walker.whitespaces(true),p=/\ufeff|\u00a0/;g.range.prototype.select=f?function(q){var A=this;var r=A.collapsed,s,t,u=A.createBookmark(),v=u.startNode,w;if(!r)w=u.endNode;var x=A.document.$.body.createTextRange();x.moveToElementText(v.$);x.moveStart('character',1);if(w){var y=A.document.$.body.createTextRange();y.moveToElementText(w.$);x.setEndPoint('EndToEnd',y);x.moveEnd('character',-1);}else{var z=v.getNext(o);s=!(z&&z.getText&&z.getText().match(p))&&(q||!v.hasPrevious()||v.getPrevious().is&&v.getPrevious().is('br'));t=A.document.createElement('span');t.setHtml('&#65279;');t.insertBefore(v);if(s)A.document.createText('').insertBefore(v);}A.setStartBefore(v);v.remove();if(r){if(s){x.moveStart('character',-1);x.select();A.document.$.selection.clear();}else x.select();t.remove();}else{A.setEndBefore(w);w.remove();x.select();}}:function(){var t=this;var q=t.startContainer;if(t.collapsed&&q.type==1&&!q.getChildCount())q.append(new g.text(''));var r=t.document.$.createRange();r.setStart(q.$,t.startOffset);try{r.setEnd(t.endContainer.$,t.endOffset);}catch(u){if(u.toString().indexOf('NS_ERROR_ILLEGAL_VALUE')>=0){t.collapse(true);r.setEnd(t.endContainer.$,t.endOffset);}else throw u;}var s=t.document.getSelection().getNative();s.removeAllRanges();s.addRange(r);};})();(function(){var o={elements:{$:function(p){var q=p.attributes,r=q&&q._cke_realelement,s=r&&new d.htmlParser.fragment.fromHtml(decodeURIComponent(r)),t=s&&s.children[0];if(t&&p.attributes._cke_resizable){var u=p.attributes.style;if(u){var v=/(?:^|\s)width\s*:\s*(\d+)/i.exec(u),w=v&&v[1];v=/(?:^|\s)height\s*:\s*(\d+)/i.exec(u);var x=v&&v[1];if(w)t.attributes.width=w;if(x)t.attributes.height=x;}}return t;}}};m.add('fakeobjects',{requires:['htmlwriter'],afterInit:function(p){var q=p.dataProcessor,r=q&&q.htmlFilter;if(r)r.addRules(o);}});})();d.editor.prototype.createFakeElement=function(o,p,q,r){var s=this.lang.fakeobjects,t={'class':p,src:d.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(o.getOuterHtml()),_cke_real_node_type:o.type,alt:s[q]||s.unknown};if(q)t._cke_real_element_type=q;if(r)t._cke_resizable=r;return this.document.createElement('img',{attributes:t});};d.editor.prototype.createFakeParserElement=function(o,p,q,r){var s=this.lang.fakeobjects,t,u=new d.htmlParser.basicWriter();o.writeHtml(u);t=u.getHtml();var v={'class':p,src:d.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(t),_cke_real_node_type:o.type,alt:s[q]||s.unknown};if(q)v._cke_real_element_type=q;if(r)v._cke_resizable=r;return new d.htmlParser.element('img',v);};d.editor.prototype.restoreRealElement=function(o){if(o.getAttribute('_cke_real_node_type')!=1)return null;return k.createFromHtml(decodeURIComponent(o.getAttribute('_cke_realelement')),this.document);};m.add('richcombo',{requires:['floatpanel','listblock','button'],beforeInit:function(o){o.ui.addHandler(3,n.richCombo.handler);}});d.UI_RICHCOMBO=3;n.richCombo=h.createClass({$:function(o){var q=this;h.extend(q,o,{title:o.label,modes:{wysiwyg:1}});var p=q.panel||{};delete q.panel;q.id=h.getNextNumber();q.document=p&&p.parent&&p.parent.getDocument()||d.document;p.className=(p.className||'')+(' cke_rcombopanel');q._={panelDefinition:p,items:{},state:2};},statics:{handler:{create:function(o){return new n.richCombo(o);}}},proto:{renderHtml:function(o){var p=[];this.render(o,p);return p.join('');},render:function(o,p){var q='cke_'+this.id,r=h.addFunction(function(u){var x=this;var v=x._;if(v.state==0)return;x.createPanel(o);if(v.on){v.panel.hide();return;}if(!v.committed){v.list.commit();v.committed=1;}var w=x.getValue();if(w)v.list.mark(w);else v.list.unmarkAll();v.panel.showBlock(x.id,new k(u),4);},this),s={id:q,combo:this,focus:function(){var u=d.document.getById(q).getChild(1);u.focus();},execute:r};o.on('mode',function(){this.setState(this.modes[o.mode]?2:0);},this);var t=h.addFunction(function(u,v){u=new g.event(u);var w=u.getKeystroke();switch(w){case 13:case 32:case 40:h.callFunction(r,v);break;default:s.onkey(s,w);}u.preventDefault();});p.push('<span class="cke_rcombo">','<span id=',q);if(this.className)p.push(' class="',this.className,' cke_off"');p.push('><span class=cke_label>',this.label,'</span><a hidefocus=true title="',this.title,'" tabindex="-1" href="javascript:void(\'',this.label,"')\"");if(e.opera||e.gecko&&e.mac)p.push(' onkeypress="return false;"');if(e.gecko)p.push(' onblur="this.style.cssText = this.style.cssText;"');p.push(' onkeydown="CKEDITOR.tools.callFunction( ',t,', event, this );" onclick="CKEDITOR.tools.callFunction(',r,', this); return false;"><span><span class="cke_accessibility">'+(this.voiceLabel?this.voiceLabel+' ':'')+'</span>'+'<span id="'+q+'_text" class="cke_text cke_inline_label">'+this.label+'</span>'+'</span>'+'<span class=cke_openbutton></span>'+'</a>'+'</span>'+'</span>');if(this.onRender)this.onRender();return s;},createPanel:function(o){if(this._.panel)return;var p=this._.panelDefinition,q=p.parent||d.document.getBody(),r=new n.floatPanel(o,q,p),s=r.addListBlock(this.id,this.multiSelect),t=this;r.onShow=function(){if(t.className)this.element.getFirst().addClass(t.className+'_panel');t.setState(1);s.focus(!t.multiSelect&&t.getValue());t._.on=1;if(t.onOpen)t.onOpen();};r.onHide=function(){if(t.className)this.element.getFirst().removeClass(t.className+'_panel');t.setState(2);t._.on=0;if(t.onClose)t.onClose();};r.onEscape=function(){r.hide();t.document.getById('cke_'+t.id).getFirst().getNext().focus();};s.onClick=function(u,v){t.document.getWindow().focus();if(t.onClick)t.onClick.call(t,u,v);if(v)t.setValue(u,t._.items[u]);else t.setValue('');r.hide();};this._.panel=r;this._.list=s;r.getBlock(this.id).onHide=function(){t._.on=0;t.setState(2);};if(this.init)this.init();},setValue:function(o,p){var r=this;r._.value=o;var q=r.document.getById('cke_'+r.id+'_text');if(!(o||p)){p=r.label;q.addClass('cke_inline_label');}else q.removeClass('cke_inline_label');q.setHtml(typeof p!='undefined'?p:o);},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(o){this._.list.mark(o);},hideItem:function(o){this._.list.hideItem(o);},hideGroup:function(o){this._.list.hideGroup(o);},showAll:function(){this._.list.showAll();},add:function(o,p,q){this._.items[o]=q||o;this._.list.add(o,p,q);},startGroup:function(o){this._.list.startGroup(o);},commit:function(){this._.list.commit();},setState:function(o){var p=this;if(p._.state==o)return;p.document.getById('cke_'+p.id).setState(o);p._.state=o;}}});n.prototype.addRichCombo=function(o,p){this.add(o,3,p);};m.add('htmlwriter');d.htmlWriter=h.createClass({base:d.htmlParser.basicWriter,$:function(){var q=this;q.base();q.indentationChars='\t';q.selfClosingEnd=' />';q.lineBreakChars='\n';q.forceSimpleAmpersand=false;q.sortAttributes=true;q._.indent=false;q._.indentation='';q._.rules={};var o=i;for(var p in h.extend({},o.$nonBodyContent,o.$block,o.$listItem,o.$tableContent))q.setRules(p,{indent:true,breakBeforeOpen:true,breakAfterOpen:true,breakBeforeClose:!o[p]['#'],breakAfterClose:true});q.setRules('br',{breakAfterOpen:true});q.setRules('title',{indent:false,breakAfterOpen:false});q.setRules('style',{indent:false,breakBeforeClose:true});q.setRules('pre',{indent:false});},proto:{openTag:function(o,p){var r=this;var q=r._.rules[o];if(r._.indent)r.indentation();else if(q&&q.breakBeforeOpen){r.lineBreak();r.indentation();}r._.output.push('<',o);},openTagClose:function(o,p){var r=this;var q=r._.rules[o];if(p)r._.output.push(r.selfClosingEnd);else{r._.output.push('>');if(q&&q.indent)r._.indentation+=r.indentationChars;}if(q&&q.breakAfterOpen)r.lineBreak();},attribute:function(o,p){if(this.forceSimpleAmpersand)p=p.replace(/&amp;/,'&');this._.output.push(' ',o,'="',p,'"');},closeTag:function(o){var q=this;var p=q._.rules[o];if(p&&p.indent)q._.indentation=q._.indentation.substr(q.indentationChars.length);if(q._.indent)q.indentation();else if(p&&p.breakBeforeClose){q.lineBreak();q.indentation();}q._.output.push('</',o,'>');if(p&&p.breakAfterClose)q.lineBreak();},text:function(o){if(this._.indent){this.indentation();o=h.ltrim(o);}this._.output.push(o);},comment:function(o){if(this._.indent)this.indentation();this._.output.push('<!--',o,'-->');},lineBreak:function(){var o=this;if(o._.output.length>0)o._.output.push(o.lineBreakChars);o._.indent=true;},indentation:function(){this._.output.push(this._.indentation);this._.indent=false;},setRules:function(o,p){var q=this._.rules[o];if(q)h.extend(q,p,true);else this._.rules[o]=p;}}});m.add('menubutton',{requires:['button','contextmenu'],beforeInit:function(o){o.ui.addHandler(5,n.menuButton.handler);}});d.UI_MENUBUTTON=5;(function(){var o=function(p){var q=this._;if(q.state===0)return;q.previousState=q.state;var r=q.menu;if(!r){r=q.menu=new m.contextMenu(p);r.onHide=h.bind(function(){this.setState(q.previousState);},this);if(this.onMenu)r.addListener(this.onMenu);}if(q.on){r.hide();return;}this.setState(1);r.show(d.document.getById(this._.id),4);};n.menuButton=h.createClass({base:n.button,$:function(p){var q=p.panel;delete p.panel;this.base(p);this.hasArrow=true;this.click=o;},statics:{handler:{create:function(p){return new n.menuButton(p);}}}});})();d.DIALOG_RESIZE_NONE=0;d.DIALOG_RESIZE_WIDTH=1;d.DIALOG_RESIZE_HEIGHT=2;d.DIALOG_RESIZE_BOTH=3;(function(){function o(N){return!!this._.tabs[N][0].$.offsetHeight;};function p(){var R=this;var N=R._.currentTabId,O=R._.tabIdList.length,P=h.indexOf(R._.tabIdList,N)+O;for(var Q=P-1;Q>P-O;Q--)if(o.call(R,R._.tabIdList[Q%O]))return R._.tabIdList[Q%O];return null;};function q(){var R=this;var N=R._.currentTabId,O=R._.tabIdList.length,P=h.indexOf(R._.tabIdList,N);for(var Q=P+1;Q<P+O;Q++)if(o.call(R,R._.tabIdList[Q%O]))return R._.tabIdList[Q%O];return null;};d.dialog=function(N,O){var P=d.dialog._.dialogDefinitions[O];P=h.extend(P(N),s);P=h.clone(P);P=new w(this,P);this.definition=P=d.fire('dialogDefinition',{name:O,definition:P},N).definition;var Q=d.document,R=N.theme.buildDialog(N);this._={editor:N,element:R.element,name:O,contentSize:{width:0,height:0},size:{width:0,height:0},updateSize:false,contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};this.parts=R.parts;this.parts.dialog.setStyles({position:e.ie6Compat?'absolute':'fixed',top:0,left:0,visibility:'hidden'});d.event.call(this);if(P.onLoad)this.on('load',P.onLoad);if(P.onShow)this.on('show',P.onShow);if(P.onHide)this.on('hide',P.onHide);if(P.onOk)this.on('ok',function(ad){if(P.onOk.call(this,ad)===false)ad.data.hide=false;});if(P.onCancel)this.on('cancel',function(ad){if(P.onCancel.call(this,ad)===false)ad.data.hide=false;});var S=this,T=function(ad){var ae=S._.contents,af=false;for(var ag in ae)for(var ah in ae[ag]){af=ad.call(this,ae[ag][ah]);if(af)return;}};this.on('ok',function(ad){T(function(ae){if(ae.validate){var af=ae.validate(this);if(typeof af=='string'){alert(af);af=false;}if(af===false){if(ae.select)ae.select();else ae.focus();ad.data.hide=false;ad.stop();return true;}}});},this,null,0);this.on('cancel',function(ad){T(function(ae){if(ae.isChanged()){if(!confirm(N.lang.common.confirmCancel))ad.data.hide=false;return true;}});},this,null,0);this.parts.close.on('click',function(ad){if(this.fire('cancel',{hide:true}).hide!==false)this.hide();},this);function U(ad){var ae=S._.focusList,af=ad?1:-1;if(ae.length<1)return;var ag=(S._.currentFocusIndex+af+ae.length)%(ae.length),ah=ag;while(!ae[ah].isFocusable()){ah=(ah+af+ae.length)%(ae.length);if(ah==ag)break;}ae[ah].focus();if(ae[ah].type=='text')ae[ah].select();};var V;function W(ad){if(S!=d.dialog._.currentTop)return;var ae=ad.data.getKeystroke();V=0;if(ae==9||ae==2000+9){var af=ae==2000+9;if(S._.tabBarMode){var ag=af?p.call(S):q.call(S);S.selectPage(ag);S._.tabs[ag][0].focus();}else U(!af);V=1;}else if(ae==4000+121&&!S._.tabBarMode){S._.tabBarMode=true;S._.tabs[S._.currentTabId][0].focus();V=1;}else if((ae==37||ae==39)&&(S._.tabBarMode)){ag=ae==37?p.call(S):q.call(S);S.selectPage(ag);S._.tabs[ag][0].focus();V=1;}if(V){ad.stop();ad.data.preventDefault();}};function X(ad){V&&ad.data.preventDefault();};this.on('show',function(){d.document.on('keydown',W,this,null,0);if(e.opera||e.gecko&&e.mac)d.document.on('keypress',X,this);if(e.ie6Compat){var ad=B.getChild(0).getFrameDocument();ad.on('keydown',W,this,null,0);}});this.on('hide',function(){d.document.removeListener('keydown',W);if(e.opera||e.gecko&&e.mac)d.document.removeListener('keypress',X);});this.on('iframeAdded',function(ad){var ae=new j(ad.data.iframe.$.contentWindow.document);ae.on('keydown',W,this,null,0);});this.on('show',function(){var ag=this;if(!ag._.hasFocus){ag._.currentFocusIndex=-1;U(true);if(ag._.editor.mode=='wysiwyg'&&f){var ad=N.document.$.selection,ae=ad.createRange();if(ae)if(ae.parentElement&&ae.parentElement().ownerDocument==N.document.$||ae.item&&ae.item(0).ownerDocument==N.document.$){var af=document.body.createTextRange();af.moveToElementText(ag.getElement().getFirst().$);af.collapse(true);af.select();}}}},this,null,4294967295);if(e.ie6Compat)this.on('load',function(ad){var ae=this.getElement(),af=ae.getFirst();af.remove();af.appendTo(ae);},this);y(this);z(this);new g.text(P.title,d.document).appendTo(this.parts.title);for(var Y=0;Y<P.contents.length;Y++)this.addPage(P.contents[Y]);var Z=/cke_dialog_tab(\s|$|_)/,aa=/cke_dialog_tab(\s|$)/;this.parts.tabs.on('click',function(ad){var ai=this;var ae=ad.data.getTarget(),af=ae,ag,ah;if(!(Z.test(ae.$.className)||ae.getName()=='a'))return;ag=ae.$.id.substr(0,ae.$.id.lastIndexOf('_'));ai.selectPage(ag);if(ai._.tabBarMode){ai._.tabBarMode=false;ai._.currentFocusIndex=-1;U(true);}ad.data.preventDefault();},this);var ab=[],ac=d.dialog._.uiElementBuilders.hbox.build(this,{type:'hbox',className:'cke_dialog_footer_buttons',widths:[],children:P.buttons},ab).getChild();this.parts.footer.setHtml(ab.join(''));for(Y=0;Y<ac.length;Y++)this._.buttons[ac[Y].id]=ac[Y];d.skins.load(N,'dialog');};function r(N,O,P){this.element=O;this.focusIndex=P;this.isFocusable=function(){return!O.getAttribute('disabled')&&O.isVisible();};this.focus=function(){N._.currentFocusIndex=this.focusIndex;this.element.focus();};O.on('keydown',function(Q){if(Q.data.getKeystroke()in{32:1,13:1})this.fire('click');});O.on('focus',function(){this.fire('mouseover');});O.on('blur',function(){this.fire('mouseout');});};d.dialog.prototype={resize:(function(){return function(N,O){var P=this;if(P._.contentSize&&P._.contentSize.width==N&&P._.contentSize.height==O)return;d.dialog.fire('resize',{dialog:P,skin:P._.editor.skinName,width:N,height:O},P._.editor);P._.contentSize={width:N,height:O};P._.updateSize=true;};})(),getSize:function(){var P=this;if(!P._.updateSize)return P._.size;var N=P._.element.getFirst(),O=P._.size={width:N.$.offsetWidth||0,height:N.$.offsetHeight||0};P._.updateSize=!O.width||!O.height;return O;},move:(function(){var N;return function(O,P){var S=this;var Q=S._.element.getFirst();if(N===undefined)N=Q.getComputedStyle('position')=='fixed';if(N&&S._.position&&S._.position.x==O&&S._.position.y==P)return;S._.position={x:O,y:P};if(!N){var R=d.document.getWindow().getScrollPosition();O+=R.x;P+=R.y;}Q.setStyles({left:(O>0?O:0)+('px'),top:(P>0?P:0)+('px')});};})(),getPosition:function(){return h.extend({},this._.position);},show:function(){var N=this._.editor;if(N.mode=='wysiwyg'&&f){var O=N.getSelection();O&&O.lock();}var P=this._.element,Q=this.definition;if(!(P.getParent()&&P.getParent().equals(d.document.getBody())))P.appendTo(d.document.getBody());else return;if(e.gecko&&e.version<10900){var R=this.parts.dialog;R.setStyle('position','absolute');setTimeout(function(){R.setStyle('position','fixed');},0);}this.resize(Q.minWidth,Q.minHeight);this.selectPage(this.definition.contents[0].id);this.reset();if(d.dialog._.currentZIndex===null)d.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;this._.element.getFirst().setStyle('z-index',d.dialog._.currentZIndex+=10);if(d.dialog._.currentTop===null){d.dialog._.currentTop=this;this._.parentDialog=null;C(this._.editor);P.on('keydown',F);P.on(e.opera?'keypress':'keyup',G);for(var S in{keyup:1,keydown:1,keypress:1})P.on(S,M);}else{this._.parentDialog=d.dialog._.currentTop;var T=this._.parentDialog.getElement().getFirst();T.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);d.dialog._.currentTop=this;}H(this,this,'\x1b',null,function(){this.getButton('cancel')&&this.getButton('cancel').click();});this._.hasFocus=false;h.setTimeout(function(){var U=d.document.getWindow().getViewPaneSize(),V=this.getSize();this.move((U.width-Q.minWidth)/(2),(U.height-V.height)/(2));this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(W){W.setInitValue&&W.setInitValue();});},100,this);},foreach:function(N){var Q=this;for(var O in Q._.contents)for(var P in Q._.contents[O])N(Q._.contents[O][P]);return Q;},reset:(function(){var N=function(O){if(O.reset)O.reset();};return function(){this.foreach(N);return this;};})(),setupContent:function(){var N=arguments;this.foreach(function(O){if(O.setup)O.setup.apply(O,N);});},commitContent:function(){var N=arguments;this.foreach(function(O){if(O.commit)O.commit.apply(O,N);});},hide:function(){this.fire('hide',{});this._.editor.fire('dialogHide',this);var N=this._.element;if(!N.getParent())return;N.remove();this.parts.dialog.setStyle('visibility','hidden');I(this);if(!this._.parentDialog)D();else{var O=this._.parentDialog.getElement().getFirst();O.setStyle('z-index',parseInt(O.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}d.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){d.dialog._.currentZIndex=null;N.removeListener('keydown',F);N.removeListener(e.opera?'keypress':'keyup',G);for(var P in{keyup:1,keydown:1,keypress:1})N.removeListener(P,M);var Q=this._.editor;Q.focus();if(Q.mode=='wysiwyg'&&f){var R=Q.getSelection();R&&R.unlock(true);}}else d.dialog._.currentZIndex-=10;this.foreach(function(S){S.resetInitValue&&S.resetInitValue();});},addPage:function(N){var X=this;var O=[],P=N.label?' title="'+h.htmlEncode(N.label)+'"':'',Q=N.elements,R=d.dialog._.uiElementBuilders.vbox.build(X,{type:'vbox',className:'cke_dialog_page_contents',children:N.elements,expand:!!N.expand,padding:N.padding,style:N.style||'width: 100%;'},O),S=k.createFromHtml(O.join('')),T=k.createFromHtml(['<a class="cke_dialog_tab"',X._.pageCount>0?' cke_last':'cke_first',P,!!N.hidden?' style="display:none"':'',' id="',N.id+'_',h.getNextNumber(),'" href="javascript:void(0)"',' hidefocus="true">',N.label,'</a>'].join(''));if(X._.pageCount===0)X.parts.dialog.addClass('cke_single_page');else X.parts.dialog.removeClass('cke_single_page');X._.tabs[N.id]=[T,S];X._.tabIdList.push(N.id);X._.pageCount++;X._.lastTab=T;var U=X._.contents[N.id]={},V,W=R.getChild();while(V=W.shift()){U[V.id]=V;if(typeof V.getChild=='function')W.push.apply(W,V.getChild());}S.setAttribute('name',N.id);S.appendTo(X.parts.contents);T.unselectable();X.parts.tabs.append(T);if(N.accessKey){H(X,X,'CTRL+'+N.accessKey,K,J);X._.accessKeyMap['CTRL+'+N.accessKey]=N.id;}},selectPage:function(N){var S=this;for(var O in S._.tabs){var P=S._.tabs[O][0],Q=S._.tabs[O][1];if(O!=N){P.removeClass('cke_dialog_tab_selected');Q.hide();}}var R=S._.tabs[N];R[0].addClass('cke_dialog_tab_selected');R[1].show();S._.currentTabId=N;S._.currentTabIndex=h.indexOf(S._.tabIdList,N);},hidePage:function(N){var O=this._.tabs[N]&&this._.tabs[N][0];if(!O)return;O.hide();},showPage:function(N){var O=this._.tabs[N]&&this._.tabs[N][0];if(!O)return;O.show();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(N,O){return this._.contents[N][O];},getValueOf:function(N,O){return this.getContentElement(N,O).getValue();},setValueOf:function(N,O,P){return this.getContentElement(N,O).setValue(P);},getButton:function(N){return this._.buttons[N];},click:function(N){return this._.buttons[N].click();},disableButton:function(N){return this._.buttons[N].disable();},enableButton:function(N){return this._.buttons[N].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(N,O){var Q=this;if(typeof O=='undefined'){O=Q._.focusList.length;Q._.focusList.push(new r(Q,N,O));}else{Q._.focusList.splice(O,0,new r(Q,N,O));for(var P=O+1;P<Q._.focusList.length;P++)Q._.focusList[P].focusIndex++;}}};h.extend(d.dialog,{add:function(N,O){if(!this._.dialogDefinitions[N]||typeof O=='function')this._.dialogDefinitions[N]=O;},exists:function(N){return!!this._.dialogDefinitions[N];},getCurrent:function(){return d.dialog._.currentTop;},okButton:(function(){var N=function(O,P){P=P||{};return h.extend({id:'ok',type:'button',label:O.lang.common.ok,'class':'cke_dialog_ui_button_ok',onClick:function(Q){var R=Q.data.dialog;if(R.fire('ok',{hide:true}).hide!==false)R.hide();}},P,true);};N.type='button';N.override=function(O){return h.extend(function(P){return N(P,O);},{type:'button'},true);};return N;})(),cancelButton:(function(){var N=function(O,P){P=P||{};return h.extend({id:'cancel',type:'button',label:O.lang.common.cancel,'class':'cke_dialog_ui_button_cancel',onClick:function(Q){var R=Q.data.dialog;if(R.fire('cancel',{hide:true}).hide!==false)R.hide();}},P,true);};N.type='button';N.override=function(O){return h.extend(function(P){return N(P,O);},{type:'button'},true);};return N;})(),addUIElement:function(N,O){this._.uiElementBuilders[N]=O;}});d.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};d.event.implementOn(d.dialog);d.event.implementOn(d.dialog.prototype,true);var s={resizable:0,minWidth:600,minHeight:400,buttons:[d.dialog.okButton,d.dialog.cancelButton]},t=function(N,O,P){for(var Q=0,R;R=N[Q];Q++){if(R.id==O)return R;if(P&&R[P]){var S=t(R[P],O,P);if(S)return S;}}return null;},u=function(N,O,P,Q,R){if(P){for(var S=0,T;T=N[S];S++){if(T.id==P){N.splice(S,0,O);return O;}if(Q&&T[Q]){var U=u(T[Q],O,P,Q,true);if(U)return U;}}if(R)return null;}N.push(O);return O;},v=function(N,O,P){for(var Q=0,R;R=N[Q];Q++){if(R.id==O)return N.splice(Q,1);if(P&&R[P]){var S=v(R[P],O,P);if(S)return S;}}return null;},w=function(N,O){this.dialog=N;var P=O.contents;for(var Q=0,R;R=P[Q];Q++)P[Q]=new x(N,R);h.extend(this,O);};w.prototype={getContents:function(N){return t(this.contents,N);},getButton:function(N){return t(this.buttons,N);},addContents:function(N,O){return u(this.contents,N,O);},addButton:function(N,O){return u(this.buttons,N,O);},removeContents:function(N){v(this.contents,N);},removeButton:function(N){v(this.buttons,N);}};function x(N,O){this._={dialog:N};h.extend(this,O);};x.prototype={get:function(N){return t(this.elements,N,'children');},add:function(N,O){return u(this.elements,N,O,'children');},remove:function(N){v(this.elements,N,'children');}};function y(N){var O=null,P=null,Q=N.getElement().getFirst(),R=N.getParentEditor(),S=R.config.dialog_magnetDistance,T=R.skin.margins||[0,0,0,0];if(typeof S=='undefined')S=20;function U(W){var X=N.getSize(),Y=d.document.getWindow().getViewPaneSize(),Z=W.data.$.screenX,aa=W.data.$.screenY,ab=Z-O.x,ac=aa-O.y,ad,ae;O={x:Z,y:aa};P.x+=ab;P.y+=ac;if(P.x+T[3]<S)ad=-T[3];else if(P.x-T[1]>Y.width-X.width-S)ad=Y.width-X.width+T[1];else ad=P.x;if(P.y+T[0]<S)ae=-T[0];else if(P.y-T[2]>Y.height-X.height-S)ae=Y.height-X.height+T[2];else ae=P.y;N.move(ad,ae);W.data.preventDefault();};function V(W){d.document.removeListener('mousemove',U);d.document.removeListener('mouseup',V);if(e.ie6Compat){var X=B.getChild(0).getFrameDocument();X.removeListener('mousemove',U);X.removeListener('mouseup',V);}};N.parts.title.on('mousedown',function(W){N._.updateSize=true;O={x:W.data.$.screenX,y:W.data.$.screenY};d.document.on('mousemove',U);d.document.on('mouseup',V);P=N.getPosition();if(e.ie6Compat){var X=B.getChild(0).getFrameDocument();X.on('mousemove',U);X.on('mouseup',V);}W.data.preventDefault();},N);};function z(N){var O=N.definition,P=O.minWidth||0,Q=O.minHeight||0,R=O.resizable,S=N.getParentEditor().skin.margins||[0,0,0,0];function T(ae,af){ae.y+=af;};function U(ae,af){ae.x2+=af;};function V(ae,af){ae.y2+=af;};function W(ae,af){ae.x+=af;};var X=null,Y=null,Z=N._.editor.config.magnetDistance,aa=['tl','t','tr','l','r','bl','b','br'];function ab(ae){var af=ae.listenerData.part,ag=N.getSize();Y=N.getPosition();h.extend(Y,{x2:Y.x+ag.width,y2:Y.y+ag.height});X={x:ae.data.$.screenX,y:ae.data.$.screenY};d.document.on('mousemove',ac,N,{part:af});d.document.on('mouseup',ad,N,{part:af});if(e.ie6Compat){var ah=B.getChild(0).getFrameDocument();ah.on('mousemove',ac,N,{part:af});ah.on('mouseup',ad,N,{part:af});}ae.data.preventDefault();};function ac(ae){var af=ae.data.$.screenX,ag=ae.data.$.screenY,ah=af-X.x,ai=ag-X.y,aj=d.document.getWindow().getViewPaneSize(),ak=ae.listenerData.part;if(ak.search('t')!=-1)T(Y,ai);if(ak.search('l')!=-1)W(Y,ah);if(ak.search('b')!=-1)V(Y,ai);if(ak.search('r')!=-1)U(Y,ah);X={x:af,y:ag};var al,am,an,ao;if(Y.x+S[3]<Z)al=-S[3];else if(ak.search('l')!=-1&&Y.x2-Y.x<P+Z)al=Y.x2-P;else al=Y.x;if(Y.y+S[0]<Z)am=-S[0];else if(ak.search('t')!=-1&&Y.y2-Y.y<Q+Z)am=Y.y2-Q;else am=Y.y;if(Y.x2-S[1]>aj.width-Z)an=aj.width+S[1];else if(ak.search('r')!=-1&&Y.x2-Y.x<P+Z)an=Y.x+P;else an=Y.x2;if(Y.y2-S[2]>aj.height-Z)ao=aj.height+S[2];else if(ak.search('b')!=-1&&Y.y2-Y.y<Q+Z)ao=Y.y+Q;else ao=Y.y2;N.move(al,am);N.resize(an-al,ao-am);ae.data.preventDefault();};function ad(ae){d.document.removeListener('mouseup',ad);d.document.removeListener('mousemove',ac);if(e.ie6Compat){var af=B.getChild(0).getFrameDocument();af.removeListener('mouseup',ad);af.removeListener('mousemove',ac);}};};var A,B,C=function(N){var O=d.document.getWindow();if(!B){var P=N.config.dialog_backgroundCoverColor||'white',Q=['<div style="position: ',e.ie6Compat?'absolute':'fixed','; z-index: ',N.config.baseFloatZIndex,'; top: 0px; left: 0px; ',!e.ie6Compat?'background-color: '+P:'','" id="cke_dialog_background_cover">'];if(e.ie6Compat){var R=e.isCustomDomain(),S="<html><body style=\\'background-color:"+P+";\\'></body></html>";Q.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');Q.push('void((function(){document.open();'+(R?"document.domain='"+document.domain+"';":'')+"document.write( '"+S+"' );"+'document.close();'+'})())');Q.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>');}Q.push('</div>');B=k.createFromHtml(Q.join(''));}var T=B,U=function(){var Y=O.getViewPaneSize();T.setStyles({width:Y.width+'px',height:Y.height+'px'});},V=function(){var Y=O.getScrollPosition(),Z=d.dialog._.currentTop;T.setStyles({left:Y.x+'px',top:Y.y+'px'});do{var aa=Z.getPosition();Z.move(aa.x,aa.y);}while(Z=Z._.parentDialog)};A=U;O.on('resize',U);U();if(e.ie6Compat){var W=function(){V();arguments.callee.prevScrollHandler.apply(this,arguments);};O.$.setTimeout(function(){W.prevScrollHandler=window.onscroll||(function(){});window.onscroll=W;},0);V();}var X=N.config.dialog_backgroundCoverOpacity;T.setOpacity(typeof X!='undefined'?X:0.5);T.appendTo(d.document.getBody());},D=function(){if(!B)return;var N=d.document.getWindow();B.remove();N.removeListener('resize',A);if(e.ie6Compat)N.$.setTimeout(function(){var O=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=O||null;},0);A=null;},E={},F=function(N){var O=N.data.$.ctrlKey||N.data.$.metaKey,P=N.data.$.altKey,Q=N.data.$.shiftKey,R=String.fromCharCode(N.data.$.keyCode),S=E[(O?'CTRL+':'')+(P?'ALT+':'')+(Q?'SHIFT+':'')+R];if(!S||!S.length)return;S=S[S.length-1];S.keydown&&S.keydown.call(S.uiElement,S.dialog,S.key);N.data.preventDefault();},G=function(N){var O=N.data.$.ctrlKey||N.data.$.metaKey,P=N.data.$.altKey,Q=N.data.$.shiftKey,R=String.fromCharCode(N.data.$.keyCode),S=E[(O?'CTRL+':'')+(P?'ALT+':'')+(Q?'SHIFT+':'')+R];if(!S||!S.length)return;S=S[S.length-1];if(S.keyup){S.keyup.call(S.uiElement,S.dialog,S.key);N.data.preventDefault();}},H=function(N,O,P,Q,R){var S=E[P]||(E[P]=[]);S.push({uiElement:N,dialog:O,key:P,keyup:R||N.accessKeyUp,keydown:Q||N.accessKeyDown});},I=function(N){for(var O in E){var P=E[O];for(var Q=P.length-1;Q>=0;Q--)if(P[Q].dialog==N||P[Q].uiElement==N)P.splice(Q,1);if(P.length===0)delete E[O];}},J=function(N,O){if(N._.accessKeyMap[O])N.selectPage(N._.accessKeyMap[O]);},K=function(N,O){},L={27:1,13:1},M=function(N){if(N.data.getKeystroke()in L)N.data.stopPropagation();};(function(){n.dialog={uiElement:function(N,O,P,Q,R,S,T){if(arguments.length<4)return;var U=(Q.call?Q(O):Q)||('div'),V=['<',U,' '],W=(R&&R.call?R(O):R)||({}),X=(S&&S.call?S(O):S)||({}),Y=(T&&T.call?T(N,O):T)||(''),Z=this.domId=X.id||h.getNextNumber()+'_uiElement',aa=this.id=O.id,ab;X.id=Z;var ac={};if(O.type)ac['cke_dialog_ui_'+O.type]=1;if(O.className)ac[O.className]=1;var ad=X['class']&&X['class'].split?X['class'].split(' '):[];for(ab=0;ab<ad.length;ab++)if(ad[ab])ac[ad[ab]]=1;var ae=[];for(ab in ac)ae.push(ab);X['class']=ae.join(' ');if(O.title)X.title=O.title;var af=(O.style||'').split(';');for(ab in W)af.push(ab+':'+W[ab]);if(O.hidden)af.push('display:none');for(ab=af.length-1;ab>=0;ab--)if(af[ab]==='')af.splice(ab,1);if(af.length>0)X.style=(X.style?X.style+'; ':'')+(af.join('; '));for(ab in X)V.push(ab+'="'+h.htmlEncode(X[ab])+'" ');V.push('>',Y,'</',U,'>');P.push(V.join(''));(this._||(this._={})).dialog=N;if(typeof O.isChanged=='boolean')this.isChanged=function(){return O.isChanged;};if(typeof O.isChanged=='function')this.isChanged=O.isChanged;d.event.implementOn(this);this.registerEvents(O);if(this.accessKeyUp&&this.accessKeyDown&&O.accessKey)H(this,N,'CTRL+'+O.accessKey);var ag=this;N.on('load',function(){if(ag.getInputElement())ag.getInputElement().on('focus',function(){N._.tabBarMode=false;N._.hasFocus=true;ag.fire('focus');},ag);});if(this.keyboardFocusable){this.focusIndex=N._.focusList.push(this)-1;this.on('focus',function(){N._.currentFocusIndex=ag.focusIndex;});}h.extend(this,O);},hbox:function(N,O,P,Q,R){if(arguments.length<4)return;this._||(this._={});var S=this._.children=O,T=R&&R.widths||null,U=R&&R.height||null,V={},W,X=function(){var Y=['<tbody><tr class="cke_dialog_ui_hbox">'];for(W=0;W<P.length;W++){var Z='cke_dialog_ui_hbox_child',aa=[];if(W===0)Z='cke_dialog_ui_hbox_first';if(W==P.length-1)Z='cke_dialog_ui_hbox_last';Y.push('<td class="',Z,'" ');if(T){if(T[W])aa.push('width:'+h.cssLength(T[W]));}else aa.push('width:'+Math.floor(100/P.length)+'%');if(U)aa.push('height:'+h.cssLength(U));if(R&&R.padding!=undefined)aa.push('padding:'+h.cssLength(R.padding));if(aa.length>0)Y.push('style="'+aa.join('; ')+'" ');Y.push('>',P[W],'</td>');}Y.push('</tr></tbody>');return Y.join('');};n.dialog.uiElement.call(this,N,R||{type:'hbox'},Q,'table',V,R&&R.align&&{align:R.align}||null,X);},vbox:function(N,O,P,Q,R){if(arguments.length<3)return;this._||(this._={});var S=this._.children=O,T=R&&R.width||null,U=R&&R.heights||null,V=function(){var W=['<table cellspacing="0" border="0" '];W.push('style="');if(R&&R.expand)W.push('height:100%;');W.push('width:'+h.cssLength(T||'100%'),';');W.push('"');W.push('align="',h.htmlEncode(R&&R.align||(N.getParentEditor().lang.dir=='ltr'?'left':'right')),'" ');W.push('><tbody>');for(var X=0;X<P.length;X++){var Y=[];W.push('<tr><td ');if(T)Y.push('width:'+h.cssLength(T||'100%'));if(U)Y.push('height:'+h.cssLength(U[X]));else if(R&&R.expand)Y.push('height:'+Math.floor(100/P.length)+'%');if(R&&R.padding!=undefined)Y.push('padding:'+h.cssLength(R.padding));if(Y.length>0)W.push('style="',Y.join('; '),'" ');W.push(' class="cke_dialog_ui_vbox_child">',P[X],'</td></tr>');}W.push('</tbody></table>');return W.join('');};n.dialog.uiElement.call(this,N,R||{type:'vbox'},Q,'div',null,null,V);}};})();n.dialog.uiElement.prototype={getElement:function(){return d.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(N){this.getInputElement().setValue(N);this.fire('change',{value:N});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var Q=this;var N=Q.getInputElement(),O=N,P;while((O=O.getParent())&&(O.$.className.search('cke_dialog_page_contents')==-1)){}if(!O)return Q;P=O.getAttribute('name');if(Q._.dialog._.currentTabId!=P)Q._.dialog.selectPage(P);return Q;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(N){var O=/^on([A-Z]\w+)/,P,Q=function(S,T,U,V){T.on('load',function(){S.getInputElement().on(U,V,S);});};for(var R in N){if(!(P=R.match(O)))continue;if(this.eventProcessors[R])this.eventProcessors[R].call(this,this._.dialog,N[R]);else Q(this,this._.dialog,P[1].toLowerCase(),N[R]);}return this;},eventProcessors:{onLoad:function(N,O){N.on('load',O,this);},onShow:function(N,O){N.on('show',O,this);},onHide:function(N,O){N.on('hide',O,this);}},accessKeyDown:function(N,O){this.focus();},accessKeyUp:function(N,O){},disable:function(){var N=this.getInputElement();N.setAttribute('disabled','true');N.addClass('cke_disabled');},enable:function(){var N=this.getInputElement();N.removeAttribute('disabled');N.removeClass('cke_disabled');},isEnabled:function(){return!this.getInputElement().getAttribute('disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};n.dialog.hbox.prototype=h.extend(new n.dialog.uiElement(),{getChild:function(N){var O=this;if(arguments.length<1)return O._.children.concat();if(!N.splice)N=[N];if(N.length<2)return O._.children[N[0]];else return O._.children[N[0]]&&O._.children[N[0]].getChild?O._.children[N[0]].getChild(N.slice(1,N.length)):null;}},true);n.dialog.vbox.prototype=new n.dialog.hbox();(function(){var N={build:function(O,P,Q){var R=P.children,S,T=[],U=[];for(var V=0;V<R.length&&(S=R[V]);V++){var W=[];T.push(W);U.push(d.dialog._.uiElementBuilders[S.type].build(O,S,W));}return new n.dialog[P.type](O,U,T,Q,P);}};d.dialog.addUIElement('hbox',N);d.dialog.addUIElement('vbox',N);})();d.dialogCommand=function(N){this.dialogName=N;};d.dialogCommand.prototype={exec:function(N){N.openDialog(this.dialogName);},canUndo:false};(function(){var N=/^([a]|[^a])+$/,O=/^\d*$/,P=/^\d*(?:\.\d+)?$/;d.VALIDATE_OR=1;d.VALIDATE_AND=2;d.dialog.validate={functions:function(){return function(){var W=this;var Q=W&&W.getValue?W.getValue():arguments[0],R=undefined,S=2,T=[],U;for(U=0;U<arguments.length;U++)if(typeof arguments[U]=='function')T.push(arguments[U]);else break;if(U<arguments.length&&typeof arguments[U]=='string'){R=arguments[U];U++;}if(U<arguments.length&&typeof arguments[U]=='number')S=arguments[U];var V=S==2?true:false;for(U=0;U<T.length;U++)if(S==2)V=V&&T[U](Q);else V=V||T[U](Q);if(!V){if(R!==undefined)alert(R);if(W&&(W.select||W.focus))W.select||W.focus();return false;}return true;};},regex:function(Q,R){return function(){var T=this;var S=T&&T.getValue?T.getValue():arguments[0];if(!Q.test(S)){if(R!==undefined)alert(R);if(T&&(T.select||T.focus))if(T.select)T.select();else T.focus();return false;}return true;};},notEmpty:function(Q){return this.regex(N,Q);},integer:function(Q){return this.regex(O,Q);},number:function(Q){return this.regex(P,Q);},equals:function(Q,R){return this.functions(function(S){return S==Q;},R);},notEqual:function(Q,R){return this.functions(function(S){return S!=Q;},R);}};})();})();h.extend(d.editor.prototype,{openDialog:function(o,p){var q=d.dialog._.dialogDefinitions[o];if(typeof q=='function'){var r=this._.storedDialogs||(this._.storedDialogs={}),s=r[o]||(r[o]=new d.dialog(this,o));p&&p.call(s,s);s.show();return s;}else if(q=='failed')throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+o+'" failed when loading definition.');var t=d.document.getBody(),u=t.$.style.cursor,v=this;t.setStyle('cursor','wait');d.scriptLoader.load(d.getUrl(q),function(){if(typeof d.dialog._.dialogDefinitions[o]!='function')d.dialog._.dialogDefinitions[o]='failed';v.openDialog(o,p);t.setStyle('cursor',u);});return null;}});m.add('dialog',{requires:['dialogui']});m.add('panel',{beforeInit:function(o){o.ui.addHandler(2,n.panel.handler);}});d.UI_PANEL=2;n.panel=function(o,p){var q=this;if(p)h.extend(q,p);h.extend(q,{className:'',css:[]});q.id=h.getNextNumber();q.document=o;q._={blocks:{}};};n.panel.handler={create:function(o){return new n.panel(o);}};n.panel.prototype={renderHtml:function(o){var p=[];this.render(o,p);return p.join('');},render:function(o,p){var r=this;var q='cke_'+r.id;p.push('<div class="',o.skinClass,'" lang="',o.langCode,'" style="display:none;z-index:'+(o.config.baseFloatZIndex+1)+'">'+'<div'+' id=',q,' dir=',o.lang.dir,' class="cke_panel cke_',o.lang.dir);if(r.className)p.push(' ',r.className);p.push('">');if(r.forceIFrame||r.css.length){p.push('<iframe id="',q,'_frame" frameborder="0" src="javascript:void(');p.push(e.isCustomDomain()?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');p.push(')"></iframe>');}p.push('</div></div>');return q;},getHolderElement:function(){var o=this._.holder;if(!o){if(this.forceIFrame||this.css.length){var p=this.document.getById('cke_'+this.id+'_frame'),q=p.getParent(),r=q.getAttribute('dir'),s=q.getParent().getAttribute('class'),t=q.getParent().getAttribute('lang'),u=p.getFrameDocument();u.$.open();if(e.isCustomDomain())u.$.domain=document.domain;var v=h.addFunction(h.bind(function(x){this.isLoaded=true;if(this.onLoad)this.onLoad();},this));u.$.write('<!DOCTYPE html><html dir="'+r+'" class="'+s+'_container" lang="'+t+'">'+'<head>'+'<style>.'+s+'_container{visibility:hidden}</style>'+'</head>'+'<body class="cke_'+r+' cke_panel_frame '+e.cssClass+'" style="margin:0;padding:0"'+' onload="( window.CKEDITOR || window.parent.CKEDITOR ).tools.callFunction('+v+');">'+'</body>'+h.buildStyleHtml(this.css)+'</html>');u.$.close();var w=u.getWindow();w.$.CKEDITOR=d;u.on('keydown',function(x){var z=this;var y=x.data.getKeystroke();if(z._.onKeyDown&&z._.onKeyDown(y)===false){x.data.preventDefault();return;}if(y==27)z.onEscape&&z.onEscape();},this);o=u.getBody();}else o=this.document.getById('cke_'+this.id);this._.holder=o;}return o;},addBlock:function(o,p){var q=this;p=q._.blocks[o]=p||new n.panel.block(q.getHolderElement());if(!q._.currentBlock)q.showBlock(o);return p;},getBlock:function(o){return this._.blocks[o];},showBlock:function(o){var s=this;var p=s._.blocks,q=p[o],r=s._.currentBlock;if(r)r.hide();s._.currentBlock=q;q._.focusIndex=-1;s._.onKeyDown=q.onKeyDown&&h.bind(q.onKeyDown,q);q.show();return q;},destroy:function(){this.element&&this.element.remove();}};n.panel.block=h.createClass({$:function(o){var p=this;p.element=o.append(o.getDocument().createElement('div',{attributes:{'class':'cke_panel_block'},styles:{display:'none'}}));p.keys={};p._.focusIndex=-1;p.element.disableContextMenu();},_:{},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var o=this;if(!o.onHide||o.onHide.call(o)!==true)o.element.setStyle('display','none');},onKeyDown:function(o){var t=this;var p=t.keys[o];switch(p){case'next':var q=t._.focusIndex,r=t.element.getElementsByTag('a'),s;while(s=r.getItem(++q))if(s.getAttribute('_cke_focus')&&s.$.offsetWidth){t._.focusIndex=q;s.focus();break;}return false;case'prev':q=t._.focusIndex;r=t.element.getElementsByTag('a');while(q>0&&(s=r.getItem(--q)))if(s.getAttribute('_cke_focus')&&s.$.offsetWidth){t._.focusIndex=q;s.focus();break;}return false;case'click':q=t._.focusIndex;s=q>=0&&t.element.getElementsByTag('a').getItem(q);if(s)s.$.click?s.$.click():s.$.onclick();return false;}return true;}}});m.add('listblock',{requires:['panel'],onLoad:function(){n.panel.prototype.addListBlock=function(o,p){return this.addBlock(o,new n.listBlock(this.getHolderElement(),p));};n.listBlock=h.createClass({base:n.panel.block,$:function(o,p){var r=this;r.base(o);r.multiSelect=!!p;var q=r.keys;q[40]='next';q[9]='next';q[38]='prev';q[2000+9]='prev';q[32]='click';r._.pendingHtml=[];r._.items={};r._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('</ul>');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=h.addFunction(function(o){var q=this;var p=true;if(q.multiSelect)p=q.toggle(o);else q.mark(o);if(q.onClick)q.onClick(o,p);},this);return this._.click;}},proto:{add:function(o,p,q){var t=this;var r=t._.pendingHtml,s='cke_'+h.getNextNumber();if(!t._.started){r.push('<ul class=cke_panel_list>');t._.started=1;}t._.items[o]=s;r.push('<li id=',s,' class=cke_panel_listItem><a _cke_focus=1 hidefocus=true title="',q||o,'" href="javascript:void(\'',o,'\')" onclick="CKEDITOR.tools.callFunction(',t._.getClick(),",'",o,"'); return false;\">",p||o,'</a></li>');},startGroup:function(o){this._.close();var p='cke_'+h.getNextNumber();this._.groups[o]=p;this._.pendingHtml.push('<h1 id=',p,' class=cke_panel_grouptitle>',o,'</h1>');},commit:function(){var o=this;o._.close();o.element.appendHtml(o._.pendingHtml.join(''));o._.pendingHtml=[];},toggle:function(o){var p=this.isMarked(o);if(p)this.unmark(o);else this.mark(o);return!p;},hideGroup:function(o){var p=this.element.getDocument().getById(this._.groups[o]),q=p&&p.getNext();if(p){p.setStyle('display','none');if(q&&q.getName()=='ul')q.setStyle('display','none');}},hideItem:function(o){this.element.getDocument().getById(this._.items[o]).setStyle('display','none');},showAll:function(){var o=this._.items,p=this._.groups,q=this.element.getDocument();for(var r in o)q.getById(o[r]).setStyle('display','');for(var s in p){var t=q.getById(p[s]),u=t.getNext();t.setStyle('display','');if(u&&u.getName()=='ul')u.setStyle('display','');}},mark:function(o){var p=this;if(!p.multiSelect)p.unmarkAll();p.element.getDocument().getById(p._.items[o]).addClass('cke_selected');},unmark:function(o){this.element.getDocument().getById(this._.items[o]).removeClass('cke_selected');},unmarkAll:function(){var o=this._.items,p=this.element.getDocument();for(var q in o)p.getById(o[q]).removeClass('cke_selected');},isMarked:function(o){return this.element.getDocument().getById(this._.items[o]).hasClass('cke_selected');},focus:function(o){this._.focusIndex=-1;if(o){var p=this.element.getDocument().getById(this._.items[o]).getFirst(),q=this.element.getElementsByTag('a'),r,s=-1;while(r=q.getItem(++s))if(r.equals(p)){this._.focusIndex=s;break;}setTimeout(function(){p.focus();},0);}}}});}});m.add('dialogui');(function(){var o=function(v){var y=this;y._||(y._={});y._['default']=y._.initValue=v['default']||'';var w=[y._];for(var x=1;x<arguments.length;x++)w.push(arguments[x]);w.push(true);h.extend.apply(h,w);return y._;},p={build:function(v,w,x){return new n.dialog.textInput(v,w,x);}},q={build:function(v,w,x){return new n.dialog[w.type](v,w,x);}},r={isChanged:function(){return this.getValue()!=this.getInitValue();},reset:function(){this.setValue(this.getInitValue());},setInitValue:function(){this._.initValue=this.getValue();},resetInitValue:function(){this._.initValue=this._['default'];},getInitValue:function(){return this._.initValue;}},s=h.extend({},n.dialog.uiElement.prototype.eventProcessors,{onChange:function(v,w){if(!this._.domOnChangeRegistered){v.on('load',function(){this.getInputElement().on('change',function(){this.fire('change',{value:this.getValue()});},this);},this);this._.domOnChangeRegistered=true;}this.on('change',w);}},true),t=/^on([A-Z]\w+)/,u=function(v){for(var w in v)if(t.test(w)||w=='title'||w=='type')delete v[w];return v;};h.extend(n.dialog,{labeledElement:function(v,w,x,y){if(arguments.length<4)return;var z=o.call(this,w);z.labelId=h.getNextNumber()+'_label';var A=this._.children=[],B=function(){var C=[];if(w.labelLayout!='horizontal')C.push('<div class="cke_dialog_ui_labeled_label" id="',z.labelId,'" >',w.label,'</div>','<div class="cke_dialog_ui_labeled_content">',y(v,w),'</div>');else{var D={type:'hbox',widths:w.widths,padding:0,children:[{type:'html',html:'<span class="cke_dialog_ui_labeled_label" id="'+z.labelId+'">'+h.htmlEncode(w.label)+'</span>'},{type:'html',html:'<span class="cke_dialog_ui_labeled_content">'+y(v,w)+'</span>'}]};d.dialog._.uiElementBuilders.hbox.build(v,D,C);}return C.join('');};n.dialog.uiElement.call(this,v,w,x,'div',null,null,B);},textInput:function(v,w,x){if(arguments.length<3)return;o.call(this,w);var y=this._.inputId=h.getNextNumber()+'_textInput',z={'class':'cke_dialog_ui_input_'+w.type,id:y,type:'text'},A;if(w.validate)this.validate=w.validate;if(w.maxLength)z.maxlength=w.maxLength;if(w.size)z.size=w.size;var B=this,C=false;v.on('load',function(){B.getInputElement().on('keydown',function(E){if(E.data.getKeystroke()==13)C=true;});B.getInputElement().on('keyup',function(E){if(E.data.getKeystroke()==13&&C){v.getButton('ok')&&setTimeout(function(){v.getButton('ok').click();},0);C=false;}},null,null,1000);});var D=function(){var E=['<div class="cke_dialog_ui_input_',w.type,'"'];if(w.width)E.push('style="width:'+w.width+'" ');E.push('><input ');for(var F in z)E.push(F+'="'+z[F]+'" ');E.push(' /></div>');return E.join('');};n.dialog.labeledElement.call(this,v,w,x,D);},textarea:function(v,w,x){if(arguments.length<3)return;o.call(this,w);var y=this,z=this._.inputId=h.getNextNumber()+'_textarea',A={};if(w.validate)this.validate=w.validate;A.rows=w.rows||5;A.cols=w.cols||20;var B=function(){var C=['<div class="cke_dialog_ui_input_textarea"><textarea class="cke_dialog_ui_input_textarea" id="',z,'" '];for(var D in A)C.push(D+'="'+h.htmlEncode(A[D])+'" ');C.push('>',h.htmlEncode(y._['default']),'</textarea></div>');return C.join('');};n.dialog.labeledElement.call(this,v,w,x,B);},checkbox:function(v,w,x){if(arguments.length<3)return;var y=o.call(this,w,{'default':!!w['default']});if(w.validate)this.validate=w.validate;var z=function(){var A=h.extend({},w,{id:w.id?w.id+'_checkbox':h.getNextNumber()+'_checkbox'},true),B=[],C={'class':'cke_dialog_ui_checkbox_input',type:'checkbox'};u(A);if(w['default'])C.checked='checked';y.checkbox=new n.dialog.uiElement(v,A,B,'input',null,C);B.push(' <label for="',C.id,'">',h.htmlEncode(w.label),'</label>');return B.join('');};n.dialog.uiElement.call(this,v,w,x,'span',null,null,z);},radio:function(v,w,x){if(arguments.length<3)return;o.call(this,w);if(!this._['default'])this._['default']=this._.initValue=w.items[0][1];if(w.validate)this.validate=w.valdiate;var y=[],z=this,A=function(){var B=[],C=[],D={'class':'cke_dialog_ui_radio_item'},E=w.id?w.id+'_radio':h.getNextNumber()+'_radio';for(var F=0;F<w.items.length;F++){var G=w.items[F],H=G[2]!==undefined?G[2]:G[0],I=G[1]!==undefined?G[1]:G[0],J=h.extend({},w,{id:h.getNextNumber()+'_radio_input',title:null,type:null},true),K=h.extend({},J,{id:null,title:H},true),L={type:'radio','class':'cke_dialog_ui_radio_input',name:E,value:I},M=[];if(z._['default']==I)L.checked='checked';u(J);u(K);y.push(new n.dialog.uiElement(v,J,M,'input',null,L));M.push(' ');new n.dialog.uiElement(v,K,M,'label',null,{'for':L.id},G[0]);B.push(M.join(''));}new n.dialog.hbox(v,[],B,C);return C.join('');};n.dialog.labeledElement.call(this,v,w,x,A);this._.children=y;},button:function(v,w,x){if(!arguments.length)return;if(typeof w=='function')w=w(v.getParentEditor());o.call(this,w,{disabled:w.disabled||false});d.event.implementOn(this);var y=this;v.on('load',function(A){var B=this.getElement();(function(){B.on('click',function(C){y.fire('click',{dialog:y.getDialog()});C.data.preventDefault();});})();B.unselectable();},this);var z=h.extend({},w);delete z.style;n.dialog.uiElement.call(this,v,z,x,'a',null,{style:w.style,href:'javascript:void(0)',title:w.label,hidefocus:'true','class':w['class']},'<span class="cke_dialog_ui_button">'+h.htmlEncode(w.label)+'</span>');},select:function(v,w,x){if(arguments.length<3)return;var y=o.call(this,w);if(w.validate)this.validate=w.validate;var z=function(){var A=h.extend({},w,{id:w.id?w.id+'_select':h.getNextNumber()+'_select'},true),B=[],C=[],D={'class':'cke_dialog_ui_input_select'};if(w.size!=undefined)D.size=w.size;if(w.multiple!=undefined)D.multiple=w.multiple;u(A);for(var E=0,F;E<w.items.length&&(F=w.items[E]);E++)C.push('<option value="',h.htmlEncode(F[1]!==undefined?F[1]:F[0]),'" /> ',h.htmlEncode(F[0]));y.select=new n.dialog.uiElement(v,A,B,'select',null,D,C.join(''));return B.join('');};n.dialog.labeledElement.call(this,v,w,x,z);},file:function(v,w,x){if(arguments.length<3)return;if(w['default']===undefined)w['default']='';var y=h.extend(o.call(this,w),{definition:w,buttons:[]});if(w.validate)this.validate=w.validate;var z=function(){y.frameId=h.getNextNumber()+'_fileInput';var A=e.isCustomDomain(),B=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" id="',y.frameId,'" title="',w.label,'" src="javascript:void('];B.push(A?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');B.push(')"></iframe>');return B.join('');};v.on('load',function(){var A=d.document.getById(y.frameId),B=A.getParent();B.addClass('cke_dialog_ui_input_file');});n.dialog.labeledElement.call(this,v,w,x,z);},fileButton:function(v,w,x){if(arguments.length<3)return;var y=o.call(this,w),z=this;if(w.validate)this.validate=w.validate;var A=h.extend({},w),B=A.onClick;A.className=(A.className?A.className+' ':'')+('cke_dialog_ui_button');A.onClick=function(C){var D=w['for'];if(!B||B.call(this,C)!==false){v.getContentElement(D[0],D[1]).submit();this.disable();}};v.on('load',function(){v.getContentElement(w['for'][0],w['for'][1])._.buttons.push(z);});n.dialog.button.call(this,v,A,x);},html:(function(){var v=/^\s*<[\w:]+\s+([^>]*)?>/,w=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,x=/\/$/;return function(y,z,A){if(arguments.length<3)return;var B=[],C,D=z.html,E,F;if(D.charAt(0)!='<')D='<span>'+D+'</span>';if(z.focus){var G=this.focus;this.focus=function(){G.call(this);z.focus.call(this);this.fire('focus');};if(z.isFocusable){var H=this.isFocusable;this.isFocusable=H;}this.keyboardFocusable=true;}n.dialog.uiElement.call(this,y,z,B,'span',null,null,'');C=B.join('');E=C.match(v);F=D.match(w)||['','',''];if(x.test(F[1])){F[1]=F[1].slice(0,-1);F[2]='/'+F[2];}A.push([F[1],' ',E[1]||'',F[2]].join(''));};})()},true);n.dialog.html.prototype=new n.dialog.uiElement();n.dialog.labeledElement.prototype=h.extend(new n.dialog.uiElement(),{setLabel:function(v){var w=d.document.getById(this._.labelId);if(w.getChildCount()<1)new g.text(v,d.document).appendTo(w);else w.getChild(0).$.nodeValue=v;return this;},getLabel:function(){var v=d.document.getById(this._.labelId);if(!v||v.getChildCount()<1)return'';else return v.getChild(0).getText();},eventProcessors:s},true);n.dialog.button.prototype=h.extend(new n.dialog.uiElement(),{click:function(){var v=this;if(!v._.disabled)return v.fire('click',{dialog:v._.dialog});v.getElement().$.blur();return false;},enable:function(){this._.disabled=false;var v=this.getElement();v&&v.removeClass('disabled');},disable:function(){this._.disabled=true;this.getElement().addClass('disabled');},isVisible:function(){return this.getElement().getFirst().isVisible();},isEnabled:function(){return!this._.disabled;},eventProcessors:h.extend({},n.dialog.uiElement.prototype.eventProcessors,{onClick:function(v,w){this.on('click',w);}},true),accessKeyUp:function(){this.click();},accessKeyDown:function(){this.focus();},keyboardFocusable:true},true);n.dialog.textInput.prototype=h.extend(new n.dialog.labeledElement(),{getInputElement:function(){return d.document.getById(this._.inputId);},focus:function(){var v=this.selectParentTab();setTimeout(function(){var w=v.getInputElement();w&&w.$.focus();},0);},select:function(){var v=this.selectParentTab();setTimeout(function(){var w=v.getInputElement();if(w){w.$.focus();w.$.select();}},0);},accessKeyUp:function(){this.select();},setValue:function(v){v=v||'';return n.dialog.uiElement.prototype.setValue.call(this,v);},keyboardFocusable:true},r,true);n.dialog.textarea.prototype=new n.dialog.textInput();n.dialog.select.prototype=h.extend(new n.dialog.labeledElement(),{getInputElement:function(){return this._.select.getElement();},add:function(v,w,x){var y=new k('option',this.getDialog().getParentEditor().document),z=this.getInputElement().$;y.$.text=v;y.$.value=w===undefined||w===null?v:w;if(x===undefined||x===null){if(f)z.add(y.$);else z.add(y.$,null);}else z.add(y.$,x);return this;},remove:function(v){var w=this.getInputElement().$;w.remove(v);return this;},clear:function(){var v=this.getInputElement().$;while(v.length>0)v.remove(0);return this;},keyboardFocusable:true},r,true);n.dialog.checkbox.prototype=h.extend(new n.dialog.uiElement(),{getInputElement:function(){return this._.checkbox.getElement();},setValue:function(v){this.getInputElement().$.checked=v;this.fire('change',{value:v});},getValue:function(){return this.getInputElement().$.checked;},accessKeyUp:function(){this.setValue(!this.getValue());},eventProcessors:{onChange:function(v,w){if(!f)return s.onChange.apply(this,arguments);else{v.on('load',function(){var x=this._.checkbox.getElement();x.on('propertychange',function(y){y=y.data.$;if(y.propertyName=='checked')this.fire('change',{value:x.$.checked});},this);},this);this.on('change',w);}return null;}},keyboardFocusable:true},r,true);n.dialog.radio.prototype=h.extend(new n.dialog.uiElement(),{setValue:function(v){var w=this._.children,x;for(var y=0;y<w.length&&(x=w[y]);y++)x.getElement().$.checked=x.getValue()==v;this.fire('change',{value:v});},getValue:function(){var v=this._.children;for(var w=0;w<v.length;w++)if(v[w].getElement().$.checked)return v[w].getValue();return null;},accessKeyUp:function(){var v=this._.children,w;for(w=0;w<v.length;w++)if(v[w].getElement().$.checked){v[w].getElement().focus();return;}v[0].getElement().focus();},eventProcessors:{onChange:function(v,w){if(!f)return s.onChange.apply(this,arguments);else{v.on('load',function(){var x=this._.children,y=this;for(var z=0;z<x.length;z++){var A=x[z].getElement();A.on('propertychange',function(B){B=B.data.$;if(B.propertyName=='checked'&&this.$.checked)y.fire('change',{value:this.getAttribute('value')});});}},this);this.on('change',w);}return null;}},keyboardFocusable:true},r,true);n.dialog.file.prototype=h.extend(new n.dialog.labeledElement(),r,{getInputElement:function(){var v=d.document.getById(this._.frameId).getFrameDocument();return v.$.forms.length>0?new k(v.$.forms[0].elements[0]):this.getElement();},submit:function(){this.getInputElement().getParent().$.submit();return this;},getAction:function(v){return this.getInputElement().getParent().$.action;},reset:function(){var v=d.document.getById(this._.frameId),w=v.getFrameDocument(),x=this._.definition,y=this._.buttons;function z(){w.$.open();if(e.isCustomDomain())w.$.domain=document.domain;var A='';if(x.size)A=x.size-(f?7:0);w.$.write(['<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" action="',h.htmlEncode(x.action),'">','<input type="file" name="',h.htmlEncode(x.id||'cke_upload'),'" size="',h.htmlEncode(A>0?A:''),'" />','</form>','</body></html>'].join(''));w.$.close();for(var B=0;B<y.length;B++)y[B].enable();};if(e.gecko)setTimeout(z,500);else z();},getValue:function(){return'';},eventProcessors:s,keyboardFocusable:true},true);n.dialog.fileButton.prototype=new n.dialog.button();d.dialog.addUIElement('text',p);d.dialog.addUIElement('password',p);d.dialog.addUIElement('textarea',q);d.dialog.addUIElement('checkbox',q);d.dialog.addUIElement('radio',q);d.dialog.addUIElement('button',q);d.dialog.addUIElement('select',q);d.dialog.addUIElement('file',q);d.dialog.addUIElement('fileButton',q);d.dialog.addUIElement('html',q);})();d.themes.add('default',(function(){function o(p,q){var r,s;s=p.config.sharedSpaces;s=s&&s[q];s=s&&d.document.getById(s);if(s){var t='<span class="cke_shared"><span class="'+p.skinClass+' cke_editor_'+p.name+'">'+'<span class="'+e.cssClass+'">'+'<span class="cke_wrapper cke_'+p.lang.dir+'">'+'<span class="cke_editor">'+'<div class="cke_'+q+'">'+'</div></span></span></span></span></span>',u=s.append(k.createFromHtml(t,s.getDocument()));if(s.getCustomData('cke_hasshared'))u.hide();else s.setCustomData('cke_hasshared',1);r=u.getChild([0,0,0,0]);p.on('focus',function(){for(var v=0,w,x=s.getChildren();w=x.getItem(v);v++)if(w.type==1&&!w.equals(u)&&w.hasClass('cke_shared'))w.hide();u.show();});p.on('destroy',function(){u.remove();});}return r;};return{build:function(p,q){var r=p.name,s=p.element,t=p.elementMode;if(!s||t==0)return;if(t==1)s.hide();var u=p.fire('themeSpace',{space:'top',html:''}).html,v=p.fire('themeSpace',{space:'contents',html:''}).html,w=p.fireOnce('themeSpace',{space:'bottom',html:''}).html,x=v&&p.config.height,y=p.config.tabIndex||p.element.getAttribute('tabindex')||0;if(!v)x='auto';else if(!isNaN(x))x+='px';var z='',A=p.config.width;if(A){if(!isNaN(A))A+='px';z+='width: '+A+';';}var B=u&&o(p,'top'),C=o(p,'bottom');B&&(B.setHtml(u),u='');C&&(C.setHtml(w),w='');var D=k.createFromHtml(['<span id="cke_',r,'" onmousedown="return false;" class="',p.skinClass,' cke_editor_',r,'" dir="',p.lang.dir,'" title="',e.gecko?' ':'','" lang="',p.langCode,'" tabindex="'+y+'"'+(z?' style="'+z+'"':'')+'>'+'<span class="',e.cssClass,'"><span class="cke_wrapper cke_',p.lang.dir,'"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0"><tbody><tr',u?'':' style="display:none"','><td id="cke_top_',r,'" class="cke_top">',u,'</td></tr><tr',v?'':' style="display:none"','><td id="cke_contents_',r,'" class="cke_contents" style="height:',x,'">',v,'</td></tr><tr',w?'':' style="display:none"','><td id="cke_bottom_',r,'" class="cke_bottom">',w,'</td></tr></tbody></table><style>.',p.skinClass,'{visibility:hidden;}</style></span></span></span>'].join(''));D.getChild([0,0,0,0,0]).unselectable();D.getChild([0,0,0,0,2]).unselectable();if(t==1)D.insertAfter(s);else s.append(D);p.container=D;D.disableContextMenu();p.fireOnce('themeLoaded');p.fireOnce('uiReady');},buildDialog:function(p){var q=h.getNextNumber(),r=k.createFromHtml(['<div class="cke_editor_'+p.name.replace('.','\\.')+'_dialog cke_skin_',p.skinName,'" dir="',p.lang.dir,'" lang="',p.langCode,'"><table class="cke_dialog',' '+e.cssClass,' cke_',p.lang.dir,'" style="position:absolute"><tr><td><div class="%body"><div id="%title#" class="%title"></div><div id="%close_button#" class="%close_button"><span>X</span></div><div id="%tabs#" class="%tabs"></div><table class="%contents"><tr><td id="%contents#" class="%contents"></td></tr></table><div id="%footer#" class="%footer"></div></div><div id="%tl#" class="%tl"></div><div id="%tc#" class="%tc"></div><div id="%tr#" class="%tr"></div><div id="%ml#" class="%ml"></div><div id="%mr#" class="%mr"></div><div id="%bl#" class="%bl"></div><div id="%bc#" class="%bc"></div><div id="%br#" class="%br"></div></td></tr></table>',f?'':'<style>.cke_dialog{visibility:hidden;}</style>','</div>'].join('').replace(/#/g,'_'+q).replace(/%/g,'cke_dialog_')),s=r.getChild([0,0,0,0,0]),t=s.getChild(0),u=s.getChild(1);t.unselectable();u.unselectable();return{element:r,parts:{dialog:r.getChild(0),title:t,close:u,tabs:s.getChild(2),contents:s.getChild([3,0,0,0]),footer:s.getChild(4)}};},destroy:function(p){var q=p.container;if(f){q.setStyle('display','none');var r=document.body.createTextRange();r.moveToElementText(q.$);try{r.select();}catch(s){}}if(q)q.remove();if(p.elementMode==1){p.element.show();delete p.element;}}};})());d.editor.prototype.getThemeSpace=function(o){var p='cke_'+o,q=this._[p]||(this._[p]=d.document.getById(p+'_'+this.name));return q;};d.editor.prototype.resize=function(o,p,q,r){var s=/^\d+$/;if(s.test(o))o+='px';var t=this.container,u=d.document.getById('cke_contents_'+this.name),v=r?t.getChild(0):t;e.webkit&&v.setStyle('display','none');v.setStyle('width',o);if(e.webkit){v.$.offsetWidth;v.setStyle('display','');}var w=q?0:(v.$.offsetHeight||0)-(u.$.clientHeight||0);u.setStyle('height',Math.max(p-w,0)+'px');this.fire('resize');};d.editor.prototype.getResizable=function(){return this.container.getChild(0);};d.skins.add('vs',(function(){var o=[];if(f&&e.version<7)o.push('icons.png','images/sprites_ie6.png','images/dialog_sides.gif');var p='../../i2rd/skins/vs/';return{preload:o,editor:{css:[p+'editor.css']},dialog:{css:[p+'dialog.css']},templates:{css:[p+'templates.css']},margins:[0,0,0,0]};})());if(d.dialog)d.dialog.on('resize',function(o){var p=o.data,q=p.width,r=p.height,s=p.dialog,t=s.parts.contents,u=!e.quirks;if(p.skin!='vs')return;t.setStyles(f||e.gecko&&e.version<10900?{width:q+'px',height:r+'px'}:{'min-width':q+'px','min-height':r+'px'});if(!f)return;setTimeout(function(){var v=t.getParent(),w=v.getParent(),x=w.getChild(2);x.setStyle('width',v.$.offsetWidth+'px');x=w.getChild(7);x.setStyle('width',v.$.offsetWidth-28+'px');x=w.getChild(4);x.setStyle('height',v.$.offsetHeight-31-14+'px');x=w.getChild(5);x.setStyle('height',v.$.offsetHeight-31-14+'px');},100);});d.ajax=(function(){var o=function(){if(!f||location.protocol!='file:')try{return new XMLHttpRequest();}catch(t){}try{return new ActiveXObject('Msxml2.XMLHTTP');}catch(u){}try{return new ActiveXObject('Microsoft.XMLHTTP');}catch(v){}return null;},p=function(t){return t.readyState==4&&(t.status>=200&&t.status<300||t.status==304||t.status===0||t.status==1223);},q=function(t){if(p(t))return t.responseText;return null;},r=function(t){if(p(t)){var u=t.responseXML;return new d.xml(u&&u.firstChild?u:t.responseText);}return null;},s=function(t,u,v){var w=!!u,x=o();if(!x)return null;x.open('GET',t,w);if(w)x.onreadystatechange=function(){if(x.readyState==4){u(v(x));x=null;}};x.send(null);return w?'':v(x);};return{load:function(t,u){return s(t,u,q);},loadXml:function(t,u){return s(t,u,r);}};})();var a={};window.CKeditorHelper=a;a.overrideTablePropDefaults=function(){d.on('dialogDefinition',function(o){var p=o.data.definition,q=o.data.name;if(q=='table'){if(p.defaultsModified)return;p.defaultsModified=true;var r=p.getContents('info'),s=r.get('txtBorder');s['default']='';var t=r.get('txtCellSpace');t['default']='';var u=r.get('txtCellPad');u['default']='';}});};a.fixBrokenDimCalc=function(){if(!(f&&navigator.userAgent.match(/MSIE [678]/)))return;d.on('instanceReady',function(o){var p=document.getElementById('cke_'+o.editor.name),q=p?p.firstChild:p;if(p&&p!=q&&q.offsetHeight<p.offsetHeight){var r,s=p.getElementsByTagName('iframe');if(s&&s.length==1){s=s[0].style;s.display='none';s.display='block';s=p.getElementsByTagName('td');for(r=0;r<s.length;r++)if(s[r].className=='cke_contents'){s[r].style.height=p.offsetHeight+'px';break;}}}});};a.fckSetupRetryCount=0;a.integrationSetupCompleted=false;a.integrationSetup=function(){if(a.integrationSetupCompleted)return;if(d.status=='ready'||d.status=='loaded'){a.integrationSetupCompleted=true;a.overrideTablePropDefaults();a.fixBrokenDimCalc();if(Form&&Form.Element&&Form.Element.Serializers){var o=Form.Element.Serializers.textarea;Form.Element.Serializers.textarea=function(p){try{var q=d.instances[p.id];if(!q)q=d.instances[p.name];if(q)q.updateElement();}catch(r){log4js.logger.error('Unable to call update CKEditors',r);}return o(p);};}}else{a.fckSetupRetryCount++;if(a.fckSetupRetryCount<20)window.setTimeout(a.integrationSetup,500);else log4js.logger.warn('Gave up on integration setup for CKEditor.');}};a.integrationSetup();window.customConfigPath=resourcesPath+'FCKconfig/';a.fckactivate=function(o){if(typeof o.setup_fck!='undefined')return;o.setup_fck=true;var p={},q=k.get(o),r=q.getComputedStyle('height');if(!!r&&o.offsetHeight>200)p.height=r;var s=o.className.match(/fckeditor_config_(\w+)/);if(s){var t=s[1]+'.js';p.customConfig=customConfigPath+t;}d.replace(o,p);};window.CKeditorHelper.fckactivate=a.fckactivate;a.checkPermission=function(o){if(!o)return;var p=[],q=false,r=b(),s=r.length;if(s===0)return;for(var t=0,u=o.length;t<u;t++){var v=o[t];if(v==='/'&&!q){p[p.length]=v;q=true;continue;}var w=[];for(var x=0,y=v.length;x<y;x++){var z=v[x];if(c(z,r,s))w[w.length]=z;}if(w.length>0){p[p.length]=w;q=false;}o[t]=null;}if(p[0]==='/')p.shift();if(p[p.length-1]==='/')p.pop();o.length=0;o.push.apply(o,p);};function b(){var o,p=[],q=window.top.document.getElementsByTagName('dfn');for(var r=0,s=q.length;r<s;r++){o=q[r];if(!o)continue;if(!(o.className&&o.className.match(/richtexteditorpermissionhelper/)))continue;o=o.firstChild?o.firstChild.nodeValue.split(','):[];p.push.apply(p,o);}return p;};function c(o,p,q){for(var r=0;r<q;r++){if(p[r]===o)return false;}return true;};window.CKeditorHelper.checkPermission=a.checkPermission;a.addURLParam=function(o,p){var q=o.indexOf('?')==-1?'?':'&';return o+q+p;};window.CKeditorHelper.addURLParam=a.addURLParam;a.setupCKFileManager=function(o,p,q){if(p){o.filebrowserBrowseUrl=p;o.filebrowserImageBrowseUrl=a.addURLParam(p,'Type=Image');o.filebrowserFlashBrowseUrl=a.addURLParam(p,'Type=Flash');}if(q){}};window.CKeditorHelper.setupCKFileManager=a.setupCKFileManager;l.toolbar_Basic=[['Bold','Italic','Underline'],['NumberedList','BulletedList'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Outdent','Indent','Blockquote'],['Source']];l.toolbar_Media=[['Undo','Redo','Image','Flash','Link','Unlink','Source']];l.toolbar_Standard=[['Templates','Format','-','Bold','Italic','Underline','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight'],['Link','Unlink','-','Image','Flash','Table','SpecialChar','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Source']];l.toolbar_Web=[['Templates','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Find','Replace','-','SelectAll','RemoveFormat','-','Undo','Redo'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript','-','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Anchor','-','Image','Flash','Table','SpecialChar','HorizontalRule'],['Format','Font','FontSize','-','TextColor','BGColor','-','Maximize','ShowBlocks','-','Source']];l.toolbar_Complete=[['Templates','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Find','Replace','-','SelectAll','RemoveFormat','-','Undo','Redo'],['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript','-','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Anchor','-','Image','Flash','Table','Smiley','SpecialChar','HorizontalRule','PageBreak'],['Styles','Format','Font','FontSize','-','TextColor','BGColor','-','Maximize','ShowBlocks','-','Source']];(function(){function o(p){if(p.cmspages)return;p.cmspages=true;var q=p.getContents('info'),r=q.get('linkType');r.items=[['CMS Page','cms']].concat(r.items);r.setup=h.override(r.setup,function(s){return function(t){if(t.url){if((t.url.url||'').startsWith('cms'))t.type='cms';}else if(!(!!t.email||!!t.anchor))t.type='cms';if(s)s.call(this,t);};});r.onChange=h.override(r.onChange,function(s){return function(t){if(s)s.call(this,t);var u=this.getDialog(),v=['cmsOptions'],w=this.getValue();if(w=='cms')if(u.getParentEditor().config.linkShowTargetTab)u.showPage('target');for(var x=0;x<v.length;x++){var y=u.getContentElement('info',v[x]);if(!y)continue;y=y.getElement().getParent().getParent();if(v[x]==w+'Options')y.show();else y.hide();}};});q.add({id:'cmsOptions',label:'Page',type:'select',items:[],pagesLoaded:false,onLoad:function(s){var t=this;d.ajax.load(connectorURL+'?Command=GetPages',function(u){t.pagesLoaded=true;var v,w=eval(u),x=t.getValue();t.clear();for(v=0;v<w.length;v++)t.add(w[v][0],w[v][1]);if(x)t.setValue(x);delete w.p;});},setup:function(s){if(s.url){if(!this.pagesLoaded)this.add(s.url.url);this.setValue(s.url.url);if(s.type=='cms')s.url.url='';}},commit:function(s){s.cmsUrl=this.getValue();if(!s.url)s.url={};}});p.onOk=h.override(p.onOk,function(s){return function(t){var u={href:'javascript:void(0)/*'+h.getNextNumber()+'*/'},v=[],w={href:u.href},x=this,y=this.getParentEditor();this.commitContent(w);if(w.type!='cms'){if(s)s.call(this,t);return;}var z=w.cmsUrl||'';u._cke_saved_href=z;if(w.target)if(w.target.type=='popup'){var A=["window.open(this.href, '",w.target.name||'',"', '"],B=['resizable','status','location','toolbar','menubar','fullscreen','scrollbars','dependent'],C=B.length,D=function(N){if(w.target[N])B.push(N+'='+w.target[N]);};for(var E=0;E<C;E++)B[E]=B[E]+(w.target[B[E]]?'=yes':'=no');D('width');D('left');D('height');D('top');A.push(B.join(','),"'); return false;");u._cke_pa_onclick=A.join('');}else{if(w.target.type!='notSet'&&w.target.name)u.target=w.target.name;else v.push('target');v.push('_cke_pa_onclick','onclick');}if(w.adv){var F=function(N,O){var P=w.adv[N];if(P)u[O]=P;else v.push(O);};if(this._.selectedElement)F('advId','id');F('advLangDir','dir');F('advAccessKey','accessKey');F('advName','name');F('advLangCode','lang');F('advTabIndex','tabindex');F('advTitle','title');F('advContentType','type');F('advCSSClasses','class');F('advCharset','charset');F('advStyles','style');}if(!this._.selectedElement){var G=y.getSelection(),H=G.getRanges();if(H.length==1&&H[0].collapsed){var I=new g.text(u._cke_saved_href,y.document);H[0].insertNode(I);H[0].selectNodeContents(I);G.selectRanges(H);}var J=new d.style({element:'a',attributes:u});J.type=2;J.apply(y.document);if(w.adv&&w.adv.advId){var K=this.getParentEditor().document.$.getElementsByTagName('a');for(E=0;E<K.length;E++)if(K[E].href==u.href){K[E].id=w.adv.advId;break;}}}else{var L=this._.selectedElement;if(f&&u.name!=L.getAttribute('name')){var M=new k('<a name="'+h.htmlEncode(u.name)+'">',y.document);G=y.getSelection();L.moveChildren(M);L.copyAttributes(M,{name:1});M.replace(L);L=M;G.selectElement(L);}L.setAttributes(u);L.removeAttributes(v);if(L.getAttribute('name'))L.addClass('cke_anchor');else L.removeClass('cke_anchor');if(this.fakeObj)y.createFakeElement(L,'cke_anchor','anchor').replace(this.fakeObj);delete this._.selectedElement;}};});};l.cmsPageConnector=false;l.extraPlugins=l.extraPlugins+',cmspages';m.add('cmspages',{requires:['link','image'],init:function(p){if(!!p.config.cmsPageConnector)d.on('dialogDefinition',function(q){var r=q.data.definition,s=q.data.name;if(s=='link')o(r);else if(s=='image')r.removeContents('Link');});}});})();})();
/*  JS Resource: lib/miwt/miwt-lib.js  */

if(typeof miwt=='undefined'){var miwt=new Object();}
if(typeof miwtutil=='undefined'){var miwtutil={};if(!Node){var Node=new Object();Node.ELEMENT_NODE=1;Node.ATTRIBUTE_NODE=2;Node.TEXT_NODE=3;Node.CDATA_SECTION_NODE=4;Node.ENTITY_REFERENCE_NODE=5;Node.ENTITY_NODE=6;Node.PROCESSING_INSTRUCTION_NODE=7;Node.COMMENT_NODE=8;Node.DOCUMENT_NODE=9;Node.DOCUMENT_TYPE_NODE=10;Node.DOCUMENT_FRAGMENT_NODE=11;Node.NOTATION_NODE=12;}
miwt.parseUri=function(url){var p=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],u={},i=p.length,m=/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);while(i--)u[p[i]]=m[i]||"";return u;};miwt.getComputedStyle=function(element,style){if(document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(element,"").getPropertyValue(style);}
else if(element.currentStyle){return element.currentStyle[style];}
else{return"";}};miwt.closeCKEditors=function(element){if(typeof CKEDITOR=='undefined')return;var i,ta,list=element.getElementsByTagName('textarea');for(i=0;i<list.length;i++){ta=list[i];var editor=CKEDITOR.instances[ta.id];if(editor){try{}finally{if(editor)
editor.destroy();}}}};miwt.observe=function(element,name,observer,useCapture){element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
name='keydown';if(element.addEventListener){element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){element.attachEvent('on' +name,observer);}}
miwt.stopObserving=function(element,name,observer,useCapture){element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.detachEvent))
name='keydown';if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else if(element.detachEvent){try{element.detachEvent('on' +name,observer);}catch(e){}}}
miwt.viewResource=function(url,newWindow){var f=Element.select(document,"form.viewresource").pop();if(f){f.action=url;if(newWindow)
f.target="_new";else
f.target="_self";f.submit();}else{var nw;if(newWindow)
nw=window.open(url,'_new');else
nw=window.open(url);if(!nw){if(confirm($$("dfn.miwt_popup_blocked").pop().firstChild.data))
window.location.href=url;}}}
miwt.saveResource=function(url){var f=Element.select(document,"form.saveresource").pop();if(f){f.action=url;f.submit();}else{var nw=window.open(url +(miwt.parseUri(url).query?'&':'?') +"disposition=attachment");if(!nw){if(confirm($$("dfn.miwt_popup_blocked").pop().firstChild.data))
window.location.href=url;}}}}
if(typeof miwt.Form=='undefined'){miwt.prv_FormOnSubmitHandler=function(evt){var form=Event.element(evt);if(!form||!form.MIWTOnSubmit)
return true;return form.MIWTOnSubmit.apply(form);}
miwt.TransientFieldNames=["btnhit","dnd_source","dnd_target","dnd_location","dnd_option"];miwt.Form=Class.create();miwt.Form.prototype={initialize:function(){this.submitters=new Array();this.submitter_functions=new Array();this.onsubmit=miwt.prv_FormOnSubmitHandler;},MIWTOnSubmit:function()
{if(typeof(window.miwtReady)!='undefined'&&window.miwtReady==2)
return false;var submitter;for(var i=0;submitter=this.submitters[i];i++){var element=$(submitter);if(element){var f=this.submitter_functions[element.id];if(f&&!f(this))
{return false;}}}
window.miwtReady=2;return true;},MIWTSubmit:function(ajax_request_complete_callback)
{if(this.lastSubmit)
{var now=new Date().getTime();var then=this.lastSubmit.getTime();if((now -then)<250)
{this.ResetTransient();return false;}}
if(!this.MIWTOnSubmit())
return false;if(typeof(miwtajax)=='undefined'||$(this.elements['btnhit'].value+"_noajax"))
{miwtajax.showFormPostWait();this.submit();return true;}
if(ajax_request_complete_callback==null)
ajax_request_complete_callback=miwtajax.ajax_request_complete_callback;else if(typeof(ajax_request_complete_callback.push)=='undefined'){var a=new Array();a.push(ajax_request_complete_callback);ajax_request_complete_callback=miwtajax.ajax_request_complete_callback.concat(a);}
var ajax=new miwtajax.InputProcessor(this,ajax_request_complete_callback,miwtajax.ajax_failed_update_callback);this.lastSubmit=new Date();if(!ajax.isRequestSubmitted())
{miwtajax.showFormPostWait();this.submit();}
else
{}
return true;},RegisterOnSubmitHandler:function(element,handler)
{if(element==null)
return;this.submitter_functions[element.id]=handler;if(this.submitters.indexOf(element.id)== -1)
this.submitters.push(element.id);},CleanOnSubmitHandlers:function()
{var list=new Array();var elementid;for(var i=0;elementid=this.submitters[i];i++){var element=$(elementid);if(element)
list.push(elementid);else
this.submitter_functions[elementid]=null;};this.submitters=list;},ResetTransient:function(){for(var name,i=0;name=miwt.TransientFieldNames[i++];){if(this.elements[name])
this.elements[name].value='';}}}}
if(typeof miwtsetup=='undefined'){var miwtsetup={};miwt.setupHandlers=new Array();miwt.setupHandlers["any"]=new Array();miwt.setupHandlers["a"]=new Array();miwt.setupHandlers["button"]=new Array();miwt.setupHandlers["div"]=new Array();miwt.setupHandlers["img"]=new Array();miwt.setupHandlers["input"]=new Array();miwt.setupHandlers["select"]=new Array();miwt.setupHandlers["dfn"]=new Array();miwt.setupHandlers["table"]=new Array();miwt.setupHandlers["textarea"]=new Array();miwt.AddSetupHandler=function(tags,f)
{if(tags==null)
tags=["any"];var i,tag;for(i=0;tag=tags[i];i++){if(!miwt.setupHandlers[tag])
miwt.setupHandlers[tag]=new Array();miwt.setupHandlers[tag].push(f);}}
miwt.setup=function(node)
{var nodes=node.getElementsByTagName('*');var f,a,j,i=0;var any=miwt.setupHandlers["any"];while(node){if(node.className){var tag=node.tagName.toLowerCase();if(tag=='select'&&node.type&&node.type=='select-one'&&!/\bmiwt_focus\b/.exec(node.className))
{if(miwt.lastFocusId==null)
node.blur();}
for(j=0;f=any[j];j++){f(tag,node);}
a=miwt.setupHandlers[tag];if(a){for(j=0;f=a[j];j++){f(tag,node);}}}
node=nodes.item(i);i++;}}
miwt.scheduleUpdateKeydownHandler=function(event){miwttimer.scheduleUpdate(Event.element(event).form.id);}
miwt.observerFormSubmit=function(element){element.form.MIWTSubmit();}
miwt.AddSetupHandler(['input','select','textarea'],function(tag,node)
{if(node.form&&/\bmiwt_watch\b/.exec(node.className))
{if((tag=='input'&&node.type=='text')||tag=='textarea')
miwt.observe(node,'keydown',miwt.scheduleUpdateKeydownHandler);else
node.observer=new Form.Element.EventObserver(node,miwt.observerFormSubmit);}});miwt.AddSetupHandler(['button','input','select','textarea'],function(tag,node)
{if(node.focus&&/\bmiwt_focus\b/.exec(node.className))
window.setTimeout(function(){node.focus();},200);});miwt.setupForm=function(form)
{Object.extend(form,miwt.Form.prototype);try
{form.initialize();miwt.setup(form);form.RegisterOnSubmitHandler(form,validation.validateForm);}
catch(exception){log4js.logger.error("Configuring MIWT form "+(form.id||form.name),exception);}}
miwt.setViewportPosition=function()
{var wz,w,windows=$$("div.window");while((w=windows.pop())){if(!wz||(parseInt(wz.style.zIndex)<parseInt(w.style.zIndex))){wz=w;}}
if(!!wz){var pos=Element.cumulativeOffset(wz);window.scrollTo(pos[0],pos[1] -20);}};miwt.onLoad=function(event)
{var i,form;for(i=0;form=document.forms[i];i++){if(/\bmiwt_form\b/.exec(form.className)){miwt.setupForm(form);miwt.setViewportPosition();}else if(/\bmiwt_external_action\b/.exec(form.className)){var form2=form;setTimeout(function(){form2.submit();},10,'JavaScript');}}}
document.observe("dom:loaded",miwt.onLoad);}
if(typeof miwtbutton=='undefined'){miwtbutton={};miwt.ButtonClicked=function(event)
{Event.stop(event);var form=Event.findElement(event,'form');var element=Event.element(event);while(element&&element.parentNode&&!(element.name||element.id))
element=element.parentNode;if(element.disabled||element.hasAttribute("disabled"))
return;var buttonid=element.name||element.id;var confirmText=$(buttonid+'_confirm');if(confirmText&&!confirm(confirmText.firstChild.data))
return;form.elements['btnhit'].value=element.name||element.id;form.MIWTSubmit();}
miwt.resetEventHandler=function(event)
{Event.findElement(event,'form').reset();}
miwt.AddSetupHandler(null,function(tag,node)
{if(/\bmiwt_reset\b/.exec(node.className))
miwt.observe(node,"click",miwt.resetEventHandler);if(/\bmiwt_submit\b/.exec(node.className))
{if((tag=='input'&&(node.type=='text'||node.type=='password'))||tag=='textarea')
miwt.observe(node,"keydown",miwt.FieldAction);else
miwt.observe(node,"click",miwt.ButtonClicked);}});miwt.imagebutton=new Object();miwt.imagebutton.groups=new Array();miwt.imagebutton.imageButtonEnabled=function(button)
{var disabledValue=button.attributes.getNamedItem("disabled");return disabledValue==null||disabledValue.value!="true";}
miwt.imagebutton.imageButtonMouseOver=function(evt)
{var target=Event.element(evt);if(target==null)
return;Event.stop(evt);if(miwt.imagebutton.imageButtonEnabled(target))
{miwt.imagebutton.imageButtonSetState(target,null,null,"rollover");}}
miwt.imagebutton.imageButtonMouseOut=function(evt)
{var target=Event.element(evt);if(target==null)
return;Event.stop(evt);if(miwt.imagebutton.imageButtonEnabled(target))
{miwt.imagebutton.imageButtonSetState(target,null,null,"normal");}}
miwt.imagebutton.imageButtonMouseDown=function(evt)
{var target=Event.element(evt);if(target==null)
return;Event.stop(evt);if(miwt.imagebutton.imageButtonEnabled(target))
{if(target.focus)
target.focus();miwt.imagebutton.imageButtonSetState(target,null,null,"pressed");}}
miwt.imagebutton.imageButtonMouseUp=function(evt)
{var target=Event.element(evt);if(target==null)
return;Event.stop(evt);if(miwt.imagebutton.imageButtonEnabled(target))
{miwt.imagebutton.imageButtonSetState(target,null,null,"normal");}}
miwt.imagebutton.imageButtonMouseClick=function(evt)
{var target=Event.element(evt);if(target==null)
return;Event.stop(evt);if(miwt.imagebutton.imageButtonEnabled(target))
{var selected=target.miwt_isSelected;if(target.miwt_selectedvalue!=null)
{selected=(target.miwt_isSelected==false);}
if(target.miwt_buttonGroup==null||selected)
{miwt.imagebutton.imageButtonSetState(target,null,selected,"normal");}
if(target.miwt_watch)
Event.findElement(evt,'form').MIWTSubmit();}}
miwt.imagebutton.imageButtonSetState=function(img,isActive,isSelected,state)
{if(isActive==null)
isActive=img.miwt_isActive;if(isSelected==null)
isSelected=img.miwt_isSelected;if(img.miwt_isActive==isActive&&img.miwt_isSelected==isSelected&&img.miwt_state==state)
{return false;}
var newimgsrc;if(isActive)
{if(state=="normal")
{if(isSelected&&img.miwt_activeselected!=null)
{newimgsrc=img.miwt_activeselected;}
else
{newimgsrc=img.miwt_active;}}
else if(state=="rollover")
{newimgsrc=img.miwt_activerollover;}
else if(state=="pressed")
{newimgsrc=img.miwt_activepressed;}
else
{alert("Invalid button state "+state);}}
else
{if(state=="normal")
{if(isSelected&&img.miwt_inactiveselected!=null)
{newimgsrc=img.miwt_inactiveselected;}
else
{newimgsrc=img.miwt_inactive;}}
else if(state=="rollover")
{newimgsrc=img.miwt_inactiverollover;}
else if(state=="pressed")
{newimgsrc=img.miwt_inactivepressed;}
else
{alert("Invalid button state "+state);}}
img.miwt_isActive=isActive;img.miwt_state=state;if(img.miwt_isActive&&img.miwt_isSelected!=isSelected)
{var wasSelected=img.miwt_isSelected;img.miwt_isSelected=isSelected;if(isSelected)
{var group=null;if(img.miwt_buttonGroup&&(group=miwt.imagebutton.groups[img.miwt_buttonGroup]))
{group.each(function(buttonid){if(buttonid!=img.id){var button=$(buttonid);if(button)
miwt.imagebutton.imageButtonSetState(button,null,false,"normal");}});}
img.miwt_valuenode.value=img.miwt_selectedvalue;}
else
{img.miwt_valuenode.value="";}}
if(newimgsrc&&typeof(newimgsrc)!='undefined'&&newimgsrc!='undefined'&&newimgsrc!='null')
{img.src=newimgsrc.src;return true;}
else
{return false;}}
miwt.AddSetupHandler(['img'],function(tag,node)
{if(tag!='img'||!node.className.match(/miwt_image\S*_button/))
return;var id=node.id;var buttonGroupId=null;var match=/miwt_button_group_(\S+)/.exec(node.className);if(match)
buttonGroupId=match[1];var valueid=null;var selectedvalue=null;if(id.match(/_img$/))
{valueid=id.replace(/(_r\d+)*_img$/,"");var valuenode=$(id+"_value");if(valuenode)
selectedvalue=valuenode.firstChild.data;}
var img=$(id);if(img==null)
{log4js.logger.warn("There is an error with the generated page, cannot find image button with id '"+id+"'");return;}
img.miwt_active=$(id+"_unselected");img.miwt_activeselected=$(id+"_selected");img.miwt_activepressed=$(id+"_pressed");img.miwt_activerollover=$(id+"_rollover");img.miwt_inactive=$(id+"_unselected_inactive");img.miwt_inactiveselected=$(id+"_selected_inactive");img.miwt_inactivepressed=$(id+"_pressed_inactive");img.miwt_inactiverollover=$(id+"_rollover_inactive");img.miwt_valueid=valueid;img.miwt_valuenode=$(valueid);img.miwt_selectedvalue=selectedvalue;if(img.miwt_code==null)
img.miwt_code='null';img.miwt_isSelected=(img.miwt_valuenode!=null)&&(img.miwt_valuenode.value==selectedvalue);img.miwt_watch=node.className.match(/miwt_watch/);var isActive=(img.miwt_active&&img.src==img.miwt_active.src)||(img.miwt_activeselected&&img.src==img.miwt_activeselected.src);if(buttonGroupId!=null)
{img.miwt_buttonGroup=buttonGroupId;var group=miwt.imagebutton.groups[buttonGroupId];if(!group)
{group=new Array();miwt.imagebutton.groups[buttonGroupId]=group;}
else
{var bid=null;var newa=null;for(var i=0;bid=group[i];i++){var bobj=$(bid);if(!bobj){if(!newa){newa=new Array();for(var j=0;j<i;j++)
newa.push(group[j]);}}
else if(newa){newa.push(bobj);}}
if(newa){group=newa;miwt.imagebutton.groups[buttonGroupId]=group;}}
group.push(node.id);}
miwt.observe(img,"mouseover",miwt.imagebutton.imageButtonMouseOver,false);miwt.observe(img,"mouseout",miwt.imagebutton.imageButtonMouseOut,false);miwt.observe(img,"mousedown",miwt.imagebutton.imageButtonMouseDown,false);miwt.observe(img,"mouseup",miwt.imagebutton.imageButtonMouseUp,false);miwt.observe(img,"click",miwt.imagebutton.imageButtonMouseClick,false);miwt.imagebutton.imageButtonSetState(img,isActive,img.miwt_isSelected,"normal");});miwt.imagebutton.imageButtonActivate=function(id)
{var img=$(id);if(img==null)
{return;}
miwt.imagebutton.imageButtonSetState(img,true,null,img.miwt_state);}
miwt.imagebutton.imageButtonDeactivate=function(id)
{var img=$(id);if(img==null)
{return;}
miwt.imagebutton.imageButtonSetState(img,false,null,img.miwt_state);}}
if(typeof miwtfield=='undefined'){miwtfield={};miwt.FieldAction=function(event)
{var element=Event.element(event);var keycode=event.keyCode||event.which;if(keycode==10||keycode==13)
miwt.ButtonClicked(event);}
miwt.FieldKeyDownHandler=function(evt)
{miwttimer.rescheduleTimer();return true;}
miwt.FieldKeyUpHandler=function(evt)
{var field=Event.element(evt);if(field.maxlength&&field.maxlength>0&&field.value.length>=field.maxlength){field.value=field.value.substring(0,field.maxlength);}
return true;}
miwt.FieldFocusHandler=function(evt)
{var field=Event.element(evt);miwt.lastFocusId=field.id;if(field.hinttexton){field.value='';field.hinttexton=false;field.style.color=null;}
return true;}
miwt.FieldBlurHandler=function(evt)
{var field=(evt.tagName=='input')?evt:Event.element(evt);miwt.lastFocusId=null;if(field&&field.hinttext&&field.value==''){field.value=field.hinttext;field.hinttexton=true;field.style.color='gray';}
return true;}
miwt.prv_FieldSubmitHandler=function(form){var node=$(this+'');if(node.hinttexton){node.value='';node.hinttexton=false;node.style.color=null;}
window.setTimeout("miwt.FieldBlurHandler($('"+node.id+"'))",10,"JavaScript");return true;}
miwt.prv_FCKSubmitHandler=function(form){var node=$(this+'');try{var editor=CKEDITOR.instances[node.id];editor.updateElement();}catch(e){log4js.logger.error("Unable to update CKEditor textarea.",e);}
return true;}
miwt.AddSetupHandler(['a','input','textarea'],function(tag,node){if((tag=='input'&&node.type=='text')||tag=='textarea')
{miwt.observe(node,"keydown",miwt.FieldKeyDownHandler,true);miwt.observe(node,"focus",miwt.FieldFocusHandler,true);miwt.observe(node,"blur",miwt.FieldBlurHandler,true);var hint=$(node.id+"_hint");if(hint){var hinttext=hint.firstChild.data;node.hinttext=hinttext;if(node.value==''){node.value=hinttext;node.hinttexton=true;node.style.color='gray';}
node.form.RegisterOnSubmitHandler(node,miwt.prv_FieldSubmitHandler.bind(node.id));}
var maxlength=$(node.id+"_maxlength");if(maxlength){var i=parseInt(maxlength.firstChild.data);if(!isNaN(i)){node.maxlength=i;miwt.observe(node,"keyup",miwt.FieldKeyUpHandler,true);}}
if(/\bfckeditor\b/.exec(node.className))
{CKeditorHelper.fckactivate(node);node.form.RegisterOnSubmitHandler(node,miwt.prv_FCKSubmitHandler.bind(node.id));}}});}
if(typeof miwtsearchablecombo=='undefined'){var miwtsearchablecombo={};miwt.SearchableComboButtonClick=function(event){Event.stop(event);Event.element(event).combo.doSearch();}
miwt.SetupSearchableCombo=function(tag,element)
{if(tag!='select'||!/\bmiwt_searchable\b/.exec(element.className))
return;try
{var field=$(element.id+"_field");field.combo=element;Object.extend(element,miwt.SearchBox.prototype);element.initialize(field);miwt.observe(field,'keydown',miwt.SearchableComboKeydownHandler);var button=$(element.id+"_search");if(button&&!/\bmiwt_submit\b/.exec(button.className))
{button.combo=element;miwt.observe(button,'click',miwt.SearchableComboButtonClick);if(field.value&&element.mode==element.MODE_FILTER)
element.doSearch();}}
catch(exception){log4js.logger.error("Setup searchable combo "+element.id,exception);}}
miwt.AddSetupHandler(['select'],miwt.SetupSearchableCombo);miwt.SearchableComboKeydownHandler=function(event){if(event.keyCode==13){Event.stop(event);Event.element(event).combo.doSearch();}}
miwt.SearchBox=function()
{}
miwt.SearchBox.prototype={MODE_ITERATE:0,MODE_FILTER:1,initialize:function(field)
{this.field=field;this.selectOptions=new Array();var opt;for(var i=0;opt=this.options[i];i++)
this.selectOptions[i]=opt;this.mode=this.MODE_ITERATE;var me=this;$w(this.className).each(function(className){if(/.*_flags_(\w+)/.exec(className))
{me.flags=RegExp.$1.toLowerCase();}
else if(/.*_mode_filter/.test(className))
{me.mode=me.MODE_FILTER;}});},addAvailableOption:function(val,txt)
{var opt=new Option();opt.value=val;opt.text=txt;this.selectOptions.push(opt);},getAvailableOptions:function()
{return this.selectOptions;},setVisibleOptions:function(visibleOptions)
{this.options.length=0;var opt;for(var i=0;opt=visibleOptions[i];i++)
this.options[i]=opt;},setSelectedIndex:function(index)
{if(index>=0&&index<this.options.length)
this.options[index].selected=true;},doSearch:function()
{if(this.mode==this.MODE_ITERATE)
this.searchSelectIterative(false);else
this.searchSelectFilter(false);},searchSelectFilter:function(onlyIfNoMatch)
{var searchString=this.field.value;var searchTextLength=searchString.length;var allOptions=this.getAvailableOptions();var selectedIndex=0;var matches=new Array();var matcher=new RegExp(searchString,this.flags);for(j=0;j<allOptions.length;j++)
{var optionText=allOptions[j].text;if(searchTextLength==0||matcher.test(optionText))
{matches[matches.length]=allOptions[j];if(allOptions[j].selected)
{selectedIndex=matches.length-1;}}}
this.setVisibleOptions(matches);this.setSelectedIndex(selectedIndex);},searchSelectIterative:function(onlyIfNoMatch)
{var searchString=this.field.value;var searchTextLength=searchString.length;if(searchTextLength==0)
return;var start=this.selectedIndex +1;if(start>=this.options.length)
start=0;var end=this.selectedIndex -1;if(end<=0)
end=this.options.length;var matcher=new RegExp(searchString,this.flags);if(onlyIfNoMatch&&matcher.test(this.options[this.selectedIndex].text))
{return;}
var forEnd=(start<end?end:this.options.length);for(j=start;j<forEnd;j++)
{var optionText=this.options[j].text;if(matcher.test(optionText))
{this.selectedIndex=j;return;}}
if(start>end)
{for(j=0;j<=end;j++)
{var optionText=this.options[j].text;if(matcher.test(optionText))
{this.selectedIndex=j;return;}}}}}}
if(typeof miwt.menu=='undefined'){(function(){var PAT_MENU=new RegExp("(^|\\s)menu(\\s|$)");var PAT_MENU_ITEM=new RegExp("(^|\\s)menu_item(\\s|$)");var PAT_MENU_COMPONENT=new RegExp("(^|\\s)menu_component(\\s|$)");miwt.menu={};miwt.menu.ActiveMenuList=[];miwt.menu.ActivateMenu=function(evt){var menu=Event.element(evt).up("div.menu_component");if(!menu||Element.hasClassName(menu,'active'))return null;Element.addClassName(menu,"active");while(miwt.menu.ActiveMenuList.last()!=null)
miwt.menu.DeactivateLastActiveMenu();Element.siblings(menu).each(function(el){if(Element.up(el,"div.menu_bar")&&PAT_MENU_COMPONENT.test(el.className))
miwt.observe(el,"mouseover",miwt.menu.ShowMenu);});miwt.menu.ActiveMenuList.push(menu);return menu;};miwt.menu.DeactivateLastActiveMenu=function(){var menu=miwt.menu.ActiveMenuList.pop();if(!menu)return;Element.removeClassName(menu,"active");if(Element.up(menu,"div.menu_bar")){miwt.stopObserving(menu,"mouseover",miwt.menu.ShowMenu);Element.siblings(menu).each(function(el){miwt.stopObserving(el,"mouseover",miwt.menu.ShowMenu);});}};miwt.menu.MenuItemHit=function(evt){Event.stop(evt);var target=Event.findElement(evt,'li').down('.menu_item');if(target&&!(target.next('.menu_items'))){while(miwt.menu.ActiveMenuList.last())miwt.menu.HideMenu(evt);var form=Event.findElement(evt,'form');form.elements['btnhit'].value=target.id;form.MIWTSubmit();}};miwt.menu.HideMenu=function(evt){if(evt.keyCode&&evt.keyCode!=Event.KEY_ESC)return;if(Event.isRightClick(evt))return;Event.stop(evt);miwt.menu.DeactivateLastActiveMenu();if(miwt.menu.ActiveMenuList.last()==null){miwt.stopObserving(document,"click",miwt.menu.HideMenu);miwt.stopObserving(document,"keydown",miwt.menu.HideMenu);}};miwt.menu.ShowMenu=function(evt){var target=Event.findElement(evt,'a')
if(miwt.menu.ActivateMenu(evt)){Event.stop(evt);window.setTimeout(function(){miwt.observe(document,"click",miwt.menu.HideMenu);miwt.observe(document,"keydown",miwt.menu.HideMenu);},5);}};miwt.AddSetupHandler(['a'],function(tag,node){if(PAT_MENU_ITEM.test(node.className)&&PAT_MENU_COMPONENT.test(node.parentNode.className))
miwt.observe(node,"click",miwt.menu.ShowMenu);});miwt.AddSetupHandler(['li'],function(tag,node){if(PAT_MENU.test(node.className)){miwt.observe(node,'click',miwt.menu.MenuItemHit);if(navigator.userAgent.match(/MSIE 6/)){miwt.observe(node,"mouseenter",function(evt){Event.element(evt).addClassName('active');});miwt.observe(node,"mouseleave",function(evt){Event.element(evt).removeClassName('active');});}}});})();}
if(typeof miwtselectall=='undefined'){var miwtselectall={};miwt.setupSelectAllCheckbox=function(checkbox)
{var selectall=$(checkbox.name+"_all");if(!selectall)
return;if(!selectall.checkboxes)
{selectall.checkboxes=new Array();miwt.observe(selectall,"click",miwt.selectAllChanged,false);}
checkbox.selectall=selectall;selectall.checkboxes.push(checkbox);miwt.observe(checkbox,"click",miwt.selectAllChildChanged,false);}
miwt.selectAllChanged=function(event)
{var selectall=Event.element(event);var box;for(var i=0;box=selectall.checkboxes[i];i++){box.checked=selectall.checked;};}
miwt.selectAllChildChanged=function(event)
{var box=Event.element(event);if(!box.checked)
box.selectall.checked=false;}
miwt.AddSetupHandler(['input'],function(tag,node)
{if(tag=='input'&&node.type=='checkbox'&&/\bmiwt_row_select\b/.exec(node.className))
miwt.setupSelectAllCheckbox(node);});}
if(typeof miwtajax=='undefined'){var miwtajax={};miwtajax.READY_STATE_UNINITIALIZED=0;miwtajax.READY_STATE_LOADING=1;miwtajax.READY_STATE_LOADED=2;miwtajax.READY_STATE_INTERACTIVE=3;miwtajax.READY_STATE_COMPLETE=4;miwtajax.serial=1;miwtajax.ajax_failed_update_callback=[];miwtajax.ajax_request_complete_callback=[];miwtajax.getDocType=function()
{var d=document;var ct=d.contentType;if(!ct){var dt=d.doctype||'';if(dt.systemId||dt.publicId)dt=dt.systemId +dt.publicId;else dt=(d.documentElement||d.body).namespaceURI||'';ct=dt.match(/xhtml/i)?"application/xhtml+xml":"text/html";}
return ct;};miwtajax.Progress=function()
{this.dialog=document.createElement("div");this.dialog.innerHTML='<div class="miwt_ajax_progress" style="position: absolute; top: 100px; left: 100px;">'
+$$("dfn.miwt_loading_message").pop().firstChild.data
+"<div id=\"miwt_loading_message_503\" style=\"display: none;\">" +$$("dfn.miwt_loading_message503").pop().firstChild.data +"</div>"
+'<br /><br />'
+'<span class="miwt_ajax_progress">'
+'<span id="miwt_ajax_progress_0">&#x00a0;&#x00a0;&#x00a0;&#x00a0;&#x00a0;</span>'
+'<span id="miwt_ajax_progress_1">&#x00a0;&#x00a0;&#x00a0;&#x00a0;&#x00a0;</span>'
+'<span id="miwt_ajax_progress_2">&#x00a0;&#x00a0;&#x00a0;&#x00a0;&#x00a0;</span>'
+'<span id="miwt_ajax_progress_3">&#x00a0;&#x00a0;&#x00a0;&#x00a0;&#x00a0;</span>'
+'<span id="miwt_ajax_progress_4">&#x00a0;&#x00a0;&#x00a0;&#x00a0;&#x00a0;</span>'
+'</span>'
+'</div>';this.dialog.firstChild.style.visibility='hidden';document.getElementsByTagName("body").item(0).appendChild(this.dialog);this.useCount=0;}
miwtajax.Progress.prototype={start:function()
{this.useCount++;if(this.useCount>1)
return;var progress=this;this.timeout_callback=function(){progress.callback.call(progress);}
for(var i=miwtajax.READY_STATE_UNINITIALIZED;i<=miwtajax.READY_STATE_COMPLETE;i++)
{var progressNode=$("miwt_ajax_progress_"+i);if(progressNode!=null)
progressNode.style.backgroundColor='white';}
if(this.indeterminate)
this.mark=miwtajax.READY_STATE_UNINITIALIZED;this.timeout=setTimeout(this.timeout_callback,500,"JavaScript");},callback:function()
{if(document.all)
this.dialog.firstChild.style.position='absolute';this.dialog.firstChild.style.visibility='visible';var w=miwt.getWindowWidth();var h=miwt.getWindowHeight();var scrollTop=0;var scrollLeft=0;if(document.documentElement)
scrollTop=document.documentElement.scrollTop;else if(document.body)
scrollTop=document.body.scrollTop;if(document.documentElement)
scrollLeft=document.documentElement.scrollLeft;else if(document.body)
scrollLeft=document.body.scrollLeft;this.dialog.firstChild.style.top=(scrollTop+((parseInt(h)/2)-17))+"px";this.dialog.firstChild.style.left=(scrollLeft+((parseInt(w)/2)-100))+"px";if(this.indeterminate){this.mark++;if(this.mark>miwtajax.READY_STATE_COMPLETE)
this.mark=miwtajax.READY_STATE_UNINITIALIZED;for(var i=miwtajax.READY_STATE_UNINITIALIZED;i<=miwtajax.READY_STATE_COMPLETE;i++)
{var progressNode=$("miwt_ajax_progress_"+i);if(progressNode!=null){if(this.mark==i)
progressNode.style.backgroundColor='lightsteelblue';else
progressNode.style.backgroundColor='white';}}}
this.timeout=setTimeout(this.timeout_callback,300,"JavaScript");},stop:function()
{if(this.useCount<=0)
return;this.useCount--;if(this.useCount>0)
return;if(this.timeout!=null)
{window.clearTimeout(this.timeout);this.timeout=null;this.timeout_callback=null;}
this.dialog.firstChild.style.visibility='hidden';}}
miwtajax.showFormPostWait=function(){if(miwt.ajaxprogress==null)
miwt.ajaxprogress=new miwtajax.Progress();miwt.ajaxprogress.indeterminate=true;miwt.ajaxprogress.start();}
miwtajax.InputProcessor=function(form,ajax_request_complete_callback,ajax_failed_update_callback)
{this.req=null;if(form.encoding&&form.encoding.match(/multipart/))
{var element;for(var i=0;element=form.elements[i];i++){if(element.type=='file'&&element.value!=null&&element.value.length>0)
return;}}
this.form=form;this.ajax_request_complete_callback=ajax_request_complete_callback;this.ajax_failed_update_callback=ajax_failed_update_callback;this.failsafe=false;if(miwt.ajaxprogress==null)
miwt.ajaxprogress=new miwtajax.Progress();this.initXMLHttpRequest();if(this.req==null)
{return;}
miwtajax.serial++;var params=Form.serialize(this.form) +"&ajax="+miwtajax.serial;this.form.ResetTransient();var dotimeout=deploymentcontext?deploymentcontext.doAjaxTimeout:true;if(dotimeout&&!miwtajax.debug)
{var ajax=this;this.timeout_callback=function(){ajax.doFailsafe.call(ajax);}
this.timeout=setTimeout(this.timeout_callback,15000,"JavaScript");}
miwt.ajaxprogress.start();this.req.send(params);}
miwtajax.InputProcessor.prototype={initXMLHttpRequest:function()
{var uriEl=Element.select(this.form,"dfn.ajax_uri").pop();if(!uriEl||!uriEl.firstChild)
return;this.uri=uriEl.firstChild.data;if(window.XMLHttpRequest)
{this.req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{this.req=new ActiveXObject("Microsoft.XMLHTTP");}
if(this.req)
{var processor=this;this.req.onreadystatechange=function(){processor.handleReadyStateForComponentUpdate.call(processor);}
this.req.open("POST",this.uri,true);this.req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.req.setRequestHeader("X-MIWT-Ajax","true");this.req.setRequestHeader("X-DocumentContentType",miwtajax.getDocType());}},decomposeParts:function(node)
{var content="";var partNodesFound=false;var partnode;for(var j=0;partnode=node.childNodes[j];j++)
{if(partnode.nodeName=='part')
{for(var i=0;i<partnode.childNodes.length;i++)
{content +=partnode.childNodes.item(i).nodeValue;}
partNodesFound=true;}}
if(!partNodesFound)
{content=node.firstChild.nodeValue;}
return content;},handleReadyStateForComponentUpdate:function()
{for(var i=miwtajax.READY_STATE_UNINITIALIZED;i<=this.req.readyState;i++)
{var progressNode=$("miwt_ajax_progress_"+i);if(progressNode!=null&&progressNode.style.backgroundColor!='lightsteelblue')
progressNode.style.backgroundColor='lightsteelblue';}
if(this.failsafe)
return;if(this.req.readyState==miwtajax.READY_STATE_COMPLETE)
{delete this.req.onreadystatechange;this.req.onreadystatechange=Prototype.emptyFunction;if(this.timeout){window.clearTimeout(this.timeout);this.timeout=null;}
var failsafe=false;var failsafeSkipParam=false;processXML:if(this.req.status==503)
{miwt.ajaxprogress.indeterminate=true;miwt.ajaxprogress.mark=miwtajax.READY_STATE_UNINITIALIZED;var retryTime=this.req.getResponseHeader("Retry-After");if(retryTime!=null){var mesgElement=$("miwt_loading_message_503");mesgElement.style.display="block";mesgElement.innerHTML=mesgElement.innerHTML.replace("$(seconds)",retryTime);var form=this.form;var retryFunc=function(){mesgElement.style.display="none";form.submit();};var retryTimeMillis=parseInt(retryTime)*1000;window.setTimeout(retryFunc,retryTimeMillis);}
else{this.form.submit();}
return;}
else if(this.req.status==301||this.req.status==302)
{miwt.ajaxprogress.stop();this.req=null;window.location.href=this.req.getResponseHeader("Location");return;}
else if(this.req.status!=200)
{log4js.logger.debug("Unsuccessful HTTP response: "+this.req.status);failsafe=true;}
else if(/html/.test(this.req.getResponseHeader("Content-Type")))
{log4js.logger.debug("Received HTML response: "+this.req.responseText);failsafe=true;}
else
{var actionNodes=this.req.responseXML.getElementsByTagName("action");var action="reload";if(actionNodes.length>0)
{action=actionNodes.item(0).firstChild.nodeValue;}
else
{log4js.logger.error("No action specified");}
var firstChild=this.req.responseXML.firstChild;if(firstChild==null||firstChild.nodeName.toLowerCase()=="html")
{if(miwtajax.debug)
{if(firstChild!=null)
{var stack=new Array();stack.push(firstChild);while(stack.length>0)
{var node=stack.pop();if(node.nodeType==3)
{log4js.logger.error("Parse error: "+node.nodeValue);}
else
{for(var i=0;i<node.childNodes.length;i++)
{stack.push(node.childNodes.item(i));}}}}
break processXML;}
log4js.logger.error("Parse error. firstChild is "
+(firstChild==null?"null":(firstChild.nodeName +" -> " +firstChild.innerHTML)));failsafe=true;}
else if(action=='reload')
{failsafe=true;failsafeSkipParam=true;}
else if(action=='nochange')
{break processXML;}
else if(action=='update')
{var lastFocusId=miwt.lastFocusId;var updatedNodes=new Array();var closeNodes=this.req.responseXML.getElementsByTagName("closewindow");for(var i=0;i<closeNodes.length;i++){var refid=closeNodes.item(i).attributes.getNamedItem("ref").nodeValue;var n=$(refid);if(n){miwt.closeWindow(n);}}
var contentNodes=this.req.responseXML.getElementsByTagName("component");try
{for(var i=0;i<contentNodes.length;i++)
{var updatenode=contentNodes.item(i);var refid=updatenode.attributes.getNamedItem("ref").nodeValue;var docnode=$(refid);if(docnode==null){log4js.logger.info("Node not found: "+refid+", likely caused by update to component that was not rendered here");failsafe=true;break;}
miwt.closeCKEditors(docnode);var newContent=this.decomposeParts(updatenode);var tmpnode=document.createElement("div");try{if(document.all&&docnode.tagName!=null&&docnode.tagName.toUpperCase()=='TD'&&!newContent.match(/^</))
tmpnode.innerHTML="<span>"+newContent+"</span>";else
tmpnode.innerHTML=newContent;}
catch(exception)
{log4js.logger.error("Exception creating DOM node from "+newContent,exception);failsafe=true;break;}
tmpnode=Element.cleanWhitespace(tmpnode);var newnode=tmpnode.firstChild;if(tmpnode.childNodes.length==1&&newnode.nodeName==docnode.nodeName&&newnode.getAttribute("id")==docnode.getAttribute("id"))
{try{__i2rd_fixIELeak(docnode,false);}catch(e){log4js.logger.error("(1)Unable to cleanup JScript references for " +refid,e);}
docnode.parentNode.replaceChild(newnode,docnode);updatedNodes.push(newnode);}
else
{try{__i2rd_fixIELeak(docnode,true);}catch(e){log4js.logger.error("(1)Unable to cleanup JScript references for " +refid,e);}
while(docnode.firstChild!=null)
docnode.removeChild(docnode.firstChild);while(tmpnode.firstChild!=null)
{var node=tmpnode.firstChild;tmpnode.removeChild(node);docnode.appendChild(node);}
updatedNodes.push(docnode);}}}
catch(exception)
{log4js.logger.error("Exception updating DOM",exception);failsafe=true;}
var windowNodes=this.req.responseXML.getElementsByTagName("newwindow");for(var i=0;i<windowNodes.length;i++){var tmpnode=document.createElement("div");tmpnode.innerHTML=this.decomposeParts(windowNodes.item(i));var newnode=tmpnode.firstChild;var windowcon=$$("form#"+this.form.id+" > div.miwt").pop();if(windowcon){var refid=windowNodes.item(i).attributes.getNamedItem("ref").nodeValue;var existing=$(refid);if(existing){try{__i2rd_fixIELeak(existing,false);}catch(e){log4js.logger.error("(1)Unable to cleanup JScript references for " +refid,e);}
existing.parentNode.replaceChild(newnode,existing);}
else{windowcon.appendChild(newnode);}
updatedNodes.push(newnode);try{__i2rd_domupdate_fire(newnode);}catch(e){}}
else{failsafe=true;}}
try
{miwt.ajaxprogress.stop();var oldloc=window.location.href;var locref=false;var initNodes=this.req.responseXML.getElementsByTagName("jsinit");for(var i=0;i<initNodes.length;i++)
{var node=initNodes.item(i);var script=this.decomposeParts(node);locref=locref||script.match(/window\.location\.href/);if(window.execScript)
window.execScript(script,'JavaScript');else
window.eval(script);}
if(locref||oldloc!=window.location.href)
{return;}
if(failsafe)
break processXML;if(window.windowlist)
repairWindowsAfterUpdate();var focusChanged=false;if(lastFocusId!=null){var node=$(lastFocusId);if(node!=null&&node.focus){try{node.focus();focusChanged=true;}catch(e){log4js.logger.info("Unable to reset focus for ID = "+lastFocusId,e);}}}
updatedNodes.each(function(n){try{__i2rd_domupdate_fire(n);}catch(e){}
miwt.setup(n);miwt.autoSizeWindow($(n).up("div.window"));});if(Prototype.Browser.IE){var fcklist=Element.select(this.form,'textarea.fckeditor');if(!focusChanged&&fcklist.length>0){var el,nodes=Element.select(this.form,'input[type="text"]');while((el=nodes.shift())){if(el.type!='hidden'&&el.focus){var f=function(){for(var i=0;i<fcklist.length;i++){var fck=fcklist[i];var iframes=Element.select(fck.parentNode,'iframe');if(iframes.length==0){window.setTimeout(f,100);return;}
var iframe;while(iframe=iframes.shift()){miwt.observe(iframe,"load",function(){el.focus();});el.focus();}}};window.setTimeout(f,100);break;}}}}
if(updatedNodes.length>0)
{var docHeight,scrollTop,clientHeight,scrollBottom,de=document.documentElement,db=document.body;if(de)
{scrollTop=de.scrollTop;clientHeight=de.clientHeight;docHeight=de.scrollHeight;scrollBottom=scrollTop+clientHeight;}
else
{scrollTop=db.scrollTop;clientHeight=db.clientHeight;docHeight=db.scrollHeight;scrollBottom=scrollTop+clientHeight;}
if(docHeight>clientHeight)
{var scrollNode;var miny= -1;var node;for(var i=0;node=updatedNodes[i];i++)
{if(!node.id.match(/c_.*/)||!miwt.isInActiveWindow(node))
continue;var y=Element.cumulativeOffset(node)[1];if(miny== -1||y<miny)
{miny=y;scrollNode=node;}}
if(miny!= -1&&(miny<scrollTop||miny>scrollBottom))
{if(miny>scrollBottom)
{var targetHeight=scrollNode.offsetHeight;if(targetHeight<clientHeight)
{miny=miny -(clientHeight -targetHeight);}}
window.scrollTo(0,miny);}}}
updatedNodes=null;}
catch(exception)
{log4js.logger.error("Exception processing updates",exception);failsafe=true;break processXML;}
this.form.CleanOnSubmitHandlers();}
else if(action=="error")
{log4js.logger.error("Error occurred during rendering");var errormessage="";var errormessageNodes=this.req.responseXML.getElementsByTagName("errormessage");for(var i=0;i<errormessageNodes.length;i++)
{if(i>0)errormessage=errormessage +"\n";errormessage=errormessage +errormessageNodes.item(i).firstChild.nodeValue;}
var errordetail="";var errordetailNodes=this.req.responseXML.getElementsByTagName("errordetail");for(var i=0;i<errordetailNodes.length;i++)
{if(i>0)errordetail=errordetail +"\n";errordetail=errordetail +errordetailNodes.item(i).firstChild.nodeValue;}
var node=document.createElement("div");node.innerHTML='<div style="border: solid red 10px; background-color: white; position: fixed; z-index: 9000; top: 10px; left: 10px; padding: 10px; max-width: 800px; max-height: 600px; overflow: scroll;"><div>'+errormessage+'</div><textarea cols="60" rows="10" wrap="off">'+errordetail+'</textarea></div>';document.getElementsByTagName("body").item(0).appendChild(node);}
else
{log4js.logger.error("Unknown action: "+action);failsafe=true;}}
this.req=null;miwt.ajaxprogress.stop();window.miwtReady=1;if(failsafe)
{this.doFailsafe(failsafeSkipParam);}
else
{this.form.ResetTransient();}
if(this.ajax_request_complete_callback!=null)
{window.setTimeout(this.doRequestCompleteCallback.bind(this),10);}}},doRequestCompleteCallback:function(){var callback_event=new Object();callback_event.source=this.form;var f;for(var i=0;f=this.ajax_request_complete_callback[i];i++)
f.call(this.form,callback_event);},doFailsafe:function(skipParam)
{if(this.ajax_failed_update_callback!=null)
{var callback_event=new Object();callback_event.source=this.form;var f;for(var i=0;f=this.ajax_failed_update_callback[i];i++){if(!f.call(this.form,callback_event))
return;}}
this.failsafe=true;if(!!skipParam)
window.location.href=this.form.action;else
window.location.href=this.form.action +(this.form.action.include('?')?'&':'?') +"failsafe=true";},isRequestSubmitted:function()
{return this.req!=null;}}
miwtajax.addMIWTAJAXUpdateFailureCallback=function(f)
{miwtajax.ajax_failed_update_callback.push(f);}
miwtajax.removeMIWTAJAXUpdateFailureCallback=function(f)
{miwtajax.ajax_failed_update_callback=miwtajax.ajax_failed_update_callback.without(f);}
miwtajax.addMIWTAJAXRequestCompleteCallback=function(f)
{miwtajax.ajax_request_complete_callback.push(f);}
miwtajax.removeMIWTAJAXRequestCompleteCallback=function(f)
{miwtajax.ajax_request_complete_callback=miwtajax.ajax_request_complete_callback.without(f);}}
if(typeof miwtcardcontainer=='undefined'){miwtcardcontainer={};miwt.CardContainerSelect=function(containerId,cardId)
{var container=$(containerId);var i;for(i=0;i<container.childNodes.length;i++)
{var node=container.childNodes.item(i);if(node.nodeType==1&&node.nodeName.toLowerCase()=="div")
{if(node.id==cardId)
node.style.display="block";else
node.style.display="none";}}}
miwt.CardContainerSelectEvent=function(event)
{var element=Event.element(event);miwt.CardContainerSelect(element.cardid,element.cardname);}
miwt.CardContainerSelectSetup=function(element,containerId,cardId)
{element.cardid=containerId;element.cardname=cardId;if(element.type)
{switch(element.type.toLowerCase())
{case'checkbox':case'radio':miwt.observe(element,'click',miwt.CardContainerSelectEvent);break;case'password':case'text':case'textarea':case'select-one':case'select-multiple':miwt.observe(element,'change',miwt.CardContainerSelectEvent);break;}}
else
{Event.observe(element,'click',miwt.CardContainerSelectEvent);}}
miwt.AddSetupHandler(null,function(tag,node)
{var match=/miwt_card_(\S+)___(\S+)/.exec(node.className);if(match)
miwt.CardContainerSelectSetup(node,match[1],match[2]);});}
if(typeof miwt.windowTopZIndex=='undefined'){miwt.windowMoveTarget=null;miwt.windowTopZIndex=1;miwt.windowlist=new Array();miwt.getWindowWidth=function()
{if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientWidth>0)
{return document.documentElement.clientWidth;}
else if(document.body&&document.body.clientWidth&&document.body.clientWidth>0)
{return document.body.clientWidth;}
else if(window.innerWidth)
{return window.innerWidth;}
else
{return null;}}
miwt.getWindowHeight=function()
{if(window.innerHeight&&window.innerHeight>0)
{return window.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight&&document.documentElement.clientHeight>0)
{return document.documentElement.clientHeight;}
else if(document.body&&document.body.clientHeight&&document.body.clientHeight>0)
{return document.body.clientHeight;}
else
{return null;}}
miwt.fixWindowList=function()
{var newlist=new Array();for(var i=0;i<miwt.windowlist.length;i++)
{var w=$(miwt.windowlist[i]);if(w!=null)
newlist.push(w.id);}
miwt.windowlist=newlist;}
miwt.moveWindowRelative=function(object,xdelta,ydelta)
{var newX1=parseInt(object.style.left)+xdelta;var newY1=parseInt(object.style.top)+ydelta;object.style.left=newX1+"px";object.style.top=newY1+"px";}
miwt.saveWindowPosition=function(winName,topFormName,leftFormName,widthFormName,heightFormName,zorderFormName)
{var win=$(winName);if(win==null)
return;var zorder=$(zorderFormName);if(zorder!=null)
zorder.value=win.style.zIndex;var top=$(topFormName);if(top!=null)
top.value=win.style.top;var left=$(leftFormName);if(left!=null)
left.value=win.style.left;var width=$(widthFormName);if(width!=null)
width.value=win.style.width;var height=$(heightFormName);if(height!=null)
height.value=win.style.height;}
miwt.getWindowForElement=function(element)
{while(element!=null)
{var tn=(element.tagName||"").toLowerCase();if(tn=="div")
{var classNames=$w(element.className);if(classNames.include("window")||classNames.include("inlinewindow"))
{return element;}}
if(element.parentNode)
element=element.parentNode;else
element=element.parentElement;}
log4js.logger.error("miwt.getWindowForElement(" +element +"): Unable to find element parent that is a window. element.id = "
+(element?element.id:"null") +", element.nodeName = " +(element?element.nodeName:"null")
+", element.class = " +(element?element.className:"null"));alert("An unexpected error occurred. Try reloading the page.");return null;}
miwt.repairWindowsAfterUpdate=function()
{var activewindow=null;var newlist=new Array();for(i=0;i<miwt.windowlist.length;i++)
{var w=$(miwt.windowlist[i]);if(w!=null)
{newlist.push(miwt.windowlist[i]);w.miwt_hide_permiating=false;if(miwt.isWindowActive(w))
activewindow=w;}}
miwt.windowlist=newlist;if(activewindow!=null)
miwt.checkForPermiatingElements(activewindow);}
miwt.activateWindow=function(object)
{if($(object.id+"_title_div")==null)
return;if(object.style.zIndex!=miwt.windowTopZIndex){miwt.windowTopZIndex++;object.style.zIndex=miwt.windowTopZIndex;}
var title_td=$(object.id+"_title_td");Element.removeClassName(title_td,"inactivewindowtitle");Element.addClassName(title_td,"activewindowtitle");var title_div=$(object.id+"_title_div");Element.removeClassName(title_div,"inactivewindowtitle");Element.addClassName(title_div,"activewindowtitle");if($(object.id+"_menu_btn")!=null)
miwt.button.imageButtonActivate(object.id+"_menu_btn");if($(object.id+"_minimize_btn")!=null)
miwt.button.imageButtonActivate(object.id+"_minimize_btn");if($(object.id+"_maximize_btn")!=null)
miwt.button.imageButtonActivate(object.id+"_maximize_btn");if($(object.id+"_close_btn")!=null)
miwt.button.imageButtonActivate(object.id+"_close_btn");if(object.focusable)
miwt.stopObserving(miwt.getWindowContent(object),"mousedown",miwt.activateWindowPassive,false);var dialog=!!/\bdialog\b/.exec(object.className);for(i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]!=object.id)
{var w=$(miwt.windowlist[i]);if(w!=null&&w!=object){miwt.deactivateWindow(w);if(dialog)
miwt.disableChildren(w);}}}
object.miwt_hide_permiating=true;miwt.showPermiatingElements(object);}
miwt.deactivateWindow=function(object)
{if($(object.id+"_title_div")==null)
return;var title_td=$(object.id+"_title_td");Element.removeClassName(title_td,"activewindowtitle");Element.addClassName(title_td,"inactivewindowtitle");var title_div=$(object.id+"_title_div");Element.removeClassName(title_div,"activewindowtitle");Element.addClassName(title_div,"inactivewindowtitle");if($(object.id+"_menu_btn")!=null)
miwt.button.imageButtonDeactivate(object.id+"_menu_btn");if($(object.id+"_minimize_btn")!=null)
miwt.button.imageButtonDeactivate(object.id+"_minimize_btn");if($(object.id+"_maximize_btn")!=null)
miwt.button.imageButtonDeactivate(object.id+"_maximize_btn");if($(object.id+"_close_btn")!=null)
miwt.button.imageButtonDeactivate(object.id+"_close_btn");if(object.focusable)
miwt.observe(miwt.getWindowContent(object),"mousedown",miwt.activateWindowPassive,false);}
miwt.closeWindow=function(object){var dialog=!!/\bdialog\b/.exec(object.className);miwt.closeCKEditors(object);object.parentNode.removeChild(object);miwt.repairWindowsAfterUpdate();if(miwt.windowlist.length>0){var top=$(miwt.windowlist[0]);if(!top){log4js.logger.error("miwt.closeWindow: Expecting top window at miwt.windowlist[0], got null");return;}
if(dialog)
miwt.enableChildren(top);for(i=1;i<miwt.windowlist.length;i++)
{var w=$(miwt.windowlist[i]);if(dialog)
miwt.enableChildren(w);if(w&&w.style.zIndex>top.style.zIndex)
top=w;}
miwt.activateWindow(top);}}
miwt.isWindowActive=function(object)
{if(object.className.match(/inlinewindow/)&&miwt.windowlist.length==1)
{for(i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]!=object.id)
{var otherwindow=$(miwt.windowlist[i]);if(!otherwindow.className.match(/inlinewindow/))
{var titletd=$(otherwindow.id+"_title_td");if(titletd!=null&&titletd.className.match(/activewindowtitle/))
return false;}}}
return true;}
var titletd=$(object.id+"_title_td");if(titletd==null)
{return false;}
return!!titletd.className.match(/activewindowtitle/);}
miwt.getWindowContent=function(object)
{return $(object.id+"_content_div");}
miwt.isWindowOverlapped=function(activewindow,otherwindow)
{if(otherwindow.className.match(/inlinewindow/))
return true;var activeTop=parseInt(activewindow.style.top);var activeLeft=parseInt(activewindow.style.left);var activeBottom=activeTop+parseInt(activewindow.offsetHeight);var activeRight=activeLeft+parseInt(activewindow.offsetWidth);var otherTop=parseInt(otherwindow.style.top);var otherLeft=parseInt(otherwindow.style.left);var otherBottom=otherTop+parseInt(otherwindow.offsetHeight);var otherRight=otherLeft+parseInt(otherwindow.offsetWidth);if(activeTop>otherBottom)return false;if(activeBottom<otherTop)return false;if(activeLeft>otherRight)return false;if(activeRight<otherLeft)return false;return true;}
miwt.checkForPermiatingElements=function(activewindow)
{for(i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]!=activewindow.id)
{var otherwindow=$(miwt.windowlist[i]);if(otherwindow!=null)
{if(miwt.isWindowOverlapped(activewindow,otherwindow))
miwt.hidePermiatingElements(otherwindow);else
miwt.showPermiatingElements(otherwindow);}}}
miwt.showPermiatingElements(activewindow);}
miwt.beginWindowMove=function(evt)
{miwt.windowMoveTarget=miwt.getWindowForElement(Event.element(evt));if(miwt.windowMoveTarget==null)
return;Event.stop(evt);miwt.lastWindowX=Event.pointerX(evt);miwt.lastWindowY=Event.pointerY(evt);miwt.observe(document.body,"mousemove",miwt.doWindowMove,true);miwt.observe(document.body,"mouseup",miwt.endWindowMove,true);var td=$(miwt.windowMoveTarget.id+"_title_td");miwt.lastWindowCursor=td.style.cursor;td.style.cursor='move';miwt.lastDocumentCursor=document.body.style.cursor;document.body.style.cursor='move';miwt.activateWindow(miwt.windowMoveTarget);$(miwt.windowMoveTarget.id+"_content_div").style.visibility="hidden";}
miwt.doWindowMove=function(evt)
{Event.stop(evt);var difX=Event.pointerX(evt)-miwt.lastWindowX;var difY=Event.pointerY(evt)-miwt.lastWindowY;miwt.moveWindowRelative(miwt.windowMoveTarget,difX,difY);miwt.lastWindowX=Event.pointerX(evt);miwt.lastWindowY=Event.pointerY(evt);}
miwt.endWindowMove=function(evt)
{$(miwt.windowMoveTarget.id+"_title_td").style.cursor=miwt.lastWindowCursor;document.body.style.cursor=miwt.lastDocumentCursor;miwt.stopObserving(document.body,"mousemove",miwt.doWindowMove,true);miwt.stopObserving(document.body,"mouseup",miwt.endWindowMove,true);$(miwt.windowMoveTarget.id+"_content_div").style.visibility="visible";Event.stop(evt);miwt.checkForPermiatingElements(miwt.windowMoveTarget);miwt.windowMoveTarget=null;}
miwt.beginWindowResize=function(evt)
{var target=Event.element(evt);miwt.windowResizeTarget=miwt.getWindowForElement(target);if(miwt.windowResizeTarget==null)
return;Event.stop(evt);miwt.lastWindowX=Event.pointerX(evt);miwt.lastWindowY=Event.pointerY(evt);miwt.windowResizeDir=target.resizeDir;miwt.observe(document.body,"mousemove",miwt.doWindowResize,true);miwt.observe(document.body,"mouseup",miwt.endWindowResize,true);miwt.activateWindow(miwt.windowResizeTarget);}
miwt.doWindowResize=function(evt)
{$(miwt.windowResizeTarget.id+"_content_div").style.visibility="hidden";var difX=Event.pointerX(evt)-miwt.lastWindowX;var difY=Event.pointerY(evt)-miwt.lastWindowY;miwt.lastWindowX=Event.pointerX(evt);miwt.lastWindowY=Event.pointerY(evt);var object=miwt.windowResizeTarget;var top=parseInt(object.style.top);var left=parseInt(object.style.left);var width=parseInt(object.style.width);var height=parseInt(object.style.height);var table=$(miwt.windowResizeTarget.id+"_table");var tableWidth=parseInt(table.style.width);var tableHeight=parseInt(table.style.height);var content=$(miwt.windowResizeTarget.id+"_content_div");var contentWidth=parseInt(content.style.width);var contentHeight=parseInt(content.style.height);if(miwt.windowResizeDir=="ne")
{width=width+difX;height=height-difY;tableWidth=tableWidth+difX;tableHeight=tableHeight-difY;contentWidth=contentWidth+difX;contentHeight=contentHeight-difY;top=top+difY;}
else if(miwt.windowResizeDir=="nw")
{width=width-difX;height=height-difY;tableWidth=tableWidth-difX;tableHeight=tableHeight-difY;contentWidth=contentWidth-difX;contentHeight=contentHeight-difY;left=left+difX;top=top+difY;}
else if(miwt.windowResizeDir=="se")
{width=width+difX;height=height+difY;tableWidth=tableWidth+difX;tableHeight=tableHeight+difY;contentWidth=contentWidth+difX;contentHeight=contentHeight+difY;}
else if(miwt.windowResizeDir=="sw")
{width=width-difX;height=height+difY;tableWidth=tableWidth-difX;tableHeight=tableHeight+difY;contentWidth=contentWidth-difX;contentHeight=contentHeight+difY;left=left+difX;}
else
{alert("Internal error in window resize, I don't know which direction you are resizing.");miwt.endWindowResize(evt);}
object.style.top=top+"px";object.style.left=left+"px";object.style.width=width+"px";object.style.height=height+"px";table.style.width=tableWidth+"px";table.style.height=tableHeight+"px";content.style.width=contentWidth+"px";content.style.height=contentHeight+"px";}
miwt.endWindowResize=function(evt)
{miwt.stopObserving(document.body,"mousemove",miwt.doWindowResize,true);miwt.stopObserving(document.body,"mouseup",miwt.endWindowResize,true);$(miwt.windowResizeTarget.id+"_content_div").style.visibility="visible";Event.stop(evt);miwt.checkForPermiatingElements(miwt.windowMoveTarget);miwt.windowResizeTarget=null;}
miwt.disableWindowActivation=function(evt)
{Event.stop(evt);}
miwt.enableChildren=function(root){miwt.disableChildren(root,false);}
miwt.disableChildren=function(root,disable){if(root==null||!root.hasChildNodes()||miwt.IsIterationStopNode(root))
return;if(typeof disable=='undefined')
disable=true;var i;for(i=0;i<root.childNodes.length;i++)
{var node=root.childNodes.item(i);if(node.nodeType==Node.ELEMENT_NODE)
{if(node.hasAttributes)
{if(node.hasAttributes())
{if(disable){if(!node.hasAttribute("disabled")){node.wedisabled=true;node.setAttribute("disabled","true");}}else{if(node.wedisabled){node.wedisabled=false;node.removeAttribute("disabled");}}}}
else
{if(disable){if(node.disabled){node.wedisabled=true;node.disabled=disable;}}else{if(node.wedisabled){node.wedisabled=false;node.disabled=false;}}}
miwt.disableChildren(node,disable);}}}
miwt.activateWindowPassive=function(evt)
{var win=miwt.getWindowForElement(Event.element(evt));if(win==null)
return;if(!miwt.isWindowActive(win))
{miwt.activateWindow(win);miwt.checkForPermiatingElements(win);}}
miwt.setAbsoluteWidth=function(object)
{var width=parseInt(object.offsetWidth);var height=parseInt(object.offsetHeight);object.style.width=width+"px";object.style.height=height+"px";}
miwt.setInitialPosition=function(windowObject)
{if(windowObject.className.match(/inlinewindow/))
return;if(!windowObject.style.top||windowObject.style.top=="")
{var scrollTop=0;if(document.documentElement)
scrollTop=document.documentElement.scrollTop;if(document.body.scrollTop&&scrollTop==0)
scrollTop=document.body.scrollTop;var initialTop=scrollTop +10;if(windowObject.className.match(/dialog/)){var height=miwt.getComputedStyle(windowObject,"height");if(height.match(/px/)){height=parseInt(height);if(height<miwt.getWindowHeight())
initialTop=scrollTop +(miwt.getWindowHeight() -height)/2;}
else if(height.match(/%/)){height=parseInt(height);if(height>0)
initialTop=scrollTop +(miwt.getWindowHeight()*(1 -height/100))/2;}else{height=windowObject.offsetHeight;if(height<miwt.getWindowHeight())
initialTop=scrollTop +(miwt.getWindowHeight() -height)/2;}}
for(i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]!=windowObject.id)
{var otherwindow=$(miwt.windowlist[i]);if(otherwindow.style.top&&otherwindow.style.top!=''&&Math.abs(parseInt(otherwindow.style.top) -initialTop)<30)
{initialTop +=30;}}}
windowObject.style.top=initialTop +"px";}
if(!windowObject.style.left||windowObject.style.left=="")
{var scrollLeft=0;if(document.documentElement)
scrollLeft=document.documentElement.scrollLeft;if(document.body.scrollLeft&&scrollLeft==0)
scrollLeft=document.body.scrollLeft;var initialLeft=scrollLeft +10;if(windowObject.className.match(/dialog/)){var width=miwt.getComputedStyle(windowObject,"width");if(width.match(/px/)){width=parseInt(width);if(width<miwt.getWindowWidth())
initialLeft=scrollLeft +(miwt.getWindowWidth() -width)/2;}
else if(width.match(/%/)){width=parseInt(width);if(width>0)
initialLeft=scrollLeft +(miwt.getWindowWidth()*(1 -width/100))/2;}else{width=windowObject.offsetWidth;if(width<miwt.getWindowWidth())
initialLeft=scrollLeft +(miwt.getWindowWidth() -width)/2;}}
for(i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]!=windowObject.id)
{var otherwindow=$(miwt.windowlist[i]);if(otherwindow.style.left&&otherwindow.style.left!=''&&Math.abs(parseInt(otherwindow.style.left) -initialLeft)<30)
{initialLeft +=30;}}}
windowObject.style.left=initialLeft +"px";}}
miwt.ensurePassiveWindowActivation=function(windowObject)
{var windowContent=$(windowObject.id+"_content_div");miwt.stopObserving(windowContent,"mousedown",miwt.activateWindowPassive,false);miwt.observe(windowContent,"mousedown",miwt.activateWindowPassive,false);}
miwt.setupWindow=function(name,resizable,zindex,focusable,moveable)
{miwt.fixWindowList();var alreadyInList=false;for(var i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]==name)
{alreadyInList=true;break;}}
if(!alreadyInList)
miwt.windowlist.push(name);var windowObject=$(name);var windowTitle=$(name+"_table");var windowTable=$(name+"_table");var windowContent=$(name+"_content_div");var title=$(name+"_title_td");var active=miwt.isWindowActive(windowObject);if(zindex>miwt.windowTopZIndex)
{miwt.windowTopZIndex=zindex;}
windowObject.focusable=focusable;if(focusable)
{if(!active)
{miwt.ensurePassiveWindowActivation(windowObject);}
else if(!windowObject.className.match(/inlinewindow/))
{for(i=0;i<miwt.windowlist.length;i++)
{var otherwindow=$(miwt.windowlist[i]);if(otherwindow.className.match(/inlinewindow/))
{miwt.ensurePassiveWindowActivation(otherwindow);}}}
if(moveable)
{miwt.observe(title,"mousedown",miwt.beginWindowMove,true);}
if(resizable)
{setAbsoluteWidth(windowContent);setAbsoluteWidth(windowTable);setAbsoluteWidth(windowObject);var resize;resize=$(name+"_windowresize_nw_div");miwt.observe(resize,"mousedown",miwt.beginWindowResize,false);resize.resizeDir="nw";resize=$(name+"_windowresize_ne_div");miwt.observe(resize,"mousedown",miwt.beginWindowResize,false);resize.resizeDir="ne";resize=$(name+"_windowresize_sw_div");miwt.observe(resize,"mousedown",miwt.beginWindowResize,false);resize.resizeDir="sw";resize=$(name+"_windowresize_se_div");miwt.observe(resize,"mousedown",miwt.beginWindowResize,false);resize.resizeDir="se";}}
else
{miwt.observe(windowObject,"mousedown",miwt.disableWindowActivation,true);miwt.disableChildren(windowObject);}
for(i=0;i<miwt.windowlist.length;i++)
{if(miwt.windowlist[i]!=windowObject.id)
{var otherwindow=$(miwt.windowlist[i]);if(otherwindow!=null&&miwt.isWindowOverlapped(windowObject,otherwindow))
{if(active)
{miwt.hidePermiatingElements(otherwindow);}
else
{miwt.hidePermiatingElements(windowObject);}}}}
if(active)
{miwt.showPermiatingElements(windowObject);}
if(!Element.hasClassName(windowObject,"inlinewindow"))
{var form=Selector.findElement([windowObject].concat(windowObject.ancestors()),'form',0);form.RegisterOnSubmitHandler(windowObject,miwt.prv_saveWindowPosition.bind(name));miwt.autoSizeWindow(windowObject,windowContent,windowTitle);}
miwt.setInitialPosition(windowObject);if(active||!Element.hasClassName(windowObject,"dialog"))
miwt.activateWindow(windowObject);};miwt.autoSizeWindow=function(windowObject,windowContent,windowTitle){if(miwt.isResizable(windowObject)||!windowObject)
return;if((!windowObject.style.height||windowObject.style.height=='auto')||!!windowObject.autosized)
{windowContent=windowContent||$(windowObject.id+"_content_div");var hb=20,contentNode,list=$A(windowContent.childNodes);while((contentNode=list.pop())&&contentNode.nodeType!=1);if(contentNode&&contentNode.nodeType==1)
{contentNode.style.minHeight="2em";windowTitle=windowTitle||$(windowObject.id+"_table");var wth=windowTitle.offsetHeight,cnh,h=miwt.getWindowHeight() -40;try{Element.cleanWhitespace(contentNode);}catch(e){}
cnh=contentNode.offsetHeight?contentNode.offsetHeight:0;if(contentNode.firstChild===contentNode.lastChild&&contentNode.firstChild.offsetHeight>cnh)
cnh=contentNode.firstChild.offsetHeight;var ih=wth +cnh +hb;if(ih>h)ih=h;if(ih>windowObject.offsetHeight)
windowObject.style.height=ih +"px";else if(windowObject.autosized&&(cnh +wth +40)<windowObject.offsetHeight)
windowObject.style.height=(cnh +wth +hb) +"px";windowObject.autosized=true;}}};miwt.prv_saveWindowPosition=function(){miwt.saveWindowPosition(this+'',this+'_windowTop',this+'_windowLeft',this+'_windowWidth',this+'_windowHeight',this+'_windowZOrder');return true;};miwt.isWindow=function(node){if(!node||!node.className)
return false;return!!/\bwindow\b/.exec(node.className);}
miwt.isInlineWindow=function(node){if(!node||!node.className)
return false;return!!/\binlinewindow\b/.exec(node.className);}
miwt.isInActiveWindow=function(node){var win=miwt.getWindowForElement(node);if(!win)
return false;return miwt.isWindowActive(win);}
miwt.AddSetupHandler(['div'],function(tag,node)
{var isWindow=miwt.isWindow(node);var isInlineWindow=miwt.isInlineWindow(node);if(isWindow||isInlineWindow)
{miwt.setupWindow(node.id,miwt.isResizable(node),Element.getStyle(node,'z-index')||0,true,!isInlineWindow);}});miwt.isResizable=function(node){return node&&$(node.id+"_windowresize_nw_div")!=null};}
if(typeof miwtpermiating=='undefined'){var miwtpermiating={};miwt.elementPermiatingNone=[];miwt.elementPermiatingIE6=['select'];miwt.elementPermiating=miwt.elementPermiatingNone;if(navigator.userAgent.match(/MSIE [456]/))
miwt.elementPermiating=miwt.elementPermiatingIE6;miwt.isElementPermiating=function(node){if(!node.tagName)
return false;var tag=node.tagName.toLowerCase();var t;for(var i=0;t=miwt.elementPermiating[i];i++){if(tag==t)
return true;}
return false;}
miwt.hidePermiatingElements=function(object)
{if(object.miwt_hide_permiating==true)
return;object.miwt_hide_permiating=true;var element,node;for(var i=0;element=miwt.elementPermiating[i];i++){var nodes=object.getElementsByTagName(element);for(var j=0;node=nodes[j];j++){node.style.visibility="hidden";}}}
miwt.showPermiatingElements=function(object)
{if(object.miwt_hide_permiating==false)
return;object.miwt_hide_permiating=false;var element,node;for(var i=0;element=miwt.elementPermiating[i];i++){var nodes=object.getElementsByTagName(element);nodeLoop:for(var j=0;node=nodes[j];j++){var parent=node.parentNode;while(parent){if(miwt.isVisibilitySet(parent)){try{node.style.visibility=null;break nodeLoop;}catch(e){}}
parent=parent.parentNode;}
node.style.visibility="visible";}}}
miwt.isVisibilitySet=function(node)
{return(node.style&&node.style.visibility&&node.style.visibility!=null&&node.style.visibility!="");}
miwt.IsIterationStopNode=function(object)
{return object.nodeName=="SELECT"||object.nodeName=="select";}}
if(typeof miwtcollapsible=='undefined'){var miwtcollapsible={};miwt.collapsableContainerToggle=function(collapseFormKey,containerDivId,triggerId,anchor,inline){var formElement=$(collapseFormKey);if(formElement==null)
return;if(formElement.value=="true"){miwt.prv_collapsableContainerShow(containerDivId,triggerId,anchor,inline);formElement.value="false";}
else if(formElement.value=="false"){miwt.prv_collapsableContainerHide(containerDivId,triggerId,inline);formElement.value="true";}}
miwt.prv_collapsableContainerShow=function(containerDivId,triggerId,anchor,inline){var divObject=$(containerDivId);if(divObject==null)
return;var triggerObject=$(triggerId);if(triggerObject!=null){var pos=Element.cumulativeOffset(triggerObject);if(anchor.indexOf("south")>=0){if(anchor=="south"){divObject.style.left=pos[0]+"px";divObject.style.top=(pos[1]+triggerObject.offsetHeight)+"px";}
else{divObject.style.top=pos[1]+"px";}}
if(anchor.indexOf("east")>=0){divObject.style.left=(pos[0]+triggerObject.offsetWidth)+"px";if(anchor=="east")
divObject.style.top=pos[1]+"px";}
if(anchor.indexOf("north")>=0){if(anchor=="north"){divObject.style.left=pos[0]+"px";divObject.style.top=(pos[1]-divObject.offsetHeight)+"px";}
else{divObject.style.top=((pos[1]+triggerObject.offsetHeight)-divObject.offsetHeight)+"px";}}
if(anchor.indexOf("west")>=0){divObject.style.left=(pos[0]-divObject.offsetWidth)+"px";if(anchor=="west")
divObject.style.top=pos[1]+"px";}
Element.removeClassName(triggerObject,"miwt_collapsable_hidden");Element.removeClassName(triggerObject.parentNode,"miwt_collapsable_hidden");Element.addClassName(triggerObject,"miwt_collapsable_shown");Element.addClassName(triggerObject.parentNode,"miwt_collapsable_shown");}
Element.removeClassName(divObject,"miwt_collapsable_hidden");Element.addClassName(divObject,"miwt_collapsable_shown");if(inline)
divObject.style.display="inline";else
divObject.style.visibility="visible";if(Element.hasClassName(triggerObject,"miwt_collapsable_exclusive"))
{var el,list;list=$$('.miwt_collapsable_exclusive');while(el=list.pop()){if(el.div&&el.div!=divObject){miwt.prv_collapsableContainerHide(el.div.id,el.id,el.disposition.toLowerCase()=='inline');el.state.value="true";}}}}
miwt.prv_collapsableContainerHide=function(containerDivId,triggerId,inline)
{var divObject=$(containerDivId);if(divObject==null)
return;if(inline)
divObject.style.display="none";else
divObject.style.visibility="hidden";Element.removeClassName(divObject,"miwt_collapsable_shown");Element.addClassName(divObject,"miwt_collapsable_hidden");var triggerObject=$(triggerId);if(triggerObject!=null){Element.removeClassName(triggerObject,"miwt_collapsable_shown");Element.removeClassName(triggerObject.parentNode,"miwt_collapsable_shown");Element.addClassName(triggerObject,"miwt_collapsable_hidden");Element.addClassName(triggerObject.parentNode,"miwt_collapsable_hidden");}}
miwt.collapseContainerToggle=function(event){Event.stop(event);var element=Event.element(event)||event;miwt.collapsableContainerToggle(element.state.name,element.div.id,element.id,element.anchor,element.disposition.toLowerCase()=='inline');}
miwt.AddSetupHandler(['button','a','img'],function(tag,node){var match=/miwt_collapsable_(\w+)_(\w+)/.exec(node.className);if(match){node.anchor=match[1];node.disposition=match[2];node.div=$(node.id.replace("_collapsable_trigger","_collapsable"));node.state=$(node.id.replace("_collapsable_trigger",""));miwt.observe(node,"click",miwt.collapseContainerToggle);if(node.disposition.toLowerCase()!='inline'&&node.state.value=='false'){miwt.prv_collapsableContainerShow(node.div.id,node.id,node.anchor,false);}}});}
if(typeof miwttimer=='undefined'){var miwttimer={};miwttimer.graceperiod=3000;miwttimer.fireTimer=function(formname)
{var form=$(formname);if(!form)
return;miwttimer.oldTimer=null;if(miwttimer.rescheduleTimerNeeded&&(new Date() -miwttimer.rescheduleTimerNeeded)<miwttimer.graceperiod)
{miwttimer.oldTimer=setTimeout('miwttimer.fireTimer("'+formname+'")',miwttimer.graceperiod,'JavaScript');}
else
{form.MIWTSubmit();}}
miwttimer.rescheduleTimer=function()
{if(miwttimer.oldTimer){miwttimer.rescheduleTimerNeeded=new Date();}}
miwttimer.scheduleUpdate=function(formname,time)
{var form=$(formname);if(miwttimer.oldTimer){clearTimeout(miwttimer.oldTimer);miwttimer.oldTimer=null;}
miwttimer.oldTimer=setTimeout('miwttimer.fireTimer("'+formname+'")',time||1000,'JavaScript');}
miwt.AddSetupHandler(['dfn'],function(tag,node){if(tag=='dfn'&&/\bmiwt_timer\b/.exec(node.className))
{var form=node;while(form.parentNode&&(!form.tagName||(form.tagName.toLowerCase()!="form")))
form=form.parentNode;miwttimer.scheduleUpdate(form.id||form.name,parseInt(node.firstChild.data));}});}
if(typeof validation=='undefined'){var validation=new Object();validation.integerpattern=new RegExp("[ ]*([-]?[ ]*[0-9]+)[ ]*$");validation.realpattern=new RegExp("([ ]*[-]?[ ]*[0-9]*[\.][0-9]+[ ]*$)|([ ]*[-]?[ ]*[0-9]+[\.][0-9]*[ ]*$)");validation.emailpattern=new RegExp("^.+@.+\..{2,3}$");validation.date_mmddyyyy_slash=/([0-9][0-9])\x2F([0-9][0-9])\x2F([0-9][0-9][0-9][0-9])/;validation.date_mmddyyyy_dash=new RegExp("([0-9][0-9])-([0-9][0-9])-([0-9][0-9][0-9][0-9])");validation.date_mmddyy_slash=/([0-9][0-9])\x2F([0-9][0-9])\x2F([0-9][0-9])/;validation.date_mmddyy_dash=new RegExp("([0-9][0-9])-([0-9][0-9])-([0-9][0-9])");validation.config_regex_formatpattern=new RegExp("([-]?[\\w]*)[ ]*,[ ]*([-]?[\\w]*)");validation.config_typepattern=new RegExp("([\\w]+)([\\(](.*)[\\)])?");validation.config_formatpattern=new RegExp("([-]?[^\\s,]*)[ ]*,[ ]*([-]?[^\\s,]*)");validation.isWhiteSpace=function(s)
{if(s==' '||s=='\t'||s=='\n'||s=='\r'||s=='\b'||s=='\f')
return true;else
return false;}
validation.ltrim=function(s)
{if(s=='')
return s;var n=s.length;for(var i=0;i<n;i++)
{if(validation.isWhiteSpace(s.charAt(i))==false)
return s.substr(i);}
return'';}
validation.rtrim=function(s)
{if(s=='')
return s;var n=s.length;for(var i=n;i>0;i--)
{if(validation.isWhiteSpace(s.charAt(i-1))==false)
return s.substr(0,i);}
return'';}
validation.trim=function(s)
{return validation.ltrim(validation.rtrim(s));}
validation.isInteger=function(s)
{var re=validation.integerpattern;var parse=re.exec(s);if(parse==null)
return false;else if(parse[0]==s)
return true;else
return false;}
validation.checkNumber=function(n,lbound,ubound)
{var nn=new Number(n);if(lbound!=""&&ubound!="")
{lbound=new Number(lbound);ubound=new Number(ubound);if(nn<lbound||nn>ubound)
return false;}
else if(lbound==""&&ubound!="")
{ubound=new Number(ubound);if(nn>ubound)
return false;}
if(lbound!=""&&ubound=="")
{lbound=new Number(lbound);if(nn<lbound)
return false;}
return true;}
validation.checkString=function(s,lbound,ubound)
{var nn=s.length;if(lbound!=""&&ubound!="")
{lbound=new Number(lbound);ubound=new Number(ubound);if(nn<lbound||nn>ubound)
return false;}
else if(lbound==""&&ubound!="")
{ubound=new Number(ubound);if(nn>ubound)
return false;}
if(lbound!=""&&ubound=="")
{lbound=new Number(lbound);if(nn<lbound)
return false;}
return true;}
validation.isDate=function(s,dateFormat)
{var re;if(dateFormat=="mm/dd/yyyy")
{re=validation.date_mmddyyyy_slash;}
else if(dateFormat=="mm-dd-yyyy")
{re=validation.date_mmddyyyy_dash;}
else if(dateFormat=="mm/dd/yy")
{re=validation.date_mmddyy_slash;}
else if(dateFormat=="mm-dd-yy")
{re=validation.date_mmddyy_dash;}
var s=validation.trim(s);var parse=re.exec(s);if(parse==null||parse[0]!=s)
{return false;}
else
return true;}
validation.isReal=function(s)
{var re=validation.realpattern;var parse=re.exec(s);if(parse==null)
return false;else if(parse[0]==s)
return true;else
return false;}
validation.isNumeric=function(s)
{return validation.isInteger(s)||validation.isReal(s);}
validation.isEmail=function(s)
{var re=validation.emailpattern;var parse=re.exec(s);if(parse==null)
return false;else
return true;}
validation.isIgnored=function(htmlform){return htmlform.elements['btnhit'].value&&$(htmlform.elements['btnhit'].value+'_ignore_validation');}
validation.validateForm=function(htmlform)
{if(validation.isIgnored(htmlform))
return true;for(var i=0;i<validation.fields.length;i++)
{if(validation.fields[i]==null||htmlform.elements[validation.fields[i].element.name]==null)
{var new_fv_fields=new Array();for(var j=0;j<validation.fields.length;j++)
{if(validation.fields[j]!=null&&htmlform.elements[validation.fields[j].element.name]!=null)
{new_fv_fields.push(validation.fields[j]);}}
validation.fields=new_fv_fields;return validation.validateForm(htmlform);}
if(validation.fields[i].required=="1")
{var e=validation.fields[i].element;if(e.type=="text"||e.type=="textarea")
{if(validation.trim(e.value).length==0)
{validation.inValidation=true;alert(validation.fields[i].message);e.focus();e.select();validation.inValidation=false;return false;}}
else if(e.type=="select-one"||e.type=="select-multiple")
{if(e.selectedIndex== -1||e.options[e.selectedIndex].value=="")
{validation.inValidation=true;alert(validation.fields[i].message);e.focus();validation.inValidation=false;return false;}}
else if(e.type=="radio"||e.type=="checkbox")
{var radios=htmlform.elements[e.name];var n=0;for(var k=0;k<radios.length;k++)
{if(radios[k].checked)
{n++;break;}}
if(n==0)
{validation.inValidation=true;alert(validation.fields[i].message);validation.inValidation=false;return false;}}}
else
{if(!validation.isFieldValid(validation.fields[i]))
{var e=validation.fields[i].element;if(!e.validation_called)
{e.focus();e.blur();}
return false;}}
if(validation.fields[i].type=="doubleentry")
{var value=validation.fields[i].element.value;var compareField=$(validation.fields[i].format);if(compareField!=null)
{var value2=compareField.value;if(value!=value2)
{validation.inValidation=true;alert(validation.fields[i].message);validation.inValidation=false;return false;}}}}
return true;}
validation.badValidation=function()
{if(validation.failedValidationInfo!=null)
{alert(validation.failedValidationInfo.message);validation.failedValidationInfo.element.focus();validation.failedValidationInfo.element.select();validation.failedValidationInfo=null;}}
validation.isFieldValid=function(fieldinfo)
{var valid=true;var value=fieldinfo.element.value;if(validation.trim(value).length>0)
{if(fieldinfo.type=="int")
{valid=(validation.isInteger(value)&&validation.checkNumber(value,fieldinfo.lbound,fieldinfo.ubound));}
else if(fieldinfo.type=="num")
{valid=(validation.isNumeric(value)&&validation.checkNumber(value,fieldinfo.lbound,fieldinfo.ubound));}
else if(fieldinfo.type=="float")
{valid=(validation.isReal(value)&&validation.checkNumber(value,fieldinfo.lbound,fieldinfo.ubound));}
else if(fieldinfo.type=="text")
{valid=validation.checkString(value,fieldinfo.lbound,fieldinfo.ubound);}
else if(fieldinfo.type=="email")
{valid=validation.isEmail(value);}
else if(fieldinfo.type=="date")
{var dateFormat=(fieldinfo.format=="")?"mm/dd/yyyy":fieldinfo.format;valid=validation.isDate(value,dateFormat);}
else if(fieldinfo.type=="regexp")
{var re=new RegExp(fieldinfo.format);var s=validation.trim(value);var parse=re.exec(s);valid=(parse!=null&&parse[0]==s);}}
return valid;}
validation.onBlurHandler=function(evt)
{if(validation.inValidation)
return true;var target=Event.element(evt);if(validation.isIgnored(target.form))
return true;validation.inValidation=true;var fieldinfo=validation.getFieldInfo(target);var valid=true;if(fieldinfo!=null)
{valid=validation.isFieldValid(fieldinfo);}
target.validation_called=true;if(valid)
{validation.inValidation=false;return true;}
else
{validation.failedValidationInfo=fieldinfo;setTimeout(validation.badValidation,100,"JavaScript");validation.inValidation=false;Event.stop(evt);return false;}}
validation.getFieldInfo=function(field)
{for(var i=0;i<validation.fields.length;i++)
{if(validation.fields[i].element.name==field.name)
return validation.fields[i];}
return null;}
validation.setHandler=function(fieldinfo)
{validation.setEventHandler(fieldinfo.element,fieldinfo);}
validation.setEventHandler=function(field,fieldinfo)
{if(field.type=="text"||field.type=="textarea")
{miwt.observe(field,"blur",validation.onBlurHandler,false);}}
validation.fieldInfo=function(element,message,type,required)
{this.element=element;this.message=message;this.required=required;this.type=type.toLowerCase();this.format="";this.lbound="";this.ubound="";var parse=validation.config_typepattern.exec(type);if(parse!=null)
{this.type=parse[1];if(parse.length==4)
this.format=parse[3];parse=validation.config_formatpattern.exec(this.format);if(parse!=null)
{this.lbound=parse[1];this.ubound=parse[2];}}}
validation.FormValidation_Register=function(element,message,type,required)
{var f=new validation.fieldInfo(element,message,type,required);validation.setHandler(f);for(var i=0;i<validation.fields.length;i++)
{if(validation.fields[i].element.name==element.name)
{validation.fields[i]=f;return;}}
validation.fields.push(f);}
validation.fields=new Array();validation.inValidation=false;miwt.AddSetupHandler(['dfn'],function(tag,node)
{if(tag!='dfn'||!/\bmiwt_validation\b/.exec(node.className))
return;var match=/(\S+)_val/.exec(node.id);if(!match)
return;var type=node.firstChild.data;var msgnode=$(node.id+"_message");var reqnode=$(node.id+"_required");if(msgnode&&msgnode.firstChild&&reqnode&&reqnode.firstChild){var msg=msgnode.firstChild.data;var req=reqnode.firstChild.data;var el=$(match[1]);if(el)
validation.FormValidation_Register(el,msg,type,req);else
log4js.logger.error("Could not find element "+match[1]+" for validation");}});}
if(typeof miwttable=='undefined'){var miwttable={};miwt.tableRowOnMouseOver=function(evt)
{var tr=Event.element(evt);while(tr!=null&&(!tr.tagName||tr.tagName.toLowerCase()!='tr'))
tr=tr.parentNode;if(tr==null||!tr.highlightColor)
return;var theCells=tr.getElementsByTagName('td');var rowCellsCnt=theCells.length;for(var c=0;c<rowCellsCnt;c++){var cell=theCells[c];cell.saveBackgroundColor=cell.style.backgroundColor||tr.style.backgroundColor;cell.style.backgroundColor=tr.highlightColor;}}
miwt.tableRowOnMouseOut=function(evt)
{var tr=Event.element(evt);while(tr!=null&&(!tr.tagName||tr.tagName.toLowerCase()!='tr'))
tr=tr.parentNode;if(tr==null||!tr.highlightColor)
return;var theCells=tr.getElementsByTagName('td');var rowCellsCnt=theCells.length;for(var c=0;c<rowCellsCnt;c++){var cell=theCells[c];cell.style.backgroundColor=cell.saveBackgroundColor;}}
miwt.tableRowModification=function(element)
{if(element.modificationSet)
return;element.modificationSet=true;var tr=element.parentNode;while(tr!=null&&(!tr.tagName||tr.tagName.toLowerCase()!='tr'))
tr=tr.parentNode;if(tr==null)
return;var theCells=tr.getElementsByTagName('td');var rowCellsCnt=theCells.length;for(var c=0;c<rowCellsCnt;c++){var cell=theCells[c];cell.style.backgroundColor=element.modificationColor;cell.saveBackgroundColor=element.modificationColor;}}
miwt.AddSetupHandler(['table'],function(tag,node){if(tag!='table')
return;var moving=$("columnmoving_"+node.id);if(moving){var headers=Element.select(node,"thead th");var i,n;for(i=0;n=headers[i];i++){if(/\bcontrol\b/.test(n.className))
continue;n.id="columnmove_"+node.id+"_th_"+i;Element.addClassName(n,"dnd_source");miwtdnd.setupDragSource(n);Element.addClassName(n,"dnd_target");miwtdnd.setupDropTarget(n);}}
if(!!/\bmiwt_highlight\b/.exec(node.className)){var highlight=$(node.id+"_highlight");var modification=$(node.id+"_modification");if(!highlight||!modification)
return;var highlightColor=highlight.firstChild.data;var modificationColor=modification.firstChild.data;var trs=$A(node.getElementsByTagName('tr'));var node2;for(var i=0;node2=trs[i];i++){if(node2.parentNode.parentNode!=node)
continue;if(node2.parentNode.tagName.toLowerCase()=="thead")
continue;node2.highlightColor=highlightColor;node2.modificationColor=modificationColor;miwt.observe(node2,'mouseover',miwt.tableRowOnMouseOver,false);miwt.observe(node2,'mouseout',miwt.tableRowOnMouseOut,false);if(!modificationColor)
continue;var inputs=$A(node2.getElementsByTagName('input'));inputs.concat(node2.getElementsByTagName('select'));var rownode;for(var j=0;rownode=inputs[j];j++){if(rownode.className&&rownode.className.match(/miwt_row_select/))
continue;rownode.modificationColor=modificationColor;rownode.observer=new Form.Element.EventObserver(rownode,miwt.tableRowModification);}}}});}
if(typeof miwtdnd=='undefined'){var miwtdnd={};miwtdnd.active=false;miwtdnd.dragSource=null;miwtdnd.dropTarget=null;miwtdnd.feedbackElement=null;miwtdnd.dropactiveset=false;miwtdnd.window_mousemove=function(evt){if(!miwtdnd.dragSource)
return;if(!miwtdnd.active){if(Math.abs(Event.pointerX(evt) -miwtdnd.startX)>2||Math.abs(Event.pointerY(evt) -miwtdnd.startY)>2){Event.stop(evt);miwtdnd.active=true;if(miwtdnd.menu){miwtdnd.menu.parentNode.removeChild(miwtdnd.menu);miwtdnd.menu=null;}
Element.addClassName(document.body,'dnd_active');var ie6=(Prototype.Browser.IE&&navigator.userAgent.indexOf('MSIE 6')> -1);var ie7=(Prototype.Browser.IE&&navigator.userAgent.indexOf('MSIE 7')> -1);miwtdnd.feedbackElement=miwtdnd.dragSource.cloneNode(true);if(ie6||ie7){if(miwtdnd.feedbackElement.tagName.toLowerCase()=='td'){miwtdnd.feedbackElement=Element.wrap(miwtdnd.feedbackElement,'tr');miwtdnd.feedbackElement.style.className=miwtdnd.dragSource.style.className;miwtdnd.feedbackElement=Element.wrap(miwtdnd.feedbackElement,'table');miwtdnd.feedbackElement.style.className=miwtdnd.dragSource.parentNode.style.className;}
else if(miwtdnd.feedbackElement.tagName.toLowerCase()=='tr'){miwtdnd.feedbackElement=Element.wrap(miwtdnd.feedbackElement,'table');miwtdnd.feedbackElement.style.className=miwtdnd.dragSource.style.className;}
miwtdnd.feedbackElement.style.position='absolute';}else{miwtdnd.feedbackElement.style.position='fixed';}
miwtdnd.feedbackElement.style.display='block';miwtdnd.feedbackElement.style.margin='0px';miwtdnd.feedbackElement.style.padding='0px';miwtdnd.feedbackElement.style.zIndex='999999';miwtdnd.feedbackElement.style.right='';miwtdnd.feedbackElement.style.bottom='';{miwtdnd.feedbackElement.removeAttribute("id");var node,nodes=miwtdnd.feedbackElement.getElementsByTagName('*');for(var i=0;node=nodes.item(i); ++i){node.removeAttribute("id");}}
Element.removeClassName(miwtdnd.feedbackElement,"dnd_target");Element.removeClassName(miwtdnd.feedbackElement,"dnd_source");Element.addClassName(miwtdnd.feedbackElement,"dnd_feedback");miwtdnd.feedbackOffsetLeft=5;miwtdnd.feedbackOffsetTop=5;miwtdnd.feedbackElement.style.width=miwtdnd.dragSource.offsetWidth+"px";miwtdnd.feedbackElement.style.height=miwtdnd.dragSource.offsetHeight+"px";if(ie6||ie7)
document.body.appendChild(miwtdnd.feedbackElement);else
miwtdnd.dragSource.parentNode.appendChild(miwtdnd.feedbackElement);miwt.observe(document,"keydown",miwtdnd.window_escape,true);}}
else{Event.stop(evt);}
if(miwtdnd.feedbackElement){var scrollOffsets;if(miwtdnd.feedbackElement.style.position=='absolute'){scrollOffsets={left:0,top:0};}
else{scrollOffsets=document.viewport.getScrollOffsets();}
miwtdnd.feedbackElement.style.left=(Event.pointerX(evt)-scrollOffsets.left+miwtdnd.feedbackOffsetLeft)+"px";miwtdnd.feedbackElement.style.top=(Event.pointerY(evt)-scrollOffsets.top+miwtdnd.feedbackOffsetTop)+"px";}
var dropEl=Event.element(evt);if(dropEl==miwtdnd.feedbackElement)
return;while(dropEl&&(!dropEl.className||!/\bdnd_target\b/.test(dropEl.className)))
dropEl=dropEl.parentNode;if(dropEl&&!/\bdnd_target\b/.test(dropEl.className))
dropEl=null;if(!miwtdnd.isCompatible(miwtdnd.dragSource,dropEl))
dropEl=null;var addStyles=['dnd_target_active'];var removeStyles=[];if(dropEl&&dropEl.locations&&dropEl.locationRows&&dropEl.locationColumns){var targetOffset=Element.cumulativeOffset(dropEl);var targetDim=Element.getDimensions(dropEl);var row=Math.floor((Event.pointerY(evt) -targetOffset.top)/Math.max(1,targetDim.height/dropEl.locationRows));var col=Math.floor((Event.pointerX(evt) -targetOffset.left)/Math.max(1,targetDim.width/dropEl.locationColumns));if(row<0)
row=0;else if(row>=dropEl.locationRows)
row=dropEl.locationRows-1;if(col<0)
col=0;else if(col>=dropEl.locationColumns)
col=dropEl.locationColumns-1;var dropClass=dropEl.locations[row+","+col];if(dropClass){addStyles.push(dropClass);removeStyles=dropEl.allClassNames.without(dropClass);}else{removeStyles=dropEl.allClassNames.clone();}}
if(miwtdnd.dropactiveset){var el,list;list=$$(".dnd_target_active");while(el=list.pop()){if(el!=dropEl)
el.className=el.className.replace(/\bdnd_target_active\S*\b/g,' ').strip();}}
miwtdnd.dropactiveset=false;if(dropEl&&dropEl.className){var el;while((el=addStyles.pop())){if(!new RegExp('\b'+el+'\b').test(dropEl.className)){Element.addClassName(dropEl,el);}}
while((el=removeStyles.pop())){Element.removeClassName(dropEl,el);}
miwtdnd.dropactiveset=true;}};miwtdnd.window_mouseup=function(evt){miwt.stopObserving(document,"mousemove",miwtdnd.window_mousemove,true);miwt.stopObserving(document,"mouseup",miwtdnd.window_mouseup,true);Element.removeClassName(document.body,'dnd_active');window.setTimeout(miwtdnd.stopOperation,10);};miwtdnd.window_escape=function(evt){var keycode=evt.keyCode||evt.which;if(keycode!=27)
return;Event.stop(evt);miwtdnd.stopOperation();if(miwtdnd.menu){miwtdnd.menu.form.ResetTransient();miwtdnd.menu.parentNode.removeChild(miwtdnd.menu);miwtdnd.menu=null;}
miwt.stopObserving(document,"keydown",miwtdnd.window_escape,true);};miwtdnd.stopOperation=function(){if(miwtdnd.dropOpPending)
return;miwtdnd.active=false;miwtdnd.dragSource=null;miwtdnd.dropTarget=null;miwtdnd.startX=null;miwtdnd.startY=null;if(miwtdnd.feedbackElement){Element.remove(miwtdnd.feedbackElement);miwtdnd.feedbackElement=null;}
if(miwtdnd.dropactiveset){var el,list;list=$$(".dnd_target_active");while(el=list.pop()){el.className=el.className.replace(/\bdnd_target_active\S*\b/g,' ').strip();}
miwtdnd.dropactiveset=false;}};miwtdnd.dragSource_mousedown=function(evt,drag){var src=Event.element(evt);if(src&&(tag_name=src.tagName.toUpperCase())&&(tag_name=='INPUT'||tag_name=='SELECT'||tag_name=='OPTION'||tag_name=='BUTTON'||tag_name=='TEXTAREA'))return;miwtdnd.dragSource=drag||src;miwtdnd.startX=Event.pointerX(evt);miwtdnd.startY=Event.pointerY(evt);Event.stop(evt);miwt.observe(document,"mousemove",miwtdnd.window_mousemove,true);miwt.observe(document,"mouseup",miwtdnd.window_mouseup,true);};miwtdnd.setupDragSource=function(node,contentTypes){var drag=node;drag.provides=contentTypes||[];Element.addClassName(drag,"dnd_source");miwt.observe(node,"mousedown",function(evt){miwtdnd.dragSource_mousedown(evt||window.event,drag)},true);};miwtdnd.dropTarget_mouseup=function(evt,drop){if(!miwtdnd.active)
return;var eventel=Event.element(evt);while(eventel&&!Element.hasClassName(eventel,"dnd_target"))
eventel=eventel.parentNode;drop=eventel||drop;if(!miwtdnd.isCompatible(miwtdnd.dragSource,drop))
return;if(miwtdnd.dropTarget){var el=miwtdnd.dropTarget;while(el){if(drop==el){return;}
el=el.parentNode;}}
miwtdnd.dropTarget=drop;if(miwtdnd.dropTimer){clearTimeout(miwtdnd.dropTimer);miwtdnd.dropTimer=null;}
miwtdnd.dropOpPending=true;var form=Event.findElement(evt,'form');var x=Event.pointerX(evt);var y=Event.pointerY(evt);miwtdnd.dropTimer=setTimeout(function(){miwtdnd.handleDropTargetActivate(drop,form,x,y);},10);};miwtdnd.handleDropTargetActivate=function(drop,form,x,y){miwtdnd.active=false;if(miwtdnd.dropTimer){clearTimeout(miwtdnd.dropTimer);miwtdnd.dropTimer=null;}
if(form){form.elements['dnd_source'].value=miwtdnd.dragSource.id;form.elements['dnd_target'].value=miwtdnd.dropTarget.id;var left,top,dropDim,dropOffset,scrollOffset,docOffset;docOffset=Element.viewportOffset(document.body);scrollOffset=Element.cumulativeScrollOffset(miwtdnd.dropTarget);dropOffset=Element.cumulativeOffset(miwtdnd.dropTarget);dropDim=Element.getDimensions(miwtdnd.dropTarget);left=dropOffset.left -(scrollOffset.left +docOffset.left);top=dropOffset.top -(scrollOffset.top +docOffset.top);form.elements['dnd_location'].value="("+left+","+top+","+dropDim.width+","+dropDim.height+"),("+x+","+y+")";miwtdnd.dropOpPending=false;miwtdnd.stopOperation();if(drop.hasOptions){miwtdnd.menu=document.createElement("div");miwtdnd.menu.form=form;miwtdnd.menu.className="dropoptions";miwtdnd.menu.style.position='absolute';miwtdnd.menu.style.top=y+"px";miwtdnd.menu.style.left=x+"px";document.getElementsByTagName("body")[0].appendChild(miwtdnd.menu);miwtdnd.menu.innerHTML='<div class="loading">Loading...</div>';new Ajax.Request(Element.select(form,"dfn.ajax_uri").pop().firstChild.data,{method:'get',parameters:{ajax:'true',alt:'dropoptions',dnd_source:form.elements['dnd_source'].value,dnd_target:form.elements['dnd_target'].value},onSuccess:function(transport){try{var tmpnode=document.createElement("div");tmpnode.innerHTML=transport.responseText;miwtdnd.menu.removeChild(miwtdnd.menu.firstChild);miwtdnd.menu.appendChild(tmpnode.firstChild);var el,list,count=0;list=Element.select(miwtdnd.menu,"a");while(el=list.pop()){count++;el.dndoption=el.href.substring(el.href.indexOf("#")+1);el.href='#';el.onclick=function(evt){Event.stop(evt);miwtdnd.menu.parentNode.removeChild(miwtdnd.menu);miwtdnd.menu=null;form.elements['dnd_option'].value=this.dndoption;miwt.stopObserving(document,"keydown",miwtdnd.window_escape,true);try{this.onclick=null;}catch(e){}
form.MIWTSubmit();};}
if(count==0)
{miwtdnd.menu.parentNode.removeChild(miwtdnd.menu);miwtdnd.menu=null;miwt.stopObserving(document,"keydown",miwtdnd.window_escape,true);form.MIWTSubmit();}}
catch(e){log4js.logger.info("drop options",e);}},onFailure:function(){miwt.stopObserving(document,"keydown",miwtdnd.window_escape,true);form.MIWTSubmit();},onException:function(){miwt.stopObserving(document,"keydown",miwtdnd.window_escape,true);form.MIWTSubmit();}});}
else{miwt.stopObserving(document,"keydown",miwtdnd.window_escape,true);form.MIWTSubmit();}}else{miwtdnd.dropOpPending=false;miwtdnd.stopOperation();}};miwtdnd.setupDropTarget=function(node,hasOptions,contentTypes,locations){var drop=node;drop.accepts=contentTypes||[];drop.hasOptions=!!hasOptions;Element.addClassName(drop,"dnd_target");drop.locations=[];drop.allClassNames=[];drop.locationRows=1;drop.locationColumns=1;if(locations&&locations.length>0){var dim=/(\d+)X(\d+)/.exec(locations[0]);drop.locationRows=dim[1];drop.locationColumns=dim[2];for(var i=1,cells,className;(cells=locations[i++])&&(className=locations[i++]);){className="dnd_target_active_" +className;drop.allClassNames.push(className);var values=cells.match(/\d+/g);for(var r,c;(r=values.shift())&&(c=values.shift());){drop.locations[r+","+c]=className;}}
drop.allClassNames=drop.allClassNames.uniq();}
miwt.observe(node,"mouseup",function(evt){miwtdnd.dropTarget_mouseup(evt,drop)},true);};miwtdnd.isCompatible=function(dragSource,dropTarget){if(dragSource==null)
return false;if(dropTarget==null)
return false;if(dragSource.provides.length==0)
return true;if(dropTarget.accepts.length==0)
return true;var common=dropTarget.accepts.intersect(dragSource.provides);return(common.length>0);};miwt.AddSetupHandler(['dfn'],function(tag,node)
{if(/\bdnd_source_def\b/.exec(node.className)){var a=$w(node.firstChild.data);miwtdnd.setupDragSource($(a.shift()),a);}
if(/\bdnd_target_def\b/.exec(node.className)){var a=$w(node.firstChild.data);var drop=$(a.shift());var hasOptions=!/nodropoptions/.test(a.shift());var contentTypes=[];var locations=[];for(var el;el=a.shift();){if(locations.length>0||/\d+X\d+/.test(el))
locations.push(el);else
contentTypes.push(el);}
miwtdnd.setupDropTarget(drop,hasOptions,contentTypes,locations);}});}
if(typeof miwtcalendar=='undefined'){miwtcalendar={};miwt.calendarClearHandler=function(evt){var node=Event.element(evt).node;node.value='';if(/\bmiwt_submit\b/.exec(node.className))
miwt.calendarUpdateSubmit(node);else
miwt.calendarUpdateNoSubmit(node);}
miwt.calendarUpdateSubmit=function(node){if(this&&this.target){node=$(this.target);}
if(!node)return;var form=node.form;form.elements['btnhit'].value=node.name||node.id;node.hinttexton=false;node.style.color=null;form.MIWTSubmit();}
miwt.calendarUpdateNoSubmit=function(node){if(this&&this.target){node=$(this.target);}
if(!node)return;node.hinttexton=false;node.style.color=null;}
miwt.AddSetupHandler(['input'],function(tag,node){if(!/\bmiwt_calendar\b/.exec(node.className))
return;var submit=/\bmiwt_submit\b/.exec(node.className);var form=node.form;var yearstart=$(node.id+'_yearstart');var yearend=$(node.id+'_yearend');var yearrange=null;if(yearstart&&yearend)
yearrange=[parseInt(yearstart.firstChild.data),parseInt(yearend.firstChild.data)];else
yearrange=[1900,2999];var updateFunction=(submit)?(miwt.calendarUpdateSubmit.bind({target:node.id})):(miwt.calendarUpdateNoSubmit.bind({target:node.id}));var clearbutton=$(node.id+"_clear");if(clearbutton){clearbutton.node=node;miwt.observe(clearbutton,"click",miwt.calendarClearHandler);}
try
{var openbutton=$(node.id+"_open");if(openbutton){Calendar.setup({inputField:node.id,button:openbutton,ifFormat:$(node.id+'_format').firstChild.data,range:yearrange,showOthers:true,showsTime:($(node.id+'_time')!=null),onUpdate:updateFunction,timeFormat:"12",cache:true});}}
catch(e){log4js.logger.error("Cannot init calendar, check your classpath",e);}});}
if(typeof miwt.list=='undefined'){miwt.list=new Object();miwt.list.inputclick=function(evt){var input=Event.element(evt);var element=input.parentNode;if(input.checked){if(input.type=='radio'){var el,list=Element.select(input.parentNode.parentNode,".checked");while(el=list.pop())
Element.removeClassName(el,"checked");}
Element.addClassName(element,"checked");}else{Element.removeClassName(element,"checked");}}
miwt.list.elementclick=function(evt){var element=Event.element(evt);var input=Element.select(element,"input.selector").pop();if(!input)
return;input.click();}
miwt.AddSetupHandler(['input'],function(tag,node){var element=node.parentNode;var richlist=element.parentNode;if(!/\belement\b/.exec(element.className))
return;if(!/\brichlist\b/.exec(richlist.className))
return;miwt.observe(node,'click',miwt.list.inputclick);miwt.observe(element,'click',miwt.list.elementclick);});}
/*  JS Resource: lib/jscalendar/calendar_stripped.js  */

Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getCumulativeOffset=function(el){var valueT=0,valueL=0;do{valueT+=el.offsetTop||0;valueL+=el.offsetLeft||0;el=el.offsetParent;}while(el);return{left:valueL,top:valueT};};Calendar.getAbsolutePos=function(el){if(document.defaultView&&document.defaultView.getComputedStyle){var r={x:parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("left")),y:parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("top"))};if(!isNaN(r.x)&&!isNaN(r.y))return r;}else if(el.currentStyle){var r={x:parseInt(el.currentStyle["left"]),y:parseInt(el.currentStyle["top"])};if(!isNaN(r.x)&&!isNaN(r.y))return r;}var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var co=Calendar.getCumulativeOffset(el);var r={x:co.left-SL,y:co.top-ST};return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&#160;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML="&#160;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++y<cal.ar_days.length)ne=cal.ar_days[y][x];else{nextMonth();setVars();}break;}break;}if(ne){if(!ne.disabled)Calendar.cellClick(ne);else if(prev)prevMonth();else nextMonth();}}break;case 13:if(act)Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&#160;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var br;if(window.innerWidth&&window.innerWidth>0){br={x:window.innerWidth,y:window.innerHeight};}else if(document.documentElement&&document.documentElement.clientWidth>0){br={x:document.documentElement.clientWidth,y:document.documentElement.clientHeight};}else if(document.body.clientWidth&&document.body.clientWidth>0){br={x:document.body.clientWidth,y:document.body.clientHeight};}else{var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);}if(Calendar.is_ie){var docEl=document.documentElement?document.documentElement:document.body;br.y+=docEl.scrollTop;br.x+=docEl.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case"T":p.y-=h;break;case"B":p.y+=el.offsetHeight;break;case"C":p.y+=(el.offsetHeight-h)/2;break;case"t":p.y+=el.offsetHeight-h;break;case"b":break;}switch(halign){case"L":p.x-=w;break;case"R":p.x+=el.offsetWidth;break;case"C":p.x+=(el.offsetWidth-w)/2;break;case"l":p.x+=el.offsetWidth-w;break;case"r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();if(this.isPopup){var tmp=el;var zindex=0;try{while(tmp!=null){if(tmp.style&&tmp.style.zIndex){var zval=parseInt(tmp.style.zIndex);if(zval>zindex)zindex=zval;}tmp=tmp.parentNode;}if(zindex>0){self.element.style.zIndex=zindex;}}catch(e){if(typeof log4js!='undefined'){log4js.logger.error("Unable to get zIndex.",e);}}}};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(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.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])continue;switch(b[i]){case"%d":case"%e":d=parseInt(a[i],10);break;case"%m":m=parseInt(a[i],10)-1;break;case"%Y":case"%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case"%b":case"%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case"%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;
/*  JS Resource: lib/jscalendar/calendar-setup_stripped.js  */

Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};
/*  JS Resource: lib/jscalendar/lang/calendar-en.js  */

Calendar._DN=new Array
("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array
("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array
("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT["INFO"]="About the calendar";Calendar._TT["ABOUT"]="DHTML Date/Time Selector\n" +"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +"\n\n" +"Date selection:\n" +"- Use the \xab, \xbb buttons to select year\n" +"- Use the " +String.fromCharCode(0x2039) +", " +String.fromCharCode(0x203a) +" buttons to select month\n" +"- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT["ABOUT_TIME"]="\n\n" +"Time 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.";Calendar._TT["PREV_YEAR"]="Prev. year (hold for menu)";Calendar._TT["PREV_MONTH"]="Prev. month (hold for menu)";Calendar._TT["GO_TODAY"]="Go Today";Calendar._TT["NEXT_MONTH"]="Next month (hold for menu)";Calendar._TT["NEXT_YEAR"]="Next year (hold for menu)";Calendar._TT["SEL_DATE"]="Select date";Calendar._TT["DRAG_TO_MOVE"]="Drag to move";Calendar._TT["PART_TODAY"]=" (today)";Calendar._TT["DAY_FIRST"]="Display %s first";Calendar._TT["WEEKEND"]="0,6";Calendar._TT["CLOSE"]="Close";Calendar._TT["TODAY"]="Today";Calendar._TT["TIME_PART"]="(Shift-)Click or drag to change value";Calendar._TT["DEF_DATE_FORMAT"]="%Y-%m-%d";Calendar._TT["TT_DATE_FORMAT"]="%a, %b %e";Calendar._TT["WK"]="wk";Calendar._TT["TIME"]="Time:";
/*  JS Resource: cms/js/bean/articlecontainer.js  */

if(typeof AC!='undefined'){log4js.logger.error("Redefining ArticleContainer library.");}
AC={};AC.getElementsByTagName=function(tagName,start){if(!start){start=document;}
var elements=start.getElementsByTagName(tagName);if(!elements||elements.length===0){elements=start.getElementsByTagName(tagName.toUpperCase());}
return elements;};AC.countWords=function(text){var count=0;if(text){var list=text.split(/\s+/);for(var h=0;h<list.length;h++){if(!(list[h]=='')){count++;}}}
return count;};AC.Article=function(li,wpm){this.article=li;var text="";var components=AC.getElementsByTagName("div",li);for(var el=null,idx=0;(el=components[idx]);idx++){var cn=el.className||"";if(cn.match(/article_heading/)||cn.match(/article_subheading/)||cn.match(/article_teaser/)||cn.match(/article_post_time/)||cn.match(/article_link_read_more/)||cn.match(/article_byline/)||cn.match(/article_content/)){text=text +this.getText(el);}else if(cn!=''){log4js.logger.info("Unexpected component with classname: " +cn);}}
this.wordCount=AC.countWords(text);wpm=wpm||120.0;var t1=(this.wordCount/wpm);t1=Math.ceil(t1*60)*1000;this.minShowTime=t1 +2000;};AC.Article.prototype={getRecommendedInterval:function(){return this.minShowTime;},show:function(cb){var opacity=this.getOpacity();if(this.article.style.display!='block'){opacity=0.0;this.setOpacity(opacity);this.article.style.display='block';}
if(opacity>0.9){if(cb){cb.apply(this);}}else{opacity=opacity +0.1;this.setOpacity(opacity);if(parseInt(opacity*100)!=parseInt(this.getOpacity()*100)){if(cb){cb.apply(this);}}
else
window.setTimeout(i2rd.bind(this.show,this,cb),100);}},hide:function(cb){var opacity=this.getOpacity();if(opacity<0.1){if(cb){cb.apply(this);}}else{opacity=opacity -0.1;this.setOpacity(opacity);if(parseInt(opacity*100)!=parseInt(this.getOpacity()*100)){if(cb){cb.apply(this);}}
else
window.setTimeout(i2rd.bind(this.hide,this,cb),100);}},getText:function(el){if(!el){return el;}
if(typeof el=="string"){return el;}
var str="",children=el.childNodes;var cn,i;for(i=0;(cn=children[i]);i++){switch(cn.nodeType){case 1:str +=this.getText(cn);break;case 3:if(cn.nodeValue){str +=cn.nodeValue;}else if(str.length>0&&str[str.length -1]!=""){str +=" ";}
break;}}
return str;},setOpacity:function(value){if(value>=1){value=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera){this.article.style.filter=this.article.style.filter.replace(/alpha\([^\)]*\)/gi,'');}}else{if(value<0.00001)value=0;if(/MSIE/.test(navigator.userAgent)&&!window.opera){this.article.style.filter=this.article.style.filter.replace(/alpha\([^\)]*\)/gi,'') +'alpha(opacity='+parseInt(value*100) +')';}}
this.article.style.opacity=value;},getOpacity:function(){var value=this.article.style.opacity;if(this.article.style.filter){value=/alpha\(opacity=([^\)]+)\)/gi.exec((this.article.style.filter||''));if(value&&value[1]){value=parseFloat(value[1])/100.0;}}
if(value)return parseFloat(value);return this.article.style.filter?100:1.0;}};AC.RotatingHeadline=function(ol){this.container=ol;var articleContainer=ol.parentNode;while(articleContainer&&(articleContainer.className||"").toLowerCase().indexOf('articlecontainer')== -1){articleContainer=articleContainer.parentNode;}
if(!articleContainer){log4js.logger.error("Unable to find article container.");return;}
var article,idx,el,lis=AC.getElementsByTagName("var",articleContainer),wpm=95.0;for(el=null,idx=0;(el=lis[idx]);idx++){if(el.className=="wpm"){wpm=parseFloat(el.innerHTML+"");}}
this.containerId=articleContainer.id;this.articles=[];this.paused=false;lis=AC.getElementsByTagName("li",ol);if(lis.length<=1){return;}
for(el=null,idx=0;(el=lis[idx]);idx++){article=new AC.Article(el,wpm);this.articles[this.articles.length]=article;article.article.style.display='none';}
this.currentIdx=0;i2rd.addEvent(ol,"mouseover",i2rd.bind(this.pause,this));i2rd.addEvent(ol,"mouseout",i2rd.bind(this.start,this));var startIdx=0;if(this.containerId){var articleId=i2rd.getCookie(this.containerId +"-la");for(var el=null,idx=0;(el=lis[idx]);idx++){var article=this.articles[idx];if(article.article.id==articleId){startIdx=idx;break;}}}
this.currentArticle=this.articles[startIdx];this.currentIdx=startIdx;this.currentArticle.show();window.setTimeout(i2rd.bind(this.showNextArticle,this),this.currentArticle.getRecommendedInterval());};AC.RotatingHeadline.prototype={pause:function(){this.paused=true;},start:function(){this.paused=false;},showNextArticle:function(){if(this.paused){window.setTimeout(i2rd.bind(this.showNextArticle,this),750);return;}
this.prevArticle=null;this.currentIdx++;if(this.currentIdx>=this.articles.length)this.currentIdx=0;if(this.currentIdx==0)this.prevArticle=this.articles[this.articles.length -1];else this.prevArticle=this.articles[this.currentIdx -1];this.currentArticle=this.articles[this.currentIdx];this.prevArticle.hide(i2rd.bind(this.showNext,this));if(this.containerId){var time=new Date();time.setHours(time.getHours() +48);i2rd.setCookie(this.containerId +"-la",this.currentArticle.article.id,time);}},showNext:function(nextFunc){if(this.prevArticle)
this.prevArticle.article.style.display='none';this.currentArticle.show(i2rd.bind(this.startTimer,this));},startTimer:function(){window.setTimeout(i2rd.bind(this.showNextArticle,this),this.currentArticle.getRecommendedInterval());}};AC.init=function(evt){var lists=AC.getElementsByTagName("ol");for(var el=null,idx=0;(el=lists[idx]);idx++){var cn=el.className||"";if(cn.match(/ac_style_rotating_headline/)){new AC.RotatingHeadline(el);}}};i2rd.addEvent(window,'load',AC.init);
/*  JS Resource: cms/js/file-loading.js  */

function disableImgLoading(evt){var i,ib,el,l=document.getElementsByTagName("img");for(i=0,ib=l.length;i<ib;i++){el=l[i];if(el.className&&el.className.match(/file_preview/)){el.style.backgroundImage="none";}}}
if(window.addEventListener){window.addEventListener("load",disableImgLoading,true);}else if(window.attachEvent){window.attachEvent("onload",disableImgLoading,true);}
/*  JS Resource: cms/js/bean/pa_carousel.js  */

if(typeof pa_carousel_inited=='undefined'){var pa_carousel_inited=true;var counter=0;PACarousel=function(photo,caption,ol,tn_w,tn_h,ap,an){this.ol=ol;this.ie=!!(window.attachEvent&&!window.opera);this.photo=photo;this.caption=caption;this.tnWidth=tn_w;this.tnHeight=tn_h;this.ap=ap;this.an=an;this.nextFunc=this.next.bindAsEventListener(this);this.prevFunc=this.prev.bindAsEventListener(this);try{Element.cleanWhitespace(this.ol);}catch(e){}
this.initPA();};PACarousel.prototype={isDisplayed:function(el){if(el.style&&el.style.display=="none")return false;if(el.parentNode)return this.isDisplayed(el.parentNode);return true;},initPA:function(){if(!this.isDisplayed(this.ol)){this.ol.style.visibility="hidden";window.setTimeout(this.initPA.bind(this),1000);return;}else{this.ol.style.visibility="visible";}
if(this.tnHeight==0||this.tnWidth==0){var dim=Element.getDimensions(this.getTNs()[0]);this.tnHeight=dim.height;this.tnWidth=dim.width;}
var olw=Element.getWidth(this.ol.parentNode) -Element.getWidth(this.ap) -Element.getWidth(this.an);olw -=(olw%this.tnWidth);var vc=parseInt(olw/this.tnWidth);Element.setStyle(this.ol,{height:this.tnHeight +"px",width:olw +"px",overflow:'hidden'},true);this.ap.className +=" disabled";var i,ib,el,tns=this.getTNs();if(vc<tns.length){this.an.onclick=this.nextStart.bindAsEventListener(this);this.ap.onclick=this.prevStart.bindAsEventListener(this);}else{this.an.style.visibility="hidden";}
var uif=this.updateImg.bindAsEventListener(this);this.updateImg(null,tns[0]);for(i=0,ib=tns.length;i<ib;i++){el=tns[i];el.id="p_" +(counter++);Event.observe(el,"click",uif,false);if((i+1)>vc){el.style.display="none";}
else el.style.display="block";el.style.overflow='hidden';}},getTNs:function(){return Element.select(this.ol,"li.thumbnail");},getChangingTNs:function(forward){var el,prev,next,vc,i,ib,list=this.getTNs();vc=parseInt(Element.getDimensions(this.ol).width/this.tnWidth);for(i=0,ib=list.length;i<ib;i++){el=list[i];if(el.style.display=='none'){continue;}
if(forward){prev=el;next=(i+vc<ib)?list[i+vc]:null;}else{prev=(i>0)?list[i-1]:null;next=(i+vc<ib)?list[i+vc-1]:null;}
break;}
return{prev:prev,next:next};},nextStart:function(){if(this.els){return;}
this.ap.className=this.ap.className.replace("disabled","");this.els=this.getChangingTNs(true);if(!(this.els.next&&this.els.prev)){this.els=null;return;}
this.els.next.style.width='0px';this.els.next.style.display='block';window.setTimeout(this.nextFunc,10);},next:function(){try{var ps=this.els.prev.style;var ns=this.els.next.style;var cd=parseInt(ps.marginLeft?ps.marginLeft.replace('px',''):0);if(Math.abs(cd)>=this.tnWidth){this.nextStop();}
else{var v=parseInt(Math.pow(this.tnWidth +cd,0.5));cd-=v;ps.marginLeft=cd+'px';ns.width=Math.abs(cd) +'px';window.setTimeout(this.nextFunc,15);}}catch(e){this.els=null;}},nextStop:function(){if(this.getTNs().pop()===this.els.next){this.an.className+=" disabled";}
this.els.prev.style.display='none';this.els=null;},prevStart:function(){if(this.els){return;}
this.els=this.getChangingTNs(false);if(!(this.els.prev)){this.els=null;return;}
this.els.prev.style.display='block';window.setTimeout(this.prevFunc,10);},prev:function(){try{var ps=this.els.prev.style;var ns=(this.els.next?this.els.next.style:null);var cd=parseInt(ps.marginLeft?ps.marginLeft.replace('px',''):-this.tnWidth);if(cd>=0){;this.prevStop();}
else{var v=parseInt(Math.pow(Math.abs(cd),0.5));cd+=v
ps.marginLeft=cd+'px';if(ns){ns.width=Math.abs(cd) +'px'};window.setTimeout(this.prevFunc,15);}}catch(e){this.els=null;}},prevStop:function(){this.an.className=this.an.className.replace("disabled","");if(this.getTNs()[0]===this.els.prev){this.ap.className +=" disabled";}
this.els.prev.style.marginLeft='0px';var ns=(this.els.next?this.els.next.style:null);if(ns){ns.display='none';ns.width=this.tnWidth+'px';}
this.els=null;},getConfig:function(tn){var el,config={},codes=Element.select(tn,"code");while((el=codes.pop())){if(el.className&&el.firstChild){config[el.className]=el.firstChild.nodeValue;}}
return config;},clear:function(el){while(el.firstChild){el.removeChild(el.firstChild);}},getTN:function(el){var parent=el;while((parent&&parent.nodeName.toLowerCase()!='li')){parent=parent.parentNode;}
return parent;},updateImg:function(evt,tn){var li=tn||this.getTN(Event.element(evt));var img,dim,config=this.getConfig(li);dim=config.image_dim.split(",");img=new Image();img.src=config.image_url;img.title=config.image_title;img.alt=config.image_title;img.width=dim[0].replace('px','');img.height=dim[1].replace('px','');img.align="middle";var pac=this;var ci=this.photo.getElementsByTagName("img");ci=(ci.length==1?ci[0]:{transition:true})
var interval=window.setInterval(function(){try{if(img.complete){window.clearInterval(interval);pac.clear(pac.photo);pac.photo.appendChild(img);img=pac.photo.childNodes[0];if(pac.ie){img.style.position="absolute";img.style.top="50%";img.style.left="50%";img.style.marginTop="-" +parseInt(parseInt(img.height)/2) +"px";img.style.marginLeft="-" +parseInt(parseInt(img.width)/2) +"px";}
var els=pac.getChangingTNs();var test=li;if(li==els.next){pac.nextStart();}else if(li.previousSibling==els.prev){pac.prevStart();}}else if(!ci.transition){ci.transition=true;pac.clear(pac.photo);Element.update(pac.photo,'<div  style="height: ' +ci.height +'px;" class="image_loading">Loading...</div>');}}catch(e){if(typeof log4js!='undefined')
log4js.logger.error("Error loading image: " +e,e);}},10);this.clear(this.caption);Element.update(this.caption,'<span class="caption">' +config.image_caption +'</span>');var i,ib,tns=this.getTNs();for(i=0,ib=tns.length;i<ib;i++){tns[i].className=tns[i].className.replace("selected","");}
li.className +=" selected";}};pac_getBySel=function(start,sel){var l=Element.select(start,sel);if(!!l&&l.length==1){return l[0];}
else return null;};var pac_timer=false,pac_inited=false;pac_init=function(){if(pac_inited){return;}
pac_inited=true;if(pac_timer){try{clearInterval(pac_timer);}catch(e){}}
var el,list=$$("div.carousel");while((el=list.pop())){var p,c,ol,dim,tnList,ap,an;p=pac_getBySel(el,"div.photo");c=pac_getBySel(el,"div.caption");ol=pac_getBySel(el,"ol");ap=pac_getBySel(el,"span.previous");an=pac_getBySel(el,"span.next");tnList=Element.select(ol,"li.thumbnail");if(tnList.length==0){continue;}
if(!(p&&c&&ol)){continue;}
dim=Element.getDimensions(tnList[0]);new PACarousel(p,c,ol,dim.width,dim.height,ap,an);}
Event.stopObserving(window,'load',pac_init);};try{var ua=navigator.userAgent;if(document.addEventListener&&(ua.match(/Firefox/)||ua.match(/SeaMonkey/))){document.addEventListener("DOMContentLoaded",pac_init,false);}else if(document.attachEvent&&!window.opera){document.write("<script id=__pac_ocl defer " +"src='//:'><\/script>");document.getElementById("__pac_ocl").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;pac_init();}};}else{pac_timer=setInterval(function(){var drs=document.readyState;if((drs&&/complete|loaded/.test(drs))||pac_inited){clearInterval(pac_timer);delete pac_timer;pac_init();}},1);}}catch(e){}
Event.observe(window,'load',pac_init);}
/*  JS Resource: cms/js/bean/sitesearch.js  */

cmsSiteSearchGetForm=function(element){while(element.parentNode&&element.nodeName.toLowerCase()!="form"){element=element.parentNode;}
return element;};evt_Target=function(evt){evt=evt||window.event;return evt.target||evt.srcElement;};cms_ss_OnBlur=function(evt){var t=evt_Target(evt)||this;if(t.value.length==0){t.value=t.origValue||t.value;}};cms_ss_OnFocus=function(evt){var t=evt_Target(evt)||this;if(t.value==t.origValue){t.value="";}};cms_ss_SetRPP=function(evt){var t=evt_Target(evt)||this;t.rpp.value=t.rppvalue;cms_ss_ResetOS(evt);t.rpp.form.submit();};cms_ss_ResetOS=function(evt){var t=evt_Target(evt)||this;if(t.sso){t.sso.value=0;}};cms_ss_Setup=function(){try{var nn,ssq,sso,rpp,f,h,i,el,forms=document.forms;try{if(!forms)forms=document.forms();}catch(e){}
for(h=0;h<forms.length;h++){rpp=null;f=forms[h];for(i=0;i<f.elements.length;i++){el=f.elements[i];nn=(el.nodeName?el.nodeName.toLowerCase():'');if(nn=="input"){if(el.name=="site_search_rpp"){rpp=el;}else if(el.name=="site_search_offset"){sso=el;}else if(el.name=="site_search_query"){ssq=el;ssq.origValue=document.getElementById("site_search_query_default").value;ssq.onfocus=cms_ss_OnFocus;ssq.onblur=cms_ss_OnBlur;ssq.onkeypress=cms_ss_ResetOS;}}}}
if(ssq!=null){ssq.sso=sso;ssq.rpp=rpp;}
if(rpp!=null){var cn,a,anchors=document.anchors;try{if(!anchors)anchors=document.anchors();}catch(e){}
for(i=0;i<anchors.length;i++){a=anchors[i];cn=a.className||'';if(cn.match(/site_search_rpp/)){a.rpp=rpp;a.sso=sso;a.onclick=cms_ss_SetRPP;var idx=a.href.indexOf("#");var n=a.href.substring(idx +1);a.rppvalue=n;a.href="#";}}}}catch(e){if(typeof log4js!='undefined'){log4js.logger.error("Unable to setup sitesearch",e);}}};if(window.attachEvent){window.attachEvent('onload',cms_ss_Setup);}else if(window.addEventListener){window.addEventListener('load',cms_ss_Setup,true);}
if(typeof cms_js_includes != 'undefined') {
 cms.addJSInclude('/resources/dyn/docroot/lib/i2rd-util.js/_fn/i2rd-util.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/bean/MenuBean.js/_fn/MenuBean.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/sizzle.js/_fn/sizzle.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/i2rd-selectors.js/_fn/i2rd-selectors.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/logger.js/_fn/logger.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/cms-contentload.js/_fn/cms-contentload.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/cms-tabcontainer.js/_fn/cms-tabcontainer.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/prototype.js/_fn/prototype.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/miwt/dc_release.js/_fn/dc_release.js');
 cms.addJSInclude('/resources/dyn/docroot/Javascript_%02_%01Path/_fn/cp-resource-path.js');
 cms.addJSInclude('/resources/dyn/docroot/FCKeditor/ckeditor.js/_fn/ckeditor.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/miwt/miwt-lib.js/_fn/miwt-lib.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/jscalendar/calendar_stripped.js/_fn/calendar_stripped.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/jscalendar/calendar-setup_stripped.js/_fn/calendar-setup_stripped.js');
 cms.addJSInclude('/resources/dyn/docroot/lib/jscalendar/lang/calendar-en.js/_fn/calendar-en.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/bean/articlecontainer.js/_fn/articlecontainer.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/file-loading.js/_fn/file-loading.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/bean/pa_carousel.js/_fn/pa_carousel.js');
 cms.addJSInclude('/resources/dyn/docroot/cms/js/bean/sitesearch.js/_fn/sitesearch.js');
}
