define("richfacesjs.available",["prototypejs","a4j.ajax","richfacesjs","log"],function(o,k,m,n){var l=o.$,i=o.Event,j=k.AJAX,p=n.LOG;
Object.extend(m.Richfaces,function(){var g=0;var t={};var d=false;var a=null;var e=function(s,q){if(q instanceof Array){for(var r=0;
r<q.length;r++){q[r](s)}}else{q(s)}};var c=function(){if(d){i.stopObserving(document,"mouseover",v,true);
i.stopObserving(document,"focus",v,true);i.stopObserving(document,"focusin",v,true);
d=false;a=null}};var v=function(s){var z=i.element(s);while(z){var q=z.id;if(q){if(!a){a=q
}else{if(a==q){break}}var y=t[q];if(y){try{e(z,y)}catch(r){u();throw r}delete t[q];
if(--g==0){c();break}}}z=z.parentNode}};var h=function(){if(!d){i.observe(document,"mousemove",v,true);
i.observe(document,"focus",v,true);i.observe(document,"focusin",v,true);d=true}};
var u=function(){try{c();g=0;t={}}catch(q){p.error("Error occured during cleanup: "+q)
}};var b=function(){try{for(var q in t){var r=l(q);if(r){e(r,t[q])}else{p.error("Element with id = "+q+" hasn't been found!")
}}}finally{u()}};var f=function(r,q){var s=l(r);if(s){q(s)}else{var z=t[r];if(!z){t[r]=q;
a=null;g++;h()}else{if(z instanceof Array){z.push(q)}else{var y=new Array();y.push(z);
y.push(q);t[r]=y}}}};j.AddListener(b);document.observe("dom:loaded",b);return{onAvailable:f}
}());return{onAvailable:m.Richfaces.onAvailable,Richfaces:m.Richfaces}});define("richfacesjs.tooltip",["globals","prototypejs","richfacesjs","richfacesjs.utils","a4j.ajax"],function(v,p,x,o,q){var t=v.g,u=x.Richfaces,w=p.$,n=p.Event,y=p.Element,z=p.Class,s=q.AJAX;
var r=u.ToolTip=z.create();r.prototype={showEvent:null,hideEvent:null,delay:0,hideDelay:0,ajaxFunction:null,onhide:null,onshow:null,disabled:false,direction:"bottom-right",followMouse:false,horizontalOffset:10,verticalOffset:10,initialize:function(a,b,c){this["rich:destructor"]="destroy";
this.id=a;this.parentId=b;this.parent=w(this.parentId);Object.extend(this,c);this.clientAjaxParams={};
this.toolTip=w(a);this.toolTip.component=this;this.toolTipContent=w(a+"content");
this.toolTipDefaultContent=w(a+"defaultContent");if(this.toolTip.style){this.toolTip.style.visibility="hidden";
this.toolTip.style.display="block";this.toolTipOffsetW=this.toolTip.offsetWidth;this.toolTipOffsetH=this.toolTip.offsetHeight;
this.toolTipW=this.toolTip.getWidth();this.toolTipH=this.toolTip.getHeight();this.toolTipBorderHeight=(this.toolTipOffsetH-this.toolTipH)/2;
this.toolTipBorderWidth=(this.toolTipOffsetW-this.toolTipW)/2;this.toolTip.style.visibility="visible";
this.toolTip.style.display="none";this.parentAttached=false;this.hintParentElement=null;
this.isMouseOvered=false;this.attachOnLoadEventsListner=this.attachOnLoadEvents.bindAsEventListener(this);
this.setToolTipPositionListner=this.setToolTipPosition.bindAsEventListener(this);
this.leaveToolTipListner=this.leaveToolTip.bindAsEventListener(this);if(!this.disabled){n.observe(document,"mousemove",this.attachOnLoadEventsListner,true)
}}},destroy:function(){if(!this.parentAttached&&!this.disabled){n.stopObserving(document,"mousemove",this.attachOnLoadEventsListner,true)
}if(this.toolTip){this.toolTip.component=null}this.doDisable();this.hintParentElement=null;
this.parent=null;this.toolTip=null;this.toolTipContent=null;this.toolTipDefaultContent=null;
this.iframe=null;this.eventCopy=null;this.showEvent=null;this.hideEvent=null},attachOnLoadEvents:function(){if(!this.parentAttached){if(!this.parent){this.parent=w(this.parentId)
}if(this.parent!=null&&!this.disabled){this.attachParentEvents();this.parentAttached=true
}n.stopObserving(document,"mousemove",this.attachOnLoadEventsListner,true)}},attachParentEvents:function(){if(this.followMouse){n.observe(this.parent,"mousemove",this.setToolTipPositionListner,false)
}this.doShowListner=this.doShow.bindAsEventListener(this);this.doHideListner=this.doHide.bindAsEventListener(this);
n.observe(this.parent,this.showEvent,this.doShowListner,false);if(this.showEvent!="focus"){if(this.hideEvent!=null){n.observe(this.parent,this.hideEvent,this.doHideListner,false);
n.observe(this.toolTip,this.hideEvent,this.leaveToolTipListner,false)}else{n.observe(this.parent,"mouseout",this.doHideListner,false);
n.observe(this.toolTip,"mouseout",this.leaveToolTipListner,false)}}else{if(this.hideEvent!=null){n.observe(this.parent,this.hideEvent,this.doHideListner,false)
}else{n.observe(this.parent,"blur",this.doHideListner,false)}}},detectAncestorNode:function(c,b){var a=c;
while(a!=null&&a!=b){a=a.parentNode}return a!=null},ffcheck:function(c){var d=this.parent.tagName.toLowerCase();
if((d=="input"||d=="textarea")&&c){var b;try{b=c.className;if(b=="anonymous-div"){return true
}}catch(a){return true}if(c==this.parent){return true}}else{while(c){if(c==this.parent){return true
}c=c.parentNode}}return false},leaveToolTip:function(a){var c=false;var d=a.relatedTarget||a.toElement;
var b;if(d){try{b=d.className;c=this.detectAncestorNode(d,this.hintParentElement)
}catch(a){}}if(!c){this.doHide(a);this.isMouseOvered=false}},doShow:function(a,c){if(this.disabled){return
}else{if(this.activationTimerHandle){return}}var b;if(!a){a=t.event}var f=a.relatedTarget||a.fromElement;
if(this.ffcheck(f)){return}var e;if(f){try{e=f.className;if(this.detectAncestorNode(f,this.toolTip)){return
}}catch(a){}}this.isMouseOvered=true;if(a.target){this.hintParentElement=a.target
}if(a.srcElement){this.hintParentElement=a.srcElement}if(this.hidingTimerHandle){t.clearTimeout(this.hidingTimerHandle);
this.hidingTimerHandle=undefined}if(this.ajaxFunction){if(this.toolTipDefaultContent){this.toolTipContent.innerHTML=this.toolTipDefaultContent.innerHTML;
this.toolTip.style.visibility="hidden";this.toolTip.style.display="block";if(this.toolTip.removeClassName){this.toolTip.removeClassName("show")
}this.setToolTipPosition(a)}var d=s.CloneObject(a,false);if(a.clientX){this.clientAjaxParams.clientX=a.clientX;
this.clientAjaxParams.clientY=a.clientY}else{this.clientAjaxParams["event.pageX"]=a.pageX;
this.clientAjaxParams["event.pageY"]=a.pageY}if(this.delay>0){this.setToolTipPosition(a);
this.activationTimerHandle=t.setTimeout(function(){if(this.toolTipDefaultContent){this.setToolTipVisible()
}this.ajaxFunction(d,c)}.bind(this),this.delay)}else{if(this.toolTipDefaultContent){this.setToolTipVisible()
}this.ajaxFunction(d,c)}}else{this.setToolTipPosition(a);if(this.delay>0){this.activationTimerHandle=t.setTimeout(function(){this.displayDiv()
}.bind(this),this.delay)}else{this.displayDiv()}}},hideDiv:function(a){this.isMouseOvered=false;
var b=this.toolTip;b.style.visibility="hidden";t.setTimeout(function(){b.style.display="none"
},1);if(this.toolTip.removeClassName){this.toolTip.removeClassName("show")}if(this.iframe){this.iframe.style.display="none"
}this.hintParentElement=null;this.isMouseOvered=false;if(this.onhide!=null){this.onhide(a)
}},doHide:function(a){if(this.hidingTimerHandle){return}this.eventCopy=null;if(!a){a=t.event
}var d=null;if(a.type=="mouseout"||a.type=="mouseover"){d=a.relatedTarget||a.toElement
}if(this.ffcheck(d)){return}var c;if(d){try{c=d.className;if(this.detectAncestorNode(d,this.toolTip)){return
}}catch(a){}}if(this.activationTimerHandle){t.clearTimeout(this.activationTimerHandle);
this.activationTimerHandle=undefined}if(this.hideDelay>0){var b=s.CloneObject(a,false);
this.hidingTimerHandle=t.setTimeout(function(){this.hideDiv(b);if(this.hidingTimerHandle){t.clearTimeout(this.hidingTimerHandle);
this.hidingTimerHandle=undefined}}.bindAsEventListener(this),this.hideDelay)}else{this.hideDiv()
}},doEnable:function(){if(!this.parentAttached){n.observe(document,"mousemove",this.attachOnLoadEventsListner,true)
}this.disabled=false},doDisable:function(){if(!this.parentAttached){if(!this.disabled){n.stopObserving(document,"mousemove",this.attachOnLoadEventsListner,true)
}}else{if(this.followMouse){n.stopObserving(this.parent,"mousemove",this.setToolTipPositionListner,false)
}n.stopObserving(this.parent,this.event,this.doShowListner,false);if(this.showEvent!="focus"){if(this.hideEvent!=null){n.stopObserving(this.parent,this.hideEvent,this.doHideListner,false);
n.stopObserving(this.toolTip,this.hideEvent,this.leaveToolTipListner,false)}else{n.stopObserving(this.parent,"mouseout",this.doHideListner,false);
n.stopObserving(this.toolTip,"mouseout",this.leaveToolTipListner,false)}}else{if(this.hideEvent!=null){n.stopObserving(this.parent,this.hideEvent,this.doHideListner,false)
}else{n.stopObserving(this.parent,"blur",this.doHideListner,false)}}this.parentAttached=false
}this.disabled=true},show:function(b,a){this.doShow(b,a)},hide:function(a){this.doHide(a)
},enable:function(a){this.doEnable(a)},disable:function(a){this.doDisable(a)},PX_REGEX:/px$/,parseToPx:function(b){if(b){var c=b.strip();
if(this.PX_REGEX.test(c)){try{return parseInt(c.replace(this.PX_REGEX,""),10)}catch(a){}}}return NaN
},setToolTipPosition:function(c){var N=o.Position.getOffsetDimensions(this.toolTip);
var b=this.toolTip.style;var L=b.display;var O=b.visibility;b.visibility="hidden";
b.display="block";var k=this.parseToPx(b.left);if(isNaN(k)){k=0;b.left="0px"}var P=this.parseToPx(b.top);
if(isNaN(P)){P=0;b.top="0px"}var h=jQuery.event.fix(c);var l=this.toolTip.offsetWidth;
var J=this.toolTip.offsetHeight;var d=/^(top|bottom)-(left|right)$/;var f=this.direction.match(d);
var j=f[2];var i=f[1];var m=isNaN(c.clientX)?y.cumulativeOffset(this.parent).left+this.horizontalOffset:c.clientX;
var K=isNaN(c.clientY)?y.cumulativeOffset(this.parent).top+this.verticalOffset:c.clientY;
var e=this.fitToolTip(m,K,N,j,i,{x:this.horizontalOffset,y:this.verticalOffset});
var g=jQuery(this.toolTip).offset();var M;var a;if(isNaN(h.clientX)){M=e.x-g.left+k+this.horizontalOffset;
a=e.y-g.top+P+this.verticalOffset}else{M=e.x-g.left+(h.pageX-h.clientX)+k;a=e.y-g.top+(h.pageY-h.clientY)+P
}y.setStyle(this.toolTip,{left:M+"px",top:a+"px"});if(this.iframe){this.iframe.style.top=(a-this.toolTipBorderHeight)+"px";
this.iframe.style.left=(M-this.toolTipBorderWidth)+"px";this.iframe.style.width=l+"px";
this.iframe.style.height=J+"px"}b.visibility=O;b.display=L;b.position="absolute";
this.eventCopy=s.CloneObject(c,false)},prePosition:function(f,a,d,b,g,c){var e,h;
e=b=="left"?f-d.width-c.x:f+c.x;h=g=="top"?a-d.height-c.y:a+c.y;return{x:e,y:h}},fitToolTip:function(e,g,d,c,j,E){var a=o.Position.getWindowDimensions();
var l=e-E.x-d.width;var k=a.width-(e+E.x+d.width);var F=g-E.y-d.height;var h=a.height-(g+E.y+d.height);
if(l<0){var m=a.width-(e+E.x+d.width);if(m>0){c="right"}else{if(m>l){c="right"}}}else{if(k<0){var D=e-E.x-d.width;
if(D>0){c="left"}else{if(D>k){c="left"}}}}if(F<0){var i=a.height-(g+E.y+d.height);
if(i>0){j="bottom"}else{if(i>F){j="bottom"}}}else{if(h<0){var b=g-E.y-d.height;if(b>0){j="top"
}else{if(b>h){j="top"}}}}var f=this.prePosition(e,g,d,c,j,E);return f},displayDiv:function(){if(this.isMouseOvered){if(this.ajaxFunction){this.toolTip.style.display="none";
if(this.clientAjaxParams){var b;if(this.clientAjaxParams.clientX){b="clientX"}else{b="pageX"
}var c;if(this.clientAjaxParams.clientY){c="clientY"}else{c="pageY"}var a={};a[b]=this.clientAjaxParams[b];
a[c]=this.clientAjaxParams[c];this.toolTip.style.visibility="hidden";this.toolTip.style.display="block";
this.setToolTipPosition((this.eventCopy?this.eventCopy:a))}}if(this.onshow!=null){this.onshow(this.eventCopy)
}this.setToolTipVisible()}},setToolTipVisible:function(){this.activationTimerHandle=undefined;
this.toolTip.style.display="block";this.toolTip.style.visibility="visible";if(this.toolTip.addClassName){this.toolTip.addClassName("show")
}if(this.iframe){this.iframe.style.display="block"}}};return{ToolTip:r}});define("richfacesjs.utils",["globals","prototypejs","richfacesjs","eval.with","log"],function(w,q,z,r,y){var s=w.g,v=z.Richfaces,x=q.$,o=q.Event,t=q.Object,u=r.evalWith,n=y.LOG;
var p={mergeStyles:function(b,a){var c;for(c in b){if(typeof b[c]=="object"){this.mergeStyles(b[c],a[c])
}else{if(a[c]){a[c]+=" "+b[c]}else{a[c]=b[c]}}}return a},getComputedStyle:function(a,d){var c=x(a);
if(c.nodeType!=Node.ELEMENT_NODE){return""}else{if(c.currentStyle){return c.currentStyle[d]
}else{if(s.document.defaultView&&s.document.defaultView.getComputedStyle){var b=s.document.defaultView.getComputedStyle(c,null);
if(b){return b.getPropertyValue(d)}}}}return""},getComputedStyleSize:function(b,c){var a=p.getComputedStyle(b,c);
if(a){a=a.strip();a=a.replace(/px$/,"");return parseFloat(a)}return 0},getWindowSize:function(){var a=0,b=0;
if(typeof(s.innerWidth)=="number"){a=s.innerWidth;b=s.innerHeight}else{if(s.document.documentElement&&(s.document.documentElement.clientWidth||s.document.documentElement.clientHeight)){a=s.document.documentElement.clientWidth;
b=s.document.documentElement.clientHeight}else{if(s.document.body&&(s.document.body.clientWidth||s.document.body.clientHeight)){a=s.document.body.clientWidth;
b=s.document.body.clientHeight}}}return{width:a,height:b}},removePX:function(a){var b=a.indexOf("px");
if(b==-1){return a}return a.substr(0,b)},visitTree:function(d,a){var c=d;if(!c){c=s.document
}a.call(this,c);var b=c.firstChild;while(b){p.visitTree(b,a);b=b.nextSibling}},getNSAttribute:function(c,a){if(a.getAttributeNS){var e=a.getAttributeNS("http://richfaces.ajax4jsf.org/rich",c);
if(e){return e}}var d=a.attributes;var b="rich:"+c;var e=d[b];if(e){return e.nodeValue
}return null},VARIABLE_NAME_PATTERN:/^\s*[_,A-Z,a-z][\w,_\.]*\s*$/,getObjectValue:function(b,d){var e=b.split(".");
var c=d[e[0]];var a=1;while(c&&a<e.length){c=c[e[a++]]}return(c?c:"")},evalMacro:function(b,d){var c="";
if(p.VARIABLE_NAME_PATTERN.test(b)){if(b.indexOf(".")==-1){c=d[b];if(!c){c=s[b]}}else{c=p.getObjectValue(b,d);
if(!c){c=p.getObjectValue(b,s)}}if(c&&typeof c=="function"){c=c(d)}if(!c){c=""}}else{try{value=u(b,d);
if(typeof c=="function"){c=c(d)}}catch(a){n.warn("Exception: "+a.Message+"\n["+b+"]")
}}return c},evalSimpleMacro:function(b,c){var a=c[b];if(!a){a=s[b];if(!a){a=""}}return a
},getComponent:function(d,c){var a="richfacesComponent";var b="richfaces:"+d;while(c.parentNode){if(c[a]&&c[a]==b){return c.component
}else{c=c.parentNode}}},evaluateTemplate:function(c,d){var b="";try{b=u(c,d)}catch(a){n.warn("Exception: "+a.message+"\n["+c+"]")
}return b},interpolate:function(e,b){for(var c in b){var d=b[c];var a=new RegExp("\\{"+c+"\\}","g");
e=e.replace(a,d)}return e},Position:{setElementPosition:function(d,h,F,k,f){var b=p.Position.getOffsetDimensions(d);
var j=p.Position.getOffsetDimensions(h);var H=p.Position.getWindowViewport();var e=p.Position.cumulativeOffset(h);
var g=e[0];var i=e[1];var c=/^(top|bottom)-(left|right)$/;var a;if(typeof F=="object"){g=F.x;
i=F.y}else{if(F&&(a=F.toLowerCase().match(c))!=null){if(a[2]=="right"){g+=j.width
}if(a[1]=="bottom"){i+=j.height}}}if(k&&(a=k.toLowerCase().match(c))!=null){var G=k.toLowerCase().split("-");
if(a[2]=="left"){g-=b.width+f.x}else{g+=f.x}if(a[1]=="top"){i-=b.height+f.y}else{i+=f.y
}}else{var l={square:0};var m={right:e[0]+j.width,top:e[1]+j.height};m.left=m.right-b.width;
m.bottom=m.top+b.height;g=m.left;i=m.top;var I=p.Position.checkCollision(m,H);if(I!=0){if(g>=0&&i>=0&&l.square<I){l={x:g,y:i,square:I}
}m={right:e[0]+j.width,bottom:e[1]};m.left=m.right-b.width;m.top=m.bottom-b.height;
g=m.left;i=m.top;I=p.Position.checkCollision(m,H);if(I!=0){if(g>=0&&i>=0&&l.square<I){l={x:g,y:i,square:I}
}m={left:e[0],top:e[1]+j.height};m.right=m.left+b.width;m.bottom=m.top+b.height;g=m.left;
i=m.top;I=p.Position.checkCollision(m,H);if(I!=0){if(g>=0&&i>=0&&l.square<I){l={x:g,y:i,square:I}
}m={left:e[0],bottom:e[1]};m.right=m.left+b.width;m.top=m.bottom-b.height;g=m.left;
i=m.top;I=p.Position.checkCollision(m,H);if(I!=0){if(g<0||i<0||l.square>I){g=l.x;
i=l.y}}}}}}d.style.left=g+"px";d.style.top=i+"px"},getOffsetDimensions:function(f){f=x(f);
var b=x(f).getStyle("display");if(b!="none"&&b!=null){return{width:f.offsetWidth,height:f.offsetHeight}
}var g=f.style;var c=g.visibility;var e=g.position;var h=g.display;g.visibility="hidden";
g.position="absolute";g.display="block";var a=f.offsetWidth;var d=f.offsetHeight;
g.display=h;g.position=e;g.visibility=c;return{width:a,height:d}},checkCollision:function(d,c,a){if(d.left>=c.left&&d.top>=c.top&&d.right<=c.right&&d.bottom<=c.bottom){return 0
}var b={left:(d.left>c.left?d.left:c.left),top:(d.top>c.top?d.top:c.top),right:(d.right<c.right?d.right:c.right),bottom:(d.bottom<c.bottom?d.bottom:c.bottom)};
return(b.right-b.left)*(b.bottom-b.top)},getWindowDimensions:function(){var b=self.innerWidth||s.document.documentElement.clientWidth||s.document.body.clientWidth||0;
var a=self.innerHeight||s.document.documentElement.clientHeight||s.document.body.clientHeight||0;
return{width:b,height:a}},getWindowScrollOffset:function(){var a=s.pageXOffset||s.document.documentElement.scrollLeft||s.document.body.scrollLeft||0;
var b=s.pageYOffset||s.document.documentElement.scrollTop||s.document.body.scrollTop||0;
return{left:a,top:b}},getWindowViewport:function(){var a=p.Position.getWindowDimensions();
var b=p.Position.getWindowScrollOffset();return{left:b.left,top:b.top,right:a.width+b.left,bottom:a.height+b.top}
}},firstDescendant:function(b){var a=b.firstChild;while(a&&a.nodeType!=1){a=a.nextSibling
}return a},lastDescendant:function(b){var a=b.lastChild;while(a&&a.nodeType!=1){a=a.previousSibling
}return a},next:function(b){var a=b;do{a=a.nextSibling}while(a&&a.nodeType!=1);return a
},previous:function(b){var a=b;do{a=a.previousSibling}while(a&&a.nodeType!=1);return a
},removeNode:function(a){if(a){var b=a.parentNode;if(b){b.removeChild(a)}}},readAttribute:function(b,c){var d=null;
var a=b.getAttributeNode(c);if(a){d=a.nodeValue}return d},writeAttribute:function(c,d,a){var b=c.getAttributeNode(d);
if(a!==null){if(b){b.nodeValue=a}else{b=s.document.createAttribute(d);b.nodeValue=a;
c.setAttributeNode(b)}}else{if(b){c.removeAttributeNode(b)}}},mergeObjects:function(){var a=arguments[0];
if(a){for(var c=1;c<arguments.length;c++){var b=arguments[c];if(b){for(var d in b){if(!a[d]){a[d]=b[d]
}}}}}},invokeEvent:function(c,d,e,f){var g;if(c){d=x(d);if(d==s.document&&s.document.createEvent&&!d.dispatchEvent){d=s.document.documentElement
}var b;if(s.document.createEvent){b=s.document.createEvent("HTMLEvents");b.initEvent("dataavailable",true,true)
}else{b=s.document.createEventObject();b.eventType="ondataavailable"}b.eventName=e;
b.rich={component:this};b.memo=f||{};try{g=c.call(d,b)}catch(a){n.warn("Exception: "+a.Message+"\n[on"+e+"]")
}}if(g!=false){g=true}return g},setupScrollEventHandlers:function(c,b){var a=[];c=c.parentNode;
while(c&&c!=s.document.body){if(c.offsetWidth!=c.scrollWidth||c.offsetHeight!=c.scrollHeight){a.push(c);
o.observe(c,"scroll",b,false)}c=c.parentNode}return a},removeScrollEventHandlers:function(a,b){if(a){for(var c=0;
c<a.length;c++){o.stopObserving(a[c],"scroll",b,false)}a=null}}};p.browser={isIE:(!s.opera&&/MSIE/.test(navigator.userAgent)),isIE6:(!s.opera&&/MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent)),isSafari:/Safari/.test(navigator.userAgent),isOpera:!!s.opera,isFF2:(!s.opera&&/Firefox\s*[\/]2[\.]/.test(navigator.userAgent)),isFF3:(!s.opera&&/Firefox\s*[\/]3[\.]/.test(navigator.userAgent))};
t.extend(v,p);return p});define("richfacesjs.suggestion",["globals","log","richfaces","richfacesjs","scriptaculos.effect","prototypejs","a4j.ajax","jquery","richfaces.browser","richfacesjs.available"],function(S,N,Q,I,V,F,H,J){var M=S.g,L=N.LOG,G=Q.RichFaces,O=I.Richfaces,P=F.$,C=F.Class,y=F.Event,E=F.Element,R=F.Insertion,B=H.AJAX;
var U=O.Selection={getStart:function(b){if(b.setSelectionRange){return b.selectionStart
}else{if(document.selection&&document.selection.createRange){var a=document.selection.createRange().duplicate();
a.moveEnd("character",b.value.length);if(a.text==""){return b.value.length}return b.value.lastIndexOf(a.text)
}}},getEnd:function(b){if(b.setSelectionRange){return b.selectionEnd}else{if(document.selection&&document.selection.createRange){var a=document.selection.createRange().duplicate();
a.moveStart("character",-b.value.length);return a.text.length}}},setCaretTo:function(b,a){if(b.setSelectionRange){b.focus();
b.setSelectionRange(a,a)}else{if(b.createTextRange){var c=b.createTextRange();c.collapse(true);
c.moveEnd("character",a);c.moveStart("character",a);c.select()}}}};var z=G.Position={source:null,target:null,smartClone:function(b,a,c){this.options=Object.extend({width:"auto"},c||{});
this.source=P(b);this.target=P(a);this.clonePosition(this.target,this.source,this.source.offsetHeight)
},PX_REGEX:/px$/,parseToPx:function(b){var c=b.strip();if(this.PX_REGEX.test(c)){try{return parseFloat(c.replace(this.PX_REGEX,""))
}catch(a){}}return NaN},clonePosition:function(a,f,c){var j=J(a);var h=J(f);var e=h.offset();
var b=(j.css("display")=="none");var k;if(b){k=j.css("visibility");j.css("visibility","hidden").css("display","")
}var d=this.parseToPx(j.css("left"));if(isNaN(d)){d=0;j.css("left","0px")}var i=this.parseToPx(j.css("top"));
if(isNaN(i)){i=0;j.css("top","0px")}var g=j.offset();if(b){j.css("display","none").css("visibility",k)
}j.css({left:(e.left-g.left+d)+"px",top:(e.top-g.top+i+c)+"px"})},getBody:function(){return this.source.ownerDocument.body
}};var T={};var K=T.Base=function(){};K.prototype={baseInitialize:function(f,b,e){this.isOpera=(G.navigatorType()==G.OPERA?true:false);
this.element=P(f);this.update=P(b);this.hasFocus=false;this.changed=false;this.active=false;
this.index=0;this.prevIndex=-1;this.entryCount=0;this.keyEvent=false;this.oldValue=this.element.value;
this.skipHover=false;this.selectedItems=[];this.selectedItemsCache={};e.selection=b+"_selection";
if(this.setOptions){this.setOptions(e)}else{this.options=e||{}}this.options.param=this.options.param||this.element.name;
this.options.selectedClasses=(this.options.selectedClass||"rich-sb-int-sel").split(" ");
this.options.selectValueClass=this.options.selectValueClass||" ";this.options.tokens=$A(e.tokens)||[];
this.options.frequency=this.options.frequency||0.4;this.options.minChars=isNaN(this.options.minChars)?1:parseInt(this.options.minChars);
this.options.onShow=this.options.onShow||function(h,g,i){if(!g.style.position||g.style.position=="absolute"){g.style.position="absolute";
z.smartClone(h,g,i)}if(!M.opera){V.Appear(g,{duration:0.15})}else{V.Appear(g,{duration:0.15,to:0.999999})
}};this.options.onHide=this.options.onHide||function(h,g,i){new V.Fade(g,{duration:0.15})
};this.options.width=this.options.width||"auto";if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)
}for(var a=0;a<this.options.tokens.length;a++){var d=this.options.tokens[a];if(d.charAt[0]=="'"&&d.charAt[d.length-1]=="'"){this.options.tokens[a]=d.substring(1,-1)
}}this.observerHandle=null;this.element.setAttribute("autocomplete","off");E.hide(this.update);
this.onBlurListener=this.onBlur.bindAsEventListener(this);y.observe(this.element,"blur",this.onBlurListener);
if(G.navigatorType()==G.MSIE){y.observe(this.element,"focusout",function(g){var h=g.toElement;
while(h){if(h==this.update){this.element.keepFocus=true;h=undefined}else{h=h.parentNode
}}}.bindAsEventListener(this))}this.onKeyDownListener=this.onKeyDown.bindAsEventListener(this);
y.observe(this.element,"keydown",this.onKeyDownListener);if(this.isOpera){this.onKeyPressListener=this.onKeyPress.bindAsEventListener(this);
y.observe(this.element,"keypress",this.onKeyPressListener);this.onKeyUpListener=this.onKeyUp.bindAsEventListener(this);
y.observe(this.element,"keyup",this.onKeyUpListener);this.upDown=0}this.onScrollListener=this.onScroll.bindAsEventListener(this);
if(e.popupClass){var c=E.select(this.update,".rich-sb-ext-decor-3");E.addClassName(c[0],e.popupClass)
}this.onNothingLabelClick=this.hideNLabel.bindAsEventListener(this);this.scrollElements=null;
this.eventOnScroll=this.eventOnScroll.bindAsEventListener(this)},cancelSubmit:function(a){y.stop(a)
},disableSubmit:function(){if(this.isOpera){var a=this.element;while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!="FORM"))){a=a.parentNode
}if(a.tagName&&(a.tagName.toUpperCase()=="FORM")){this.parentForm=a;this.onSubmitListener=this.cancelSubmit.bindAsEventListener(this);
y.observe(a,"submit",this.onSubmitListener)}}},enableSubmit:function(){if(this.isOpera&&this.parentForm){y.stopObserving(this.parentForm,"submit",this.onSubmitListener)
}},onKeyPress:function(a){if(this.upDown!=0){if(this.upDownMark){this.upDownMark=false
}else{if(this.upDown==1){this.keyEvent=true;this.markPrevious();this.render()}else{if(this.upDown==2){this.keyEvent=true;
this.markNext();this.render()}else{if(this.upDown==3){this.keyEvent=true;this.markPreviousPage();
this.render()}else{if(this.upDown==4){this.keyEvent=true;this.markNextPage();this.render()
}}}}}}},onKeyUp:function(a){this.upDownMark=false;this.upDown=0},show:function(){if(G.SAFARI==G.navigatorType()){this.wasScroll=false;
this.wasBlur=false;if(!this.overflow){var a=E.select(this.update,".rich-sb-overflow");
this.overflow=a[0]}y.observe(this.overflow,"scroll",this.onScrollListener)}if(E.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update,this.options)
}this.disableSubmit();O.removeScrollEventHandlers(this.scrollElements,this.eventOnScroll);
this.scrollElements=O.setupScrollEventHandlers(P(this.options.selection),this.eventOnScroll)
},hide:function(){O.removeScrollEventHandlers(this.scrollElements,this.eventOnScroll);
if(G.SAFARI==G.navigatorType()){if(this.wasScroll){this.wasScroll=false;return}if(this.overflow){y.stopObserving(this.overflow,"scroll",this.onScrollListener)
}}this.stopIndicator();if(E.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update,this.options)
}this.enableSubmit();this.hasFocus=false;this.active=false},eventOnScroll:function(a){this.hide()
},hideNLabel:function(a){var b=P(this.update.id+"NothingLabel");if(b){E.hide(b);y.stopObserving(b,"click",this.onNothingLabelClick);
y.stopObserving(this.element,"blur",this.onNothingLabelClick);this.hide()}},startIndicator:function(){if(this.options.indicator){E.show(this.options.indicator)
}},stopIndicator:function(){if(this.options.indicator){E.hide(this.options.indicator)
}},isUnloaded:function(){if(this.element.parentNode&&this.update.parentNode){return false
}L.info("Element unloaded from DOM");if(this.element){y.stopObserving(this.element,"blur",this.onBlurListener);
y.stopObserving(this.element,"keydown",this.onKeyDownListener);if(this.onKeyPressListener){y.stopObserving(this.element,"keypress",this.onKeyPressListener);
this.onKeyPressListener=undefined}if(this.onKeyUpListener){y.stopObserving(this.element,"keyup",this.onKeyUpListener);
this.onKeyUpListener=undefined}}return true},onKeyDown:function(d){if(this.isUnloaded()){return
}if(!this.initialized){var h=this.update.cloneNode(true);this.update.parentNode.removeChild(this.update);
this.update=h;this.update.component=this;this["rich:destructor"]="destroy";var g=h.getElementsByTagName("script");
for(var f=0;f<g.length;f++){var a=g[f];if(a.parentNode){a.parentNode.removeChild(a)
}}document.body.insertBefore(this.update,document.body.firstChild);this.initialized=true
}this.wasBlur=false;if(this.active){this.wasScroll=false;var e=(d.rich&&d.rich.isCallSuggestion);
switch(d.keyCode){case y.KEY_TAB:case y.KEY_RETURN:this.selectEntry(d);y.stop(d);
case y.KEY_ESC:this.hide();this.active=false;y.stop(d);if(this.isOpera){this.element.focus()
}return;case y.KEY_LEFT:case y.KEY_RIGHT:return;case y.KEY_UP:this.keyEvent=true;
this.markPrevious();this.render();if(navigator.appVersion.indexOf("AppleWebKit")>0){y.stop(d)
}if(this.isOpera&&!e){this.upDown=1;this.upDownMark=true}return;case y.KEY_DOWN:this.keyEvent=true;
this.markNext();this.render();if(navigator.appVersion.indexOf("AppleWebKit")>0){y.stop(d)
}if(this.isOpera&&!e){this.upDown=2;this.upDownMark=true}return;case 33:this.keyEvent=true;
this.markPreviousPage();this.render();if(navigator.appVersion.indexOf("AppleWebKit")>0){y.stop(d)
}if(this.isOpera&&!e){this.upDown=3;this.upDownMark=true}return;case 34:this.keyEvent=true;
this.markNextPage();this.render();if(navigator.appVersion.indexOf("AppleWebKit")>0){y.stop(d)
}if(this.isOpera&&!e){this.upDown=4;this.upDownMark=true}return}}else{if(d.keyCode==y.KEY_TAB||d.keyCode==y.KEY_RETURN||d.keyCode==y.KEY_ESC){return
}}this.changed=true;this.hasFocus=true;if(this.observerHandle){L.debug("clear existing observer");
M.clearTimeout(this.observerHandle)}L.debug("set timeout for request suggestion");
var c={};try{c.target=d.target;c.srcElement=d.srcElement;c.type=d.type;c.altKey=d.altKey;
c.button=d.button;c.clientX=d.clientX;c.clientY=d.clientY;c.ctrlKey=d.ctrlKey;c.keyCode=d.keyCode;
c.modifiers=d.modifiers;c.pageX=d.pageX;c.pageY=d.pageY;c.screenX=d.screenX;c.screenY=d.screenY;
c.shiftKey=d.shiftKey;c.which=d.which;c.rich=d.rich}catch(b){L.warn("Exception on clone event")
}if((d.rich&&d.rich.ignoreFrequency)){this.onObserverEvent(c)}else{this.observerHandle=M.setTimeout(this.onObserverEvent.bind(this,c),this.options.frequency*1000)
}},_findTr:function(a){var b=y.element(a);while(b&&(!b.tagName||b.tagName.toUpperCase()!="TR")){b=b.parentNode
}return b},onHover:function(a){var b=this._findTr(a);if(!this.skipHover){if(this.index!=b.autocompleteIndex){this.index=b.autocompleteIndex;
this.render()}if(a.type=="mousemove"){y.stopObserving(b,"mousemove",this.onHover)
}}else{this.skipHover=false;y.observe(b,"mousemove",this.onHover.bindAsEventListener(this))
}y.stop(a)},onClick:function(a){if(this.active){this.wasScroll=false;this.wasBlur=false;
var b=this._findTr(a);this.index=b.autocompleteIndex;this.selectEntry(a);this.hide()
}},onMouseOut:function(a){var b=this._findTr(a);y.stopObserving(b,"mousemove",this.onHover)
},onBlur:function(a){if(this.isUnloaded()){return}this.wasBlur=true;if(!this.active){return
}if(this.element.keepFocus){this.element.keepFocus=false;this.element.focus()}else{M.setTimeout(this.hide.bind(this),250)
}},onScroll:function(a){if(G.SAFARI==G.navigatorType()&&this.wasBlur){if(this.element){this.element.focus();
this.wasScroll=true;this.wasBlur=false}}},calcEntryPosition:function(b,f){var d=b;
var c=0;while(d&&(d!=f)){if(G.SAFARI==G.navigatorType()&&"TR"==d.tagName.toUpperCase()){c+=d.select(".rich-sb-cell-padding")[0].offsetTop
}else{c+=d.offsetTop}if(d.parentNode==f){break}d=d.offsetParent}var e;if(G.SAFARI==G.navigatorType()&&d){var a=d.select(".rich-sb-cell-padding")[0];
e=a.offsetTop+a.offsetHeight}else{e=b.offsetHeight}return{realOffset:c,entryOffsetHeight:e}
},countVisibleEntries:function(){var d=this.getEntry(this.index);var f=E.select(this.update,"._suggestion_size_");
var c=f[0]||this.update;var e=this.calcEntryPosition(d,c);var a=Math.round(c.clientHeight/e.entryOffsetHeight);
var b=Math.round((e.realOffset-c.scrollTop)/e.entryOffsetHeight);return{current:b,all:a}
},render:function(){if(this.entryCount>0){L.debug("render for index "+this.index+" and old index "+this.prevIndex);
if(this.prevIndex!=this.index){var j=this.getEntry(this.index);for(var d=0;d<this.options.selectedClasses.length;
d++){E.addClassName(j,this.options.selectedClasses[d])}var h=j.select(".rich-sb-cell-padding");
for(var d=0;d<h.length;d++){E.addClassName(h[d],this.options.selectValueClass)}if(this.keyEvent){var f=E.select(this.update,"._suggestion_size_");
var a=f[0]||this.update;var g=this.calcEntryPosition(j,a);var e=a.scrollTop;if(g.realOffset>a.scrollTop+a.clientHeight-g.entryOffsetHeight){a.scrollTop=g.realOffset-a.clientHeight+g.entryOffsetHeight
}else{if(g.realOffset<a.scrollTop){a.scrollTop=g.realOffset}}if(e!=a.scrollTop){this.skipHover=true
}this.keyEvent=false}if(this.prevIndex>=0){var c=this.getEntry(this.prevIndex);if(c){var b=c.select(".rich-sb-cell-padding");
for(var d=0;d<b.length;d++){E.removeClassName(b[d],this.options.selectValueClass)
}for(var d=0;d<this.options.selectedClasses.length;d++){E.removeClassName(c,this.options.selectedClasses[d])
}}}}this.prevIndex=this.index;if(this.hasFocus&&!this.wasBlur){this.show();this.active=true
}}else{var i=P(this.update.id+"NothingLabel");if(!i||"none"==i.style.display){this.active=false;
this.hide()}}},markPrevious:function(){if(this.index>0){this.index--}},markNext:function(){if(this.index<this.entryCount-1){this.index++
}},markPreviousPage:function(){var a=this.countVisibleEntries();if(this.index>0){if(a.current>0){this.index=this.index-Math.min(a.current,a.all)
}else{this.index=this.index-a.all}if(this.index<0){this.index=0}}},markNextPage:function(){var a=this.countVisibleEntries();
if(this.index<this.entryCount-1){if((a.current<a.all-1)&&a.current>=0){this.index=this.index+(a.all-a.current-1)
}else{this.index=this.index+a.all}if(this.index>this.entryCount-1){this.index=this.entryCount-1
}}},getEntry:function(b){var a=P(this.contentTable).firstChild;while(!a.tagName||a.tagName.toLowerCase()!="tbody"){a=a.nextSibling
}return P(a.childNodes[b])},getCurrentEntry:function(){return this.getEntry(this.index)
},selectEntry:function(b){this.active=false;var c=P(this.options.selection);c.value=this.index;
var a="";this.updateElement(this.getCurrentEntry(),b);if(this.options.onselect){this.options.onselect(this,b)
}if(this.update.onselect){this.update.onselect(this,b)}c.value=""},updateElement:function(d,c){if(this.options.updateElement){this.options.updateElement(d);
return}var b="";var a=d.firstChild;while(!a.tagName||a.tagName.toLowerCase()!="td"){a=a.nextSibling
}b=E.collectTextNodes(a);this.insertValue(b,c);this.oldValue=this.element.value;this.element.focus();
if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,d)
}},updateChoices:function(b){if(!this.changed&&this.hasFocus){if(b){this.update.firstChild.replaceChild(b,this.update.firstChild.firstChild)
}var a=[];if(this.options.entryClass){var e=E.select(this.update,"."+this.options.entryClass);
a=e||[]}else{if(this.update.firstChild&&this.update.firstChild.firstChild&&this.update.firstChild.firstChild.childNodes){E.cleanWhitespace(this.update);
E.cleanWhitespace(this.update.firstChild);E.cleanWhitespace(this.update.firstChild.firstChild);
a=this.update.firstChild.firstChild.childNodes}}this.entryCount=a.length;for(var g=0;
g<this.entryCount;g++){var c=a[g];c.autocompleteIndex=g;this.addObservers(c)}this.stopIndicator();
var e=E.select(this.update,"._suggestion_size_");var f=e[0]||this.update;f.scrollTop=-1;
f.scrollLeft=-1;this.index=0;this.prevIndex=-1;var d=P(this.update.id+"NothingLabel");
if(d&&this.hasFocus&&!this.wasBlur){if(this.entryCount<1){E.show(d);y.observe(d,"click",this.onNothingLabelClick);
y.observe(this.element,"blur",this.onNothingLabelClick);this.show()}}this.render()
}},addObservers:function(a){y.observe(a,"mouseover",this.onHover.bindAsEventListener(this));
y.observe(a,"click",this.onClick.bindAsEventListener(this));y.observe(a,"mouseout",this.onMouseOut.bindAsEventListener(this))
},onObserverEvent:function(b){L.debug("Observer event occurs");this.changed=false;
var c=this.element.value;if((b.rich&&b.rich.isCallSuggestion)||this.oldValue!=c){this.startPosition=0;
this.endPosition=c.length;if(this.options.tokens.length!=0){var a=this.options.tokens.join("");
this.startPosition=this.endPosition=U.getStart(this.element);while(this.endPosition<c.length&&a.indexOf(c.charAt(this.endPosition))==-1){this.endPosition++
}while(this.startPosition>0&&a.indexOf(c.charAt(this.startPosition-1))==-1){this.startPosition--
}}if(this.options.usingSuggestObjects){this.updateItems(c)}}if((b.rich&&b.rich.ignoreMinChars)||this.getToken().length>=this.options.minChars){L.debug("Call data for update choices");
if(b.keyCode==y.KEY_DOWN||this.oldValue!=c){this.startIndicator();this.getUpdatedChoices(b)
}}else{if(this.isSelectedItemsUpdated){this.isSelectedItemsUpdated=false;this.callOnObjectChangeListener(b)
}this.active=false;this.hide()}this.oldValue=c;this.observerHandle=null},callSuggestion:function(b){if(this.active){return
}if(!this.hasFocus){this.element.focus();U.setCaretTo(this.element,this.element.value.length)
}var a={};a.target=this.element;a.type="keydown";a.altKey=false;a.clientX=0;a.clientY=0;
a.ctrlKey=false;a.keyCode=40;a.pageX=0;a.pageY=0;a.screenX=0;a.screenY=0;a.shiftKey=false;
a.which=40;a.rich={isCallSuggestion:true,ignoreMinChars:b,ignoreFrequency:true};this.onKeyDownListener(a)
},getSelectedItems:function(){var b=new Array();if(this.options.usingSuggestObjects){for(var a=0;
a<this.selectedItems.length;a++){if(this.selectedItems[a].object){b.push(this.selectedItems[a].object)
}}}return b},updateItems:function(d){this.isSelectedItemsUpdated=false;var c=this.selectedItems;
var f=d.replace(/^\s+/,"").replace(/\s+$/,"");var b="";this.selectedItems=[];var e={};
if(this.options.tokens.length!=0){var h=new RegExp("\\s*[\\"+this.options.tokens.join("|\\")+"]\\s*");
var g=f.split(h);for(var a=0;a<g.length;a++){b=this.selectedItemsCache[g[a]];if(!b){b={text:g[a],object:null}
}this.selectedItems.push(b);e[b.text]=b}}else{b=this.selectedItemsCache[f];if(!b){b={text:f,object:null}
}this.selectedItems.push(b);e[b.text]=b}this.selectedItemsCache=e;if(this.selectedItems.length!=c.length){this.isSelectedItemsUpdated=true
}else{for(var a=0;a<this.selectedItems.length;a++){if(this.selectedItems[0].text!=c.text||this.selectedItems[0].object!=c.object){this.isSelectedItemsUpdated=true;
break}}}},updateSelectedItems:function(c){for(var b=0;b<this.selectedItems.length;
b++){if(!this.selectedItems[b].object){var a=c[this.selectedItems[b].text];if(a){this.selectedItems[b].object=a;
this.isSelectedItemsUpdated=true}}}},getItemListForUpdate:function(){var a=[];var c="";
if(this.options.tokens.length!=0){for(var b=0;b<this.selectedItems.length;b++){if(!this.selectedItems[b].object&&this.selectedItems[b].text.length==0){a.push(this.selectedItems[b].text)
}}c=a.join(this.options.tokens[0])}else{if(this.selectedItems.length!=0&&!this.selectedItems[0].object){c=this.selectedItems[0].object
}}return c},insertValue:function(g,f){var a=this.element.value.substr(0,this.startPosition);
var d=this.element.value.substr(this.endPosition);var j=this.element.value.substring(this.startPosition,this.endPosition);
var e=j.match(/^\s+/);if(e){a+=e[0]}e=j.match(/\s+$/);if(e){d=e[0]+d}this.element.value=a+g+d;
U.setCaretTo(this.element,(a+g).length);this.endPosition=this.startPosition+g.length;
if(this.options.usingSuggestObjects){var b=0;if(this.options.tokens.length!=0){var i=this.options.tokens.join("");
var c=0;while(c<this.startPosition){if(i.indexOf(this.element.value.charAt(c))!=-1){b++
}c++}}var h={text:g,object:this.fetchValues[this.index]};var k=(!this.selectedItems[b]||this.selectedItems[b].text!=g||this.selectedItems[b].object==null?true:false);
this.selectedItemsCache[g]=h;if(!this.selectedItems[b]){this.selectedItems.push(h)
}else{this.selectedItems[b]=h}if(k){this.callOnObjectChangeListener(f)}}},getToken:function(){var a=this.element.value.substring(this.startPosition,this.endPosition).replace(/^\s+/,"").replace(/\s+$/,"");
return/\n/.test(a)?"":a},callOnObjectChangeListener:function(a){if(this.options.onobjectchange){this.options.onobjectchange(this,a)
}}};var D=O.SuggestionBox={defaultOptions:{popupClass:"",popupStyle:"",width:200,height:200,entryClass:"richfaces_suggestionEntry",selectedClass:"",param:"inputvalue",frequency:0.4,minChars:0,tokens:null,selectValueClass:"richfaces_suggestionSelectValue",usingSuggestObjects:false,zindex:200}};
var A=G.Suggestion=C.create();Object.extend(Object.extend(A.prototype,K.prototype),{initialize:function(e,c,a,d){this.options=Object.clone(O.SuggestionBox.defaultOptions);
Object.extend(this.options,d);var b=a||"ac1update";if(!P(b)){this.create(c,b,a,this.options)
}this.baseInitialize(c,b,this.options);this.options.asynchronous=true;this.options.onajaxcomplete=this.options.oncomplete;
this.options.oncomplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;
this.content=a;this.contentTable=a+":suggest";this.actionUrl=e;if(this.options.onsubmit&&this.options.onsubmit!="null"){this.onsubmitFunction=new Function(this.options.onsubmit+";return true;").bind(this.element)
}this.update.component=this;this["rich:destructor"]="destroy";return this},destroy:function(){this.update.component=null
},getUpdatedChoices:function(a){this.options.parameters[this.options.param]=this.getToken();
if(this.options.usingSuggestObjects){this.options.parameters[this.options.param+"request"]=this.getItemListForUpdate()
}if(this.onsubmitFunction&&!this.onsubmitFunction()){return}B.Submit(this.actionUrl,a,this.options)
},onComplete:function(b,c,a){L.debug("AJAX response  complete - updateChoices");if(!this.update.style.position||this.update.style.position=="absolute"){this.update.style.position="absolute";
z.smartClone(this.element,this.update,this.options)}this.updateChoices();if(this.options.usingSuggestObjects&&a){this.fetchValues=a.suggestionObjects;
this.updateSelectedItems(a.requestedObjects);if(this.isSelectedItemsUpdated){this.isSelectedItemsUpdated=false;
this.callOnObjectChangeListener(c)}L.debug("Choices updated")}if(this.options.onajaxcomplete){this.options.onajaxcomplete(b,c)
}},create:function(f,d,b,a){if(!P(f)){return}var c="display:none;"+(a.popupStyle||"border:1px solid black;position:absolute; background-color:white;");
var e=a.popupClass?' class="'+a.popupClass+'" ':"";new R.Top(P(f).ownerDocument.body,'<div id="'+d+'"'+e+' style="'+c+'"><table id="'+b+'" cellspacing="0" cellpadding="0"><tbody></tbody></table></div>')
}});return{onAvailable:O.onAvailable,SuggestionComponent:A,Suggestion:T,SuggestionBox:D}
});define("scriptaculos.effect",["log","prototypejs","exports"],function(A,v,z){var r=v.Prototype,y=v.$,s=v.$$,w=v.$A,B=v.$H,t=v.$R,C=v.$w,F=v.Class,D=v.Enumerable,E=v.Element,u=v.Event,x=v.Object;
String.prototype.parseColor=function(){var c="#";if(this.slice(0,4)=="rgb("){var a=this.slice(4,this.length-1).split(",");
var b=0;do{c+=parseInt(a[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;
b<4;b++){c+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){c=this.toLowerCase()
}}}return(c.length==7?c:(arguments[0]||this))};E.collectTextNodes=function(a){return w(y(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?E.collectTextNodes(b):""))
}).flatten().join("")};E.collectTextNodesIgnoreClass=function(b,a){return w(y(b).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!E.hasClassName(c,a))?E.collectTextNodesIgnoreClass(c,a):""))
}).flatten().join("")};E.setContentZoom=function(b,a){b=y(b);b.setStyle({fontSize:(a/100)+"em"});
if(r.Browser.WebKit){window.scrollBy(0,0)}return b};E.getInlineOpacity=function(a){return y(a).style.opacity||""
};E.forceRerendering=function(c){try{c=y(c);var a=document.createTextNode(" ");c.appendChild(a);
c.removeChild(a)}catch(b){}};var q={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:r.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5
},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;
return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(a,b){return(-Math.cos((a*((b||5)-0.5)*2)*Math.PI)/2)+0.5
},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0
},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var a="position:relative";
if(r.Browser.IE){a+=";zoom:1"}b=y(b);w(b.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){b.insertBefore(new E("span",{style:a}).update(d==" "?String.fromCharCode(160):d),c)
});E.remove(c)}})},multiple:function(d,c){var a;if(((typeof d=="object")||x.isFunction(d))&&(d.length)){a=d
}else{a=y(d).childNodes}var e=x.extend({speed:0.1,delay:0},arguments[2]||{});var b=e.delay;
w(a).each(function(f,g){new c(f,x.extend(e,{delay:g*e.speed+b}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,a){b=y(b);
a=(a||"appear").toLowerCase();var c=x.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});
q[b.visible()?q.PAIRS[a][1]:q.PAIRS[a][0]](b,c)}};q.DefaultOptions.transition=q.Transitions.sinoidal;
q.ScopedQueue=F.create(D,{initialize:function(){this.effects=[];this.interval=null
},_each:function(a){this.effects._each(a)},add:function(b){var a=new Date().getTime();
var c=x.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(c){case"front":this.effects.findAll(function(d){return d.state=="idle"
}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":a=this.effects.pluck("startOn").max()||a;
break;case"end":a=this.effects.pluck("finishOn").max()||a;break}b.startOn+=a;b.finishOn+=a;
if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)
}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a
});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var a=new Date().getTime();
for(var b=0,c=this.effects.length;b<c;b++){this.effects[b]&&this.effects[b].loop(a)
}}});q.Queues={instances:B(),get:function(a){if(!x.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new q.ScopedQueue())
}};q.Queue=q.Queues.get("global");q.Base=F.create({position:null,start:function(b){function a(c,d){return((c[d+"Internal"]?"this.options."+d+"Internal(this);":"")+(c[d]?"this.options."+d+"(this);":""))
}if(b&&b.transition===false){b.transition=q.Transitions.linear}this.options=x.extend(x.extend({},q.DefaultOptions),b||{});
this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function c(d,e){if(d.options[e+"Internal"]){d.options[e+"Internal"](d)
}if(d.options[e]){d.options[e](d)}}return function(d){if(this.state==="idle"){this.state="running";
c(this,"beforeSetup");if(this.setup){this.setup()}c(this,"afterSetup")}if(this.state==="running"){d=(this.options.transition(d)*this.fromToDelta)+this.options.from;
this.position=d;c(this,"beforeUpdate");if(this.update){this.update(d)}c(this,"afterUpdate")
}}})();this.event("beforeStart");if(!this.options.sync){q.Queues.get(x.isString(this.options.queue)?"global":this.options.queue.scope).add(this)
}},loop:function(a){if(a>=this.startOn){if(a>=this.finishOn){this.render(1);this.cancel();
this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");
return}var b=(a-this.startOn)/this.totalTime,c=(b*this.totalFrames).round();if(c>this.currentFrame){this.render(b);
this.currentFrame=c}}},cancel:function(){if(!this.options.sync){q.Queues.get(x.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)
}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)
}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=B();for(property in this){if(!x.isFunction(this[property])){a.set(property,this[property])
}}return"#<Effect:"+a.inspect()+",options:"+B(this.options).inspect()+">"}});q.Parallel=F.create(q.Base,{initialize:function(a){this.effects=a||[];
this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);
b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")
})}});q.Tween=F.create(q.Base,{initialize:function(d,a,b){d=x.isString(d)?y(d):d;
var e=w(arguments),c=e.last(),f=e.length==5?e[3]:null;this.method=x.isFunction(c)?c.bind(d):x.isFunction(d[c])?d[c].bind(d):function(g){d[c]=g
};this.start(x.extend({from:a,to:b},f||{}))},update:function(a){this.method(a)}});
q.Event=F.create(q.Base,{initialize:function(){this.start(x.extend({duration:0},arguments[0]||{}))
},update:r.emptyFunction});q.Opacity=F.create(q.Base,{initialize:function(a){this.element=y(a);
if(!this.element){throw (q._elementDoesNotExistError)}if(r.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}var b=x.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)
},update:function(a){this.element.setOpacity(a)}});q.Move=F.create(q.Base,{initialize:function(a){this.element=y(a);
if(!this.element){throw (q._elementDoesNotExistError)}var b=x.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})
}});q.MoveBy=function(b,c,a){return new q.Move(b,x.extend({x:a,y:c},arguments[3]||{}))
};q.Scale=F.create(q.Base,{initialize:function(b,a){this.element=y(b);if(!this.element){throw (q._elementDoesNotExistError)
}var c=x.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:a},arguments[2]||{});
this.start(c)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]
}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;
var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);
this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]
}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]
}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]
}},update:function(b){var a=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*a+this.fontSizeType})
}this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)
}},setDimensions:function(e,b){var a={};if(this.options.scaleX){a.width=b.round()+"px"
}if(this.options.scaleY){a.height=e.round()+"px"}if(this.options.scaleFromCenter){var c=(e-this.dims[0])/2;
var d=(b-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){a.top=this.originalTop-c+"px"
}if(this.options.scaleX){a.left=this.originalLeft-d+"px"}}else{if(this.options.scaleY){a.top=-c+"px"
}if(this.options.scaleX){a.left=-d+"px"}}}this.element.setStyle(a)}});q.Highlight=F.create(q.Base,{initialize:function(a){this.element=y(a);
if(!this.element){throw (q._elementDoesNotExistError)}var b=x.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();
return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")
}this._base=t(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)
}.bind(this));this._delta=t(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]
}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:t(0,2).inject("#",function(d,c,b){return d+((this._base[b]+(this._delta[b]*a)).round().toColorPart())
}.bind(this))})},finish:function(){this.element.setStyle(x.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))
}});q.ScrollTo=function(b){var c=arguments[1]||{},d=document.viewport.getScrollOffsets(),a=y(b).cumulativeOffset();
if(c.offset){a[1]+=c.offset}return new q.Tween(null,d.top,a[1],c,function(e){scrollTo(d.left,e.round())
})};q.Fade=function(a){a=y(a);var c=a.getInlineOpacity();var b=x.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return
}d.element.hide().setStyle({opacity:c})}},arguments[1]||{});return new q.Opacity(a,b)
};q.Appear=function(a){a=y(a);var b=x.extend({from:(a.getStyle("display")=="none"?0:a.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()
},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});
return new q.Opacity(a,b)};q.Puff=function(a){a=y(a);var b={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};
return new q.Parallel([new q.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new q.Opacity(a,{sync:true,to:0})],x.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))
};q.BlindUp=function(a){a=y(a);a.makeClipping();return new q.Scale(a,0,x.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()
}},arguments[1]||{}))};q.BlindDown=function(a){a=y(a);var b=a.getDimensions();return new q.Scale(a,100,x.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};
q.SwitchOff=function(a){a=y(a);var b=a.getInlineOpacity();return new q.Appear(a,x.extend({duration:0.4,from:0,transition:q.Transitions.flicker,afterFinishInternal:function(c){new q.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})
}})}},arguments[1]||{}))};q.DropOut=function(a){a=y(a);var b={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};
return new q.Parallel([new q.Move(a,{x:0,y:100,sync:true}),new q.Opacity(a,{sync:true,to:0})],x.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()
},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(b)
}},arguments[1]||{}))};q.Shake=function(b){b=y(b);var d=x.extend({distance:20,duration:0.5},arguments[1]||{});
var a=parseFloat(d.distance);var c=parseFloat(d.duration)/10;var e={top:b.getStyle("top"),left:b.getStyle("left")};
return new q.Move(b,{x:a,y:0,duration:c,afterFinishInternal:function(f){new q.Move(f.element,{x:-a*2,y:0,duration:c*2,afterFinishInternal:function(g){new q.Move(g.element,{x:a*2,y:0,duration:c*2,afterFinishInternal:function(h){new q.Move(h.element,{x:-a*2,y:0,duration:c*2,afterFinishInternal:function(i){new q.Move(i.element,{x:a*2,y:0,duration:c*2,afterFinishInternal:function(j){new q.Move(j.element,{x:-a,y:0,duration:c,afterFinishInternal:function(k){k.element.undoPositioned().setStyle(e)
}})}})}})}})}})}})};q.SlideDown=function(a){a=y(a).cleanWhitespace();var c=a.down().getStyle("bottom");
var b=a.getDimensions();return new q.Scale(a,100,x.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})
},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:c})
}},arguments[1]||{}))};q.SlideUp=function(a){a=y(a).cleanWhitespace();var c=a.down().getStyle("bottom");
var b=a.getDimensions();return new q.Scale(a,window.opera?0:1,x.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();
d.element.down().undoPositioned().setStyle({bottom:c})}},arguments[1]||{}))};q.Squish=function(a){return new q.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};q.Grow=function(f){f=y(f);
var g=x.extend({direction:"center",moveTransition:q.Transitions.sinoidal,scaleTransition:q.Transitions.sinoidal,opacityTransition:q.Transitions.full},arguments[1]||{});
var h={top:f.style.top,left:f.style.left,height:f.style.height,width:f.style.width,opacity:f.getInlineOpacity()};
var b=f.getDimensions();var a,c;var d,e;switch(g.direction){case"top-left":a=c=d=e=0;
break;case"top-right":a=b.width;c=e=0;d=-b.width;break;case"bottom-left":a=d=0;c=b.height;
e=-b.height;break;case"bottom-right":a=b.width;c=b.height;d=-b.width;e=-b.height;
break;case"center":a=b.width/2;c=b.height/2;d=-b.width/2;e=-b.height/2;break}return new q.Move(f,{x:a,y:c,duration:0.01,beforeSetup:function(i){i.element.hide().makeClipping().makePositioned()
},afterFinishInternal:function(i){new q.Parallel([new q.Opacity(i.element,{sync:true,to:1,from:0,transition:g.opacityTransition}),new q.Move(i.element,{x:d,y:e,sync:true,transition:g.moveTransition}),new q.Scale(i.element,100,{scaleMode:{originalHeight:b.height,originalWidth:b.width},sync:true,scaleFrom:window.opera?1:0,transition:g.scaleTransition,restoreAfterFinish:true})],x.extend({beforeSetup:function(j){j.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(j){j.effects[0].element.undoClipping().undoPositioned().setStyle(h)
}},g))}})};q.Shrink=function(d){d=y(d);var e=x.extend({direction:"center",moveTransition:q.Transitions.sinoidal,scaleTransition:q.Transitions.sinoidal,opacityTransition:q.Transitions.none},arguments[1]||{});
var f={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};
var a=d.getDimensions();var b,c;switch(e.direction){case"top-left":b=c=0;break;case"top-right":b=a.width;
c=0;break;case"bottom-left":b=0;c=a.height;break;case"bottom-right":b=a.width;c=a.height;
break;case"center":b=a.width/2;c=a.height/2;break}return new q.Parallel([new q.Opacity(d,{sync:true,to:0,from:1,transition:e.opacityTransition}),new q.Scale(d,window.opera?1:0,{sync:true,transition:e.scaleTransition,restoreAfterFinish:true}),new q.Move(d,{x:b,y:c,sync:true,transition:e.moveTransition})],x.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(f)
}},e))};q.Pulsate=function(c){c=y(c);var d=arguments[1]||{},e=c.getInlineOpacity(),a=d.transition||q.Transitions.linear,b=function(f){return 1-a((-Math.cos((f*(d.pulses||5)*2)*Math.PI)/2)+0.5)
};return new q.Opacity(c,x.extend(x.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:e})
}},d),{transition:b}))};q.Fold=function(a){a=y(a);var b={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};
a.makeClipping();return new q.Scale(a,5,x.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new q.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(b)
}})}},arguments[1]||{}))};q.Morph=F.create(q.Base,{initialize:function(a){this.element=y(a);
if(!this.element){throw (q._elementDoesNotExistError)}var c=x.extend({style:{}},arguments[1]||{});
if(!x.isString(c.style)){this.style=B(c.style)}else{if(c.style.include(":")){this.style=c.style.parseStyle()
}else{this.element.addClassName(c.style);this.style=B(this.element.getStyles());this.element.removeClassName(c.style);
var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]
});c.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(e){d.element.style[e.style]=""
})}}}this.start(c)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"
}b=b.parseColor();return t(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)
})}this.transforms=this.style.map(function(b){var c=b[0],d=b[1],e=null;if(d.parseColor("#zzzzzz")!="#zzzzzz"){d=d.parseColor();
e="color"}else{if(c=="opacity"){d=parseFloat(d);if(r.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}}else{if(E.CSS_LENGTH.test(d)){var f=d.match(/^([\+\-]?[0-9\.]+)(.*)$/);d=parseFloat(f[1]);
e=(f.length==3)?f[2]:null}}}var g=this.element.getStyle(c);return{style:c.camelize(),originalValue:e=="color"?a(g):parseFloat(g||0),targetValue:e=="color"?a(d):d,unit:e}
}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))
})},update:function(d){var a={},c,b=this.transforms.length;while(b--){a[(c=this.transforms[b]).style]=c.unit=="color"?"#"+(Math.round(c.originalValue[0]+(c.targetValue[0]-c.originalValue[0])*d)).toColorPart()+(Math.round(c.originalValue[1]+(c.targetValue[1]-c.originalValue[1])*d)).toColorPart()+(Math.round(c.originalValue[2]+(c.targetValue[2]-c.originalValue[2])*d)).toColorPart():(c.originalValue+(c.targetValue-c.originalValue)*d).toFixed(3)+(c.unit===null?"":c.unit)
}this.element.setStyle(a,true)}});q.Transform=F.create({initialize:function(a){this.tracks=[];
this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(c){c=B(c);
var b=c.values().first();this.tracks.push(B({ids:c.keys().first(),effect:q.Morph,options:{style:b}}))
}.bind(this));return this},play:function(){return new q.Parallel(this.tracks.map(function(e){var b=e.get("ids"),c=e.get("effect"),d=e.get("options");
var a=[y(b)||s(b)].flatten();return a.map(function(f){return new c(f,x.extend({sync:true},d))
})}).flatten(),this.options)}});E.CSS_PROPERTIES=C("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
E.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var a,b=B();if(r.Browser.WebKit){a=new E("div",{style:this}).style
}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';a=String.__parseStyleElement.childNodes[0].style
}E.CSS_PROPERTIES.each(function(c){if(a[c]){b.set(c,a[c])}});if(r.Browser.IE&&this.include("opacity")){b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])
}return b};if(document.defaultView&&document.defaultView.getComputedStyle){E.getStyles=function(a){var b=document.defaultView.getComputedStyle(y(a),null);
return E.CSS_PROPERTIES.inject({},function(d,c){d[c]=b[c];return d})}}else{E.getStyles=function(b){b=y(b);
var c=b.currentStyle,a;a=E.CSS_PROPERTIES.inject({},function(e,d){e[d]=c[d];return e
});if(!a.opacity){a.opacity=b.getOpacity()}return a}}q.Methods={morph:function(b,a){b=y(b);
new q.Morph(b,x.extend({style:a},arguments[2]||{}));return b},visualEffect:function(c,a,d){c=y(c);
var b=a.dasherize().camelize(),e=b.charAt(0).toUpperCase()+b.substring(1);new q[e](c,d);
return c},highlight:function(a,b){a=y(a);new q.Highlight(a,b);return a}};C("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){q.Methods[a]=function(b,c){b=y(b);
q[a.charAt(0).toUpperCase()+a.substring(1)](b,c);return b}});C("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){q.Methods[a]=E[a]
});E.addMethods(q.Methods);return z=q});define("richfacesjs.panelbar",["globals","prototypejs","richfacesjs","log"],function(u,p,x,w){var r=u.window,t=x.Richfaces,v=p.$,s=p.$F,z=p.Class,o=p.Event,n=w.LOG;
var q=t.PanelBar=z.create();q.prototype={initialize:function(a,b){this["rich:destructor"]="destroy";
this._componentType="PanelBar";this.id=a;this.panel=v(a);if(!this.panel){return}this.panel.component=this;
this.hclient=0;this.COUNT=0;this.STEP=0;this.slides=new Array();this.ch=this.panel.clientHeight;
this.options=b;this.onitemchange=b.onitemchange;this.onitemchanged=b.onitemchanged;
this.onclick=b.onclick;this.items=b.items;this._attachBehaviors();this.input=v(a+"_panelBarInput");
this.defaultIndex=this.findPanelById(s(a+"_panelBarInput"));this.handleOnLoadBound=this.handleOnLoad.bind(this);
if(!b.ajax){o.observe(r,"load",this.handleOnLoadBound)}else{this.handleOnLoad()}this.mouseover=b.mouseover;
this.mouseout=b.mouseout;this.mousemove=b.mousemove;if(this.mouseover&&this.mouseover!=""){o.observe(this.panel,"mouseover",new Function("event",this.mouseover))
}if(this.mouseout&&this.mouseout!=""){o.observe(this.panel,"mouseout",new Function("event",this.mouseout))
}if(this.mousemove&&this.mousemove!=""){o.observe(this.panel,"mousemove",new Function("event",this.mousemove))
}if(this.slides[this.defaultIndex]){this.showSlide(this.slides[this.defaultIndex])
}this.contentHight=-1},reInitialize:function(a){this.initialize(this.id||a,this.options)
},destroy:function(){o.stopObserving(r,"load",this.handleOnLoadBound);if(this.panel){this.panel.component=undefined
}if(this.timer){clearTimeout(this.timer);this.timer=undefined}},handleOnLoad:function(){o.stopObserving(r,"load",this.handleOnLoadBound);
if(this.timer){clearTimeout(this.timer)}if(this.panel.clientHeight<=0){this.contentHight=-1;
this.timer=r.setTimeout(this.handleOnLoadBound,100)}this.showSlide(this.slides[this.defaultIndex])
},getContentHeight:function(){if(this.contentHight){}else{this.contentHight=-1}if(this.contentHight<=-1){var a=0;
this.hclient=0;for(var b=0;b<this.slides.length;b++){a+=this.slides[b].item.offsetHeight
}this.hclient=a;this.contentHight=this.panel.clientHeight-a}return this.contentHight
},showSlide:function(b){if(this.current){this.current.hideContent()}var a=this.getContentHeight();
if(this.current){this.current.hideHeader()}b.content.style.height=(a>0?a:0)+"px";
if(a<=1&&(this.panel.style.height==""||this.panel.style.height.indexOf("%")!=-1)){this.panel.style.height="";
b.content.style.height="100%"}b.showContent();this.current=b;this.input.value=this.current.item.id;
this.firstLoad=false},_attachBehaviors:function(){var a=this._getItems(this.panel);
for(var b=0;b<a.length;b++){var c=this._getDirectChildrenByTag(a[b],"DIV");this.slides.push(new q.Slide(this,a[b],c[0],c[1],c[2],b,this.onclick))
}},_getItems:function(b){var d=new Array();var c=t.firstDescendant(b);var e=0;var a=this.items[e].id;
do{if(c.id==a){d.push(c);e++;if(e<this.items.length){a=this.items[e].id}else{break
}}}while(c=c.nextSibling);return d},_getDirectChildrenByTag:function(a,c){var e=new Array();
var f=a.childNodes;for(var d=0;d<f.length;d++){var b=f[d];if(b&&b.tagName&&b.tagName.toUpperCase()==c.toUpperCase()){e.push(b)
}}return e},findPanelById:function(a){for(var b=0;b<this.slides.length;b++){if(this.slides[b].item.id==a){return b
}}return 0},invokeEvent:function(j,e,g,c,a,d,b){var f;if(d){var h;if(e){h=e}else{if(document.createEventObject){h=document.createEventObject()
}else{if(document.createEvent){h=document.createEvent("Events");h.initEvent(j,true,false)
}}}h.rich={component:this};h.rich.enterElement=g;h.rich.leaveElement=c;try{f=d.call(a,h)
}catch(i){n.warn("Exception: "+i.Message+"\n[on"+j+"]")}}if(f!=false){f=true}return f
}};var y=q.Slide=z.create();y.prototype={initialize:function(b,c,a,g,d,e,f){this.index=e;
this.slidePanel=b;this.item=c;this.header=a;this.header_act=g;this.content=d;this.onclick=f;
o.observe(this.header,"click",this.headerOnClick.bindAsEventListener(this));o.observe(this.header,"selectstart",this.headerOnSelectStart.bindAsEventListener(this));
o.observe(this.header_act,"click",this.headerOnClick.bindAsEventListener(this));o.observe(this.header_act,"selectstart",this.headerOnSelectStart.bindAsEventListener(this));
this.content.style.display="none";this.content.style.overflow="auto";this.content.style.height="0px";
this.hightFirefoxDelta=0;if(this.onclick&&this.onclick!=""){this.onclickFunction=new Function("event",this.onclick)
}},showContent:function(){this.content.style.display="block";t.firstDescendant(this.content).style.height="";
this.header.style.display="none";this.header_act.style.display=""},hideContent:function(){this.content.style.display="none";
t.firstDescendant(this.content).style.height="100%"},hideHeader:function(){this.header_act.style.display="none";
this.header.style.display=""},headerOnClick:function(a){if(this.onclickFunction){var h=this.onclickFunction(a);
if(h==false){return false}}if(this.content.style.display=="block"){return}var b=this.item;
var d=this.slidePanel.current.item;var f=this.slidePanel.items[this.index];var c;
var g=this.slidePanel.items;for(var e=0;e<g.length;e++){if(this.slidePanel.items[e].id==d.id){c=this.slidePanel.items[e]
}}if(!this.slidePanel.invokeEvent("onenter",a,d,b,b,f.onenter)){return false}if(!this.slidePanel.invokeEvent("onleave",a,d,b,d,c.onleave)){return false
}if(!this.slidePanel.invokeEvent("onchangeitem",a,d,b,this.slidePanel.panel,this.slidePanel.onitemchange)){return false
}this.slidePanel.showSlide(this);this.slidePanel.panel.style.maxHeight="";this.slidePanel.panel.style.minHeight="";
this.slidePanel.invokeEvent("onchangeditem",a,d,b,this.slidePanel.panel,this.slidePanel.onitemchanged)
},headerOnSelectStart:function(){return false}};return{PanelBar:q}});define("richfacesjs.fileupload",["globals","prototypejs","json.dom","a4j.form","richfacesjs.utils","a4j","a4j.ajax"],function(Q,I,H,S,z,R,J){var N=Q.g,O=I.$,D=I.$F,F=I.Prototype,C=I.Class,x=I.Event,G=I.Element,y=I.Object,K=H.E,E=H.ET,P=H.T,T=H.JSNode;
var L=C.create();L.INITIALIZED="initialized";L.READY="ready";L.UPLOAD_IN_PROGRESS="progress";
L.UPLOAD_CANCELED="canceled";L.UPLOAD_SUCCESS="done";L.UPLOAD_TRANSFER_ERROR="transfer_error";
L.UPLOAD_SERVER_ERROR="server_error";L.UPLOAD_SIZE_ERROR="size_error";L.UPLOAD_FORBIDDEN="forbidden";
L.UPLOAD_IN_PROGRESS_CLASS="";L.UPLOAD_SUCCESS_CLASS="rich-fileupload-bold-label";
L.UPLOAD_TRANSFER_ERROR_CLASS="";L.UPLOAD_SIZE_ERROR_CLASS="";L.ENTRY_CANCEL_LABEL_CLASS="";
L.ENTRY_CLEAR_LABEL_CLASS="";L.ENTRY_STOP_LABEL_CLASS="";L.LABELS={};L.LABELS[L.INITIALIZED]="";
L.LABELS[L.READY]="";L.LABELS[L.UPLOAD_IN_PROGRESS]="";L.LABELS[L.UPLOAD_CANCELED]="";
L.LABELS[L.UPLOAD_FORBIDDEN]="Uploading forbidden";L.clearControlTemplate=[new K("a",{style:"",onclick:function(a){return'var entry=require("richfacesjs.fileupload").getComponent(this);entry.uploadObject.clear(entry);return false;'
},className:function(a){return"rich-fileupload-anc "+z.evalMacro("labelClassName",a)+z.evalMacro("className",a)
},href:"#"},[new P(function(a){return z.evalMacro("controlLink",a)})])];L.stopControlTemplate=[new K("a",{style:"",onclick:function(a){return'require("richfacesjs.fileupload").getComponent(this).uploadObject.stop();return false;'
},className:function(a){return"rich-fileupload-anc "+z.evalMacro("labelClassName",a)+z.evalMacro("className",a)
},href:"#"},[new P(function(a){return z.evalMacro("controlLink",a)})])];L.cancelControlTemplate=[new K("a",{style:"",onclick:function(a){return'var entry=require("richfacesjs.fileupload").getComponent(this);entry.uploadObject.clear(entry,true);return false;'
},className:function(a){return"rich-fileupload-anc "+z.evalMacro("labelClassName",a)+z.evalMacro("className",a)
},href:"#"},[new P(function(a){return z.evalMacro("controlLink",a)})])];L.template=[new K("table",{cellspacing:"0",cellpadding:"0",border:"0",style:"width:100%"},[new K("tbody",{},[new K("tr",{},[new K("td",{className:function(a){return"rich-fileupload-font rich-fileupload-name rich-fileupload-table-td "+z.evalMacro("className",a)
}},[new K("div",{className:"rich-fileupload-name-padding",style:function(a){return"overflow : hidden; width:"+z.evalMacro("fileEntryWidth",a)
}},[new E(function(a){return z.evalMacro("fileName",a)})]),new K("div",{}),new K("div",{className:"rich-fileupload-name-padding",style:function(a){return"overflow : hidden; width:"+z.evalMacro("fileEntryWidth",a)
}},[new E(function(a){return z.evalMacro("label",a)})])]),new K("td",{style:"vertical-align: center;",className:"rich-fileupload-table-td"},[new K("div",{className:"rich-fileupload-font rich-fileupload-del"},[])]),new K("td",{className:"rich-fileupload-table-td"},[new K("div",{className:"rich-fileupload-font rich-fileupload-scroll"},[new P("\u00A0")])])])])])];
L.getComponent=function(b){while(b){var a=b.component;if(a){return a}else{b=b.parentNode
}}};y.extend(L.prototype,{fileInput:null,fileName:null,uploadObject:null,state:L.INITIALIZED,initialize:function(c,a,g,h,i,f,b,e){this.fileInput=c;
this.uploadObject=g;this.size=h;this.type=i;this.creator=f;this.creationDate=b;this.modificationDate=e;
var d=a||T.prototype.xmlEscape(D(this.fileInput));this.fileName=d;var j=L.template.invoke("getContent",{fileName:d,fileEntryWidth:g.getFileEntryWidth(),className:this.uploadObject.classes.FILE_ENTRY.ENABLED}).join("");
G.insert(this.uploadObject.items,j);this.entryElement=this.uploadObject.items.childNodes[this.uploadObject.items.childNodes.length-1];
this.entryElement.component=this;this.statusLabel=this.entryElement.rows[0].cells[0].lastChild;
this.controlArea=this.entryElement.rows[0].cells[1].firstChild;this.progressArea=this.entryElement.rows[0].cells[0].childNodes[1]
},upload:function(){this.setState(L.UPLOAD_IN_PROGRESS);this.setupProgressBar();this.uploadObject.createFrame();
N.setTimeout(function(){this.uploadObject.submitForm(this)}.bind(this),0)},setupProgressBar:function(){this.progressArea.appendChild(this.uploadObject._progressBar);
this.uploadObject.prepareProgressBar()},setupLabelUpdate:function(){this.updateLabel();
this.labelUpdateInterval=setInterval(function(){this.updateLabel()}.bind(this),this.uploadObject.progressBar.options.pollinterval)
},updateLabel:function(){if(this.state!=L.UPLOAD_IN_PROGRESS){clearInterval(this.labelUpdateInterval)
}else{var b=this.uploadObject.progressBar.getValue();if(b){var c=this.uploadObject.labelMarkup.invoke("getContent",this.uploadObject.progressData.getContext(b)).join("");
var a=this.getClassByState(L.UPLOAD_IN_PROGRESS);G.addClassName(this.statusLabel,a);
this.statusLabel.innerHTML=c}}},finishProgressBar:function(){this.uploadObject.finishProgressBar()
},stop:function(){this.uploadObject.executeStopScript(this.uid)},_clearInput:function(){z.removeNode(this.fileInput);
this.fileInput=null},_clearEntry:function(){z.removeNode(this.entryElement);this.entryElement=null
},clear:function(){this._clearInput();this._clearEntry()},setState:function(b){var a=this.state;
this.state=b;G.clearChildren(this.statusLabel);G.clearChildren(this.controlArea);
var c=this.getClassByState(b);G.addClassName(this.statusLabel,c);G.insert(this.statusLabel,L.LABELS[b]);
if(b==L.UPLOAD_IN_PROGRESS){G.update(this.controlArea,L.stopControlTemplate.invoke("getContent",{controlLink:L.LABELS.entry_stop,labelClassName:L.ENTRY_STOP_LABEL_CLASS,className:this.uploadObject.classes.FILE_ENTRY_CONTROL.ENABLED}).join(""))
}else{if(b==L.UPLOAD_SUCCESS){G.update(this.controlArea,L.clearControlTemplate.invoke("getContent",{controlLink:L.LABELS.entry_clear,labelClassName:L.ENTRY_CLEAR_LABEL_CLASS,className:this.uploadObject.classes.FILE_ENTRY_CONTROL.ENABLED}).join(""))
}else{G.update(this.controlArea,L.cancelControlTemplate.invoke("getContent",{controlLink:L.LABELS.entry_cancel,labelClassName:L.ENTRY_CANCEL_LABEL_CLASS,className:this.uploadObject.classes.FILE_ENTRY_CONTROL.ENABLED}).join(""))
}}if(b==L.UPLOAD_SUCCESS){this._clearInput()}this.uploadObject.notifyStateChange(this,a)
},getClassByState:function(a){if(a==L.UPLOAD_SUCCESS){return L.UPLOAD_SUCCESS_CLASS
}else{if(a==L.UPLOAD_IN_PROGRESS){return L.UPLOAD_IN_PROGRESS_CLASS}else{if(a==L.UPLOAD_TRANSFER_ERROR){return L.UPLOAD_TRANSFER_ERROR_CLASS
}else{if(a==L.UPLOAD_SIZE_ERROR){return L.UPLOAD_SIZE_ERROR_CLASS}else{return""}}}}}});
var B=C.create();y.extend(B.prototype,{size:null,startTime:null,initialize:function(a){this.size=a;
this.startTime=parseInt((new Date().getTime())/1000)},ss:function(){var a=parseInt((this.time-this.startTime)%60);
if(a<10){return"0"+a}return a+""},mm:function(){var a=parseInt((this.time-this.startTime)/60);
if(a<10){return"0"+a}return a+""},hh:function(){var a=parseInt((this.time-this.startTime)/3600);
if(a<10){return"0"+a}return a+""},B:function(){return this.size},KB:function(){return parseInt(this.size/1024)
},MB:function(){return parseInt(this.size/(1024*1024))},getContext:function(b){var a={};
this.time=parseInt((new Date().getTime())/1000);a.B=this.B();a.KB=this.KB();a.MB=this.MB();
a.ss=this.ss();a.mm=this.mm();a.hh=this.hh();var c=this.size;this.size=(this.size*b)/100;
a._B=this.B();a._KB=this.KB();a._MB=this.MB();this.size=c;return a}});var M=C.create();
y.extend(M.prototype,{initialize:function(a,b,c){this.iframe=a;this.callback=b;this.viewStateUpdater=c;
this.loadObserver=function(){if(!this.stopped){this.stop();this.onload()}return false
}.bind(this);x.observe(this.iframe,"load",this.loadObserver);this.isError=function(){try{if(this.iframe.contentWindow&&this.iframe.contentWindow.document){this.iframe.contentWindow.document.readyState
}}catch(d){return true}return false}.bind(this);this.interval=N.setInterval(function(){if(!this.stopped){var f=false;
var d=null;try{if(!F.Browser.Opera&&!F.Browser.WebKit&&this.iframe.contentWindow&&this.iframe.contentWindow.document){f=/complete/.test(this.iframe.contentWindow.document.readyState)
}}catch(e){d=e}if(d){this.stop();this.onerror()}}return false}.bind(this),200)},oncancel:function(){if(!this.stopped){this.stop();
this.callback(L.UPLOAD_CANCELED)}},onerror:function(){this.callback(L.UPLOAD_TRANSFER_ERROR)
},onload:function(){if(this.isError()){this.callback(L.UPLOAD_TRANSFER_ERROR);return
}var e=this.iframe.contentWindow.document;var b=e.getElementById("_richfaces_file_upload_stopped");
var d=e.getElementById("_richfaces_file_upload_size_restricted");var c=e.getElementById("_richfaces_file_upload_forbidden");
var a=this.findViewState(e);if(b){this.callback(L.UPLOAD_CANCELED)}else{if(d){this.callback(L.UPLOAD_SIZE_ERROR)
}else{if(c){this.callback(L.UPLOAD_SIZE_ERROR)}else{if(a){this.viewStateUpdater(a.value);
this.callback(L.UPLOAD_SUCCESS)}else{this.callback(L.UPLOAD_TRANSFER_ERROR)}}}}},findViewState:function(b){var c="javax.faces.ViewState";
var a=b.getElementsByTagName("input");for(var d in a){if(a[d].name==c){return a[d]
}}return b.getElementById(c)},stop:function(){this.stopped=true;if(this.interval){N.clearInterval(this.interval);
this.interval=null}if(this.loadObserver){x.stopObserving(this.iframe,"load",this.loadObserver);
this.loadObserver=null}}});var A=C.create();y.extend(A.prototype,{idCounter:0,progressBar:null,iframe:null,element:null,entries:new Array(),activeEntry:null,options:null,runUpload:false,maxFileBatchSize:1,uploadedCount:0,acceptedTypes:{"*":true},initialize:function(g,f,a,k,d,h){if(!h){h={}
}this.allOptions=h;this._componentType="FileUpload";this.classes={ADD:{ENABLED:"rich-fileupload-button rich-fileupload-font ",DISABLED:"rich-fileupload-button-dis rich-file-upload-font "},ADD_CONTENT:{ENABLED:"rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-add ",DISABLED:"rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-add-dis "},UPDATE:{ENABLED:"rich-fileupload-button rich-fileupload-font ",DISABLED:"rich-fileupload-button-dis rich-fileupload-font "},UPDATE_CONTENT:{ENABLED:"rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-start ",DISABLED:"rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-start-dis "},STOP:{ENABLED:"rich-fileupload-button rich-fileupload-font",DISABLED:"rich-fileupload-button-dis rich-fileupload-font"},STOP_CONTENT:{ENABLED:"rich-fileupload-button-content rich-file-upload-font rich-fileupload-ico rich-fileupload-ico-stop ",DISABLED:"rich-fileupload-button-content rich-file-upload-font rich-fileupload-ico rich-fileupload-ico-stop-dis "},CLEAN:{ENABLED:"rich-fileupload-button rich-fileupload-font ",DISABLED:"rich-fileupload-button-dis rich-fileupload-font "},CLEAN_CONTENT:{ENABLED:"rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-clear ",DISABLED:"rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-clear-dis "},FILE_ENTRY:{ENABLED:"",DISABLED:""},FILE_ENTRY_CONTROL:{ENABLED:"",DISABLED:""},UPLOAD_LIST:{ENABLED:"",DISABLED:""},SIZE_ERROR_LABEL:{ENABLED:""},TRANSFER_ERROR_LABEL:{ENABLED:""},DONE_LABEL:{ENABLED:"rich-fileupload-bold-label"},PROGRESS_LABEL:{ENABLED:""},ENTRY_CANCEL_LABEL:{ENABLED:""},ENTRY_STOP_LABEL:{ENABLED:""},ENTRY_CLEAR_LABEL:{ENABLED:""}};
this.events={};this.options={};var e=h.classes;for(var c in e){var j=c;if(j=="DONE_LABEL"){L.UPLOAD_SUCCESS_CLASS=e.DONE_LABEL.ENABLED
}else{if(j=="SIZE_ERROR_LABEL"){L.UPLOAD_SIZE_ERROR_CLASS=e.SIZE_ERROR_LABEL.ENABLED
}else{if(j=="TRANSFER_ERROR_LABEL"){L.UPLOAD_TRANSFER_ERROR_CLASS=e.TRANSFER_ERROR_LABEL.ENABLED
}else{if(j=="PROGRESS_LABEL"){L.UPLOAD_IN_PROGRESS_CLASS=e.PROGRESS_LABEL.ENABLED
}else{if(j=="ENTRY_CANCEL_LABEL"){L.ENTRY_CANCEL_LABEL_CLASS=e.ENTRY_CANCEL_LABEL.ENABLED
}else{if(j=="ENTRY_STOP_LABEL"){L.ENTRY_STOP_LABEL_CLASS=e.ENTRY_STOP_LABEL.ENABLED
}else{if(j=="ENTRY_CLEAR_LABEL"){L.ENTRY_CLEAR_LABEL_CLASS=e.ENTRY_CLEAR_LABEL.ENABLED
}}}}}}}j=e[c];for(var i in j){this.classes[c][i]+=j[i];if(this.classes[c+"_CONTENT"]){this.classes[c+"_CONTENT"][i]+=j[i]
}}}y.extend(this,h.fields);this.id=g;this.element=O(this.id);var b=this.element.up("form");
this.formId=(b)?b.id:null;this.form=b;this._progressBar=O(k);this.fillProgressBar();
this.entries=new Array();this.element.component=this;this.actionScript=a;this.items=O(this.id+":fileItems");
this.sessionId=d;this.currentInput=O(this.id+":file");this.actionUrl=f;this.initEvents();
this.setupAutoUpload();this.checkFrame();this.initLabels(h.labels);this.processButtons();
this.initFileInput()},reInitialize:function(a){this.initialize(this.id||a,this.actionUrl,this.actionScript,this._progressBar.id,this.sessionId,this.allOptions)
},fillProgressBar:function(){if(this._progressBar){this.progressBar=this._progressBar.component
}},executeStopScript:function(a){this.actionScript(a,"richfaces_file_upload_action_stop",this.cancelUpload.bind(this))
},cancelUpload:function(c,e,b){var a=b;if(this.activeEntry&&this.activeEntry.uid==a){if(this.watcher){this.watcher.oncancel()
}if(this.iframe){try{this.iframe.contentWindow.location.href="about:blank";this.iframe.contentWindow.stop()
}catch(d){}}}},initLabels:function(b){if(b){for(var a in b){L.LABELS[a]=b[a]}}},initFileInput:function(){var b=this.currentInput;
var c=b.parentNode.parentNode;c=O(c);if(c.getWidth()!=0){var a=b.parentNode.style;
a.width=c.getWidth()+"px";a.height=c.getHeight()+"px";x.stopObserving(c,"mouseover",this.inputHandler)
}else{this.inputHandler=this.initFileInput.bindAsEventListener(this);x.observe(c,"mouseover",this.inputHandler)
}},getFileEntryWidth:function(){if(this.fileEntryWidth){return this.fileEntryWidth
}var a;a=this.element.offsetWidth-122;if(a<0){a=0}this.fileEntryWidth=a;var c=this._progressBar.style.width;
if(c==""){c=200}if(c>this.fileEntryWidth){a=(a-2);if(a<0){a=0}a+="px";this._progressBar.style.width=a;
var b=O(this._progressBar.id+":remain");if(b){b.style.width=a;O(this._progressBar.id+":complete").style.width=a
}}this.fileEntryWidth=this.fileEntryWidth+"px";return this.fileEntryWidth},createFrame:function(){if(this.iframe){return
}var b=document.createElement("div");b.style.display="none";var a="<iframe name='"+this.id+"_iframe' id='"+this.id+"_iframe'"+(!z.browser.isOpera?' src="about:blank"':"")+"></iframe>";
b.innerHTML=a;document.body.appendChild(b);this.iframe=O(this.id+"_iframe")},checkFrame:function(){this.iframe=O(this.id+"_iframe");
if(this.iframe){this.deleteFrame()}},deleteFrame:function(){this.resetFrame();if(this.iframe){document.body.removeChild(this.iframe.parentNode)
}this.iframe=null},resetFrame:function(){if(N.opera&&this.iframe&&this.iframe.contentWindow.document&&this.iframe.contentWindow.document.body){this.iframe.contentWindow.document.body.innerHTML=""
}else{this.iframe.src="about:blank"}},initEvents:function(){for(var a in this.events){if(a&&this.events[a]){if(a=="onupload"){this.element.observe("rich:onupload",function(b){if(this.events.onupload(b)!==false){b.memo.entry.upload()
}}.bindAsEventListener(this))}else{this.element.observe("rich:"+a,this.events[a])
}}}},executeFileSizeScript:function(a){this.actionScript(a,"progress",this.getFileSize.bind(this))
},getFileSize:function(c,d,b){this.fillProgressBar();if(b){this.progressBar.enable();
if(this.labelMarkup){var a=new B(b);this.progressData=a;if(this.activeEntry){this.activeEntry.setupLabelUpdate()
}}}else{if(this.activeEntry){this._fileSizeScriptTimeoutId=N.setTimeout(function(){this._fileSizeScriptTimeoutId=undefined;
this.executeFileSizeScript(this.activeEntry.uid)}.bind(this),this.progressBar.options.pollinterval||500)
}}},prepareProgressBar:function(){this.fillProgressBar();this.progressBar.setValue(0);
G.show(this._progressBar);this.progressBar.options.onerror=function(a){this.errorHandler(a)
}.bind(this)},errorHandler:function(a){if(this.watcher){this.watcher.stop();this.watcher.onerror();
this.watcher=null}},finishProgressBar:function(){this.fillProgressBar();if(this._fileSizeScriptTimeoutId){clearTimeout(this._fileSizeScriptTimeoutId);
this._fileSizeScriptTimeoutId=undefined}this.progressBar.disable();this.progressBar.setValue(100);
G.hide(this._progressBar)},setupAutoUpload:function(){this.runUpload=this.options.immediateUpload
},checkFileType:function(b){if(!this.acceptedTypes||this.acceptedTypes["*"]){return true
}if(/(?:\S+)\.(\S+)$/.test(b)){var a=RegExp.$1;a=a.toLowerCase();if(this.acceptedTypes[a]){return true
}}return false},checkDuplicated:function(a){if(!this.options.noDuplicate){return true
}var b=a.value;for(var c=0;c<this.entries.length;c++){if(b==this.entries[c].fileName){return false
}}return true},add:function(b,c){if(this.disabled){return}if(!b.value){return}if(b.files&&b.files.length>1&&!c){for(var e=0;
e<b.files.length;e++){this.add(b,b.files[e].name)}return}if(!this.checkFileType(c||b.value)||!this.checkDuplicated(b)){try{var g=b.cloneNode(true);
g.value="";b.parentNode.replaceChild(g,b);this.currentInput=g;if(this.events.ontyperejected){this.element.fire("rich:ontyperejected",{fileName:c||b.value})
}}catch(d){}return}var f=new L(b,c,this);this.entries.push(f);if(this.runUpload){f.setState(L.READY)
}else{f.setState(L.INITIALIZED)}var g=b.cloneNode(true);b.onchange=null;b.style.cssText="position: absolute; right: 0px; top: 0px; display: none; visibility: hidden;";
g.id=this.id+":file"+(this.idCounter++);g.value="";this.currentInput=g;b.parentNode.appendChild(g);
if(this.events.onadd){var a=[];a.push(f);this.element.fire("rich:onadd",{entries:a})
}if(this.runUpload){this.upload()}},remove:function(a){a.clear();this.entries=this.entries.without(a)
},_selectEntryForUpload:function(){this.uploadIndex=-1;var a=this.entries.length;
for(var c=0;c<a;c++){var b=this.entries[c];if(b.state==L.READY||b.state==L.INITIALIZED||b.state==L.UPLOAD_CANCELED){this.uploadIndex=c;
return b}}return null},upload:function(){if(this.disabled){return}this.runUpload=true;
if(!this.activeEntry){var a=this._selectEntryForUpload();if(a){if(this.events.onupload){this.element.fire("rich:onupload",{entry:a})
}else{a.upload()}}}return false},stop:function(){if(this.disabled){return}this.runUpload=false;
if(this.activeEntry){this.activeEntry.stop()}return false},clear:function(c,b){if(this.disabled){return
}if(c){if(b||c.state==L.UPLOAD_SUCCESS||c.state==L.INITIALIZED){this.remove(c);if(this.events.onclear){this.element.fire("rich:onclear",{entry:c})
}}}else{var a=0;while(a<this.entries.length){var c=this.entries[a];if(c.state==L.UPLOAD_SUCCESS){this.remove(c)
}else{a++}}if(this.events.onclear){this.element.fire("rich:onclear",{})}}if(this.entries.length==0){this.setupAutoUpload()
}this.processButtons();return false},processButtons:function(){this.disableAddButton();
this.disableCleanButton();this.disableUploadButton()},cleanAllDisabled:function(){if(this.options.autoclear){return true
}var a=this.getFileEntriesSumByState(L.UPLOAD_SUCCESS);return(a==0)},uploadAllDisabled:function(){if(this.runUpload&&this.activeEntry){return false
}else{var a=this.getFileEntriesSumByState(L.READY,L.INITIALIZED,L.UPLOAD_CANCELED);
return(a==0)}},getFileEntriesSumByState:function(){var b={};var c=0;for(var a=0;a<arguments.length;
a++){b[arguments[a]]=true}for(var a=0;a<this.entries.length;a++){if(b[this.entries[a].state]){c++
}}return c},disableCleanButton:function(){var a=this.cleanAllDisabled();var b=O(this.id+":clean1");
var c=O(this.id+":clean2");if(a){G.hide(b.parentNode);return}else{G.show(b.parentNode)
}if(this.disabled){b.onclick=function(){return false}}else{b.onclick=function(){return this.clear()
}.bind(this)}this._updateClassNames(b,c,this.classes.CLEAN,this.classes.CLEAN_CONTENT)
},disableAddButton:function(){var b=((this.getFileEntriesSumByState(L.READY,L.INITIALIZED,L.UPLOAD_CANCELED)+this.uploadedCount+this.getFileEntriesSumByState(L.UPLOAD_IN_PROGRESS))>=this.maxFileBatchSize);
this.currentInput.disabled=b||this.disabled;var c=this.disabled;var a=O(this.id+":add1");
var d=O(this.id+":add2");if(b){this.disabled=true}this._updateClassNames(a,d,this.classes.ADD,this.classes.ADD_CONTENT);
this.disabled=c},disableUploadButton:function(){var a=this.uploadAllDisabled();var b=O(this.id+":upload1");
var c=O(this.id+":upload2");if(a){G.hide(b.parentNode)}else{G.show(b.parentNode)}if(this.disabled){b.onclick=function(){return false
}}else{if(!this.runUpload){b.onclick=function(){return this.upload()}.bind(this);
c.innerHTML=L.LABELS.upload}else{b.onclick=function(){return this.stop()}.bind(this);
c.innerHTML=L.LABELS.stop}}this._updateClassNames(b,c,(this.runUpload)?this.classes.STOP:this.classes.UPDATE,(this.runUpload)?this.classes.STOP_CONTENT:this.classes.UPDATE_CONTENT)
},_updateClassNames:function(b,c,a,d){if(this.disabled){b.className=a.DISABLED;c.className=d.DISABLED;
b.onmouseover=b.onmouseout=b.onmousedown=b.onmouseup=null}else{b.className=a.ENABLED;
c.className=d.ENABLED;b.onmouseover=function(){this.className="rich-fileupload-button-light rich-fileupload-font"
};b.onmouseout=function(){this.className="rich-fileupload-button rich-fileupload-font"
};b.onmousedown=function(){this.className="rich-fileupload-button-press rich-fileupload-font"
};b.onmouseup=function(){this.className="rich-fileupload-button rich-fileupload-font"
}}},disable:function(){this.disabled=true;this.items.className="rich-fileupload-list-overflow "+this.classes.UPLOAD_LIST.DISABLED;
for(var a=0;a<this.entries.length;a++){var b=this.entries[a];b.entryElement.rows[0].cells[0].className="rich-fileupload-font rich-fileupload-name rich-fileupload-table-td "+this.classes.FILE_ENTRY.DISABLED;
b.controlArea.firstChild.className="rich-fileupload-anc "+this.classes.FILE_ENTRY_CONTROL.DISABLED
}this.processButtons()},enable:function(){this.disabled=false;this.items.className="rich-fileupload-list-overflow "+this.classes.UPLOAD_LIST.ENABLED;
for(var a=0;a<this.entries.length;a++){var b=this.entries[a];b.entryElement.rows[0].cells[0].className="rich-fileupload-font rich-fileupload-name rich-fileupload-table-td "+this.classes.FILE_ENTRY.ENABLED;
b.controlArea.firstChild.className="rich-fileupload-anc "+this.classes.FILE_ENTRY_CONTROL.ENABLED
}this.processButtons()},_endUpload:function(){if(this.options.autoclear){this.clear(this.activeEntry)
}this.activeEntry=null},updateViewState:function(b){if(!b){return}var a=this.getForm();
var c=a["javax.faces.ViewState"];if(c){c.value=b}},_updateEntriesState:function(){var b=this.entries.length;
var e;var d;if(this.runUpload){e=L.INITIALIZED;d=L.READY}else{e=L.READY;d=L.INITIALIZED
}for(var c=0;c<b;c++){var a=this.entries[c];if(a.state==e){a.setState(d)}}},notifyStateChange:function(c,a){var b=c.state;
if(b==L.UPLOAD_SUCCESS||b==L.UPLOAD_SIZE_ERROR){if(b==L.UPLOAD_SIZE_ERROR){if(this.events.onsizerejected){this.element.fire("rich:onsizerejected",{entry:c})
}}if(b==L.UPLOAD_SUCCESS){this.uploadedCount++}this._endUpload();var c=this._selectEntryForUpload();
if(c){if(this.runUpload){c.upload()}}else{this.setupAutoUpload();if(this.events.onuploadcomplete){this.element.fire("rich:onuploadcomplete",{})
}this.resetFrame()}this._updateEntriesState()}else{if(b==L.UPLOAD_CANCELED||b==L.UPLOAD_TRANSFER_ERROR||b==L.UPLOAD_SERVER_ERROR){this._endUpload();
this.runUpload=false;this._updateEntriesState();if(b==L.UPLOAD_CANCELED){if(this.events.onuploadcanceled){this.element.fire("rich:onuploadcanceled",{entry:c})
}}else{if(this.events.onerror){this.element.fire("rich:onerror",{entry:c})}}}else{if(b==L.UPLOAD_IN_PROGRESS){this.activeEntry=c;
this._updateEntriesState()}}}this.processButtons()},getForm:function(){return this.form
},_getForm:function(){var a=this.element;while(a.tagName&&a.tagName.toLowerCase()!="form"){a=a.firstChild
}return a},submitForm:function(i){var e=this.getForm();if(!e){throw"No parent form found!"
}this.fillProgressBar();var l=!(i&&i instanceof L);var a=z.readAttribute(e,"target");
var k=z.readAttribute(e,"enctype");var c=z.readAttribute(e,"encoding");var f=z.readAttribute(e,"action");
try{if(!l){i.uid=Math.random().toString().substring(2);z.writeAttribute(e,"encoding","multipart/form-data");
z.writeAttribute(e,"enctype","multipart/form-data");z.writeAttribute(e,"action",this.actionUrl+(/\?/.test(this.actionUrl)?"&_richfaces_upload_uid":"?_richfaces_upload_uid")+"="+encodeURI(i.uid)+"&"+this.id+"="+this.id+"&_richfaces_upload_file_indicator=true&AJAXREQUEST="+(this.progressBar.options.containerId||J.VIEW_ROOT_ID));
z.writeAttribute(e,"target",this.id+"_iframe");var b=e.elements;var h=i.fileInput;
h.name=this.id+":file";h.disabled=false;var g=b.length;for(var d=0;d<g;d++){var j=b[d];
if(j!=h){if("file"==j.type){j._disabled=j.disabled;j.disabled=true}}}}else{this.beforeSubmit()
}if(!e.onsubmit||e.onsubmit()){if(!l){this.watcher=new M(this.iframe,function(m){this.finishProgressBar();
this.setState(m);if(this.uploadObject.events.onfileuploadcomplete){this.uploadObject.element.fire("rich:onfileuploadcomplete",{state:m})
}}.bind(i),function(m){this.updateViewState(m)}.bind(this))}S.JSFFormSubmit(null,e.id,null,this.parameters)
}if(!l){for(var d=0;d<g;d++){var j=b[d];if("file"==j.type){j.disabled=j._disabled;
j._disabled=undefined}}}else{this._enableEntries(true)}}finally{z.writeAttribute(e,"action",f);
z.writeAttribute(e,"encoding",c);z.writeAttribute(e,"enctype",k);if(l){this.currentInput.disabled=true
}else{z.writeAttribute(e,"target",a);this.executeFileSizeScript(i.uid)}}},_enableEntries:function(a){for(var c=0;
c<this.entries.length;c++){var b=this.entries[c];b.fileInput.name=(!a)?(this.id+":file"+c):"";
b.fileInput.disabled=a}},beforeSubmit:function(){var a=this.getForm();if(!a){throw"No parent form found!"
}z.writeAttribute(a,"encoding","multipart/form-data");z.writeAttribute(a,"enctype","multipart/form-data");
z.writeAttribute(a,"action",this.actionUrl+(/\?/.test(this.actionUrl)?"&_richfaces_upload_uid":"?_richfaces_upload_uid")+"=_richfaces_form_upload&"+this.id+"="+this.id+"&_richfaces_upload_file_indicator=true");
this.currentInput.disabled=true;this._enableEntries(false);return true}});return{getComponent:L.getComponent,FileUpload:A,FileUploadEntry:L}
});define("richfacesjs.comboboxlist",["prototypejs","richfacesjs","jquery","richfacesjs.comboboxutils"],function(p,q,l){var s=q.Richfaces,m=p.Prototype,t=p.$,r=p.Object,u=p.Element,v=p.Class,n=p.Event;
var o=s.ComboBoxList=v.create();o.prototype={selectFirstOnUpdate:true,listHeight:"200px",itemsText:[],showDelay:0,hideDelay:0,initialize:function(c,d,e,a,b){r.extend(this,a);
this.list=document.getElementById(c+"list");this.listParent=t(c+"listParent");this.listParentContainer=this.listParent.parentNode;
this.fieldElem=document.getElementById(c+b);if(this.onlistcall){this.listParent.observe("rich:onlistcall",this.onlistcall)
}if(this.onlistclose){this.listParent.observe("rich:onlistclose",this.onlistclose)
}this.filterNewValues=d;this.isList=false;this.defaultRowsAmount=15;this.selectedItem=null;
this.activeItem=null;this.classes=e;this.initDimensions();this.scrollElements=null;
this.eventOnScroll=this.eventOnScroll.bindAsEventListener(this)},initDimensions:function(){this.listParent.style.visibility="hidden";
this.listParent.style.display="";var b=this.listParent.childNodes[0].firstChild;try{this.LAYOUT_BORDER_V=s.getBorderWidth(b,"tb");
this.LAYOUT_BORDER_H=s.getBorderWidth(b,"lr");this.LAYOUT_PADDING_V=s.getPaddingWidth(b,"tb");
this.LAYOUT_PADDING_H=s.getPaddingWidth(b,"lr")}catch(a){}this.listParent.style.display="none";
this.listParent.style.visibility="visible"},createDefaultList:function(){var b=new Array();
for(var a=0;a<this.itemsText.length;a++){b.push(this.createItem(this.itemsText[a],this.classes.item.normal))
}this.createNewList(b)},getItems:function(){return this.list.childNodes},showWithDelay:function(){this.show()
},show:function(){var a=Position.cumulativeOffset(this.fieldElem);this.fieldDimensions={};
this.fieldDimensions.left=a[0];this.fieldDimensions.top=a[1];this.fieldDimensions.height=this.fieldElem.parentNode.offsetHeight;
this.listParent.style.visibility="hidden";this.listParent.style.display="";this.setSize();
this.listParent.style.display="none";this.listParent.style.visibility="visible";this.injectListToBody(this.listParent);
this.setPosition(this.fieldDimensions.top,this.fieldDimensions.left,this.fieldDimensions.height);
if(this.selectedItem){this.doSelectItem(this.findItemByDOMNode(this.selectedItem))
}var b=this.getItems();if(b.length!=0){this.listParent.style.display="";if(this.selectFirstOnUpdate){if(this.selectedItem){this.doActiveItem(this.selectedItem)
}else{this.doActiveItem(b[0])}}}this.listParent.fire("rich:onlistcall",{});s.removeScrollEventHandlers(this.scrollElements,this.eventOnScroll);
this.scrollElements=s.setupScrollEventHandlers(this.listParentContainer.parentNode,this.eventOnScroll)
},injectListToBody:function(a){if(!this.listInjected){var b=a.parentNode;var c=document.body.insertBefore(b.removeChild(a),null);
this.listInjected=true}},outjectListFromBody:function(b,a){if(this.listInjected){var c=b.appendChild(document.body.removeChild(a));
this.listInjected=false}},hideWithDelay:function(){this.hide();this.listParent.fire("rich:onlistclose",{})
},hide:function(){s.removeScrollEventHandlers(this.scrollElements,this.eventOnScroll);
this.outjectListFromBody(this.listParentContainer,this.listParent);this.resetState();
var a=this.listParent.parentNode;a.style.position="static";a.style.zIndex=0;u.hide(this.listParent)
},eventOnScroll:function(a){this.hideWithDelay()},visible:function(){return this.listParent.visible()
},setSize:function(){var b=this.listHeight;var a;var e;var d=this.getItems()[0];var f=0;
if(d){var c=d.offsetHeight;e=this.getItems().length;a=c*e;if(this.listHeight){if(parseInt(this.listHeight)>a){b=a
}}else{if(e<this.defaultRowsAmount){b=a}else{b=c*this.defaultRowsAmount}}if(m.Browser.IE){b=parseInt(b)+this.LAYOUT_BORDER_V+this.LAYOUT_PADDING_V
}b=parseInt(b)+"px";this.list.style.height=b;this.setWidth(this.listWidth)}},setWidth:function(c){var b=this.listParent.childNodes[0];
var d=this.listParent.parentNode;var a=parseInt(c)-s.getBorderWidth(b.firstChild,"lr")-s.getPaddingWidth(b.firstChild,"lr")+"px";
this.list.style.width=a},setPosition:function(i,g,e){var b=this.listParent.parentNode;
b.style.zIndex=2;var h=s.getDocumentHeight();var f=i+e;var d=parseInt(this.list.style.height);
if(this.list.parentNode){d+=s.getBorderWidth(this.list.parentNode,"tb")}var a=f;var c=e;
if(parseInt(d)>(h-f)){if(a>(h-f)){c=-parseInt(d)}}this.clonePosition(this.listParent,this.fieldElem,c)
},scrolling:function(f){var b;var e=this.list;var c=o.getElemXY(e).top;var d=e.scrollTop;
var g=o.getElemXY(this.activeItem).top;if((f.keyCode==n.KEY_UP)||(f.keyCode==33)){b=(g-d)-c;
if(b<0){e.scrollTop+=b}}else{if((f.keyCode==n.KEY_DOWN)||(f.keyCode==34)){var a=g+this.activeItem.offsetHeight;
var b=(a-d)-(c+e.clientHeight);if(b>0){e.scrollTop+=b}}}n.stop(f)},scrollingUpToItem:function(a){var c=this.list;
var b=(o.getElemXY(a).top-c.scrollTop)-o.getElemXY(c).top;c.scrollTop+=b},doActiveItem:function(a){if(this.activeItem){this.doNormalItem(this.activeItem)
}this.activeItem=a;this.changeItem(a,this.classes.item.selected)},doNormalItem:function(a){this.activeItem=null;
this.changeItem(a,this.classes.item.normal)},doSelectItem:function(a){this.selectedItem=a
},changeItem:function(a,b){a.className=b},moveActiveItem:function(c){var d=this.activeItem;
if(c.keyCode==n.KEY_UP){if(!this.activeItem){if(!this.selectFirstOnUpdate){var e=this.getItems();
if(e!=null&&e.length!=0){this.doActiveItem(e[e.length-1]);this.scrollingUpToItem(e[e.length-1])
}}return}var a=d.previousSibling;if(a){this.itemsRearrangement(d,a)}}else{if(c.keyCode==n.KEY_DOWN){if(!this.activeItem){if(!this.selectFirstOnUpdate){var e=this.getItems();
if(e!=null&&e.length!=0){this.doActiveItem(e[0]);this.scrollingUpToItem(e[0])}}return
}var b=d.nextSibling;if(b){this.itemsRearrangement(d,b)}}}this.scrolling(c)},itemsRearrangement:function(a,b){this.doActiveItem(b)
},resetState:function(){if(this.filterNewValues){var a=this.list.cloneNode(false);
try{this.listParent.childNodes[0].firstChild.replaceChild(a,this.list)}catch(b){}this.list=t(a.id)
}else{if(this.activeItem){this.doNormalItem(this.activeItem)}}this.activeItem=null;
this.isList=false},dataFilter:function(a){this.createNewList(this.getFilteredItems(a))
},getFilteredItems:function(c){var b=new Array();for(var a=0;a<this.itemsText.length;
a++){var d=this.itemsText[a];if(d.substr(0,c.length).toLowerCase()==c.toLowerCase()){b.push(this.createItem(d,this.classes.item.normal))
}}return b},findItemByDOMNode:function(b){var a=b.innerHTML.unescapeHTML();return this.findItemBySubstr(a)
},findItemBySubstr:function(c){var b=this.getItems();for(var a=0;a<b.length;a++){var d=b[a];
var e=d.innerHTML.unescapeHTML();if(e.substr(0,c.length).toLowerCase()==c.toLowerCase()){return d
}}},createNewList:function(b){if(this.selectedItem){var c=this.selectedItem}this.list.innerHTML=b.join("");
if(this.selectedItem){var a=this.findItemByDOMNode(c);if(a){this.doSelectItem(a)}}},createItem:function(c,b){var a=c.escapeHTML();
return'<span class="'+b+'">'+a+"</span>"},PX_REGEX:/px$/,parseToPx:function(a){var b=a.strip();
if(this.PX_REGEX.test(b)){try{return parseFloat(b.replace(this.PX_REGEX,""))}catch(c){}}return NaN
},clonePosition:function(b,g,d){var k=l(b);var i=l(g);var f=i.offset();var c=(k.css("display")=="none");
var a;if(c){a=k.css("visibility");k.css("visibility","hidden").css("display","")}var e=this.parseToPx(k.css("left"));
if(isNaN(e)){e=0;k.css("left","0px")}var j=this.parseToPx(k.css("top"));if(isNaN(j)){j=0;
k.css("top","0px")}var h=k.offset();if(c){k.css("display","none").css("visibility",a)
}k.css({left:(f.left-h.left+e)+"px",top:(f.top-h.top+j+d)+"px"})}};o.getElemXY=function(d){var b=d.offsetLeft;
var c=d.offsetTop;for(var a=d.offsetParent;a;a=a.offsetParent){b+=a.offsetLeft;c+=a.offsetTop
}return{left:b,top:c}};return{ComboBoxList:o}});define("richfacesjs.processeffect",["globals","eval.with","prototypejs","richfacesjs","jquery","scriptaculos.effect"],function(globals,ev,prototype,richfacesjs,$,eff){var window=globals.window,Richfaces=richfacesjs.Richfaces;
var processEffect=Richfaces.processEffect=function(params){new eff[params.type]($(params.targetId),params)
};var effectEventOnOut=Richfaces.effectEventOnOut=function(ename){return ename.substr(0,2)=="on"?ename.substr(2):ename
};var Effect=Richfaces.Effect={};Effect.create=function(options){if(!options){options={}
}var params=options.params||{};options.params=null;var attachObj;var targetObj;var targetId=options.targetId;
var attachId=options.attachId;if(options.attachObj){try{attachObj=eval(options.attachObj)
}catch(e){}if(typeof attachObj=="object"){attachId=attachObj}}if(options.targetObj){try{targetObj=eval(options.targetObj)
}catch(e){}if(typeof targetObj=="object"){targetId=targetObj}}if(!targetId){targetId=attachId
}if(!params.targetId){params.targetId=targetId}params.type=options.type;if(!options.event){with(window){window[options.name]=function(){return processEffect(Object.extend(this,arguments[0]||{}))
}.bind(params)}}else{var ename=effectEventOnOut(options.event||"");if(ename){var bindedFunction=function(event){return processEffect(this)
}.bindAsEventListener(params);Event.observe(attachId,ename,bindedFunction,params.useCapture||false)
}}};return{Effect:Effect,create:Effect.create}});define("simpletogglepanel",["log","prototypejs","richfaces","a4j.form"],function(w,r,y,q){var p=w.LOG,A=y.RichFaces,u=r.$,x=r.$H,s=r.$A,t=r.Object,B=r.Element,D=r.Class,C=q.findForm;
var z=D.create();z.prototype={initialize:function(a,c,b){this.panelId=a;this.panelId_head=a+"_header";
this.options=b;this.status=c;if(!this.status){this.status="true"}},toggleToState:function(a){var d=u(this.panelId+"_body");
var b=u(this.panelId+"_switch_on");var c=u(this.panelId+"_switch_off");if(this.status=="false"){if(this.invokeEvent("expand",a,"false",d)){B.show(d);
this.status="true";c.style.display="none";b.style.display=""}}else{if(this.invokeEvent("collapse",a,"true",d)){B.hide(d);
this.status="false";b.style.display="none";c.style.display=""}}u(this.panelId+"_input").value=this.status
},invokeEvent:function(g,d,b,f){var e=this.options["on"+g];var h;if(e){var c;if(d){c=d
}else{if(document.createEventObject){c=document.createEventObject()}else{if(document.createEvent){c=document.createEvent("Events");
c.initEvent(g,true,false)}}}c.rich={component:this};c.rich.value=b;try{h=e.call(f,c)
}catch(a){p.warn("Exception: "+a.Message+"\n[on"+g+"]")}}if(h!=false){h=true}return h
}};var v=D.create();v.panels=x(s({}));v.add=function(a){var b=new t();b[a.panelId]=a;
this.panels=this.panels.merge(b)};v.toggleOnServer=function(b,e){var f=C(u(e+"_header"));
if(!f||!f.appendChild){return}var c=this.panels.get(e);var d=u(e);if(c.status=="true"){if(c.invokeEvent("collapse",b,"true",d)){c.status="false"
}}else{if(c.invokeEvent("expand",b,"false",d)){c.status="true"}}var a={};a[e]=c.status;
q.JSFFormSubmit(null,f,null,a);return false};v.toggleOnClient=function(a,b){this.panels.get(b).toggleToState(a);
return false};v.toggleOnAjax=function(a,b){var c=u(b);var d=this.panels.get(b);if(d.status=="true"){var e=d.invokeEvent("collapse",a,"true",c);
B.hide(b+"_body");return e}else{var e=d.invokeEvent("expand",a,"false",c);B.show(b+"_body");
return e}};return{SimpleTogglePanel:z,SimpleTogglePanelManager:v}});define("richfacesjs.comboboxutils",["globals","prototypejs","richfacesjs"],function(s,n,o){var q=s.g,r=o.Richfaces,t=n.$,p=n.Object,u=n.Element,v=n.Class,m=n.Event;
var l={};r.defined=function(a){return(typeof(a)!="undefined")};l.execOnLoad=function(b,c,a){if(c()){b()
}else{q.setTimeout(function(){l.execOnLoad(b,c,a)},a)}};l.Condition={ElementPresent:function(a){return function(){var b=document.getElementById(a);
return b&&b.offsetHeight>0}}};r.getBody=function(){if(document.body){return document.body
}if(document.getElementsByTagName){var a=document.getElementsByTagName("BODY");if(a!=null&&a.length>0){return a[0]
}}return null};r.zero=function(a){return(!r.defined(a)||isNaN(a))?0:a};r.getDocumentHeight=function(){var a=0;
var b=jQuery(q);a=b.height()+b.scrollTop();return a};r.getScrollWidth=function(a){if(a.clientWidth!=0){return a.offsetWidth-a.clientWidth
}return 0};r.getBorderWidth=function(a,b){return r.getStyles(a,b,r.borders)};r.getPaddingWidth=function(a,b){return r.getStyles(a,b,r.paddings)
};r.getMarginWidth=function(a,b){return r.getStyles(a,b,r.margins)};r.getStyles=function(f,d,e){var c=0;
for(var g=0,b=d.length;g<b;g++){var a=parseInt(u.getStyle(f,e[d.charAt(g)]),10);if(!isNaN(a)){c+=a
}}return c};r.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};
r.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};
r.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};return{RichComboUtils:l}
});(function(b){define("rp.a4j.extra",["log","scriptaculos.effect","richfacesjs.suggestion","simpletogglepanel","richfacesjs.available","richfacesjs.utils","richfacesjs.panelbar"],function(d,a){b.Effect=a.Effect;
d.LOG.debug("a4j.extra js loaded")});require("rp.a4j.extra")})(window);