var it_Accordion=function(h,j){j=$extend({cssPrefix:null,separatorEnabled:true},j);var n=this;var g=[];var m=-1;var f,e,s,a;var p,o,k,b,t;var c;var l=true;var r=function(){it_ComponentUtils.init(n,h,j);p=new Element("div");p.setStyle=function(v,u){if(v=="zIndex"){s=u;d()}};o=new Fx.Tween(p,{property:"zIndex",duration:500,unit:null,transition:Fx.Transitions.Quad.easeOut,onComplete:function(){e=s=null}});b=new it_Timer(300,function(){n.openPanel(k.index)});t=new it_Timer(1000,function(){n.closePanel()})};this.addPanel=function(z,E){z=$(z);E=$extend({id:z.getProperty("id"),initialClosedHeight:20,separatorEnabled:true,triggerMode:"mouseOver",useScrollPane:false},E);var B=g.length;var A=null;if(B!=0&&j.separatorEnabled){A=new Element("div",{"class":j.cssPrefix.getClass(["Separator","Separator"+B]),styles:{position:"relative",width:n._width,fontSize:1}});A.inject(n.canvas);if(m==-1){m=A.getHeight();if(!(m>0)){throw new Error('The separator class must have the height property set, with class: "'+A.className+'"')}}}z.setWidth(n._width);var C=z.getHeight();var y;if(E.useScrollPane){var w=new Element("div",{styles:{width:n._width,height:C}});var x=new it_ScrollPane(w);x.setContent(z);x.forceScrollBarVisibility(false);y=w}else{z.setStyle("overflow","hidden");y=z}y.inject(n.canvas);if(!(C>0)){throw new Error("The panel Element must have its height set.")}var u={content:y,index:B,id:E.id,openHeight:C,initialClosedHeight:E.initialClosedHeight,scrollPane:x,separatorElement:A};g.push(u);if(u.id!=null){g[u.id]=u}if(j.triggerMode=="mouseOver"){y.addEvents({mouseover:function(){if(l){k=u;b.start();t.stop()}},mouseout:function(){if(l){k=null;b.stop();t.start()}}})}else{y.addEvent("click",function(){n.openPanel(u.id)})}f=[];a=n._height-(g.length-1)*m;var v=0;g.forEach(function(F){v+=F.initialClosedHeight});if(v>a){var D=a-v;g.forEach(function(F,G){if(G<g.length-1){var I=it_Utils.changeScale(0,v,F.initialClosedHeight,0,1);var H=(D*I).toInt();f.push(F.initialClosedHeight-H)}})}else{g.forEach(function(F,G){if(G<g.length-1){f.push(F.initialClosedHeight)}})}q(f);d();return this};this.openPanel=function(A){b.stop();t.stop();var v=g[A];if(v==c){return}var z=c;c=v;var u=c.openHeight;var x=f[c.index];if(x>u){u=x}else{u=Math.min(u,a)}e=[];var w=a-u;var y=0;f.forEach(function(B,C){if(C!=c.index){y+=B}});g.forEach(function(C,D){if(D<g.length-1){if(C==c){e.push(u)}else{var E=it_Utils.changeScale(0,y,f[D],0,1);var B=(w*E).toInt();e.push(B)}if(C.scrollPane){C.scrollPane.forceScrollBarVisibility(C==c?undefined:false)}}});q(e);o.start(0,100);if(z!=null){n.fireEvent("panelClosed",[z.index,z.id])}n.fireEvent("panelOpened",[v.index,v.id])};this.closePanel=function(){b.stop();t.stop();if(c==null){return}if(c.scrollPane){c.scrollPane.forceScrollBarVisibility(false)}e=f;o.start(0,100);n.fireEvent("panelClosed",[c.index,c.id]);c=null};var q=function(w){var v=0;w.forEach(function(x){v+=x});var u=a-v;w.push(u);return u};var d=function(){var u=[];if(e!=null){g.forEach(function(v,w){if(w<g.length-1){var x=v.content.getHeight();u[w]=Math.floor(it_Utils.changeScale(0,100,s,x,e[w])+0.5)}q(u)})}else{u=f}g.forEach(function(v,w){v.content.setHeight(u[w])})};this.setEventsEnabled=function(u){l=u};r()};var it_PropertiesAccordion=function(e,d){d=$extend({cssPrefix:"propertiesAccordion"},d);var c=this;var a;var b;var f=true;var g=function(){it_ComponentUtils.init(c,e,d);var k=d.cssPrefix.createChild("ButtonBar");var l=k.getWidth(true);var h=new Element("div",{"class":k.getClass()}).inject(c.canvas);var j=new Element("div",{"class":d.cssPrefix.getClass(),styles:{width:c._width-l}}).inject(c.canvas);it_ComponentUtils.horizontalLayout(c.canvas,{mode:"resizeLastChild"});b=new it_AutoButtonBar(h,{cssPrefix:k,orientation:"vertical",beginDivEnabled:false,endDivEnabled:false});a=new it_Accordion(j,{cssPrefix:d.cssPrefix});a.addEvent("panelOpened",function(n,p){var o=b.getButton(n);o.fade(true,false);c.fireEvent("panelOpened",[n,p])});a.addEvent("panelClosed",function(n,p){var o=b.getButton(n);o.fade(false,false);c.fireEvent("panelClosed",[n,p])});var m=new it_Timer(1000,function(){if(f){a.closePanel()}else{m.start()}});c.canvas.addEvent("mouseover",function(){m.stop()});c.canvas.addEvent("mouseout",function(){m.start()})};this.addPanel=function(k,j){k=$(k);j=$extend({buttonText:null},j);var l=b.getButtonCount();var h=b.addButton({cssPrefix:d.cssPrefix.createChild("Button"),text:j.buttonText});h.addEvent("activation",function(){a.openPanel(l)});if(j.initialClosedHeight==null){j.initialClosedHeight=h.canvas.getHeight()}a.addPanel(k,j);return this};this.end=function(){b.end()};this.setEventsEnabled=function(h){f=h;a.setEventsEnabled(h)};this.getAccordion=function(){return a};g()};function it_AutoComplete(a,n){n=$extend({queryUrl:null,queryParameter:"query",queryFunction:null,charactersPreventingQuery:"[],",closeTimeOut:3000,width:250},n);var m=this;a=$(a);var c=false;var b=3;var d=null;if((n.queryUrl==null||n.queryParameter==null)&&n.queryFunction==null){throw new Error("Query source not found. You must set the queryUrl and queryParameter options, or the queryFunction option")}var e;var h=null;var j;var l=function(){n.triggerElement=a;j=new it_PopupMenu(n);j.addEvents({closed:function(){e.stop();if(h!=null){h.cancel()}},lineSelected:function(p,o){a.value=p}});e=new it_Timer(200,function(){g()},{autoCancel:true});a.setProperty("autocomplete","off");a.addEvent(it_IE?"keydown":"keypress",function(o){o=new Event(o);if(!o.shift){switch(o.key){case"enter":if(j.isOpen()){if(j.getSelectionIndex()!=-1){m.lineSelected()}else{j.close()}o.stop()}return;case"up":case"down":if(a.value!=d){g()}else{if(d==null){break}else{if(!j.isOpen()){j.open()}else{if(o.key=="up"){j.selectPreviousLine()}else{j.selectNextLine()}}}}o.stop();return;case"esc":j.close();return}}}).addEvent("keyup",function(o){o=new Event(o);if(o.key!="enter"&&o.key!="esc"){e.start()}}).addEvent("mousedown",function(o){if(c){g()}}).addEvent("focus",function(){c=true}).addEvent("blur",function(){c=false;if(!j.isMousePressedOnSlider()){j.close()}});if(n.queryFunction==null){h=new it_AjaxService(n.queryUrl,{data:{cmd:"suggest"},autoCancel:true,onComplete:function(o){k(o)}})}};var g=function(){if(!c||a.value.length<b){j.close()}else{if(a.value==d){j.open()}else{valid=false;f()}}};var f=function(){d=a.value;if(n.charactersPreventingQuery!=null){for(var o=0;o<n.charactersPreventingQuery.length;o++){var q=n.charactersPreventingQuery.charAt(o);if(d.contains(q)){k([]);return}}}if(h!=null){var p=new Object();p[n.queryParameter]=d;h.send(p)}else{k(n.queryFunction(d))}};var k=function(o){n.popupMenuBuilder.setData(o);if(!c){return}j.popupMenuChanged()};this.setSelectedIndex=function(o){j.setSelectedIndex(o)};this.lineSelected=function(){j.lineSelected()};l()}var it_AutoButton=function(b,c){c=$extend({name:null,activationTime:1000,fadeTime:500,cssPrefix:"Button",layerCreationFunc:null,text:null,createForeground:false,opacityChanged:$empty},c);var j=this;var s=null;var r,a;var t;var h;var p;var f=false;var l="test";var o=function(){b=it_ComponentUtils.init(j,b,c);r=$splat(e(false));r.forEach(function(u){u.inject(b)});a=$splat(e(true));a.forEach(function(u){u.inject(b)});s=new Element("div",{"class":c.cssPrefix.getClass("Event"),styles:{opacity:0.01,backgroundColor:"#ffffff"},events:{click:d}}).inject(b);if(c.activationTime>0){s.addEvents({mouseover:k,mouseout:g})}t=new Fx({duration:c.activationTime,transition:Fx.Transitions.linear,onComplete:m});h=new Fx({duration:c.fadeTime,transition:Fx.Transitions.linear});t.set=h.set=q;j.doLayout()};var q=function(u){for(var v=0;v<a.length;v++){r[v].set("opacity",1-u)}for(var v=0;v<a.length;v++){a[v].set("opacity",u);c.opacityChanged(1-u,p)}};var e=function(x){if(c.layerCreationFunc){return c.layerCreationFunc(x,j,c)}var z=x?"Off":"On";var w=x?c.backgroundColorOff:c.backgroundColorOn;var y=[];var u=new Element("div",{"class":c.cssPrefix.getClass(z)});y.push(u);if(c.createForeground){var v=new Element("div",{"class":c.cssPrefix.getClass("Overlay"+z)});y.push(v)}if(c.text!=null){new Element("span",{html:"&nbsp;"+c.text}).inject(u)}if(w!=null){u.setStyle("backgroundColor",w)}return y};this.doLayout=function(){it_ComponentUtils.allChildrenAbsoluteAllOverParent(j.canvas)};var m=function(){if(l!=null){l()}};this.fade=function(u,v){if(f!=u){n(u,v);if(u){p=false;h.start(1,0)}else{p=true;h.start(0,1)}}};this.getState=function(){return f};this.getEventElement=function(){return s};this.setState=function(v){var u=v?0:1;p=null;q(u);f=v};var k=function(){if(h.timer){return}t.pause();if(!f){t.options.duration=c.activationTime;p=false;t.start(1,0);l=function(){n(true,true)}}};var g=function(){if(!f){t.pause();t.options.duration=200;p=true;t.start(a[0].get("opacity"),1);l=null}};var d=function(){if(h.timer){return}t.pause();if(!f){j.setState(true);n(true,true)}};var n=function(u,v){f=u;if(v==null||v){if(f){j.fireEvent("activation",c.name)}}};o()};var it_AutoButtonBar=function(b,j){j=$extend({cssPrefix:"ButtonBar",orientation:"vertical",separatorEnabled:true,beginDivEnabled:true,endDivEnabled:true,animatedOverlays:false},j);j.orientation=j.orientation.toLowerCase();var h=this;var c;var e;var d;var f=[];var g=function(){b=it_ComponentUtils.init(h,b,j);h.invalidationEnabled=false;var k=it_ComponentUtils.createAbsoluteDiv(j.cssPrefix.getClass("Content"),h.canvas);c=it_ComponentUtils.createAbsoluteDiv(null,k);it_ComponentUtils.absoluteAllOverParent(k);it_ComponentUtils.absoluteAllOverParent(c);e=j.orientation=="vertical"?"height":"width";d=j.orientation=="vertical"?it_ComponentUtils.verticalLayout:it_ComponentUtils.horizontalLayout;if(j.beginDivEnabled){var l=j.cssPrefix.createChild("Begin");if(a(l)){new Element("div",{"class":l.getClass()}).inject(c)}}};this.doLayout=function(){it_ComponentUtils.allChildrenAbsoluteAllOverParent(b);it_ComponentUtils.absoluteAllOverParent(c);d(c,{mode:"leaveEmptySpace"})};var a=function(k){return k.getNumericStyle(e)!=null};this.addButton=function(p){p=p||{};var l=f.length;if(p.cssPrefix===undefined){p.cssPrefix=j.cssPrefix.createChild("Button")}if(p.separatorCssPrefix===undefined){p.separatorCssPrefix=j.cssPrefix.createChild("Separator")}var v=["",""+l];p=$merge(p,{cssPrefix:p.cssPrefix.createChild(v),separatorCssPrefix:p.separatorCssPrefix.createChild(v)});if(l>0&&j.separatorEnabled){if(a(p.separatorCssPrefix)){new Element("div",{"class":p.separatorCssPrefix.getClass(),styles:{position:"relative",fontSize:1}}).inject(c)}}if(j.animatedOverlays){var n=it_ComponentUtils.createAbsoluteDiv(p.cssPrefix.getClass(["BarOverlay","BarOverlay100"]),b).setStyle("visibility","hidden");var u=[];for(var r=0;r<4;r++){var q=Math.pow(2,r)*10;var t=it_ComponentUtils.createAbsoluteDiv(p.cssPrefix.getClass(["BarOverlay","BarOverlay"+q]),b).setStyle("visibility","hidden");u.push(t)}var m=0;p.opacityChanged=function(w,y){var x=Math.round(w*10);if(x!=m){m=x;if(x===10){u.forEach(function(A){A.style.visibility="hidden"});n.style.visibility="visible"}else{var z=x.toString(2);u.forEach(function(B,A){var C=z.charAt(z.length-1-A)==="1";B.style.visibility=C?"visible":"hidden"});n.style.visibility="hidden"}}}}var k=it_ComponentUtils.createAbsoluteDiv(p.cssPrefix.getClass(["",p.name]),c);var o=j.orientation==="vertical"?"width":"height";k.setStyle(o,b.getStyle(o));var s=new it_AutoButton(k,p);s.addEvent("activation",function(){f.map(function(x,w){if(w===l){return null}else{if(w===l-1){return"BottomRightShadow"}else{if(w===l+1){return"TopRightShadow"}else{return"RightShadow"}}}});h.setStateOfAll(false,l)});f.push(s);return s};this.addFiller=function(n){var m;if(!n||!n.cssPrefix){m=j.cssPrefix.getClass("Button")}else{m=n.cssPrefix.getClass()}var l=it_ComponentUtils.createAbsoluteDiv(m,c);var k=j.orientation==="vertical"?"width":"height";l.setStyle(k,b.getStyle(k))};this.end=function(){var l=[];f.forEach(function(n){l.push(n.getEventElement())});var k=it_ComponentUtils.createAbsoluteDiv(j.cssPrefix.getClass("Overlay"),b);new it_Overlay(k,l);if(j.endDivEnabled){var m=j.cssPrefix.createChild("End");if(a(m)){new Element("div",{"class":m.getClass()}).inject(h.canvas);h.doLayout()}}this.invalidationEnabled=true;this.doLayout()};this.setStateOfAll=function(l,k){f.forEach(function(n,m){if(k===undefined||m!=k){n.fade(l,false)}})};this.getButtonCount=function(){return f.length};this.getButton=function(k){return f[k]};g()};var it_CheckBoxGroup=function(a,r){r=$extend({cssPrefix:"checkBoxGroup",columnCount:2,useScrollPane:true},r);var q=this;var k,b;var l,m,c;var h,o;var p=function(){a=it_ComponentUtils.init(q,a,r);if(r.allItem||r.noneItem){k=new Element("div",{"class":r.cssPrefix.getClass("Header")}).inject(a);var u;if(r.allItem){l=g(r.allItem,false);l.element.setWidth(r.noneItem?a.getWidth()/2:a.getWidth());l.element.inject(k);u=l.element.getHeight()}if(r.noneItem){m=g(r.noneItem,false);m.element.setWidth(r.allItem?a.getWidth()/2:a.getWidth());m.element.inject(k);if(u==null){u=m.element.getHeight()}}k.setHeight(u);it_ComponentUtils.horizontalLayout(k,{mode:"resizeContainer"});k.setWidth(k.getWidth()+1);it_LayoutUtils.centerHorizontally(k)}b=new Element("div",{"class":r.cssPrefix.getClass("Body")}).inject(a);c=[];r.data.forEach(function(x){var w=g(x,true);w.element.inject(b);c.push(w)});it_ComponentUtils.verticalLayout(a);it_LayoutUtils.columnLayout(b,{columnCount:r.columnCount,mode:"resizeContainer"});if(r.useScrollPane){var v=new Element("div",{styles:{width:b.getWidth(),height:b.getHeight()}});var t=new it_ScrollPane(v);b.dispose();t.setContent(b);v.inject(a)}var s=b.getHeight();if(k){s+=k.getHeight()}a.setHeight(s)};var g=function(s,t){return new e(s,t)};this.doLayout=function(){if(r.useScrollPane){it_ComponentUtils.verticalLayout(a,{mode:"resizeLastChild"})}it_LayoutUtils.columnLayout(b,{columnCount:r.columnCount});it_Utils.forEach([l,m,c],function(s){s.doLayout()})};var e=function(s,w){this.itemData=s;var u=this;var x=false;var t=false;var v;this.element=undefined;var y=function(){var A=w?"Item":["Item","HeaderItem"];var C=new Element("div",{"class":r.cssPrefix.getClass(A)});u.element=C;var z=new Element("div").inject(C);v=new it_Checkbox(z,{cssPrefix:["stdCheckBox",r.cssPrefix.getClassArray("CheckBox")],events:{stateChanged:function(){f(u)}}});var B=new Element("div",{overflow:"ellipsis",text:s[1]}).inject(C);if(w){it_PopupUtils.link("Uniquement "+s[1],B,{mode:"info"});B.addEvent("click",function(){n(u)})}else{B.addEvent("click",function(){u.setChecked(!u.isChecked());f(u)})}};this.doLayout=function(){var z={alignment:"center",gap:5};it_ComponentUtils.horizontalLayout(this.element,z)};this.isChecked=function(){return v.getStateBoolean()};this.setChecked=function(z){v.setState(z,false);t=false};this.setSingleState=function(z){t=z};this.isSingleState=function(){return t};this.saveState=function(){x=this.isChecked()};this.restoreState=function(){this.setChecked(x);this.setSingleState(false)};y()};var n=function(s){if(s.isSingleState()){j()}else{d();h=o=false;if(l){l.setChecked(false)}if(m){m.setChecked(false)}c.forEach(function(t){t.setChecked(t===s);if(t===s){t.setSingleState(true)}})}q.fireEvent("modified")};var f=function(s){if(s===l){if(s.isChecked()){d();h=true;o=false;if(m){m.setChecked(false)}c.forEach(function(t){t.setChecked(true)})}else{j()}}else{if(s===m){if(s.isChecked()){d();o=true;h=false;if(l){l.setChecked(false)}c.forEach(function(t){t.setChecked(false)})}else{j()}}}h=true;o=true;c.every(function(t){if(t.isChecked()){o=false}else{h=false}return h||o});if(l){l.setChecked(h)}if(m){m.setChecked(o)}q.fireEvent("modified")};var d=function(){c.forEach(function(s){s.saveState()})};var j=function(){c.forEach(function(s){s.restoreState()})};this.getState=function(){var t=[];var s=[];c.forEach(function(u){(u.isChecked()?t:s).push(u.itemData)});return{all:h,none:o,checked:t,unchecked:s}};p()};var it_ColorPickerSingleton=function(s){s=$extend({imgDir:it_basePath+"img/components/colorPicker"},s);if(!it_StringUtils.endsWith(s.imgDir,"/")){s.imgDir=s.imgDir+"/"}var x;var D;var k;var a;var c;var h;var z,p,u,y,B,l,L,I,d,v;var e;var f;var w;var J,O,P;var j=-1;var N=-1;var o=-1;var A;var M=function(){var Q="<style>#pickerPanel {	width: 333px;	height: 199px;	FONT: bold 10px Arial, Helvetica, sans-serif;	color: #333;	line-height: 14px;	margin: 0;	BORDER: 1px solid #000000;	VISIBILITY: hidden;}/* slider */.dragPanel {	position: relative;	background-color: #efeeed;	margin: 4px;	width: 260px;	height: 180px;}#pickervaldiv input, #pickerButtons input {	font-size: .85em;	BORDER: 1px solid #000000;}#pickerButtons input {	BORDER-LEFT-COLOR:#999999;	BORDER-TOP-COLOR:#999999;}.thumb {	cursor:default;	width:18px;	height:18px;	z-index: 9;	position:absolute;}.bg {	position:absolute;	left:10px;	height:18px;	width:146px;	border: 0px solid #aaaaaa;}.bg span, .bg p {	cursor:default;	position: relative;	font-size: 2px;	overflow: hidden;	color: #aaaaaa;	top: 4px;	height: 10px;	width: 4px;	display: block;	float:left;}.bg span {	border-top:1px solid #cccccc;	border-bottom:1px solid #cccccc;}.bg .lb {	border-left:1px solid #cccccc;}.bg .rb {	border-right:1px solid #cccccc;}#valdiv {	position:absolute;	top: 100px;	left:10px;}#rBG {	top:30px;}#gBG {	top:50px;}#bBG {	top:70px;}#rgbSwatch {	position:absolute;	left:160px;	top:34px;	height:50px;	width:50px;	border:1px solid #aaaaaa;}#rgbPanel {	width: 360px;	height: 240px;}/* picker */#hueThumb {	cursor:default;	width:28px;	height:14px;	z-index: 9;	position:absolute;	left: -5px;}#hueBg {	position:absolute;	left:198px;	height:198px;	width:23px;	background-repeat: no-repeat;}#pickerDiv {	position:absolute;	left:3px;	height:187px;	width:188px;	/*	background-repeat: no-repeat;	*/	top:2px;}#selector {	cursor:default;	width:11px;	height:11px;	z-index: 9;	position:absolute;}#pickerSwatch, #pickerWitness {	position:absolute;	right:8px;	top:8px;	height:30px;	width:99px;	border:1px solid #000000;}#pickerSwatch {	BORDER-BOTTOM: 0px;}#pickerWitness {	BORDER-TOP: 0px;	top:38px;}#pickervaldiv, #pickerButtons {	position:absolute;	top: 80px;	right: 8px;	text-align:right;	LINE-HEIGHT: 20px;}#pickerButtons {	top: 171px;}.pickerButton {	WIDTH: 49px;	CURSOR: pointer;}</style>";document.write(Q);var g='<div id="pickerDiv">	<div id="selector"></div></div><div id="hueBg">	<div id="hueThumb"></div></div><div id="pickervaldiv">	<form id="pickerform" name="pickerform" onsubmit="return pickerUpdate()">	<span title="Rouge"     >R:</span> <input name="pickerrval" id="pickerrval" type="text"/>	<span title="Tonalité"  >H:</span> <input name="pickerhval" id="pickerhval" type="text"/><br/>	<span title="Vert"      >G:</span> <input name="pickergval" id="pickergval" type="text"/>	<span title="Saturation">S:</span> <input name="pickergsal" id="pickersval" type="text"/><br/>	<span title="Bleu"      >B:</span> <input name="pickerbval" id="pickerbval" type="text"/>	<span title="Luminosité">V:</span> <input name="pickervval" id="pickervval" type="text"/><br/>	# <input name="pickerhexval" id="pickerhexval" type="text" value="0" size="6" maxlength="6"/>	</form></div><div id="pickerButtons">	<input type="button" id="pickerOkButton" value="Ok" class="pickerButton"/><input type="button" id="pickerCancelButton" value="Annuler" class="pickerButton"/></div>	<div id="pickerSwatch">&nbsp;</div>	<div id="pickerWitness">&nbsp;</div></div>';new Element("div",{id:"pickerPanel","class":"dragPanel",styles:{zIndex:10000,position:"absolute",top:100,left:100,visibility:"hidden"}}).inject(document.body,"top").innerHTML=g;var T=function(){q("hsv",true)};var S=function(){q("rgb",true)};var r={value:0,size:3,maxlength:3};z=$("pickerWitness");p=$("pickerhexval").addEvent("keyup",function(){q("hex",true)});u=$("pickerPanel");y=$("pickerSwatch");B=$("pickerhval").addEvent("keyup",T).setProperties(r);l=$("pickersval").addEvent("keyup",T).setProperties(r);L=$("pickervval").addEvent("keyup",T).setProperties(r);I=$("pickerrval").addEvent("keyup",S).setProperties(r);d=$("pickergval").addEvent("keyup",S).setProperties(r);v=$("pickerbval").addEvent("keyup",S).setProperties(r);$("pickerOkButton").addEvent("click",function(){K(true)});$("pickerCancelButton").addEvent("click",function(){K(false)});it_CssUtils.setBackground("hueThumb",s.imgDir+"hline.png");it_CssUtils.setBackground("pickerDiv",s.imgDir+"pickerbg.png");it_CssUtils.setBackground("selector",s.imgDir+"select.gif");it_CssUtils.setBackground("hueBg",s.imgDir+"hue.png");it_CssUtils.setBackground("pickerDiv",s.imgDir+"pickerbg.png");e=$("hueThumb");e.setStyle("left",-5);var b=false;new Drag(e,{limit:{x:[-5,-5],y:[0,180]},onStart:function(){b=true},onComplete:function(){setTimeout(function(){b=false},200)},onDrag:function(){q("hueSlider",true)}});var R=$("hueBg");R.addEvent("click",function(V){if(!b){V=new Event(V);var W=V.page.y-R.getTop()-10;W=W.limit(0,180);new Fx.Tween(e,{property:"top",duration:500,transition:Fx.Transitions.Quad.easeOut,onComplete:function(){q("hueSlider",true)}}).start(W)}});w=$("selector");var U=false;new Drag(w,{limit:{x:[0+C,180+C],y:[0+E,180+E]},onStart:function(){U=true},onComplete:function(){setTimeout(function(){U=false},200)},onDrag:function(){q("pickerRegion",true)}});f=$("pickerDiv");f.addEvent("click",function(W){if(!U){W=new Event(W);var V=W.page.x-f.getLeft()-6;var X=W.page.y-f.getTop()-6;new Fx.Morph(w,{duration:500,transition:Fx.Transitions.Quad.easeOut,onComplete:function(){q("pickerRegion",true)}}).start({left:V,top:X})}})};var C=1;var E=1;var m=function(){return{x:(w.getStyle("left").toInt()-C).limit(0,180),y:(w.getStyle("top").toInt()-E).limit(0,180)}};var t=function(b,g){b=b.limit(0,180);g=g.limit(0,180);w.setStyle("left",b+C);w.setStyle("top",g+E)};this.show=function(b,Q,S,r,T,R){x=b;D=Q;A=x.value;if(A==""){A="FFFFFF"}z.style.backgroundColor="#"+A;D.style.backgroundColor="#"+A;p.value=A;a=r;c=T;h=R;k=S;if(it_IE&&k){for(var g=0;g<k.length;g++){k[g].set("opacity",0)}}it_PositionUtils.calculateAndSetPos(D,u,{anchor:"trigger",alignmentX:"left"});u.style.visibility="visible";q("hex")};var K=function(r){if(r&&!x.disabled){var g=p.value;D.style.backgroundColor="#"+g;x.value=g;if(a!=null){a(g)}}else{if(c!=null){c(A)}}u.style.visibility="hidden";if(it_IE&&k){for(var b=0;b<k.length;b++){$(k[b]).set("opacity",1)}}x=null;D=null;k=null;a=null;h=null;A=null};var F=function(T,S,R,Q){T.style.backgroundColor="rgb("+S+", "+R+", "+Q+")"};var H=function(r,g){var b=g.value;if(b>r){g.value=r}if(b<0){g.value=0}};var q=function(Q,T){if(Q=="hueSlider"){j=(180-e.getStyle("top").toInt())/180;if(j==1){j=0}n()}else{if(Q=="pickerRegion"){var r=m();N=r.x/180;o=(180-r.y)/180;n()}else{if(Q=="hsv"){H(360,B);H(100,l);H(100,L);j=B.value/360;N=l.value/100;o=L.value/100;n()}else{if(Q=="rgb"){H(255,I);H(255,d);H(255,v);J=I.value;O=d.value;P=v.value;G()}else{if(Q=="hex"){var S=p.value;if(S.length<6){return}var g=it_ColorUtils.hex2rgb(S);J=g[0];O=g[1];P=g[2];G()}}}}}if(Q!="rbg"){I.value=J;d.value=O;v.value=P}if(Q!="hex"){p.value=it_ColorUtils.rgb2hex(J,O,P)}F(y,J,O,P);if(Q!="hsv"){B.value=(j*360).toInt();l.value=(N*100).toInt();L.value=(o*100).toInt()}if(Q!="hueSlider"){var R=(180-(180*j)).toInt();if(R>=180){R=0}e.setStyle("top",R)}if(Q!="pickerRegion"){var b=it_ColorUtils.hsvToRgb(j,1,1);F(f,b[0],b[1],b[2]);t(N*180,180-(o*180));t(N*180,180-(o*180))}if(T&&h!=null){S=it_ColorUtils.rgb2hex(J,O,P);h(S)}};var G=function(){var b=it_ColorUtils.rgbToHsv(J,O,P);j=b[0];N=b[1];o=b[2]};var n=function(){var b=it_ColorUtils.hsvToRgb(j,N,o);J=b[0];O=b[1];P=b[2]};M()};var it_ColorPicker=function(c,d,a){if(window.it_colorPickerSingleton==null){window.it_colorPickerSingleton=new it_ColorPickerSingleton(a)}c=$(c);d=$(d);a=a||{};if(a.elementsToHide!=null){a.elementsToHide=it_Utils.ensureDomArray(a.elementsToHide)}var b=function(f){c.setStyle("backgroundColor","");a.okListener(f)};d.addEvent("click",function(){if(!c.disabled){it_colorPickerSingleton.show(c,d,a.elementsToHide,b,a.cancelListener,a.earlyListener)}});var e=function(){try{if(it_ColorUtils.isColor(c.value)){d.setStyle("backgroundColor","#"+c.value);c.setStyle("backgroundColor","");return true}}catch(f){console.log("input.value isn't valid: '"+c.value+"'")}return false};c.addEvents({keyup:function(){if(e()&&a.okListener){a.okListener(c.value)}},change:function(){if(!it_ColorUtils.isColor(c.value)){c.setStyle("backgroundColor","#FFDDCF")}}});e()};var it_Combo=function(d,c){c=$extend({popupMenuBuilder:null,wrap9Prefix:"combo"},c);if(c.popupMenuBuilder==null){throw new Error("options.popupMenuBuilder is missing")}var b=this;var a;var e;var f=function(){it_ComponentUtils.init(b,d,c);var g=new Element("div",{overflow:hidden}).inject(b.canvas);it_ComponentUtils.absoluteAllOverParent(g);a=c.content.getStyle("height");e=this._height};f()};if(!window.it_ComponentUtils){(function(){var a=function(){this.init=function(k,j,h){j=this.initWithoutLayout(k,j,h);this.initLayout(k,h.bufferResize,false);return j};this.initWithoutLayout=function(m,l,k){if(k!=null&&k.cssPrefix!==undefined){k.cssPrefix=it_CssUtils.toCssChain(k.cssPrefix)}k=$extend({bufferResize:false,checkWidth:true,checkHeight:true},k);l=$(l);if(!l){it_Utils.throwError("Canvas not found")}m.canvas=l;l.component=m;m._width=l._width;m._height=l._height;m._left=l._left;m._top=l._top;if(k.width!=null){l.setWidth(k.width)}else{var h=l.getWidth();if(h<=0&&k.defaultWidth>0){l.setWidth(k.defaultWidth)}else{if(!(m._width>0)){m._width=h}}}if(k.checkWidth&&!(m._width>0)){it_Utils.throwError('Missing width style in canvas with className: "'+l.className+'"',l)}if(k.height!=null){l.setHeight(k.height)}else{var j=l.getHeight();if(j<=0&&k.defaultHeight>0){l.setHeight(k.defaultHeight)}else{if(m._height<=0){m._height=j}}}if(k.checkHeight&&!(m._height>0)){it_Utils.throwError('Missing height style in canvas with className: "'+l.className+'"',l)}if(l.getStyle("position")=="static"){l.setStyle("position","relative")}this.addEventMethods(m,k);return l};this.addEventMethods=function(j,h){var k=new Events();j.addEvent=function(l,m){k.addEvent(l,m);return j};j.addEvents=function(l){k.addEvents(l);return j};j.fireEvent=function(l,n,m){k.fireEvent(l,n,m);return j};if(h!=null&&h.events!=null){j.addEvents(h.events)}};this.initLayout=function(k,l,j){if(k.doLayout){if(l){var h=new it_Timer(50,k.doLayout)}var m=function(){if(k.invalidationEnabled){l?h.start():k.doLayout()}};k.canvas.addEvent("resize",m);k.invalidationEnabled=true;k.invalidate=m;if(j===undefined||j){k.doLayout()}else{}}};this.verticalLayout=function(k,u){u=u||{};var p=u.mode!=null?u.mode:"leaveEmptySpace";var r=u.alignment!=null?u.alignment:"fill";var s=u.gap!=null?u.gap:0;if(k.getStyle("position")=="static"){k.setStyle("position","relative")}var l=k.getWidth();var j=0;var n=it_Utils.getChildren(k,"div");var o=n.length;for(var q=0;q<o;q++){var m=n[q];m.setStyle("position","absolute");if(r=="none"){}else{if(r=="fill"){m.setStyle("left","0");m.setWidth(l)}else{if(r=="left"){m.setStyle("left","0")}else{if(r=="center"){m.setStyle("left",(l-m.getWidth())/2)}else{if(r=="right"){m.setStyle("left",l-m.getWidth())}else{it_Utils.throwError("Unknown alignment: '"+r,k)}}}}}m.setStyle("top",j);if(q!=n.length-1||p=="resizeContainer"){var h=it_CssUtils.getHeightWithMargin(m);if(isNaN(h)){it_Utils.throwError("Missing height with the child at the index "+q+" of the container '"+k+"'",m)}j+=h;if(q!=n.length-1){j+=s}}else{if(q==n.length-1&&p=="resizeLastChild"){var t=k.getHeight();m.setHeight(Math.max(0,t-j))}}}if(p=="resizeContainer"){k.setHeight(j)}};this.horizontalLayout=function(j,u){u=u||{};var n=u.mode!=null?u.mode:"leaveEmptySpace";var q=u.alignment!=null?u.alignment:"fill";var s=u.gap!=null?u.gap:0;if(j.getStyle("position")=="static"){j.setStyle("position","relative")}var t=j.getHeight();var h=0;var l=it_Utils.getChildren(j,"div");var m=l.length;for(var o=0;o<m;o++){var k=l[o];k.setStyle("position","absolute");if(q=="none"){}else{if(q=="fill"){k.setStyle("top","0");k.setHeight(t)}else{if(q=="top"){k.setStyle("top","0")}else{if(q=="center"){k.setStyle("top",(t-k.getHeight())/2)}else{if(q=="bottom"){k.setStyle("top",t-k.getHeight())}else{it_Utils.throwError("Unknown alignment: '"+q)}}}}}k.setStyle("left",h);if(o!=l.length-1||n=="resizeContainer"){var p=it_CssUtils.getWidthWithMargin(k);if(isNaN(p)){it_Utils.throwError("Missing width with the child at the index "+o+" of the container '"+j+"'",k)}h+=p;if(o!=l.length-1){h+=s}}else{if(o==l.length-1&&n=="resizeLastChild"){var r=j.getWidth();if(isNaN(r)){it_Utils.throwError("The layout mode is 'resizeLastChild', but the container doesn't have a width",j)}k.setWidth(r-h)}}}if(n=="resizeContainer"){j.setWidth(h)}};this.fixSmallElementForIE=function(h){h.setStyle("fontSize",1)};this.setSize=function(j,k,h){j.setWidth(k);j.setHeight(h)};var g={position:"absolute",left:0};var c={backgroundRepeat:"no-repeat",backgroundPosition:"bottom center"};var b={backgroundRepeat:"repeat-y",backgroundPosition:"top center"};var d={backgroundRepeat:"no-repeat",backgroundPosition:"top center"};this.vertical3PartBg=function(h){h=$(h);var j=h.getChildren();j[0].setStyles(g).setStyles(c);j[1].setStyles(g).setStyles(b);j[2].setStyles(g).setStyles(d)};this.createAbsoluteDiv=function(k,h,j){var l=new Element("div");if(k!=null){l.setProperty("class",k)}l.setStyles(g);if(h){l.inject(h)}if(j){l.setStyles(j)}return l};var f=["marginLeft","paddingLeft","marginRight","paddingRight"];var e=["marginTop","paddingTop","marginBottom","paddingBottom"];this.allChildrenAbsoluteAllOverParent=function(j){j=$(j);var k=it_Utils.getStyleOrZero(j,"width");var h=it_Utils.getStyleOrZero(j,"height");it_Utils.getChildren(j,"div").forEach(function(n){n.setStyles(g);var m=k;var l=h;f.forEach(function(o){m=m-it_Utils.getStyleOrZero(n,o)});e.forEach(function(o){l=l-it_Utils.getStyleOrZero(n,o)});n.setWidth(m);n.setHeight(l)})};this.absoluteAllOverParent=function(l){l.setStyles(g);var k=l.getParent();var j=it_Utils.getStyleOrZero(k,"width");var h=it_Utils.getStyleOrZero(k,"height");f.forEach(function(m){j=j-it_Utils.getStyleOrZero(l,m)});e.forEach(function(m){h=h-it_Utils.getStyleOrZero(l,m)});l.setWidth(j);l.setHeight(h)};this.absoluteAllOverParentComponent=function(j,h){j.setStyles(g);j.setWidth(h._width);j.setHeight(h._height)};this.getFirstChild=function(h){h=$(h);var j=it_Utils.getChildren(h,"div");if(j.length>0){return j[0]}else{return null}};this.linkImageScrollerAndTabbedPane=function(k,h,j){h.addEvent("beforeTabClose",function(m,l){if(j==l){k.pause()}});h.addEvent("beforeTabOpen",function(m,l){if(j==l){k.resume()}});k.pause()};this.linkButtonAndSlidingPanel=function(j,h){j.addEvent("activation",function(){h.slide(true)});h.addEvent("beforeStateChange",function(k,l){j.fade(l)})}};window.it_ComponentUtils=new a()})();(function(){var d=function(j){var h=$type(j);if(h=="number"){return true}if(h=="string"){if(j.length==0){return false}if(it_StringUtils.isDigit(j.charAt(j.length-1))){return true}return it_StringUtils.endsWith(j,"px")}return false};var f=function(o,n,l){if(n===undefined){return this}l=l!==false;if(l&&!this.parentNode){l=false}var k=o=="width"||o=="height";var m=k||o=="left"||o=="top";var j=undefined;var p;if(m){if($type(n)==="array"){n=n[0]}if(n.toInt){p=n.toInt()}if(isNaN(p)){return this}var h="_"+o;if(k&&l){j=this[h]}this[h]=d(n)?p:undefined;if(this.component!==undefined){this.component[h]=this[h]}}if(k&&l&&j===undefined){j=this.getStyle(o).toInt()}arguments.callee.parent.apply(this,arguments);if(k&&l&&j!=p){this.fireEvent("resize")}return this};f.parent=Element.prototype.setStyle;var b=function(l){var k=null;var j=l=="width"||l=="height"||l=="left"||l=="right";if(j){var h="_"+l;if(this[h]!==undefined){k=this[h]+"px"}}if(k===null){k=arguments.callee.parent.apply(this,arguments);if(j){var m=k.toInt();if(isNaN(m)){m=undefined}this[h]=m;if(this.component!==undefined){this.component[h]=m}}}return k};b.parent=Element.prototype.getStyle;var a=function(){if(this._width!==undefined){return this._width}var h=parseInt(this.style.width);if(isNaN(h)){if(document.defaultView){h=document.defaultView.getComputedStyle(this,null).getPropertyValue("width")}else{if(this.currentStyle){h=this.currentStyle.width}}h=parseInt(h);if(isNaN(h)){h=this.offsetWidth}}this._width=h;if(this.component!==undefined){this.component._width=h}return h};var g=function(){if(this._height!==undefined){return this._height}var h=parseInt(this.style.height);if(isNaN(h)){if(document.defaultView){h=document.defaultView.getComputedStyle(this,null).getPropertyValue("height")}else{if(this.currentStyle){h=this.currentStyle.height}}h=parseInt(h);if(isNaN(h)){h=this.offsetHeight}}this._height=h;if(this.component!==undefined){this.component._height=h}return h};var e=function(k,j){var l=parseInt(k);if(isNaN(l)){return this}var h=this.getWidth();this.style.width=l+"px";this._width=l;if(this.component){this.component._width=l}if(j!==false&&h!=l){this.fireEvent("resize")}return this};var c=function(k,j){var l=parseInt(k);if(isNaN(l)){return this}var h=this.getHeight();this.style.height=l+"px";this._height=l;if(this.component){this.component._height=l}if(j!==false&&h!=l){this.fireEvent("resize")}return this};Element.implement({setStyle:f,getStyle:b,getWidth:a,setWidth:e,getHeight:g,setHeight:c})})();(function(){var a=function(){this.setButtonMouseEvents=function(c,b){b=$extend({mouseDown:$empty,mouseUp:$empty,mouseClick:$empty},b);var d=false;var e=false;c.addEvent("mouseenter",function(){d=true;if(e){b.mouseDown()}});c.addEvent("mouseleave",function(){d=false;if(e){b.mouseUp()}});c.addEvent("mousedown",function(){e=true;b.mouseDown()});c.addEvent("mouseup",function(){e=false;if(d){b.mouseUp();b.mouseClick()}})}};window.it_EventUtils=new a()})()}function it_DateUtilsClass(){this.getDay=function(a){return a.getDate()};this.getMonth=function(a){return a.getMonth()+1};this.getYear=function(a){return a.getFullYear()};this.setDay=function(b,a){b.setDate(a);return b};this.setMonth=function(a,b){a.setMonth(b-1);return a};this.setYear=function(a,b){a.setFullYear(b);return a};this.addDay=function(b,a){b.setTime(b.getTime()+a*24*60*60*1000);return b};this.addYear=function(b,a){b.setFullYear(b.getFullYear()+a);return b};this.newDate=function(b,c,a){return new Date(b,c-1,a)};this.padZero=function(a){return((a<=9)?("0"+a):a)};this.getDayStr=function(a){return this.padZero(this.getDay(a))};this.getMonthStr=function(a){return this.padZero(this.getMonth(a))};this.getComparInt=function(a,b){if(b==null){b=true}if(b){return parseInt(""+this.getYear(a)+this.getMonthStr(a)+this.getDayStr(a),10)}else{return parseInt(""+this.getMonthStr(a)+this.getDayStr(a),10)}};this.equals=function(c,b,a){return this.getComparInt(c,a)==this.getComparInt(b,a)};this.getDaysInMonth=function(a,b){monthdays=[0,31,28,31,30,31,30,31,31,30,31,30,31];if(a!=2){return monthdays[a]}else{return((b%4==0&&b%100!=0)||b%400==0?29:28)}};this.clone=function(b){var a=new Date();a.setTime(b.getTime());return a};this.getDaySuffix=function(a){switch(a){case 1:return"sun";case 2:return"mon";case 3:return"tue";case 4:return"wed";case 5:return"thu";case 6:return"fri";case 7:return"sat";default:throw new Error("The day of week index must be between 1 and 7")}};this.getMonthSuffix=function(a){switch(a){case 1:return"jan";case 2:return"feb";case 3:return"mar";case 4:return"apr";case 5:return"may";case 6:return"jun";case 7:return"jul";case 8:return"aug";case 9:return"sep";case 10:return"oct";case 11:return"nov";case 12:return"dec"}}}var it_DateUtils=new it_DateUtilsClass();var CompoundDate=function(l,a,d){this.objName=l;var w;if($defined(d)&&$defined(d.today)){w=d.today}else{w=new Date()}d=$extend({dayOfWeekElement:null,anchorElement:null,imgDir:"img",shortYear:false,fromDate:w,toDate:it_DateUtils.newDate(it_DateUtils.getYear(w)+1,it_DateUtils.getMonth(w),it_DateUtils.getDay(w)),selectedDate:w},d);d.dayOfWeekElement=$(d.dayOfWeekElement);if(d.anchorElement!=null){d.anchorElement=$(d.anchorElement);d.anchor=d.anchorElement}this.options=d;this.dateListener=null;var o=this;var b=true;var m,v,j,x,s;if(a!=null){a=it_FormUtils.getForm(a);m=a.elements[l+".day"];v=a.elements[l+".monthYear"];j=$defined(v);if(!j){x=a.elements[l+".month"];s=a.elements[l+".year"]}}else{m=$(l+".day");v=$(l+".monthYear");j=$defined(v);if(!j){x=$(l+".month");s=$(l+".year")}}this.setDateListener=function(y){this.dateListener=y};this.getSelDay=function(){return m[m.selectedIndex].value};this.getSelMonth=function(){if(j){var y=v[v.selectedIndex].value;return y.substring(0,y.indexOf("-")).toInt()}else{return x[x.selectedIndex].value}};this.getSelYear=function(){if(j){var y=v[v.selectedIndex].value;return y.substring(y.indexOf("-")+1).toInt()}else{return s[s.selectedIndex].value}};this.getDate=function(){return it_DateUtils.newDate(this.getSelYear(),this.getSelMonth(),this.getSelDay())};this.setDate=function(y){this.setDateParts(it_DateUtils.getYear(y),it_DateUtils.getMonth(y),it_DateUtils.getDay(y))};this.setDateParts=function(z,A,y){p(A,z);m.selectedIndex=y-1;if(j){it_SelectUtils.select(v,""+A+"-"+z)}else{x.selectedIndex=A-1;it_SelectUtils.select(s,z)}t();if(this.dateListener!=null){this.dateListener(this)}};this.showCalendar=function(y){it_getCalendar().show(y,this);o.fireEvent("calendarShown")};this.calendarHidden=function(){o.fireEvent("calendarHidden")};this.setVisible=function(y){if(b==y){return}b=y;it_Utils.setVisible([m,v,j,x,s,d.anchorElement,d.dayOfWeekElement],b)};var g=function(){t();q();if(o.dateListener!=null){o.dateListener(this)}};var k=function(){it_ComponentUtils.addEventMethods(o);$(m);m.addEvent("change",g);if(j){$(v);v.addEvent("change",g)}else{$(x);$(s);x.addEvent("change",g);s.addEvent("change",g)}if(d.anchorElement!=null){d.anchorElement.addEvent("mouseover",function(){it_singletonPopup.clearTimeout(l)});d.anchorElement.addEvent("mouseout",function(){it_singletonPopup.timeout(l);window.status=""});d.anchorElement.addEvent("click",o.showCalendar.bind(o))}};var t=function(){if(d.dayOfWeekElement){var z=it_DateUtils.newDate(o.getSelYear(),o.getSelMonth(),o.getSelDay());var y=z.getDay();d.dayOfWeekElement.innerHTML=it_message("common.date.day.long."+it_DateUtils.getDaySuffix(y+1))}};var q=function(){var z=o.getSelMonth();var y=o.getSelYear();p(z,y)};var p=function(C,A){var y=it_DateUtils.getDaysInMonth(C,A);var B=m.length;var z;if(B>y){for(z=0;z<(B-y);z++){m.options[m.options.length-1]=null}}if(y>B){var D=m.options.length;for(z=D+1;z<=y;z++){it_SelectUtils.addOption(m,z,z)}}if(m.selectedIndex<0){m.selectedIndex=0}};var c=function(){u();if(j){n()}else{e();r()}};var u=function(){for(var y=1;y<=31;y++){it_SelectUtils.addOption(m,y,y)}};var f=function(y){y=""+y;return d.shortYear?y.substring(2):y};if(j){var n=function(){var C=it_DateUtils.getYear(d.fromDate);var y=it_DateUtils.getYear(d.toDate);var B=it_DateUtils.getMonth(d.fromDate);var A=it_DateUtils.getMonth(d.toDate);if(y>C){h(B,12,C);for(var z=C+1;z<y;z++){h(1,12,z)}h(1,A,y)}else{h(B,A,C)}};var h=function(A,B,z){for(var y=A;y<=B;y++){it_SelectUtils.addOption(v,y+"-"+z,it_message("common.date.month.short."+it_DateUtils.getMonthSuffix(y))+" "+f(z))}}}else{var e=function(){for(var y=1;y<=12;y++){it_SelectUtils.addOption(x,y,it_message("common.date.month.short."+it_DateUtils.getMonthSuffix(y)))}};var r=function(){var A=it_DateUtils.getYear(d.fromDate);var y=it_DateUtils.getYear(d.toDate);for(var z=A;z<=y;z++){it_SelectUtils.addOption(s,z,f(z))}}}k();c();this.setDate(d.selectedDate);q();t()};document.write('<div id="calendarContainer" style="position:absolute; visibility: hidden; left: 0px; width: 124px; background-color : #ffffff;"></div>');var it_calendar;var it_getCalendar=function(){if(!$defined(it_calendar)){it_calendar=new Calendar()}return it_calendar};var Calendar=function(){this.daysInMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var b=$("calendarContainer");var a=1;var d;this.updatePopupContent=function(){var o=new StringBuilder();o.a('<form id="calendarForm" onSubmit="this.year.blur();return false;"><table width="100%" border="0" cellspacing="0" cellpadding="2" class="calBorderColor"><tr><td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="1" class="calBgColor">').a('<tr><td width="60%" class="cal" align="left">').a('<table border="0" cellspacing="0" cellpadding="0"><tr><td><a href="javascript: it_getCalendar().changeMonth(-1);" onmouseover="window.status=\'Mois pr&eacute;c&eacute;dent\';return true;" onmouseout="window.status=\'\';return true;"><img name="calendar" src="').a(d.options.imgDir).a('/calendar/down.gif" width="8" height="12" border="0" alt=""></a></td><td class="cal" width="100%" align="center">').a(it_message("common.date.month.long."+it_DateUtils.getMonthSuffix(this.month))).a('</td><td class="cal"><a href="javascript: it_getCalendar().changeMonth(+1);" onmouseover="window.status=\'Mois suivant\';return true;" onmouseout="window.status=\'\';return true;"><img name="calendar" src="').a(d.options.imgDir).a('/calendar/up.gif" width="8" height="12" border="0" alt=""></a></td></tr></table>').a('</td><td width="40%" align="right" class="cal">').a('<table border="0" cellspacing="0" cellpadding="0"><tr><td class="cal"><a href="javascript: it_calendar.changeYear(-1);" onmouseover="window.status=\'Ann&eacute;e pr&eacute;c&eacute;dente\';return true;" onmouseout="window.status=\'\';return true;"><img name="calendar" src="').a(d.options.imgDir).a('/calendar/down.gif" width="8" height="12" border="0" alt=""></a></td><td class="cal" width="100%" align="center">').a(this.year).a('</td><td class="cal"><a href="javascript: it_getCalendar().changeYear(+1);" onmouseover="window.status=\'Ann&eacute;e suivante\';return true;" onmouseout="window.status=\'\';return true;"><img name="calendar" src="').a(d.options.imgDir).a('/calendar/up.gif" width="8" height="12" border="0" alt=""></a></td></tr></table>').a("</td></tr></table>");var n=(7+this.getFirstDOM()-a)%7;var l=it_DateUtils.getDaysInMonth(this.month,this.year);o.a('<table width="100%" border="0" cellspacing="0" cellpadding="1" class="calBgColor"><tr>');var m;for(m=0;m<7;m++){var h=it_message("common.date.day.short."+it_DateUtils.getDaySuffix((a+m)%7+1));o.a('<td align="center" class="calDaysColor">').a(h).a("</td>")}o.a("</tr>");var q=it_DateUtils.getComparInt(d.options.fromDate);var f=it_DateUtils.getComparInt(d.options.toDate);var p=1;var g=it_DateUtils.newDate(this.year,this.month,p);var e=it_DateUtils.getComparInt(g);for(var k=1;k<=6;k++){o.a("<tr>");for(m=1;m<=7;m++){o.a('<td width="16" align="center" ');if((7*(k-1)+m)>=n+1&&p<=l){if(this.day==p&&this.year==d.getSelYear()&&this.month==d.getSelMonth()){o.a('class="calHighlightColor"')}else{if(m==7-a||m==((7-a)%7)+1){o.a('class="calWeekend"')}else{o.a('class="cal"')}}o.a(">");if(e>=q&&e<=f){o.a('<a class="cal" href="javascript: it_getCalendar().clickDay(').a(p).a(');" onmouseover="window.status=\'').a(p).a(" ").a(it_message("common.date.month.long."+it_DateUtils.getMonthSuffix(this.month))).a(" ").a(this.year).a("';return true;\" onmouseout=\"window.status='';return true;\">").a(p).a("</a>")}else{o.a('<span class="disabled">').a(p).a("</span>")}p++;it_DateUtils.setDay(g,p);e=it_DateUtils.getComparInt(g)}else{if(m==7-a||m==((7-a)%7)+1){o.a('class="calWeekend"')}else{o.a('class="cal"')}o.a(">&nbsp;")}o.a("</td>")}o.a("</tr>")}o.a("</table></td></tr></table></form>");b.innerHTML=o.toString()};this.getFirstDOM=function(){var e=new Date();it_DateUtils.setDay(e,1);it_DateUtils.setMonth(e,this.month);it_DateUtils.setYear(e,this.year);return e.getDay()};this.changeYear=function(e){(e==1)?this.year++:this.year--;this.updatePopupContent()};this.changeMonth=function(e){if(this.month==12&&e==1){this.month=1;this.year++}else{if(this.month==1&&e==-1){this.month=12;this.year--}else{(e==1)?this.month++:this.month--}}this.updatePopupContent()};this.clickDay=function(e){d.setDateParts(this.year,this.month,e);this.hide()};this.show=function(e,f){d=f;this.month=d.getSelMonth();this.day=d.getSelDay();this.year=d.getSelYear();this.updatePopupContent();b.setStyle("visibility","");it_singletonPopup.triggerMouseOver(d.objName,b,$extend({callbackOnClose:function(g){if(g==d.objName){c()}}},d.options),e)};this.hide=function(){it_singletonPopup.triggerForceHide(d.objName);c()};var c=function(){if(d!=null){d.calendarHidden();d=null}}};var it_CompoundTime=function(e,f,b){b=b||{};var a,d;if(f!=null){f=it_FormUtils.getForm(f);a=f.elements[e+".hour"];d=f.elements[e+".minute"]}else{a=$(e+".hour");d=$(e+".minute")}var c;if(a){for(c=0;c<=23;c++){it_SelectUtils.addOption(a,c,(c<10?"0":"")+c)}}if(d){for(c=0;c<60;c+=15){it_SelectUtils.addOption(d,c,(c<10?"0":"")+c)}}this.setTime=function(g){this.setTimeParts(g.getHours(),g.getMinutes())};this.setTimeParts=function(g,h){it_SelectUtils.select(a,g);it_SelectUtils.select(d,h)};this.getHourSelect=function(){return a}};function it_ScrollerImage(b,a){this.title=b;this.imageUrl=a}var it_ImageScroller=function(s,j,D,X,I,u,B){B=$extend({imageClass:null,showPartialImages:false,vertical:true,transition:"opacity",transitionDelay:1000,canvas:null,alignment:null,alignmentLimit:null,waitToInit:false},B);if(B.canvas!=null){B.canvas=$(B.canvas);j=B.canvas.getWidth();D=B.canvas.getHeight()}else{j=parseInt(j);D=parseInt(D)}X=parseInt(X);I=parseInt(I);var q={};var o=2;var W=B.vertical?"height":"width";var t=B.vertical?"width":"height";var x=B.vertical?D:j;var A=B.vertical?j:D;var S=B.vertical?"top":"left";var n=B.vertical?"left":"top";var d=B.vertical?I:X;var K=B.vertical?X:I;var Q=Math.floor((A+o)/(K+o));var z=Math.floor((x+o)/(d+o));var P=z;if(B.showPartialImages){P++}var l=P*(d+o);var F=Math.ceil(u.length/Q);var h=z<F;var V;var b=Q*(K+o)-o;if(B.alignment==null){if(B.alignmentLimit!=null){B.alignment=A>B.alignmentLimit?"left":"center"}else{B.alignment="left"}}if(B.alignment=="left"||B.alignment=="top"){V=0}else{if(B.alignment=="right"||B.alignment=="bottom"){V=A-b}else{V=(A-b)/2}}var v;var N;var p=-1;var m,C;var a=-1;var M;var f=null;var U=false;var w=false;var g=this;var L=false;this.canvas=null;var k=function(){var Y=new StringBuilder();if(B.canvas==null){Y.a("<div id='"+s+"ScrollerContainer' style='width: ").a(j).a("px;height: ").a(D).a("px;'></div>");document.write(Y.toString());g.canvas=$(s+"ScrollerContainer")}else{g.canvas=B.canvas}g.canvas.setStyle("position","relative");if(!B.waitToInit){g.init()}};this.init=function(){if(L){return false}L=true;var Z=new Element("div",{styles:{position:"absolute",overflow:"hidden"}});this.canvas.adopt(Z);Z.setStyle(W,x);Z.setStyle(t,b);Z.setStyle(n,V);Z.onmouseover=it_Utils.delegate(this,y);Z.onmouseout=it_Utils.delegate(this,c);if(!h){O(Z);e(Z);Z.setStyle("zIndex",20);return true}var Y={position:"absolute",top:0,left:0,width:j,height:D};v=new Element("div",{styles:Y});N=[new Element("div",{styles:Y}),new Element("div",{styles:Y})];O(N[0]);O(N[1]);e(N[0]);N[0].setStyle("zIndex",20);v.adopt(N);Z.adopt(v);if(B.transitionDelay>0){C=new Fx({duration:B.transitionDelay,fps:10,onComplete:G});C.set=$empty}if(B.transition=="slide"){m=new J()}else{m=new T()}R();return true};var O=function(aa){var ae=B.vertical?Q:P;var Z=B.vertical?P:Q;var Y=h?null:u.length;aa.empty();var ac=0;for(var ad=0;ad<Z;ad++){for(var ab=0;ab<ae;ab++){var af={width:X,height:I,styles:{position:"absolute",top:ad*(I+o),left:ab*(X+o)}};if(B.imageClass!=null){af["class"]=B.imageClass}new Element("img",af).inject(aa);ac++;if(Y!=null&&Y==ac){return}}}};var R=function(){M=true;if(C==null){G()}else{C.start(0,1)}};var G=function(){M=false;p++;p=p%2;var Y=N[p];var Z=N[(p+1)%2];e(Z);m.start(Y,Z)};var e=function(Y){Y.getChildren().forEach(function(aa){E(aa);if(!q[aa.src]){var Z=new Image();q[aa.src]=Z;Z.src=aa.src}})};var E=function(aa){a++;if(a>=u.length){a=0}var Y=a;var Z=u[Y];aa.setProperty("title",Z.title);aa.setProperty("src",Z.imageUrl)};var H=function(){if(M){C.pause()}else{m.pause()}};var r=function(){if(M){C.resume()}else{m.resume()}};this.pause=function(){if(L&&h&&!U){U=true;if(!w){H()}}};this.resume=function(){if(!L){this.init()}this.canvas.setStyle("display","");if(h&&U){U=false;if(!w){r()}}};var y=function(){if(h&&!w){w=true;if(!U){H()}}};var c=function(){if(h&&w){w=false;if(!U){r()}}};var J=function(){var Z=20;var Y=l*1000/Z;var aa=new Fx.Tween(v,{property:S,duration:Y,fps:Z,transition:Fx.Transitions.linear,onComplete:it_Utils.delegate(this,R)});this.start=function(ab,ac){ab.setStyle(S,0);ab.setStyle(n,0);ac.setStyle(S,l);ac.setStyle(n,0);aa.start(0,-l)};this.pause=function(){aa.pause()};this.resume=function(){aa.resume()}};function T(){var Y=new Fx.Tween(v,{property:"opacity",duration:500,fps:30,transition:Fx.Transitions.linear,onComplete:it_Utils.delegate(this,R)});this.start=function(Z,aa){Z.setStyle("opacity",1);Z.setStyle("zIndex",10);aa.setStyle("opacity",0);aa.setStyle("zIndex",20);Y.element=aa;Y.start(0,1)};this.pause=function(){Y.pause()};this.resume=function(){Y.resume()}}k()};if(!window.it_LayoutUtils){(function(){var a=function(){this.columnLayout=function(d,n){n=n||{};var m=it_Utils.getPropertyMandatory(n,"columnCount");var e=it_CssUtils.getWidth(d,true);var k=Math.floor(e/m);var c=0;var g=it_Utils.getChildren(d,"div");for(var l=0;l<g.length;l+=m){var b=0;for(var j=0;j<m;j++){var f=g[l+j];var h=f.getHeight();if(h>0){b=Math.max(b,h)}}if(b==0){throw new Error("We need at least one element in the row to have an height. The first element in the row has the class: '"+g[l].getProperty("class")+"'")}for(j=0;j<m;j++){f=g[l+j];f.setStyle("position","absolute");f.setStyle("top",c);f.setStyle("left",k*j);f.setWidth(k);f.setHeight(b)}c+=b}if(n.mode=="resizeContainer"){d.setHeight(c)}};this.centerHorizontally=function(b){b.setStyle("left",(b.getParent().getWidth()-getWidth())/2)}};window.it_LayoutUtils=new a()})()}var it_Overlay=function(d,c){d=$(d);var e=c.map(function(g){return $(g)});var b;d.addEvents({click:function(k){k=new Event(k);var g=k.page;var j=a(g);if(j!=null){var h=j.getPosition();f(j,"click",g,h)}},mousemove:function(k){k=new Event(k);var g=k.page;var j=a(g);if(j!==b){var h;if(b!=null){h=b.getPosition();f(b,"mouseout",g,h)}if(j!=null){h=j.getPosition();f(j,"mouseover",g,h)}b=j}},mouseout:function(h){if(b!=null){var g=new Event(h).page;childPos=b.getPosition();f(b,"mouseout",g,childPos);b=null}}});var f=function(n,h,g,l){var k=g.x-l.x;var j=g.y-l.y;var m;if(document.createEventObject){m=document.createEventObject();m.screenX=g.x;m.screenY=g.y;m.clientX=k;m.clientY=j;m.type="on"+h;m.srcElement=n;m.target=n;m.cancelBubble=false;m.returnValue=true;n.fireEvent(h,new Event(m))}else{m=document.createEvent("MouseEvents");m.initMouseEvent(h,true,true,window,1,g.x,g.y,k,j,false,false,false,false,1,null);n.dispatchEvent(m)}};var a=function(g){for(var h=0;h<e.length;h++){var k=e[h];var j=k.getCoordinates();if(j.left<=g.x&&g.x<=(j.left+j.width)&&j.top<=g.y&&g.y<=(j.top+j.height)){return k}}return null}};var it_PopupMenu=function(n){n=$extend({popupMenuBuilder:null,triggerElement:null,triggerElementKeepsFocus:true,imgDir:it_basePath+"img/",anchor:"trigger",anchorAlignmentX:"left",offsetY:-1,visibleLineCount:6,lineHeight:18,width:200},n);if(n.popupMenuBuilder==null){it_Utils.throwError("options.popupMenuBuilder is mandatory")}n.triggerElement=$(n.triggerElement);if(!n.triggerElement){it_Utils.throwError("options.triggerElement is mandatory")}if(n.imgDir!=null&&!it_StringUtils.endsWith(n.imgDir,"/")){n.imgDir=n.imgDir+"/"}n.popupMenuBuilder.init(this,n);var m=this;var e=null;var o=null;var k=null;var j=null;var c=null;var b=false;var d=false;var f=false;var l=function(){it_ComponentUtils.addEventMethods(m)};this.selectPreviousLine=function(p){var r=p!==undefined?p:e;var q;if(r==null){q=o.length-1}else{if(r!=0){q=r-1}else{return}}if(!m.setSelectedIndex(q)){selectPreviousLine(q)}else{a();g()}};this.selectNextLine=function(p){var r=p!==undefined?p:e;var q;if(r==null){q=0}else{if(r!=(o.length-1)){q=r+1}else{return}}if(!m.setSelectedIndex(q)){selectNextLine(q)}else{a();g()}};var g=function(){if(c.sliderVisible){var p=Math.floor((n.visibleLineCount/2))*n.lineHeight;resultY=e*n.lineHeight-p;resultY=Math.max(0,resultY);resultY=Math.min(resultY,o.length*n.lineHeight-height);c.setScrollY(resultY)}};this.setSelectedIndex=function(p){if(f){return false}if(!n.popupMenuBuilder.isResultValid(p)){return false}if(e!=null){o[e].removeClass("autoCompleteSelected")}e=p;o[e].addClass("autoCompleteSelected");return true};this.getSelectionIndex=function(){if(e===null||e===undefined||e<0){return -1}else{return e}};this.lineSelected=function(){if(e!=null){var p=n.popupMenuBuilder.getInputValue(e);this.fireEvent("lineSelected",[p,e]);this.close();if(n.triggerElementKeepsFocus){n.triggerElement.blur();setTimeout(function(){n.triggerElement.focus()},200)}}};this.close=function(){if(d){d=false;it_singletonPopup.triggerForceHide(name);this.fireEvent("closed")}};this.open=function(){if(n.popupMenuBuilder.isDataShowable()){d=true;h();it_singletonPopup.triggerMouseOver(name,k,n,n.triggerElement);this.fireEvent("open")}else{this.close()}};var a=function(){it_singletonPopup.clearTimeout(name);it_singletonPopup.timeout(name)};this.popupMenuChanged=function(){e=null;b=false;this.open()};this.isOpen=function(){return d};this.isMousePressedOnSlider=function(){return f};var h=function(){if(!b){b=true;if(k==null){k=new Element("div",{"class":"autoCompleteContainer",styles:{position:"absolute",left:0,width:n.width,height:100}}).inject(document.body);j=new Element("div",{styles:{position:"absolute",left:0,cursor:"pointer",textAlign:"left",height:200}});c=new it_ScrollPane(k,{events:{onMouseDown:function(q){f=true;it_singletonPopup.manualPreventClosing=true}},imgDir:n.imgDir+"components/slider/"});c.setContent(j);var p=function(q){if(f){f=false;it_singletonPopup.manualPreventClosing=false;if(n.triggerElementKeepsFocus){n.triggerElement.focus()}}};document.addEvent("mouseup",p)}j.empty();o=n.popupMenuBuilder.buildContent(j);height=Math.min(n.visibleLineCount,o.length)*n.lineHeight;k.setHeight(height);j.setHeight(o.length*n.lineHeight);e=null}};l()};var it_DefaultPopupMenuBuilder=function(c){var b;var a;this.init=function(e,d){if(b!=null){it_Utils.throwError("The popupBuilder can't be shared")}b=e;a=d};this.getInputValue=function(d){return c[d].value};this.isDataShowable=function(){return true};this.isResultValid=function(d){return true};this.buildContent=function(e){var d=[];c.forEach(function(f,h){var g=new Element("div",{text:f.text,styles:{position:"relative",height:a.lineHeight},events:{mouseover:function(){b.setSelectedIndex(h)},mousedown:function(){b.lineSelected()}}}).inject(e);d.push(g)});return d}};var it_VerticalScrollBar=function(b,c){c=$extend({minValue:0,maxValue:100,imgDir:it_basePath+"img/components/slider/",ratio:0},c);var j=TRACK_BOTTOM_HEIGHT=4;var e=KNOB_BOTTOM_HEIGHT=KNOB_GRIP_HEIGHT=8;var n,g,h,k,d,l,t;var s,r,q;var o=null;var f=null;var m=this;var p=function(){b=it_ComponentUtils.init(m,b,c);n=new Element("div",{styles:{position:"absolute",left:0,width:m._width},events:{click:function(x){x=new Event(x);var w=x.page.y-it_PositionUtils.getTop(b);if(w>h.offsetTop){m.nextPage()}else{m.previousPage()}}}}).inject(b);new Element("div",{styles:{height:j,backgroundImage:"url('"+c.imgDir+"trackTop.png')"}}).inject(n);g=new Element("div",{styles:{backgroundImage:"url('"+c.imgDir+"trackMiddle.png')"}}).inject(n);new Element("div",{styles:{height:TRACK_BOTTOM_HEIGHT,backgroundImage:"url('"+c.imgDir+"trackBottom.png')"}}).inject(n);it_ComponentUtils.vertical3PartBg(n);h=new Element("div",{styles:{position:"absolute",fontSize:1,top:0,left:0,width:m._width}}).inject(b);k=new Element("div",{styles:{height:e,backgroundImage:"url('"+c.imgDir+"knobTop.png')"}}).inject(h);d=new Element("div",{styles:{backgroundImage:"url('"+c.imgDir+"knobMiddle.png')"}}).inject(h);l=new Element("div",{styles:{height:KNOB_BOTTOM_HEIGHT,backgroundImage:"url('"+c.imgDir+"knobBottom.png')"}}).inject(h);it_ComponentUtils.vertical3PartBg(h);t=new Element("div",{styles:{position:"absolute",left:0,width:m._width,height:KNOB_GRIP_HEIGHT,backgroundImage:"url('"+c.imgDir+"knobGrip.png')",backgroundRepeat:"no-repeat",backgroundPosition:"center center"}}).inject(d);var v=false;var u={mousedown:function(w){if(!v){v=true;m.fireEvent("onMouseDown")}},mouseup:function(w){if(v){v=false;m.fireEvent("onMouseUp")}}};q=new Drag(h,{limit:{x:[0,0],y:[0,0]},snap:0,onDrag:function(){a(h.offsetTop)},onBeforeStart:u.mousedown,onComplete:u.mouseup});b.addEvents(u);m.setRatio(c.ratio)};var a=function(u){var v=it_Utils.changeScale(s,r,u,c.minValue,c.maxValue);m.setValue(v)};this.getValue=function(){return Math.floor(it_Utils.changeScale(s,r,h.offsetTop,c.minValue,c.maxValue))};this.setValue=function(v){var u=Math.floor(it_Utils.changeScale(c.minValue,c.maxValue,v,s,r));h.setStyle("top",u);if(v!==o){o=v;m.fireEvent("drag",v)}};this.nextPage=function(){var v=Math.floor(it_Utils.changeScale(0,100-f,f,c.minValue,c.maxValue));var u=Math.min(this.getValue()+v,c.maxValue);this.setValue(u)};this.previousPage=function(){var v=Math.floor(it_Utils.changeScale(0,100-f,f,c.minValue,c.maxValue));var u=Math.max(this.getValue()-v,c.minValue);this.setValue(u)};this.doLayout=function(){var u=c.height?c.height:b.getHeight();var y=Math.max(0,u-j-TRACK_BOTTOM_HEIGHT);g.setHeight(y);it_ComponentUtils.verticalLayout(n,{mode:"resizeContainer"});var v=KNOB_BOTTOM_HEIGHT+e+KNOB_GRIP_HEIGHT;var w=Math.max(u*f/100,v);var x=w-e-KNOB_BOTTOM_HEIGHT;d.setHeight(x);it_ComponentUtils.verticalLayout(h,{mode:"resizeContainer"});t.setStyle("top",(x-KNOB_GRIP_HEIGHT)/2);s=j;r=u-w-TRACK_BOTTOM_HEIGHT;q.options.limit.y=[s,r]};this.setRatio=function(u){f=u;this.invalidate();a(s)};p()};var it_ScrollPane=function(c,l){l=$extend({sliderWidth:15,imgDir:it_basePath+"img/components/slider/"},l);c=$(c);var k=this;var g,d,f,b;var h=null;var e;this.sliderVisible=true;var j=function(){c=it_ComponentUtils.init(k,c,l);g=new Element("div",{styles:{position:"absolute",top:0,left:0,overflow:"hidden"}}).inject(c);d=new Element("div",{styles:{position:"absolute",top:0,left:0}}).inject(g);f=new Element("div",{styles:{position:"absolute",left:k._width-l.sliderWidth,width:l.sliderWidth,height:k._height}}).inject(c);b=new it_VerticalScrollBar(f,{imgDir:l.imgDir,minValue:0,maxValue:1000,events:{drag:function(n){var m=Math.floor(it_Utils.changeScale(0,1000,n,0,h-k._height));g.scrollTo(0,m)},onMouseDown:function(m){k.fireEvent("onMouseDown")},onMouseUp:function(m){k.fireEvent("onMouseUp")}}});c.addEvent("mousewheel",function(o){o=new Event(o);o.stop();var m=h-k._height;var n=Math.floor(it_Utils.changeScale(0,1000,b.getValue(),0,m));n=n-30*o.wheel;n=Math.min(n,m);n=Math.max(n,0);k.setScrollY(n)})};this.setContent=function(n){var m=it_ComponentUtils.getFirstChild(d);if(m!=null){m.removeEvent("resize",a)}d.empty();n.inject(d).setStyle("top",0).setStyle("left",0);n.addEvent("resize",a);this.invalidate()};var a=function(){k.invalidate()};this.doLayout=function(){var o=it_ComponentUtils.getFirstChild(d);if(o!=null){this._height=c.getHeight();h=o.getHeight();if(e===null||e===undefined){this.sliderVisible=h>this._height}else{this.sliderVisible=e}f.setStyle("display",this.sliderVisible?"block":"none");var p={width:this.sliderVisible?this._width-l.sliderWidth:this._width,height:h};var m={width:p.width,height:this._height};this.invalidationEnabled=false;o.setStyles(p);this.invalidationEnabled=true;d.setStyles(p);g.setStyles(m);f.setHeight(m.height);if(this.sliderVisible){var n=100*this._height/h;b.setRatio(n)}this.setScrollY(0)}};this.setScrollY=function(n){var m=it_Utils.changeScale(0,h-this._height,n,0,1000);b.setValue(m)};this.forceScrollBarVisibility=function(m){e=m};j()};function it_Select(g,m){m=$extend({visibleLineCount:10},m);var l=this;g=$(g);var e;var b=false;var j;var d;var c,f,a;var k=function(){it_ComponentUtils.addEventMethods(l,m);e=[];$each(g.options,function(o,n){if(o.selected){f=o.value}e.push({value:o.value,text:o.text})});d=new Element("input",{type:"text",readOnly:"true"}).replaces(g);h(g.selectedIndex);m.triggerElement=d;m.popupMenuBuilder=new it_DefaultPopupMenuBuilder(e);j=new it_PopupMenu(m);j.addEvents({lineSelected:function(o,n){h(n);l.fireEvent("lineSelected",[f,a])},closed:function(){l.fireEvent("closed")},open:function(){l.fireEvent("open")}});d.addEvent(it_IE?"keydown":"keypress",function(n){n=new Event(n);if(!n.shift){switch(n.key){case"enter":if(j.isOpen()){l.lineSelected();n.stop()}return;case"up":case"down":if(!j.isOpen()){j.open()}else{if(n.key=="up"){j.selectPreviousLine()}else{j.selectNextLine()}}n.stop();return;case"esc":j.close();return}}}).addEvent("mousedown",function(n){j.open()}).addEvent("focus",function(){b=true}).addEvent("blur",function(){b=false;if(!j.isMousePressedOnSlider()){j.close()}})};var h=function(n){c=n;var o=e[n];f=o.value;a=o.text;d.value=a};this.getSelectedIndex=function(){return c};this.getSelectedValue=function(){return f};this.getSelectedText=function(){return a};this.removeFocus=function(){d.blur()};k()}var it_Slider=function(f,e,d,j){j=$extend({onChange:$empty,formatter:new PriceFormat().format,formatterUnit:"",allwaysShowLabel:false},j);if(!d){d=""}else{d=d+"."}$(d+"minLabel").innerHTML=j.formatter(f)+j.formatterUnit;$(d+"maxLabel").innerHTML=j.formatter(e)+j.formatterUnit;var g=$(d+"label");var c=$(d+"track");it_ComponentUtils.fixSmallElementForIE(c);var a;var h=function(){var k=c.offsetWidth;a=new it_SliderKnob(d+"knob",f,e,k,true,{onDrag:b,onComplete:function(){j.onChange(false,a.getValue())}});if(j.allwaysShowLabel){b()}else{g.set("opacity",0)}c.addEvent("click",function(m){m=new Event(m);var l=m.client.x-c.getLeft()-a.getElement().getWidth()/2;a.setValue(a.toValue(l),{onComplete:function(){b();j.onChange(false,a.getValue())}})})};var b=function(){var k=a.getValue();if(j.allwaysShowLabel||k>f){g.innerHTML=j.formatter(a.getValue())+j.formatterUnit+"&nbsp;";g.set("opacity",1)}else{g.innerHTML="";if(!j.allwaysShowLabel){g.set("opacity",0)}}g.setStyle("left",a.getPositionOnTrack()-(g.offsetWidth/2).toInt())};h()};var it_RangeSlider=function(m,h,g,q){q=$extend({onChange:$empty,formatter:new PriceFormat().format,formatterUnit:"",knobPressedClass:null},q);this.options=q;if(!g){g=""}else{g=g+"."}$(g+"minLabel").innerHTML=q.formatter(m)+q.formatterUnit;$(g+"maxLabel").innerHTML=q.formatter(h)+q.formatterUnit;var p=$(g+"leftLabel");var f=$(g+"rightLabel");var c=$(g+"track");it_ComponentUtils.fixSmallElementForIE(c);var r,l;var k=undefined;var a=false;var e=false;var o=function(){var s=c.offsetWidth;r=new it_SliderKnob(g+"leftKnob",m,h,s,true,{classWhenPressed:q.knobClassWhenPressed,onDrag:b,onComplete:function(){q.onChange(false,r.getValue())}});l=new it_SliderKnob(g+"rightKnob",m,h,s,false,{classWhenPressed:q.knobClassWhenPressed,onDrag:b,onComplete:function(){q.onChange(true,l.getValue())}});p.set("opacity",0);f.set("opacity",0);j()};this.getLeftValue=function(){return r.getValue()};this.getRightValue=function(){return l.getValue()};var j=function(){var s=r.getValue()>(m+h)/2;if(s!==k){k=s;r.element.setStyle("zIndex",k?1001:1000);l.element.setStyle("zIndex",k?1000:1001)}};var b=function(){r.changeUpperLimit(l.getValue());l.changeLowerLimit(r.getValue());var t=r.getValue();if(t>m){p.innerHTML=q.formatter(r.getValue())+q.formatterUnit+"&nbsp;";p.set("opacity",1)}else{p.innerHTML="";p.set("opacity",0)}var s=l.getValue();if(s<h){f.innerHTML=q.formatter(l.getValue())+q.formatterUnit;f.set("opacity",1)}else{f.innerHTML="";f.set("opacity",0)}p.setStyle("left",r.getPositionOnTrack()-(p.offsetWidth/2).toInt());f.setStyle("left",l.getPositionOnTrack()-(f.offsetWidth/2).toInt());a=false;e=false;n();d();n();j()};var n=function(){var t=f.offsetLeft-(p.offsetLeft+p.offsetWidth);if(t<0){t=-t;if(a){f.setStyle("left",f.offsetLeft+t)}else{if(e){p.setStyle("left",p.offsetLeft-t)}else{var s=(t/2).toInt();f.setStyle("left",f.offsetLeft+s);p.setStyle("left",p.offsetLeft-(t-s))}}}};var d=function(){if(p.offsetLeft<c.offsetLeft){p.setStyle("left",c.offsetLeft);a=true}if(f.offsetLeft+f.offsetWidth>c.offsetLeft+c.offsetWidth){f.setStyle("left",c.offsetLeft+c.offsetWidth-f.offsetWidth);e=true}};o()};var it_SliderKnob=function(e,j,g,m,h,l){l=$extend({onStart:$empty,onDrag:$empty,onComplete:$empty,classWhenPressed:null},l);var b=$(e);this.element=b;it_ComponentUtils.fixSmallElementForIE(b);var d,a;if(h){d=b.offsetLeft;a=d+m}else{a=b.offsetLeft;d=a-m}var c=[d,a];var f=new Drag(b,{limit:{x:c,y:[b.offsetTop,b.offsetTop]},snap:0,onStart:function(){if(l.classWhenPressed){b.addClass(l.classWhenPressed)}l.onStart()},onDrag:l.onDrag,onComplete:function(){if(l.classWhenPressed){b.removeClass(l.classWhenPressed)}l.onComplete()}});this.getValue=function(){return this.toValue(b.offsetLeft)};this.setValue=function(o,p){p=$extend({animate:true,onComplete:$empty},p);var n=k(o);if(p.animate){new Fx.Tween(b,{property:"left",duration:400,transition:Fx.Transitions.Quart.easeOut,onComplete:p.onComplete}).start(n)}else{b.setStyle("left",n);p.onComplete()}};this.changeUpperLimit=function(n){c[1]=k(n);if(f.limit){f.limit.x[1]=c[1]}};this.changeLowerLimit=function(n){c[0]=k(n);if(f.limit){f.limit.x[0]=c[0]}};this.getPositionOnTrack=function(){return b.offsetLeft-d};var k=function(n){return it_Utils.changeScale(j,g,n,d,a)};this.toValue=function(n){return it_Utils.changeScale(d,a,n,j,g)};this.getElement=function(){return b}};var it_SlidingPanels=function(e,d){d=$extend({initialPanelIndex:0,slideStartPosition:"left",transition:"quad"},d);d.slideStartPosition=d.slideStartPosition.toLowerCase();d.transition=d.transition.toLowerCase();var b=this;var c=[];var a;var g=function(){e=it_ComponentUtils.init(b,e,d);e.setStyle("overflow","hidden")};this.addPanel=function(k,j){k=$(k);j=it_Utils.extendIfNonNull({panelName:k.getProperty("id")},j);if(it_StringUtils.isEmpty(j.panelName)){j.panelName="panel"+it_nextRef()}k.inject(b.canvas);it_ComponentUtils.absoluteAllOverParent(k);var h={content:k,index:c.length,name:j.panelName};c.push(h);if(h.name!=null){c[h.name]=h}c.forEach(function(l,m){if(m==d.initialPanelIndex){l.content.setStyle("visibility","visible").setStyle("zIndex",20);if(it_IE6){f(l.content,true)}a=l}else{l.content.setStyle("visibility","hidden").setStyle("zIndex",10);if(it_IE6){f(l.content,false)}}});return h};this.openPanel=function(u){var h=c[u];if(h==a){return}var l=a;a=h;var p=l.content.getElements("input");var s;for(var n=0;n<p.length;n++){var t=p[n];if(t.getProperty("type")==="text"){s=t;break}}if(s){s.focus();s.blur()}l.content.setStyle("zIndex",10);a.content.setStyle("zIndex",20);if(it_IE6){f(a.content,true);f(l.content,false)}var o,k,r;if(d.transition=="opacity"){o="opacity";k=0;r=1}else{if(d.transition=="quad"||d.transition=="bounce"){r=0;if(d.slideStartPosition=="left"){o="left";k=-b._width}else{if(d.slideStartPosition=="right"){o="left";k=b._width}else{if(d.slideStartPosition=="top"){o="top";k=-b._height}else{if(d.slideStartPosition=="bottom"){o="top";k=b._height}else{throw new Error("when transition is 'quad' or 'bounce', options.slideStartPosition can only be 'left', 'right', 'top' or 'bottom' (wrong value is '"+d.slideStartPosition+"')")}}}}}else{throw new Error("options.transition can only by 'opacity', quad' or 'bounce' (wrong value is '"+d.transition+"')")}}var q;var m;if(d.transition=="opacity"){m=400;q=Fx.Transitions.linear}else{if(d.transition=="quad"){m=500;q=Fx.Transitions.quadOut}else{if(d.transition=="bounce"){m=700;q=it_LightBounce}}}b.fireEvent("beforePanelOpen",[h.index,h.name]);var j=new Fx.Tween(h.content,{property:o,duration:m,transition:q}).addEvent("onComplete",function(){b.fireEvent("afterPanelOpen",[h.index,h.name])}.bind(this));j.set(k);if(d.transition=="quad"||d.transition=="bounce"){h.content.set("opacity",1)}new Fx.Tween(l.content,{property:"opacity",duration:200,transition:Fx.Transitions.linear}).addEvent("onComplete",function(){b.fireEvent("afterPanelClose",[l.index,l.name])}.bind(this)).start(1,0).chain(function(){j.start(k,r)})};var f=function(l,k){var j=l.getElementsByTagName("select");for(var h=0;h<j.length;h++){j[h].style.visibility=k?"visible":"hidden"}};g()};var it_TabbedPane=function(e,d){d=$extend({divsTitle:[],cssPrefix:"tabbedPane",activationTime:1000,tabsPosition:"top",transition:"bounce",buttonBarOptions:null,maxButtonCount:null},d);var b=this;var a,c;var f=function(){it_ComponentUtils.init(b,e,d);var l=it_Utils.getChildren(b.canvas,"div");l.forEach(function(n){n.dispose()});var k=d.tabsPosition=="top"?"horizontal":"vertical";var j=d.cssPrefix.createChild("Header");var g=new Element("div",{"class":j.getClass()}).inject(b.canvas);var m=new Element("div",{"class":d.cssPrefix.getClass("Content")}).inject(b.canvas);if(k=="horizontal"){it_ComponentUtils.verticalLayout(b.canvas,{mode:"resizeLastChild"})}else{it_ComponentUtils.horizontalLayout(b.canvas,{mode:"resizeLastChild"})}a=new it_AutoButtonBar(g,it_Utils.extendIfNonNull({cssPrefix:j,orientation:k},d.buttonBarOptions));c=new it_SlidingPanels(m,{slideStartPosition:d.tabsPosition,transition:d.transition});c.addEvents({beforePanelClose:function(n,o){b.fireEvent("beforeTabClose",[n,o])},afterPanelClose:function(n,o){b.fireEvent("afterTabClose",[n,o])},beforePanelOpen:function(n,o){b.fireEvent("beforeTabOpen",[n,o])},afterPanelOpen:function(n,o){b.fireEvent("afterTabOpen",[n,o])}});l.forEach(function(o,n){b.addPanel(o,{tabTitle:d.divsTitle.length>n?d.divsTitle[n]:null,last:n==l.length-1})});var h;if(!isNaN(d.maxButtonCount)){for(h=l.length;h<d.maxButtonCount;h++){a.addFiller({cssPrefix:d.cssPrefix.createChild(["Title","Title"+h])})}}if(l.length>0){b.endInit()}};this.endInit=function(){a.end();a.getButton(0).setState(true);var g=a.getButtonCount();for(i=1;i<g;i++){a.getButton(i).setState(false)}b.canvas.setStyle("display","block");return this};this.addPanel=function(j,h){j=$(j);h=$extend({tabTitle:null,buttonLayerCreationFunc:null},h);var g=c.addPanel(j,{panelName:h.tabName});a.addButton({name:g.name,layerCreationFunc:h.buttonLayerCreationFunc,text:h.tabTitle,cssPrefix:d.cssPrefix.createChild("Title"),createForeground:true,last:h.last}).addEvent("activation",function(k){c.openPanel(k)});return this};f()};var it_Checkbox=function(e,j){j=$extend({cssPrefix:"Checkbox",width:10,height:10,midStateEnabled:false},j);var h=this;var c,d;var f;var b;var a=j.midStateEnabled;var g=function(){e=it_ComponentUtils.init(h,e,j);j.cssPrefix.getClassArray().forEach(function(k){e.addClass(k)});c=new Element("div").inject(h.canvas);it_ComponentUtils.fixSmallElementForIE(c);it_ComponentUtils.absoluteAllOverParentComponent(c,h);d=new Element("div",{"class":j.cssPrefix.getClass("Pressed")}).inject(h.canvas);it_ComponentUtils.fixSmallElementForIE(d);it_ComponentUtils.absoluteAllOverParentComponent(d,h);d.set("opacity",0);it_EventUtils.setButtonMouseEvents(e,{mouseDown:function(){d.set("opacity",1)},mouseUp:function(){d.set("opacity",0)},mouseClick:function(){h.click()}});h.setState("off",false)};this.click=function(){var k;if(b=="off"){k=a?"mid":"on"}else{if(b=="mid"){k="on"}else{k="off"}}this.setState(k)};this.getState=function(){return b};this.getStateBoolean=function(){if(b=="off"){return false}else{if(b=="on"){return true}else{return null}}};this.setState=function(k,l){if(k===false){k="off"}else{if(k===true){k="on"}}if(b===k){return}if(f!=null){c.removeClass(f)}if(k==="off"){f=j.cssPrefix.getClass("Off")}else{if(k==="on"){f=j.cssPrefix.getClass("On")}else{if(k==="mid"){this.setMidStateEnabled(true);f=j.cssPrefix.getClass("Mid")}else{throw new Error("Unknown state: "+k)}}}b=k;c.addClass(f);if(l==null||l){this.fireEvent("stateChanged",[this,b])}};this.isMidStateEnabled=function(){return a};this.setMidStateEnabled=function(k){if(!k&&b=="mid"){h.setState("on")}a=k};g()};var it_Wrapper9=function(b,c){c=$extend({compatibilityMode:false,cssPrefix:"combo",topCssPrefix:null,keepContentWidth:false,keepContentHeight:false,content:null,topContent:null},c);if(c.content==null){throw new Error("options.content is missing")}c.content=$(c.content);c.content.setStyle("overflow","hidden");if(c.topContent!=null){c.topContent=$(c.topContent)}var l=this;var n,k,m,d,s,p,h,j;var a,e,f,q;var r=function(){b=it_ComponentUtils.init(l,b,c);var u;if(c.topCssPrefix!=null){u=c.topCssPrefix=it_CssUtils.toCssChain(c.topCssPrefix)}else{u=c.cssPrefix}n=g(u,c.compatibilityMode?"LeftCorner":"TopLeft","no-repeat");k=g(u,"Top","repeat-x");m=g(u,c.compatibilityMode?"RightCorner":"TopRight","no-repeat");d=g(c.cssPrefix,"Left","repeat-y");s=g(c.cssPrefix,"Right","repeat-y");p=g(c.cssPrefix,c.compatibilityMode?"LeftBotCorner":"BottomLeft","no-repeat");h=g(c.cssPrefix,c.compatibilityMode?"Bot":"Bottom","repeat-x");j=g(c.cssPrefix,c.compatibilityMode?"RightBotCorner":"BottomRight","no-repeat");if(c.compatibilityMode){o(n,k,m);o(p,h,j);d.setWidth(n.getWidth());s.setWidth(m.getWidth())}a=it_CssUtils.getHeight(k,true);e=it_CssUtils.getWidth(s,true);f=it_CssUtils.getHeight(h,true);q=it_CssUtils.getWidth(d,true);it_ComponentUtils.setSize(n,q,a);it_ComponentUtils.setSize(m,e,a);it_ComponentUtils.setSize(p,q,f);it_ComponentUtils.setSize(j,e,f);c.content.inject(b).setStyle("position","absolute");if(c.topContent!=null){c.topContent.inject(k).setStyle("position","absolute")}t(c.keepContentWidth,c.keepContentHeight)};var o=function(v,x,w){var u=x.getHeight();v.setStyles({height:u,width:x.getStyle("marginLeft").toInt()});w.setStyles({height:u,width:x.getStyle("marginRight").toInt()});x.setStyle("margin","0")};var g=function(w,u,v){return new Element("div",{"class":w.getClass(u),styles:{backgroundRepeat:v,position:"absolute"}}).inject(b)};this.doLayout=function(){t(false,false)};var t=function(x,w){var u=x?it_CssUtils.getWidth(c.content,true):it_CssUtils.getWidth(b,true);var v=w?it_CssUtils.getHeight(c.content,true):it_CssUtils.getHeight(b,true);if(x){b.setWidth(q+u+e)}else{c.content.setWidth(u)}if(w){b.setHeight(a+v+f)}else{c.content.setHeight(v)}c.content.setStyle("left",q);c.content.setStyle("top",a);k.setStyles({width:u,left:q});m.setStyle("left",q+u);d.setStyles({top:a,height:v});s.setStyles({top:a,left:q+u,height:v});p.setStyle("top",a+v);h.setStyles({left:q,top:a+v,width:u});j.setStyles({left:q+u,top:a+v})};r()};