
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - jquery.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/jquery.js?original=1
(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init: function(selector,context){var match,elem,ret,doc;if(!selector){return this}
if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}
if(selector==="body"&&!context){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this}
if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true)} else{selector=[doc.createElement(ret[1])]}} else{ret=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes}
return jQuery.merge(this,selector)} else{elem=document.getElementById(match[2]);if(elem){if(elem.id!==match[2]){return rootjQuery.find(selector)}
this.length=1;this[0]=elem}
this.context=document;this.selector=selector;return this}} else if(!context&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector)} else if(!context||context.jquery){return(context||rootjQuery).find(selector)} else{return jQuery(context).find(selector)}} else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector)}
if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}
return jQuery.makeArray(selector,this)},selector:"",jquery:"1.4.2",length:0,size: function(){return this.length},toArray: function(){return slice.call(this,0)},get: function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num])},pushStack: function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems)} else{jQuery.merge(ret,elems)}
ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector} else if(name){ret.selector=this.selector+"."+name+"("+selector+")"}
return ret},each: function(callback,args){return jQuery.each(this,callback,args)},ready: function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery)} else if(readyList){readyList.push(fn)}
return this},eq: function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first: function(){return this.eq(0)},last: function(){return this.eq(-1)},slice: function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","))},map: function(callback){return this.pushStack(jQuery.map(this, function(elem,i){return callback.call(elem,i,elem)}))},end: function(){return this.prevObject||jQuery(null)},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}
if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}}
if(length===i){target=this;--i}
for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}
if(deep&&copy&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy)} else if(copy!==undefined){target[name]=copy}}}}
return target};jQuery.extend({noConflict: function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}
return jQuery},isReady:false,ready: function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13)}
jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery)}
readyList=null}
if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready")}}},bindReady: function(){if(readyBound){return}
readyBound=true;if(document.readyState==="complete"){return jQuery.ready()}
if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false)} else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null} catch(e){}
if(document.documentElement.doScroll&&toplevel){doScrollCheck()}}},isFunction: function(obj){return toString.call(obj)==="[object Function]"},isArray: function(obj){return toString.call(obj)==="[object Array]"},isPlainObject: function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false}
if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false}
var key;for(key in obj){}
return key===undefined||hasOwnProperty.call(obj,key)},isEmptyObject: function(obj){for(var name in obj){return false}
return true},error: function(msg){throw msg},parseJSON: function(data){if(typeof data!=="string"||!data){return null}
data=jQuery.trim(data);if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))()} else{jQuery.error("Invalid JSON: "+data)}},noop: function(){},globalEval: function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))} else{script.text=data}
head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName: function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase()},each: function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break}}} else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}} else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}} else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}
return object},trim: function(text){return(text||"").replace(rtrim,"")},makeArray: function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array)} else{jQuery.merge(ret,array)}}
return ret},inArray: function(elem,array){if(array.indexOf){return array.indexOf(elem)}
for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}
return-1},merge: function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j]}} else{while(second[j]!==undefined){first[i++]=second[j++]}}
first.length=i;return first},grep: function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i])}}
return ret},map: function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value}}
return ret.concat.apply([],ret)},guid:1,proxy: function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined} else if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined}}
if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments)}}
if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++}
return proxy},uaMatch: function(ua){ua=ua.toLowerCase();var match=/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version}
if(jQuery.browser.webkit){jQuery.browser.safari=true}
if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem)}}
rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready()}} else if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready()}}}
function doScrollCheck(){if(jQuery.isReady){return}
try{document.documentElement.doScroll("left")} catch(error){setTimeout(doScrollCheck,1);return}
jQuery.ready()}
function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})} else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}
if(elem.parentNode){elem.parentNode.removeChild(elem)}}
function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value)}
return elems}
if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass)}
return elems}
return length?fn(elems[0],key):undefined}
function now(){return(new Date).getTime()}(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return}
jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,parentNode:div.removeChild(div.appendChild(document.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"))} catch(e){}
root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id]}
try{delete script.test} catch(e){jQuery.support.deleteExpando=false}
root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick", function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click)});div.cloneNode(true).fireEvent("onclick")}
div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';div=null});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function"}
el=null;return isSupported};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},expando:expando,noData:{"embed":true,"object":true,"applet":true},data: function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return}
elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!id&&typeof name==="string"&&data===undefined){return null}
if(!id){id=++uuid}
if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name)} else if(!cache[id]){elem[expando]=id;cache[id]={}}
thisCache=cache[id];if(data!==undefined){thisCache[name]=data}
return typeof name==="string"?thisCache[name]:thisCache},removeData: function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return}
elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem)}}} else{if(jQuery.support.deleteExpando){delete elem[jQuery.expando]} else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando)}
delete cache[id]}}});jQuery.fn.extend({data: function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0])} else if(typeof key==="object"){return this.each(function(){jQuery.data(this,key)})}
var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key)}
return data===undefined&&parts[1]?this.data(parts[0]):data} else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData: function(key){return this.each(function(){jQuery.removeData(this,key)})}});jQuery.extend({queue: function(elem,type,data){if(!elem){return}
type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[]}
if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))} else{q.push(data)}
return q},dequeue: function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift()}
if(fn){if(type==="fx"){queue.unshift("inprogress")}
fn.call(elem, function(){jQuery.dequeue(elem,type)})}}});jQuery.fn.extend({queue: function(type,data){if(typeof type!=="string"){data=type;type="fx"}
if(data===undefined){return jQuery.queue(this[0],type)}
return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue: function(type){return this.each(function(){jQuery.dequeue(this,type)})},delay: function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type, function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type)},time)})},clearQueue: function(type){return this.queue(type||"fx",[])}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr: function(name,value){return access(this,name,value,true,jQuery.attr)},removeAttr: function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name)}})},addClass: function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")))})}
if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value} else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c]}}
elem.className=jQuery.trim(setClass)}}}}
return this},removeClass: function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")))})}
if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ")}
elem.className=jQuery.trim(className)} else{elem.className=""}}}}
return this},toggleClass: function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal)})}
return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className)}} else if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className)}
this.className=this.className||value===false?"":jQuery.data(this,"__className__")||""}})},hasClass: function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true}}
return false},val: function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text}
if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null}
for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value}
values.push(value)}}
return values}
if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value}
return(elem.value||"").replace(rreturn,"")}
return undefined}
var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return}
if(isFunction){val=value.call(this,i,self.val())}
if(typeof val==="number"){val+=""}
if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0} else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0});if(!values.length){this.selectedIndex=-1}} else{this.value=val}})}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr: function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}
if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value)}
var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex}}}
if(name in elem&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed")}
elem[name]=value}
if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}
if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}
return elem[name]}
if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value}
return elem.style.cssText}
if(set){elem.setAttribute(name,""+value)}
var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}
return jQuery.style(elem,name,value)}});var rnamespaces=/\.(.*)$/,fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g, function(ch){return "\\"+ch})};jQuery.event={add: function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return}
if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window}
var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler}
if(!handler.guid){handler.guid=jQuery.guid++}
var elemData=jQuery.data(elem);if(!elemData){return}
var events=elemData.events=elemData.events||{},eventHandle=elemData.handle,eventHandle;if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined}}
eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".")} else{namespaces=[];handleObj.namespace=""}
handleObj.type=type;handleObj.guid=handler.guid;var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false)} else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle)}}}
if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}
handlers.push(handleObj);jQuery.event.global[type]=true}
elem=null},global:{},remove: function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return}
var ret,type,fn,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.data(elem),events=elemData&&elemData.events;if(!elemData||!events){return}
if(types&&types.type){handler=types.handler;types=types.type}
if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types)}
return}
types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)")}
eventType=events[type];if(!eventType){continue}
if(!handler){for(var j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1)}}
continue}
special=jQuery.event.special[type]||{};for(var j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1)}
if(special.remove){special.remove.call(elem,handleObj)}}
if(pos!=null){break}}}
if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){removeEvent(elem,type,elemData.handle)}
ret=null;delete events[type]}}
if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null}
delete elemData.events;delete elemData.handle;if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem)}}},trigger: function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true}
if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache, function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)}})}}
if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}
event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event)}
event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data)}
var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false}}} catch(e){}
if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true)} else if(!event.isDefaultPrevented()){var target=event.target,old,isClick=jQuery.nodeName(target,"a")&&type==="click",special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[type]){old=target["on"+type];if(old){target["on"+type]=null}
jQuery.event.triggered=true;target[type]()}} catch(e){}
if(old){target["on"+type]=old}
jQuery.event.triggered=false}}},handle: function(event){var all,handlers,namespaces,namespace,events;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}
var events=jQuery.data(this,"events"),handlers=events[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation()}}
if(event.isImmediatePropagationStopped()){break}}}}
return event.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix: function(event){if(event[expando]){return event}
var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop]}
if(!event.target){event.target=event.srcElement||document}
if(event.target.nodeType===3){event.target=event.target.parentNode}
if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement}
if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}
if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}
if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}
if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}
return event},guid:1E8,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add: function(handleObj){jQuery.event.add(this,handleObj.origType,jQuery.extend({},handleObj,{handler:liveHandler}))},remove: function(handleObj){var remove=true,type=handleObj.origType.replace(rnamespaces,"");jQuery.each(jQuery.data(this,"events").live||[], function(){if(type===this.origType.replace(rnamespaces,"")){remove=false;return false}});if(remove){jQuery.event.remove(this,handleObj.origType,liveHandler)}}},beforeunload:{setup: function(data,namespaces,eventHandle){if(this.setInterval){this.onbeforeunload=eventHandle}
return false},teardown: function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null}}}}};var removeEvent=document.removeEventListener?
function(elem,type,handle){elem.removeEventListener(type,handle,false)}:
function(elem,type,handle){elem.detachEvent("on"+type,handle)};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)}
if(src&&src.type){this.originalEvent=src;this.type=src.type} else{this.type=src}
this.timeStamp=now();this[expando]=true};
function returnFalse(){return false}
function returnTrue(){return true}
jQuery.Event.prototype={preventDefault: function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return}
if(e.preventDefault){e.preventDefault()}
e.returnValue=false},stopPropagation: function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return}
if(e.stopPropagation){e.stopPropagation()}
e.cancelBubble=true},stopImmediatePropagation: function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode}
if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments)}} catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments)};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"}, function(orig,fix){jQuery.event.special[orig]={setup: function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig)},teardown: function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement)}}});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup: function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit", function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments)}});jQuery.event.add(this,"keypress.specialSubmit", function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments)}})} else{return false}},teardown: function(namespaces){jQuery.event.remove(this,".specialSubmit")}}}
if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i,changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked} else if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options, function(elem){return elem.selected}).join("-"):""} else if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex}
return val},testChange=function testChange(e){var elem=e.target,data,val;if(!formElems.test(elem.nodeName)||elem.readOnly){return}
data=jQuery.data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val)}
if(data===undefined||val===data){return}
if(data!=null||val){e.type="change";return jQuery.event.trigger(e,arguments[1],elem)}};jQuery.event.special.change={filters:{focusout:testChange,click: function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e)}},keydown: function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e)}},beforeactivate: function(e){var elem=e.target;jQuery.data(elem,"_change_data",getVal(elem))}},setup: function(data,namespaces){if(this.type==="file"){return false}
for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type])}
return formElems.test(this.nodeName)},teardown: function(namespaces){jQuery.event.remove(this,".specialChange");return formElems.test(this.nodeName)}};changeFilters=jQuery.event.special.change.filters}
function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args)}
if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"}, function(orig,fix){jQuery.event.special[fix]={setup: function(){this.addEventListener(orig,handler,true)},teardown: function(){this.removeEventListener(orig,handler,true)}};
function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e)}})}
jQuery.each(["bind","one"], function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn)}
return this}
if(jQuery.isFunction(data)){fn=data;data=undefined}
var handler=name==="one"?jQuery.proxy(fn, function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments)}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn)} else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data)}}
return this}});jQuery.fn.extend({unbind: function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key])}} else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn)}}
return this},delegate: function(selector,types,data,fn){return this.live(types,data,fn,selector)},undelegate: function(selector,types,fn){if(arguments.length===0){return this.unbind("live")} else{return this.die(types,null,fn,selector)}},trigger: function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler: function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}},toggle: function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++])}
return this.click(jQuery.proxy(fn, function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false}))},hover: function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"], function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(jQuery.isFunction(data)){fn=data;data=undefined}
types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"")}
if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue}
preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces} else{type=(liveMap[type]||type)+namespaces}
if(name==="live"){context.each(function(){jQuery.event.add(this,liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType})})} else{context.unbind(liveConvert(type,selector),fn)}}
return this}});
function liveHandler(event){var stop,elems=[],selectors=[],args=arguments,related,match,handleObj,elem,j,i,l,data,events=jQuery.data(this,"events");if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return}
event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector)} else{live.splice(j--,1)}}
match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j=0;j<live.length;j++){handleObj=live[j];if(match[i].selector===handleObj.selector){elem=match[i].elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){related=jQuery(event.relatedTarget).closest(handleObj.selector)[0]}
if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj})}}}}
for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;if(match.handleObj.origHandler.apply(match.elem,args)===false){stop=false;break}}
return stop}
function liveConvert(type,selector){return "live."+(type&&type!=="*"?type+".":"")+selector.replace(/\./g, "`").replace(/ /g,"&")}
jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error").split(" "), function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)};if(jQuery.attrFn){jQuery.attrFn[name]=true}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload", function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem)} catch(e){}}}})}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});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,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];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){Sizzle.error(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=baseHasDuplicate;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.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);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.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}
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){Sizzle.error(expr)} else{break}}
old=expr}
return curLoop};Sizzle.error=function(msg){throw "Syntax error, unrecognized expression: "+msg};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\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href: function(elem){return elem.getAttribute("href")}},relative:{"+": function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase()}
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.toLowerCase()===part?elem||false:elem===part}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">": function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===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(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();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=part.toLowerCase();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){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+" ").replace(/[\t\n]/g," ").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){return match[1].toLowerCase()},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.toLowerCase()==="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||getText([elem])||"").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} else{Sizzle.error("Syntax error, unrecognized expression: "+name)}},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.toLowerCase()===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);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all,num){return "\\"+(num-0+1)}))}
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)[0].nodeType} 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 a.compareDocumentPosition?-1:1}
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 a.sourceIndex?-1:1}
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 a.ownerDocument?-1:1}
var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}
return ret}}
function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue} else if(elem.nodeType!==8){ret+=getText(elem.childNodes)}}
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})()}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||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){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){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.toLowerCase()===cur){match=elem;break}
elem=elem[dir]}
checkSet[i]=match}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){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){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};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)};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return;window.Sizzle=Sizzle})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements, function(elem,i){return!!qualifier.call(elem,i,elem)===keep})} else if(qualifier.nodeType){return jQuery.grep(elements, function(elem,i){return(elem===qualifier)===keep})} else if(typeof qualifier==="string"){var filtered=jQuery.grep(elements, function(elem){return elem.nodeType===1});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep)} else{qualifier=jQuery.filter(qualifier,filtered)}}
return jQuery.grep(elements, function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep})};jQuery.fn.extend({find: function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break}}}}}
return ret},has: function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true}}})},not: function(selector){return this.pushStack(winnow(this,selector,false),"not",selector)},filter: function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector)},is: function(selector){return!!selector&&jQuery.filter(selector,this).length>0},closest: function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector}}
while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector]}}
cur=cur.parentNode}}
return ret}
var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur}
cur=cur.parentNode}
return null})},index: function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children())}
return jQuery.inArray(elem.jquery?elem[0]:elem,this)},add: function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all))},andSelf: function(){return this.add(this.prevObject)}});
function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11}
jQuery.each({parent: function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents: function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil: function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next: function(elem){return jQuery.nth(elem,2,"nextSibling")},prev: function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll: function(elem){return jQuery.dir(elem,"nextSibling")},prevAll: function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil: function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil: function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children: function(elem){return jQuery.sibling(elem.firstChild)},contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}}, function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until}
if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret)}
ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse()}
return this.pushStack(ret,name,slice.call(arguments).join(","))}});jQuery.extend({filter: function(expr,elems,not){if(not){expr=":not("+expr+")"}
return jQuery.find.matches(expr,elems)},dir: function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur)}
cur=cur[dir]}
return matched},nth: function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break}}
return cur},sibling: function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n)}}
return r}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<script|<object|<embed|<option|<style/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked(html5)
fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">"},wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"]}
jQuery.fn.extend({text: function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()))})}
if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}
return jQuery.text(this)},wrapAll: function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}
if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}
wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild}
return elem}).append(this)}
return this},wrapInner: function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}
return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)} else{self.append(html)}})},wrap: function(html){return this.each(function(){jQuery(this).wrapAll(html)})},unwrap: function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()},append: function(){return this.domManip(arguments,true, function(elem){if(this.nodeType===1){this.appendChild(elem)}})},prepend: function(){return this.domManip(arguments,true, function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild)}})},before: function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false, function(elem){this.parentNode.insertBefore(elem,this)})} else if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments)}},after: function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false, function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})} else if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set}},remove: function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem])}
if(elem.parentNode){elem.parentNode.removeChild(elem)}}}
return this},empty: function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"))}
while(elem.firstChild){elem.removeChild(elem.firstChild)}}
return this},clone: function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}
return jQuery.clean([html.replace(rinlinejQuery,"").replace(/=([^="'>\s]+\/)>/g, '="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0]} else{return this.cloneNode(true)}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"))}
return ret},html: function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null} else if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,fcloseTag);try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value}}} catch(e){this.empty().append(value)}} else if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old)})})} else{this.empty().append(value)}
return this},replaceWith: function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old))})}
if(typeof value!=="string"){value=jQuery(value).detach()}
return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value)} else{jQuery(parent).append(value)}})} else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value)}},detach: function(selector){return this.remove(selector,true)},domManip: function(args,table,callback){var results,first,value=args[0],scripts=[],fragment,parent;if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true)})}
if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback)})}
if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent}} else{results=buildFragment(args,this,scripts)}
fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild} else{first=fragment.firstChild}
if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment)}}
if(scripts.length){jQuery.each(scripts,evalScript)}}
return this;
function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem}}});
function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return}
var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)}}}})}
function buildFragment(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults}}}
if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts)}
if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1}
return{fragment:fragment,cacheable:cacheable}}
jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"}, function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this} else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}
return this.pushStack(ret,name,insert.selector)}}});jQuery.extend({clean: function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}
var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+=""}
if(!elem){continue}
if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem)} else if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild}
if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0 ;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}}
if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild)}
elem=div.childNodes}
if(elem.nodeType){ret.push(elem)} else{ret=jQuery.merge(ret,elem)}}
if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])} else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))}
fragment.appendChild(ret[i])}}}
return ret},cleanData: function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){id=elem[jQuery.expando];if(id){data=cache[id];if(data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type)} else{removeEvent(elem,type,data.handle)}}}
if(deleteExpando){delete elem[jQuery.expando]} else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando)}
delete cache[id]}}}});var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn.css=function(name,value){return access(this,name,value,true, function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name)}
if(typeof value==="number"&&!rexclude.test(name)){value+="px"}
jQuery.style(elem,name,value)})};jQuery.extend({style: function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}
if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined}
var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value * 100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity}
return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":""}
if(rfloat.test(name)){name=styleFloat}
name=name.replace(rdashAlpha,fcamelCase);if(set){style[name]=value}
return style[name]},css: function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;
function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return}
jQuery.each(which, function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0}
if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0} else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0}})}
if(elem.offsetWidth!==0){getWH()} else{jQuery.swap(elem,props,getWH)}
return Math.max(0,Math.round(val))}
return jQuery.curCSS(elem,name,force)},curCSS: function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret}
if(rfloat.test(name)){name=styleFloat}
if(!force&&style&&style[name]){ret=style[name]} else if(getComputedStyle){if(rfloat.test(name)){name="float"}
name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null}
var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name)}
if(name==="opacity"&&ret===""){ret="1"}} else if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}
return ret},swap: function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}
callback.call(elem);for(var name in options){elem.style[name]=old[name]}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none"};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}}
var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,_load=jQuery.fn.load;jQuery.fn.extend({load: function(url,params,callback){if(typeof url!=="string"){return _load.call(this,url)} else if(!this.length){return this}
var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}
var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null} else if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST"}}
var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete: function(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText)}
if(callback){self.each(callback,[res.responseText,status,res])}}});return this},serialize: function(){return jQuery.param(this.serializeArray())},serializeArray: function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val, function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});jQuery.extend({get: function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null}
return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript: function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON: function(url,data,callback){return jQuery.get(url,data,callback,"json")},post: function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={}}
return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup: function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?
function(){return new window.XMLHttpRequest()}:
function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")} catch(e){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax: function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);var jsonp,status,data,callbackContext=origSettings&&origSettings.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}
if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?"}} else if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}
s.dataType="json"}
if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}
s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]|| function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]} catch(e){}
if(head){head.removeChild(script)}}}
if(s.dataType==="script"&&s.cache===null){s.cache=false}
if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"")}
if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data}
if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}
var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}
if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script)}}}}
head.insertBefore(script,head.firstChild);return undefined}
var requestDone=false;var xhr=s.xhr();if(!xhr){return}
if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)} else{xhr.open(type,s.url,s.async)}
try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType)}
if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url])}
if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url])}}
if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest")}
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)} catch(e){}
if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}
xhr.abort();return false}
if(s.global){trigger("ajaxSend",[xhr,s])}
var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){complete()}
requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop}} else if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s)} catch(err){status="parsererror";errMsg=err}}
if(status==="success"||status==="notmodified"){if(!jsonp){success()}} else{jQuery.handleError(s,xhr,status,errMsg)}
complete();if(isTimeout==="timeout"){xhr.abort()}
if(s.async){xhr=null}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr)}
onreadystatechange("abort")}} catch(e){}
if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")}},s.timeout)}
try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null)} catch(e){jQuery.handleError(s,xhr,null,e);complete()}
if(!s.async){onreadystatechange()}
function success(){if(s.success){s.success.call(callbackContext,data,status,xhr)}
if(s.global){trigger("ajaxSuccess",[xhr,s])}}
function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status)}
if(s.global){trigger("ajaxComplete",[xhr,s])}
if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}
function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args)}
return xhr},handleError: function(s,xhr,status,e){if(s.error){s.error.call(s.context||s,xhr,status,e)}
if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess: function(xhr){try{return!xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0} catch(e){}
return false},httpNotModified: function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified}
if(etag){jQuery.etag[url]=etag}
return xhr.status===304||xhr.status===0},httpData: function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror")}
if(s&&s.dataFilter){data=s.dataFilter(data,type)}
if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data)} else if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data)}}
return data},param: function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional}
if(jQuery.isArray(a)||a.jquery){jQuery.each(a, function(){add(this.name,this.value)})} else{for(var prefix in a){buildParams(prefix,a[prefix])}}
return s.join("&").replace(r20,"+");
function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj, function(i,v){if(traditional||/\[\]$/.test(prefix)){add(prefix,v)} else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v)}})} else if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj, function(k,v){buildParams(prefix+"["+k+"]",v)})} else{add(prefix,obj)}}
function add(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)}}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show: function(speed,callback){if(speed||speed===0){return this.animate(genFx("show",3),speed,callback)} else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName]} else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block"}
elem.remove();elemdisplay[nodeName]=display}
jQuery.data(this[i],"olddisplay",display)}}
for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||""}
return this}},hide: function(speed,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,callback)} else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))}}
for(var j=0,k=this.length;j<k;j++){this[j].style.display="none"}
return this}},_toggle:jQuery.fn.toggle,toggle: function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments)} else if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]()})} else{this.animate(genFx("toggle",3),fn,fn2)}
return this},fadeTo: function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback)},animate: function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete)}
return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name}
if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this)}
if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}
if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0]}}
if(opt.overflow!=null){this.style.overflow="hidden"}
opt.curAnim=jQuery.extend({},prop);jQuery.each(prop, function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop)} else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true)) * start;self.style[name]=start+unit}
if(parts[1]){end=((parts[1]==="-="?-1:1) * end)+start}
e.custom(start,end,unit)} else{e.custom(start,val,"")}}});return true})},stop: function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}
this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true)}
timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}
return this}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}}, function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)}});jQuery.extend({speed: function(speed,easing,fn){var opt=speed&&typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}
if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear: function(p,n,firstNum,diff){return firstNum+diff * p},swing: function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5) * diff+firstNum}},timers:[],fx: function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update: function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur: function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}
var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom: function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;
function t(gotoEnd){return self.step(gotoEnd)}
t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13)}},show: function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show()},hide: function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step: function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}
if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block"}}
if(this.options.hide){jQuery(this.elem).hide()}
if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p])}}
this.options.complete.call(this.elem)}
return false} else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start) * this.pos);this.update()}
return true}};jQuery.extend(jQuery.fx,{tick: function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}
if(!timers.length){jQuery.fx.stop()}},stop: function(){clearInterval(timerId);timerId=null},speeds:{slow:600,fast:200,_default:400},step:{opacity: function(fx){jQuery.style(fx.elem,"opacity",fx.now)},_default: function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit} else{fx.elem[fx.prop]=fx.now}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers, function(fn){return elem===fn.elem}).length}}
function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)), function(){obj[this]=type});return obj}
if("getBoundingClientRect" in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}
if(!elem||!elem.ownerDocument){return null}
if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}
var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left}}} else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}
if(!elem||!elem.ownerDocument){return null}
if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}
jQuery.offset.initialize();var offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break}
computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}
prevOffsetParent=offsetParent,offsetParent=elem.offsetParent}
if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}
prevComputedStyle=computedStyle}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft}
if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft)}
return{top:top,left:left}}}
jQuery.offset={initialize: function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.curCSS(body,"marginTop",true))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed",checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop},bodyOffset: function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0}
return{top:top,left:left}},setOffset: function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative"}
var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset)}
var props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using" in options){options.using.call(elem,props)} else{curElem.css(props)}}};jQuery.fn.extend({position: function(){if(!this[0]){return null}
var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}},offsetParent: function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent}
return offsetParent})}});jQuery.each(["Left","Top"], function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null}
if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop())} else{this[method]=val}})} else{win=getWindow(elem);return win?("pageXOffset" in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method]}}});
function getWindow(elem){return("scrollTo" in elem&&elem.document)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false}
jQuery.each(["Height","Width"], function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],type,false,"padding"):null};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,margin?"margin":"border"):null};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this}
if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()))})}
return("scrollTo" in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px")}});window.jQuery=window.$=jQuery})(window);

/* - event-registration.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/event-registration.js?original=1
window.onDOMLoadEvents=new Array();window.DOMContentLoadedInitDone=false;
function addDOMLoadEvent(listener){window.onDOMLoadEvents[window.onDOMLoadEvents.length]=listener}
function DOMContentLoadedInit(){if(window.DOMContentLoadedInitDone) return;window.DOMContentLoadedInitDone=true;var exceptions=new Array();for(var i=0;i<window.onDOMLoadEvents.length;i++){var func=window.onDOMLoadEvents[i];try{func()} catch(e){exceptions[exceptions.length]=e}}
for(var i=0;i<exceptions.length;i++){throw exceptions[i]}}
function DOMContentLoadedScheduler(){if(window.DOMContentLoadedInitDone) return true;if(/KHTML|WebKit/i.test(navigator.userAgent)){if(/loaded|complete/.test(document.readyState)){DOMContentLoadedInit()} else{setTimeout("DOMContentLoadedScheduler()",250)}} else{setTimeout("DOMContentLoadedScheduler()",250)}
return true}
setTimeout("DOMContentLoadedScheduler()",250);if(window.addEventListener){window.addEventListener("load",DOMContentLoadedInit,false);document.addEventListener("DOMContentLoaded",DOMContentLoadedInit,false)} else if(window.attachEvent){window.attachEvent("onload",DOMContentLoadedInit)} else{var _dummy=function(){var $old_onload=window.onload;window.onload=function(e){DOMContentLoadedInit();$old_onload()}}}
/*@cc_on @*/
/*@if (@_win32)
{var proto="src='javascript:void(0)'";if(location.protocol=="https:") proto="src=//0";document.write("<scr"+"ipt id=__ie_onload defer "+proto+"><\/scr"+"ipt>");var script=document.getElementById("__ie_onload");script.onreadystatechange=function(){if(this.readyState=="complete"){DOMContentLoadedInit()}}};/*@end @*/


/* - register_function.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/register_function.js?original=1
var bugRiddenCrashPronePieceOfJunk=(navigator.userAgent.indexOf('MSIE 5')!=-1&&navigator.userAgent.indexOf('Mac')!=-1)
var W3CDOM=(!bugRiddenCrashPronePieceOfJunk&&typeof document.getElementsByTagName!='undefined'&&typeof document.createElement!='undefined');var registerEventListener=null;if(typeof addEvent!='undefined'){registerEventListener=function(elem,event,func){addEvent(elem,event,func);return true}} else if(window.addEventListener){registerEventListener=function(elem,event,func){elem.addEventListener(event,func,false);return true}} else if(window.attachEvent){registerEventListener=function(elem,event,func){var result=elem.attachEvent("on"+event,func);return result}} else{registerEventListener=function(elem,event,func){return false}}
var unRegisterEventListener=null;if(typeof removeEvent!='undefined'){unRegisterEventListener=function(elem,event,func){removeEvent(element,event,func);return true}} else if(window.removeEventListener){unRegisterEventListener=function(elem,event,func){elem.removeEventListener(event,func,false);return true}} else if(window.detachEvent){unRegisterEventListener=function(elem,event,func){var result=elem.detachEvent("on"+event,func);return result}} else{unRegisterEventListener=function(elem,event,func){return false}}
var registerPloneFunction=null;if(typeof addDOMLoadEvent!='undefined'){registerPloneFunction=function(func){addDOMLoadEvent(func)}} else{registerPloneFunction=function(func){registerEventListener(window,"load",func)}}
function getContentArea(){if(W3CDOM){var node=document.getElementById('region-content');if(!node){node=document.getElementById('content')}
return node}}


/* - cssQuery.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/cssQuery.js?original=1
var cssQuery=function(){var version="2.0.2";var $COMMA=/\s*,\s*/;var cssQuery=function($selector,$$from){try{var $match=[];var $useCache=arguments.callee.caching&&!$$from;var $base=($$from)?($$from.constructor==Array)?$$from:[$$from]:[document];var $$selectors=parseSelector($selector).split($COMMA),i;for(i=0;i<$$selectors.length;i++){$selector=_toStream($$selectors[i]);if(isMSIE&&$selector.slice(0,3).join("")==" *#"){$selector=$selector.slice(2);$$from=_msie_selectById([],$base,$selector[1])} else $$from=$base;var j=0,$token,$filter,$arguments,$cacheSelector="";while(j<$selector.length){$token=$selector[j++];$filter=$selector[j++];$cacheSelector+=$token+$filter;$arguments="";if($selector[j]=="("){while($selector[j++]!=")"&&j<$selector.length){$arguments+=$selector[j]}
$arguments=$arguments.slice(0,-1);$cacheSelector+="("+$arguments+")"}
$$from=($useCache&&cache[$cacheSelector])?cache[$cacheSelector]:select($$from,$token,$filter,$arguments);if($useCache) cache[$cacheSelector]=$$from}
$match=$match.concat($$from)}
delete cssQuery.error;return $match} catch($error){cssQuery.error=$error;return []}};cssQuery.toString=function(){return "function cssQuery() {\n  [version "+version+"]\n}"};var cache={};cssQuery.caching=false;cssQuery.clearCache=function($selector){if($selector){$selector=_toStream($selector).join("");delete cache[$selector]} else cache={}};var modules={};var loaded=false;cssQuery.addModule=function($name,$script){if(loaded) eval("$script="+String($script));modules[$name]=new $script()};cssQuery.valueOf=function($code){return $code?eval($code):this};var selectors={};var pseudoClasses={};var AttributeSelector={match:/\[([\w-]+(\|[\w-]+)?)\s*(\W?=)?\s*([^\]]*)\]/};var attributeSelectors=[];selectors[" "]=function($results,$from,$tagName,$namespace){var $element,i,j;for(i=0;i<$from.length;i++){var $subset=getElementsByTagName($from[i],$tagName,$namespace);for(j=0;($element=$subset[j]);j++){if(thisElement($element)&&compareNamespace($element,$namespace))
$results.push($element)}}};selectors["#"]=function($results,$from,$id){var $element,j;for(j=0;($element=$from[j]);j++) if($element.id==$id) $results.push($element)};selectors["."]=function($results,$from,$className){$className=new RegExp("(^|\\s)"+$className+"(\\s|$)");var $element,i;for(i=0;($element=$from[i]);i++)
if($className.test($element.className)) $results.push($element)};selectors[":"]=function($results,$from,$pseudoClass,$arguments){var $test=pseudoClasses[$pseudoClass],$element,i;if($test) for(i=0;($element=$from[i]);i++)
if($test($element,$arguments)) $results.push($element)};pseudoClasses["link"]=function($element){var $document=getDocument($element);if($document.links) for(var i=0;i<$document.links.length;i++){if($document.links[i]==$element) return true}};pseudoClasses["visited"]=function($element){};var thisElement=function($element){return($element&&$element.nodeType==1&&$element.tagName!="!")?$element:null};var previousElementSibling=function($element){while($element&&($element=$element.previousSibling)&&!thisElement($element)) continue;return $element};var nextElementSibling=function($element){while($element&&($element=$element.nextSibling)&&!thisElement($element)) continue;return $element};var firstElementChild=function($element){return thisElement($element.firstChild)||nextElementSibling($element.firstChild)};var lastElementChild=function($element){return thisElement($element.lastChild)||previousElementSibling($element.lastChild)};var childElements=function($element){var $childElements=[];$element=firstElementChild($element);while($element){$childElements.push($element);$element=nextElementSibling($element)}
return $childElements};var isMSIE=true;var isXML=function($element){var $document=getDocument($element);return(typeof $document.mimeType=="unknown")?/\.xml$/i.test($document.URL):Boolean($document.mimeType=="XML Document")};var getDocument=function($element){return $element.ownerDocument||$element.document};var getElementsByTagName=function($element,$tagName){return($tagName=="*"&&$element.all)?$element.all:$element.getElementsByTagName($tagName)};var compareTagName=function($element,$tagName,$namespace){if($tagName=="*") return thisElement($element);if(!compareNamespace($element,$namespace)) return false;if(!isXML($element)) $tagName=$tagName.toUpperCase();return $element.tagName==$tagName};var compareNamespace=function($element,$namespace){return!$namespace||($namespace=="*")||($element.scopeName==$namespace)};var getTextContent=function($element){return $element.innerText};
function _msie_selectById($results,$from,id){var $match,i,j;for(i=0;i<$from.length;i++){if($match=$from[i].all.item(id)){if($match.id==id) $results.push($match);else if($match.length!=null){for(j=0;j<$match.length;j++){if($match[j].id==id) $results.push($match[j])}}}}
return $results};if(![].push) Array.prototype.push=function(){for(var i=0;i<arguments.length;i++){this[this.length]=arguments[i]}
return this.length};var $NAMESPACE=/\|/;
function select($$from,$token,$filter,$arguments){if($NAMESPACE.test($filter)){$filter=$filter.split($NAMESPACE);$arguments=$filter[0];$filter=$filter[1]}
var $results=[];if(selectors[$token]){selectors[$token]($results,$$from,$filter,$arguments)}
return $results};var $STANDARD_SELECT=/^[^\s>+~]/;var $$STREAM=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;
function _toStream($selector){if($STANDARD_SELECT.test($selector)) $selector=" "+$selector;return $selector.match($$STREAM)||[]};var $WHITESPACE=/\s*([\s>+~(),]|^|$)\s*/g;var $IMPLIED_ALL=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var parseSelector=function($selector){return $selector.replace($WHITESPACE,"$1").replace($IMPLIED_ALL,"$1*$2")};var Quote={toString: function(){return "'"},match:/^('[^']*')|("[^"]*")$/,test: function($string){return this.match.test($string)},add: function($string){return this.test($string)?$string:this+$string+this},remove: function($string){return this.test($string)?$string.slice(1,-1):$string}};var getText=function($text){return Quote.remove($text)};var $ESCAPE=/([\/()[\]?{}|*+-])/g;
function regEscape($string){return $string.replace($ESCAPE,"\\$1")};cssQuery.addModule("css-standard", function(){isMSIE=eval("false;/*@cc_on@if(@\x5fwin32)isMSIE=true@end@*/");if(!isMSIE){getElementsByTagName=function($element,$tagName,$namespace){return $namespace?$element.getElementsByTagNameNS("*",$tagName):$element.getElementsByTagName($tagName)};compareNamespace=function($element,$namespace){return!$namespace||($namespace=="*")||($element.prefix==$namespace)};isXML=document.contentType? function($element){return/xml/i.test(getDocument($element).contentType)}: function($element){return getDocument($element).documentElement.tagName!="HTML"};getTextContent=function($element){return $element.textContent||$element.innerText||_getTextContent($element)};
function _getTextContent($element){var $textContent="",$node,i;for(i=0;($node=$element.childNodes[i]);i++){switch($node.nodeType){case 11:case 1:$textContent+=_getTextContent($node);break;case 3:$textContent+=$node.nodeValue;break}}
return $textContent}}});cssQuery.addModule("css-level2", function(){selectors[">"]=function($results,$from,$tagName,$namespace){var $element,i,j;for(i=0;i<$from.length;i++){var $subset=childElements($from[i]);for(j=0;($element=$subset[j]);j++)
if(compareTagName($element,$tagName,$namespace))
$results.push($element)}};selectors["+"]=function($results,$from,$tagName,$namespace){for(var i=0;i<$from.length;i++){var $element=nextElementSibling($from[i]);if($element&&compareTagName($element,$tagName,$namespace))
$results.push($element)}};selectors["@"]=function($results,$from,$attributeSelectorID){var $test=attributeSelectors[$attributeSelectorID].test;var $element,i;for(i=0;($element=$from[i]);i++)
if($test($element)) $results.push($element)};pseudoClasses["first-child"]=function($element){return!previousElementSibling($element)};pseudoClasses["lang"]=function($element,$code){$code=new RegExp("^"+$code,"i");while($element&&!$element.getAttribute("lang")) $element=$element.parentNode;return $element&&$code.test($element.getAttribute("lang"))};AttributeSelector.NS_IE=/\\:/g;AttributeSelector.PREFIX="@";AttributeSelector.tests={};AttributeSelector.replace=function($match,$attribute,$namespace,$compare,$value){var $key=this.PREFIX+$match;if(!attributeSelectors[$key]){$attribute=this.create($attribute,$compare||"",$value||"");attributeSelectors[$key]=$attribute;attributeSelectors.push($attribute)}
return attributeSelectors[$key].id};AttributeSelector.parse=function($selector){$selector=$selector.replace(this.NS_IE,"|");var $match;while($match=$selector.match(this.match)){var $replace=this.replace($match[0],$match[1],$match[2],$match[3],$match[4]);$selector=$selector.replace(this.match,$replace)}
return $selector};AttributeSelector.create=function($propertyName,$test,$value){var $attributeSelector={};$attributeSelector.id=this.PREFIX+attributeSelectors.length;$attributeSelector.name=$propertyName;$test=this.tests[$test];$test=$test?$test(this.getAttribute($propertyName),getText($value)):false;$attributeSelector.test=new Function("e","return "+$test);return $attributeSelector};AttributeSelector.getAttribute=function($name){switch($name.toLowerCase()){case "id":return "e.id";case "class":return "e.className";case "for":return "e.htmlFor";case "href":if(isMSIE){return "String((e.outerHTML.match(/href=\\x22?([^\\s\\x22]*)\\x22?/)||[])[1]||'')"}}
return "e.getAttribute('"+$name.replace($NAMESPACE,":")+"')"};AttributeSelector.tests[""]=function($attribute){return $attribute};AttributeSelector.tests["="]=function($attribute,$value){return $attribute+"=="+Quote.add($value)};AttributeSelector.tests["~="]=function($attribute,$value){return "/(^| )"+regEscape($value)+"( |$)/.test("+$attribute+")"};AttributeSelector.tests["|="]=function($attribute,$value){return "/^"+regEscape($value)+"(-|$)/.test("+$attribute+")"};var _parseSelector=parseSelector;parseSelector=function($selector){return _parseSelector(AttributeSelector.parse($selector))}});cssQuery.addModule("css-level3", function(){selectors["~"]=function($results,$from,$tagName,$namespace){var $element,i;for(i=0;($element=$from[i]);i++){while($element=nextElementSibling($element)){if(compareTagName($element,$tagName,$namespace))
$results.push($element)}}};pseudoClasses["contains"]=function($element,$text){$text=new RegExp(regEscape(getText($text)));return $text.test(getTextContent($element))};pseudoClasses["root"]=function($element){return $element==getDocument($element).documentElement};pseudoClasses["empty"]=function($element){var $node,i;for(i=0;($node=$element.childNodes[i]);i++){if(thisElement($node)||$node.nodeType==3) return false}
return true};pseudoClasses["last-child"]=function($element){return!nextElementSibling($element)};pseudoClasses["only-child"]=function($element){$element=$element.parentNode;return firstElementChild($element)==lastElementChild($element)};pseudoClasses["not"]=function($element,$selector){var $negated=cssQuery($selector,getDocument($element));for(var i=0;i<$negated.length;i++){if($negated[i]==$element) return false}
return true};pseudoClasses["nth-child"]=function($element,$arguments){return nthChild($element,$arguments,previousElementSibling)};pseudoClasses["nth-last-child"]=function($element,$arguments){return nthChild($element,$arguments,nextElementSibling)};pseudoClasses["target"]=function($element){return $element.id==location.hash.slice(1)};pseudoClasses["checked"]=function($element){return $element.checked};pseudoClasses["enabled"]=function($element){return $element.disabled===false};pseudoClasses["disabled"]=function($element){return $element.disabled};pseudoClasses["indeterminate"]=function($element){return $element.indeterminate};AttributeSelector.tests["^="]=function($attribute,$value){return "/^"+regEscape($value)+"/.test("+$attribute+")"};AttributeSelector.tests["$="]=function($attribute,$value){return "/"+regEscape($value)+"$/.test("+$attribute+")"};AttributeSelector.tests["*="]=function($attribute,$value){return "/"+regEscape($value)+"/.test("+$attribute+")"};
function nthChild($element,$arguments,$traverse){switch($arguments){case "n":return true;case "even":$arguments="2n";break;case "odd":$arguments="2n+1"}
var $$children=childElements($element.parentNode);
function _checkIndex($index){var $index=($traverse==nextElementSibling)?$$children.length-$index:$index-1;return $$children[$index]==$element};if(!isNaN($arguments)) return _checkIndex($arguments);$arguments=$arguments.split("n");var $multiplier=parseInt($arguments[0]);var $step=parseInt($arguments[1]);if((isNaN($multiplier)||$multiplier==1)&&$step==0) return true;if($multiplier==0&&!isNaN($step)) return _checkIndex($step);if(isNaN($step)) $step=0;var $count=1;while($element=$traverse($element)) $count++;if(isNaN($multiplier)||$multiplier==1)
return($traverse==nextElementSibling)?($count<=$step):($step>=$count);return($count%$multiplier)==$step}});loaded=true;return cssQuery}();

/* - plone_javascript_variables.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/plone_javascript_variables.js?original=1
var portal_url='http://www.frameworkdemoiselle.gov.br';var form_modified_message='Your form has not been saved. All changes you have made will be lost.';var form_resubmit_message='You already clicked the submit button. Do you really want to submit this form again?';var external_links_open_new_window=false;var external_links_in_content_only=true;

/* - nodeutilities.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/nodeutilities.js?original=1
function wrapNode(node,wrappertype,wrapperclass){var wrapper=document.createElement(wrappertype)
wrapper.className=wrapperclass;var innerNode=node.parentNode.replaceChild(wrapper,node);wrapper.appendChild(innerNode)};
function nodeContained(innernode,outernode){var node=innernode.parentNode;while(node!=document){if(node==outernode){return true}
node=node.parentNode}
return false};
function findContainer(node,func){while(node!=null){if(func(node)){return node}
node=node.parentNode}
return false};
function hasClassName(node,class_name){return new RegExp('\\b'+class_name+'\\b').test(node.className)};
function addClassName(node,class_name){if(!node.className){node.className=class_name} else if(!hasClassName(node,class_name)){var className=node.className+" "+class_name;node.className=className.split(/\s+/).join(' ')}};
function removeClassName(node,class_name){var className=node.className;if(className){className=className.replace(new RegExp('\\b'+class_name+'\\b'),'');className=className.replace(/\s+/g,' ');node.className=className.replace(/\s+$/g,'')}};
function replaceClassName(node,old_class,new_class,ignore_missing){if(ignore_missing&&!hasClassName(node,old_class)){addClassName(node,new_class)} else{var className=node.className;if(className){className=className.replace(new RegExp('\\b'+old_class+'\\b'),new_class);className=className.replace(/\s+/g,' ');node.className=className.replace(/\s+$/g,'')}}};
function walkTextNodes(node,func,data){if(!node){return false}
if(node.hasChildNodes){for(var i=0;i<node.childNodes.length;i++){walkTextNodes(node.childNodes[i],func,data)}
if(node.nodeType==3){func(node,data)}}};
function getInnerTextCompatible(node){var result=new Array();walkTextNodes(node,
function(n,d){d.push(n.nodeValue)},result);return result.join("")};
function getInnerTextFast(node){if(node.innerText){return node.innerText} else{return getInnerTextCompatible(node)}};
function sortNodes(nodes,fetch_func,cmp_func){if(!W3CDOM){return false};var SortNodeWrapper=function(node){this.value=fetch_func(node);this.cloned_node=node.cloneNode(true);this.toString=function(){if(this.value.toString){return this.value.toString()} else{return this.value}}}
var items=new Array();for(var i=0;i<nodes.length;i++){items.push(new SortNodeWrapper(nodes[i]))}
if(cmp_func){items.sort(cmp_func)} else{items.sort()}
for(var i=0;i<items.length;i++){var dest=nodes[i];dest.parentNode.replaceChild(items[i].cloned_node,dest)}};

/* - cookie_functions.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/cookie_functions.js?original=1
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()} else{expires=""}
document.cookie=name+"="+escape(value)+expires+"; path=/;"};
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length)}
if(c.indexOf(nameEQ)==0){return unescape(c.substring(nameEQ.length,c.length))}}
return null};

/* - livesearch.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/livesearch.js?original=1
var liveSearchReq=false;var t=null;var liveSearchLast="";var queryTarget="livesearch_reply?q=";var searchForm=null;var searchInput=null;var isIE=false;var _cache=new Object();var widthOffset=1;
function calculateWidth(){}
function getElementDimensions(elemID){var base=document.getElementById(elemID);var offsetTrail=base;var offsetLeft=0;var offsetTop=0;var width=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent}
if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){offsetLeft+=document.body.leftMargin;offsetTop+=document.body.topMargin}
if(!isIE)
width=searchInput.offsetWidth-widthOffset*2;else
width=searchInput.offsetWidth;return{left:offsetLeft,top:offsetTop,width:width,height:base.offsetHeight,bottom:offsetTop+base.offsetHeight,right:offsetLeft+width}}
function liveSearchInit(){searchInput=document.getElementById('searchGadget');if(searchInput==null||searchInput==undefined)
return
if(navigator.userAgent.indexOf("KHTML")>0){searchInput.addEventListener("keydown",liveSearchKeyPress,false);searchInput.addEventListener("focus",liveSearchDoSearch,false);searchInput.addEventListener("keydown",liveSearchStart,false);searchInput.addEventListener("blur",liveSearchHideDelayed,false)} else if(searchInput.addEventListener){searchInput.addEventListener("keypress",liveSearchKeyPress,false);searchInput.addEventListener("blur",liveSearchHideDelayed,false);searchInput.addEventListener("keypress",liveSearchStart,false)} else{searchInput.attachEvent("onkeydown",liveSearchKeyPress);searchInput.attachEvent("onkeydown",liveSearchStart);searchInput.attachEvent("onblur",liveSearchHideDelayed);isIE=true}
searchInput.setAttribute("autocomplete","off");var pos=getElementDimensions('searchGadget');result=document.getElementById('LSResult');if((typeof result.offsetParent!='undefined')&&(result.offsetParent!=null)){pos.left=pos.left-result.offsetParent.offsetLeft+pos.width} else{pos.left=pos.left+pos.width}
result.style.display='none'}
function liveSearchHideDelayed(){window.setTimeout("liveSearchHide()",400)}
function liveSearchHide(){document.getElementById("LSResult").style.display="none";var highlight=document.getElementById("LSHighlight");if(highlight)
highlight.removeAttribute("id")}
function getFirstHighlight(){var set=getHits();return set[0]}
function getLastHighlight(){var set=getHits();return set[set.length-1]}
function getHits(){var res=document.getElementById("LSShadow");var set=res.getElementsByTagName('li');return set}
function findChild(object,specifier){var cur=object.firstChild;try{while(cur!=undefined){cur=cur.nextSibling;if(specifier(cur)==true)
return cur}} catch(e){};return null}
function findNext(object,specifier){var cur=object;try{while(cur!=undefined){cur=cur.nextSibling;if(cur.nodeType==3)
cur=cur.nextSibling;if(cur!=undefined){if(specifier(cur)==true)
return cur} else{break}}} catch(e){};return null}
function findPrev(object,specifier){var cur=object;try{cur=cur.previousSibling;if(cur.nodeType==3)
cur=cur.previousSibling;if(cur!=undefined){if(specifier(cur)==true)
return cur}} catch(e){};return null}
function liveSearchKeyPress(event){var highlight=document.getElementById("LSHighlight");if(event.keyCode==40){if(!highlight){highlight=getFirstHighlight()} else{highlight.removeAttribute("id");highlight=findNext(highlight, function(o){return o.className=="LSRow"})}
if(highlight)
highlight.setAttribute("id","LSHighlight");if(!isIE)
event.preventDefault()}
else if(event.keyCode==38){if(!highlight){highlight=getLastHighlight()}
else{highlight.removeAttribute("id");highlight=findPrev(highlight, function(o){return o.className=='LSRow'})}
if(highlight)
highlight.setAttribute("id","LSHighlight");if(!isIE)
event.preventDefault()}
else if(event.keyCode==27){if(highlight)
highlight.removeAttribute("id");document.getElementById("LSResult").style.display="none"}}
function liveSearchStart(event){if(t){window.clearTimeout(t)}
var code=event.keyCode;if(code!=40&&code!=38&&code!=27&&code!=37&&code!=39){t=window.setTimeout("liveSearchDoSearch()",200)}}
function liveSearchDoSearch(){if(typeof liveSearchRoot=="undefined"){if(typeof portal_url=="undefined"){liveSearchRoot=""} else{if(portal_url[portal_url.length-1]=='/'){liveSearchRoot=portal_url} else{liveSearchRoot=portal_url+'/'}}}
if(typeof liveSearchRootSubDir=="undefined"){liveSearchRootSubDir=""}
if(liveSearchLast!=searchInput.value){if(liveSearchReq&&liveSearchReq.readyState<4){liveSearchReq.abort()}
if(searchInput.value==""){liveSearchHide();return false}
if(searchInput.value.length<2){liveSearchHide();return false}
var result=_cache[searchInput.value];if(result){showResult(result);return}
liveSearchReq=new XMLHttpRequest();liveSearchReq.onreadystatechange=liveSearchProcessReqChange;liveSearchReq.open("GET",liveSearchRoot+queryTarget+encodeURIComponent(searchInput.value));liveSearchLast=searchInput.value;liveSearchReq.send(null)}}
function showResult(result){var res=document.getElementById("LSResult");res.style.display="block";var sh=document.getElementById("LSShadow");sh.innerHTML=result}
function liveSearchProcessReqChange(){if(liveSearchReq.readyState==4){try{if(liveSearchReq.status>299||liveSearchReq.status<200||liveSearchReq.responseText.length<10)
return} catch(e){return}
showResult(liveSearchReq.responseText);_cache[liveSearchLast]=liveSearchReq.responseText}}
function liveSearchSubmit(){var highlight=document.getElementById("LSHighlight");if(highlight){var targets=highlight.getElementsByTagName('a');if(targets.length==0)
return true;var target=targets[0].href;if(!target)
return true;if((liveSearchRoot.length>0)&&(target.substring(0,liveSearchRoot.length)!=liveSearchRoot)){window.location=liveSearchRoot+liveSearchRootSubDir+target} else{window.location=target}
return false} else{return true}}
if(window.addEventListener)
window.addEventListener("load",liveSearchInit,false);else if(window.attachEvent)
window.attachEvent("onload",liveSearchInit);

/* - fullscreenmode.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/fullscreenmode.js?original=1
function toggleFullScreenMode(){var body=cssQuery('body')[0];if(document.getElementById('icon-full_screen')){var fsicon=document.getElementById('icon-full_screen')}
if(hasClassName(body,'fullscreen')){removeClassName(body,'fullscreen');createCookie('fullscreenMode','');if(fsicon){fsicon.src='fullscreenexpand_icon.gif'}} else{addClassName(body,'fullscreen');createCookie('fullscreenMode','1');if(fsicon){fsicon.src='fullscreencollapse_icon.gif'}}};
function fullscreenModeLoad(){if(document.getElementById('icon-full_screen')){var fsicon=document.getElementById('icon-full_screen')}
if(readCookie('fullscreenMode')=='1'){var body=cssQuery('body')[0];addClassName(body,'fullscreen');if(fsicon){fsicon.src='fullscreencollapse_icon.gif'}}};registerPloneFunction(fullscreenModeLoad)


/* - select_all.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/select_all.js?original=1
function selectAll(id,formName){if(formName==null){checkboxes=document.getElementsByName(id)
for(i=0;i<checkboxes.length;i++){checkboxes[i].checked=true }} else{for(i=0;i<document.forms[formName].elements.length;i++){if(document.forms[formName].elements[i].name==id){document.forms[formName].elements[i].checked=true}}}}
function deselectAll(id,formName){if(formName==null){checkboxes=document.getElementsByName(id)
for(i=0;i<checkboxes.length;i++){checkboxes[i].checked=false }} else{for(i=0;i<document.forms[formName].elements.length;i++){if(document.forms[formName].elements[i].name==id){document.forms[formName].elements[i].checked=false}}}}
function toggleSelect(selectbutton,id,initialState,formName){id=id||'ids:list'
if(selectbutton.isSelected==null){initialState=initialState||false;selectbutton.isSelected=initialState}
if(selectbutton.isSelected==false){selectbutton.setAttribute('src',portal_url+'/select_none_icon.gif');selectbutton.isSelected=true;return selectAll(id,formName)} else{selectbutton.setAttribute('src',portal_url+'/select_all_icon.gif');selectbutton.isSelected=false;return deselectAll(id,formName)}}


/* - dropdown.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/dropdown.js?original=1
function isActionMenu(node){if(hasClassName(node,'actionMenu')){return true}
return false};
function hideAllMenus(){var menus=cssQuery('dl.actionMenu');for(var i=0;i<menus.length;i++){replaceClassName(menus[i],'activated','deactivated',true)}};
function toggleMenuHandler(event){if(!event) var event=window.event;if(!W3CDOM){return true}
var container=findContainer(this,isActionMenu);if(!container){return true}
if(hasClassName(container,'activated')){replaceClassName(container,'activated','deactivated',true)} else{replaceClassName(container,'deactivated','activated',true)}
return false};
function hideMenusHandler(event){if(!event) var event=window.event;hideAllMenus();return true};
function actionMenuDocumentMouseDown(event){if(!event) var event=window.event;if(event.target)
targ=event.target;else if(event.srcElement)
targ=event.srcElement;var container=findContainer(targ,isActionMenu);if(container){return true}
hideAllMenus();return true};
function actionMenuMouseOver(event){if(!event) var event=window.event;if(!this.tagName&&(this.tagName=='A'||this.tagName=='a')){return true}
var container=findContainer(this,isActionMenu);if(!container){return true}
var menu_id=container.id;var switch_menu=false;var menus=cssQuery('dl.actionMenu');for(var i=0;i<menus.length;i++){var menu=menus[i]
if(hasClassName(menu,'activated')){switch_menu=true}
if(menu.id!=menu_id){replaceClassName(menu,'activated','deactivated',true)}}
if(switch_menu){var menu=cssQuery('#'+menu_id)[0];if(menu){replaceClassName(menu,'deactivated','activated',true)}}
return true};
function initializeMenus(){if(!W3CDOM){return false}
document.onmousedown=actionMenuDocumentMouseDown;hideAllMenus();var menu_headers=cssQuery('dl.actionMenu > dt.actionMenuHeader > a');for(var i=0;i<menu_headers.length;i++){var menu_header=menu_headers[i];menu_header.onclick=toggleMenuHandler;menu_header.onmouseover=actionMenuMouseOver}
var menu_contents=cssQuery('dl.actionMenu > dd.actionMenuContent');for(var i=0;i<menu_contents.length;i++){menu_contents[i].onclick=hideMenusHandler}};registerPloneFunction(initializeMenus);

/* - dragdropreorder.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/dragdropreorder.js?original=1
var ploneDnDReorder={}
ploneDnDReorder.dragging=null;ploneDnDReorder.table=null;ploneDnDReorder.rows=null;ploneDnDReorder.isDraggable=function(node){return hasClassName(node,'draggable')};ploneDnDReorder.doDown=function(e){if(!e) var e=window.event;var target=findContainer(this,ploneDnDReorder.isDraggable);if(target==null)
return;for(var i=0;i<ploneDnDReorder.rows.length;i++)
ploneDnDReorder.rows[i].onmousemove=ploneDnDReorder.doDrag;ploneDnDReorder.dragging=target;ploneDnDReorder.dragging._position=ploneDnDReorder.getPos(ploneDnDReorder.dragging);addClassName(ploneDnDReorder.dragging,"dragging");return false}
ploneDnDReorder.getPos=function(node){var children=node.parentNode.childNodes;var pos=0;for(var i=0;i<children.length;i++){if(node==children[i])
return pos;if(hasClassName(children[i],"draggable"))
pos++}
return null}
ploneDnDReorder.doDrag=function(e){if(!e) var e=window.event;if(!ploneDnDReorder.dragging)
return;var target=this;if(!target)
return;if(target.id!=ploneDnDReorder.dragging.id){ploneDnDReorder.swapElements(target,ploneDnDReorder.dragging)}
return false}
ploneDnDReorder.swapElements=function(child1,child2){var parent=child1.parentNode;var children=parent.childNodes;var items=new Array();for(var i=0;i<children.length;i++){var node=children[i];items[i]=node;if(node.id){removeClassName(node,"even");removeClassName(node,"odd");if(node.id==child1.id)
items[i]=child2;if(node.id==child2.id)
items[i]=child1}}
Sarissa.clearChildNodes(parent);var pos=0;for(var i=0;i<items.length;i++){var node=parent.appendChild(items[i]);if(node.id){if(pos%2)
addClassName(node,"even");else
addClassName(node,"odd");pos++}}}
ploneDnDReorder.doUp=function(e){if(!e) var e=window.event;if(!ploneDnDReorder.dragging)
return;removeClassName(ploneDnDReorder.dragging,"dragging");ploneDnDReorder.updatePositionOnServer();ploneDnDReorder.dragging._position=null;try{delete ploneDnDReorder.dragging._position} catch(e){}
ploneDnDReorder.dragging=null;for(var i=0;i<ploneDnDReorder.rows.length;i++)
ploneDnDReorder.rows[i].onmousemove=null;return false}
ploneDnDReorder.updatePositionOnServer=function(){var delta=ploneDnDReorder.getPos(ploneDnDReorder.dragging)-ploneDnDReorder.dragging._position;if(delta==0)
return;var req=new XMLHttpRequest();req.open("POST","folder_moveitem",true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var item_id=ploneDnDReorder.dragging.id.substr('folder-contents-item-'.length);req.send("item_id="+item_id+"&delta:int="+delta)}
ploneDnDReorder.initializeDragDrop=function(){ploneDnDReorder.table=cssQuery("table#sortable")[0];if(!ploneDnDReorder.table)
return;ploneDnDReorder.rows=cssQuery("table#sortable > tr,"+"table#sortable > tbody > tr");var targets=cssQuery("table#sortable > tr > td,"+"table#sortable > tbody > tr > td");for(var i=0;i<targets.length;i++){if(hasClassName(targets[i],'notDraggable'))
continue;targets[i].onmousedown=ploneDnDReorder.doDown;targets[i].onmouseup=ploneDnDReorder.doUp;addClassName(targets[i],"draggingHook")}}
registerPloneFunction(ploneDnDReorder.initializeDragDrop);

/* - collapsiblesections.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/collapsiblesections.js?original=1
function isCollapsible(node){if(hasClassName(node,'collapsible')){return true}
return false};
function toggleCollapsible(event){if(!event) var event=window.event;if(!this.tagName&&(this.tagName=='DT'||this.tagName=='dt')){return true}
var container=findContainer(this,isCollapsible);if(!container){return true}
if(hasClassName(container,'collapsedBlockCollapsible')){replaceClassName(container,'collapsedBlockCollapsible','expandedBlockCollapsible')} else if(hasClassName(container,'expandedBlockCollapsible')){replaceClassName(container,'expandedBlockCollapsible','collapsedBlockCollapsible')} else if(hasClassName(container,'collapsedInlineCollapsible')){replaceClassName(container,'collapsedInlineCollapsible','expandedInlineCollapsible')} else if(hasClassName(container,'expandedInlineCollapsible')){replaceClassName(container,'expandedInlineCollapsible','collapsedInlineCollapsible')}};
function activateCollapsibles(){if(!W3CDOM){return false}
var collapsibles=cssQuery('dl.collapsible');for(var i=0;i<collapsibles.length;i++){var collapsible=collapsibles[i];var collapsible_header=cssQuery('dt.collapsibleHeader',collapsible)[0];collapsible_header.onclick=toggleCollapsible;if(hasClassName(collapsible,'inline')){if(hasClassName(collapsible,'collapsedOnLoad')){replaceClassName(collapsible,'collapsedOnLoad','collapsedInlineCollapsible')} else{addClassName(collapsible,'expandedInlineCollapsible')}} else{if(hasClassName(collapsible,'collapsedOnLoad')){replaceClassName(collapsible,'collapsedOnLoad','collapsedBlockCollapsible')} else{addClassName(collapsible,'expandedBlockCollapsible')}}}};registerPloneFunction(activateCollapsibles);

/* - highlightsearchterms.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/highlightsearchterms.js?original=1
function highlightTermInNode(node,word){var contents=node.nodeValue;var index=contents.toLowerCase().indexOf(word.toLowerCase());if(index<0){return false};var parent=node.parentNode;if(parent.className!="highlightedSearchTerm"){var hiword=document.createElement("span");hiword.className="highlightedSearchTerm";hiword.appendChild(document.createTextNode(contents.substr(index,word.length)));parent.insertBefore(document.createTextNode(contents.substr(0,index)),node);parent.insertBefore(hiword,node);parent.insertBefore(document.createTextNode(contents.substr(index+word.length)),node);parent.removeChild(node)}}
function highlightSearchTerms(terms,startnode){if(!W3CDOM){return false};if(!terms){return false};if(!startnode){return false};for(var term_index=0;term_index<terms.length;term_index++){var term=terms[term_index];if(term.length<1)
continue;var term_lower=term.toLowerCase();if(term_lower!='not'&&term_lower!='and'&&term_lower!='or'){walkTextNodes(startnode,highlightTermInNode,term)}}}
function getSearchTermsFromURI(uri){var query;if(typeof decodeURI!='undefined'){query=decodeURI(uri)} else if(typeof unescape!='undefined'){query=unescape(uri)} else{}
var result=new Array();if(window.decodeReferrer){var referrerSearch=decodeReferrer();if(null!=referrerSearch&&referrerSearch.length>0){result=referrerSearch}}
var qfinder=new RegExp("searchterm=([^&]*)","gi");var qq=qfinder.exec(query);if(qq&&qq[1]){var terms=qq[1].replace(/\+/g,' ').split(/\s+/);for(var i=0;i<terms.length;i++){if(terms[i]!=''){result.push(terms[i])}}
return result}
return result.length==0?false:result}
function highlightSearchTermsFromURI(){if(!W3CDOM){return false};var terms=getSearchTermsFromURI(window.location.search);var contentarea=getContentArea();highlightSearchTerms(terms,contentarea)}
registerPloneFunction(highlightSearchTermsFromURI);

/* - se-highlight.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/se-highlight.js?original=1
var searchEngines=[['^http://([^.]+\\.)?google.*','q='],['^http://search\\.yahoo.*','p='],['^http://search\\.msn.*','q='],['^http://search\\.aol.*','userQuery='],['^http://(www\\.)?altavista.*','q='],['^http://(www\\.)?feedster.*','q='],['^http://search\\.lycos.*','query='],['^http://(www\\.)?alltheweb.*','q='],['^http://(www\\.)?ask\\.com.*','q=']]
function decodeReferrer(ref){if(null==ref&&document.referrer){ref=document.referrer}
if(!ref) return null;var match=new RegExp('');var seQuery='';for(var i=0;i<searchEngines.length;i++){if(!match.compile){match=new RegExp(searchEngines[i][0],'i')} else{match.compile(searchEngines[i][0],'i')}
if(ref.match(match)){if(!match.compile){match=new RegExp('^.*[?&]'+searchEngines[i][1]+'([^&]+)&?.*$','i')} else{match.compile('^.*[?&]'+searchEngines[i][1]+'([^&]+)&?.*$')}
seQuery=ref.replace(match,'$1');if(seQuery){seQuery=decodeURIComponent(seQuery);seQuery=seQuery.replace(/\'|"/, '');return seQuery.split(/[\s,\+\.]+/)}}}
return null}


/* - first_input_focus.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/first_input_focus.js?original=1
function setFocus(){if(!W3CDOM){return false};var xre=new RegExp(/\berror\b/);for(var f=0;(formnode=document.getElementsByTagName('form').item(f));f++){for(var i=0;(node=formnode.getElementsByTagName('div').item(i));i++){if(xre.exec(node.className)){for(var j=0;(inputnode=node.getElementsByTagName('input').item(j));j++){try{if(inputnode.focus){inputnode.focus();return}} catch(e){}}}}}}
registerPloneFunction(setFocus)


/* - folder_contents_filter.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/folder_contents_filter.js?original=1
function submitFolderAction(folderAction){document.folderContentsForm.action=document.folderContentsForm.action+'/'+folderAction;document.folderContentsForm.submit()}
function submitFilterAction(){document.folderContentsForm.action=document.folderContentsForm.action+'/folder_contents';filter_selection=document.getElementById('filter_selection');for(var i=0;i<filter_selection.length;i++){if(filter_selection.options[i].selected){if(filter_selection.options[i].value=='#'){document.folderContentsForm.filter_state.value='clear_view_filter'}
else{document.folderContentsForm.filter_state.value='set_view_filter'}}}
document.folderContentsForm.submit()}


/* - folder_contents_hideAddItems.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/folder_contents_hideAddItems.js?original=1
function hideTraditionalAddItemPullDown(){pullDown=document.getElementById('traditional-add-item-pulldown');if(pullDown){pullDown.style.display='none'}}
registerPloneFunction(hideTraditionalAddItemPullDown)


/* - styleswitcher.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/styleswitcher.js?original=1
function setActiveStyleSheet(title,reset){if(!W3CDOM){return false};var i,a,main;for(i=0;(a=document.getElementsByTagName("link")[i]);i++){if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){a.disabled=true;if(a.getAttribute("title")==title){a.disabled=false}}}
if(reset==1){createCookie("wstyle",title,365)}};
function setStyle(){var style=readCookie("wstyle");if(style!=null){setActiveStyleSheet(style,0)}};registerPloneFunction(setStyle);

/* - table_sorter.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/table_sorter.js?original=1
function compare(a,b){au=new String(a);bu=new String(b);if(au.charAt(4)!='-'&&au.charAt(7)!='-'){var an=parseFloat(au)
var bn=parseFloat(bu)}
if(isNaN(an)||isNaN(bn)){as=au.toLowerCase()
bs=bu.toLowerCase()
if(as>bs){return 1}
else{return-1}}
else{return an-bn}}
function getConcatenedTextContent(node){var _result="";if(node==null){return _result}
var childrens=node.childNodes;var i=0;while(i<childrens.length){var child=childrens.item(i);switch(child.nodeType){case 1:case 5:_result+=getConcatenedTextContent(child);break;case 3:case 2:case 4:_result+=child.nodeValue;break;case 6:case 7:case 8:case 9:case 10:case 11:case 12:break}
i++}
return _result}
function sort(e){var el=window.event?window.event.srcElement:e.currentTarget;var a=new Array();if(el.nodeName=='IMG') el=el.parentNode;var name=el.childNodes.item(1).nodeValue;var dad=el.parentNode;var node;for(var im=0;(node=dad.getElementsByTagName("th").item(im));im++){if(node.lastChild.nodeName=='IMG'){lastindex=node.getElementsByTagName('img').length-1;node.getElementsByTagName('img').item(lastindex).setAttribute('src',portal_url+'/arrowBlank.gif')}}
for(var i=0;(node=dad.getElementsByTagName("th").item(i));i++){var xre=new RegExp(/\bnosort\b/);if(!xre.exec(node.className)&&node.childNodes.item(1).nodeValue==name){lastindex=node.getElementsByTagName('img').length-1;node.getElementsByTagName('img').item(lastindex).setAttribute('src',portal_url+'/arrowUp.gif');break}}
var tbody=dad.parentNode.parentNode.getElementsByTagName("tbody").item(0);for(var j=0;(node=tbody.getElementsByTagName("tr").item(j));j++){a[j]=new Array();a[j][0]=getConcatenedTextContent(node.getElementsByTagName("td").item(i));a[j][1]=getConcatenedTextContent(node.getElementsByTagName("td").item(1));a[j][2]=getConcatenedTextContent(node.getElementsByTagName("td").item(0));a[j][3]=node}
if(a.length>1){a.sort(compare);if(a[0][0]==getConcatenedTextContent(tbody.getElementsByTagName("tr").item(0).getElementsByTagName("td").item(i))&&a[1][0]==getConcatenedTextContent(tbody.getElementsByTagName("tr").item(1).getElementsByTagName("td").item(i))){a.reverse();lastindex=el.getElementsByTagName('img').length-1;el.getElementsByTagName('img').item(lastindex).setAttribute('src',portal_url+'/arrowDown.gif')}}
for(var j=0;j<a.length;j++){a[j][3].className=((j%2)==0)?'odd':'even';tbody.appendChild(a[j][3])}}
function initalizeTableSort(e){if(!W3CDOM){return false};var tbls=document.getElementsByTagName('table');for(var t=0;t<tbls.length;t++){var re=new RegExp(/\blisting\b/)
var xre=new RegExp(/\bnosort\b/)
if(re.exec(tbls[t].className)&&!xre.exec(tbls[t].className)){try{var thead=tbls[t].getElementsByTagName("thead").item(0);var node;blankarrow=document.createElement('img');blankarrow.setAttribute('src',portal_url+'/arrowBlank.gif');blankarrow.setAttribute('height',6);blankarrow.setAttribute('width',9);initialsort=false;for(var i=0;(node=thead.getElementsByTagName("th").item(i));i++){if(!xre.exec(node.className)){node.insertBefore(blankarrow.cloneNode(1),node.firstChild);node.style.cursor='pointer';if(!initialsort){initialsort=true;uparrow=document.createElement('img');uparrow.setAttribute('src',portal_url+'/arrowUp.gif');uparrow.setAttribute('height',6);uparrow.setAttribute('width',9);node.appendChild(uparrow)} else{node.appendChild(blankarrow.cloneNode(1))}
if(node.addEventListener) node.addEventListener("click",sort,false);else if(node.attachEvent) node.attachEvent("onclick",sort)}}} catch(er){}}}}
registerPloneFunction(initalizeTableSort)


/* - calendar_formfield.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/calendar_formfield.js?original=1
function onJsCalendarDateUpdate(cal){var year=cal.params.input_id_year;var month=cal.params.input_id_month;var day=cal.params.input_id_day;var daystr=''+cal.date.getDate();if(daystr.length==1)
daystr='0'+daystr;var monthstr=''+(cal.date.getMonth()+1);if(monthstr.length==1)
monthstr='0'+monthstr;cal.params.inputField.value=''+cal.date.getFullYear()+'/'+monthstr+'/'+daystr
year.value=cal.params.inputField.value.substring(0,4);month.value=cal.params.inputField.value.substring(5,7);day.value=cal.params.inputField.value.substring(8,10)}
function showJsCalendar(input_id_anchor,input_id,input_id_year,input_id_month,input_id_day,input_id_hour,input_id_minute,yearStart,yearEnd){var input_id_anchor=document.getElementById(input_id_anchor);var input_id=document.getElementById(input_id);var input_id_year=document.getElementById(input_id_year);var input_id_month=document.getElementById(input_id_month);var input_id_day=document.getElementById(input_id_day);var format='y/mm/dd';var dateEl=input_id;var mustCreate=false;var cal=window.calendar;var params={'range':[yearStart,yearEnd],inputField:input_id,input_id_year:input_id_year,input_id_month:input_id_month,input_id_day:input_id_day};
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",1);param_default("align","Bl");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);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,null,onJsCalendarDateUpdate,
function(cal){cal.hide()});cal.time24=true;cal.weekNumbers=true;mustCreate=true} else{cal.hide()}
cal.showsOtherMonths=false;cal.yearStep=2;cal.setRange(yearStart,yearEnd);cal.params=params;cal.setDateStatusHandler(null);cal.getDateText=null;cal.setDateFormat(format);if(mustCreate)
cal.create();cal.refresh();if(!params.position)
cal.showAtElement(input_id_anchor,null);else
cal.showAt(params.position[0],params.position[1]);return false}
function update_date_field(field,year,month,day,hour,minute,ampm){var field=document.getElementById(field)
var date=document.getElementById(date)
var year=document.getElementById(year)
var month=document.getElementById(month)
var day=document.getElementById(day)
var hour=document.getElementById(hour)
var minute=document.getElementById(minute)
var ampm=document.getElementById(ampm)
if(0<year.value){field.value=year.value+"-"+month.value+"-"+day.value+" "+hour.value+":"+minute.value
if(ampm&&ampm.value)
field.value=field.value+" "+ampm.value}
else{field.value=''
month.options[0].selected=1
day.options[0].selected=1
hour.options[0].selected=1
minute.options[0].selected=1
if(ampm&&ampm.options)
ampm.options[0].selected=1}}


/* - calendarpopup.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/calendarpopup.js?original=1
function showDay(date){document.getElementById('day'+date).style.visibility='visible';return true}
function hideDay(date){document.getElementById('day'+date).style.visibility='hidden';return true}


/* - ie5fixes.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/ie5fixes.js?original=1
function hackPush(el){this[this.length]=el}
function hackPop(){var N=this.length-1,el=this[N];this.length=N
return el}
function hackShift(){var one=this[0],N=this.length;for(var i=1;i<N;i++){this[i-1]=this[i]}
this.length=N-1
return one}
var testPushPop=new Array();if(testPushPop.push){}else{Array.prototype.push=hackPush
Array.prototype.pop=hackPop
Array.prototype.shift=hackShift}


/* - formUnload.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/formUnload.js?original=1
if(!window.beforeunload)(function(){var BeforeUnloadHandler=function(){var self=this;this.message=window.form_modified_message||"Your form has not been saved. All changes you have made will be lost.";this.forms=[];this.chkId=[];this.chkType=new this.CheckType();this.handlers=[this.isAnyFormChanged];this.submitting=false;this.execute=function(event){if(self.submitting) return;if(!event) event=window.event;for(var i=0;i<self.handlers.length;i++){var fn=self.handlers[i];var message=message||fn.apply(self)}
if(message===true) message=self.message;if(message===false) message=undefined;if(event&&message){event.returnValue=message}
return message}
this.execute.tool=this}
var Class=BeforeUnloadHandler.prototype;Class.isAnyFormChanged=function(){for(var i=0;i<this.forms.length;i++){var form=this.forms[i];if(this.isElementChanged(form)){return true}}
return false}
Class.addHandler=function(fn){this.handlers.push(fn)}
Class.onsubmit=function(){var tool=window.onbeforeunload&&window.onbeforeunload.tool;tool.submitting=true}
Class.addForm=function(form){for(var i=0;i<this.forms.length;i++){if(this.forms[i]==form) return}
this.forms.push(form);form.onsubmit=this.onsubmit;var elements=form.getElementsByTagName('input');for(var j=0;j<elements.length;j++){var ele=elements[j];if(ele.type=='hidden'){ele.setAttribute('originalValue',ele.defaultValue)}}}
Class.addForms=function(){for(var i=0;i<arguments.length;i++){var element=arguments[i];if(!element) continue;if(element.tagName=='FORM'){this.addForm(element)}
else{var forms=element.getElementsByTagName('form');for(var j=0;j<forms.length;j++){this.addForm(forms[j])}}}}
Class.removeForms=function(){for(var i=0;i<arguments.length;i++){var element=arguments[i];if(!element) continue;if(element.tagName=='FORM'){for(var j=0;j<arguments.length;j++){if(this.forms[j]==element){this.forms.splice(j--,1);element.onsubmit=null}}} else{var forms=element.getElementsByTagName('form');for(var j=0;j<forms.length;j++){this.removeForms(forms[j])}}}}
Class.CheckType=function(){};var c=Class.CheckType.prototype;c.checkbox=c.radio=function(ele){return ele.checked!=ele.defaultChecked}
c.password=c.textarea=c.text=function(ele){return ele.value!=ele.defaultValue}
c.hidden=function(ele){var orig=ele.getAttribute("originalValue");return orig&&(ele.value!=orig)}
c['select-one']=function(ele){for(var i=0 ;i<ele.length;i++){var opt=ele.options[i];if(opt.selected!=opt.defaultSelected){if(i===0&&opt.selected) continue;return true}}
return false}
c['select-multiple']=function(ele){for(var i=0 ;i<ele.length;i++){var opt=ele.options[i];if(opt.selected!=opt.defaultSelected){return true}}
return false}
Class.chk_form=function(form){var elements=form.elements;for(var i=0;i<elements.length;i++){var element=elements[i];if(this.isElementChanged(element)){return true}}
return false}
Class.isElementChanged=function(ele){var method=ele.id&&this.chkId[ele.id];if(!method&&ele.type&&ele.name)
method=this.chkType[ele.type];if(!method&&ele.tagName)
method=this['chk_'+ele.tagName.toLowerCase()];return method?method.apply(this,[ele]):false};window.onbeforeunload=new BeforeUnloadHandler().execute;registerPloneFunction(function(){if(!W3CDOM){return false};var tool=window.onbeforeunload&&window.onbeforeunload.tool;var content=getContentArea();if(tool&&content){var forms=cssQuery('form.enableUnloadProtection');for(var i=0;i<forms.length;i++){tool.addForm(forms[i])}}})})();

/* - sarissa.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/sarissa.js?original=1
function Sarissa(){};Sarissa.PARSED_OK="Document contains no parsing errors";Sarissa.IS_ENABLED_TRANSFORM_NODE=false;Sarissa.IS_ENABLED_XMLHTTP=false;Sarissa.IS_ENABLED_SELECT_NODES=false;var _sarissa_iNsCounter=0;var _SARISSA_IEPREFIX4XSLPARAM="";var _SARISSA_HAS_DOM_IMPLEMENTATION=document.implementation&&true;var _SARISSA_HAS_DOM_CREATE_DOCUMENT=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.createDocument;var _SARISSA_HAS_DOM_FEATURE=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.hasFeature;var _SARISSA_IS_MOZ=_SARISSA_HAS_DOM_CREATE_DOCUMENT&&_SARISSA_HAS_DOM_FEATURE;var _SARISSA_IS_SAFARI=navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1;var _SARISSA_IS_IE=document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1;if(!window.Node||!window.Node.ELEMENT_NODE){var 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}};if(_SARISSA_IS_IE){_SARISSA_IEPREFIX4XSLPARAM="xsl:";var _SARISSA_DOM_PROGID="";var _SARISSA_XMLHTTP_PROGID="";pickRecentProgID=function(idList,enabledList){var bFound=false;for(var i=0;i<idList.length&&!bFound;i++){try{var oDoc=new ActiveXObject(idList[i]);o2Store=idList[i];bFound=true;for(var j=0;j<enabledList.length;j++)
if(i<=enabledList[j][1])
Sarissa["IS_ENABLED_"+enabledList[j][0]]=true}catch(objException){}};if(!bFound)
throw "Could not retreive a valid progID of Class: "+idList[idList.length-1]+". (original exception: "+e+")";idList=null;return o2Store};_SARISSA_DOM_PROGID=pickRecentProgID(["Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"],[["SELECT_NODES",2],["TRANSFORM_NODE",2]]);_SARISSA_XMLHTTP_PROGID=pickRecentProgID(["Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],[["XMLHTTP",4]]);_SARISSA_THREADEDDOM_PROGID=pickRecentProgID(["Msxml2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.4.0","MSXML2.FreeThreadedDOMDocument.3.0"]);_SARISSA_XSLTEMPLATE_PROGID=pickRecentProgID(["Msxml2.XSLTemplate.5.0","Msxml2.XSLTemplate.4.0","MSXML2.XSLTemplate.3.0"],[["XSLTPROC",2]]);pickRecentProgID=null;Sarissa.getDomDocument=function(sUri,sName){var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);if(sName){if(sUri){oDoc.loadXML("<a"+_sarissa_iNsCounter+":"+sName+" xmlns:a"+_sarissa_iNsCounter+"=\""+sUri+"\" />");++_sarissa_iNsCounter}
else
oDoc.loadXML("<"+sName+"/>")};return oDoc};Sarissa.getParseErrorText=function(oDoc){var parseErrorText=Sarissa.PARSED_OK;if(oDoc.parseError!=0){parseErrorText="XML Parsing Error: "+oDoc.parseError.reason+"\nLocation: "+oDoc.parseError.url+"\nLine Number "+oDoc.parseError.line+", Column "+oDoc.parseError.linepos+":\n"+oDoc.parseError.srcText+"\n";for(var i=0;i<oDoc.parseError.linepos;i++){parseErrorText+="-"};parseErrorText+="^\n"};return parseErrorText};Sarissa.setXpathNamespaces=function(oDoc,sNsSet){oDoc.setProperty("SelectionLanguage","XPath");oDoc.setProperty("SelectionNamespaces",sNsSet)};XSLTProcessor=function(){this.template=new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID);this.processor=null};XSLTProcessor.prototype.importStylesheet=function(xslDoc){var converted=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);converted.loadXML(xslDoc.xml);this.template.stylesheet=converted;this.processor=this.template.createProcessor();this.paramsSet=new Array()};XSLTProcessor.prototype.transformToDocument=function(sourceDoc){this.processor.input=sourceDoc;var outDoc=new ActiveXObject(_SARISSA_DOM_PROGID);this.processor.output=outDoc;this.processor.transform();return outDoc};XSLTProcessor.prototype.transformToFragment=function(sourceDoc,ownerDocument){return this.transformToDocument(sourceDoc)};XSLTProcessor.prototype.setParameter=function(nsURI,name,value){if(nsURI){this.processor.addParameter(name,value,nsURI)}else{this.processor.addParameter(name,value)};if(!this.paramsSet[""+nsURI]){this.paramsSet[""+nsURI]=new Array()};this.paramsSet[""+nsURI][name]=value};XSLTProcessor.prototype.getParameter=function(nsURI,name){if(this.paramsSet[""+nsURI]&&this.paramsSet[""+nsURI][name])
return this.paramsSet[""+nsURI][name];else
return null}}
else{if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){if(window.XMLDocument){XMLDocument.prototype.onreadystatechange=null;XMLDocument.prototype.readyState=0;XMLDocument.prototype.parseError=0;var _SARISSA_SYNC_NON_IMPLEMENTED=false;try{XMLDocument.prototype.async=true;_SARISSA_SYNC_NON_IMPLEMENTED=true}catch(e){};XMLDocument.prototype._sarissa_load=XMLDocument.prototype.load;XMLDocument.prototype.load=function(sURI){var oDoc=document.implementation.createDocument("","",null);Sarissa.copyChildNodes(this,oDoc);this.parseError=0;Sarissa.__setReadyState__(this,1);try{if(this.async==false&&_SARISSA_SYNC_NON_IMPLEMENTED){var tmp=new XMLHttpRequest();tmp.open("GET",sURI,false);tmp.send(null);Sarissa.__setReadyState__(this,2);Sarissa.copyChildNodes(tmp.responseXML,this);Sarissa.__setReadyState__(this,3)}
else{this._sarissa_load(sURI)}}
catch(objException){this.parseError=-1}
finally{if(this.async==false){Sarissa.__handleLoad__(this)}};return oDoc}};Sarissa.__handleLoad__=function(oDoc){if(!oDoc.documentElement||oDoc.documentElement.tagName=="parsererror")
oDoc.parseError=-1;Sarissa.__setReadyState__(oDoc,4)};_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this)};Sarissa.__setReadyState__=function(oDoc,iReadyState){oDoc.readyState=iReadyState;if(oDoc.onreadystatechange!=null&&typeof oDoc.onreadystatechange=="function")
oDoc.onreadystatechange()};Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:"",sName?sName:"",null);oDoc.addEventListener("load",_sarissa_XMLDocument_onload,false);return oDoc}}};if(!window.DOMParser){DOMParser=function(){};DOMParser.prototype.parseFromString=function(sXml,contentType){var doc=Sarissa.getDomDocument();doc.loadXML(sXml);return doc}};if(window.XMLHttpRequest){Sarissa.IS_ENABLED_XMLHTTP=true}
else if(_SARISSA_IS_IE){XMLHttpRequest=function(){return new ActiveXObject(_SARISSA_XMLHTTP_PROGID)};Sarissa.IS_ENABLED_XMLHTTP=true};if(!window.document.importNode&&_SARISSA_IS_IE){try{window.document.importNode=function(oNode,bChildren){var importNode=document.createElement("div");if(bChildren)
importNode.innerHTML=Sarissa.serialize(oNode);else
importNode.innerHTML=Sarissa.serialize(oNode.cloneNode(false));return importNode.firstChild}}catch(e){}};if(!Sarissa.getParseErrorText){Sarissa.getParseErrorText=function(oDoc){var parseErrorText=Sarissa.PARSED_OK;if(oDoc.parseError!=0){if(oDoc.documentElement.tagName=="parsererror"){parseErrorText=oDoc.documentElement.firstChild.data;parseErrorText+="\n"+oDoc.documentElement.firstChild.nextSibling.firstChild.data}
else if(oDoc.documentElement.tagName=="html"){parseErrorText=Sarissa.getText(oDoc.documentElement.getElementsByTagName("h1")[0],false)+"\n";parseErrorText+=Sarissa.getText(oDoc.documentElement.getElementsByTagName("body")[0],false)+"\n";parseErrorText+=Sarissa.getText(oDoc.documentElement.getElementsByTagName("pre")[0],false)}};return parseErrorText}};Sarissa.getText=function(oNode,deep){var s="";var nodes=oNode.childNodes;for(var i=0;i<nodes.length;i++){var node=nodes[i];var nodeType=node.nodeType;if(nodeType==Node.TEXT_NODE||nodeType==Node.CDATA_SECTION_NODE){s+=node.data}
else if(deep==true&&(nodeType==Node.ELEMENT_NODE||nodeType==Node.DOCUMENT_NODE||nodeType==Node.DOCUMENT_FRAGMENT_NODE)){s+=Sarissa.getText(node,true)}};return s};if(window.XMLSerializer){Sarissa.serialize=function(oDoc){return(new XMLSerializer()).serializeToString(oDoc)}}else{if((Sarissa.getDomDocument("","foo",null)).xml){Sarissa.serialize=function(oDoc){return oDoc.xml};XMLSerializer=function(){};XMLSerializer.prototype.serializeToString=function(oNode){return oNode.xml}}};Sarissa.stripTags=function(s){return s.replace(/<[^>]+>/g,"")};Sarissa.clearChildNodes=function(oNode){while(oNode.hasChildNodes()){oNode.removeChild(oNode.firstChild)}};Sarissa.copyChildNodes=function(nodeFrom,nodeTo,bPreserveExisting){if(!bPreserveExisting){Sarissa.clearChildNodes(nodeTo)};var ownerDoc=nodeTo.nodeType==Node.DOCUMENT_NODE?nodeTo:nodeTo.ownerDocument;var nodes=nodeFrom.childNodes;if(ownerDoc.importNode&&(!_SARISSA_IS_IE)){for(var i=0;i<nodes.length;i++){nodeTo.appendChild(ownerDoc.importNode(nodes[i],true))}}
else{for(var i=0;i<nodes.length;i++){nodeTo.appendChild(nodes[i].cloneNode(true))}}};Sarissa.moveChildNodes=function(nodeFrom,nodeTo,bPreserveExisting){if(!bPreserveExisting){Sarissa.clearChildNodes(nodeTo)};var nodes=nodeFrom.childNodes;if(nodeFrom.ownerDocument==nodeTo.ownerDocument){nodeTo.appendChild(nodes[i])}else{var ownerDoc=nodeTo.nodeType==Node.DOCUMENT_NODE?nodeTo:nodeTo.ownerDocument;if(ownerDoc.importNode&&(!_SARISSA_IS_IE)){for(var i=0;i<nodes.length;i++){nodeTo.appendChild(ownerDoc.importNode(nodes[i],true))}}
else{for(var i=0;i<nodes.length;i++){nodeTo.appendChild(nodes[i].cloneNode(true))}};Sarissa.clearChildNodes(nodeFrom)}};Sarissa.xmlize=function(anyObject,objectName,indentSpace){indentSpace=indentSpace?indentSpace:'';var s=indentSpace+'<'+objectName+'>';var isLeaf=false;if(!(anyObject instanceof Object)||anyObject instanceof Number||anyObject instanceof String||anyObject instanceof Boolean||anyObject instanceof Date){s+=Sarissa.escape(""+anyObject);isLeaf=true}else{s+="\n";var itemKey='';var isArrayItem=anyObject instanceof Array;for(var name in anyObject){s+=Sarissa.xmlize(anyObject[name],(isArrayItem?"array-item key=\""+name+"\"":name),indentSpace+"   ")};s+=indentSpace};return s+=(objectName.indexOf(' ')!=-1?"</array-item>\n":"</"+objectName+">\n")};Sarissa.escape=function(sXml){return sXml.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g, "&quot;").replace(/'/g,"&apos;")};Sarissa.unescape=function(sXml){return sXml.replace(/&apos;/g,"'").replace(/&quot;/g,"\"").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")};

/* - login.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/login.js?original=1
function cookiesEnabled(){var c="areYourCookiesEnabled=0";document.cookie=c;var dc=document.cookie;if(dc.indexOf(c)==-1) return 0;c="areYourCookiesEnabled=1";document.cookie=c;dc=document.cookie;if(dc.indexOf(c)==-1) return 0;document.cookie="areYourCookiesEnabled=; expires=Thu, 01-Jan-70 00:00:01 GMT";return 1}
function setLoginVars(user_name_id,alt_user_name_id,password_id,empty_password_id,js_enabled_id,cookies_enabled_id){if(js_enabled_id){el=document.getElementById(js_enabled_id);if(el){el.value=1}}
if(cookies_enabled_id){el=document.getElementById(cookies_enabled_id);if(el){el.value=cookiesEnabled()}}
if(user_name_id&&alt_user_name_id){user_name=document.getElementById(user_name_id)
alt_user_name=document.getElementById(alt_user_name_id)
if(user_name&&alt_user_name){alt_user_name.value=user_name.value}}
if(password_id&&empty_password_id){password=document.getElementById(password_id)
empty_password=document.getElementById(empty_password_id)
if(password&&empty_password){if(password.value.length==0){empty_password.value='1'} else{empty_password.value='0'}}}
return 1}
function showCookieMessage(msg_id){msg=document.getElementById(msg_id)
if(msg){if(cookiesEnabled()){msg.style.display='none'} else{msg.style.display='block'}}}
function showEnableCookiesMessage(){showCookieMessage('enable_cookies_message')}
registerPloneFunction(showEnableCookiesMessage);

/* - formsubmithelpers.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/formsubmithelpers.js?original=1
function inputSubmitOnClick(event){if(!event) var event=window.event;if(hasClassName(this,'submitting')){return confirm(window.form_resubmit_message)} else{addClassName(this,'submitting')}
return true}
function registerSubmitHandler(){var nodes=cssQuery('input[type=submit]');for(var i=0;i<nodes.length;i++){var node=nodes[i];if(!node.onclick){node.onclick=inputSubmitOnClick}}}
registerPloneFunction(registerSubmitHandler);

/* - kupunoi18n.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupunoi18n.js?original=1
window._=function(msgid,interpolations){if(interpolations){for(var id in interpolations){var value=interpolations[id];var reg=new RegExp('\\\$\\\{'+id+'\\\}','g');msgid=msgid.replace(reg,""+value)}};return msgid};

/* - sarissa_ieemu_xpath.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/sarissa_ieemu_xpath.js?original=1
if(_SARISSA_HAS_DOM_FEATURE&&document.implementation.hasFeature("XPath","3.0")){var xmldoc=window.XMLDocument||window.Document;
function SarissaNodeList(i){this.length=i};SarissaNodeList.prototype.item=function(i){return(i<0||i>=this.length)?null:this[i]};SarissaNodeList.prototype.expr="";xmldoc.prototype.setProperty=function(x,y){};Sarissa.setXpathNamespaces=function(oDoc,sNsSet){oDoc._sarissa_useCustomResolver=true;var namespaces=sNsSet.indexOf(" ")>-1?sNsSet.split(" "):new Array(sNsSet);oDoc._sarissa_xpathNamespaces=new Array(namespaces.length);for(var i=0;i<namespaces.length;i++){var ns=namespaces[i];var colonPos=ns.indexOf(":");var assignPos=ns.indexOf("=");if(colonPos==5&&assignPos>colonPos+2){var prefix=ns.substring(colonPos+1,assignPos);var uri=ns.substring(assignPos+2,ns.length-1);oDoc._sarissa_xpathNamespaces[prefix]=uri}else{throw "Bad format on namespace declaration(s) given"}}};xmldoc.prototype._sarissa_useCustomResolver=false;xmldoc.prototype._sarissa_xpathNamespaces=new Array();xmldoc.prototype.selectNodes=function(sExpr,contextNode){var nsDoc=this;var nsresolver=this._sarissa_useCustomResolver? function(prefix){var s=nsDoc._sarissa_xpathNamespaces[prefix];if(s)return s;else throw "No namespace URI found for prefix: '"+prefix+"'"}:this.createNSResolver(this.documentElement);var oResult=this.evaluate(sExpr,(contextNode?contextNode:this),nsresolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var nodeList=new SarissaNodeList(oResult.snapshotLength);nodeList.expr=sExpr;for(var i=0;i<nodeList.length;i++)
nodeList[i]=oResult.snapshotItem(i);return nodeList};Element.prototype.selectNodes=function(sExpr){var doc=this.ownerDocument;if(doc.selectNodes)
return doc.selectNodes(sExpr,this);else
throw "Method selectNodes is only supported by XML Elements"};xmldoc.prototype.selectSingleNode=function(sExpr,contextNode){var ctx=contextNode?contextNode:null;sExpr="("+sExpr+")[1]";var nodeList=this.selectNodes(sExpr,ctx);if(nodeList.length>0)
return nodeList.item(0);else
return null};Element.prototype.selectSingleNode=function(sExpr){var doc=this.ownerDocument;if(doc.selectSingleNode)
return doc.selectSingleNode(sExpr,this);else
throw "Method selectNodes is only supported by XML Elements"};Sarissa.IS_ENABLED_SELECT_NODES=true;xmldoc=undefined};

/* - kupuhelpers.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupuhelpers.js?original=1
function addEventHandler(element,event,method,context){var wrappedmethod=new ContextFixer(method,context);var args=new Array(null,null);for(var i=4;i<arguments.length;i++){args.push(arguments[i])};wrappedmethod.args=args;try{if(element.addEventListener){element.addEventListener(event,wrappedmethod.execute,false)} else if(element.attachEvent){element.attachEvent("on"+event,wrappedmethod.execute)} else{throw _("Unsupported browser!")};return wrappedmethod.execute} catch(e){alert(_('exception ${message} while registering an event handler '+'for element ${element}, event ${event}, method ${method}',{'message':e.message,'element':element,'event':event,'method':method}))}};
function removeEventHandler(element,event,method){if(element.removeEventListener){element.removeEventListener(event,method,false)} else if(element.detachEvent){element.detachEvent("on"+event,method)} else{throw _("Unsupported browser!")}};
function getFromSelector(selector){var match=/#(\S+)\s*([^ .]+)\.(\S+)/.exec(selector);if(!match){return window.document.getElementById(selector)}
var id=match[1],tag=match[2],className=match[3];var base=window.document.getElementById(id);return getBaseTagClass(base,tag,className)}
function getBaseTagClass(base,tag,className){var classPat=new RegExp('\\b'+className+'\\b');var nodes=base.getElementsByTagName(tag);for(var i=0;i<nodes.length;i++){if(classPat.test(nodes[i].className)){return nodes[i]}}
return null}
function openPopup(url,width,height){var sw=screen.width;var sh=screen.height;var left=sw/ 2 - width / 2;var top=sh/ 2 - height / 2;var win=window.open(url,'someWindow','width='+width+',height='+height+',left='+left+',top='+top);return win};
function selectSelectItem(select,item){for(var i=0;i<select.options.length;i++){var option=select.options[i];if(option.value==item){select.selectedIndex=i;return}}
select.selectedIndex=0};
function ParentWithStyleChecker(tagnames,style,stylevalue,command){return function(selNode,button,editor,event){if(command){var result=editor.getInnerDocument().queryCommandState(command)
if(result||editor.getSelection().getContentLength()==0){return result}};var currnode=selNode;while(currnode&&currnode.style){for(var i=0;i<tagnames.length;i++){if(currnode.nodeName.toLowerCase()==tagnames[i].toLowerCase()){return true}};if(style&&currnode.style[style]==stylevalue){return true};currnode=currnode.parentNode};return false}};
function _load_dict_helper(element){var dict={};for(var i=0;i<element.childNodes.length;i++){var child=element.childNodes[i];if(child.nodeType==1){var value='';for(var j=0;j<child.childNodes.length;j++){if(child.childNodes[j].nodeType==1){value=_load_dict_helper(child);break} else if(typeof(value)==typeof('')){value+=child.childNodes[j].nodeValue}};if(typeof(value)==typeof('')&&!isNaN(parseInt(value))&&parseInt(value).toString().length==value.length){value=parseInt(value)} else if(typeof(value)!=typeof('')){if(value.length==1){value=value[0]}};var name=child.nodeName.toLowerCase();if(child.attributes[0]&&/^_/.test(child.attributes[0])){name+=child.attributes[0].toLowerCase()}
if(dict[name]!=undefined){if(!dict[name].push){dict[name]=new Array(dict[name],value)} else{dict[name].push(value)}} else{dict[name]=value}}};return dict};
function loadDictFromXML(document,islandid){var dict={};var confnode=getFromSelector(islandid);var root=null;for(var i=0;i<confnode.childNodes.length;i++){if(confnode.childNodes[i].nodeType==1){root=confnode.childNodes[i];break}};if(!root){throw(_('No element found in the config island!'))};dict=_load_dict_helper(root);return dict};
function NodeIterator(node,continueatnextsibling){this.node=node;this.current=node;this.terminator=continueatnextsibling?null:node;this.next=function(){if(this.current===false){this.current=this.node};var current=this.current;if(current.firstChild){this.current=current.firstChild} else{while(current!=this.terminator&&!current.nextSibling){current=current.parentNode};if(current==this.terminator){this.current=false} else{this.current=current.nextSibling}};return this.current};this.reset=function(){this.current=this.node};this.setCurrent=function(node){this.current=node}};
function BaseSelection(){this.splitNodeAtSelection=function(node){if(!this.selectionInsideNode(node)){throw(_('Selection not inside the node!'))};var doc=this.document.getDocument();var br=doc.createElement('br');br.setAttribute('node_splitter','indeed');this.replaceWithNode(br);var clone=node.cloneNode(true);var iterator=new NodeIterator(node);var currnode=iterator.next();var remove=false;while(currnode){if(currnode.nodeName.toLowerCase()=='br'&&currnode.getAttribute('node_splitter')=='indeed'){remove=true};var lastnode=currnode;currnode=iterator.next();if(remove&&(lastnode.nodeType==3||!lastnode.hasChildNodes())){lastnode.parentNode.removeChild(lastnode)}};var iterator=new NodeIterator(clone);var currnode=iterator.next();var remove=true;while(currnode){var lastnode=currnode;currnode=iterator.next();if(lastnode.nodeName.toLowerCase()=='br'&&lastnode.getAttribute('node_splitter')=='indeed'){lastnode.parentNode.removeChild(lastnode);remove=false};if(remove&&(lastnode.nodeType==3||!lastnode.hasChildNodes())){lastnode.parentNode.removeChild(lastnode)}};if(node.nextSibling){node.parentNode.insertBefore(clone,node.nextSibling)} else{node.parentNode.appendChild(clone)};this.reset();return clone};this.selectionInsideNode=function(node){var currnode=this.parentElement();while(currnode){if(currnode==node){return true};currnode=currnode.parentNode};return false}};
function MozillaSelection(document){this.document=document;this.selection=document.getWindow().getSelection();this.selectNodeContents=function(node){this.selection.removeAllRanges();this.selection.selectAllChildren(node)};this.collapse=function(collapseToEnd){try{if(!collapseToEnd){this.selection.collapseToStart()} else{this.selection.collapseToEnd()}} catch(e){}};this.replaceWithNode=function(node,selectAfterPlace){var range=this.selection.getRangeAt(0);this.selection.removeAllRanges();range.deleteContents();var container=range.startContainer;var pos=range.startOffset;var range=this.document.getDocument().createRange();if(container.nodeType==3&&node.nodeType==3){container.insertData(pos,node.nodeValue);range.setEnd(container,pos+node.length);range.setStart(container,pos+node.length)} else{var afterNode;if(container.nodeType==3){var textNode=container;var container=textNode.parentNode;var text=textNode.nodeValue;var textBefore=text.substr(0,pos);var textAfter=text.substr(pos);var beforeNode=this.document.getDocument().createTextNode(textBefore);afterNode=this.document.getDocument().createTextNode(textAfter);container.insertBefore(afterNode,textNode);container.insertBefore(node,afterNode);container.insertBefore(beforeNode,node);container.removeChild(textNode)} else{afterNode=container.childNodes[pos];if(afterNode){container.insertBefore(node,afterNode)} else{container.appendChild(node)}}
range.setEnd(afterNode,0);range.setStart(afterNode,0)}
if(selectAfterPlace){this.selection=this.document.getWindow().getSelection();this.selection.addRange(range);if(selectAfterPlace.nodeType==1){this.selection.selectAllChildren(selectAfterPlace)} else{if(node.hasChildNodes()){this.selection.selectAllChildren(node)} else{var range=this.selection.getRangeAt(0).cloneRange();this.selection.removeAllRanges();range.selectNode(node);this.selection.addRange(range)}};this.document.getWindow().focus()};return node};this.startOffset=function(){var startnode=this.startNode();var startnodeoffset=0;if(startnode==this.selection.anchorNode){startnodeoffset=this.selection.anchorOffset} else{startnodeoffset=this.selection.focusOffset};var parentnode=this.parentElement();if(startnode==parentnode){return startnodeoffset};var currnode=parentnode.firstChild;var offset=0;if(!currnode){if(startnodeoffset!=0){throw(_('Start node offset detected in a node without children!'))};return 0};while(currnode!=startnode){if(currnode.nodeType==3){offset+=currnode.nodeValue.length};currnode=currnode.nextSibling};return offset+startnodeoffset};this.startNode=function(){var anode=this.selection.anchorNode;var aoffset=this.selection.anchorOffset;var onode=this.selection.focusNode;var ooffset=this.selection.focusOffset;var arange=this.document.getDocument().createRange();arange.setStart(anode,aoffset);var orange=this.document.getDocument().createRange();orange.setStart(onode,ooffset);return arange.compareBoundaryPoints('START_TO_START',orange)<=0?anode:onode};this.endOffset=function(){var endnode=this.endNode();var endnodeoffset=0;if(endnode=this.selection.focusNode){endnodeoffset=this.selection.focusOffset} else{endnodeoffset=this.selection.anchorOffset};var parentnode=this.parentElement();var currnode=parentnode.firstChild;var offset=0;if(parentnode==endnode){for(var i=0;i<parentnode.childNodes.length;i++){var child=parentnode.childNodes[i];if(i==endnodeoffset){return offset};if(child.nodeType==3){offset+=child.nodeValue.length}}};if(!currnode){if(endnodeoffset!=0){var msg=_('End node offset detected in a node without '+'children!');alert(msg);throw(msg)};return 0};while(currnode!=endnode){if(currnode.nodeType==3){offset+=currnode.nodeValue.length};currnode=currnode.nextSibling};return offset+endnodeoffset};this.endNode=function(){var anode=this.selection.anchorNode;var aoffset=this.selection.anchorOffset;var onode=this.selection.focusNode;var ooffset=this.selection.focusOffset;var arange=this.document.getDocument().createRange();arange.setStart(anode,aoffset);var orange=this.document.getDocument().createRange();orange.setStart(onode,ooffset);return arange.compareBoundaryPoints('START_TO_START',orange)>0?anode:onode};this.getContentLength=function(){return this.selection.toString().length};this.cutChunk=function(startOffset,endOffset){var range=this.selection.getRangeAt(0);var offsetParent=this.parentElement();var currnode=offsetParent.firstChild;var curroffset=0;var startparent=null;var startparentoffset=0;while(currnode){if(currnode.nodeType==3){var nodelength=currnode.nodeValue.length;if(curroffset+nodelength<startOffset){curroffset+=nodelength} else{startparent=currnode;startparentoffset=startOffset-curroffset;break}};currnode=currnode.nextSibling};var currnode=offsetParent.firstChild;var curroffset=0;var endparent=null;var endoffset=0;while(currnode){if(currnode.nodeType==3){var nodelength=currnode.nodeValue.length;if(curroffset+nodelength<endOffset){curroffset+=nodelength} else{endparent=currnode;endparentoffset=endOffset-curroffset;break}};currnode=currnode.nextSibling};if(!startparent){throw(_('Start offset out of range!'))};if(!endparent){throw(_('End offset out of range!'))};var newrange=range.cloneRange();newrange.setStart(startparent,startparentoffset);newrange.setEnd(endparent,endparentoffset);return newrange.extractContents()};this.getElementLength=function(element){var length=0;var currnode=element.firstChild;while(currnode){if(currnode.nodeType==3){length+=currnode.nodeValue.length};currnode=currnode.nextSibling};return length};this.parentElement=function(){if(this.selection.rangeCount==0){var parent=this.document.getDocument().body;while(parent.firstChild){parent=parent.firstChild}} else{var range=this.selection.getRangeAt(0);var parent=range.commonAncestorContainer;var inv=range.compareBoundaryPoints(Range.START_TO_END,range)<0;var startNode=inv?range.endContainer:range.startContainer;var startOffset=inv?range.endOffset:range.startOffset;var endNode=inv?range.startContainer:range.endContainer;var endOffset=inv?range.startOffset:range.endOffset;var selectedChild=null;var child=parent.firstChild;while(child){if(range.intersectsNode(child)&&!(child==startNode&&startOffset==child.length)&&!(child==endNode&&endOffset==0)){if(selectedChild){selectedChild=null;break} else{selectedChild=child}} else if(selectedChild){break};child=child.nextSibling};if(selectedChild){parent=selectedChild}};if(parent.nodeType==Node.TEXT_NODE){parent=parent.parentNode};return parent};this.getSelectedNode=this.parentElement;this.moveStart=function(offset){var offsetparent=this.parentElement();var startoffset=this.startOffset();var realoffset=offset+startoffset;if(realoffset>=0){var currnode=offsetparent.firstChild;var curroffset=0;var startparent=null;var startoffset=0;while(currnode){if(currnode.nodeType==3){var nodelength=currnode.nodeValue.length;if(curroffset+nodelength>=realoffset){var range=this.selection.getRangeAt(0);range.setStart(currnode,realoffset-curroffset);return}};currnode=currnode.nextSibling};var currnode=offsetparent.nextSibling;while(currnode){if(currnode.nodeType==3){var nodelength=currnode.nodeValue.length;if(curroffset+nodelength>=realoffset){var range=this.selection.getRangeAt(0);var endnode=this.endNode();var endoffset=this.endOffset();range.setEnd(currnode,realoffset-curroffset);range.setStart(endnode,endoffset);return};curroffset+=nodelength};currnode=currnode.nextSibling};throw(_('Offset out of document range'))} else if(realoffset<0){var currnode=offsetparent.prevSibling;var curroffset=0;while(currnode){if(currnode.nodeType==3){var currlength=currnode.nodeValue.length;if(curroffset-currlength<realoffset){var range=this.selection.getRangeAt(0);range.setStart(currnode,realoffset-curroffset)};curroffset-=currlength};currnode=currnode.prevSibling}} else{var range=this.selection.getRangeAt(0);range.setStart(offsetparent,0)}};this.moveEnd=function(offset){};this.reset=function(){this.selection=this.document.getWindow().getSelection()};this.cloneContents=function(){var range=this.selection.getRangeAt(0);return range.cloneContents()};this.containsNode=function(node){return this.selection.containsNode(node,true)}
this.toString=function(){return this.selection.toString()};this.getRange=function(){return this.selection.getRangeAt(0)}
this.restoreRange=function(range){var selection=this.selection;selection.removeAllRanges();selection.addRange(range)}};MozillaSelection.prototype=new BaseSelection;
function IESelection(document){this.document=document;this.selection=document.getDocument().selection;var doc=document.getDocument();var range=this.selection.createRange()
var parent=this.selection.type=="Text"?range.parentElement():this.selection.type=="Control"?range.parentElement:null;if(parent&&parent.ownerDocument!=doc){var range=doc.body.createTextRange();range.collapse();range.select()}
this.selectNodeContents=function(node){var range=this.selection.createRange().duplicate();range.moveToElementText(node);range.moveStart('character',1);range.moveStart('character',-1);range.moveEnd('character',-1);range.moveEnd('character',1);range.select();this.selection=this.document.getDocument().selection};this.collapse=function(collapseToEnd){var range=this.selection.createRange();range.collapse(!collapseToEnd);range.select();this.selection=document.getDocument().selection};this.replaceWithNode=function(newnode,selectAfterPlace){if(this.selection.type=='Control'){var range=this.selection.createRange();range.item(0).parentNode.replaceChild(newnode,range.item(0));for(var i=1;i<range.length;i++){range.item(i).parentNode.removeChild(range[i])};if(selectAfterPlace){var range=this.document.getDocument().body.createTextRange();range.moveToElementText(newnode);range.select()}} else{var document=this.document.getDocument();var range=this.selection.createRange();range.pasteHTML('<img id="kupu-tempnode">');tempnode=document.getElementById('kupu-tempnode');tempnode.replaceNode(newnode);if(selectAfterPlace){if(selectAfterPlace.nodeType==Node.ELEMENT_NODE){range.moveToElementText(selectAfterPlace)} else{range.moveToElementText(newnode)};range.select()}};this.reset();return newnode};this.startOffset=function(){var startoffset=0;var selrange=this.selection.createRange();var parent=selrange.parentElement();var elrange=selrange.duplicate();elrange.moveToElementText(parent);var tempstart=selrange.duplicate();while(elrange.compareEndPoints('StartToStart',tempstart)<0){startoffset++;tempstart.moveStart('character',-1)};return startoffset};this.endOffset=function(){var endoffset=0;var selrange=this.selection.createRange();var parent=selrange.parentElement();var elrange=selrange.duplicate();elrange.moveToElementText(parent);var tempend=selrange.duplicate();while(elrange.compareEndPoints('EndToEnd',tempend)>0){endoffset++;tempend.moveEnd('character',1)};return endoffset};this.getContentLength=function(){if(this.selection.type=='Control'){return this.selection.createRange().length};var contentlength=0;var range=this.selection.createRange();var endrange=range.duplicate();while(range.compareEndPoints('StartToEnd',endrange)<0){range.move('character',1);contentlength++};return contentlength};this.cutChunk=function(startOffset,endOffset){var range=this.selection.createRange().duplicate();range.moveStart('character',startOffset);range.moveEnd('character',-endOffset);range.pasteHTML('')};this.getElementLength=function(element){var length=0;var range=this.selection.createRange().duplicate();range.moveToElementText(element);range.moveStart('character',1);range.moveEnd('character',-1);var endpoint=range.duplicate();endpoint.collapse(false);range.collapse();while(!range.isEqual(endpoint)){range.moveEnd('character',1);range.moveStart('character',1);length++};return length};this.parentElement=function(){if(this.selection.type=='Control'){return this.selection.createRange().item(0)} else{return this.selection.createRange().parentElement()}};this.getSelectedNode=this.parentElement;this.moveStart=function(offset){var range=this.selection.createRange();range.moveStart('character',offset);range.select()};this.moveEnd=function(offset){var range=this.selection.createRange();range.moveEnd('character',offset);range.select()};this.reset=function(){this.selection=this.document.getDocument().selection};this.cloneContents=function(){var contents=this.selection.createRange().htmlText;var doc=this.document.getDocument();var docfrag=doc.createElement('span');docfrag.innerHTML=contents;return docfrag};this.containsNode=function(node){var selected=this.selection.createRange();if(this.selection.type.toLowerCase()=='text'){var range=doc.body.createTextRange();range.moveToElementText(node);if(selected.compareEndPoints('StartToEnd',range)>=0||selected.compareEndPoints('EndToStart',range)<=0){return false}
return true} else{for(var i=0;i<selected.length;i++){if(selected.item(i).contains(node)){return true}}
return false}};this.getRange=function(){return this.selection.createRange()}
this.restoreRange=function(range){try{range.select()} catch(e){}}
this.toString=function(){return this.selection.createRange().text}};IESelection.prototype=new BaseSelection;
function ContextFixer(func,context){this.func=func;this.context=context;this.args=arguments;var self=this;this.execute=function(){var args=new Array();for(var i=0;i<self.args.length-2;i++){args.push(self.args[i+2])};for(var i=0;i<arguments.length;i++){args.push(arguments[i])};return self.func.apply(self.context,args)}};
function Timer(){this.lastid=0;this.functions={};this.registerFunction=function(object,func,timeout){var args=new Array();for(var i=0;i<arguments.length-3;i++){args.push(arguments[i+3])}
var id=this._createUniqueId();this.functions[id]=new Array(object,func,args);setTimeout("timer_instance._handleFunction("+id+")",timeout)};this._handleFunction=function(id){var obj=this.functions[id][0];var func=this.functions[id][1];var args=this.functions[id][2];this.functions[id]=null;func.apply(obj,args)};this._createUniqueId=function(){while(this.lastid in this.functions&&this.functions[this.lastid]){this.lastid++;if(this.lastid>100000){this.lastid=0}}
return this.lastid}};timer_instance=new Timer();Array.prototype.contains=function(element,objectequality){for(var i=0;i<this.length;i++){if(objectequality){if(element===this[i]){return true}} else{if(element==this[i]){return true}}};return false};Array.prototype.removeDoubles=function(){var ret=[];for(var i=0;i<this.length;i++){if(!ret.contains(this[i])){ret.push(this[i])}};return ret};Array.prototype.map=function(func){for(var i=0;i<this.length;i++){this[i]=func(this[i])}};Array.prototype.reversed=function(){var ret=[];for(var i=this.length;i>0;i--){ret.push(this[i-1])};return ret};String.prototype.strip=function(){var stripspace=/^\s*([\s\S]*?)\s*$/;return stripspace.exec(this)[1]};String.prototype.reduceWhitespace=function(){var spacereg=/(\s+)/g;var copy=this;while(true){var match=spacereg.exec(copy);if(!match){return copy};copy=copy.replace(match[0],' ')}};String.prototype.entitize=function(){var ret=this.replace(/&/g,'&amp;');ret=ret.replace(/"/g,'&quot;');ret=ret.replace(/'/g, '&apos;');ret=ret.replace(/</g,'&lt;');ret=ret.replace(/>/g,'&gt;');return ret};String.prototype.deentitize=function(){var ret=this.replace(/&gt;/g,'>');ret=ret.replace(/&lt;/g,'<');ret=ret.replace(/&quot;/g,'"');ret=ret.replace(/&apos;/g,"'");ret=ret.replace(/&amp;/g,'&');return ret};String.prototype.urldecode=function(){var reg=/%([a-fA-F0-9]{2})/g;var str=this;while(true){var match=reg.exec(str);if(!match||!match.length){break};var repl=new RegExp(match[0],'g');str=str.replace(repl,String.fromCharCode(parseInt(match[1],16)))};return str};String.prototype.centerTruncate=function(maxlength){if(this.length<=maxlength){return this};var chunklength=maxlength/2-3;var start=this.substr(0,chunklength);var end=this.substr(this.length-chunklength);return start+' ... '+end};
function debug(str,win){if(!win){win=window};var doc=win.document;var div=doc.createElement('div');div.appendChild(doc.createTextNode(str));doc.getElementsByTagName('body')[0].appendChild(div)};
function Exception(){return};UpdateStateCancelBubble=new Exception();

/* - kupueditor.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupueditor.js?original=1
function KupuDocument(iframe){this.editable=iframe;this.window=this.editable.contentWindow;this.document=this.window.document;this._browser=_SARISSA_IS_IE?'IE':'Mozilla';this.execCommand=function(command,arg){if(arg===undefined) arg=null;this.document.execCommand(command,false,arg)};this.reloadSource=function(){document.location=document.location};this.getDocument=function(){return this.document};this.getWindow=function(){return this.window};this.getSelection=function(){if(this._browser=='Mozilla'){return new MozillaSelection(this)} else{return new IESelection(this)}};this.getEditable=function(){return this.editable}};
function KupuEditor(document,config,logger){this.document=document;this.config=config;this.log=logger;this.tools={};this.filters=new Array();this._designModeSetAttempts=0;this._initialized=false;this._previous_range=null;this.content_changed=false;this.initialize=function(){this._initializeEventHandlers();if(this.getBrowserName()=="IE"){var body=this.getInnerDocument().getElementsByTagName('body')[0];body.setAttribute('contentEditable','true');this._initialized=true;if(this.afterInit){this.afterInit()};this._saveSelection()} else{this._setDesignModeWhenReady()};this.logMessage(_('Editor initialized'))};this.setContextMenu=function(menu){menu.initialize(this)};this.registerTool=function(id,tool){this.tools[id]=tool;tool.initialize(this)};this.getTool=function(id){return this.tools[id]};this.registerFilter=function(filter){this.filters.push(filter);filter.initialize(this)};this.updateStateHandler=function(event){var interesting_codes=new Array(8,13,37,38,39,40,46);this._saveSelection();if(event.type=='click'||event.type=='mouseup'||(event.type=='keyup'&&interesting_codes.contains(event.keyCode))){this.updateState(event)}};this.updateState=function(event){var selNode=this.getSelectedNode();for(var id in this.tools){try{this.tools[id].updateState(selNode,event)} catch(e){if(e==UpdateStateCancelBubble){this.updateState(event);break} else{this.logMessage(_('Exception while processing updateState on '+'${id}: ${msg}',{'id':id,'msg':e}),2)}}}};this.saveDocument=function(redirect,synchronous){if(!this.config.dst){this.logMessage(_('No destination URL available!'),2);return}
var sourcetool=this.getTool('sourceedittool');if(sourcetool){sourcetool.cancelSourceMode()};if(!this._initialized){return}
this._initialized=false;window.status=_("Please wait while saving document...");for(var id in this.tools){var tool=this.tools[id];if(tool.beforeSave){try{tool.beforeSave()} catch(e){alert(e);this._initialized=true;return}}};this.logMessage(_("Starting HTML cleanup"));var transform=this._filterContent(this.getInnerDocument().documentElement);var contents=this._serializeOutputToString(transform);this.logMessage(_("Cleanup done, sending document to server"));var request=new XMLHttpRequest();if(!synchronous){request.onreadystatechange=(new ContextFixer(this._saveCallback,this,request,redirect)).execute;request.open("PUT",this.config.dst,true);request.setRequestHeader("Content-type",this.config.content_type);request.send(contents);this.logMessage(_("Request sent to server"))} else{this.logMessage(_('Sending request to server'));request.open("PUT",this.config.dst,false);request.setRequestHeader("Content-type",this.config.content_type);request.send(contents);this.handleSaveResponse(request,redirect)}};this.prepareForm=function(form,id){var sourcetool=this.getTool('sourceedittool');if(sourcetool){sourcetool.cancelSourceMode()};if(!this._initialized){return}
this._initialized=false;window.status=_("Please wait while saving document...");for(var tid in this.tools){var tool=this.tools[tid];if(tool.beforeSave){try{tool.beforeSave()} catch(e){alert(e);this._initialized=true;return}}};if(!id){id='kupu'};this.logMessage(_("Starting HTML cleanup"));var transform=this._filterContent(this.getInnerDocument().documentElement);var contents=this._serializeOutputToString(transform);this.logMessage(_("Cleanup done, sending document to server"));var document=form.ownerDocument?form.ownerDocument:window.document;var ta=document.createElement('textarea');ta.style.visibility='hidden';var text=document.createTextNode(contents);ta.appendChild(text);ta.setAttribute('name',id);form.appendChild(ta);return true};this.execCommand=function(command,param){if(!this._initialized){this.logMessage(_('Editor not initialized yet!'));return};if(this.getBrowserName()=="IE"){this._restoreSelection()} else{this.focusDocument();if(command!='useCSS'){this.content_changed=true;this.getDocument().execCommand('useCSS',!this.config.use_css)}};this.getDocument().execCommand(command,param);var message=_('Command ${command} executed',{'command':command});if(param){message=_('Command ${command} executed with parameter ${param}',{'command':command,'param':param})}
this.updateState();this.logMessage(message)};this.getSelection=function(){this._restoreSelection();return this.getDocument().getSelection()};this.getSelectedNode=function(){return this.getSelection().parentElement()};this.getNearestParentOfType=function(node,type){var type=type.toLowerCase();while(node){if(node.nodeName.toLowerCase()==type){return node}
var node=node.parentNode}
return false};this.removeNearestParentOfType=function(node,type){var nearest=this.getNearestParentOfType(node,type);if(!nearest){return false};var parent=nearest.parentNode;while(nearest.childNodes.length){var child=nearest.firstChild;child=nearest.removeChild(child);parent.insertBefore(child,nearest)};parent.removeChild(nearest)};this.getDocument=function(){return this.document};this.getInnerDocument=function(){return this.getDocument().getDocument()};this.insertNodeAtSelection=function(insertNode,selectNode){if(!this._initialized){this.logMessage(_('Editor not initialized yet!'));return};this.content_changed=true;var browser=this.getBrowserName();if(browser!="IE"){this.focusDocument()};var ret=this.getSelection().replaceWithNode(insertNode,selectNode);this._saveSelection();return ret};this.focusDocument=function(){this.getDocument().getWindow().focus()}
this.logMessage=function(message,severity){this.log.log(message,severity)};this.registerContentChanger=function(element){addEventHandler(element,'change', function(){this.content_changed=true},this)};this.getBrowserName=function(){if(_SARISSA_IS_MOZ){return "Mozilla"} else if(_SARISSA_IS_IE){return "IE"} else{throw _("Browser not supported!")}};this.handleSaveResponse=function(request,redirect){if(request.status!='200'&&request.status!='204'&&request.status!='1223'){var msg=_('Error saving your data.\nResponse status: '+'${status}.\nCheck your server log for more '+'information.',{'status':request.status});alert(msg);window.status=_("Error saving document")} else if(redirect){window.document.location=redirect;this.content_changed=false} else{this.content_changed=false;if(this.config.reload_after_save){this.reloadSrc()};window.status=_("Document saved")};this._initialized=true};this._addEventHandler=addEventHandler;this._saveCallback=function(request,redirect){if(request.readyState==4){this.handleSaveResponse(request,redirect)}};this.reloadSrc=function(){this.getDocument().reloadSource();if(this.getBrowserName()=="Mozilla"){this.getInnerDocument().designMode="On"}};this._initializeEventHandlers=function(){this._addEventHandler(this.getInnerDocument(),"click",this.updateStateHandler,this);this._addEventHandler(this.getInnerDocument(),"dblclick",this.updateStateHandler,this);this._addEventHandler(this.getInnerDocument(),"keyup",this.updateStateHandler,this);this._addEventHandler(this.getInnerDocument(),"keyup", function(){this.content_changed=true},this);this._addEventHandler(this.getInnerDocument(),"mouseup",this.updateStateHandler,this)};this._setDesignModeWhenReady=function(){this._designModeSetAttempts++;if(this._designModeSetAttempts>25){alert(_('Couldn\'t set design mode. Kupu will not work on this browser.'));return};var success=false;try{this._setDesignMode();success=true} catch(e){timer_instance.registerFunction(this,this._setDesignModeWhenReady,100)};if(success){if(this.afterInit){this.afterInit()}}};this._setDesignMode=function(){this.getInnerDocument().designMode="On";this.execCommand("undo");this._initialized=true};this._saveSelection=function(){if(this._isDocumentSelected()){var currange=this.getInnerDocument().selection.createRange();this._previous_range=currange}};this._restoreSelection=function(){if(this._previous_range&&!this._isDocumentSelected()){try{this._previous_range.select()} catch(e){alert("Error placing back selection");this.logMessage(_('Error placing back selection'))}}};if(this.getBrowserName()!="IE"){this._saveSelection=function(){};this._restoreSelection=function(){}}
this._isDocumentSelected=function(){var editable_body=this.getInnerDocument().getElementsByTagName('body')[0];try{var selrange=this.getInnerDocument().selection.createRange()} catch(e){return false}
var someelement=selrange.parentElement?selrange.parentElement():selrange.item(0);while(someelement.nodeName.toLowerCase()!='body'){someelement=someelement.parentNode};return someelement==editable_body};this._clearSelection=function(){this._previous_range=null};this._filterContent=function(documentElement){var xhtmldoc=Sarissa.getDomDocument();var doc=this._convertToSarissaNode(xhtmldoc,documentElement);for(var i=0;i<this.filters.length;i++){var doc=this.filters[i].filter(xhtmldoc,doc)};this._fixXML(doc,xhtmldoc);return doc};this.getXMLBody=function(transform){var bodies=transform.getElementsByTagName('body');var data='';for(var i=0;i<bodies.length;i++){data+=Sarissa.serialize(bodies[i])}
return this.layoutsource(this.escapeEntities(data))};this.getHTMLBody=function(){var doc=this.getInnerDocument();var docel=doc.documentElement;var bodies=docel.getElementsByTagName('body');var data='';for(var i=0;i<bodies.length;i++){data+=bodies[i].innerHTML}
return this.layoutsource(this.escapeEntities(data))};this.setHTMLBody=function(text){var bodies=this.getInnerDocument().documentElement.getElementsByTagName('body');for(var i=0;i<bodies.length-1;i++){bodies[i].parentNode.removeChild(bodies[i])}
bodies[bodies.length-1].innerHTML=text};this._fixXML=function(doc,document){var heads=doc.getElementsByTagName('head');var titles=doc.getElementsByTagName('title');if(!heads.length){var body=doc.getElementsByTagName('body')[0];var head=document.createElement('head');body.parentNode.insertBefore(head,body);var title=document.createElement('title');var titletext=document.createTextNode('');head.appendChild(title);title.appendChild(titletext)} else if(!titles.length){var head=heads[0];var title=document.createElement('title');var titletext=document.createTextNode('');head.appendChild(title);title.appendChild(titletext)};var dualtons=new Array('a','abbr','acronym','address','applet','b','bdo','big','blink','blockquote','button','caption','center','cite','comment','del','dfn','dir','div','dl','dt','em','embed','fieldset','font','form','frameset','h1','h2','h3','h4','h5','h6','i','iframe','ins','kbd','label','legend','li','listing','map','marquee','menu','multicol','nobr','noembed','noframes','noscript','object','ol','optgroup','option','p','pre','q','s','script','select','small','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','u','ul','xmp');for(var i=0;i<dualtons.length;i++){var elname=dualtons[i];var els=doc.getElementsByTagName(elname);for(var j=0;j<els.length;j++){var el=els[j];if(!el.hasChildNodes()){var child=document.createTextNode('');el.appendChild(child)}}}};this.xhtmlvalid=new XhtmlValidation(this);this._convertToSarissaNode=function(ownerdoc,htmlnode){return this.xhtmlvalid._convertToSarissaNode(ownerdoc,htmlnode)};this._fixupSingletons=function(xml){return xml.replace(/<([^>]+)\/>/g,"<$1 />")}
this._serializeOutputToString=function(transform){if(this.config.strict_output){var contents='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '+'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'+'<html xmlns="http://www.w3.org/1999/xhtml">'+Sarissa.serialize(transform.getElementsByTagName("head")[0])+Sarissa.serialize(transform.getElementsByTagName("body")[0])+'</html>'} else{var contents='<html>'+Sarissa.serialize(transform.getElementsByTagName("head")[0])+Sarissa.serialize(transform.getElementsByTagName("body")[0])+'</html>'};contents=this.escapeEntities(contents);if(this.config.compatible_singletons){contents=this._fixupSingletons(contents)};return contents};this.layoutsource=function(data){data=data.replace(/\s*(<(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td))\b/ig,'\n$1');data=data.replace(/\s*(<\/(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td)>)\s*/ig,'$1\n');return data.strip()}
this.escapeEntities=function(xml){return xml;return xml.replace(/[^\r\n -\177]/g,
function(c){return '&#'+c.charCodeAt(0)+';'})}
this.getFullEditor=function(){var fulleditor=this.getDocument().getEditable();while(!/kupu-fulleditor/.test(fulleditor.className)){fulleditor=fulleditor.parentNode}
return fulleditor}
this.setClass=function(name){this.getFullEditor().className+=' '+name}
this.clearClass=function(name){var fulleditor=this.getFullEditor();fulleditor.className=fulleditor.className.replace(' '+name,'')}
this.suspendEditing=function(){this._previous_range=this.getSelection().getRange();this.setClass('kupu-modal');for(var id in this.tools){this.tools[id].disable()}
if(this.getBrowserName()=="IE"){var body=this.getInnerDocument().getElementsByTagName('body')[0];body.setAttribute('contentEditable','false')} else{this.getInnerDocument().designMode="Off";var iframe=this.getDocument().getEditable();iframe.style.position=iframe.style.position?"":"relative"}
this.suspended=true}
this.resumeEditing=function(){if(!this.suspended){return}
this.suspended=false;this.clearClass('kupu-modal');for(var id in this.tools){this.tools[id].enable()}
if(this.getBrowserName()=="IE"){this._restoreSelection();var body=this.getInnerDocument().getElementsByTagName('body')[0];body.setAttribute('contentEditable','true')} else{var doc=this.getInnerDocument();doc.designMode="On";this.getSelection().restoreRange(this._previous_range)}}}


/* - kupubasetools.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupubasetools.js?original=1
function KupuTool(){this.toolboxes={};this.initialize=function(editor){this.editor=editor};this.registerToolBox=function(id,toolbox){this.toolboxes[id]=toolbox;toolbox.initialize(this,this.editor)};this.updateState=function(selNode,event){for(id in this.toolboxes){this.toolboxes[id].updateState(selNode,event)}};this.enable=function(){}
this.disable=function(){}
addEventHandler=addEventHandler;this._selectSelectItem=function(select,item){this.editor.logMessage(_('Deprecation warning: KupuTool._selectSelectItem'))};this._fixTabIndex=function(element){var tabIndex=this.editor.getDocument().getEditable().tabIndex-1;if(tabIndex&&!element.tabIndex){element.tabIndex=tabIndex}}}
function KupuToolBox(){this.initialize=function(tool,editor){this.tool=tool;this.editor=editor};this.updateState=function(selNode,event){};this._selectSelectItem=function(select,item){this.editor.logMessage(_('Deprecation warning: KupuToolBox._selectSelectItem'))}};
function NoContextMenu(object){object.createContextMenuElements=function(selNode,event){return []}
return object}
function KupuButtonDisable(button){button=button||this.button;button.disabled="disabled";button.className+=' disabled'}
function KupuButtonEnable(button){button=button||this.button;button.disabled="";button.className=button.className.replace(/ *\bdisabled\b/g,'')}
function KupuButton(buttonid,commandfunc,tool){this.buttonid=buttonid;this.button=getFromSelector(buttonid);this.commandfunc=commandfunc;this.tool=tool;this.initialize=function(editor){this.editor=editor;this._fixTabIndex(this.button);addEventHandler(this.button,'click',this.execCommand,this)};this.execCommand=function(){this.commandfunc(this,this.editor,this.tool)};this.updateState=function(selNode,event){};this.disable=KupuButtonDisable;this.enable=KupuButtonEnable};KupuButton.prototype=new KupuTool;
function KupuStateButton(buttonid,commandfunc,checkfunc,offclass,onclass){this.buttonid=buttonid;this.button=getFromSelector(buttonid);this.commandfunc=commandfunc;this.checkfunc=checkfunc;this.offclass=offclass;this.onclass=onclass;this.pressed=false;this.execCommand=function(){this.button.className=(this.pressed?this.offclass:this.onclass);this.pressed=!this.pressed;this.editor.focusDocument();this.commandfunc(this,this.editor)};this.updateState=function(selNode,event){var currclass=this.button.className;var newclass=null;if(this.checkfunc(selNode,this,this.editor,event)){newclass=this.onclass;this.pressed=true} else{newclass=this.offclass;this.pressed=false};if(currclass!=newclass){this.button.className=newclass}}};KupuStateButton.prototype=new KupuButton;
function KupuLateFocusStateButton(buttonid,commandfunc,checkfunc,offclass,onclass){KupuStateButton.apply(this,[buttonid,commandfunc,checkfunc,offclass,onclass]);this.execCommand=function(){this.button.className=(this.pressed?this.offclass:this.onclass);this.pressed=!this.pressed;this.commandfunc(this,this.editor);this.editor.focusDocument()}}
KupuLateFocusStateButton.prototype=new KupuStateButton;
function KupuRemoveElementButton(buttonid,element_name,cssclass){this.button=getFromSelector(buttonid);this.onclass='invisible';this.offclass=cssclass;this.pressed=false;this.commandfunc=function(button,editor){editor.removeNearestParentOfType(editor.getSelectedNode(),element_name)};this.checkfunc=function(currnode,button,editor,event){var element=editor.getNearestParentOfType(currnode,element_name);return(element?false:true)}};KupuRemoveElementButton.prototype=new KupuStateButton;
function KupuUI(textstyleselectid){this.tsselect=getFromSelector(textstyleselectid);var paraoptions=[];var tableoptions=[];this.optionstate=-1;this.otherstyle=null;this.tablestyles={};this.styles={};this.initialize=function(editor){this.editor=editor;this.cleanStyles();this.enableOptions(false);this._fixTabIndex(this.tsselect);this._selectevent=addEventHandler(this.tsselect,'change',this.setTextStyleHandler,this)};this.getStyles=function(){if(!paraoptions){this.cleanStyles()}
return [paraoptions,tableoptions]}
this.setTextStyleHandler=function(event){this.setTextStyle(this.tsselect.options[this.tsselect.selectedIndex].value)};this.basicButtonHandler=function(action){this.editor.execCommand(action);this.editor.updateState()};this.saveButtonHandler=function(){this.editor.saveDocument()};this.saveAndExitButtonHandler=function(redirect_url){this.editor.saveDocument(redirect_url)};this.cutButtonHandler=function(){try{this.editor.execCommand('Cut')} catch(e){if(this.editor.getBrowserName()=='Mozilla'){alert(_('Cutting from JavaScript is disabled on your Mozilla due to security settings. For more information, read http://www.mozilla.org/editor/midasdemo/securityprefs.html'))} else{throw e}};this.editor.updateState()};this.copyButtonHandler=function(){try{this.editor.execCommand('Copy')} catch(e){if(this.editor.getBrowserName()=='Mozilla'){alert(_('Copying from JavaScript is disabled on your Mozilla due to security settings. For more information, read http://www.mozilla.org/editor/midasdemo/securityprefs.html'))} else{throw e}};this.editor.updateState()};this.pasteButtonHandler=function(){try{this.editor.execCommand('Paste')} catch(e){if(this.editor.getBrowserName()=='Mozilla'){alert(_('Pasting from JavaScript is disabled on your Mozilla due to security settings. For more information, read http://www.mozilla.org/editor/midasdemo/securityprefs.html'))} else{throw e}};this.editor.updateState()};this.cleanStyles=function(){var options=this.tsselect.options;var parastyles=this.styles;var tablestyles=this.tablestyles;tableoptions.push([options[0].text,'td|']);tablestyles['td']=0;paraoptions.push([options[0].text,'p|']);parastyles['p']=0;while(options.length>1){opt=options[1];var v=opt.value;if (/^thead|tbody|table|t[rdh]\b/i.test(v)){var otable=tableoptions;var styles=tablestyles} else{var otable=paraoptions;var styles=parastyles}
if(v.indexOf('|')>-1){var split=v.split('|');v=split[0].toLowerCase()+"|"+split[1]} else{v=v.toLowerCase()+"|"};otable.push([opt.text,v]);styles[v]=otable.length-1;options[1]=null}
options[0]=null}
this.enableOptions=function(inTable){var select=this.tsselect;var options=select.options;if(this.otherstyle){options[options.length-1]=null;this.otherstyle=null}
if(this.optionstate==inTable) return;var valid=inTable?tableoptions:paraoptions;while(options.length) options[0]=null;this.otherstyle=null;for(var i=0;i<valid.length;i++){var opt=document.createElement('option');opt.text=valid[i][0];opt.value=valid[i][1];options.add(opt)}
select.selectedIndex=0;this.optionstate=inTable}
this.setIndex=function(currnode,tag,index,styles){var className=currnode.className;this.styletag=tag;this.classname=className;var style=tag+'|'+className;if(style in styles){return styles[style]} else if(!className&&tag in styles){return styles[tag]}
return index}
this.nodeStyle=function(node){var currnode=node;var index=-1;var options=this.tsselect.options;this.styletag=undefined;this.classname='';this.intable=false;while(currnode){var tag=currnode.nodeName.toLowerCase();if (/^body$/.test(tag)){if(!this.styletag){return-1}
break}
if (/^(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center)$/.test(tag)){index=this.setIndex(currnode,tag,index,this.styles)}
if (/^thead|tbody|table|t[rdh]$/.test(tag)){this.intable=true;index=this.setIndex(currnode,tag,index,this.tablestyles);if(index>0||tag=='table'){return index}}
currnode=currnode.parentNode}
return index}
this.updateState=function(selNode){var index=undefined;var mixed=false;var styletag,classname;var selection=this.editor.getSelection();for(var el=selNode.firstChild;el;el=el.nextSibling){if(el.nodeType==1&&selection.containsNode(el)){var i=this.nodeStyle(el);if(index===undefined){index=i;styletag=this.styletag;classname=this.classname}
if(index!=i||styletag!=this.styletag||classname!=this.classname){mixed=true;break}}};if(index===undefined){index=this.nodeStyle(selNode)}
this.enableOptions(this.intable);if(index<0||mixed){if(mixed){var caption='Mixed styles'} else if(this.styletag){var caption='Other: '+this.styletag+' '+this.classname} else{var caption='<no style>'}
var opt=document.createElement('option');opt.text=caption;this.otherstyle=opt;this.tsselect.options.add(opt);index=this.tsselect.length-1}
this.tsselect.selectedIndex=Math.max(index,0)};this._cleanNode=function(node){var len=node.childNodes.length;
function stripspace(){var c;while((c=node.lastChild)&&c.nodeType==3&&/^\s*$/.test(c.data)){node.removeChild(c)}}
stripspace();var c=node.lastChild;if(c&&c.nodeType==1&&c.tagName=='BR'){node.removeChild(c)}
stripspace();if(node.childNodes.length==0){node.parentNode.removeChild(node)}}
this._cleanCell=function(eltype,classname){var selNode=this.editor.getSelectedNode();var el=this.editor.getNearestParentOfType(selNode,eltype);if(!el){el=this.editor.getNearestParentOfType(selNode,eltype=='TD'?'TH':'TD')}
if(!el) return;var node,nxt,n;for(node=el.firstChild;node;){if (/DIV|P/.test(node.nodeName)){for(var n=node.firstChild;n;){var nxt=n.nextSibling;el.insertBefore(n,node);n=nxt}
nxt=node.nextSibling;el.removeChild(node);node=nxt} else{node=node.nextSibling}}
if(eltype!=el.tagName){var node=el.ownerDocument.createElement(eltype);var parent=el.parentNode;parent.insertBefore(node,el);while(el.firstChild){node.appendChild(el.firstChild)}
parent.removeChild(el);el=node}
if(classname){el.className=classname} else{el.removeAttribute("class");el.removeAttribute("className")}}
this._setClass=function(el,classname){var parent=el.parentNode;if(parent.tagName=='DIV'){var gp=parent.parentNode;if(el!=parent.firstChild){var previous=parent.cloneNode(false);while(el!=parent.firstChild){previous.appendChild(parent.firstChild)}
gp.insertBefore(previous,parent);this._cleanNode(previous)}
gp.insertBefore(el,parent);this._cleanNode(el);this._cleanNode(parent)} else{this._cleanNode(el)}
if(classname){el.className=classname} else{el.removeAttribute("class");el.removeAttribute("className")}}
this.setTextStyle=function(style,noupdate){var classname='';var eltype=style.toUpperCase();if(style.indexOf('|')>-1){style=style.split('|');eltype=style[0].toUpperCase();classname=style[1]};var command=eltype;if(this.editor.getBrowserName()=='IE'){command='<'+eltype+'>'};if (/T[RDH]/.test(eltype)){this._cleanCell(eltype,classname)}
else{this.editor.getDocument().execCommand('formatblock',command);var selNode=this.editor.getSelectedNode();var el=this.editor.getNearestParentOfType(selNode,eltype);if(el){this._setClass(el,classname)} else{var selection=this.editor.getSelection();var elements=selNode.getElementsByTagName(eltype);for(var i=0;i<elements.length;i++){el=elements[i];if(selection.containsNode(el)){this._setClass(el,classname)}}}}
if(el){this.editor.getSelection().selectNodeContents(el)}
if(!noupdate){this.editor.updateState()}};this.createContextMenuElements=function(selNode,event){var ret=new Array();ret.push(new ContextMenuElement(_('Cut'),this.cutButtonHandler,this));ret.push(new ContextMenuElement(_('Copy'),this.copyButtonHandler,this));ret.push(new ContextMenuElement(_('Paste'),this.pasteButtonHandler,this));return ret};this.disable=function(){this.tsselect.disabled="disabled"}
this.enable=function(){this.tsselect.disabled=""}}
KupuUI.prototype=new KupuTool;
function ColorchooserTool(fgcolorbuttonid,hlcolorbuttonid,colorchooserid){this.fgcolorbutton=getFromSelector(fgcolorbuttonid);this.hlcolorbutton=getFromSelector(hlcolorbuttonid);this.ccwindow=getFromSelector(colorchooserid);this.command=null;this.initialize=function(editor){this.editor=editor;this.createColorchooser(this.ccwindow);addEventHandler(this.fgcolorbutton,"click",this.openFgColorChooser,this);addEventHandler(this.hlcolorbutton,"click",this.openHlColorChooser,this);addEventHandler(this.ccwindow,"click",this.chooseColor,this);this.hide();this.editor.logMessage(_('Colorchooser tool initialized'))};this.updateState=function(selNode){this.hide()};this.openFgColorChooser=function(){this.command="forecolor";this.show()};this.openHlColorChooser=function(){if(this.editor.getBrowserName()=="IE"){this.command="backcolor"} else{this.command="hilitecolor"}
this.show()};this.chooseColor=function(event){var target=_SARISSA_IS_MOZ?event.target:event.srcElement;var cell=this.editor.getNearestParentOfType(target,'td');this.editor.execCommand(this.command,cell.getAttribute('bgColor'));this.hide();this.editor.logMessage(_('Color chosen'))};this.show=function(command){this.ccwindow.style.display="block"};this.hide=function(){this.command=null;this.ccwindow.style.display="none"};this.createColorchooser=function(table){var chunks=new Array('00','33','66','99','CC','FF');table.setAttribute('id','kupu-colorchooser-table');table.style.borderWidth='2px';table.style.borderStyle='solid';table.style.position='absolute';table.style.cursor='default';table.style.display='none';var tbody=document.createElement('tbody');for(var i=0;i<6;i++){var tr=document.createElement('tr');var r=chunks[i];for(var j=0;j<6;j++){var g=chunks[j];for(var k=0;k<6;k++){var b=chunks[k];var color='#'+r+g+b;var td=document.createElement('td');td.setAttribute('bgColor',color);td.style.backgroundColor=color;td.style.borderWidth='1px';td.style.borderStyle='solid';td.style.fontSize='1px';td.style.width='10px';td.style.height='10px';var text=document.createTextNode('\u00a0');td.appendChild(text);tr.appendChild(td)}}
tbody.appendChild(tr)}
table.appendChild(tbody);return table};this.enable=function(){KupuButtonEnable(this.fgcolorbutton);KupuButtonEnable(this.hlcolorbutton)}
this.disable=function(){KupuButtonDisable(this.fgcolorbutton);KupuButtonDisable(this.hlcolorbutton)}}
ColorchooserTool.prototype=new KupuTool;
function PropertyTool(titlefieldid,descfieldid){this.titlefield=getFromSelector(titlefieldid);this.descfield=getFromSelector(descfieldid);this.initialize=function(editor){this.editor=editor;addEventHandler(this.titlefield,"change",this.updateProperties,this);addEventHandler(this.descfield,"change",this.updateProperties,this);var heads=this.editor.getInnerDocument().getElementsByTagName('head');if(!heads[0]){this.editor.logMessage(_('No head in document!'),1)} else{var head=heads[0];var titles=head.getElementsByTagName('title');if(titles.length){this.titlefield.value=titles[0].text}
var metas=head.getElementsByTagName('meta');if(metas.length){for(var i=0;i<metas.length;i++){var meta=metas[i];if(meta.getAttribute('name')&&meta.getAttribute('name').toLowerCase()=='description'){this.descfield.value=meta.getAttribute('content');break}}}}
this.editor.logMessage(_('Property tool initialized'))};this.updateProperties=function(){var doc=this.editor.getInnerDocument();var heads=doc.getElementsByTagName('HEAD');if(!heads){this.editor.logMessage(_('No head in document!'),1);return}
var head=heads[0];var titles=head.getElementsByTagName('title');if(!titles){var title=doc.createElement('title');var text=doc.createTextNode(this.titlefield.value);title.appendChild(text);head.appendChild(title)} else{var title=titles[0];if(title.childNodes.length==0){title.removeNode(true);title=doc.createElement('title');title.innerText=this.titlefield.value;head.appendChild(title)} else{title.childNodes[0].nodeValue=this.titlefield.value}}
document.title=this.titlefield.value;var metas=doc.getElementsByTagName('meta');var descset=0;for(var i=0;i<metas.length;i++){var meta=metas[i];if(meta.getAttribute('name')&&meta.getAttribute('name').toLowerCase()=='description'){meta.setAttribute('content',this.descfield.value);descset=1}}
if(!descset){var meta=doc.createElement('meta');meta.setAttribute('name','description');meta.setAttribute('content',this.descfield.value);head.appendChild(meta)}
this.editor.logMessage(_('Properties modified'))}}
PropertyTool.prototype=new KupuTool;
function LinkTool(){this.initialize=function(editor){this.editor=editor;this.editor.logMessage(_('Link tool initialized'))};this.createLinkHandler=function(event){var linkWindow=openPopup('kupupopups/link.html',300,200);linkWindow.linktool=this;linkWindow.focus()};this.updateLink=function(linkel,url,type,name,target,title){if(type&&type=='anchor'){linkel.removeAttribute('href');linkel.setAttribute('name',name)} else{linkel.href=url;if(linkel.innerHTML==""){var doc=this.editor.getInnerDocument();linkel.appendChild(doc.createTextNode(title||url))}
if(title){linkel.title=title} else{linkel.removeAttribute('title')}
if(target){linkel.setAttribute('target',target)}
else{linkel.removeAttribute('target')};linkel.style.color=this.linkcolor}};this.formatSelectedLink=function(url,type,name,target,title){var currnode=this.editor.getSelectedNode();var linkel=this.editor.getNearestParentOfType(currnode,'A');if(linkel){this.updateLink(linkel,url,type,name,target,title);return true}
if(currnode.nodeType!=1) return false;var linkelements=currnode.getElementsByTagName('A');var selection=this.editor.getSelection();var containsLink=false;for(var i=0;i<linkelements.length;i++){linkel=linkelements[i];if(selection.containsNode(linkel)){this.updateLink(linkel,url,type,name,target,title);containsLink=true}};return containsLink}
this.createLink=function(url,type,name,target,title){if(!this.formatSelectedLink(url,type,name,target,title)){this.editor.execCommand("CreateLink",url);if(!this.formatSelectedLink(url,type,name,target,title)){var doc=this.editor.getInnerDocument();linkel=doc.createElement("a");linkel.setAttribute('href',url);linkel.setAttribute('class','generated');this.editor.getSelection().replaceWithNode(linkel,true);this.updateLink(linkel,url,type,name,target,title)}}
this.editor.logMessage(_('Link added'));this.editor.updateState()};this.deleteLink=function(){var currnode=this.editor.getSelectedNode();var linkel=this.editor.getNearestParentOfType(currnode,'a');if(!linkel){this.editor.logMessage(_('Not inside link'));return};while(linkel.childNodes.length){linkel.parentNode.insertBefore(linkel.childNodes[0],linkel)};linkel.parentNode.removeChild(linkel);this.editor.logMessage(_('Link removed'));this.editor.updateState()};this.createContextMenuElements=function(selNode,event){var ret=new Array();var link=this.editor.getNearestParentOfType(selNode,'a');if(link){ret.push(new ContextMenuElement(_('Delete link'),this.deleteLink,this))} else{ret.push(new ContextMenuElement(_('Create link'),this.createLinkHandler,this))};return ret}}
LinkTool.prototype=new KupuTool;
function LinkToolBox(inputid,buttonid,toolboxid,plainclass,activeclass){this.input=getFromSelector(inputid);this.button=getFromSelector(buttonid);this.toolboxel=getFromSelector(toolboxid);this.plainclass=plainclass;this.activeclass=activeclass;this.initialize=function(tool,editor){this.tool=tool;this.editor=editor;addEventHandler(this.input,"blur",this.updateLink,this);addEventHandler(this.button,"click",this.addLink,this)};this.updateState=function(selNode){var linkel=this.editor.getNearestParentOfType(selNode,'a');if(linkel){if(this.toolboxel){this.toolboxel.className=this.activeclass};this.input.value=linkel.getAttribute('href')} else{if(this.toolboxel){this.toolboxel.className=this.plainclass};this.input.value=''}};this.addLink=function(event){var url=this.input.value;this.tool.createLink(url)};this.updateLink=function(){var currnode=this.editor.getSelectedNode();var linkel=this.editor.getNearestParentOfType(currnode,'A');if(!linkel){return}
var url=this.input.value;linkel.setAttribute('href',url);this.editor.logMessage(_('Link modified'))}};LinkToolBox.prototype=new LinkToolBox;
function ImageTool(){this.initialize=function(editor){this.editor=editor;this.editor.logMessage(_('Image tool initialized'))};this.createImageHandler=function(event){var imageWindow=openPopup('kupupopups/image.html',300,200);imageWindow.imagetool=this;imageWindow.focus()};this.createImage=function(url,alttext,imgclass){var img=this.editor.getInnerDocument().createElement('img');img.src=url;img.removeAttribute('height');img.removeAttribute('width');if(alttext){img.alt=alttext};if(imgclass){img.className=imgclass};img=this.editor.insertNodeAtSelection(img,1);this.editor.logMessage(_('Image inserted'));this.editor.updateState();return img};this.setImageClass=function(imgclass){var currnode=this.editor.getSelectedNode();var currimg=this.editor.getNearestParentOfType(currnode,'IMG');if(currimg){currimg.className=imgclass}};this.createContextMenuElements=function(selNode,event){return new Array(new ContextMenuElement(_('Create image'),this.createImageHandler,this))}}
ImageTool.prototype=new KupuTool;
function ImageToolBox(inputfieldid,insertbuttonid,classselectid,toolboxid,plainclass,activeclass){this.inputfield=getFromSelector(inputfieldid);this.insertbutton=getFromSelector(insertbuttonid);this.classselect=getFromSelector(classselectid);this.toolboxel=getFromSelector(toolboxid);this.plainclass=plainclass;this.activeclass=activeclass;this.initialize=function(tool,editor){this.tool=tool;this.editor=editor;addEventHandler(this.classselect,"change",this.setImageClass,this);addEventHandler(this.insertbutton,"click",this.addImage,this)};this.updateState=function(selNode,event){var imageel=this.editor.getNearestParentOfType(selNode,'img');if(imageel){if(this.toolboxel){this.toolboxel.className=this.activeclass;this.inputfield.value=imageel.getAttribute('src');var imgclass=imageel.className?imageel.className:'image-inline';selectSelectItem(this.classselect,imgclass)}} else{if(this.toolboxel){this.toolboxel.className=this.plainclass}}};this.addImage=function(){var url=this.inputfield.value;var sel_class=this.classselect.options[this.classselect.selectedIndex].value;this.tool.createImage(url,null,sel_class);this.editor.focusDocument()};this.setImageClass=function(){var sel_class=this.classselect.options[this.classselect.selectedIndex].value;this.tool.setImageClass(sel_class);this.editor.focusDocument()}};ImageToolBox.prototype=new KupuToolBox;
function TableTool(){this.createContextMenuElements=function(selNode,event){var table=this.editor.getNearestParentOfType(selNode,'table');if(!table){ret=new Array();var el=new ContextMenuElement(_('Add table'),this.addPlainTable,this);ret.push(el);return ret} else{var ret=new Array();ret.push(new ContextMenuElement(_('Add row'),this.addTableRow,this));ret.push(new ContextMenuElement(_('Delete row'),this.delTableRow,this));ret.push(new ContextMenuElement(_('Add column'),this.addTableColumn,this));ret.push(new ContextMenuElement(_('Delete column'),this.delTableColumn,this));ret.push(new ContextMenuElement(_('Delete Table'),this.delTable,this));return ret}};this.addPlainTable=function(){this.createTable(2,3,1,'plain')};this.createTable=function(rows,cols,makeHeader,tableclass){if(rows<1||rows>99||cols<1||cols>99){this.editor.logMessage(_('Invalid table size'),1);return};var doc=this.editor.getInnerDocument();table=doc.createElement("table");table.className=tableclass;if(makeHeader){var tr=doc.createElement("tr");var thead=doc.createElement("thead");for(i=0;i<cols;i++){var th=doc.createElement("th");th.appendChild(doc.createTextNode("Col "+i+1));tr.appendChild(th)}
thead.appendChild(tr);table.appendChild(thead)}
tbody=doc.createElement("tbody");for(var i=0;i<rows;i++){var tr=doc.createElement("tr");for(var j=0;j<cols;j++){var td=doc.createElement("td");var content=doc.createTextNode('\u00a0');td.appendChild(content);tr.appendChild(td)}
tbody.appendChild(tr)}
table.appendChild(tbody);this.editor.insertNodeAtSelection(table);this._setTableCellHandlers(table);this.editor.logMessage(_('Table added'));this.editor.updateState();return table};this._setTableCellHandlers=function(table){addEventHandler(table,'click',this._selectContentIfEmpty,this);var cells=table.getElementsByTagName('td');for(var i=0;i<cells.length;i++){addEventHandler(cells[i],'click',this._selectContentIfEmpty,this)};var firstcell=cells[0];if(firstcell){var children=firstcell.childNodes;if(children.length==1&&children[0].nodeType==3&&children[0].nodeValue=='\xa0'){var selection=this.editor.getSelection();selection.selectNodeContents(firstcell)}}};this._selectContentIfEmpty=function(){var selNode=this.editor.getSelectedNode();var cell=this.editor.getNearestParentOfType(selNode,'td');if(!cell){return};var children=cell.childNodes;if(children.length==1&&children[0].nodeType==3&&children[0].nodeValue=='\xa0'){var selection=this.editor.getSelection();selection.selectNodeContents(cell)}};this.addTableRow=function(){var currnode=this.editor.getSelectedNode();var currtbody=this.editor.getNearestParentOfType(currnode,"TBODY");var bodytype="tbody";if(!currtbody){currtbody=this.editor.getNearestParentOfType(currnode,"THEAD");bodytype="thead"}
var parentrow=this.editor.getNearestParentOfType(currnode,"TR");var nextrow=parentrow.nextSibling;var colcount=0;for(var i=0;i<currtbody.childNodes.length;i++){var el=currtbody.childNodes[i];if(el.nodeType!=1){continue}
if(el.nodeName.toLowerCase()=='tr'){var cols=0;for(var j=0;j<el.childNodes.length;j++){if(el.childNodes[j].nodeType==1){cols++}}
if(cols>colcount){colcount=cols}}}
var newrow=this.editor.getInnerDocument().createElement("TR");for(var i=0;i<colcount;i++){var newcell;if(bodytype=='tbody'){newcell=this.editor.getInnerDocument().createElement("TD")} else{newcell=this.editor.getInnerDocument().createElement("TH")}
var newcellvalue=this.editor.getInnerDocument().createTextNode("\u00a0");newcell.appendChild(newcellvalue);newrow.appendChild(newcell)}
if(!nextrow){currtbody.appendChild(newrow)} else{currtbody.insertBefore(newrow,nextrow)}
this.editor.focusDocument();this.editor.logMessage(_('Table row added'))};this.delTableRow=function(){var currnode=this.editor.getSelectedNode();var parentrow=this.editor.getNearestParentOfType(currnode,"TR");if(!parentrow){this.editor.logMessage(_('No row to delete'),1);return}
var selection=this.editor.getSelection();if(parentrow.nextSibling){selection.selectNodeContents(parentrow.nextSibling.firstChild)} else if(parentrow.previousSibling){selection.selectNodeContents(parentrow.previousSibling.firstChild)};parentrow.parentNode.removeChild(parentrow);this.editor.focusDocument();this.editor.logMessage(_('Table row removed'))};this.addTableColumn=function(){var currnode=this.editor.getSelectedNode();var currtd=this.editor.getNearestParentOfType(currnode,'TD');if(!currtd){currtd=this.editor.getNearestParentOfType(currnode,'TH')}
if(!currtd){this.editor.logMessage(_('No parentcolumn found!'),1);return}
var currtr=this.editor.getNearestParentOfType(currnode,'TR');var currtable=this.editor.getNearestParentOfType(currnode,'TABLE');var tdindex=this._getColIndex(currtd);this.editor.logMessage(_('tdindex: ${tdindex}'));var theads=currtable.getElementsByTagName('THEAD');if(theads){for(var i=0;i<theads.length;i++){var currthead=theads[i];for(var j=0;j<currthead.childNodes.length;j++){var tr=currthead.childNodes[j];if(tr.nodeType!=1){continue}
var currindex=0;for(var k=0;k<tr.childNodes.length;k++){var th=tr.childNodes[k];if(th.nodeType!=1){continue}
if(currindex==tdindex){var doc=this.editor.getInnerDocument();var newth=doc.createElement('th');var text=doc.createTextNode('\u00a0');newth.appendChild(text);if(tr.childNodes.length==k+1){tr.appendChild(newth)} else{tr.insertBefore(newth,tr.childNodes[k+1])}
break}
currindex++}}}}
var tbodies=currtable.getElementsByTagName('TBODY');if(tbodies){for(var i=0;i<tbodies.length;i++){var currtbody=tbodies[i];for(var j=0;j<currtbody.childNodes.length;j++){var tr=currtbody.childNodes[j];if(tr.nodeType!=1){continue}
var currindex=0;for(var k=0;k<tr.childNodes.length;k++){var td=tr.childNodes[k];if(td.nodeType!=1){continue}
if(currindex==tdindex){var doc=this.editor.getInnerDocument();var newtd=doc.createElement('td');var text=doc.createTextNode('\u00a0');newtd.appendChild(text);if(tr.childNodes.length==k+1){tr.appendChild(newtd)} else{tr.insertBefore(newtd,tr.childNodes[k+1])}
break}
currindex++}}}}
this.editor.focusDocument();this.editor.logMessage(_('Table column added'))};this.delTableColumn=function(){var currnode=this.editor.getSelectedNode();var currtd=this.editor.getNearestParentOfType(currnode,'TD');if(!currtd){currtd=this.editor.getNearestParentOfType(currnode,'TH')}
var currcolindex=this._getColIndex(currtd);var currtable=this.editor.getNearestParentOfType(currnode,'TABLE');var selection=this.editor.getSelection();if(currtd.nextSibling){selection.selectNodeContents(currtd.nextSibling)} else if(currtd.previousSibling){selection.selectNodeContents(currtd.previousSibling)};var heads=currtable.getElementsByTagName('THEAD');if(heads.length){for(var i=0;i<heads.length;i++){var thead=heads[i];for(var j=0;j<thead.childNodes.length;j++){var tr=thead.childNodes[j];if(tr.nodeType!=1){continue}
var currindex=0;for(var k=0;k<tr.childNodes.length;k++){var th=tr.childNodes[k];if(th.nodeType!=1){continue}
if(currindex==currcolindex){tr.removeChild(th);break}
currindex++}}}}
var bodies=currtable.getElementsByTagName('TBODY');for(var i=0;i<bodies.length;i++){var currtbody=bodies[i];var relevant_rowspan=0;for(var j=0;j<currtbody.childNodes.length;j++){var tr=currtbody.childNodes[j];if(tr.nodeType!=1){continue}
var currindex=0
for(var k=0;k<tr.childNodes.length;k++){var cell=tr.childNodes[k];if(cell.nodeType!=1){continue}
var colspan=cell.colSpan;if(currindex==currcolindex){tr.removeChild(cell);break}
currindex++}}}
this.editor.focusDocument();this.editor.logMessage(_('Table column deleted'))};this.delTable=function(){var currnode=this.editor.getSelectedNode();var table=this.editor.getNearestParentOfType(currnode,'table');if(!table){this.editor.logMessage(_('Not inside a table!'));return};table.parentNode.removeChild(table);this.editor.logMessage(_('Table removed'))};this.setColumnAlign=function(newalign){var currnode=this.editor.getSelectedNode();var currtd=this.editor.getNearestParentOfType(currnode,"TD");var bodytype='tbody';if(!currtd){currtd=this.editor.getNearestParentOfType(currnode,"TH");bodytype='thead'}
var currcolindex=this._getColIndex(currtd);var currtable=this.editor.getNearestParentOfType(currnode,"TABLE");for(var i=0;i<currtable.childNodes.length;i++){var currtbody=currtable.childNodes[i];if(currtbody.nodeType!=1||(currtbody.nodeName.toUpperCase()!="THEAD"&&currtbody.nodeName.toUpperCase()!="TBODY")){continue}
for(var j=0;j<currtbody.childNodes.length;j++){var row=currtbody.childNodes[j];if(row.nodeType!=1){continue}
var index=0;for(var k=0;k<row.childNodes.length;k++){var cell=row.childNodes[k];if(cell.nodeType!=1){continue}
if(index==currcolindex){if(this.editor.config.use_css){cell.style.textAlign=newalign} else{cell.setAttribute('align',newalign)}
cell.className='align-'+newalign}
index++}}}};this.setTableClass=function(sel_class){var currnode=this.editor.getSelectedNode();var currtable=this.editor.getNearestParentOfType(currnode,'TABLE');if(currtable){currtable.className=sel_class}};this._getColIndex=function(currcell){var prevsib=currcell.previousSibling;var currcolindex=0;while(prevsib){if(prevsib.nodeType==1&&(prevsib.tagName.toUpperCase()=="TD"||prevsib.tagName.toUpperCase()=="TH")){var colspan=prevsib.colSpan;if(colspan){currcolindex+=parseInt(colspan)} else{currcolindex++}}
prevsib=prevsib.previousSibling;if(currcolindex>30){alert(_("Recursion detected when counting column position"));return}}
return currcolindex};this._getColumnAlign=function(selNode){var align;var td=this.editor.getNearestParentOfType(selNode,'td');if(!td){td=this.editor.getNearestParentOfType(selNode,'th')};if(td){align=td.getAttribute('align');if(this.editor.config.use_css){align=td.style.textAlign}};return align};this.fixTable=function(event){var currnode=this.editor.getSelectedNode();var table=this.editor.getNearestParentOfType(currnode,'TABLE');if(!table){this.editor.logMessage(_('Not inside a table!'));return};this._fixTableHelper(table)};this._isBodyRow=function(row){for(var node=row.firstChild;node;node=node.nextSibling){if (/TD/.test(node.nodeName)){return true}}
return false}
this._cleanCell=function(el){dump('_cleanCell('+el.innerHTML+')\n');var node,nxt,n;for(node=el.firstChild;node;){if (/DIV|P/.test(node.nodeName)){for(var n=node.firstChild;n;){var nxt=n.nextSibling;el.insertBefore(n,node);n=nxt}
nxt=node.nextSibling;el.removeChild(node);node=nxt} else{node=node.nextSibling}}
var c;while(el.firstChild&&(c=el.firstChild).nodeType==3&&/^\s+/.test(c.data)){c.data=c.data.replace(/^\s+/,'');if(!c.data){el.removeChild(c)} else{break}};while(el.lastChild&&(c=el.lastChild).nodeType==3&&/\s+$/.test(c.data)){c.data=c.data.replace(/\s+$/,'');if(!c.data){el.removeChild(c)} else{break}};el.removeAttribute('colSpan');el.removeAttribute('rowSpan')}
this._countCols=function(rows,numcols){for(var i=0;i<rows.length;i++){var row=rows[i];var currnumcols=0;for(var node=row.firstChild;node;node=node.nextSibling){if (/td|th/i.test(node.nodeName)){currnumcols+=parseInt(node.getAttribute('colSpan')||'1')}};if(currnumcols>numcols){numcols=currnumcols}};return numcols}
this._cleanRows=function(rows,container,numcols){for(var i=0;i<rows.length;i++){dump("row "+i+'\n');var row=rows[i];var doc=this.editor.getInnerDocument();var newrow=doc.createElement('tr');if(row.className){newrow.className=row.className}
for(var node=row.firstChild;node;){dump("child\n");var nxt=node.nextSibling;if (/TD|TH/.test(node.nodeName)){this._cleanCell(node);newrow.appendChild(node)};node=nxt};if(newrow.childNodes.length){container.appendChild(newrow)}};for(row=container.firstChild;row;row=row.nextSibling){var cellname=row.lastChild.nodeName;while(row.childNodes.length<numcols){var cell=doc.createElement(cellname);var nbsp=doc.createTextNode('\u00a0');cell.appendChild(nbsp);row.appendChild(cell)}}};this._fixTableHelper=function(table){var doc=this.editor.getInnerDocument();var thead=doc.createElement('thead');var tbody=doc.createElement('tbody');var tfoot=doc.createElement('tfoot');var table_classes=this.editor.config.table_classes;
function cleanClassName(name){var allowed_classes=table_classes['class'];for(var i=0;i<allowed_classes.length;i++){var classname=allowed_classes[i];classname=classname.classname||classname;if(classname==name) return name};return allowed_classes[0]}
if(table_classes){table.className=cleanClassName(table.className)} else{table.removeAttribute('class');table.removeAttribute('className')};table.removeAttribute('border');table.removeAttribute('cellpadding');table.removeAttribute('cellPadding');table.removeAttribute('cellspacing');table.removeAttribute('cellSpacing');var hrows=[],brows=[],frows=[];for(var node=table.firstChild;node;node=node.nextSibling){var nodeName=node.nodeName;if (/TR/.test(node.nodeName)){brows.push(node)} else if (/THEAD|TBODY|TFOOT/.test(node.nodeName)){var rows=nodeName=='THEAD'?hrows:nodeName=='TFOOT'?frows:brows;for(var inode=node.firstChild;inode;inode=inode.nextSibling){if (/TR/.test(inode.nodeName)){rows.push(inode)}}}};dump('extract head and foot\n');while(brows.length&&!this._isBodyRow(brows[0])){hrows.push(brows[0]);brows.shift()}
while(brows.length&&!this._isBodyRow(brows[brows.length-1])){var last=brows[brows.length-1];brows.length-=1;frows.unshift(last)}
dump('count cols\n');var numcols=this._countCols(hrows,0);numcols=this._countCols(brows,numcols);numcols=this._countCols(frows,numcols);dump('clean rows\n');this._cleanRows(hrows,thead);this._cleanRows(brows,tbody);this._cleanRows(frows,tfoot);dump('remove old\n');while(table.firstChild){table.removeChild(table.firstChild)}
if(hrows.length)
table.appendChild(thead);if(brows.length)
table.appendChild(tbody);if(frows.length)
table.appendChild(tfoot);dump('finish up\n');this.editor.focusDocument();this.editor.logMessage(_('Table cleaned up'))};this.fixAllTables=function(){var tables=this.editor.getInnerDocument().getElementsByTagName('table');for(var i=0;i<tables.length;i++){this._fixTableHelper(tables[i])}}};TableTool.prototype=new KupuTool;
function TableToolBox(addtabledivid,edittabledivid,newrowsinputid,newcolsinputid,makeheaderinputid,classselectid,alignselectid,addtablebuttonid,addrowbuttonid,delrowbuttonid,addcolbuttonid,delcolbuttonid,fixbuttonid,fixallbuttonid,toolboxid,plainclass,activeclass){this.addtablediv=getFromSelector(addtabledivid);this.edittablediv=getFromSelector(edittabledivid);this.newrowsinput=getFromSelector(newrowsinputid);this.newcolsinput=getFromSelector(newcolsinputid);this.makeheaderinput=getFromSelector(makeheaderinputid);this.classselect=getFromSelector(classselectid);this.alignselect=getFromSelector(alignselectid);this.addtablebutton=getFromSelector(addtablebuttonid);this.addrowbutton=getFromSelector(addrowbuttonid);this.delrowbutton=getFromSelector(delrowbuttonid);this.addcolbutton=getFromSelector(addcolbuttonid);this.delcolbutton=getFromSelector(delcolbuttonid);this.fixbutton=getFromSelector(fixbuttonid);this.fixallbutton=getFromSelector(fixallbuttonid);this.toolboxel=getFromSelector(toolboxid);this.plainclass=plainclass;this.activeclass=activeclass;this.initialize=function(tool,editor){this.tool=tool;this.editor=editor;if(this.editor.config.table_classes){var classes=this.editor.config.table_classes['class'];while(this.classselect.hasChildNodes()){this.classselect.removeChild(this.classselect.firstChild)};for(var i=0;i<classes.length;i++){var classname=classes[i];classname=classname.classname||classname;var option=document.createElement('option');var content=document.createTextNode(classname);option.appendChild(content);option.setAttribute('value',classname);this.classselect.appendChild(option)}};addEventHandler(this.addtablebutton,"click",this.addTable,this);addEventHandler(this.addrowbutton,"click",this.tool.addTableRow,this.tool);addEventHandler(this.delrowbutton,"click",this.tool.delTableRow,this.tool);addEventHandler(this.addcolbutton,"click",this.tool.addTableColumn,this.tool);addEventHandler(this.delcolbutton,"click",this.tool.delTableColumn,this.tool);addEventHandler(this.alignselect,"change",this.setColumnAlign,this);addEventHandler(this.classselect,"change",this.setTableClass,this);addEventHandler(this.fixbutton,"click",this.tool.fixTable,this.tool);addEventHandler(this.fixallbutton,"click",this.tool.fixAllTables,this.tool);this.addtablediv.style.display="block";this.edittablediv.style.display="none";this.editor.logMessage(_('Table tool initialized'))};this.updateState=function(selNode){var table=this.editor.getNearestParentOfType(selNode,'table');if(table){this.addtablediv.style.display="none";this.edittablediv.style.display="block";var align=this.tool._getColumnAlign(selNode);selectSelectItem(this.alignselect,align);selectSelectItem(this.classselect,table.className);if(this.toolboxel){this.toolboxel.className=this.activeclass}} else{this.edittablediv.style.display="none";this.addtablediv.style.display="block";this.alignselect.selectedIndex=0;this.classselect.selectedIndex=0;if(this.toolboxel){this.toolboxel.className=this.plainclass}}};this.addTable=function(){var rows=this.newrowsinput.value;var cols=this.newcolsinput.value;var makeHeader=this.makeheaderinput.checked;var classchooser=getFromSelector("kupu-table-classchooser-add");var tableclass=this.classselect.options[this.classselect.selectedIndex].value;this.tool.createTable(rows,cols,makeHeader,tableclass)};this.setColumnAlign=function(){var newalign=this.alignselect.options[this.alignselect.selectedIndex].value;this.tool.setColumnAlign(newalign)};this.setTableClass=function(){var sel_class=this.classselect.options[this.classselect.selectedIndex].value;if(sel_class){this.tool.setTableClass(sel_class)}}};TableToolBox.prototype=new KupuToolBox;
function ListTool(addulbuttonid,addolbuttonid,ulstyleselectid,olstyleselectid){this.addulbutton=getFromSelector(addulbuttonid);this.addolbutton=getFromSelector(addolbuttonid);this.ulselect=getFromSelector(ulstyleselectid);this.olselect=getFromSelector(olstyleselectid);this.style_to_type={'decimal':'1','lower-alpha':'a','upper-alpha':'A','lower-roman':'i','upper-roman':'I','disc':'disc','square':'square','circle':'circle','none':'none'};this.type_to_style={'1':'decimal','a':'lower-alpha','A':'upper-alpha','i':'lower-roman','I':'upper-roman','disc':'disc','square':'square','circle':'circle','none':'none'};this.initialize=function(editor){this.editor=editor;this._fixTabIndex(this.addulbutton);this._fixTabIndex(this.addolbutton);this._fixTabIndex(this.ulselect);this._fixTabIndex(this.olselect);addEventHandler(this.addulbutton,"click",this.addUnorderedList,this);addEventHandler(this.addolbutton,"click",this.addOrderedList,this);addEventHandler(this.ulselect,"change",this.setUnorderedListStyle,this);addEventHandler(this.olselect,"change",this.setOrderedListStyle,this);this.ulselect.style.display="none";this.olselect.style.display="none";this.editor.logMessage(_('List style tool initialized'))};this._handleStyles=function(currnode,onselect,offselect){if(this.editor.config.use_css){var currstyle=currnode.style.listStyleType} else{var currstyle=this.type_to_style[currnode.getAttribute('type')]}
selectSelectItem(onselect,currstyle);offselect.style.display="none";onselect.style.display="inline";offselect.selectedIndex=0};this.updateState=function(selNode){for(var currnode=selNode;currnode;currnode=currnode.parentNode){var tag=currnode.nodeName.toLowerCase();if(tag=='ul'){this._handleStyles(currnode,this.ulselect,this.olselect);return} else if(tag=='ol'){this._handleStyles(currnode,this.olselect,this.ulselect);return}}
with(this.ulselect){selectedIndex=0;style.display="none"};with(this.olselect){selectedIndex=0;style.display="none"}};this.addList=function(command){this.ulselect.style.display="inline";this.olselect.style.display="none";this.editor.execCommand(command);this.editor.focusDocument()};this.addUnorderedList=function(){this.addList("insertunorderedlist")};this.addOrderedList=function(){this.addList("insertorderedlist")};this.setListStyle=function(tag,select){var currnode=this.editor.getSelectedNode();var l=this.editor.getNearestParentOfType(currnode,tag);var style=select.options[select.selectedIndex].value;if(this.editor.config.use_css){l.style.listStyleType=style} else{l.setAttribute('type',this.style_to_type[style])}
this.editor.focusDocument();this.editor.logMessage(_('List style changed'))};this.setUnorderedListStyle=function(){this.setListStyle('ul',this.ulselect)};this.setOrderedListStyle=function(){this.setListStyle('ol',this.olselect)};this.enable=function(){KupuButtonEnable(this.addulbutton);KupuButtonEnable(this.addolbutton);this.ulselect.disabled="";this.olselect.disabled=""}
this.disable=function(){KupuButtonDisable(this.addulbutton);KupuButtonDisable(this.addolbutton);this.ulselect.disabled="disabled";this.olselect.disabled="disabled"}};ListTool.prototype=new KupuTool;
function ShowPathTool(){this.updateState=function(selNode){var path='';var url=null;var currnode=selNode;while(currnode!=null&&currnode.nodeName!='#document'){if(currnode.nodeName.toLowerCase()=='a'){url=currnode.getAttribute('href')};path='/'+currnode.nodeName.toLowerCase()+path;currnode=currnode.parentNode}
try{window.status=url?(path.toString()+' - contains link to \''+url.toString()+'\''):path} catch(e){this.editor.logMessage(_('Could not set status bar message, '+'check your browser\'s security settings.'),1)}}};ShowPathTool.prototype=new KupuTool;
function ViewSourceTool(){this.sourceWindow=null;this.viewSource=function(){if(this.sourceWindow){this.sourceWindow.close()};this.sourceWindow=window.open('#','sourceWindow');var contents='<html>\n'+this.editor.getInnerDocument().documentElement.innerHTML+'\n</html>';var doc=this.sourceWindow.document;doc.write('\xa0');doc.close();var body=doc.getElementsByTagName("body")[0];while(body.hasChildNodes()){body.removeChild(body.firstChild)};var pre=doc.createElement('pre');var textNode=doc.createTextNode(contents);body.appendChild(pre);pre.appendChild(textNode)};this.createContextMenuElements=function(selNode,event){return new Array(new ContextMenuElement(_('View source'),this.viewSource,this))}};ViewSourceTool.prototype=new KupuTool;
function DefinitionListTool(dlbuttonid){this.dlbutton=getFromSelector(dlbuttonid);this.initialize=function(editor){this.editor=editor;this._fixTabIndex(this.dlbutton);addEventHandler(this.dlbutton,'click',this.createDefinitionList,this);addEventHandler(editor.getInnerDocument(),'keyup',this._keyDownHandler,this);addEventHandler(editor.getInnerDocument(),'keypress',this._keyPressHandler,this)};this.handleEnterPress=function(selNode){var dl=this.editor.getNearestParentOfType(selNode,'dl');if(dl){var dt=this.editor.getNearestParentOfType(selNode,'dt');if(dt){if(dt.childNodes.length==1&&dt.childNodes[0].nodeValue=='\xa0'){this.escapeFromDefinitionList(dl,dt,selNode);return};var selection=this.editor.getSelection();var startoffset=selection.startOffset();var endoffset=selection.endOffset();if(endoffset>startoffset){selection.cutChunk(startoffset,endoffset);selection=this.editor.getSelection();startoffset=selection.startOffset()};var ellength=selection.getElementLength(selection.parentElement());if(startoffset>=ellength-1){this.createDefinition(dl,dt)} else{var doc=this.editor.getInnerDocument();var newdt=selection.splitNodeAtSelection(dt);var newdd=doc.createElement('dd');while(newdt.hasChildNodes()){if(newdt.firstChild!=newdt.lastChild||newdt.firstChild.nodeName.toLowerCase()!='br'){newdd.appendChild(newdt.firstChild)}};newdt.parentNode.replaceChild(newdd,newdt);selection.selectNodeContents(newdd);selection.collapse()}} else{var dd=this.editor.getNearestParentOfType(selNode,'dd');if(!dd){this.editor.logMessage(_('Not inside a definition list element!'));return};if(dd.childNodes.length==1&&dd.childNodes[0].nodeValue=='\xa0'){this.escapeFromDefinitionList(dl,dd,selNode);return};var selection=this.editor.getSelection();var startoffset=selection.startOffset();var endoffset=selection.endOffset();if(endoffset>startoffset){selection.cutChunk(startoffset,endoffset);selection=this.editor.getSelection();startoffset=selection.startOffset()};var ellength=selection.getElementLength(selection.parentElement());if(startoffset>=ellength-1){this.createDefinitionTerm(dl,dd)} else{var br=this.editor.getInnerDocument().createElement('br');this.editor.insertNodeAtSelection(br,1);selection.collapse(true)}}}};this.handleTabPress=function(selNode){};this._keyDownHandler=function(event){var selNode=this.editor.getSelectedNode();var dl=this.editor.getNearestParentOfType(selNode,'dl');if(!dl){return};switch(event.keyCode){case 13:if(event.preventDefault){event.preventDefault()} else{event.returnValue=false};break}};this._keyPressHandler=function(event){var selNode=this.editor.getSelectedNode();var dl=this.editor.getNearestParentOfType(selNode,'dl');if(!dl){return};switch(event.keyCode){case 13:this.handleEnterPress(selNode);if(event.preventDefault){event.preventDefault()} else{event.returnValue=false};break;case 9:if(event.preventDefault){event.preventDefault()} else{event.returnValue=false};this.handleTabPress(selNode)}};this.createDefinitionList=function(){var selection=this.editor.getSelection();var doc=this.editor.getInnerDocument();var selection=this.editor.getSelection();var cloned=selection.cloneContents();var iterator=new NodeIterator(cloned);var currnode=null;var remove=false;while(currnode=iterator.next()){if(currnode.nodeName.toLowerCase()=='br'){remove=true};if(remove){var next=currnode;while(!next.nextSibling){next=next.parentNode};next=next.nextSibling;iterator.setCurrent(next);currnode.parentNode.removeChild(currnode)}};var dtcontentcontainer=cloned;var collapsetoend=false;var dl=doc.createElement('dl');this.editor.insertNodeAtSelection(dl);var dt=this.createDefinitionTerm(dl);if(dtcontentcontainer.hasChildNodes()){collapsetoend=true;while(dt.hasChildNodes()){dt.removeChild(dt.firstChild)};while(dtcontentcontainer.hasChildNodes()){dt.appendChild(dtcontentcontainer.firstChild)}};var selection=this.editor.getSelection();selection.selectNodeContents(dt);selection.collapse(collapsetoend)};this.createDefinitionTerm=function(dl,dd){var doc=this.editor.getInnerDocument();var dt=doc.createElement('dt');if(dd){if(dd.lastChild.nodeName.toLowerCase()=='br'){dd.removeChild(dd.lastChild)}};if(!dd||dl==dd.lastChild){dl.appendChild(dt)} else{var nextsibling=dd.nextSibling;if(nextsibling){dl.insertBefore(dt,nextsibling)} else{dl.appendChild(dt)}};var nbsp=doc.createTextNode('\xa0');dt.appendChild(nbsp);var selection=this.editor.getSelection();selection.selectNodeContents(dt);selection.collapse();this.editor.focusDocument();return dt};this.createDefinition=function(dl,dt,initial_content){var doc=this.editor.getInnerDocument();var dd=doc.createElement('dd');var nextsibling=dt.nextSibling;if(dt){if(dt.lastChild.nodeName.toLowerCase()=='br'){dt.removeChild(dt.lastChild)}};while(nextsibling){var name=nextsibling.nodeName.toLowerCase();if(name=='dd'||name=='dt'){break} else{nextsibling=nextsibling.nextSibling}};if(nextsibling){dl.insertBefore(dd,nextsibling)} else{dl.appendChild(dd)};if(initial_content){for(var i=0;i<initial_content.length;i++){dd.appendChild(initial_content[i])}};var nbsp=doc.createTextNode('\xa0');dd.appendChild(nbsp);var selection=this.editor.getSelection();selection.selectNodeContents(dd);selection.collapse()};this.escapeFromDefinitionList=function(dl,currel,selNode){var doc=this.editor.getInnerDocument();var p=doc.createElement('p');var nbsp=doc.createTextNode('\xa0');p.appendChild(nbsp);if(dl.lastChild==currel){dl.parentNode.insertBefore(p,dl.nextSibling)} else{for(var i=0;i<dl.childNodes.length;i++){var child=dl.childNodes[i];if(child==currel){var newdl=this.editor.getInnerDocument().createElement('dl');while(currel.nextSibling){newdl.appendChild(currel.nextSibling)};dl.parentNode.insertBefore(newdl,dl.nextSibling);dl.parentNode.insertBefore(p,dl.nextSibling)}}};currel.parentNode.removeChild(currel);var selection=this.editor.getSelection();selection.selectNodeContents(p);selection.collapse();this.editor.focusDocument()};this._fixStructure=function(doc,dl,offsetnode){var currname=offsetnode.nodeName.toLowerCase();var currnode=offsetnode.nextSibling;while(currnode){if(currnode.nodeType==1){var nodename=currnode.nodeName.toLowerCase();if(currname=='dt'&&nodename=='dt'){var dd=doc.createElement('dd');while(currnode.hasChildNodes()){dd.appendChild(currnode.childNodes[0])};currnode.parentNode.replaceChild(dd,currnode)} else if(currname=='dd'&&nodename=='dd'){var dt=doc.createElement('dt');while(currnode.hasChildNodes()){dt.appendChild(currnode.childNodes[0])};currnode.parentNode.replaceChild(dt,currnode)}};currnode=currnode.nextSibling}}};DefinitionListTool.prototype=new KupuTool;
function KupuZoomTool(buttonid,firsttab,lasttab){this.button=getFromSelector(buttonid);firsttab=firsttab||'kupu-tb-styles';lasttab=lasttab||'kupu-logo-button';this.initialize=function(editor){this.offclass='kupu-zoom';this.onclass='kupu-zoom-pressed';this.pressed=false;this.baseinitialize(editor);this.button.tabIndex=this.editor.document.editable.tabIndex;addEventHandler(window,"resize",this.onresize,this);addEventHandler(window,"scroll",this.onscroll,this);var lastbutton=getFromSelector(lasttab);var firstbutton=getFromSelector(firsttab);var iframe=editor.getInnerDocument();this.setTabbing(iframe,firstbutton,lastbutton);this.setTabbing(firstbutton,null,editor.getDocument().getWindow());this.editor.logMessage(_('Zoom tool initialized'))}};KupuZoomTool.prototype=new KupuLateFocusStateButton;KupuZoomTool.prototype.baseinitialize=KupuZoomTool.prototype.initialize;KupuZoomTool.prototype.onscroll=function(){if(!this.zoomed) return;var top=window.pageYOffset!=undefined?window.pageYOffset:document.documentElement.scrollTop;var left=window.pageXOffset!=undefined?window.pageXOffset:document.documentElement.scrollLeft;if(top||left) window.scrollTo(0,0)}
KupuZoomTool.prototype.setTabbing=function(control,forward,backward){
function TabDown(event){if(event.keyCode!=9||!this.zoomed) return;var target=event.shiftKey?backward:forward;if(!target) return;if(event.stopPropogation) event.stopPropogation();event.cancelBubble=true;event.returnValue=false;target.focus();return false}
addEventHandler(control,"keydown",TabDown,this)}
KupuZoomTool.prototype.onresize=function(){if(!this.zoomed) return;var editor=this.editor;var iframe=editor.getDocument().editable;var sourcetool=editor.getTool('sourceedittool');var sourceArea=sourcetool?sourcetool.getSourceArea():null;var fulleditor=iframe.parentNode;var body=document.body;if(window.innerWidth){var width=window.innerWidth;var height=window.innerHeight} else if(document.documentElement){if(!window._IE_VERSION){_IE_VERSION=/MSIE\s*([0-9.]*)/.exec(navigator.appVersion)};var kludge=(_IE_VERSION[1]<7)?5:0;var width=document.documentElement.offsetWidth-kludge;var height=document.documentElement.offsetHeight-kludge} else{var width=document.body.offsetWidth-5;var height=document.body.offsetHeight-5}
width=width+'px';var offset=iframe.parentNode.offsetTop;var nheight=Math.max(height-offset-1,10)+'px';fulleditor.style.width=width;iframe.style.width=width;iframe.style.height=nheight;if(sourceArea){sourceArea.style.width=width;sourceArea.style.height=nheight}}
KupuZoomTool.prototype.checkfunc=function(selNode,button,editor,event){return this.zoomed}
KupuZoomTool.prototype.commandfunc=function(button,editor){var zoom=button.pressed;this.zoomed=zoom;var zoomClass='kupu-fulleditor-zoomed';var iframe=editor.getDocument().getEditable();var body=document.body;var html=document.getElementsByTagName('html')[0];if(zoom){html.style.overflow='hidden';window.scrollTo(0,0);editor.setClass(zoomClass);body.className+=' '+zoomClass;this.onresize()} else{html.style.overflow='';var fulleditor=iframe.parentNode;fulleditor.style.width='';body.className=body.className.replace(/ *kupu-fulleditor-zoomed/,'');editor.clearClass(zoomClass);iframe.style.width='';iframe.style.height='';var sourcetool=editor.getTool('sourceedittool');var sourceArea=sourcetool?sourcetool.getSourceArea():null;if(sourceArea){sourceArea.style.width='';sourceArea.style.height=''}}
var doc=editor.getInnerDocument();doc.designMode=doc.designMode;window.scrollTo(0,iframe.offsetTop);editor.focusDocument()}


/* - kupuloggers.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupuloggers.js?original=1
function DebugLogger(){this.log=function(message,severity){if(severity>1){alert("Error: "+message)} else if(severity==1){alert("Warning: "+message)} else{alert("Log message: "+message)}}}
function PlainLogger(debugelid,maxlength){this.debugel=getFromSelector(debugelid);this.maxlength=maxlength;this.log=function(message,severity){if(severity>1){throw message} else{if(this.maxlength){if(this.debugel.childNodes.length>this.maxlength-1){this.debugel.removeChild(this.debugel.childNodes[0])}}
var now=new Date();var time=now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();var div=document.createElement('div');var text=document.createTextNode(time+' - '+message);div.appendChild(text);this.debugel.appendChild(div)}}}
function DummyLogger(){this.log=function(message,severity){if(severity>1){throw message}}};

/* - kupucontentfilters.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupucontentfilters.js?original=1
function NonXHTMLTagFilter(){if(arguments.length){this.filterdata=arguments[0]} else{this.filterdata={'html':1,'body':1,'head':1,'title':1,'a':1,'abbr':1,'acronym':1,'address':1,'b':1,'base':1,'blockquote':1,'br':1,'caption':1,'cite':1,'code':1,'col':1,'colgroup':1,'dd':1,'dfn':1,'div':1,'dl':1,'dt':1,'em':1,'h1':1,'h2':1,'h3':1,'h4':1,'h5':1,'h6':1,'h7':1,'i':1,'img':1,'kbd':1,'li':1,'link':1,'meta':1,'ol':1,'p':1,'pre':1,'q':1,'samp':1,'script':1,'span':1,'strong':1,'style':1,'sub':1,'sup':1,'table':1,'tbody':1,'td':1,'tfoot':1,'th':1,'thead':1,'tr':1,'ul':1,'u':1,'var':1,'font':1,'center':0}};this.initialize=function(editor){this.editor=editor};this.filter=function(ownerdoc,htmlnode){return this._filterHelper(ownerdoc,htmlnode)};this._filterHelper=function(ownerdoc,node){if(node.nodeType==3){return ownerdoc.createTextNode(node.nodeValue)} else if(node.nodeType==4){return ownerdoc.createCDATASection(node.nodeValue)};var newnode=ownerdoc.createElement(node.nodeName);for(var i=0;i<node.attributes.length;i++){var attr=node.attributes[i];newnode.setAttribute(attr.nodeName,attr.nodeValue)};for(var i=0;i<node.childNodes.length;i++){var child=node.childNodes[i];var nodeType=child.nodeType;var nodeName=child.nodeName.toLowerCase();if(nodeType==3||nodeType==4){newnode.appendChild(this._filterHelper(ownerdoc,child))};if(nodeName in this.filterdata&&this.filterdata[nodeName]){newnode.appendChild(this._filterHelper(ownerdoc,child))} else if(nodeName in this.filterdata){for(var j=0;j<child.childNodes.length;j++){newnode.appendChild(this._filterHelper(ownerdoc,child.childNodes[j]))}}};return newnode}};
function XhtmlValidation(editor){this.Set=function(ary){if(typeof(ary)==typeof('')) ary=[ary];if(ary instanceof Array){for(var i=0;i<ary.length;i++){this[ary[i]]=1}}
else{for(var v in ary){this[v]=1}}}
this._exclude=function(array,exceptions){var ex;if(exceptions.split){ex=exceptions.split("|")} else{ex=exceptions}
var exclude=new this.Set(ex);var res=[];for(var k=0;k<array.length;k++){if(!exclude[array[k]]) res.push(array[k])}
return res}
this.setAttrFilter=function(attributes,filter){for(var j=0;j<attributes.length;j++){var attr=attributes[j];this.attrFilters[attr]=filter||this._defaultCopyAttribute}}
this.setTagAttributes=function(tags,attributes){for(var j=0;j<tags.length;j++){this.tagAttributes[tags[j]]=attributes}}
this.includeTagAttributes=function(tags,attributes){for(var j=0;j<tags.length;j++){var tag=tags[j];this.tagAttributes[tag]=this.tagAttributes[tag].concat(attributes)}}
this.excludeTagAttributes=function(tags,attributes){var bad=new this.Set(attributes);var tagset=new this.Set(tags);for(var tag in tagset){var val=this.tagAttributes[tag];if(val){for(var i=val.length;i>=0;i--){if(bad[val[i]]){val=val.concat();val.splice(i,1)}}}
this.tagAttributes[tag]=val;this.badTagAttributes[tag]=attributes}}
this.excludeTags=function(badtags){if(typeof(badtags)==typeof('')) badtags=[badtags];for(var i=0;i<badtags.length;i++){delete this.tagAttributes[badtags[i]]}}
this.excludeAttributes=function(badattrs){this.excludeTagAttributes(this.tagAttributes,badattrs);for(var i=0;i<badattrs.length;i++){delete this.attrFilters[badattrs[i]]}}
if(editor.getBrowserName()=="IE"){this._getTagName=function(htmlnode){var nodename=htmlnode.nodeName.toLowerCase();if(htmlnode.scopeName&&htmlnode.scopeName!="HTML"){nodename=htmlnode.scopeName+':'+nodename}
return nodename}} else{this._getTagName=function(htmlnode){return htmlnode.nodeName.toLowerCase()}};this.elements=new function(validation){this.attributes=['abbr','accept','accept-charset','accesskey','action','align','alink','alt','archive','axis','background','bgcolor','border','cellpadding','cellspacing','char','charoff','charset','checked','cite','class','classid','clear','code','codebase','codetype','color','cols','colspan','compact','content','coords','data','datetime','declare','defer','dir','disabled','enctype','face','for','frame','frameborder','headers','height','href','hreflang','hspace','http-equiv','id','ismap','label','lang','language','link','longdesc','marginheight','marginwidth','maxlength','media','method','multiple','name','nohref','noshade','nowrap','object','onblur','onchange','onclick','ondblclick','onfocus','onkeydown','onkeypress','onkeyup','onload','onmousedown','onmousemove','onmouseout','onmouseover','onmouseup','onreset','onselect','onsubmit','onunload','profile','prompt','readonly','rel','rev','rows','rowspan','rules','scheme','scope','scrolling','selected','shape','size','span','src','standby','start','style','summary','tabindex','target','text','title','type','usemap','valign','value','valuetype','vlink','vspace','width','xml:lang','xml:space','xmlns'];this.coreattrs=['id','title','style','class'];this.i18n=['lang','dir','xml:lang'];this.events=[];this.focusevents=[];this.loadevents=[];this.formevents=[];this.inputevents=[] ;this.focus=['accesskey','tabindex'].concat(this.focusevents);this.attrs=[].concat(this.coreattrs,this.i18n,this.events);this.special_extra=['object','applet','img','map','iframe'];this.special_basic=['br','span','bdo'];this.special=[].concat(this.special_basic,this.special_extra);this.fontstyle_extra=['big','small','font','basefont'];this.fontstyle_basic=['tt','i','b','u','s','strike'];this.fontstyle=[].concat(this.fontstyle_basic,this.fontstyle_extra);this.phrase_extra=['sub','sup'];this.phrase_basic=['em','strong','dfn','code','q','samp','kbd','var','cite','abbr','acronym'];this.inline_forms=['input','select','textarea','label','button'];this.misc_inline=['ins','del'];this.misc=['noscript'].concat(this.misc_inline);this.inline=['a'].concat(this.special,this.fontstyle,this.phrase,this.inline_forms);this.Inline=['#PCDATA'].concat(this.inline,this.misc_inline);this.heading=['h1','h2','h3','h4','h5','h6'];this.lists=['ul','ol','dl','menu','dir'];this.blocktext=['pre','hr','blockquote','address','center','noframes'];this.block=['p','div','isindex','fieldset','table'].concat(this.heading,this.lists,this.blocktext);this.Flow=['#PCDATA','form'].concat(this.block,this.inline)}(this);this._commonsetting=function(self,names,value){for(var n=0;n<names.length;n++){self[names[n]]=value}}
this.tagAttributes=new function(el,validation){this.title=el.i18n.concat('id');this.html=this.title.concat('xmlns');this.head=this.title.concat('profile');this.base=['id','href','target'];this.meta=this.title.concat('http-equiv','name','content','scheme');this.link=el.attrs.concat('charset','href','hreflang','type','rel','rev','media','target');this.style=this.title.concat('type','media','title','xml:space');this.script=['id','charset','type','language','src','defer','xml:space'];this.iframe=['longdesc','name','src','frameborder','marginwidth','marginheight','scrolling','align','height','width'].concat(el.coreattrs);this.body=['background','bgcolor','text','link','vlink','alink'].concat(el.attrs,el.loadevents);validation._commonsetting(this,['p','div'].concat(el.heading),['align'].concat(el.attrs));this.dl=this.dir=this.menu=el.attrs.concat('compact');this.ul=this.menu.concat('type');this.ol=this.ul.concat('start');this.li=el.attrs.concat('type','value');this.hr=el.attrs.concat('align','noshade','size','width');this.pre=el.attrs.concat('width','xml:space');this.blockquote=this.q=el.attrs.concat('cite');this.ins=this.del=this.blockquote.concat('datetime');this.a=el.attrs.concat(el.focus,'charset','type','name','href','hreflang','rel','rev','shape','coords','target');this.bdo=el.coreattrs.concat(el.events,'lang','xml:lang','dir');this.br=el.coreattrs.concat('clear');validation._commonsetting(this,['noscript','noframes','dt','dd','address','center','span','em','strong','dfn','code','samp','kbd','var','cite','abbr','acronym','sub','sup','tt','i','b','big','small','u','s','strike','fieldset'],el.attrs);this.basefont=['id','size','color','face'];this.font=el.coreattrs.concat(el.i18n,'size','color','face');this.object=el.attrs.concat('declare','classid','codebase','data','type','codetype','archive','standby','height','width','usemap','name','tabindex','align','border','hspace','vspace');this.param=['id','name','value','valuetype','type'];this.applet=el.coreattrs.concat('codebase','archive','code','object','alt','name','width','height','align','hspace','vspace');this.img=el.attrs.concat('src','alt','name','longdesc','height','width','usemap','ismap','align','border','hspace','vspace');this.map=this.title.concat('title','name','style','class',el.events);this.area=el.attrs.concat('shape','coords','href','nohref','alt','target',el.focus);this.form=el.attrs.concat('action','method','name','enctype',el.formevents,'accept','accept-charset','target');this.label=el.attrs.concat('for','accesskey',el.focusevents);this.input=el.attrs.concat('type','name','value','checked','disabled','readonly','size','maxlength','src','alt','usemap',el.input,'accept','align',el.focus);this.select=el.attrs.concat('name','size','multiple','disabled','tabindex',el.focusevents,el.input);this.optgroup=el.attrs.concat('disabled','label');this.option=el.attrs.concat('selected','disabled','label','value');this.textarea=el.attrs.concat('name','rows','cols','disabled','readonly',el.inputevents,el.focus);this.legend=el.attrs.concat('accesskey','align');this.button=el.attrs.concat('name','value','type','disabled',el.focus);this.isindex=el.coreattrs.concat('prompt',el.i18n);this.table=el.attrs.concat('summary','width','border','frame','rules','cellspacing','cellpadding','align','bgcolor');this.caption=el.attrs.concat('align');this.col=this.colgroup=el.attrs.concat('span','width','align','char','charoff','valign');this.thead=el.attrs.concat('align','char','charoff','valign');this.tfoot=this.tbody=this.thead;this.tr=this.thead.concat('bgcolor');this.td=this.th=this.tr.concat('abbr','axis','headers','scope','rowspan','colspan','nowrap','width','height')}(this.elements,this);this.badTagAttributes=new this.Set({});this.States=new function(el,validation){var here=this;
function setStates(tags,value){var valset=new validation.Set(value);for(var i=0;i<tags.length;i++){here[tags[i]]=valset}}
setStates(['html'],['head','body']);setStates(['head'],['title','base','script','style','meta','link','object','isindex']);setStates(['base','meta','link','hr','param','img','area','input','br','basefont','isindex','col',],[]);setStates(['title','style','script','option','textarea'],['#PCDATA']);setStates(['noscript','iframe','noframes','body','div','li','dd','blockquote','center','ins','del','td','th',],el.Flow);setStates(el.heading,el.Inline);setStates(['p','dt','address','span','bdo','caption','em','strong','dfn','code','samp','kbd','var','cite','abbr','acronym','q','sub','sup','tt','i','b','big','small','u','s','strike','font','label','legend'],el.Inline);setStates(['ul','ol','menu','dir','ul',],['li']);setStates(['dl'],['dt','dd']);setStates(['pre'],validation._exclude(el.Inline,"img|object|applet|big|small|sub|sup|font|basefont"));setStates(['a'],validation._exclude(el.Inline,"a"));setStates(['applet','object'],['#PCDATA','param','form'].concat(el.block,el.inline,el.misc));setStates(['map'],['form','area'].concat(el.block,el.misc));setStates(['form'],validation._exclude(el.Flow,['form']));setStates(['select'],['optgroup','option']);setStates(['optgroup'],['option']);setStates(['fieldset'],['#PCDATA','legend','form'].concat(el.block,el.inline,el.misc));setStates(['button'],validation._exclude(el.Flow,['a','form','iframe'].concat(el.inline_forms)));setStates(['table'],['caption','col','colgroup','thead','tfoot','tbody','tr']);setStates(['thead','tfoot','tbody'],['tr']);setStates(['colgroup'],['col']);setStates(['tr'],['th','td'])}(this.elements,this);this.styleWhitelist=new this.Set(['text-align','list-style-type','float']);this.classBlacklist=new this.Set(['MsoNormal','MsoTitle','MsoHeader','MsoFootnoteText','Bullet1','Bullet2']);this.classFilter=function(value){var classes=value.split(' ');var filtered=[];for(var i=0;i<classes.length;i++){var c=classes[i];if(c&&!this.classBlacklist[c]){filtered.push(c)}}
return filtered.join(' ')}
this._defaultCopyAttribute=function(name,htmlnode,xhtmlnode){var val=htmlnode.getAttribute(name);if(val) xhtmlnode.setAttribute(name,val)}
var filter=this;this.attrFilters=new function(validation,editor){var attrs=validation.elements.attributes;for(var i=0;i<attrs.length;i++){this[attrs[i]]=validation._defaultCopyAttribute}
this['class']=function(name,htmlnode,xhtmlnode){var val=htmlnode.getAttribute('class');if(val) val=validation.classFilter(val);if(val) xhtmlnode.setAttribute('class',val)}
this['*']=function(name,htmlnode,xhtmlnode){var nodeName=filter._getTagName(htmlnode);var bad=filter.badTagAttributes[nodeName];for(var i=0;i<htmlnode.attributes.length;i++){var attr=htmlnode.attributes[i];if(bad&&bad.contains(attr.name)){continue};if(attr.value!==null&&attr.value!==undefined){xhtmlnode.setAttribute(attr.name,attr.value)}}}
if(editor.getBrowserName()=="IE"){this['class']=function(name,htmlnode,xhtmlnode){var val=htmlnode.className;if(val) val=validation.classFilter(val);if(val) xhtmlnode.setAttribute('class',val)}
this['http-equiv']=function(name,htmlnode,xhtmlnode){var val=htmlnode.httpEquiv;if(val) xhtmlnode.setAttribute('http-equiv',val)}
this['xml:lang']=this['xml:space']=function(name,htmlnode,xhtmlnode){try{var val=htmlnode.getAttribute(name);if(val) xhtmlnode.setAttribute(name,val)} catch(e){}}}
this.rowspan=this.colspan=function(name,htmlnode,xhtmlnode){var val=htmlnode.getAttribute(name);if(val&&val!='1') xhtmlnode.setAttribute(name,val)}
this.style=function(name,htmlnode,xhtmlnode){var val=htmlnode.style.cssText;if(val){var styles=val.split(/; */);for(var i=styles.length;i>=0;i--) if(styles[i]){var parts=/^([^:]+): *(.*)$/.exec(styles[i]);var name=parts[1].toLowerCase();if(validation.styleWhitelist[name]){styles[i]=name+': '+parts[2]} else{styles.splice(i,1)}}
if(styles[styles.length-1]) styles.push('');val=styles.join('; ').strip()}
if(val) xhtmlnode.setAttribute('style',val)}}(this,editor);this.excludeTags(['center']);if(editor.config&&editor.config.htmlfilter){this.filterStructure=editor.config.htmlfilter.filterstructure;var exclude=editor.config.htmlfilter;if(exclude.a)
this.excludeAttributes(exclude.a);if(exclude.t)
this.excludeTags(exclude.t);if(exclude.c){var c=exclude.c;if(!c.length) c=[c];for(var i=0;i<c.length;i++){this.excludeTagAttributes(c[i].t,c[i].a)}}
if(exclude.xstyle){var s=exclude.xstyle;for(var i=0;i<s.length;i++){this.styleWhitelist[s[i]]=1}}
if(exclude['class']){var c=exclude['class'];for(var i=0;i<c.length;i++){this.classBlacklist[c[i]]=1}}};this._copyAttributes=function(htmlnode,xhtmlnode,valid){if(valid.contains('*')){this.attrFilters['*'](name,htmlnode,xhtmlnode);return};for(var i=0;i<valid.length;i++){var name=valid[i];var filter=this.attrFilters[name];if(filter) filter(name,htmlnode,xhtmlnode)}}
this._convertToSarissaNode=function(ownerdoc,htmlnode,xhtmlparent){return this._convertNodes(ownerdoc,htmlnode,xhtmlparent,new this.Set(['html']))};this._convertNodes=function(ownerdoc,htmlnode,xhtmlparent,permitted){var name,parentnode=xhtmlparent;var nodename=this._getTagName(htmlnode);var nostructure=!this.filterstructure;var validattrs=this.tagAttributes[nodename];if(validattrs&&(nostructure||permitted[nodename])){try{var xhtmlnode=ownerdoc.createElement(nodename);parentnode=xhtmlnode} catch(e){};if(validattrs&&xhtmlnode)
this._copyAttributes(htmlnode,xhtmlnode,validattrs)}
var kids=htmlnode.childNodes;var permittedChildren=this.States[parentnode.tagName]||permitted;if(kids.length==0){if(htmlnode.text&&htmlnode.text!=""&&(nostructure||permittedChildren['#PCDATA'])){var text=htmlnode.text;var tnode=ownerdoc.createTextNode(text);parentnode.appendChild(tnode)}} else{for(var i=0;i<kids.length;i++){var kid=kids[i];if(kid.parentNode!==htmlnode){if(kid.tagName=='BODY'){if(nodename!='html') continue} else if(kid.parentNode.tagName===htmlnode.tagName){continue}}
if(kid.nodeType==1){var newkid=this._convertNodes(ownerdoc,kid,parentnode,permittedChildren);if(newkid!=null){parentnode.appendChild(newkid)}} else if(kid.nodeType==3){if(nostructure||permittedChildren['#PCDATA'])
parentnode.appendChild(ownerdoc.createTextNode(kid.nodeValue))} else if(kid.nodeType==4){if(nostructure||permittedChildren['#PCDATA'])
parentnode.appendChild(ownerdoc.createCDATASection(kid.nodeValue))}}}
return xhtmlnode}}


/* - kupucontextmenu.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupucontextmenu.js?original=1
function ContextMenu(){this.contextmenu=null;this.seperator=1;this.initialize=function(editor){this.editor=editor;addEventHandler(this.editor.getInnerDocument(),"contextmenu",this.createContextMenu,this);addEventHandler(document,"focus",this.hideContextMenu,this);addEventHandler(editor.getInnerDocument(),"mousedown",this.hideContextMenu,this);addEventHandler(document,"mousedown",this.hideContextMenu,this)};this.createContextMenu=function(event){if(event.stopPropagation){event.stopPropagation()};event.returnValue=false;if(this.editor.getBrowserName()=='IE'){this.editor._saveSelection()};if(this.editor.getBrowserName()=='Mozilla'&&this.contextmenu){return false};this.hideContextMenu();var selNode=this.editor.getSelectedNode();var elements=new Array();for(var id in this.editor.tools){var tool=this.editor.tools[id];if(tool.createContextMenuElements){var els=tool.createContextMenuElements(selNode,event);elements=elements.concat(els)}};this._createNewContextMenu(elements,event);this.last_event=event;return false};this.hideContextMenu=function(event){if(this.contextmenu){try{window.document.getElementsByTagName('body')[0].removeChild(this.contextmenu)} catch(e){};this.contextmenu=null}};this._createNewContextMenu=function(elements,event){var doc=window.document;var menu=doc.createElement('div');menu.contentEditable=false;menu.designMode='Off';this._setMenuStyle(menu);for(var i=0;i<elements.length;i++){var element=elements[i];if(element!==this.seperator){var div=doc.createElement('div');div.style.width='100%';var label=doc.createTextNode('\u00a0'+element.label);div.appendChild(label);menu.appendChild(div);element.element=div;addEventHandler(div,"mousedown",element.action,element.context);addEventHandler(div,"mouseover",element.changeOverStyle,element);addEventHandler(div,"mouseout",element.changeNormalStyle,element);addEventHandler(div,"mouseup",this.hideContextMenu,this)} else{var hr=doc.createElement('hr');menu.appendChild(hr)}};var iframe=this.editor.getDocument().getEditable();var left=event.clientX;var top=event.clientY;var currnode=iframe;if(this.editor.getBrowserName()=='IE'){while(currnode){left+=currnode.offsetLeft+currnode.clientLeft;top+=currnode.offsetTop+currnode.clientTop;currnode=currnode.offsetParent}} else{while(currnode){left+=currnode.offsetLeft;top+=currnode.offsetTop;currnode=currnode.offsetParent}};menu.style.left=left+'px';menu.style.top=top+'px';menu.style.visibility='visible';addEventHandler(menu,'focus', function(){this.blur},menu)
doc.getElementsByTagName('body')[0].appendChild(menu);this.contextmenu=menu};this._setMenuStyle=function(menu){menu.style.position='absolute';menu.style.backgroundColor='white';menu.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';menu.style.fontSize='12px';menu.style.lineHeight='16px';menu.style.borderWidth='1px';menu.style.borderStyle='solid';menu.style.borderColor='black';menu.style.cursor='default';menu.style.width="8em"};this._showOriginalMenu=function(event){window.document.dispatchEvent(this._last_event)}};
function ContextMenuElement(label,action,context){this.label=label;this.action=action;this.context=context;this.element=null;this.changeOverStyle=function(event){this.element.style.backgroundColor='blue'};this.changeNormalStyle=function(event){this.element.style.backgroundColor='white'}};

/* - kupuploneeditor.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupuploneeditor.js?original=1
KupuEditor.prototype._getBase=function(dom){var base=dom.getElementsByTagName('base');if(base.length){return base[0].getAttribute('href')} else{return ''}}
KupuEditor.prototype.makeLinksRelative=function(contents,base,debug){var href=base.replace(/\/[^\/]*$/,'/');var hrefparts=href.split('/');return contents.replace(/(<[^>]* (?:src|href)=")([^"]*)"/g,
function(str,tag,url,offset,contents){var resolveuid=url.indexOf('/resolveuid/');if(resolveuid!=-1){str=tag+url.substr(resolveuid+1)+'"';return str}
var urlparts=url.split('#');var anchor=urlparts[1]||'';url=urlparts[0];var urlparts=url.split('/');var common=0;while(common<urlparts.length&&common<hrefparts.length&&urlparts[common]==hrefparts[common])
common++;var last=urlparts[common];if(common+1==urlparts.length&&last=='emptypage'){urlparts[common]=''}
if(common>2){var path=new Array();var i=0;for(;i+common<hrefparts.length-1;i++){path[i]='..'};while(common<urlparts.length){path[i++]=urlparts[common++]};if(i==0){path[i++]='.'}
str=path.join('/');if(anchor){str=[str,anchor].join('#')}
str=tag+str+'"'};return str})};KupuEditor.prototype.saveDataToField=function(form,field){var sourcetool=this.getTool('sourceedittool');if(sourcetool){sourcetool.cancelSourceMode()};if(!this._initialized){return};this._initialized=false;window.status="Please wait while saving document...";this.logMessage("Starting HTML cleanup");var transform=this._filterContent(this.getInnerDocument().documentElement);var contents=kupu.getXMLBody(transform);if (/^<body[^>]*>(<\/?(p|br)[^>]*>|\&nbsp;)*<\/body>$/.test(contents)){contents=''}
var base=this._getBase(transform);contents=this._fixupSingletons(contents);contents=this.makeLinksRelative(contents,base).replace(/<\/?body[^>]*>/g,"");this.logMessage("Cleanup done, sending document to server");var document=form.ownerDocument;field.value=contents;kupu.content_changed=false};

/* - kupuploneui.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupuploneui.js?original=1


/* - kupusourceedit.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupusourceedit.js?original=1
function SourceEditTool(sourcebuttonid,sourceareaid){this.sourceButton=getFromSelector(sourcebuttonid);this.sourcemode=false;this._currently_editing=null;this.getSourceArea=function(){return getFromSelector(sourceareaid)}};SourceEditTool.prototype=new KupuTool;SourceEditTool.prototype.cancelSourceMode=function(){if(this._currently_editing){this.switchSourceEdit(null,true)}};SourceEditTool.prototype.updateState=SourceEditTool.prototype.cancelSourceMode;SourceEditTool.prototype.initialize=function(editor){this.editor=editor;this._fixTabIndex(this.sourceButton);addEventHandler(this.sourceButton,"click",this.switchSourceEdit,this);this.editor.logMessage(_('Source edit tool initialized'))};SourceEditTool.prototype.switchSourceEdit=function(event,nograb){var kupu=this.editor;var docobj=this._currently_editing||kupu.getDocument();var editorframe=docobj.getEditable();var sourcearea=this.getSourceArea();var kupudoc=docobj.getDocument();var sourceClass='kupu-sourcemode';if(!this.sourcemode){if(window.drawertool){window.drawertool.closeDrawer()};if (/on/i.test(kupudoc.designMode)){kupudoc.designMode='Off'};kupu._initialized=false;var data='';if(kupu.config.filtersourceedit){window.status=_('Cleaning up HTML...');var transform=kupu._filterContent(kupu.getInnerDocument().documentElement);data=kupu.getXMLBody(transform);data=kupu._fixupSingletons(data).replace(/<\/?body[^>]*>/g,"");if(kupu._getBase&&kupu.makeLinksRelative){var base=kupu._getBase(transform);data=kupu.makeLinksRelative(data,base).replace(/<\/?body[^>]*>/g,"")};window.status=''} else{data=kupu.getHTMLBody()};sourcearea.value=data.strip();kupu.setClass(sourceClass);editorframe.style.display='none';sourcearea.style.display='block';if(!nograb){sourcearea.focus()};this._currently_editing=docobj} else{kupu.setHTMLBody(sourcearea.value);kupu.clearClass(sourceClass);sourcearea.style.display='none';editorframe.style.display='block';if (/off/i.test(kupudoc.designMode)){kupudoc.designMode='On'};if(!nograb){docobj.getWindow().focus();var selection=this.editor.getSelection();selection.collapse()};kupu._initialized=true;this._currently_editing=null;this.editor.updateState()};this.sourcemode=!this.sourcemode};SourceEditTool.prototype.enable=function(){KupuButtonEnable(this.sourceButton)};SourceEditTool.prototype.disable=function(){KupuButtonDisable(this.sourceButton)};
function MultiSourceEditTool(sourcebuttonid,textareaprefix){this.sourceButton=getFromSelector(sourcebuttonid);this.textareaprefix=textareaprefix;this._currently_editing=null};MultiSourceEditTool.prototype=new SourceEditTool;MultiSourceEditTool.prototype.getSourceArea=function(){var docobj=this._currently_editing||kupu.getDocument();var sourceareaid=this.textareaprefix+docobj.getEditable().id;return getFromSelector(sourceareaid)};

/* - kupudrawers.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupudrawers.js?original=1
function DrawerTool(){this.drawers={};this.current_drawer=null;this.initialize=function(editor){this.editor=editor;this.isIE=this.editor.getBrowserName()=='IE';window.drawertool=this};this.registerDrawer=function(id,drawer,editor){this.drawers[id]=drawer;drawer.initialize(editor||this.editor,this)};this.openDrawer=function(id){if(this.current_drawer){this.closeDrawer()};var drawer=this.drawers[id];if(this.isIE){drawer.editor._saveSelection()}
drawer.createContent();drawer.editor.suspendEditing();this.current_drawer=drawer};this.updateState=function(selNode){};this.closeDrawer=function(button){if(!this.current_drawer){return};this.current_drawer.hide();this.current_drawer.editor.resumeEditing();this.current_drawer=null}};DrawerTool.prototype=new KupuTool;
function Drawer(elementid,tool){this.element=getFromSelector(elementid);this.tool=tool;this.initialize=function(editor,drawertool){this.editor=editor;this.drawertool=drawertool};this.createContent=function(){this.element.style.display='block';this.focusElement()};this.hide=function(){this.element.style.display='none';this.focussed=false};this.focusElement=function(){this.focussed=false;var iterator=new NodeIterator(this.element);var currnode=iterator.next();while(currnode){if(currnode.tagName&&(currnode.tagName.toUpperCase()=='BUTTON'||(currnode.tagName.toUpperCase()=='INPUT'&&!(/nofocus/.test(currnode.className))))){this.focussed=true;
function focusit(){currnode.focus()}
timer_instance.registerFunction(this,focusit,100);return}
currnode=iterator.next()}}};
function LinkDrawer(elementid,tool,wrap){this.element=getFromSelector(elementid);this.tool=tool;
function wrap(id,tag){return '#'+this.element.id+' '+tag+'.'+id}
var input=getBaseTagClass(this.element,'input','kupu-linkdrawer-input');var preview=getBaseTagClass(this.element,'iframe','kupu-linkdrawer-preview');this.target="";this.createContent=function(){var currnode=this.editor.getSelectedNode();var linkel=this.editor.getNearestParentOfType(currnode,'a');input.value="";this.preview();if(linkel){input.value=linkel.getAttribute('href')} else{input.value='http://'};this.element.style.display='block';this.focusElement()};this.save=function(){this.editor.resumeEditing();var url=input.value;this.tool.createLink(url,null,null,this.target);input.value='';this.drawertool.closeDrawer()};this.preview=function(){preview.src=input.value;if(this.editor.getBrowserName()=='IE'){preview.width="800";preview.height="365";preview.style.zoom="60%"}}
this.preview_loaded=function(){if(input.value!=preview.src){input.value=preview.src}}};LinkDrawer.prototype=new Drawer;
function TableDrawer(elementid,tool){this.element=getFromSelector(elementid);this.tool=tool;this.addpanel=getBaseTagClass(this.element,'div','kupu-tabledrawer-addtable');this.editpanel=getBaseTagClass(this.element,'div','kupu-tabledrawer-edittable');var editclassselect=getBaseTagClass(this.element,'select','kupu-tabledrawer-editclasschooser');var addclassselect=getBaseTagClass(this.element,'select','kupu-tabledrawer-addclasschooser');var alignselect=getBaseTagClass(this.element,'select','kupu-tabledrawer-alignchooser');var newrowsinput=getBaseTagClass(this.element,'input','kupu-tabledrawer-newrows');var newcolsinput=getBaseTagClass(this.element,'input','kupu-tabledrawer-newcols');var makeheadercheck=getBaseTagClass(this.element,'input','kupu-tabledrawer-makeheader');this.createContent=function(){var editor=this.editor;var selNode=editor.getSelectedNode();
function fixClasses(classselect){if(editor.config.table_classes){var classes=editor.config.table_classes['class'];while(classselect.hasChildNodes()){classselect.removeChild(classselect.firstChild)};for(var i=0;i<classes.length;i++){var classinfo=classes[i];var caption=classinfo.xcaption||classinfo;var classname=classinfo.classname||classinfo;var option=document.createElement('option');var content=document.createTextNode(caption);option.appendChild(content);option.setAttribute('value',classname);classselect.appendChild(option)}}};fixClasses(addclassselect);fixClasses(editclassselect);var table=editor.getNearestParentOfType(selNode,'table');if(!table){show=this.addpanel;hide=this.editpanel} else{show=this.editpanel;hide=this.addpanel;var align=this.tool._getColumnAlign(selNode);selectSelectItem(alignselect,align);selectSelectItem(editclassselect,table.className)};hide.style.display='none';show.style.display='block';this.element.style.display='block';this.focusElement()};this.createTable=function(){this.editor.resumeEditing();var rows=newrowsinput.value;var cols=newcolsinput.value;var style=addclassselect.value;var add_header=makeheadercheck.checked;this.tool.createTable(parseInt(rows),parseInt(cols),add_header,style);this.drawertool.closeDrawer()};this.delTableRow=function(){this.editor.resumeEditing();this.tool.delTableRow();this.editor.suspendEditing()};this.addTableRow=function(){this.editor.resumeEditing();this.tool.addTableRow();this.editor.suspendEditing()};this.delTableColumn=function(){this.editor.resumeEditing();this.tool.delTableColumn();this.editor.suspendEditing()};this.addTableColumn=function(){this.editor.resumeEditing();this.tool.addTableColumn();this.editor.suspendEditing()};this.fixTable=function(){this.editor.resumeEditing();this.tool.fixTable();this.editor.suspendEditing()};this.fixAllTables=function(){this.editor.resumeEditing();this.tool.fixAllTables();this.editor.suspendEditing()};this.setTableClass=function(className){this.editor.resumeEditing();this.tool.setTableClass(className);this.editor.suspendEditing()};this.setColumnAlign=function(align){this.editor.resumeEditing();this.tool.setColumnAlign(align);this.editor.suspendEditing()}};TableDrawer.prototype=new Drawer;
function LibraryDrawer(tool,xsluri,libsuri,searchuri,baseelement){this.init=function(tool,xsluri,libsuri,searchuri,baseelement){this.drawerid='kupu-librarydrawer';this.librariespanelid='kupu-librariespanel';this.resourcespanelid='kupu-resourcespanel';this.propertiespanelid='kupu-propertiespanel';if(baseelement){this.baseelement=getFromSelector(baseelement)} else{this.baseelement=getBaseTagClass(document.body,'div','kupu-librarydrawer-parent')}
this.tool=tool;this.element=document.getElementById(this.drawerid);if(!this.element){var e=document.createElement('div');e.id=this.drawerid;e.className='kupu-drawer '+this.drawerid;this.baseelement.appendChild(e);this.element=e}
this.shared.xsluri=xsluri;this.shared.libsuri=libsuri;this.shared.searchuri=searchuri;this.shared.newimages=null;this.shared.xsl=null;this.shared.xmldata=null};if(tool){this.init(tool,xsluri,libsuri,searchuri)}
this.initialize=function(editor,drawertool){this.editor=editor;this.drawertool=drawertool;this.selecteditemid='';var wrapped_callback=new ContextFixer(this._libsXslCallback,this);this._loadXML(this.shared.xsluri,wrapped_callback.execute)};this._libsXslCallback=function(dom){this.shared.xsl=dom;try{var xsltproc=new XSLTProcessor();this.shared.xsltproc=xsltproc;xsltproc.importStylesheet(dom);xsltproc.setParameter("","drawertype",this.drawertype);xsltproc.setParameter("","drawertitle",this.drawertitle);xsltproc.setParameter("","showupload",this.showupload);if(this.editor.config.captions){xsltproc.setParameter("","usecaptions",'yes')}} catch(e){return}};this.createContent=function(){if(this.element.parentNode!=this.baseelement){this.baseelement.appendChild(this.element)}
if(!this.shared.xmldata){if(!window.XSLTProcessor){alert("This function requires better XML support in your browser.");return}
this.loadLibraries()} else{if(this.shared.newimages){this.reloadCurrent();this.shared.newimages=null};this.updateDisplay();this.initialSelection()};this.element.style.display='block'};this._singleLibsXslCallback=function(dom){this.singlelibxsl=dom};this.loadLibraries=function(){var wrapped_callback=new ContextFixer(this._libsContentCallback,this);this._loadXML(this.shared.libsuri,wrapped_callback.execute)};this._libsContentCallback=function(dom){this.shared.xmldata=dom;this.shared.xmldata.setProperty("SelectionLanguage","XPath");this.updateDisplay(this.drawerid);this.initialSelection()};this.initialSelection=function(){var libnode_path='/libraries/library[@selected]';var libnode=this.shared.xmldata.selectSingleNode(libnode_path);if(libnode){var id=libnode.getAttribute('id');this.selectLibrary(id)}}
this.updateDisplay=function(id){if(!id){id=this.drawerid};try{this.shared.xsltproc.setParameter("","showupload",this.showupload)} catch(e){};var doc=this._transformXml();var sourcenode=doc.selectSingleNode('//*[@id="'+id+'"]');var targetnode=document.getElementById(id);Sarissa.copyChildNodes(sourcenode,targetnode);if(!this.focussed){this.focusElement()}
if(this.editor.getBrowserName()=='IE'&&id==this.resourcespanelid){this.updateDisplay(this.drawerid)}};this.deselectActiveCollection=function(){while(1){var selected=this.shared.xmldata.selectSingleNode('//*[@selected]');if(!selected){return};selected.removeAttribute('selected')}};this.selectLibrary=function(id){this.deselectActiveCollection();var divs=this.element.getElementsByTagName('div');for(var i=0;i<divs.length;i++){if(divs[i].className=='kupu-libsource-selected'){divs[i].className='kupu-libsource'}};var libnode_path='/libraries/library[@id="'+id+'"]';var libnode=this.shared.xmldata.selectSingleNode(libnode_path);libnode.setAttribute('selected','1');var items_xpath="items";var items_node=libnode.selectSingleNode(items_xpath);if(items_node&&!this.shared.newimages){this.updateDisplay(this.resourcespanelid);this.updateDisplay(this.propertiespanelid)} else{var src_uri=libnode.selectSingleNode('src/text()').nodeValue;src_uri=src_uri.strip();var wrapped_callback=new ContextFixer(this._libraryContentCallback,this);this._loadXML(src_uri,wrapped_callback.execute,null);this.shared.newimages=null};var newseldiv=document.getElementById(id);newseldiv.className='kupu-libsource-selected'};this._libraryContentCallback=function(dom,src_uri){var libnode=this.shared.xmldata.selectSingleNode('//*[@selected]');var itemsnode=libnode.selectSingleNode("items");var newitemsnode=dom.selectSingleNode("//items");if(this.editor.getBrowserName()=='IE'){newitemsnode=newitemsnode.cloneNode(true)} else{newitemsnode=this.shared.xmldata.importNode(newitemsnode,true)}
if(!itemsnode){libnode.appendChild(newitemsnode)} else{libnode.replaceChild(newitemsnode,itemsnode)};this.updateDisplay(this.resourcespanelid);this.updateDisplay(this.propertiespanelid)};this.selectCollection=function(id){this.deselectActiveCollection();this.removeSelection();var leafnode_path="//collection[@id='"+id+"']";var leafnode=this.shared.xmldata.selectSingleNode(leafnode_path);var loadedInNode=leafnode.getAttribute('loadedInNode');if(loadedInNode){var collnode_path="/libraries/collection[@id='"+loadedInNode+"']";var collnode=this.shared.xmldata.selectSingleNode(collnode_path);if(collnode){collnode.setAttribute('selected','1');this.updateDisplay(this.resourcespanelid);this.updateDisplay(this.propertiespanelid);return}};uri=leafnode.selectSingleNode('uri/text()').nodeValue;uri=(new String(uri)).strip();var collnode_path="/libraries/collection/uri[text()='"+uri+"']/..";var collnode=this.shared.xmldata.selectSingleNode(collnode_path);if(collnode){id=collnode.getAttribute('id');leafnode.setAttribute('loadedInNode',id);collnode.setAttribute('selected','1');this.updateDisplay(this.resourcespanelid);this.updateDisplay(this.propertiespanelid);return};leafnode.setAttribute('selected','1');var src_uri=leafnode.selectSingleNode('src/text()').nodeValue;src_uri=src_uri.strip();var wrapped_callback=new ContextFixer(this._collectionContentCallback,this);this._loadXML(src_uri,wrapped_callback.execute,null)};this._collectionContentCallback=function(dom,src_uri){date=new Date();time=date.getTime();var leafnode=this.shared.xmldata.selectSingleNode('//*[@selected]');leafnode.setAttribute('loadedInNode',time);this.deselectActiveCollection()
var collnode=dom.selectSingleNode('/collection');collnode.setAttribute('id',time);collnode.setAttribute('selected','1');var libraries=this.shared.xmldata.selectSingleNode('/libraries');if(this.editor.getBrowserName()=='IE'){collnode=collnode.cloneNode(true)} else{collnode=this.shared.xmldata.importNode(collnode,true)}
libraries.appendChild(collnode);this.updateDisplay(this.resourcespanelid);this.updateDisplay(this.propertiespanelid)};this.reloadCurrent=function(){this.showupload='';var current=this.shared.xmldata.selectSingleNode('//*[@selected]');if(current.tagName=="resource"){current.removeAttribute("selected");current=current.parentNode;current.setAttribute("selected","1")};var src_node=current.selectSingleNode('src');if(!src_node){return};var src_uri=src_node.selectSingleNode('text()').nodeValue;src_uri=src_uri.strip();var wrapped_callback=new ContextFixer(this._libraryContentCallback,this);this._loadXML(src_uri,wrapped_callback.execute)};this.removeSelection=function(){var oldselxpath='/libraries/*[@selected]//resource[@selected]';var oldselitem=this.shared.xmldata.selectSingleNode(oldselxpath);if(oldselitem){oldselitem.removeAttribute("selected")};if(this.selecteditemid){var item=document.getElementById(this.selecteditemid);if(item){var span=item.getElementsByTagName('span');if(span.length>0){span=span[0];span.className=span.className.replace(' selected-item','')}}
this.selecteditemid=''}
this.showupload=''}
this.selectUpload=function(){this.removeSelection();this.showupload='yes';this.updateDisplay(this.resourcespanelid);this.updateDisplay(this.propertiespanelid)}
this.selectItem=function(item,id){this.removeSelection();var newselxpath='/libraries/*[@selected]//resource[@id="'+id+'"]';var newselitem=this.shared.xmldata.selectSingleNode(newselxpath);newselitem.setAttribute("selected","1");this.updateDisplay(this.propertiespanelid);var span=item.getElementsByTagName('span');if(span.length>0){span=span[0];span.className+=' selected-item'}
this.selecteditemid=id;if(this.editor.getBrowserName()=='IE'){var ppanel=document.getElementById(this.propertiespanelid)
var height=ppanel.clientHeight;if(height>ppanel.scrollHeight) height=ppanel.scrollHeight;if(height<260) height=260;document.getElementById(this.resourcespanelid).style.height=height+'px'}
return}
this.search=function(){var searchvalue=getFromSelector('kupu-searchbox-input').value;var body='SearchableText='+escape(searchvalue);var chunks=this.shared.searchuri.split('?');var searchuri=chunks[0];if(chunks[1]){body+="&"+chunks[1]};var wrapped_callback=new ContextFixer(this._searchCallback,this);this._loadXML(searchuri,wrapped_callback.execute,body)};this._searchCallback=function(dom){var resultlib=dom.selectSingleNode("/library");var items=resultlib.selectNodes("items/*");if(!items.length){alert("No results found.");return};date=new Date();time=date.getTime();resultlib.setAttribute("id",time);this.deselectActiveCollection();resultlib.setAttribute("selected","1");if(this.editor.getBrowserName()=='IE'){resultlib=resultlib.cloneNode(true)} else{resultlib=this.shared.xmldata.importNode(resultlib,true)}
var libraries=this.shared.xmldata.selectSingleNode("/libraries");libraries.appendChild(resultlib);this.updateDisplay(this.drawerid);var newseldiv=getFromSelector(time);newseldiv.className='selected'};this.save=function(){throw "Not yet implemented"};this._transformXml=function(){var doc=Sarissa.getDomDocument();var result=this.shared.xsltproc.transformToDocument(this.shared.xmldata);return result};this._loadXML=function(uri,callback,body){var xmlhttp=new XMLHttpRequest();var method='GET';if(body){method='POST'} else{body=null};xmlhttp.open(method,uri,true);var wrapped_callback=new ContextFixer(this._sarissaCallback,xmlhttp,callback,uri);xmlhttp.onreadystatechange=wrapped_callback.execute;if(method=="POST"){xmlhttp.setRequestHeader('content-type','application/x-www-form-urlencoded')};xmlhttp.send(body)};this._sarissaCallback=function(user_callback,uri){var errmessage='Error loading XML: ';if(uri){errmessage='Error loading '+uri+':'};if(this.readyState==4){if(this.status&&this.status!=200){alert(errmessage+this.status);throw "Error loading XML"};var dom=this.responseXML;user_callback(dom,uri)}}};LibraryDrawer.prototype=new Drawer;LibraryDrawer.prototype.shared={};
function ImageLibraryDrawer(tool,xsluri,libsuri,searchuri,baseelement){this.drawertitle="Insert Image";this.drawertype="image";this.showupload='';if(tool){this.init(tool,xsluri,libsuri,searchuri,baseelement)}
this.uploadImage=function(){var form=document.kupu_upload_form;if(!form||form.node_prop_image.value=='') return;if(form.node_prop_caption.value==""){alert("Please enter a title for the image you are uploading");return};var targeturi=this.shared.xmldata.selectSingleNode('/libraries/*[@selected]/uri/text()').nodeValue
document.kupu_upload_form.action=targeturi+"/kupuUploadImage";document.kupu_upload_form.submit()};this.cancelUpload=function(msg){var s=this.shared.xmldata.selectSingleNode('/libraries/*[@selected]');s.removeAttribute("selected");this.updateDisplay();if(msg!=''){alert(msg)}};this.finishUpload=function(url){this.editor.resumeEditing();var imgclass='image-inline';if(this.editor.config.captions){imgclass+=" captioned"};this.tool.createImage(url,null,imgclass);this.shared.newimages=1;this.drawertool.closeDrawer()};this.save=function(){this.editor.resumeEditing();var selxpath='//resource[@selected]';var selnode=this.shared.xmldata.selectSingleNode(selxpath);if(!selnode){var uploadbutton=this.shared.xmldata.selectSingleNode("/libraries/*[@selected]//uploadbutton");if(uploadbutton){this.uploadImage()};return};var sizeselector=document.getElementsByName('image-size-selector');if(sizeselector&&sizeselector.length>0){sizeselector=sizeselector[0];var uri=sizeselector.options[sizeselector.selectedIndex].value} else{var uri=selnode.selectSingleNode('uri/text()').nodeValue}
uri=uri.strip();var alt=getFromSelector('image_alt').value;var radios=document.getElementsByName('image-align');for(var i=0;i<radios.length;i++){if(radios[i].checked){var imgclass=radios[i].value}};var caption=document.getElementsByName('image-caption');if(caption&&caption.length>0&&caption[0].checked){imgclass+=" captioned"};this.tool.createImage(uri,alt,imgclass);this.drawertool.closeDrawer()}};ImageLibraryDrawer.prototype=new LibraryDrawer;ImageLibraryDrawer.prototype.shared={};
function LinkLibraryDrawer(tool,xsluri,libsuri,searchuri,baseelement){this.drawertitle="Insert Link";this.drawertype="link";this.showupload='';if(tool){this.init(tool,xsluri,libsuri,searchuri,baseelement)}
this.save=function(){this.editor.resumeEditing();var selxpath='//resource[@selected]';var selnode=this.shared.xmldata.selectSingleNode(selxpath);if(!selnode){return};var uri=selnode.selectSingleNode('uri/text()').nodeValue;uri=uri.strip();var title='';title=selnode.selectSingleNode('title/text()').nodeValue;title=title.strip();var type=null;var name=getFromSelector('link_name').value;var node=getFromSelector('link_target');var target=node&&node.value;this.tool.createLink(uri,type,name,target,title);this.drawertool.closeDrawer()}};LinkLibraryDrawer.prototype=new LibraryDrawer;LinkLibraryDrawer.prototype.shared={};
function HandleDrawerEnter(event,clickid){var key;event=event||window.event;key=event.which||event.keyCode;if(key==13){if(clickid){var button=document.getElementById(clickid);if(button){button.click()}}
event.cancelBubble=true;if(event.stopPropogation) event.stopPropogation();return false}
return true}


/* - kupuploneinit.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/kupuploneinit.js?original=1
function initPloneKupu(editorId){var topnode=getFromSelector(editorId);var prefix='#'+editorId+' ';var iframe=getFromSelector(prefix+'iframe.kupu-editor-iframe');var textarea=getFromSelector(prefix+'textarea.kupu-editor-textarea');var l=new DummyLogger();var ibody=iframe.contentWindow.document.body;var form=textarea.form;var initialtext=textarea.value||(_SARISSA_IS_IE?'<p></p>':'<p><br></p>');var conf=loadDictFromXML(document,prefix+'xml.kupuconfig');var doc=new KupuDocument(iframe);var kupu=new KupuEditor(doc,conf,l);kupu.setHTMLBody(initialtext);var cm=new ContextMenu();kupu.setContextMenu(cm);var ui=new KupuUI(prefix+'select.kupu-tb-styles');kupu.registerTool('ui',ui);var execCommand=function(cmd){return function(button,editor){editor.execCommand(cmd)}};var boldchecker=ParentWithStyleChecker(new Array('b','strong'),'font-weight','bold');var boldbutton=new KupuStateButton(prefix+'button.kupu-bold',execCommand('bold'),boldchecker,'kupu-bold','kupu-bold-pressed');kupu.registerTool('boldbutton',boldbutton);var italicschecker=ParentWithStyleChecker(new Array('i','em'),'font-style','italic');var italicsbutton=new KupuStateButton(prefix+'button.kupu-italic',execCommand('italic'),italicschecker,'kupu-italic','kupu-italic-pressed');kupu.registerTool('italicsbutton',italicsbutton);var subscriptchecker=ParentWithStyleChecker(new Array('sub'));var subscriptbutton=new KupuStateButton(prefix+'button.kupu-subscript',execCommand('subscript'),subscriptchecker,'kupu-subscript','kupu-subscript-pressed');kupu.registerTool('subscriptbutton',subscriptbutton);var superscriptchecker=ParentWithStyleChecker(new Array('super','sup'));var superscriptbutton=new KupuStateButton(prefix+'button.kupu-superscript',execCommand('superscript'),superscriptchecker,'kupu-superscript','kupu-superscript-pressed');kupu.registerTool('superscriptbutton',superscriptbutton);var justifyleftbutton=new KupuButton(prefix+'button.kupu-justifyleft',execCommand('justifyleft'));kupu.registerTool('justifyleftbutton',justifyleftbutton);var justifycenterbutton=new KupuButton(prefix+'button.kupu-justifycenter',execCommand('justifycenter'));kupu.registerTool('justifycenterbutton',justifycenterbutton);var justifyrightbutton=new KupuButton(prefix+'button.kupu-justifyright',execCommand('justifyright'));kupu.registerTool('justifyrightbutton',justifyrightbutton);var outdentbutton=new KupuButton(prefix+'button.kupu-outdent',execCommand('outdent'));kupu.registerTool('outdentbutton',outdentbutton);var indentbutton=new KupuButton(prefix+'button.kupu-indent',execCommand('indent'));kupu.registerTool('indentbutton',indentbutton);var undobutton=new KupuButton(prefix+'button.kupu-undo',execCommand('undo'));kupu.registerTool('undobutton',undobutton);var redobutton=new KupuButton(prefix+'button.kupu-redo',execCommand('redo'));kupu.registerTool('redobutton',redobutton);var removeimagebutton=new KupuRemoveElementButton(prefix+'button.kupu-removeimage','img','kupu-removeimage');kupu.registerTool('removeimagebutton',removeimagebutton);var removelinkbutton=new KupuRemoveElementButton(prefix+'button.kupu-removelink','a','kupu-removelink');kupu.registerTool('removelinkbutton',removelinkbutton);var listtool=new ListTool(prefix+'button.kupu-insertunorderedlist',prefix+'button.kupu-insertorderedlist',prefix+'select.kupu-ulstyles',prefix+'select.kupu-olstyles');kupu.registerTool('listtool',listtool);var definitionlisttool=new DefinitionListTool(prefix+'button.kupu-insertdefinitionlist');kupu.registerTool('definitionlisttool',definitionlisttool);var tabletool=new TableTool();kupu.registerTool('tabletool',tabletool);var showpathtool=new ShowPathTool('kupu-showpath-field');kupu.registerTool('showpathtool',showpathtool);var sourceedittool=new SourceEditTool(prefix+'button.kupu-source',prefix+'textarea.kupu-editor-textarea');kupu.registerTool('sourceedittool',sourceedittool);var imagetool=NoContextMenu(new ImageTool());kupu.registerTool('imagetool',imagetool);var linktool=NoContextMenu(new LinkTool());kupu.registerTool('linktool',linktool);var zoom=new KupuZoomTool(prefix+'button.kupu-zoom',prefix+'select.kupu-tb-styles',prefix+'button.kupu-logo');kupu.registerTool('zoomtool',zoom);if(typeof KupuSpellChecker!='undefined'){var spellchecker=new KupuSpellChecker('kupu-spellchecker-button','kupu_library_tool/spellcheck');kupu.registerTool('spellchecker',spellchecker)} else{var spellchecker_tool=document.getElementById('kupu-spellchecker');spellchecker_tool.style.display='none'}
var beforeunloadTool=window.onbeforeunload&&window.onbeforeunload.tool;if(beforeunloadTool){var initialBody=ibody.innerHTML;beforeunloadTool.addHandler(function(){return ibody.innerHTML!=initialBody});beforeunloadTool.chkId[textarea.id]=function(){return false}
beforeunloadTool.addForm(form)}
var fmtname=textarea.name+'_text_format';var pulldown=form[fmtname];if(pulldown&&pulldown.type=='select-one'){for(var i=0 ;i<pulldown.length;i++){var opt=pulldown.options[i];opt.selected=opt.defaultSelected=(opt.value=='text/html')}
pulldown.disabled=true;var hidden=document.createElement('input');hidden.type='hidden';hidden.name=fmtname;hidden.value='text/html';pulldown.parentNode.appendChild(hidden)};var opendrawer=function(drawerid){return function(button,editor){drawertool.openDrawer(prefix+drawerid)}};var imagelibdrawerbutton=new KupuButton(prefix+'button.kupu-image',opendrawer('imagelibdrawer'));kupu.registerTool('imagelibdrawerbutton',imagelibdrawerbutton);var linklibdrawerbutton=new KupuButton(prefix+'button.kupu-inthyperlink',opendrawer('linklibdrawer'));kupu.registerTool('linklibdrawerbutton',linklibdrawerbutton);var linkdrawerbutton=new KupuButton(prefix+'button.kupu-exthyperlink',opendrawer('linkdrawer'));kupu.registerTool('linkdrawerbutton',linkdrawerbutton);var tabledrawerbutton=new KupuButton(prefix+'button.kupu-table',opendrawer('tabledrawer'));kupu.registerTool('tabledrawerbutton',tabledrawerbutton);var drawertool=window.drawertool||new DrawerTool();kupu.registerTool('drawertool',drawertool);var drawerparent=prefix+'div.kupu-librarydrawer-parent';var linklibdrawer=new LinkLibraryDrawer(linktool,conf['link_xsl_uri'],conf['link_libraries_uri'],conf['search_links_uri'],drawerparent);drawertool.registerDrawer(prefix+'linklibdrawer',linklibdrawer,kupu);var imagelibdrawer=new ImageLibraryDrawer(imagetool,conf['image_xsl_uri'],conf['image_libraries_uri'],conf['search_images_uri'],drawerparent);drawertool.registerDrawer(prefix+'imagelibdrawer',imagelibdrawer,kupu);var linkdrawer=new LinkDrawer(prefix+'div.kupu-linkdrawer',linktool);drawertool.registerDrawer(prefix+'linkdrawer',linkdrawer,kupu);var tabledrawer=new TableDrawer(prefix+'div.kupu-tabledrawer',tabletool);drawertool.registerDrawer(prefix+'tabledrawer',tabledrawer,kupu);
function prepareForm(event){kupu.saveDataToField(this.form,this);var drawer=window.document.getElementById('kupu-librarydrawer');if(drawer){drawer.parentNode.removeChild(drawer)}};addEventHandler(textarea.form,'submit',prepareForm,textarea);return kupu};

/* - Plorum.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/Plorum.js?original=1
function confirmaExclusao(){objCheckbox=document.getElementById(idCheckbox);tamCheckbox=objCheckbox.length;flag=false;for(var i=0;i<tamCheckbox;i++){alert(tamCheckbox[i]);if(tamCheckbox[i].checked)
flag=true}
if(flag)
return window.confirm('TEM CERTEZA DE QUE DESEJA EXCLUIR O(S) ITEM(NS) SELECIONADO(S)?');return true}
function foco(idElemento){elemento=document.getElementById(idElemento);try{alert(elemento);elemento.focus()}
catch(error){}}
function marcarTodos(idCheckBox){checkBox=document.getElementById(idCheckBox);alert(checkBox);try{tamCheckBox=checkBox.options.length;if(tamCheckBox!=undefined){for(var i=0;i<tamCheckBox;i++){checkBox[i].checked=true}}
else{checkBox.checked=true}
return}
catch(error){}
return}


/* - fckeditor.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/fckeditor.js?original=1
var FCKeditor=function(instanceName,width,height,toolbarSet,value){this.InstanceName=instanceName ;this.Width=width||'100%' ;this.Height=height||'200' ;this.ToolbarSet=toolbarSet||'Default' ;this.Value=value||'' ;this.BasePath='/fckeditor/' ;this.CheckBrowser=true ;this.DisplayErrors=true ;this.EnableSafari=false ;this.EnableOpera=false ;this.Config=new Object() ;this.OnError=null }
FCKeditor.prototype.Version='2.4.3' ;FCKeditor.prototype.VersionBuild='15657' ;FCKeditor.prototype.Create=function(){document.write(this.CreateHtml()) }
FCKeditor.prototype.CreateHtml=function(){if(!this.InstanceName||this.InstanceName.length==0){this._ThrowError(701,'You must specify an instance name.') ;return '' }
var sHtml='<div>' ;if(!this.CheckBrowser||this._IsCompatibleBrowser()){sHtml+='<input type="hidden" id="'+this.InstanceName+'" name="'+this.InstanceName+'" value="'+this._HTMLEncode(this.Value)+'" style="display:none" />' ;sHtml+=this._GetConfigHtml() ;sHtml+=this._GetIFrameHtml() }
else{var sWidth=this.Width.toString().indexOf('%')>0?this.Width:this.Width+'px' ;var sHeight=this.Height.toString().indexOf('%')>0?this.Height:this.Height+'px' ;sHtml+='<textarea name="'+this.InstanceName+'" rows="4" cols="40" style="width:'+sWidth+';height:'+sHeight+'">'+this._HTMLEncode(this.Value)+'<\/textarea>' }
sHtml+='</div>' ;return sHtml }
FCKeditor.prototype.ReplaceTextarea=function(){if(!this.CheckBrowser||this._IsCompatibleBrowser()){var oTextarea=document.getElementById(this.InstanceName) ;var colElementsByName=document.getElementsByName(this.InstanceName) ;var i=0;while(oTextarea||i==0){if(oTextarea&&oTextarea.tagName.toLowerCase()=='textarea')
break ;oTextarea=colElementsByName[i++] }
if(!oTextarea){alert('Error: The TEXTAREA with id or name set to "'+this.InstanceName+'" was not found') ;return }
oTextarea.style.display='none' ;this._InsertHtmlBefore(this._GetConfigHtml(),oTextarea) ;this._InsertHtmlBefore(this._GetIFrameHtml(),oTextarea) }}
FCKeditor.prototype._InsertHtmlBefore=function(html,element){if(element.insertAdjacentHTML)
element.insertAdjacentHTML('beforeBegin',html) ;else{var oRange=document.createRange() ;oRange.setStartBefore(element) ;var oFragment=oRange.createContextualFragment(html);element.parentNode.insertBefore(oFragment,element) }}
FCKeditor.prototype._GetConfigHtml=function(){var sConfig='' ;for(var o in this.Config){if(sConfig.length>0) sConfig+='&amp;' ;sConfig+=encodeURIComponent(o)+'='+encodeURIComponent(this.Config[o]) }
return '<input type="hidden" id="'+this.InstanceName+'___Config" value="'+sConfig+'" style="display:none" />' }
FCKeditor.prototype._GetIFrameHtml=function(){var sFile='fckeditor.html' ;try{if((/fcksource=true/i).test(window.top.location.search))
sFile='fckeditor.original.html' }
catch(e){}
var sLink=this.BasePath+'editor/'+sFile+'?InstanceName='+encodeURIComponent(this.InstanceName) ;if(this.ToolbarSet) sLink+='&amp;Toolbar='+this.ToolbarSet ;return '<iframe id="'+this.InstanceName+'___Frame" src="'+sLink+'" width="'+this.Width+'" height="'+this.Height+'" frameborder="0" scrolling="no"></iframe>' }
FCKeditor.prototype._IsCompatibleBrowser=function(){return FCKeditor_IsCompatibleBrowser(this.EnableSafari,this.EnableOpera) }
FCKeditor.prototype._ThrowError=function(errorNumber,errorDescription){this.ErrorNumber=errorNumber ;this.ErrorDescription=errorDescription ;if(this.DisplayErrors){document.write('<div style="COLOR: #ff0000">') ;document.write('[ FCKeditor Error '+this.ErrorNumber+': '+this.ErrorDescription+' ]') ;document.write('</div>') }
if(typeof(this.OnError)=='function')
this.OnError(this,errorNumber,errorDescription) }
FCKeditor.prototype._HTMLEncode=function(text){if(typeof(text)!="string")
text=text.toString() ;text=text.replace(/&/g,"&amp;").replace(/"/g, "&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;") ;return text }
function FCKeditor_IsCompatibleBrowser(enableSafari,enableOpera){var sAgent=navigator.userAgent.toLowerCase() ;if(sAgent.indexOf("msie")!=-1&&sAgent.indexOf("mac")==-1&&sAgent.indexOf("opera")==-1){var sBrowserVersion=navigator.appVersion.match(/MSIE (.\..)/)[1] ;return(sBrowserVersion>=5.5) }
if(navigator.product=="Gecko"&&navigator.productSub>=20030210&&!(typeof(opera)=='object'&&opera.postError))
return true ;if(enableOpera&&sAgent.indexOf('opera')==0&&parseInt(navigator.appVersion,10)>=9)
return true ;if(enableSafari&&sAgent.indexOf('safari')!=-1)
return(sAgent.match(/safari\/(\d+)/ )[1] >= 312 ) ;	// Build must be at least 312(1.3)
return false }

/* - fck_plone.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/fck_plone.js?original=1
var FCKBaseHref={};makeLinksRelative=function(basehref,contents){var base=basehref.replace('http://www.frameworkdemoiselle.gov.br','');var href=base.replace(/\/[^\/]*$/,'/');var hrefparts=href.split('/');return contents.replace(/(<[^>]* (?:src|href)=")([^"]*)"/g,
function(str,tag,url,offset,contents){url=url.replace('http://www.frameworkdemoiselle.gov.br','');if(url.substring(0,1)=='#'){str=tag+url+'"';alert(str)}
else{var urlparts=url.split('#');var anchor=urlparts[1]||'';url=urlparts[0];var urlparts=url.split('/');var common=0;while(common<urlparts.length&&common<hrefparts.length&&urlparts[common]==hrefparts[common])
common++;var last=urlparts[common];if(common+1==urlparts.length&&last=='emptypage'){urlparts[common]=''}
if(common>0){var path=new Array();var i=0;for(;i+common<hrefparts.length-1;i++){path[i]='..'};while(common<urlparts.length){path[i++]=urlparts[common++]};if(i==0){path[i++]='.'}
str=path.join('/');if(anchor){str=[str,anchor].join('#')}
str=tag+str+'"'}}
return str})};finalizePublication=function(editorInstance){var oField=editorInstance.LinkedField;var fieldName=oField.name;var baseHref=FCKBaseHref[fieldName];if(baseHref){relativeLinksHtml=makeLinksRelative(FCKBaseHref[fieldName],editorInstance.GetXHTML());oField.value=relativeLinksHtml}}
getParamValue=function(id){value=document.getElementById(id).value;if(value=='true') return true;if(value=='false') return false;return value}
FCKeditor_Plone_start_instance=function(fckContainer,inputname){var inputContainer=document.getElementById(inputname+'_'+'cleaninput');if(inputContainer){var fckParams=['path_user','base_path','fck_basehref','links_basehref','input_url','allow_server_browsing','browser_root','allow_file_upload','allow_image_upload','allow_flash_upload','fck_skin_path','lang','fck_default_r2l','force_paste_as_text','allow_latin_entities','spellchecker','keyboard_entermode','keyboard_shiftentermode','fck_toolbar','editor_width','editor_height'];var fckValues={};for(var i=0;i<fckParams.length;i++){var id=inputname+'_'+fckParams [i];fckValues [fckParams [i]]=getParamValue(id)}
var oFck=new FCKeditor(inputname);var pathUser=fckValues ['path_user']+'/';oFck.BasePath=fckValues ['base_path']+'/';oFck.Config['CustomConfigurationsPath']=fckValues ['input_url']+'/fckconfigPlone.js?field_name='+inputname;oFck.BaseHref=fckValues ['fck_basehref'];FCKBaseHref[inputname]=fckValues ['links_basehref'];oFck.Value=inputContainer.innerHTML;oFck.Config['LinkBrowser']=fckValues ['allow_server_browsing'];oFck.Config['LinkBrowserURL']=fckValues ['base_path']+'/fckbrowser/browser.html?field_name='+inputname+'&Connector='+fckValues ['input_url']+'/connectorPlone&ServerPath='+fckValues ['browser_root']+'&CurrentPath='+pathUser ;oFck.Config['LinkUpload']=fckValues ['allow_file_upload'] ;oFck.Config['LinkUploadURL']=fckValues ['input_url']+'/uploadPlone?field_name='+inputname+'&CurrentPath='+pathUser;oFck.Config['ImageBrowser']=fckValues ['allow_server_browsing'];oFck.Config['ImageBrowserURL']=fckValues ['base_path']+'/fckbrowser/browser.html?field_name='+inputname+'&Type=Image&Connector='+fckValues ['input_url']+'/connectorPlone&ServerPath='+fckValues ['browser_root']+'&CurrentPath='+pathUser ;oFck.Config['ImageUpload']=fckValues ['allow_image_upload'] ;oFck.Config['ImageUploadURL']=fckValues ['input_url']+'/uploadPlone?field_name='+inputname+'&CurrentPath='+pathUser;oFck.Config['FlashBrowser']=fckValues ['allow_server_browsing'];oFck.Config['FlashBrowserURL']=fckValues ['base_path']+'/fckbrowser/browser.html?field_name='+inputname+'&Type=Flash&Connector='+fckValues ['input_url']+'/connectorPlone&ServerPath='+fckValues ['browser_root']+'&CurrentPath='+pathUser ;oFck.Config['FlashUpload']=fckValues ['allow_flash_upload'] ;oFck.Config['FlashUploadURL']=fckValues ['input_url']+'/uploadPlone?field_name='+inputname+'&CurrentPath='+pathUser;oFck.Config['SkinPath']=fckValues ['base_path']+'/editor/'+fckValues ['fck_skin_path'];oFck.Config['AutoDetectLanguage']=false;oFck.Config['DefaultLanguage']=fckValues ['lang'];oFck.Config['ForcePasteAsPlainText']=fckValues ['force_paste_as_text'];oFck.Config['IncludeLatinEntities']=fckValues ['allow_latin_entities'];oFck.Config['SpellChecker']=fckValues ['spellchecker'];oFck.Config['EnterMode']=fckValues ['keyboard_entermode'];oFck.Config['ShiftEnterMode']=fckValues ['keyboard_shiftentermode'];oFck.ToolbarSet=fckValues ['fck_toolbar'];oFck.Width=fckValues ['editor_width'];oFck.Height=fckValues ['editor_height'];try{fckContainer.innerHTML=oFck.CreateHtml();document.getElementById(inputname+'_fckLoading').style.display='none'}
catch(e){document.getElementById(inputname+'_fckLoading').style.display='none';document.getElementById(inputname+'_fckError').style.display='block'}}}
Save_inline=function(fieldname,form,editorInstance){if(editorInstance.Commands.GetCommand('FitWindow').GetState()){kukit.log('Full screen mode must be disabled before saving inline');editorInstance.Commands.GetCommand('FitWindow').Execute()} ;saveField=document.getElementById(fieldname+'_fckSaveField');if(saveField){kukit.log('Fire the savekupu server event = save inline without submitting');saveField.value='Document saved !!';if(saveField.fireEvent){saveField.fireEvent('onChange')}
else{var evt=document.createEvent("HTMLEvents");evt.initEvent("change",true,true);saveField.dispatchEvent(evt)}
comp=(setTimeout("saveField.value=''",2000));return false}
else{kukit.log('Try to submit the form in portal_factory');form.submit()}}


/* - fck_ploneInit.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/fck_ploneInit.js?original=1
function getElementsByClassName(oElm,strTagName,strClassName){var arrElements=(strTagName=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(strTagName);var arrReturnElements=new Array();strClassName=strClassName.replace(/\-/g,"\\-");var oRegExp=new RegExp("(^|\\s)"+strClassName+"(\\s|$)");var oElement;for(var i=0;i<arrElements.length;i++){oElement=arrElements[i];if(oRegExp.test(oElement.className)){arrReturnElements.push(oElement)}}
return(arrReturnElements)}
function FCKeditor_OnComplete(editorInstance){editorInstance.Events.AttachEvent('OnAfterLinkedFieldUpdate',finalizePublication) }
FCKeditor_Plone_Init=function(){var fckContainers=getElementsByClassName(document,'div','fckContainer');for(var i=0;i<fckContainers.length;i++){var fckContainer=fckContainers [i];var fckContainerId=fckContainer.getAttribute('id');var inputname=fckContainerId.replace("_fckContainer","");FCKeditor_Plone_start_instance(fckContainer,inputname)}}
registerPloneFunction(FCKeditor_Plone_Init);

/* - mark_special_links.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/mark_special_links.js?original=1
function scanforlinks(){if(!W3CDOM){return false}
if((typeof external_links_in_content_only!='undefined')&&(external_links_in_content_only==false)){links=document.getElementsByTagName('a');for(i=0;i<links.length;i++){if((links[i].getAttribute('href'))&&(links[i].className.indexOf('link-plain')==-1)){var linkval=links[i].getAttribute('href');if(linkval.toLowerCase().indexOf(window.location.protocol+'//'+window.location.host)==0){} else if(linkval.indexOf('http:')!=0){} else{links[i].setAttribute('target','_blank')}}}}
contentarea=getContentArea();if(!contentarea)
return false;links=contentarea.getElementsByTagName('a');for(i=0;i<links.length;i++){if((links[i].getAttribute('href'))&&(links[i].className.indexOf('link-plain')==-1)){var linkval=links[i].getAttribute('href');if(linkval.toLowerCase().indexOf(window.location.protocol+'//'+window.location.host)==0){} else if(linkval.indexOf('http:')!=0){protocols=['mailto','ftp','news','irc','h323','sip','callto','https','feed','webcal'];for(p=0;p<protocols.length;p++){if(linkval.indexOf(protocols[p]+':')==0){wrapNode(links[i],'span','link-'+protocols[p]);break}}} else{if(links[i].getElementsByTagName('img').length==0){wrapNode(links[i],'span','link-external')}
if((typeof external_links_open_new_window!='undefined')&&(external_links_open_new_window==true)){links[i].setAttribute('target','_blank')}}}}};registerPloneFunction(scanforlinks);

/* - jq.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/jq.js?original=1
jQuery.fn.CleanCSSAnimation=function(_animetyp,$arg1,$arg2,$arg3,$arg4){var $args=new Array($arg1,$arg2,$arg3,$arg4);(_animetyp=="animate")?$fnpos=2:$fnpos=1;var $cbfn="";jQuery.each($args,function(o){if(typeof this=="function"){$cbfn=$args[o];$fnpos=o}
return});$args.splice($fnpos,1, function(){_apllyOldCallback(this,$cbfn)});return this.each(function(){unMakeInlineCSS(this,'pre');jQuery(this)[_animetyp].apply(jQuery(this),$args)})};
function unMakeInlineCSS($elem,$when){var $nodisClass="displaynone";var $disClass="displayblock";if($when=="pre"){if(jQuery($elem).is('.'+$nodisClass))
jQuery($elem).css("display","none").removeClass($nodisClass);else if(jQuery($elem).is('.'+$disClass))
jQuery($elem).css("display","block").removeClass($disClass)} else if($when=="post"){if(jQuery($elem).css("display")=="none")
jQuery($elem).addClass($nodisClass).css("display","");else if(jQuery($elem).css("display")=="block")
jQuery($elem).addClass($disClass).css("display","")}};
function _apllyOldCallback($elem,$cbfn){unMakeInlineCSS($elem,"post");if(typeof $cbfn=="function")
$cbfn.apply($elem)};

/* - jq_dickerfisch_menue-c.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/jq_dickerfisch_menue-c.js?original=1
function DickerFisch($selektor,_settings){var _DF_hoverclass='over',_DF_parent_class='parent',$ofocusstyle='ofocus';var _DF_ActiveCatnAncestorsofIT=new Array(".activepath",".active");var _jsreadyclass='navfxenabled';var _DF_hideclass='DF_hidelis',_waitingnavclass='DF_waitlis';var $nodisClass="displaynone",$disClass="displayblock";var _DF_obj=this;var _settings=_settings||this;this.NavTimeout=_settings.NavTimeout||250;this.ListType=_settings.ListType||'ul';this.Effect=(_settings.Effect)?_settings.Effect:0;this.ShowEffect=_settings.ShowEffect||'show';this.HideEffect=_settings.HideEffect||'hide';this.EffectSpeed=_settings.EffectSpeed||300;this.FitIfViewportSmaller=_settings.FitIfViewportSmaller||1111;this.Fit2ViewportClass=_settings.Fit2ViewportClass||false;this.LimitLinks=(typeof _settings.LimitLinks=="number")?_settings.LimitLinks:1;_DF_obj.LimitLinks=($.browser.opera&&_DF_obj.LimitLinks=="1")?0:_DF_obj.LimitLinks;this._DF_NavTimeID;this._fastpullout=function(_eventobj){var $fastpullreturn=false;if(typeof $($selektor+' li.'+_DF_hoverclass).get(0)=="undefined")
$fastpullreturn=true;else{$fastpullreturn=true;$(_eventobj).siblings("li").each(function(i){if($(this).is('.'+_DF_hoverclass)){$fastpullreturn=false;return false}})}
return $fastpullreturn};this.$oldtimer=0;this.$fastpullin=function(_eventobj){var $aktimer=(typeof _DF_obj.NavTimeout!="number")?_DF_obj.NavTimeout[1]:_DF_obj.NavTimeout;if(typeof _DF_obj.NavTimeout!="number"&&$(_eventobj).parents('li').length=="0"&&!$(_eventobj).children(_DF_obj.ListType).children('li').is('.'+_DF_hoverclass))
$aktimer=_DF_obj.NavTimeout[0];if($(_eventobj).is('.'+_DF_hoverclass)||_DF_obj.$oldtimer!=$aktimer){window.clearTimeout(_DF_obj._DF_NavTimeID);_DF_obj._DF_NavTimeID=window.setTimeout(_DF_obj._hide,$aktimer)}
_DF_obj.$oldtimer=$aktimer};this.$navstatus=function(_eventobj,$action){if($action=="show"){$(_eventobj).addClass(_waitingnavclass).removeClass(_DF_hideclass);if(_DF_obj._fastpullout(_eventobj))
_DF_obj.$show()}else if($action=="hide")
$(_eventobj).removeClass(_waitingnavclass).addClass(_DF_hideclass);_DF_obj.$fastpullin(_eventobj,'pullin')};this.$show=function(){_showobj=$selektor+' li.'+_waitingnavclass;if(_DF_obj.Effect==1||_DF_obj.Effect==2)
$(_showobj+':not(.'+_DF_hoverclass+')>'+_DF_obj.ListType).addClass($nodisClass).CleanCSSAnimation(_DF_obj.ShowEffect,_DF_obj.EffectSpeed,function(){$(this).removeClass($disClass)});$(_showobj).removeClass(_waitingnavclass).addClass(_DF_hoverclass)};this._hide=function(){$hideobj=$selektor+' li.'+_DF_hideclass;if(_DF_obj.Effect==1||_DF_obj.Effect==3)
$($hideobj).removeClass(_DF_hideclass).children(_DF_obj.ListType).CleanCSSAnimation(_DF_obj.HideEffect,_DF_obj.EffectSpeed,function(){$(this).removeClass($nodisClass).parent('li').removeClass(_DF_hoverclass);_DF_obj.$show()});else{$($hideobj).removeClass(_DF_hoverclass+' '+_DF_hideclass);_DF_obj.$show()}};this.FitToScreen=function($liobj){var $subpos=$($liobj).addClass(_DF_hoverclass).children(_DF_obj.ListType).css('visibility','hidden').offset({scroll:false})['left']+$($liobj).children(_DF_obj.ListType).outerWidth();if(_viewport<$subpos)
$($liobj).children(_DF_obj.ListType).addClass(_DF_obj.Fit2ViewportClass)};if(_DF_obj.Fit2ViewportClass){var _viewport=$(document).innerWidth();_DF_obj.Fit2ViewportClass=(_viewport<_DF_obj.FitIfViewportSmaller)?_DF_obj.Fit2ViewportClass:false}
$($selektor+">"+_DF_obj.ListType).addClass(_jsreadyclass).find("li["+_DF_obj.ListType+"]").each(function(){$(this).hover(function(){_DF_obj.$navstatus(this,'show')}, function(){_DF_obj.$navstatus(this,'hide')}).addClass(_DF_parent_class).find('a').focus(function(){$(this).addClass($ofocusstyle);if(_DF_obj.LimitLinks<1)
$(this).parents('li').addClass(_DF_hoverclass);else
$(this).parents('li').filter(_DF_ActiveCatnAncestorsofIT[0]+','+_DF_ActiveCatnAncestorsofIT[1]).addClass(_DF_hoverclass)}).blur(function(){$(this).removeClass($ofocusstyle).parents("li").removeClass(_DF_hoverclass)});if(_DF_obj.Fit2ViewportClass)
_DF_obj.FitToScreen(this)});if(_DF_obj.Fit2ViewportClass)
$($selektor+" li["+_DF_obj.ListType+"]").removeClass(_DF_hoverclass).children(_DF_obj.ListType).css('visibility','')};

/* - jquery.cycle.all.min.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/jquery.cycle.all.min.js?original=1
(function($){var ver="2.88";if($.support==undefined){$.support={opacity:!($.browser.msie)}}function debug(s){if($.fn.cycle.debug){log(s)}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2)});return this}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,(!opts2.rev&&!opts.backwards))},startTime)}})};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0}if(options===undefined||options===null){options={}}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout)}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts)}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false}$.fn.cycle[options](opts);return false;default:options={fx:options}}return options}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0}if(typeof arg2=="string"){options.oneTimeFx=arg2}go(options.elements,options,1,num>=options.currSlide);return false}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0}go(options.elements,options,1,(!opts.rev&&!opts.backwards))}}}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter")}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent)}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent)}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove()})}opts.pagerAnchors=null;if(opts.destroy){opts.destroy(opts)}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts)})}if(opts.continuous){opts.after.push(function(){go(els,opts,0,(!opts.rev&&!opts.backwards))})}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides)}if($cont.css("position")=="static"){$cont.css("position","relative")}if(opts.width){$cont.width(opts.width)}if(opts.height&&opts.height!="auto"){$cont.height(opts.height)}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide)}else{if(opts.backwards){opts.startingSlide=els.length-1}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i)}opts.randomMap.sort(function(a,b){return Math.random()-0.5});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1]}else{if(opts.startingSlide>=els.length){opts.startingSlide=0}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i}$(this).css("z-index",z)});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width)}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height)}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width")}if(!h){h=e.offsetHeight||e.height||$e.attr("height")}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"})}}if(opts.pause){$cont.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(supportMultiTransitions(opts)===false){return false}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options)},opts.requeueTimeout);requeue=true;return false}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(requeue){return false}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst)}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed)}if(!opts.sync){opts.speed=opts.speed/2}var buffer=opts.fx=="shuffle"?500:250;while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing}if(!opts.speedIn){opts.speedIn=opts.speed}if(!opts.speedOut){opts.speedOut=opts.speed}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0}opts.nextSlide=opts.randomMap[opts.randomIndex]}else{if(opts.backwards){opts.nextSlide=opts.startingSlide==0?(els.length-1):opts.startingSlide-1}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts)}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true])}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true])}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1)})}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1)})}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts)}exposeAddSlide(opts,els);return opts}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this)});$.each(opts.after,function(){opts.original.after.push(this)})}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=false;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing; currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}if(changed||opts.nextSlide==opts.currSlide){opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){var roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{var roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);});if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2])}if(v&&v!="transparent"){return v}}return"#ffffff"}$slides.each(function(){$(this).css("background-color",getBg(this))})}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1))};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride}else{speedIn=speedOut=1}easeIn=easeOut=null}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb)};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter)}if(!opts.sync){fn()}});if(opts.sync){fn()}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0}}};$.fn.cycle.ver=function(){return ver};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false}})(jQuery);(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after()}};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h}};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h}};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w}};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w}};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0}};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0}};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0}};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0}};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true)});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i])}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift())}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop())}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count)}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count)}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb()}})})};opts.cssBefore={display:"block",opacity:1,top:0,left:0}};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0}};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0}};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0}};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0}};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2}});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0}};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH}});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0}};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w}};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h}};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w}};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0}});opts.cssBefore={width:0,top:0}};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0}});opts.cssBefore={height:0,left:0}};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0}});opts.cssBefore={top:0,width:0}};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0}});opts.cssBefore={left:0,height:0}};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w}else{if(d=="up"){opts.cssBefore.top=h}else{if(d=="down"){opts.cssBefore.top=-h}else{opts.cssBefore.left=w}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0}};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w}else{if(d=="up"){opts.animOut.top=-h}else{if(d=="down"){opts.animOut.top=h}else{opts.animOut.left=-w}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0}};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0}}else{opts.animOut.opacity=0}});opts.cssBefore={left:0,top:0};opts.animIn={left:0}};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none")})()});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0}}})(jQuery);

/* - smoothgallery_mootools.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/smoothgallery_mootools.js?original=1
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('k 11=f(1S){k 4s=f(){j(9.1e&&Y[0]!=\'7h\')h 9.1e.2m(9,Y);Q h 9};I(k n W 9)4s[n]=9[n];4s.U=1S;h 4s};11.1G=f(){};11.U={N:f(1S){k 4r=M 9(\'7h\');k 7g=f(2s,2f){j(!2s.2m||!2f.2m)h T;h f(){9.1t=2s;h 2f.2m(9,Y)}};I(k n W 1S){k 2s=4r[n];k 2f=1S[n];j(2s&&2s!=2f)2f=7g(2s,2f)||2f;4r[n]=2f}h M 11(4r)},1T:f(1S){I(k n W 1S)9.U[n]=1S[n]}};1H.N=f(){k R=Y;R=(R[1])?[R[0],R[1]]:[9,R[0]];I(k n W R[1])R[0][n]=R[1][n];h R[0]};1H.5p=f(){I(k i=0;i<Y.14;i++)Y[i].N=11.U.1T};M 1H.5p(59,1r,5e,76,11);j(5r 2I==\'3z\'){k 2I=11.1G;2I.U={}}f $q(u){j(u===1K||u===3z)h T;k q=5r u;j(q==\'5o\'){j(u 4m 2I)h\'r\';j(u 4m 1r)h\'1R\';j(u.9Y){2c(u.6x){1c 1:h\'r\';1c 3:h u.9X.15(\'\\\\S\')?\'9W\':\'4f\'}}}h q};f $2B(u){h!!(u||u===0)};f $9V(u,7f){h($q(u))?u:7f};f $7e(3o,1B){h G.9U(G.7e()*(1B-3o+1)+3o)};f $3Q(1f){9T(1f);9S(1f);h 1K};j(12.9R)12.3w=12[12.9Q?\'9P\':\'53\']=1g;Q j(L.6J&&!L.9O&&!9N.9M)12.3W=1g;Q j(L.9L!=1K)12.5m=1g;1r.U.4q=1r.U.4q||f(O,J){I(k i=0;i<9.14;i++)O.1i(J,9[i],i,9)};1r.U.4X=1r.U.4X||f(O,J){k 5u=[];I(k i=0;i<9.14;i++)5u[i]=O.1i(J,9[i],i,9);h 5u};1r.U.7d=1r.U.7d||f(O,J){I(k i=0;i<9.14;i++){j(!O.1i(J,9[i],i,9))h T}h 1g};1r.U.7c=1r.U.7c||f(O,J){I(k i=0;i<9.14;i++){j(O.1i(J,9[i],i,9))h 1g}h T};1r.U.4g=1r.U.4g||f(3a,F){F=F||0;j(F<0)F=G.1B(0,9.14+F);34(F<9.14){j(9[F]===3a)h F;F++}h-1};1r.N({1o:1r.U.4q,54:f(){k 36=[];I(k i=0;i<9.14;i++)36[i]=9[i];h 36},3Z:f(3a){k i=0;34(i<9.14){j(9[i]==3a)9.47(i,1);Q i++}h 9},15:f(3a,F){h 9.4g(3a,F)!=-1},N:f(36){I(k i=0;i<36.14;i++)9.18(36[i]);h 9},9K:f(1u){k u={},14=G.3o(9.14,1u.14);I(k i=0;i<14;i++)u[1u[i]]=9[i];h u}});f $A(1R){h 1r.U.54.1i(1R)};f $1o(7b,O,J){h 1r.U.4q.1i(7b,O,J)};5e.N({15:f(7a,79){h M 9J(7a,79).15(9)},2C:f(){h 5s(9)},74:f(){h 3t(9)},5n:f(){h 9.35(/-\\D/g,f(28){h 28.5t(1).78()})},6O:f(){h 9.35(/\\w[A-Z]/g,f(28){h(28.5t(0)+\'-\'+28.5t(1).3G())})},9I:f(){h 9.3G().35(/\\b[a-z]/g,f(28){h 28.78()})},77:f(){h 9.35(/^\\s+|\\s+$/g,\'\')},45:f(){h 9.35(/\\s{2,}/g,\' \').77()},3I:f(1R){k 1l=9.28(/\\d{1,3}/g);h(1l)?1l.3I(1R):T},3s:f(1R){k 2J=9.28(\'^#?(\\\\w{1,2})(\\\\w{1,2})(\\\\w{1,2})$\');h(2J)?2J.3s(1R):T}});1r.N({3I:f(1R){j(9.14<3)h T;j(9[3]&&9[3]==0)h\'9H\';k 2J=[];I(k i=0;i<3;i++){k 4p=(9[i]-0).9G(16);2J.18(4p.14==1?\'0\'+4p:4p)}h 1R?2J:\'#\'+2J.3r(\'\')},3s:f(1R){j(9.14!=4)h T;k 1l=[];I(k i=1;i<4;i++){j(9[i].14==1)9[i]+=9[i];1l.18(5s(9[i],16))}h 1R?1l:\'1l(\'+1l.3r(\',\')+\')\'}});76.N({2C:f(){h 5s(9)},74:f(){h 3t(9)}});59.N({2e:f(m){k O=9;m=1H.N({\'J\':O,\'o\':T,\'Y\':1K,\'2d\':T,\'2k\':T,\'4o\':T},m||{});j(m.Y!=1K&&5r m.Y!=\'3z\'&&!(m.Y 4m 1r))m.Y=[m.Y];h f(o){k R=m.Y||Y;j(m.o){o=(m.o===1g)?o||12.o:M m.o(o);R=[o].9F(R)}k 2t=f(){h O.2m(m.J,R)};j(m.2d)h 9E(2t,m.2d);j(m.2k)h 9D(2t,m.2k);j(m.4o){6g{k 5q=2t()}6f(73){5q=73}9C{h 5q}}Q h 2t()}},9B:f(R,J){h 9.2e({\'Y\':R,\'J\':J})},4o:f(R,J){h 9.2e({\'Y\':R,\'J\':J,\'4o\':1g})()},J:f(J,R){h 9.2e({\'J\':J,\'Y\':R})},9A:f(J,R){h 9.2e({\'J\':J,\'o\':1g,\'Y\':R})},2d:f(4n,J,R){h 9.2e({\'2d\':4n,\'J\':J,\'Y\':R})()},2k:f(4n,J,R){h 9.2e({\'2k\':4n,\'J\':J,\'Y\':R})()}});k 1b=M 11({1e:f(l){j($q(l)==\'4j\')l=L.6H(l);h $(l)}});f $(l){j(!l)h T;j(l.72||[12,L].15(l))h l;j($q(l)==\'4j\')l=L.44(l);j($q(l)!=\'r\')h T;j([\'5o\',\'9z\'].15(l.41.3G())||l.N)h l;l.72=1g;31.6z(l);l.N=1H.N;j(!(l 4m 2I))l.N(1b.U);h l};k 1N=M 11({});M 1H.5p(1N);L.2G=L.56;f $$(){j(!Y)h T;j(Y.14==1){j(!Y[0])h T;j(Y[0].71)h Y[0]}k 1w=[];$1o(Y,f(1v){2c($q(1v)){1c\'r\':1w.18($(1v));1P;1c\'4j\':1v=L.2G(1v);6F:j(1v.14){$1o(1v,f(l){j($(l))1w.18(l)})}}});1w.71=1g;h 1H.N(1w,M 1N)};1N.3T=f(n){h f(){k R=Y;k 3J=[];k 1w=1g;$1o(9,f(l){k 2t=l[n].2m(l,R);j($q(2t)!=\'r\')1w=T;3J.18(2t)});j(1w)3J=$$(3J);h 3J}};1b.N=f(1S){I(k n W 1S){2I.U[n]=1S[n];1b.U[n]=1S[n];1N.U[n]=1N.3T(n)}};1b.N({4l:f(l,70){l=$(l)||M 1b(l);2c(70){1c"6Y":$(l.26).6Z(9,l);1P;1c"6X":j(!l.5k())$(l.26).4k(9);Q $(l.26).6Z(9,l.5k());1P;1c"6W":l.4k(9)}h 9},9y:f(l){h 9.4l(l,\'6Y\')},5K:f(l){h 9.4l(l,\'6X\')},9x:f(l){h 9.4l(l,\'6W\')},5J:f(l){9.4k($(l)||M 1b(l));h 9},3Z:f(){9.26.9w(9);h 9},9v:f(6V){k l=9.9u(6V!==T);h $(l)},6G:f(l){l=$(l)||M 1b(l);9.26.9t(l,9);h l},9s:f(33){j(12.3w){2c(9.3C()){1c\'1h\':9.9r.6S=33;h 9;1c\'52\':9.4d(\'33\',33);h 9}}9.4k(L.9q(33));h 9},3A:f(1d){h 9.1d.15(\'(?:^|\\\\s+)\'+1d+\'(?:\\\\s+|$)\')},6T:f(1d){j(!9.3A(1d))9.1d=(9.1d+\' \'+1d).45();h 9},6U:f(1d){j(9.3A(1d))9.1d=9.1d.35(1d,\'\').45();h 9},9p:f(1d){h 9.3A(1d)?9.6U(1d):9.6T(1d)},1F:f(n,K){j(n==\'1Y\')9.6R(3t(K));Q 9.1h[n.5n()]=(K.18)?K.3I():K;h 9},6I:f(1L){2c($q(1L)){1c\'5o\':I(k n W 1L)9.1F(n,1L[n]);1P;1c\'4j\':j(12.3w)9.6S=1L;Q 9.6E(\'1h\',1L)}h 9},6R:f(1Y){j(1Y==0){j(9.1h.4i!="3S")9.1h.4i="3S"}Q{j(9.1h.4i!="6Q")9.1h.4i="6Q"}j(!9.4h||!9.4h.9o)9.1h.9n=1;j(12.3w)9.1h.3D="3x(1Y="+1Y*3g+")";9.1h.1Y=9.1Y=1Y;h 9},1W:f(n){n=n.5n();k 1h=9.1h[n]||T;j(!$2B(1h)){j(n==\'1Y\')h $2B(9.1Y)?9.1Y:1;j([\'2n\',\'9m\'].15(n)){h[9.1W(n+\'-2w\')||0,9.1W(n+\'-5a\')||0,9.1W(n+\'-6B\')||0,9.1W(n+\'-2i\')||0].3r(\' \')}j(L.6P)1h=L.6P.9l(9,1K).9k(n.6O());Q j(9.4h)1h=9.4h[n]}h(1h&&n.15(\'1A\',\'i\')&&1h.15(\'1l\'))?1h.3I():1h},1a:f(q,O){9.V=9.V||{};9.V[q]=9.V[q]||{\'1u\':[],\'1z\':[]};j(!9.V[q].1u.15(O)){9.V[q].1u.18(O);j(9.6N){9.6N((q==\'2M\'&&12.5m)?\'5f\':q,O,T)}Q{O=O.J(9);9.9j(\'58\'+q,O);9.V[q].1z.18(O)}}h 9},9i:f(1L){j(1L){I(k q W 1L)9.1a(q,1L[q])}h 9},1E:f(q,O){j(9.V&&9.V[q]){k 1D=9.V[q].1u.4g(O);j(1D==-1)h 9;k 1O=9.V[q].1u.47(1D,1)[0];j(9.6M){9.6M((q==\'2M\'&&12.5m)?\'5f\':q,1O,T)}Q{9.9h(\'58\'+q,9.V[q].1z.47(1D,1)[0])}}h 9},5h:f(q){j(9.V){j(q){j(9.V[q]){9.V[q].1u.1o(f(O){9.1E(q,O)},9);9.V[q]=1K}}Q{I(k 6L W 9.V)9.5h(6L);9.V=1K}}h 9},1x:f(q,R){j(9.V&&9.V[q]){R=R||[];j($q(R)!=\'1R\')R=[R];9.V[q].1u.1o(f(O){O.2m(9,R)},9)}},5j:f(5l){k l=9[5l+\'6K\'];34($q(l)==\'4f\')l=l[5l+\'6K\'];h $(l)},9g:f(){h 9.5j(\'2s\')},5k:f(){h 9.5j(\'9f\')},9e:f(){k l=9.9d;34($q(l)==\'4f\')l=l.9c;h $(l)},9b:f(){k l=9.9a;34($q(l)==\'4f\')l=l.99;h $(l)},98:f(){h $(9.26)},97:f(){h $$(9.6J)},4d:f(n,K){2c(n){1c\'6C\':9.1d=K;1P;1c\'1h\':9.6I(K);1P;1c\'24\':j(12.53){k l=$(L.6H(\'<\'+9.3C()+\' 24="\'+K+\'" />\'));$1o(9.96,f(4e){j(4e.24!=\'24\')l.4d(4e.24,4e.K)});j(9.26)9.6G(l);h l}6F:9.6E(n,K)}h 9},95:f(1L){I(k n W 1L)9.4d(n,1L[n]);h 9},94:f(6D){9.93=6D;h 9},92:f(n){h(n==\'6C\')?9.1d:9.6k(n)},3C:f(){h 9.41.3G()},2O:f(){k l=9,4c=0,4b=0;91{4c+=l.4c||0;4b+=l.4b||0;l=l.90}34(l);h{\'x\':4c,\'y\':4b}},2a:f(x,y){9.3U=x;9.3V=y},3P:f(){h{\'1V\':{\'x\':9.3U,\'y\':9.3V},\'2A\':{\'x\':9.2x,\'y\':9.2v},\'3O\':{\'x\':9.68,\'y\':9.69}}},4D:f(){h 9.2O().y},4F:f(){h 9.2O().x},8Z:f(){k 5i=9.2O();k u={\'3j\':9.2x,\'3i\':9.2v,\'2i\':5i.x,\'2w\':5i.y};u.5a=u.2i+u.3j;u.6B=u.2w+u.3i;h u},2F:f(){2c(9.3C()){1c\'2U\':j(9.6A!=-1)h 9.m[9.6A].K;1P;1c\'8Y\':j(!(9.8X&&[\'8W\',\'8V\'].15(9.q))&&![\'3S\',\'33\',\'8U\'].15(9.q))1P;1c\'8T\':h 9.K}h T}});k 8S=12;12.1a=L.1a=1b.U.1a;12.1E=L.1E=1b.U.1E;k 31={1w:[],6z:f(r){31.1w.18(r)},5g:f(){12.1E(\'6y\',31.5g);31.1w.1o(f(l){l.5h();I(k p W 1b.U)2I[p]=12[p]=L[p]=l[p]=1K;l.N=1K})}};12.1a(\'6y\',31.5g);k 3F=M 11({1e:f(o){9.o=o||12.o;9.q=9.o.q;9.3H=9.o.3H||9.o.8R;j(9.3H.6x==3)9.3H=9.3H.26;9.8Q=9.o.8P;9.8O=9.o.8N;9.8M=9.o.8L;9.8K=9.o.8J;j([\'5f\',\'2M\'].15(9.q)){9.3f=9.o.6w?(9.o.6w/ (12.51 ? -6v : 6v)) : -(9.o.8I || 0) /3}Q j(9.q.15(\'1O\')){9.5d=9.o.6r||9.o.8H;I(k 24 W 3F.1u){j(3F.1u[24]==9.5d)k 6u=24}9.1O=6u||5e.8G(9.5d).3G()}Q j(9.q.15(\'2l\')||9.q==\'8F\'){9.1y={\'x\':9.o.5c||9.o.6t+L.2r.3U,\'y\':9.o.5b||9.o.6s+L.2r.3V};9.5y={\'x\':9.o.5c?9.o.5c-12.66:9.o.6t,\'y\':9.o.5b?9.o.5b-12.67:9.o.6s};9.8E=(9.o.6r==3)||(9.o.8D==2);2c(9.q){1c\'8C\':9.4a=9.o.4a||9.o.8B;1P;1c\'8A\':9.4a=9.o.4a||9.o.5L}}},1s:f(){9.49();9.48();h 9},49:f(){j(9.o.49)9.o.49();Q 9.o.8z=1g;h 9},48:f(){j(9.o.48)9.o.48();Q 9.o.8y=T;h 9}});3F.1u={\'8x\':13,\'8w\':38,\'8v\':40,\'2i\':37,\'5a\':39,\'8u\':27,\'8t\':32,\'8s\':8,\'8r\':46};59.N({2y:f(J,R){h 9.2e({\'J\':J,\'Y\':R,\'o\':3F})}});k 5S=M 11({8q:f(O){9.2H=9.2H||[];9.2H.18(O);h 9},5Z:f(){j(9.2H&&9.2H.14)9.2H.47(0,1)[0].2d(10,9)},8p:f(){9.2H=[]}});k 3c=M 11({1a:f(q,O){j(O!=11.1G){9.V=9.V||{};9.V[q]=9.V[q]||[];j(!9.V[q].15(O))9.V[q].18(O)}h 9},1x:f(q,R,2d){j(9.V&&9.V[q]){9.V[q].1o(f(O){O.2e({\'J\':9,\'2d\':2d,\'Y\':R})()},9)}h 9},1E:f(q,O){j(9.V&&9.V[q])9.V[q].3Z(O);h 9}});k 3b=M 11({2N:f(6q,m){9.m=1H.N(6q,m);j(9.1a){I(k 3E W 9.m){j(($q(9.m[3E])==\'f\')&&3E.15(\'^58[A-Z]\'))9.1a(3E,9.m[3E])}}h 9}});f $E(1v,3D){h($(3D)||L).42(1v)};f $8o(1v,3D){h($(3D)||L).2G(1v)};1b.N({3B:f(1v){k 1Q=[];1v.45().4Y(\' \').1o(f(43,i){k 1q=43.28(\'^(\\\\w*|\\\\*)(?:#([\\\\6p-]+)|\\\\.([\\\\6p-]+))?(?:\\\\[["\\\']?(\\\\w+)["\\\']?(?:([\\\\*\\\\^\\\\$]?=)["\\\']?(\\\\w*)["\\\']?)?\\\\])?$\');j(!1q)h;1q[1]=1q[1]||\'*\';j(i==0){j(1q[2]){k l=9.44(1q[2]);j(!l||((1q[1]!=\'*\')&&(1b.U.3C.1i(l)!=1q[1])))h;1Q=[l]}Q{1Q=$A(9.56(1q[1]))}}Q{1Q=1N.U.6m.1i(1Q,1q[1]);j(1q[2])1Q=1N.U.6o.1i(1Q,1q[2])}j(1q[3])1Q=1N.U.6n.1i(1Q,1q[3]);j(1q[4])1Q=1N.U.6l.1i(1Q,1q[4],1q[6],1q[5])},9);h $$(1Q)},44:f(2Z){k l=L.44(2Z);j(!l)h T;I(k 1t=l.26;1t!=9;1t=1t.26){j(!1t)h T}h l},42:f(1v){h 9.2G(1v)[0]},2G:f(1v){k 57=[];1v.4Y(\',\').1o(f(43){57.N(9.3B(43))},9);h $$(57)}});L.N=1H.N;L.N({8n:f(1d){h L.3B(\'.\'+1d)},42:1b.U.42,3B:1b.U.3B,2G:1b.U.2G});1N.N({6o:f(2Z,8m){k 1p=[];9.1o(f(l){j(l.2Z==2Z)1p.18(l)});h 1p},6n:f(1d){k 1p=[];9.1o(f(l){j(1b.U.3A.1i(l,1d))1p.18(l)});h 1p},6m:f(41){k 1p=[];9.1o(f(l){1p.N(l.56(41))});h 1p},6l:f(24,K,55){k 1p=[];9.1o(f(l){k 30=l.6k(24);j(!30)h 1p;j(!55)h 1p.18(l);2c(55){1c\'*=\':j(30.15(K))1p.18(l);1P;1c\'=\':j(30==K)1p.18(l);1P;1c\'^=\':j(30.15(\'^\'+K))1p.18(l);1P;1c\'$=\':j(30.15(K+\'$\'))1p.18(l)}h 1p});h 1p}});k 6j=M 11({14:0,1e:f(u){9.u={};I(k n W u){9.u[n]=u[n];9.14++}},8l:f(1O){h 9.u[1O]},1U:f(1O,K){j(K==1K)h T;j(9.u[1O]==3z)9.14++;9.u[1O]=K;h 9},3Z:f(1O){j(9.u[1O]==3z)h T;k u={};9.14--;I(k n W 9.u){j(n!=1O)u[n]=9.u[n]}9.u=u;h 9},1o:f(O,J){I(k n W 9.u)O.1i(J||9,n,9.u[n])},N:f(u){9.1e(1H.N(9.u,u));h 9},1G:f(){h(9.14==0)},1u:f(){k 1u=[];I(k n W 9.u)1u.18(n);h 1u},1z:f(){k 1z=[];I(k n W 9.u)1z.18(9.u[n]);h 1z}});f $H(u){h M 6j(u)};k 2q=M 11({1e:f(1A){j(1A.6i&&1A.6h)h 1A;k 1l=(1A.18)?1A:1A.3s(1g);h 1H.N(1l,2q.U)},6i:f(){k 3y=$A(Y);k 3x=50;j($q(3y[3y.14-1])==\'5N\')3x=3y.8k();k 1l=9.54();3y.1o(f(1A){1A=M 2q(1A);I(k i=0;i<3;i++)1l[i]=G.3e((1l[i]/ 3g * (3g - 3x)) + (1A[i] /3g*3x))});h M 2q(1l)},6h:f(){k 1l=[];I(k i=0;i<3;i++)1l.18(8j-9[i]);h M 2q(1l)}});f $C(1A){h M 2q(1A)};12.N=1H.N;12.N({8i:f(){j(9.53)6g{L.8h("8g",T,1g)}6f(e){}},1a:f(q,O){j(q==\'3u\'){j(9.3Y)O();Q j(!9.V||!9.V.3u){k 3v=f(){j(9.3Y)h;9.3Y=1g;j(9.1f)9.1f=$3Q(9.1f);1b.U.1x.1i(9,\'3u\');9.V.3u=1K}.J(9);j(L.3X&&9.3W){9.1f=f(){j([\'3Y\',\'6d\'].15(L.3X))3v()}.2k(50)}Q j(L.3X&&9.3w){L.8f("<52 2Z=6e 8e 8d=8c:8b(0)><\\/52>");$(\'6e\').8a=f(){j(9.3X==\'6d\')3v()}}Q{9.1a("89",3v);L.1a("88",3v)}}}1b.U.1a.1i(9,q,O);h 9},87:f(6c){h 9.1a(\'3u\',6c)}});12.N({63:f(){j(9.3W||9.51)h 9.86;Q h L.2r.6b||L.4N.6b},62:f(){j(9.3W||9.51)h 9.85;h L.2r.6a||L.4N.6a},60:f(){h L.2r.69},61:f(){h L.2r.68},64:f(){h 9.67||L.2r.3V},65:f(){h 9.66||L.2r.3U},3P:f(){h{\'1V\':{\'x\':9.65(),\'y\':9.64()},\'2A\':{\'x\':9.63(),\'y\':9.62()},\'3O\':{\'x\':9.61(),\'y\':9.60()}}},2O:f(){h{\'x\':0,\'y\':0}}});k X={};X.1C=M 11({2j:f(){h{2K:11.1G,2g:11.1G,5T:11.1G,5Y:X.2Q.4U,4Z:84,1J:\'4I\',2T:1g,5U:50}},1e:f(m){9.r=9.r||1K;9.2N(9.2j(),m);j(9.m.1e)9.m.1e.1i(9)},19:f(){k 2Y=M 5W().5V();j(2Y<9.2Y+9.m.4Z){9.5X=2Y-9.2Y;9.2E();9.2o()}Q{9.1s(1g);9.P=9.B;9.2o();9.1x(\'2g\',9.r,10);9.5Z()}},1U:f(B){9.P=B;9.2o();h 9},2E:f(){9.P=9.2D(9.F,9.B)},2D:f(F,B){h 9.m.5Y(9.5X,F,(B-F),9.m.4Z)},1m:f(F,B){j(!9.m.2T)9.1s();Q j(9.1f)h 9;9.F=F;9.B=B;9.2Y=M 5W().5V();9.1f=9.19.2k(G.3e(83/9.m.5U),9);9.1x(\'2K\',9.r);h 9},1s:f(2h){j(!9.1f)h 9;9.1f=$3Q(9.1f);j(!2h)9.1x(\'5T\',9.r);h 9},82:f(F,B){h 9.1m(F,B)},81:f(2h){h 9.1s(2h)}});X.1C.1T(M 5S);X.1C.1T(M 3c);X.1C.1T(M 3b);X.2Q={5F:f(t,b,c,d){h c*t/d+b},4U:f(t,b,c,d){h-c/2*(G.4T(G.1X*t/d)-1)+b}};X.23={2U:f(n,B){j(n.15(\'1A\',\'i\'))h 9.2q;j(B.15&&B.15(\' \'))h 9.3T;h 9.5R},1M:f(l,n,2X){j(!2X.18)2X=[2X];k F=2X[0],B=2X[1];j(!B&&B!=0){B=F;F=l.1W(n)}k 17=9.2U(n,B);h{F:17.1M(F),B:17.1M(B),17:17}}};X.23.5R={1M:f(K){h 3t(K)},2V:f(F,B,2W){h 2W.2D(F,B)},2F:f(K,1J){h K+1J}};X.23.3T={1M:f(K){h K.18?K:K.4Y(\' \').4X(f(v){h 3t(v)})},2V:f(F,B,2W){k P=[];I(k i=0;i<F.14;i++)P[i]=2W.2D(F[i],B[i]);h P},2F:f(K,1J){h K.3r(1J+\' \')+1J}};X.23.2q={1M:f(K){h K.18?K:K.3s(1g)},2V:f(F,B,2W){k P=[];I(k i=0;i<F.14;i++)P[i]=G.3e(2W.2D(F[i],B[i]));h P},2F:f(K){h\'1l(\'+K.3r(\',\')+\')\'}};X.5Q=X.1C.N({1e:f(l,n,m){9.r=$(l);9.n=n;9.1t(m)},5I:f(){h 9.1U(0)},2E:f(){9.P=9.17.2V(9.F,9.B,9)},1U:f(B){9.17=X.23.2U(9.n,B);h 9.1t(9.17.1M(B))},1m:f(F,B){j(9.1f&&9.m.2T)h 9;k 1n=X.23.1M(9.r,9.n,[F,B]);9.17=1n.17;h 9.1t(1n.F,1n.B)},2o:f(){9.r.1F(9.n,9.17.2F(9.P,9.m.1J))}});1b.N({80:f(n,m){h M X.5Q(9,n,m)}});X.5P=X.1C.N({1e:f(l,m){9.r=$(l);9.1t(m)},2E:f(){I(k p W 9.F)9.P[p]=9.17[p].2V(9.F[p],9.B[p],9)},1U:f(B){k 1n={};9.17={};I(k p W B){9.17[p]=X.23.2U(p,B[p]);1n[p]=9.17[p].1M(B[p])}h 9.1t(1n)},1m:f(u){j(9.1f&&9.m.2T)h 9;9.P={};9.17={};k F={},B={};I(k p W u){k 1n=X.23.1M(9.r,p,u[p]);F[p]=1n.F;B[p]=1n.B;9.17[p]=1n.17}h 9.1t(F,B)},2o:f(){I(k p W 9.P)9.r.1F(p,9.17[p].2F(9.P[p],9.m.1J))}});1b.N({7Z:f(m){h M X.5P(9,m)}});X.1N=X.1C.N({1e:f(1w,m){9.1w=$$(1w);9.1t(m)},2E:f(){I(k i W 9.F){k 3q=9.F[i],2p=9.B[i],2b=9.17[i],3p=9.P[i]={};I(k p W 3q)3p[p]=2b[p].2V(3q[p],2p[p],9)}},1U:f(B){k 1n={};9.17={};I(k i W B){k 2p=B[i],2b=9.17[i]={},5O=1n[i]={};I(k p W 2p){2b[p]=X.23.2U(p,2p[p]);5O[p]=2b[p].1M(2p[p])}}h 9.1t(1n)},1m:f(u){j(9.1f&&9.m.2T)h 9;9.P={};9.17={};k F={},B={};I(k i W u){k 4W=u[i],3q=F[i]={},2p=B[i]={},2b=9.17[i]={};I(k p W 4W){k 1n=X.23.1M(9.1w[i],p,4W[p]);3q[p]=1n.F;2p[p]=1n.B;2b[p]=1n.17}}h 9.1t(F,B)},2o:f(){I(k i W 9.P){k 3p=9.P[i],2b=9.17[i];I(k p W 3p)9.1w[i].1F(p,2b[p].2F(3p[p],9.m.1J))}}});X.7Y=X.1C.N({1e:f(r,m){9.P=[];9.r=$(r);9.1a(\'2K\',f(){9.r.1a(\'2M\',9.1s.J(9,T))}.J(9));9.1E(\'2g\',f(){9.r.1E(\'2M\',9.1s.J(9,T))}.J(9));9.1t(m)},2E:f(){I(k i=0;i<2;i++)9.P[i]=9.2D(9.F[i],9.B[i])},2a:f(x,y){j(9.1f&&9.m.2T)h 9;k l=9.r.3P();k 1z={\'x\':x,\'y\':y};I(k z W l.2A){k 1B=l.3O[z]-l.2A[z];j($2B(1z[z]))1z[z]=($q(1z[z])==\'5N\')?G.1B(G.3o(1z[z],1B),0):1B;Q 1z[z]=l.1V[z]}h 9.1m([l.1V.x,l.1V.y],[1z.x,1z.y])},7X:f(){h 9.2a(T,0)},7W:f(){h 9.2a(T,\'5M\')},7V:f(){h 9.2a(0,T)},7U:f(){h 9.2a(\'5M\',T)},5L:f(l){h 9.2a($(l).4F(),$(l).4D())},2o:f(){9.r.2a(9.P[0],9.P[1])}});X.7T=X.1C.N({1e:f(l,m){9.r=$(l).1F(\'2n\',0);9.2R=M 1b(\'7S\').5K(9.r).1F(\'7R\',\'3S\').5J(9.r);9.2N({\'1k\':\'4E\'},m);9.P=[];9.1t(9.m)},2E:f(){I(k i=0;i<2;i++)9.P[i]=9.2D(9.F[i],9.B[i])},4E:f(){9.2n=\'2w\';9.4V=\'3i\';9.2S=9.r.2v;h[9.r.1W(\'2n-2w\').2C(),9.2R.1W(\'3i\').2C()]},4G:f(){9.2n=\'2i\';9.4V=\'3j\';9.2S=9.r.2x;h[9.r.1W(\'2n-2i\').2C(),9.2R.1W(\'3j\').2C()]},5H:f(1k){h 9.1m(9[1k||9.m.1k](),[0,9.2S])},5G:f(1k){h 9.1m(9[1k||9.m.1k](),[-9.2S,0])},5I:f(1k){9[1k||9.m.1k]();h 9.1U([-9.2S,0])},7Q:f(1k){9[1k||9.m.1k]();h 9.1U([0,9.2S])},7P:f(1k){j(9.2R.2v==0||9.2R.2x==0)h 9.5H(1k);Q h 9.5G(1k)},2o:f(){9.r.1F(\'2n-\'+9.2n,9.P[0]+9.m.1J);9.2R.1F(9.4V,9.P[1]+9.m.1J)}});X.2Q={5F:f(t,b,c,d){h c*t/d+b},7O:f(t,b,c,d){h c*(t/=d)*t+b},7N:f(t,b,c,d){h-c*(t/=d)*(t-2)+b},7M:f(t,b,c,d){j((t/=d/2)<1)h c/2*t*t+b;h-c/2*((--t)*(t-2)-1)+b},7L:f(t,b,c,d){h c*(t/=d)*t*t+b},7K:f(t,b,c,d){h c*((t=t/d-1)*t*t+1)+b},7J:f(t,b,c,d){j((t/=d/2)<1)h c/2*t*t*t+b;h c/2*((t-=2)*t*t+2)+b},7I:f(t,b,c,d){h c*(t/=d)*t*t*t+b},7H:f(t,b,c,d){h-c*((t=t/d-1)*t*t*t-1)+b},7G:f(t,b,c,d){j((t/=d/2)<1)h c/2*t*t*t*t+b;h-c/2*((t-=2)*t*t*t-2)+b},7F:f(t,b,c,d){h c*(t/=d)*t*t*t*t+b},7E:f(t,b,c,d){h c*((t=t/d-1)*t*t*t*t+1)+b},7D:f(t,b,c,d){j((t/=d/2)<1)h c/2*t*t*t*t*t+b;h c/2*((t-=2)*t*t*t*t+2)+b},7C:f(t,b,c,d){h-c*G.4T(t/d*(G.1X/2))+c+b},7B:f(t,b,c,d){h c*G.3n(t/d*(G.1X/2))+b},4U:f(t,b,c,d){h-c/2*(G.4T(G.1X*t/d)-1)+b},7A:f(t,b,c,d){h(t==0)?b:c*G.22(2,10*(t/d-1))+b},7z:f(t,b,c,d){h(t==d)?b+c:c*(-G.22(2,-10*t/d)+1)+b},7y:f(t,b,c,d){j(t==0)h b;j(t==d)h b+c;j((t/=d/2)<1)h c/2*G.22(2,10*(t-1))+b;h c/2*(-G.22(2,-10*--t)+2)+b},7x:f(t,b,c,d){h-c*(G.3m(1-(t/=d)*t)-1)+b},7w:f(t,b,c,d){h c*G.3m(1-(t=t/d-1)*t)+b},7v:f(t,b,c,d){j((t/=d/2)<1)h-c/2*(G.3m(1-t*t)-1)+b;h c/2*(G.3m(1-(t-=2)*t)+1)+b},7u:f(t,b,c,d,a,p){j(t==0)h b;j((t/=d)==1)h b+c;j(!p)p=d*.3;j(!a)a=1;j(a<G.4S(c)){a=c;k s=p/4}Q k s=p/(2*G.1X)*G.4R(c/a);h-(a*G.22(2,10*(t-=1))*G.3n((t*d-s)*(2*G.1X)/p))+b},7t:f(t,b,c,d,a,p){j(t==0)h b;j((t/=d)==1)h b+c;j(!p)p=d*.3;j(!a)a=1;j(a<G.4S(c)){a=c;k s=p/4}Q k s=p/(2*G.1X)*G.4R(c/a);h a*G.22(2,-10*t)*G.3n((t*d-s)*(2*G.1X)/p)+c+b},7s:f(t,b,c,d,a,p){j(t==0)h b;j((t/=d/2)==2)h b+c;j(!p)p=d*(.3*1.5);j(!a)a=1;j(a<G.4S(c)){a=c;k s=p/4}Q k s=p/(2*G.1X)*G.4R(c/a);j(t<1)h-.5*(a*G.22(2,10*(t-=1))*G.3n((t*d-s)*(2*G.1X)/p))+b;h a*G.22(2,-10*(t-=1))*G.3n((t*d-s)*(2*G.1X)/p)*.5+c+b},7r:f(t,b,c,d,s){j(!s)s=1.4Q;h c*(t/=d)*t*((s+1)*t-s)+b},7q:f(t,b,c,d,s){j(!s)s=1.4Q;h c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},7p:f(t,b,c,d,s){j(!s)s=1.4Q;j((t/=d/2)<1)h c/2*(t*t*(((s*=(1.5E))+1)*t-s))+b;h c/2*((t-=2)*t*(((s*=(1.5E))+1)*t+s)+2)+b},5D:f(t,b,c,d){h c-X.2Q.4P(d-t,0,c,d)+b},4P:f(t,b,c,d){j((t/=d)<(1/2.75)){h c*(7.3R*t*t)+b}Q j(t<(2/2.75)){h c*(7.3R*(t-=(1.5/2.75))*t+.75)+b}Q j(t<(2.5/2.75)){h c*(7.3R*(t-=(2.25/2.75))*t+.7o)+b}Q{h c*(7.3R*(t-=(2.7n/2.75))*t+.7m)+b}},7l:f(t,b,c,d){j(t<d/2)h X.2Q.5D(t*2,0,c,d)*.5+b;h X.2Q.4P(t*2-d,0,c,d)*.5+c*.5+b}};k 2L={};2L.1C=M 11({2j:f(){h{3k:T,1J:\'4I\',2K:11.1G,2g:11.1G,5B:11.1G,4A:11.1G,1j:T,2u:{x:\'2i\',y:\'2w\'},3N:6}},1e:f(l,m){9.2N(9.2j(),m);9.r=$(l);9.3k=$(9.m.3k)||9.r;9.2l={\'P\':{},\'1D\':{}};9.K={\'1m\':{},\'P\':{}};9.1I={\'1m\':9.1m.2y(9)};9.3k.1a(\'4H\',9.1I.1m);j(9.m.1e)9.m.1e.1i(9)},1m:f(o){9.2l.1m=o.1y;k 1j=9.m.1j;9.1j={\'x\':[],\'y\':[]};I(k z W 9.m.2u){9.K.P[z]=9.r.1W(9.m.2u[z]).2C();9.2l.1D[z]=o.1y[z]-9.K.P[z];j(1j&&1j[z]){I(k i=0;i<2;i++){j($2B(1j[z][i]))9.1j[z][i]=1j[z][i].2m?1j[z][i].1i(9):1j[z][i]}}}9.1I.29=9.29.2y(9);9.1I.3l=9.3l.2y(9);9.1I.1s=9.1s.J(9);L.1a(\'2P\',9.m.3N?9.1I.3l:9.1I.29);L.1a(\'5A\',9.1I.1s);9.1x(\'2K\',9.r);o.1s()},3l:f(o){k 5C=G.3e(G.3m(G.22(o.1y.x-9.2l.1m.x,2)+G.22(o.1y.y-9.2l.1m.y,2)));j(5C>9.m.3N){L.1E(\'2P\',9.1I.3l);L.1a(\'2P\',9.1I.29);9.29(o);9.1x(\'5B\',9.r)}o.1s()},29:f(o){9.4O=T;9.2l.P=o.1y;I(k z W 9.m.2u){9.K.P[z]=o.1y[z]-9.2l.1D[z];j(9.1j[z]){j($2B(9.1j[z][1])&&(9.K.P[z]>9.1j[z][1])){9.K.P[z]=9.1j[z][1];9.4O=1g}Q j($2B(9.1j[z][0])&&(9.K.P[z]<9.1j[z][0])){9.K.P[z]=9.1j[z][0];9.4O=1g}}9.r.1F(9.m.2u[z],9.K.P[z]+9.m.1J)}9.1x(\'4A\',9.r);o.1s()},7k:f(){9.3k.1E(\'4H\',9.1I.1m)},1s:f(){L.1E(\'2P\',9.1I.29);L.1E(\'5A\',9.1I.1s);9.1x(\'2g\',9.r)}});2L.1C.1T(M 3c);2L.1C.1T(M 3b);1b.N({7j:f(m){h M 2L.1C(9,1H.N(m||{},{2u:{x:\'3j\',y:\'3i\'}}))}});k 4J=M 11({2j:f(){h{3h:20,4K:1,3K:f(x,y){9.r.2a(x,y)}}},1e:f(r,m){9.2N(9.2j(),m);9.r=$(r);9.4M=([12,L].15(r))?$(L.4N):9.r},1m:f(){9.4L=9.5z.2y(9);9.4M.1a(\'2P\',9.4L)},1s:f(){9.4M.1E(\'2P\',9.4L);9.1f=$3Q(9.1f)},5z:f(o){9.1y=(9.r==12)?o.5y:o.1y;j(!9.1f)9.1f=9.1V.2k(50,9)},1V:f(){k l=9.r.3P();k 1D=9.r.2O();k 2z={\'x\':0,\'y\':0};I(k z W 9.1y){j(9.1y[z]<(9.m.3h+1D[z])&&l.1V[z]!=0)2z[z]=(9.1y[z]-9.m.3h-1D[z])*9.m.4K;Q j(9.1y[z]+9.m.3h>(l.2A[z]+1D[z])&&l.1V[z]+l.2A[z]!=l.3O[z])2z[z]=(9.1y[z]-l.2A[z]+9.m.3h-1D[z])*9.m.4K}j(2z.y||2z.x)9.1x(\'3K\',[l.1V.x+2z.x,l.1V.y+2z.y])}});4J.1T(M 3c);4J.1T(M 3b);k 4t=M 11({2j:f(){h{3K:11.1G,2g:11.1G,4x:f(1D){9.21.1F(9.p,1D+\'4I\')},3d:3g,1k:\'4G\',3f:T}},1e:f(l,21,m){9.r=$(l);9.21=$(21);9.2N(9.2j(),m);9.4w=-1;9.4v=-1;9.19=-1;9.r.1a(\'4H\',9.5w.2y(9));j(9.m.3f)9.r.1a(\'2M\',9.5x.2y(9));j(9.m.1k==\'4G\'){9.z=\'x\';9.p=\'2i\';9.1B=9.r.2x-9.21.2x;9.4y=9.21.2x/2;9.4z=9.r.4F.J(9.r)}Q j(9.m.1k==\'4E\'){9.z=\'y\';9.p=\'2w\';9.1B=9.r.2v-9.21.2v;9.4y=9.21.2v/2;9.4z=9.r.4D.J(9.r)}9.21.1F(\'1Z\',\'7i\').1F(9.p,0);k 4B={},4C={};4C[9.z]=[0,9.1B];4B[9.z]=9.p;9.29=M 2L.1C(9.21,{1j:4C,3N:0,2u:4B,2K:f(){9.3M()}.J(9),4A:f(){9.3M()}.J(9),2g:f(){9.3M();9.2h()}.J(9)});j(9.m.1e)9.m.1e.1i(9)},1U:f(19){j(19>9.m.3d)19=9.m.3d;Q j(19<0)19=0;9.19=19;9.3L();9.2h();9.1x(\'4x\',9.5v(9.19)+\'\');h 9},5x:f(o){j(o.3f<0)9.1U(9.19+1);Q j(o.3f>0)9.1U(9.19-1);o.1s()},5w:f(o){k 1Z=o.1y[9.z]-9.4z()-9.4y;j(1Z>9.1B)1Z=9.1B;Q j(1Z<0)1Z=0;9.19=9.4u(1Z);9.3L();9.2h();9.1x(\'4x\',1Z+\'\')},3M:f(){9.19=9.4u(9.29.K.P[9.z]);9.3L()},3L:f(){j(9.4w!=9.19){9.4w=9.19;9.1x(\'3K\',9.19)}},2h:f(){j(9.4v!==9.19){9.4v=9.19;9.1x(\'2g\',9.19+\'\')}},4u:f(1Z){h G.3e(1Z/9.1B*9.m.3d)},5v:f(19){h(9.1B)*19/9.m.3d}});4t.1T(M 3c);4t.1T(M 3b);',62,619,'|||||||||this||||||function||return||if|var|el|options|property|event||type|element|||obj|||||||to||||from|Math||for|bind|value|document|new|extend|fn|now|else|args||false|prototype|events|in|Fx|arguments|||Class|window||length|test||css|push|step|addEvent|Element|case|className|initialize|timer|true|style|call|limit|mode|rgb|start|parsed|each|found|param|Array|stop|parent|keys|selector|elements|fireEvent|page|values|color|max|Base|pos|removeEvent|setStyle|empty|Object|bound|unit|null|source|parse|Elements|key|break|filters|array|properties|implement|set|scroll|getStyle|PI|opacity|position||knob|pow|CSS|name||parentNode||match|drag|scrollTo|iCss|switch|delay|create|current|onComplete|end|left|getOptions|periodical|mouse|apply|margin|increase|iTo|Color|documentElement|previous|returns|modifiers|offsetHeight|top|offsetWidth|bindWithEvent|change|size|chk|toInt|compute|setNow|getValue|getElementsBySelector|chains|HTMLElement|hex|onStart|Drag|mousewheel|setOptions|getOffsets|mousemove|Transitions|wrapper|offset|wait|select|getNow|fx|fromTo|time|id|att|Garbage||text|while|replace|newArray||||item|Options|Events|steps|round|wheel|100|area|height|width|handle|checkAndDrag|sqrt|sin|min|iNow|iFrom|join|hexToRgb|parseFloat|domready|domReady|ie|alpha|colors|undefined|hasClass|getElements|getTag|filter|option|Event|toLowerCase|target|rgbToHex|items|onChange|checkStep|draggedKnob|snap|scrollSize|getSize|clear|5625|hidden|Multi|scrollLeft|scrollTop|khtml|readyState|loaded|remove||tagName|getElement|sel|getElementById|clean||splice|preventDefault|stopPropagation|relatedTarget|offsetTop|offsetLeft|setProperty|attribute|whitespace|indexOf|currentStyle|visibility|string|appendChild|inject|instanceof|ms|attempt|bit|forEach|pr0t0typ3|klass|Slider|toStep|previousEnd|previousChange|onTick|half|getPos|onDrag|modSlide|limSlide|getTop|vertical|getLeft|horizontal|mousedown|px|Scroller|velocity|coord|mousemover|body|out|bounceOut|70158|asin|abs|cos|sineInOut|layout|iProps|map|split|duration||opera|script|ie6|copy|operator|getElementsByTagName|els|on|Function|right|pageY|pageX|code|String|DOMMouseScroll|trash|removeEvents|offs|getBrother|getNext|what|gecko|camelCase|object|Native|result|typeof|parseInt|charAt|results|toPosition|clickedElement|scrolledElement|client|getCoords|mouseup|onSnap|distance|bounceIn|525|linear|slideOut|slideIn|hide|adopt|injectAfter|toElement|full|number|iParsed|Styles|Style|Single|Chain|onCancel|fps|getTime|Date|cTime|transition|callChain|getScrollHeight|getScrollWidth|getHeight|getWidth|getScrollTop|getScrollLeft|pageXOffset|pageYOffset|scrollWidth|scrollHeight|clientHeight|clientWidth|init|complete|ie_ready|catch|try|invert|mix|Hash|getAttribute|filterByAttribute|filterByTagName|filterByClassName|filterById|w_|defaults|which|clientY|clientX|special|120|wheelDelta|nodeType|unload|collect|selectedIndex|bottom|class|html|setAttribute|default|replaceWith|createElement|setStyles|childNodes|Sibling|evType|removeEventListener|addEventListener|hyphenate|defaultView|visible|setOpacity|cssText|addClass|removeClass|contents|inside|after|before|insertBefore|where|_elements_extended_|_element_extended_|err|toFloat||Number|trim|toUpperCase|params|regex|iterable|some|every|random|picked|parentize|noinit|relative|makeResizable|detach|bounceInOut|984375|625|9375|backInOut|backOut|backIn|elasticInOut|elasticOut|elasticIn|circInOut|circOut|circIn|expoInOut|expoOut|expoIn|sineOut|sineIn|quintInOut|quintOut|quintIn|quartInOut|quartOut|quartIn|cubicInOut|cubicOut|cubicIn|quadInOut|quadOut|quadIn|toggle|show|overflow|div|Slide|toRight|toLeft|toBottom|toTop|Scroll|effects|effect|clearTimer|custom|1000|500|innerHeight|innerWidth|onDomReady|DOMContentLoaded|load|onreadystatechange|void|javascript|src|defer|write|BackgroundImageCache|execCommand|disableImageCache|255|pop|get|tag|getElementsByClassName|ES|clearChain|chain|delete|backspace|space|esc|down|up|enter|returnValue|cancelBubble|mouseout|fromElement|mouseover|button|rightClick|click|fromCharCode|keyCode|detail|metaKey|meta|altKey|alt|ctrlKey|control|shiftKey|shift|srcElement|Window|textarea|password|radio|checkbox|checked|input|getPosition|offsetParent|do|getProperty|innerHTML|setHTML|setProperties|attributes|getChildren|getParent|previousSibling|lastChild|getLast|nextSibling|firstChild|getFirst|next|getPrevious|detachEvent|addEvents|attachEvent|getPropertyValue|getComputedStyle|padding|zoom|hasLayout|toggleClass|createTextNode|styleSheet|appendText|replaceChild|cloneNode|clone|removeChild|injectInside|injectBefore|embed|bindAsEventListener|pass|finally|setInterval|setTimeout|concat|toString|transparent|capitalize|RegExp|associate|getBoxObjectFor|taintEnabled|navigator|all|ie7|XMLHttpRequest|ActiveXObject|clearInterval|clearTimeout|floor|pick|textnode|nodeValue|nodeName'.split('|'),0,{}))


/* - smoothgallery_jd.gallery.js - */
// http://www.frameworkdemoiselle.gov.br/portal_javascripts/smoothgallery_jd.gallery.js?original=1
var $removeEvents=function(object,type){if(!object.events) return object;if(type){if(!object.events[type]) return object;for(var fn in object.events[type]) object.removeEvent(type,fn);object.events[type]=null} else{for(var evType in object.events) object.removeEvents(evType);object.events=null}
return object};var gallery=new Class({initialize: function(element,options){this.setOptions({showArrows:true,showCarousel:true,showInfopane:true,thumbHeight:75,thumbWidth:100,thumbSpacing:10,embedLinks:true,fadeDuration:700,timed:true,delay:7000,preloader:true,manualData:[],populateData:true,elementSelector:"div.imageElement",titleSelector:"h3",subtitleSelector:"p",linkSelector:"a.open",imageSelector:"img.full",thumbnailSelector:"img.thumbnail",slideInfoZoneOpacity:0.7,carouselMinimizedOpacity:0.4,carouselMinimizedHeight:20,carouselMaximizedOpacity:0.7,destroyAfterPopulate:true,baseClass:'jdGallery',withArrowsClass:'withArrows',textShowCarousel:'Pictures',useThumbGenerator:false,thumbGenerator:'resizer.php'},options);this.fireEvent('onInit');this.currentIter=0;this.lastIter=0;this.maxIter=0;this.galleryElement=element;this.galleryData=this.options.manualData;this.galleryInit=1;this.galleryElements=Array();this.thumbnailElements=Array();this.galleryElement.addClass(this.options.baseClass);if(this.options.populateData)
this.populateData();element.style.display="block";if(this.options.embedLinks){this.currentLink=new Element('a').addClass('open').setProperties({href:'#',title:''}).injectInside(element);if((!this.options.showArrows)&&(!this.options.showCarousel))
this.galleryElement=element=this.currentLink;else
this.currentLink.setStyle('display','none')}
this.constructElements();if((data.length>1)&&(this.options.showArrows)){var leftArrow=new Element('a').addClass('left').addEvent('click',this.prevItem.bind(this)).injectInside(element);var rightArrow=new Element('a').addClass('right').addEvent('click',this.nextItem.bind(this)).injectInside(element);this.galleryElement.addClass(this.options.withArrowsClass)}
this.loadingElement=new Element('div').addClass('loadingElement').injectInside(element);if(this.options.showInfopane) this.initInfoSlideshow();if(this.options.showCarousel) this.initCarousel();this.doSlideShow(1)},populateData: function(){currentArrayPlace=this.galleryData.length;options=this.options;data=this.galleryData;this.galleryElement.getElements(options.elementSelector).each(function(el){elementDict={image:el.getElement(options.imageSelector).getProperty('src'),number:currentArrayPlace};if((options.showInfopane)|(options.showCarousel))
Object.extend(elementDict,{title:el.getElement(options.titleSelector).innerHTML,description:el.getElement(options.subtitleSelector).innerHTML});if(options.embedLinks)
Object.extend(elementDict,{link:el.getElement(options.linkSelector).href||false,linkTitle:el.getElement(options.linkSelector).title||false});if((!options.useThumbGenerator)&&(options.showCarousel))
Object.extend(elementDict,{thumbnail:el.getElement(options.thumbnailSelector).src});else if(options.useThumbGenerator)
Object.extend(elementDict,{thumbnail:'resizer.php?imgfile='+elementDict.image+'&max_width='+options.thumbWidth+'&max_height='+options.thumbHeight});data[currentArrayPlace]=elementDict;currentArrayPlace++;if(this.options.destroyAfterPopulate)
el.remove()});this.galleryData=data;this.fireEvent('onPopulated')},constructElements: function(){el=this.galleryElement;this.maxIter=this.galleryData.length;var currentImg;for(i=0;i<this.galleryData.length;i++){var currentImg=new Fx.Style(new Element('div').addClass('slideElement').setStyles({'position':'absolute','left':'0px','right':'0px','margin':'0px','padding':'0px','backgroundImage':"url('"+this.galleryData[i].image+"')",'backgroundPosition':"center center",'opacity':'0'}).injectInside(el),'opacity',{duration:this.options.fadeDuration});this.galleryElements[parseInt(i)]=currentImg}},destroySlideShow: function(element){var myClassName=element.className;var newElement=new Element('div').addClass('myClassName');element.parentNode.replaceChild(newElement,element)},startSlideShow: function(){this.fireEvent('onStart');this.loadingElement.style.display="none";this.lastIter=this.maxIter-1;this.currentIter=0;this.galleryInit=0;this.galleryElements[parseInt(this.currentIter)].set(1);if(this.options.showInfopane)
this.showInfoSlideShow.delay(1000,this);this.prepareTimer();if(this.options.embedLinks)
this.makeLink(this.currentIter);this.showCarousel()},nextItem: function(){this.fireEvent('onNextCalled');this.nextIter=this.currentIter+1;if(this.nextIter>=this.maxIter)
this.nextIter=0;this.galleryInit=0;this.goTo(this.nextIter)},prevItem: function(){this.fireEvent('onPreviousCalled');this.nextIter=this.currentIter-1;if(this.nextIter<=-1)
this.nextIter=this.maxIter-1;this.galleryInit=0;this.goTo(this.nextIter)},goTo: function(num){this.clearTimer();if(this.options.embedLinks)
this.clearLink();if(this.options.showInfopane){this.slideInfoZone.clearChain();this.hideInfoSlideShow().chain(this.changeItem.pass(num,this))} else
this.changeItem.delay(500,this,num);if(this.options.embedLinks)
this.makeLink(num);this.prepareTimer()},changeItem: function(num){this.fireEvent('onStartChanging');this.galleryInit=0;if(this.currentIter!=num){for(i=0;i<this.maxIter;i++){if((i!=this.currentIter)) this.galleryElements[i].set(0)}
if(num>this.currentIter) this.galleryElements[num].custom(1);else{this.galleryElements[num].set(1);this.galleryElements[this.currentIter].custom(0)}
this.currentIter=num}
this.doSlideShow.bind(this)();this.fireEvent('onChanged')},clearTimer: function(){if(this.options.timed)
$clear(this.timer)},prepareTimer: function(){if(this.options.timed)
this.timer=this.nextItem.delay(this.options.delay,this)},doSlideShow: function(position){if(this.galleryInit==1){imgPreloader=new Image();imgPreloader.onload=function(){this.startSlideShow.delay(10,this)}.bind(this);imgPreloader.src=this.galleryData[0].image} else{if(this.options.showInfopane){if(this.options.showInfopane){this.showInfoSlideShow.delay((500+this.options.fadeDuration),this)} else
if(this.options.showCarousel)
this.centerCarouselOn(position)}}},initCarousel: function(){var carouselContainerElement=new Element('div').addClass('carouselContainer').injectInside(this.galleryElement);this.carouselContainer=new Fx.Styles(carouselContainerElement,{transition:Fx.Transitions.expoOut});this.carouselContainer.normalHeight=carouselContainerElement.offsetHeight;this.carouselContainer.set({'opacity':this.options.carouselMinimizedOpacity,'top':(this.options.carouselMinimizedHeight-this.carouselContainer.normalHeight)});this.carouselBtn=new Element('a').addClass('carouselBtn').setProperties({title:this.options.textShowCarousel}).setHTML(this.options.textShowCarousel).injectInside(carouselContainerElement);this.carouselBtn.addEvent('click',
function(){this.carouselContainer.clearTimer();this.toggleCarousel()}.bind(this));this.carouselActive=false;var carouselElement=new Element('div').addClass('carousel').injectInside(carouselContainerElement);this.carousel=new Fx.Styles(carouselElement);this.carouselLabel=new Element('p').addClass('label').injectInside(this.carousel.element);this.carouselWrapper=new Element('div').addClass('carouselWrapper').injectInside(this.carousel.element);this.carouselInner=new Element('div').addClass('carouselInner').injectInside(this.carouselWrapper);this.carouselWrapper.scroller=new Scroller(this.carouselWrapper,{area:100,velocity:0.2})
this.carouselWrapper.elementScroller=new Fx.Scroll(this.carouselWrapper,{duration:400,onStart:this.carouselWrapper.scroller.stop.bind(this.carouselWrapper.scroller),onComplete:this.carouselWrapper.scroller.start.bind(this.carouselWrapper.scroller)});this.constructThumbnails();this.carouselInner.style.width=((this.maxIter *(this.options.thumbWidth+this.options.thumbSpacing))-this.options.thumbSpacing+this.options.thumbWidth)+"px"},toggleCarousel: function(){if(this.carouselActive)
this.hideCarousel();else
this.showCarousel()},showCarousel: function(){this.fireEvent('onShowCarousel');this.carouselContainer.custom({'opacity':this.options.carouselMaximizedOpacity,'top':0}).addEvent('onComplete', function(){this.carouselActive=true;this.carouselWrapper.scroller.start()}.bind(this))},hideCarousel: function(){this.fireEvent('onHideCarousel');this.carouselContainer.custom({'opacity':this.options.carouselMinimizedOpacity,'top':(this.options.carouselMinimizedHeight-this.carouselContainer.normalHeight)}).addEvent('onComplete', function(){this.carouselActive=false;this.carouselWrapper.scroller.stop()}.bind(this))},constructThumbnails: function(){element=this.carouselInner;for(i=0;i<this.galleryData.length;i++){var currentImg=new Fx.Style(new Element('div').addClass("thumbnail").setStyles({backgroundImage:"url('"+this.galleryData[i].thumbnail+"')",backgroundPosition:"center center",backgroundRepeat:'no-repeat',marginLeft:this.options.thumbSpacing+"px",width:this.options.thumbWidth+"px",height:this.options.thumbHeight+"px"}).injectInside(element),"opacity",{duration:200}).set(0.2);currentImg.element.addEvents({'mouseover': function(myself){myself.clearTimer();myself.custom(0.99);$(this.carouselLabel).setHTML('<span class="number">'+(myself.relatedImage.number+1)+"/"+this.maxIter+":</span> "+myself.relatedImage.title)}.pass(currentImg,this),'mouseout': function(myself){myself.clearTimer();myself.custom(0.2)}.pass(currentImg,this),'click': function(myself){this.goTo(myself.relatedImage.number)}.pass(currentImg,this)});currentImg.relatedImage=this.galleryData[i];this.thumbnailElements[parseInt(i)]=currentImg}},clearThumbnailsHighlights: function(){for(i=0;i<this.galleryData.length;i++){this.thumbnailElements[i].clearTimer();this.thumbnailElements[i].custom(0.2)}},centerCarouselOn: function(num){var carouselElement=this.thumbnailElements[num];var position=carouselElement.element.offsetLeft+(carouselElement.element.offsetWidth/2);var carouselWidth=this.carouselWrapper.offsetWidth;var carouselInnerWidth=this.carouselInner.offsetWidth;var diffWidth=carouselWidth/2;var scrollPos=position-diffWidth;this.carouselWrapper.elementScroller.scrollTo(scrollPos,0)},initInfoSlideshow: function(){this.slideInfoZone=new Fx.Styles(new Element('div').addClass('slideInfoZone').injectInside($(this.galleryElement))).set({'opacity':0});var slideInfoZoneTitle=new Element('h2').injectInside(this.slideInfoZone.element);var slideInfoZoneDescription=new Element('p').injectInside(this.slideInfoZone.element);this.slideInfoZone.normalHeight=this.slideInfoZone.element.offsetHeight;this.slideInfoZone.element.setStyle('opacity',0)},changeInfoSlideShow: function(){this.hideInfoSlideShow.delay(10,this);this.showInfoSlideShow.delay(500,this)},showInfoSlideShow: function(){this.fireEvent('onShowInfopane');this.slideInfoZone.clearTimer();element=this.slideInfoZone.element;element.getElement('h2').setHTML(this.galleryData[this.currentIter].title);element.getElement('p').setHTML(this.galleryData[this.currentIter].description);this.slideInfoZone.custom({'opacity':[0,this.options.slideInfoZoneOpacity],'height':[0,this.slideInfoZone.normalHeight]});if(this.options.showCarousel)
this.slideInfoZone.chain(this.centerCarouselOn.pass(this.currentIter,this));return this.slideInfoZone},hideInfoSlideShow: function(){this.fireEvent('onHideInfopane');this.slideInfoZone.clearTimer();this.slideInfoZone.custom({'opacity':0,'height':0});return this.slideInfoZone},makeLink: function(num){this.currentLink.setProperties({href:this.galleryData[num].link,title:this.galleryData[num].linkTitle})
if(!((this.options.embedLinks)&&(!this.options.showArrows)&&(!this.options.showCarousel)))
this.currentLink.setStyle('display','block')},clearLink: function(){this.currentLink.setProperties({href:'',title:''});if(!((this.options.embedLinks)&&(!this.options.showArrows)&&(!this.options.showCarousel)))
this.currentLink.setStyle('display','none')}});gallery.implement(new Events);gallery.implement(new Options);

