var Salto={Version:"3.6.2.2"};Salto.TechnicalException=Class.create();Salto.TechnicalException.prototype={initialize:function(options){this.setOptions(options)},setOptions:function(options){this.options={name:"Salto.TechnicalException",message:"",parentException:null};Object.extend(this.options,options||{})},printStackTrace:function(){var message="Root:"+this.options.name+", message="+this.options.message;var exception=this.options.parentException;while(exception!==null){message=message+", origin:"+this.options.name+", message="+this.options.message;exception=exception.options.parentException}return message},toString:function(){return this.printStackTrace()}};Salto.PARSED_OK="Document contains no parsing errors";Salto.PARSED_EMPTY="Document is empty";Salto.PARSED_UNKNOWN_ERROR="Not well-formed or other error";Salto.DOMParser=Class.create();Salto.DOMParser.prototype={initialize:function(){},createParser:function(){return Try.these(function(){return new ActiveXObject("Msxml2.DOMDocument.5.0")},function(){return new ActiveXObject("Msxml2.DOMDocument.4.0")},function(){return new ActiveXObject("Msxml2.DOMDocument.3.0")},function(){return new ActiveXObject("MSXML2.DOMDocument")},function(){return new ActiveXObject("MSXML.DOMDocument")},function(){return new ActiveXObject("Microsoft.XMLDOM")},function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new DOMParser()})||null},parseFromString:function(xmlString){var parser=this.createParser();var oDomDoc=null;if(document.all){parser.async=false;parser.loadXML(xmlString);oDomDoc=parser}else{oDomDoc=parser.parseFromString(xmlString,"text/xml")}return oDomDoc},trim:function(str){return str.replace(/^\s*|\s*$/g,"")},getParseErrorText:function(oDoc){if(document.all){var parseErrorText=Salto.PARSED_OK;if(oDoc.parseError.errorCode!=0){parseErrorText="XML Parsing Error: "+oDoc.parseError.reason+"\nLocation: "+oDoc.parseError.url+"\nLine Number "+oDoc.parseError.line+", Column "+oDoc.parseError.linepos+":\n"+this.trim(oDoc.parseError.srcText)+"\n";for(var i=0;i<oDoc.parseError.linepos;i++){parseErrorText+="-"}parseErrorText+="^\n"}else{if(oDoc.documentElement==null){parseErrorText=Salto.PARSED_EMPTY}}return parseErrorText}else{var parseErrorText=Salto.PARSED_OK;if(!oDoc.documentElement){parseErrorText=Salto.PARSED_EMPTY}else{if(oDoc.documentElement.tagName=="parsererror"){parseErrorText=oDoc.documentElement.firstChild.data;parseErrorText+="\n"+oDoc.documentElement.firstChild.nextSibling.firstChild.data}else{if(oDoc.getElementsByTagName("parsererror").length>0){var parsererror=oDoc.getElementsByTagName("parsererror")[0];parseErrorText=this.getText(parsererror,true)+"\n"}else{if(oDoc.parseError&&oDoc.parseError.errorCode!=0){parseErrorText=Salto.PARSED_UNKNOWN_ERROR}}}}return parseErrorText}},getText:function(oNode,deep){var s="";var nodes=oNode.childNodes;for(var i=0;i<nodes.length;i++){var node=nodes[i];var nodeType=node.nodeType;if(nodeType==Node.TEXT_NODE||nodeType==Node.CDATA_SECTION_NODE){s+=node.data}else{if(deep==true&&(nodeType==Node.ELEMENT_NODE||nodeType==Node.DOCUMENT_NODE||nodeType==Node.DOCUMENT_FRAGMENT_NODE)){s+=this.getText(node,true)}}}return s}};Salto.BaseGUIComponent=function(){};Salto.BaseGUIComponent.prototype={isGUIReferenced:function(){var elt=this.getGUIContainer();if(elt&&(!elt.parentNode||elt.parentNode==null)){elt=null;return false}else{if(elt==null){return false}else{elt=null;return true}}},getGUIContainer:function(){if(this.container){return this.container}else{if(this.containerId&&this.containerId!==null){return $(this.containerId)}else{return null}}}};Salto.Stack=Class.create();Salto.Stack.prototype={initialize:function(){this.index=0;this.data=new Array()},push:function(elt){this.data[this.index]=elt;this.index++},peek:function(){if(this.index==0){return null}var peekIndex=this.index-1;return this.data[peekIndex]},pop:function(){if(this.index==0){return null}this.index--;return this.data[this.index]},isEmpty:function(){return this.index==0},toString:function(){if(this.index==0){return }var s="";for(var i=0;i<this.index;i++){s=s+i.toString()+":"+this.data[i]+" "}return(s)},size:function(){return this.index},clear:function(){this.index=0;this.data.clear()},debug:function(){fwkDebug(this.toString()+"\n")}};Salto.FifoBuffer=Class.create();Salto.FifoBuffer.prototype={initialize:function(options){this.data=new Array();this.setOptions(options)},setOptions:function(options){this.options={size:25};Object.extend(this.options,options||{})},isFull:function(){return this.data.length==this.options.size},add:function(elt){if(this.isFull()){this.remove()}this.data.push(elt)},get:function(){if(this.data.length==0){return null}return this.data[0]},remove:function(){if(this.data.length==0){return null}var result=this.data[0];this.data[0]=null;this.data=this.data.compact();return result},isEmpty:function(){return this.length==0},toString:function(){return this.data.inspect()},size:function(){return this.data.length},clear:function(){this.data.clear()},debug:function(){fwkDebug(this.toString()+"\n")}};Salto.FwkAjaxAppender=Class.create();Salto.FwkAjaxAppender.prototype={initialize:function(logger,loggingUrl){logger.onlog.addListener(this.doAppend.bind(this));logger.onclear.addListener(this.doClear.bind(this));this.logger=logger;this.loggingUrl=loggingUrl||"log4js.jsp"},doAppend:function(loggingEvent){var msg="__AjaxCall__=true&log4js.client="+encodeURIComponent(navigator.userAgent)+"&log4js.category="+encodeURIComponent(loggingEvent.categoryName)+"&log4js.level="+encodeURIComponent(loggingEvent.level.toString())+"&log4js.msg="+encodeURIComponent(loggingEvent.message);var request=new Ajax.Request(this.loggingUrl,{parameters:msg})},logged:function(){},doClear:function(){}};Salto.BrowserUtils=Class.create();Object.extend(Salto.BrowserUtils,{historyBack:function(){history.back()},reloadPage:function(){if(window.location.reload){window.location.reload(true)}else{window.location.href=unescape(window.location.pathname)}}});Salto.EventUtils=Class.create();Object.extend(Salto.EventUtils,{stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation()}else{ev.cancelBubble=true}},isReturnKey:function(ev){return ev.keyCode==Event.KEY_RETURN},addOnload:function(newFunction){var oldOnload=window.onload;if(typeof oldOnload=="function"){window.onload=function(){if(oldOnload){oldOnload()}newFunction()}}else{window.onload=newFunction}}});Salto.NumberUtils=Class.create();Object.extend(Salto.NumberUtils,{isInRange:function(value,minVal,maxValue){try{var valueAsNumber=parseInt(value,10);return(valueAsNumber>=minVal)&&(valueAsNumber<=maxValue)}catch(e){return false}}});Salto.is_opera=/opera/i.test(navigator.userAgent);Salto.is_ie=(/msie/i.test(navigator.userAgent)&&!Salto.is_opera);Salto.is_ie6=(Salto.is_ie&&/msie 6\.0/i.test(navigator.userAgent));Salto.is_ie5=(Salto.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Salto.is_mac_ie=(/msie.*mac/i.test(navigator.userAgent)&&!Salto.is_opera);Salto.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Salto.is_konqueror=/Konqueror/i.test(navigator.userAgent);Salto.is_gecko=/Gecko/i.test(navigator.userAgent);Salto.DateHelper=Class.create();Salto.DateHelper.prototype={initialize:function(options){this.setOptions(options)},setOptions:function(options){this.options={getDateFromWeekNumberCallback:this.defaultGetDateFromWeekNumberCallback,getWeekNumberFromDateCallback:this.defaultGetWeekNumberFromDateCallback};Object.extend(this.options,options||{})},defaultGetWeekNumberFromDateCallback:function(date,options){return date.getWeekNumber()},defaultGetDateFromWeekNumberCallback:function(year,week,options){year=+year;week=+week;if(week>53||week<1){return null}var firstDayOfYear=new Date(year,0,1);var firstDayOfWeek=options.firstDayOfWeek?+options.firstDayOfWeek:0;var amountOfDaysToAdd=7*(week-1);firstDayOfYear.setDate(firstDayOfYear.getDate()+amountOfDaysToAdd-7);var wn=options.getWeekNumberFromDateCallback(firstDayOfYear,options);while(wn!=null&&!((wn==week)&&(firstDayOfYear.getDay()==firstDayOfWeek))){firstDayOfYear.setDate(firstDayOfYear.getDate()+1);if(firstDayOfYear.getFullYear()>=(year+1)&&firstDayOfYear.getDate()>7){return null}wn=options.getWeekNumberFromDateCallback(firstDayOfYear,options)}return firstDayOfYear},parseDate:function(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var tmpYear;var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";var weekInYear=-1;var dateFromWeekNumber;var yearIsSet=false;var monthIsSet=false;var dateIsSet=false;while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++)}if(token=="yyyy"||token=="yy"||token=="y"||token=="YYYY"||token=="YY"||token=="Y"){if(token=="yyyy"||token=="YYYY"){x=4;y=4}if(token=="yy"||token=="YY"){x=2;y=2}if(token=="y"||token=="Y"){x=2;y=4}tmpYear=_getInt(val,i_val,x,y);if(tmpYear!=null){i_val+=tmpYear.length;if(!yearIsSet){year=tmpYear;if(year==null){return 0}if(year.length==2){if(year>70){year=1900+(year-0)}else{year=2000+(year-0)}}if(token=="yyyy"||token=="yy"||token=="y"){yearIsSet=true}}}else{return 0}}else{if(token=="ww"||token=="w"){weekInYear=_getInt(val,i_val,token.length,2);if(weekInYear==null||(weekInYear<1)||(weekInYear>53)){return 0}i_val+=weekInYear.length}else{if(token=="MMM"||token=="NNN"){month=0;for(var i=0;i<MONTH_NAMES.length;i++){var month_name=MONTH_NAMES[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){if(token=="MMM"||(token=="NNN"&&i>11)){month=i+1;if(month>12){month-=12}i_val+=month_name.length;break}}}if((month<1)||(month>12)){return 0}monthIsSet=true}else{if(token=="EE"||token=="E"){for(var i=0;i<DAY_NAMES.length;i++){var day_name=DAY_NAMES[i];if(val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()){i_val+=day_name.length;break}}}else{if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return 0}i_val+=month.length;monthIsSet=true}else{if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return 0}i_val+=date.length;dateIsSet=true}else{if(token=="hh"||token=="h"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>12)){return 0}i_val+=hh.length}else{if(token=="HH"||token=="H"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>23)){return 0}i_val+=hh.length}else{if(token=="KK"||token=="K"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>11)){return 0}i_val+=hh.length}else{if(token=="kk"||token=="k"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>24)){return 0}i_val+=hh.length;hh--}else{if(token=="mm"||token=="m"){mm=_getInt(val,i_val,token.length,2);if(mm==null||(mm<0)||(mm>59)){return 0}i_val+=mm.length}else{if(token=="ss"||token=="s"){ss=_getInt(val,i_val,token.length,2);if(ss==null||(ss<0)||(ss>59)){return 0}i_val+=ss.length}else{if(token=="a"){if(val.substring(i_val,i_val+2).toLowerCase()=="am"){ampm="AM"}else{if(val.substring(i_val,i_val+2).toLowerCase()=="pm"){ampm="PM"}else{return 0}}i_val+=2}else{if(val.substring(i_val,i_val+token.length)!=token){return 0}else{i_val+=token.length}}}}}}}}}}}}}}}if(i_val!=val.length){return 0}if(weekInYear>=0){dateFromWeekNumber=this.options.getDateFromWeekNumberCallback(year,weekInYear,this.options);if(dateFromWeekNumber==null){return 0}if(!monthIsSet){month=dateFromWeekNumber.getMonth()+1}if(!dateIsSet){if(monthIsSet&&yearIsSet){date=1;while(this.options.getWeekNumberFromDateCallback(new Date((year-0),(month-1),date),this.options)!=weekInYear&&date<31){date=date+1}}else{date=dateFromWeekNumber.getDate()}}if(!yearIsSet&&weekInYear>50&&month==1){year=(year-0)+1}else{if(!yearIsSet&&weekInYear==1&&month==12){year=(year-0)-1}}}if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return 0}}else{if(date>28){return 0}}}if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return 0}}if(hh<12&&ampm=="PM"){hh=hh-0+12}else{if(hh>11&&ampm=="AM"){hh-=12}}var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime()},formatDate:function(dateToFormat,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=dateToFormat.getYear()+"";var M=dateToFormat.getMonth()+1;var d=dateToFormat.getDate();var E=dateToFormat.getDay();var H=dateToFormat.getHours();var m=dateToFormat.getMinutes();var s=dateToFormat.getSeconds();var w=this.options.getWeekNumberFromDateCallback(dateToFormat,this.options);fwkDebug("dateToFormat:"+dateToFormat+",w"+w);var yw;if(w==0||w==1){if(dateToFormat.getMonth()==11){yw=""+(dateToFormat.getYear()+1)}else{yw=""+dateToFormat.getYear()}}else{if(w==52||w==53){if(dateToFormat.getMonth()==0){yw=""+(dateToFormat.getYear()-1)}else{yw=""+dateToFormat.getYear()}}else{yw=""+dateToFormat.getYear()}}if(yw.length<4){yw=""+(yw-0+1900)}var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length<4){y=""+(y-0+1900)}value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["Y"]=""+yw;value["YYYY"]=yw;value["YY"]=yw.substring(2,4);value["M"]=M;value["MM"]=LZ(M);value["MMM"]=MONTH_NAMES[M-1];value["NNN"]=MONTH_NAMES[M+11];value["d"]=d;value["dd"]=LZ(d);value["E"]=DAY_NAMES[E+7];value["EE"]=DAY_NAMES[E];value["H"]=H;value["HH"]=LZ(H);if(H==0){value["h"]=12}else{if(H>12){value["h"]=H-12}else{value["h"]=H}}value["hh"]=LZ(value["h"]);if(H>11){value["K"]=H-12}else{value["K"]=H}value["k"]=H+1;value["KK"]=LZ(value["K"]);value["kk"]=LZ(value["k"]);if(H>11){value["a"]="PM"}else{value["a"]="AM"}value["m"]=m;value["mm"]=LZ(m);value["s"]=s;value["ss"]=LZ(s);value["w"]=w;value["ww"]=LZ(w);while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++)}if(value[token]!=null&&value[token]!=undefined){result=result+value[token]}else{result=result+token}}return result},isDate:function(dateValue,format){var date=this.parseDate(dateValue,format);return(date!=0)}};Salto.CalendarHelper=Class.create();Object.extend(Salto.CalendarHelper,{onCloseCallback:function(cal){if(cal.dateClicked){if(cal.params.onDateChange){cal.params.onDateChange(cal.date);cal.dateClicked=false}}cal.hide();cal.destroy()},defaultFlatCallback:function(theCalendar){if(theCalendar.dateClicked){var params=theCalendar.params;var elementToUpdate=document.getElementById(theCalendar.params.inputFieldId);if(elementToUpdate==undefined){alert("Could not find element to update with id:"+theCalendar.params.inputFieldId)}elementToUpdate.value=theCalendar.dateHelper.formatDate(theCalendar.date,params.ifFormat);if(typeof elementToUpdate.onchange=="function"){elementToUpdate.onchange()}}},customWeekNumberCallbackForCalendar:function(when,theCalendar){throw new Salto.TechnicalException({message:"Not overriden in project"})},customWeekNumberCallback:function(when,options){throw new Salto.TechnicalException({message:"Not overriden in project"})}});Salto.FwkLogging=Class.create();Salto.FwkLogging.LOGGING_URL=SALTO_FWK_CONTEXT_PATH+"/_fwkLogJsError.do";Salto.FwkLogging.prototype={initialize:function(){this.fwkLogger=Log4js.getLogger("fwk");this.fwkLogger.setLevel(Log4js.Level.OFF);this.fwkLogger.addAppender(new ConsoleAppender(this.fwkLogger));this.fwkErrorLogger=Log4js.getLogger("fwkError");this.fwkErrorLogger.setLevel(Log4js.Level.ERROR);this.fwkErrorLogger.addAppender(new Salto.FwkAjaxAppender(this.fwkErrorLogger,Salto.FwkLogging.LOGGING_URL))}};Salto.LOADING_POPUP_ID="SALTO_LOADING_POPUP_ID";var LOG=new Salto.FwkLogging();Salto.HistoryUtils=Class.create();Salto.HistoryUtils.HISTO_MANAGER_INITIALIZED=false;Object.extend(Salto.HistoryUtils,{historyChange:function(newLocation,historyData){if(historyData!=null){if(historyData.isForm===true){if(confirm("Form submission : are you sure ?")){Salto.Ajax.serverCallWithNoHistory(historyData.url,historyData.parameters)}}else{Salto.Ajax.serverCallWithNoHistory(historyData.url,historyData.parameters)}}else{if(newLocation.length>=1&&newLocation[0]=="~"){if(confirm("Go back to start page ?")){Salto.BrowserUtils.reloadPage()}}}},fwkInitialize:function(){if(Salto.CallbackUtils.isHistoryActive()&&Salto.HistoryUtils.HISTO_MANAGER_INITIALIZED===false){dhtmlHistory.initialize();dhtmlHistory.addListener(Salto.HistoryUtils.historyChange);Salto.HistoryUtils.HISTO_MANAGER_INITIALIZED=true}}});function fwkDebug(msg){LOG.fwkLogger.debug(msg)}function fwkError(msg,err){var theLogMsg=msg+"\n"+err;LOG.fwkErrorLogger.error(theLogMsg);alert(theLogMsg)}function fwkSilentError(msg,err){var theLogMsg=msg+"\n"+err;LOG.fwkErrorLogger.error(theLogMsg)}function fwkSetComponent(node,object){node.modelObj=object}function fwkGetComponent(node){return $(node).modelObj}Salto.formErrorHandler=function(src,node){var formName=node.getAttribute("formName");var formElementName=node.getAttribute("formElementName");var indice=node.getAttribute("indice");var inError=node.getAttribute("inError");fwkSetFormElementInError(formName,formElementName,indice,"true"==inError)};function fwkSetFieldInError(theElement,indice,inError){var elementToSet=theElement;if(indice){elementToSet=theElement[indice]}if(inError){if(!Element.hasClassName(elementToSet,"inputError")){Element.addClassName(elementToSet,"inputError")}}else{Element.removeClassName(elementToSet,"inputError")}}function fwkSetFormElementInError(formName,elementName,indice,inError){var theForm=document.forms.namedItem(formName);if(theForm){var theElement=theForm[elementName];if(theElement){if(theElement.length){if(indice){fwkSetFieldInError(theElement,indice,inError)}else{for(var i=0;i<theElement.length;++i){var currentElement=theElement[i];fwkSetFieldInError(currentElement,null,inError)}}}else{fwkSetFieldInError(theElement,null,inError)}}}else{if(inError===true){fwkError("Form '"+formName+"' not found")}}}function fwkGetCenterPosition(width,height){var frameWidth=0;var frameHeight=0;if(self.innerWidth){frameWidth=self.innerWidth;frameHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientWidth){frameWidth=document.documentElement.clientWidth;frameHeight=document.documentElement.clientHeight}else{frameWidth=document.body.clientWidth;frameHeight=document.body.clientHeight}}var widthResult=(frameWidth-width)/2;var heightResult=(frameHeight-height)/2;return[widthResult,heightResult]}function fwkOpenPopup(src,node){var popupConfig=node.getElementsByTagName("attribute").item(0);if(popupConfig){var width=popupConfig.getAttribute("popupWidth");var height=popupConfig.getAttribute("popupHeight");if(width==undefined||width===null){width=400}else{width=parseInt(width,10)}if(height==undefined||height===null){height=300}else{height=parseInt(height,10)}var title=popupConfig.getAttribute("popupTitle");var type=popupConfig.getAttribute("type");var opts=new Object();opts.id=popupConfig.getAttribute("popupId");var canResize=popupConfig.getAttribute("canResize");if(canResize!=null){opts.showResize=canResize}var showMinButton=popupConfig.getAttribute("showMinButton");if(showMinButton!=null){opts.showMinButton=showMinButton}var showMaxButton=popupConfig.getAttribute("showMaxButton");if(showMaxButton!=null){opts.showMaxButton=showMaxButton}var showStatus=popupConfig.getAttribute("showStatus");if(showStatus!=null){opts.showStatus=showStatus}var showCloseButton=popupConfig.getAttribute("showCloseButton");if(showCloseButton!=null){opts.showCloseButton=showCloseButton}opts.autoCloseAfterNMs=popupConfig.getAttribute("autoCloseAfterNMs")||null;var v=null;if(v=popupConfig.getAttribute("showEffect")){opts.showEffect=v.evalJSON()}if(v=popupConfig.getAttribute("closeEffect")){opts.closeEffect=v.evalJSON()}if(v=popupConfig.getAttribute("showEffectOptions")){opts.showEffectOptions=v.evalJSON()}if(v=popupConfig.getAttribute("closeEffectOptions")){opts.closeEffectOptions=v.evalJSON()}opts.width=width;opts.height=height;opts.content=getFirstChildContent(node.getElementsByTagName("data").item(0));var position=fwkGetCenterPosition(width,height);opts.left=position[0];opts.top=position[1];opts.top+=Screen.getScrollTop();opts.left+=Screen.getScrollLeft();if(opts.top<0){opts.top=0}if(opts.left<0){opts.left=0}if(title){opts.showTitle=true;opts.title=title}if(Prototype.Browser.IE){opts.canDrag=true}if(!type){type=""}if(type=="modal"){opts.modal=true}else{opts.modal=false}fwkDebug("Opening popup width="+opts.width+", height="+opts.height+", top="+opts.top+", left="+opts.left+", modal="+opts.modal+", content="+opts.content+", title="+opts.title);var oldPopup=Salto.WindowUtils.getWindowById(opts.id);if(oldPopup==null){var popup=Salto.Window.setup(opts);popup=null}else{oldPopup.setTitle(opts.title);oldPopup.setContent(opts.content);oldPopup.setWidth(opts.width);oldPopup.setHeight(opts.height);oldPopup.show()}oldPopup=null}else{fwkError("Could not open popup, bad response format")}popupConfig=null}function fwkLoadJs(src){var scs=src.getElementsByTagName("SCRIPT");fwkDebug("Will execute :"+scs.length+" scripts");var arrayOfJsScript=new Array();for(var j=0;j<scs.length;j++){var jsCode=scs[j].innerHTML;if(jsCode.indexOf("function ")==-1){arrayOfJsScript[arrayOfJsScript.length]=[jsCode,"S"]}else{arrayOfJsScript[arrayOfJsScript.length]=[jsCode,"F"]}}fwkEvalScripts(arrayOfJsScript)}function fwkEvaluateScriptText(text){var scripts=text.extractScripts();var jsScripts=new Array();for(var i=0;i<scripts.length;++i){if(scripts[i].indexOf("function ")==-1){jsScripts[jsScripts.length]=[scripts[i],"S"]}else{jsScripts[jsScripts.length]=[scripts[i],"F"]}}fwkEvalScripts(jsScripts)}function fwkEvalScripts(scripts){for(var j=0;j<scripts.length;j++){var scriptTextWithoutComment=stripComment(scripts[j][0]);if(scripts[j][1]=="S"){if(scriptTextWithoutComment!=null){eval(scriptTextWithoutComment)}else{fwkSilentError("Bad commented script:"+scripts[j][0])}}else{if(scriptTextWithoutComment!=null){var index0=scriptTextWithoutComment.indexOf("function ");var index1=-1;while(index0>=0){index1=scriptTextWithoutComment.indexOf("function ",index0+1);var funcName=scriptTextWithoutComment.substring(index0+9,scriptTextWithoutComment.indexOf("(",index0));if(index1>=0){var func=scriptTextWithoutComment.substring(index0,index1)}else{var func=scriptTextWithoutComment.substring(index0)}eval("window."+funcName+" = "+func);index0=index1}}else{fwkSilentError("Bad commented script:"+scripts[j][0])}}}}function fwkAppendToDocument(srcElt,node){var nodeBefore=null;var nodeContent=null;if(srcElt!=null){nodeBefore=srcElt;nodeContent=" "+getFirstChildContent(node.getElementsByTagName("data").item(0))}else{nodeBefore=document.getElementsByTagName("body")[0].lastChild;nodeContent=" "+getFirstChildContent(node.getElementsByTagName("data").item(0))}var scripts=nodeContent.extractScripts();new Insertion.After_FixIE(nodeBefore,nodeContent.stripScripts());for(var i=0;i<scripts.length;++i){eval(stripComment(scripts[i]))}Element.hide(srcElt)}function stripComment(textScript){if(Prototype.Browser.IE){var indexOfComment=textScript.indexOf("<!--");if(indexOfComment==-1){return textScript}else{textScript=textScript.substring(indexOfComment+"<!--".length);indexOfComment=textScript.lastIndexOf("-->");if(indexOfComment>0){textScript=textScript.substring(0,indexOfComment);return textScript}else{return null}}}else{return textScript}}function fwkAjaxInner(src,node){if(src.nodeName=="SELECT"&&document.all){src.innerHTML="";var ind=src.outerHTML.indexOf("</SELECT>");src.outerHTML=src.outerHTML.substring(0,ind)+getFirstChildContent(node.getElementsByTagName("data").item(0))+"</SELECT>"}else{try{var value=" "+getFirstChildContent(node.getElementsByTagName("data").item(0));src.innerHTML=value}catch(e){alert("salto.js:fwkAjaxInner():Error validating HTML "+fwkPrintError(e)+", may be FORM inside FORM")}}if(src.style.display=="none"){var showNodes=node.getElementsByTagName("show");var show=(showNodes&&showNodes.length>0)?(showNodes.item(0).firstChild.data=="true"):true;if(show===true){src.style.display=""}}fwkLoadJs(src)}function fwkAjaxAddElt(src,node){var elt=document.createElement("DIV");elt.innerHTML=form.code.value;for(var i=0;i<elt.childNodes.length;i++){document.getElementById("res").appendChild(elt.childNodes[i])}}function fwkHide(src,node){src.style.display="none"}function fwkShow(src,node){src.style.display="inline"}function fwkAjaxAddRowToTable(src,node){var saltoTable=fwkGetComponent($(src.id));saltoTable.addRowsWithHtml(node.firstChild.data)}Salto.loadIframeXml=function(elt){if(document.all){var result=elt.contentWindow.document.XMLDocument.getElementsByTagName("response");Salto.loadServerXml(result,null,null)}else{var result=elt.contentWindow.document.documentElement.getElementsByTagName("response");Salto.loadServerXml(result,null,null)}};Salto.loadServerXml=function(responses,win,defaultSrcElt){if(!win){win=window}for(var i=0;i<responses.length;i++){var srcElt=defaultSrcElt;var elt=responses.item(i).getElementsByTagName("element");if(elt.length>0){var theElt=elt.item(0);if(theElt.getAttribute("type")=="1"){try{srcElt=win.document.getElementById(theElt.getAttribute("name"))}catch(exception){throw (new Salto.TechnicalException({message:"Could not evaluate :"+theElt.getAttribute("name")}))}if(srcElt==null){throw new Salto.TechnicalException({message:"DOM Element "+theElt.getAttribute("name")+" is not present in page"})}}else{if(theElt.getAttribute("type")=="2"){try{srcElt=win.eval(theElt.childNodes[0].data)}catch(exception){throw (new Salto.TechnicalException({message:"Could not evaluate :"+theElt.childNodes[0].data}))}if(srcElt==null){throw new Salto.TechnicalException({message:"DOM Element "+theElt.childNodes[0].data+" is not present in page"})}}else{fwkDebug("Unknown type for js element")}}if(srcElt==null){alert("Salto.loadServerXml:No source for elt "+i)}else{fwkDebug("Salto.loadServerXml:response "+i+",source "+srcElt.nodeName)}}var actions=responses.item(i).getElementsByTagName("action");for(var j=0;j<actions.length;j++){var theAction=actions.item(j);var theType=theAction.getAttribute("type");if(theType=="1"){if(Salto.is_opera||Salto.is_khtml){eval(theAction.childNodes[0].data)}else{win.eval(theAction.childNodes[0].data)}}else{if(theType=="2"){eval(theAction.getAttribute("name")).apply(win,[srcElt,theAction])}else{fwkDebug("Salto.loadServerXml:Incorrect type")}}}srcElt=null}};function AjaxCall(url,objectReceivingTheCall,parameters,noLoadingPopup){Salto.Ajax.serverCallWithParam({url:url,isForm:false,theParameters:parameters?parameters:"",container:(objectReceivingTheCall?objectReceivingTheCall:null),theNoPopup:(noLoadingPopup?noLoadingPopup:false)})}function FormAjaxCall(url,form,objectReceivingTheCall,noLoadingPopup){Salto.Ajax.serverCallWithParam({url:url,isForm:true,theForm:(form?form:null),container:(objectReceivingTheCall?objectReceivingTheCall:null),theNoPopup:(noLoadingPopup?noLoadingPopup:false)})}Salto.Ajax={serverCallWithNoHistory:function(url,theParameters,theNoPopup){var options={method:"post",parameters:theParameters,noPopup:false,noHistory:true};new Ajax.DefaultUpdater(window,url,options,window)},serverCallWithParam:function(options){if(Prototype.Browser.IE){Salto.CallbackUtils.ieControlsHack()}var theCompleteParameters={};Object.extend(theCompleteParameters,options.url.toQueryParams());var isForm=false;if(options.theForm){isForm=true;Object.extend(theCompleteParameters,{__FormAjaxCall__:true});if(options.theForm!=null){if(options.computedHash!=null){Object.extend(theCompleteParameters,options.computedHash)}else{Object.extend(theCompleteParameters,$(options.theForm).serialize(true))}}}else{isForm=false;Object.extend(theCompleteParameters,{__AjaxCall__:true});Object.extend(theCompleteParameters,options.theParameters.toQueryParams())}var indexOfHyphen=options.url.indexOf("?");var newUrl=indexOfHyphen>=0?options.url.substring(0,indexOfHyphen):options.url;var newOptions={method:"post",parameters:theCompleteParameters,noPopup:options.theNoPopup?(options.theNoPopup===true):false,isForm:options.isForm?(options.isForm===true):isForm,noHistory:options.noHistory?(options.noHistory===true):false};new Ajax.DefaultUpdater(options.container,newUrl,newOptions,options.window)}};Salto.isLoadingEnCours=new Boolean(false);Salto.LOADING_POPUP=null;Salto.fwkBlockKeyEvent=function(evt){if(Salto.isLoadingEnCours&&Salto.isLoadingEnCours===true){Event.stop(evt);return false}return true};Salto.fwkBlockMouseEvent=function(evt){if(Salto.isLoadingEnCours&&Salto.isLoadingEnCours===true){if(document.all){alert("Blocked")}Event.stop(evt);return false}return true};Salto.fwkOpenLoadingPopup=function(){Salto.fwkOpenLoadingPopup(null)};Salto.fwkOpenLoadingPopup=function(url){var isPopupCustomizedPerUrl=false;var userOptions=Salto.CallbackUtils.getPopupOptionsWithUrl(url);if(userOptions!=null){isPopupCustomizedPerUrl=true;if(Salto.LOADING_POPUP){Salto.LOADING_POPUP.close();Salto.LOADING_POPUP=null}}if(Salto.LOADING_POPUP&&Salto.LOADING_POPUP.config.isPopupCustomizedPerUrl){Salto.LOADING_POPUP.close();Salto.LOADING_POPUP=null}if(!Salto.LOADING_POPUP){var opts={id:Salto.LOADING_POPUP_ID,showResize:false,showStatus:false,showMinButton:false,showMaxButton:false,showCloseButton:false,modal:true,canDrag:false,title:"Loading",showTitle:false,content:'<div class="indicator_loading"/>',width:35,height:35,isPopupCustomizedPerUrl:isPopupCustomizedPerUrl};if(!userOptions){userOptions=Salto.CallbackUtils.getPopupOptions()}if(userOptions!=null){Object.extend(opts,userOptions)}var position=fwkGetCenterPosition(opts.width,opts.height);opts.left=position[0];opts.top=position[1];opts.left+=Screen.getScrollLeft();opts.top+=Screen.getScrollTop();if(opts.top<0){opts.top=0}if(opts.left<0){opts.left=0}Salto.LOADING_POPUP=Salto.Window.setup(opts)}Salto.LOADING_POPUP.showAtCenter();var hideInactiveZone=$("SALTO_INACTIVE_ZONE_ID");if(hideInactiveZone!=null){hideInactiveZone.style.zIndex=Salto.Window.maxNumber++}Salto.LOADING_POPUP.raise();Salto.isLoadingEnCours=true};Salto.fwkDisableEnableSelects=function(disable,contentNode){if(Prototype.Browser.IE){var children=document.body.getElementsByTagName("SELECT");for(var i=0;i<children.length;i++){var theChild=children[i];if(contentNode&&fwkIsParent(contentNode,theChild)){continue}if(theChild.style){if(disable){var stack=theChild.fwkPopupStatus;if(!stack){stack=new Salto.Stack();theChild.fwkPopupStatus=stack}stack.push(theChild.style.visibility);theChild.style.visibility="hidden";stack=null}else{var stack=theChild.fwkPopupStatus;if(stack&&stack!=null){var oldVisibility="";if(!stack.isEmpty()){oldVisibility=stack.pop();theChild.style.visibility=oldVisibility}else{theChild.style.visibility=""}}else{theChild.style.visibility=""}stack=null}}theChild=null}children=null}};Salto.fwkCloseLoadingPopup=function(){if(Salto.LOADING_POPUP){Salto.LOADING_POPUP.hide()}Salto.isLoadingEnCours=false};Ajax.DefaultUpdater=Class.create();Ajax.DefaultUpdater.COUNTER=0;Object.extend(Object.extend(Ajax.DefaultUpdater.prototype,Ajax.Request.prototype),{initialize:function(container,url,options,win){if(!options.noPopup&&Salto.isLoadingEnCours===true){return }if(!win){this.win=window}else{this.win=win}this.container=container;this.transport=Ajax.getTransport();options.onException=this.onException.bind(this);options.onSuccess=this.onSuccess.bind(this);options.onFailure=this.onFailure.bind(this);options.on400=this.on400.bind(this);options.on302=this.on302.bind(this);this.setOptions(options);fwkDebug("request: "+url+"\n\tparam"+options.parameters);if(!options.noPopup){this._defaultPopup(url)}this.url=url;if(!options.noHistory){this.saveHistory(url,options)}this.request(url)},saveHistory:function(url,options){if(Salto.CallbackUtils.isHistoryActive()){Salto.HistoryUtils.fwkInitialize();var data=new Object();data.url=url;data.parameters=options.parameters;data.isForm=options.isForm;dhtmlHistory.add("~"+url+"_"+Ajax.DefaultUpdater.COUNTER,data);Ajax.DefaultUpdater.COUNTER++}},setOptions:function(options){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",noPopup:false};Object.extend(this.options,options||{})},_defaultPopup:function(url){Salto.fwkOpenLoadingPopup(url)},disableEnableSelects:function(disable){Salto.fwkDisableEnableSelects(disable)},_closeLoadingPopup:function(){if(!(this.options.noPopup&&this.options.noPopup===true)){Salto.fwkCloseLoadingPopup()}},respondToError:function(){alert("Error on server call of url '"+this.url+"', status code="+this.transport.status+", status text="+this.transport.statusText)},on400:function(transport){this._closeLoadingPopup();alert(this.transport.statusText+" for URL:"+this.url)},handleTimeout:function(){alert("Redirecting to Login page after session timeout");Salto.BrowserUtils.reloadPage()},on302:function(transport){this.handleTimeout()},onException:function(request,exception){alert("An exception occured interpreting XML response for URL: "+request.url+"\r\n The following error occured : \r\n"+fwkPrintError(exception))},onSuccess:function(transport){this._closeLoadingPopup();var contentType=this.getHeader("Content-type");if(this.transport.responseXML&&this.transport.responseXML.getElementsByTagName("AjaxResponse").length>0){var responses=this.transport.responseXML.getElementsByTagName("response");fwkDebug("nb response "+responses.length);Salto.loadServerXml(responses,this.win,this.container);var scrs=this.transport.responseXML.getElementsByTagName("script");fwkDebug("nb scripts "+scrs.length);for(var i=0;i<scrs.length;i++){try{this.win.eval(scrs.item(i).firstChild.data)}catch(e){throw e}}Salto.WindowUtils.focusCurrentPopup()}else{if(this.transport.responseText&&(this.transport.responseXML==null||this.transport.responseXML.getElementsByTagName("AjaxResponse").length==0)){if(Salto.CallbackUtils.isLoginPage(this.transport,contentType)){this.handleTimeout()}else{if(contentType.indexOf("text/xml")==-1&&contentType.indexOf("application/xml")==-1){alert("Response is not XML, 3 reasons may explain this error:\n-session timeout occured\n -development error (Unhandled exception)\n-development error (Corrupt HTML)\nResponse:\n"+this.transport.responseText)}else{alert("XML Response contains parsing error:\n-development error (Unhandled exception)\n-development error (Corrupt HTML)\nXML Errors:\n"+this.getErrorsInDocument(this.transport.responseText)+"\n Response:\n"+this.transport.responseText)}}}else{if(Salto.CallbackUtils.isLoginPage(this.transport,contentType)){this.handleTimeout()}else{if(contentType.indexOf("text/xml")==-1&&contentType.indexOf("application/xml")==-1){alert("Response is not XML, 3 reasons may explain this error:\n-session timeout occured\n-development error (Unhandled exception)\n-development error (Corrupt HTML)\nResponse:\n"+this.transport.responseText)}else{alert("XML Response contains parsing error:\n-development error (Unhandled exception)\n-development error (Corrupt HTML)\nResponse:\n"+this.transport.responseText)}}}}try{fwkInit()}catch(e){alert("salto.js:updateContent():Error calling fwkInit() "+fwkPrintError(e))}},onFailure:function(transport){this._closeLoadingPopup();var contentType=this.getHeader("Content-type");if(Salto.CallbackUtils.isLoginPage(this.transport,contentType)){this.handleTimeout()}else{this.respondToError()}},getErrorsInDocument:function(xmlString){var parser=new Salto.DOMParser();var oDomDoc=parser.parseFromString(xmlString);return parser.getParseErrorText(oDomDoc)}});function fwkInit(){}Salto.FwkUtils=Class.create();Object.extend(Salto.FwkUtils,{addRowsFromHtmlContentToTable:function(src,node){var targetTableId=src;var newDivElement=document.createElement("div");newDivElement.innerHTML="<table>"+getFirstChildContent(node.getElementsByTagName("data").item(0))+"</table>";var trs=newDivElement.getElementsByTagName("tr");if(!trs||trs.length==0){return }var nbLines=trs.length;var tableContainer=$(targetTableId);var parent=tableContainer.tBodies[0];for(var i=0;i<nbLines;i++){parent.appendChild(trs[i].cloneNode(true))}},getCurrentWindow:function(){return Salto.Window.currentWindow},closePopups:function(src,node){var children=node.getElementsByTagName("data").item(0).childNodes;for(var i=0;i<children.length;i++){var popupsToClose=children[i].data;if(popupsToClose&&popupsToClose.length>0){var arrayOfWindowIds=popupsToClose.split(",");Salto.WindowUtils.closePopups(arrayOfWindowIds)}}},changeBooleanEltProp:function(eltIdName,propName,value){var element=document.getElementById(eltIdName);var attr=element.getAttribute(propName);if(value&&(attr==null||attr==false)){element.setAttribute(propName,true)}else{if(!value&&attr!=null){if(attr!=null){element.setAttribute(propName,false)}element.removeAttribute(propName)}}}});Salto.WindowUtils=Class.create();Object.extend(Salto.WindowUtils,{resize:function(windowId,width,height){Salto.WindowUtils.getWindowById(windowId).setSize(width,height);Salto.WindowUtils.getWindowById(windowId).showAtCenter()},getWindowById:function(windowId){for(var i=0;i<Salto.Window.winArray.length;i++){var win=Salto.Window.winArray[i];if(win&&win.getId()==windowId){return win}win=null}},closeCurrentPopup:function(){if(Salto.Window.currentWindow&&Salto.Window.currentWindow.config.id!=Salto.LOADING_POPUP_ID){Salto.Window.currentWindow.close()}else{if(Salto.Window.lastActive&&Salto.Window.lastActive.config.id!=Salto.LOADING_POPUP_ID){Salto.Window.lastActive.close()}}},closePopups:function(arrayOfWindowIds){for(var i=0;i<arrayOfWindowIds.length;i++){for(var j=0;j<Salto.Window.winArray.length;j++){var win=Salto.Window.winArray[j];if(win&&win.getId()==arrayOfWindowIds[i]){win.close();win=null;break}win=null}}},focusCurrentPopup:function(){if(Salto.Window.winArray.length>1){var previous=Salto.Window.winArray[Salto.Window.winArray.length-1];previous.focus()}},openPopupWithContent:function(opts,id){opts.content=document.getElementById(id).innerHTML;Element.remove($(id));var position=fwkGetCenterPosition(opts.width,opts.height);opts.left=position[0];opts.top=position[1];opts.top+=Screen.getScrollTop();opts.left+=Screen.getScrollLeft();if(opts.top<0){opts.top=0}if(opts.left<0){opts.left=0}var oldPopup=Salto.WindowUtils.getWindowById(opts.id);if(oldPopup==null){var popup=Salto.Window.setup(opts);popup=null}else{oldPopup.setTitle(opts.title);oldPopup.setContent(opts.content);oldPopup.setWidth(opts.width);oldPopup.setHeight(opts.height);oldPopup.show()}oldPopup=null}});Salto.CalendarUtils=Class.create();Object.extend(Salto.CalendarUtils,{_fixCalendarZIndex:function(calendar){var currrentWindow=Salto.FwkUtils.getCurrentWindow();if(currrentWindow){calendar.element.style.zIndex=Salto.FwkUtils.getCurrentWindow().getZIndex()}else{calendar.element.style.zIndex=Salto.Window.maxNumber}}});Salto.CallbackUtils=Class.create();Object.extend(Salto.CallbackUtils,{getPopupOptions:function(){return null},getPopupOptionsWithUrl:function(url){return null},isLoginPage:function(transport,contentType){return false},isHistoryActive:function(){return true},ieControlsHack:function(){cmHideMenuTime()}});function absoluteOffset(element){var result=Position.realOffset(element);var winScrollY=null;var winScrollX=null;if(Prototype.Browser.IE&&document.documentElement){winScrollX=document.documentElement.scrollLeft;winScrollY=document.documentElement.scrollTop}else{winScrollX=window.scrollX;winScrollY=window.scrollY}result[0]-=winScrollX;result[1]-=winScrollY;return result}function getFirstChildContent(parentNode){var firstChild=parentNode.firstChild;return (firstChild==null)?"":firstChild.data}function fwkGetParentWin(){if(document.all&&window.dialogArguments){return window.dialogArguments.win}else{if(window.opener!=null){return window.opener}}return window}function fwkGetPageScrollY(){return Screen.getScrollTop()}function fwkGetWindowSize(){var dimension={};dimension.height=Screen.getViewportHeight();dimension.width=Screen.getViewportWidth();return dimension}function fwkGetAbsolutePos(theElement){var SL=0;var ST=0;var is_div=/^div$/i.test(theElement.tagName);if(is_div&&theElement.scrollLeft){SL=theElement.scrollLeft}if(is_div&&theElement.scrollTop){ST=theElement.scrollTop}var r={x:theElement.offsetLeft-SL,y:theElement.offsetTop-ST};if(theElement.offsetParent){var tmp=fwkGetAbsolutePos(theElement.offsetParent);r.x+=tmp.x;r.y+=tmp.y}return r}function fwkPrintError(e){if(e instanceof Salto.TechnicalException){return e.toString()}else{try{var message="Error detail:"+fwkToString(e);return message}catch(t){return"Error detail:"+e}}}function fwkToString(o){var message="{ ";for(var i in o){if(i!="extend"&&typeof o[i]!="function"){message+=i+":"+o[i]+"\n"}}message+="}";return message}function openPopup(urlName,width,height,passage){try{var top=window;if(window.top!=null){top=window.top}if(passage!=null&&passage!=undefined){passage.openerWindow=top}done=null;var child;if(top.showModalDialog){var paramStr="scroll:auto;unadorned:no;status:no;resizable:yes;center:yes;";if(height!=null){paramStr+="dialogHeight:"+height+"px;"}if(width!=null){paramStr+="dialogWidth:"+width+"px;"}child=top.showModalDialog(urlName,passage,paramStr);try{onClosePopup()}catch(e){}}else{child=top.open(urlName);child.dialogArguments=passage}return child}catch(e){alert("open popup "+e.message);return null}}function fwkGetParentHavingAttributeWithValue(elt,nodeName,attributeName,attributeValue){var parent=elt;var nodeAttributeValue=null;while(parent!=null){if(parent.nodeName==nodeName&&(nodeAttributeValue=parent.getAttribute(attributeName))&&(nodeAttributeValue==attributeValue)){break}else{parent=parent.parentNode}}return parent}function fwkGetParentHavingAttribute(elt,nodeName,attributeName){var parent=elt;var nodeAttributeValue=null;while(parent!=null){if(parent.nodeName==nodeName&&(nodeAttributeValue=parent.getAttribute(attributeName))&&(nodeAttributeValue!=null)){break}else{parent=parent.parentNode}}return parent}function fwkGetParent(elt,nodeName,stopNodeName){var par=elt;while(par!=null&&par.nodeName!=nodeName&&par.nodeName!=stopNodeName){par=(par.parentNode)?par.parentNode:null}if(par!=null&&par.nodeName==stopNodeName){return null}return par}function fwkGetBrother(elt,nodeName){var brother=elt;if(brother){do{brother=brother.nextSibling}while(brother&&brother!=null&&brother.nodeName!=nodeName)}if(brother){return brother}return null}function fwkGetPreviousBrother(elt,nodeName){var brother=elt;if(brother){do{brother=brother.previousSibling}while(brother&&brother!=null&&brother.nodeName!=nodeName)}if(brother){return brother}return null}function fwkGetChild(elt,nodeName){var childs=elt.childNodes;for(var i=0;i<childs.length;i++){if(childs[i].nodeName==nodeName){return childs[i]}}return null}function fwkGetAllChildren(elt,nodeNames,elements){var childs=elt.childNodes;if(elements==undefined){elements=new Array()}if(childs==null){return elements}for(var i=0;i<childs.length;i++){fwkGetAllChildren(childs[i],nodeNames,elements);for(var j=0;j<nodeNames.length;j++){if(childs[i].nodeName==nodeNames[j]){elements[elements.length]=childs[i]}}}return elements}function fwkGetFirstChild(elt,nodeName){var childs=elt.childNodes;for(var i=0;i<childs.length;i++){if(childs[i].tagName===nodeName){return childs[i]}else{var result=fwkGetFirstChild(childs[i],nodeName);if(result!=null){return result}}}return null}function fwkGetFirstChildWithAttribute(elt,attributeName,attributeValue){var childs=elt.childNodes;for(var i=0;i<childs.length;i++){if(childs[i].tagName){var value=childs[i].getAttribute(attributeName);if(value==attributeValue){return childs[i]}else{var result=fwkGetFirstChildWithAttribute(childs[i],attributeName,attributeValue);if(result!=null){return result}}}}return null}function getChild(elt,nodeName){return fwkGetChild(elt,nodeName)}function fwkIsParent(parentNode,childNodeToTest){var node=childNodeToTest;while(node!=null){if(node==parentNode){return true}node=node.parentNode}return false}function fwkIsShiftPressed(e){if(e.modifiers){var mString=(e.modifiers+32).toString(2).substring(3,6);return(mString.charAt(0)=="1")}else{if(e.shiftKey){return e.shiftKey}else{return false}}}function fwkIsCtrlPressed(e){if(e.modifiers){var mString=(e.modifiers+32).toString(2).substring(3,6);return(mString.charAt(1)=="1")}else{if(e.ctrlKey){return e.ctrlKey}else{return false}}}function isNumber(keyCode,shift){if(shift&&keyCode>=48&&keyCode<=57){return true}if(!shift&&keyCode>=96&&keyCode<=105){return true}return false}function isNavigationKey(keyCode){if(keyCode==9||keyCode==8||keyCode==16||keyCode==35||keyCode==37||keyCode==45||keyCode==46||keyCode==39){return true}return false}function isAlpha(keyCode,shift){return true}function getSource(eventNS){if(!document.all){return eventNS.target}else{return event.srcElement}}function getKeyCode(eventNS){if(!document.all){return eventNS.keyCode}else{return event.keyCode}}function getEvent(eventNS){if(!document.all){return eventNS}else{return event}}function focusOnField(fieldName){forms=document.forms;if(forms==null||forms.length==0){return }for(i=0;i<forms.length;i++){elt=forms[i].namedItem(fieldName);if(elt!=null){if(!elt.disabled&&!elt.readonly&&elt.style.display!="none"){if(elt.nodeName=="INPUT"&&elt.type=="text"){elt.select()}elt.focus()}else{nextTab(elt)}return }}}function focusOnFieldNum(fieldName,fieldNum,formName){var w=window;if(window.opener!=null){w=window.opener}if(window.dialogArguments&&window.dialogArguments.win!=null){w=window.dialogArguments.win}var forms=w.document.forms;if(forms==null||forms.length==0){return }try{if(formName!=null){var elt=forms.item(formName).elements.namedItem(fieldName);var num=eval(elt.length);if(num!=null&&num>1){elt=elt[fieldNum]}if(elt!=null){if(!elt.disabled&&!elt.readonly&&elt.style.display!="none"){if(elt.nodeName=="INPUT"&&elt.type=="text"){elt.select()}elt.focus()}else{nextTab(elt)}return }}else{for(i=0;i<forms.length;i++){var elt=forms[i].namedItem(fieldName);var num=eval(elt.length);if(num!=null&&num>1){elt=elt[fieldNum]}if(elt!=null){if(!elt.disabled&&!elt.readonly&&elt.style.display!="none"){if(elt.nodeName=="INPUT"&&elt.type=="text"){elt.select()}elt.focus()}else{nextTab(elt)}return }}}}catch(e){}}function getWin(){var win=window.top;while(win!=win.top){win=win.top}return win}function fwkCellIndex(cell){if(cell.parentNode&&cell.parentNode.cells[1]&&cell.parentNode.cells[1].cellIndex!=1){myCells=cell.parentNode.cells;for(j=0;j<myCells.length;j++){if(cell==myCells[j]){return j}}}else{return cell.cellIndex}}function setOpacity(cssClass,opacity){var type=typeof opacity;if(type=="undefined"){opacity=0.5}var elements=document.getElementsByClassName(cssClass);for(var i=0;i<elements.length;i++){elements[i].setOpacity(1);elements[i].setOpacity(opacity)}}function getLabelDependingOnChecboxStatus(checkboxElement,elementIdToUpdateWithLabel,labels){if(checkboxElement.checked){$(elementIdToUpdateWithLabel).innerHTML=labels[0]}else{$(elementIdToUpdateWithLabel).innerHTML=labels[1]}}function defined(o){return(typeof (o)!="undefined")}var CSS=(function(){var css={};css.rgb2hex=function(rgbString){if(typeof (rgbString)!="string"||!defined(rgbString.match)){return null}var result=rgbString.match(/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*/);if(result==null){return rgbString}var rgb=+result[1]<<16|+result[2]<<8|+result[3];var hex="";var digits="0123456789abcdef";while(rgb!=0){hex=digits.charAt(rgb&15)+hex;rgb>>>=4}while(hex.length<6){hex="0"+hex}return"#"+hex};css.hyphen2camel=function(property){if(!defined(property)||property==null){return null}if(property.indexOf("-")<0){return property}var str="";var c=null;var l=property.length;for(var i=0;i<l;i++){c=property.charAt(i);str+=(c!="-")?c:property.charAt(++i).toUpperCase()}return str};css.hasClass=function(obj,className){if(!defined(obj)||obj==null||!RegExp){return false}var re=new RegExp("(^|\\s)"+className+"(\\s|$)");if(typeof (obj)=="string"){return re.test(obj)}else{if(typeof (obj)=="object"&&obj.className){return re.test(obj.className)}}return false};css.addClass=function(obj,className){if(typeof (obj)!="object"||obj==null||!defined(obj.className)){return false}if(obj.className==null||obj.className==""){obj.className=className;return true}if(css.hasClass(obj,className)){return true}obj.className=obj.className+" "+className;return true};css.removeClass=function(obj,className){if(typeof (obj)!="object"||obj==null||!defined(obj.className)||obj.className==null){return false}if(!css.hasClass(obj,className)){return false}var re=new RegExp("(^|\\s+)"+className+"(\\s+|$)");obj.className=obj.className.replace(re," ");return true};css.replaceClass=function(obj,className,newClassName){if(typeof (obj)!="object"||obj==null||!defined(obj.className)||obj.className==null){return false}css.removeClass(obj,className);css.addClass(obj,newClassName);return true};css.getStyle=function(o,property){if(o==null){return null}var val=null;var camelProperty=css.hyphen2camel(property);if(property=="float"){val=css.getStyle(o,"cssFloat");if(val==null){val=css.getStyle(o,"styleFloat")}}else{if(o.currentStyle&&defined(o.currentStyle[camelProperty])){val=o.currentStyle[camelProperty]}else{if(window.getComputedStyle){val=window.getComputedStyle(o,null).getPropertyValue(property)}else{if(o.style&&defined(o.style[camelProperty])){val=o.style[camelProperty]}}}}if(/^\s*rgb\s*\(/.test(val)){val=css.rgb2hex(val)}if(/^#/.test(val)){val=val.toLowerCase()}return val};css.get=css.getStyle;css.setStyle=function(o,property,value){if(o==null||!defined(o.style)||!defined(property)||property==null||!defined(value)){return false}if(property=="float"){o.style["cssFloat"]=value;o.style["styleFloat"]=value}else{if(property=="opacity"){o.style["-moz-opacity"]=value;o.style["-khtml-opacity"]=value;o.style.opacity=value;if(defined(o.style.filter)){o.style.filter="alpha(opacity="+value*100+")"}}else{o.style[css.hyphen2camel(property)]=value}}return true};css.set=css.setStyle;css.uniqueIdNumber=1000;css.createId=function(o){if(defined(o)&&o!=null&&defined(o.id)&&o.id!=null&&o.id!=""){return o.id}var id=null;while(id==null||document.getElementById(id)!=null){id="ID_"+(css.uniqueIdNumber++)}if(defined(o)&&o!=null&&(!defined(o.id)||o.id=="")){o.id=id}return id};return css})();var Screen=(function(){var screen={};screen.getBody=function(){if(document.body){return document.body}if(document.getElementsByTagName){var bodies=document.getElementsByTagName("BODY");if(bodies!=null&&bodies.length>0){return bodies[0]}}return null};screen.getScrollTop=function(){if(document.documentElement&&defined(document.documentElement.scrollTop)&&document.documentElement.scrollTop>0){return document.documentElement.scrollTop}if(document.body&&defined(document.body.scrollTop)){return document.body.scrollTop}return null};screen.getScrollLeft=function(){if(document.documentElement&&defined(document.documentElement.scrollLeft)&&document.documentElement.scrollLeft>0){return document.documentElement.scrollLeft}if(document.body&&defined(document.body.scrollLeft)){return document.body.scrollLeft}return null};screen.zero=function(n){return(!defined(n)||isNaN(n))?0:n};screen.getDocumentWidth=function(){var width=0;var body=screen.getBody();if(document.documentElement&&(!document.compatMode||document.compatMode=="CSS1Compat")){var rightMargin=parseInt(CSS.get(body,"marginRight"),10)||0;var leftMargin=parseInt(CSS.get(body,"marginLeft"),10)||0;width=Math.max(body.offsetWidth+leftMargin+rightMargin,document.documentElement.clientWidth)}else{width=Math.max(body.clientWidth,body.scrollWidth)}if(isNaN(width)||width==0){width=screen.zero(self.innerWidth)}return width};screen.getDocumentHeight=function(){var body=screen.getBody();var innerHeight=(defined(self.innerHeight)&&!isNaN(self.innerHeight))?self.innerHeight:0;if(document.documentElement&&(!document.compatMode||document.compatMode=="CSS1Compat")){var topMargin=parseInt(CSS.get(body,"marginTop"),10)||0;var bottomMargin=parseInt(CSS.get(body,"marginBottom"),10)||0;return Math.max(body.offsetHeight+topMargin+bottomMargin,document.documentElement.clientHeight,document.documentElement.scrollHeight,screen.zero(self.innerHeight))}return Math.max(body.scrollHeight,body.clientHeight,screen.zero(self.innerHeight))};screen.getViewportWidth=function(){if(document.documentElement&&(!document.compatMode||document.compatMode=="CSS1Compat")){return document.documentElement.clientWidth}else{if(document.compatMode&&document.body){return document.body.clientWidth}}return screen.zero(self.innerWidth)};screen.getViewportHeight=function(){if(!window.opera&&document.documentElement&&(!document.compatMode||document.compatMode=="CSS1Compat")){return document.documentElement.clientHeight}else{if(document.compatMode&&!window.opera&&document.body){return document.body.clientHeight}}return screen.zero(self.innerHeight)};return screen})();Object.extend(Salto.CallbackUtils,{isLoginPage:function(transport,contentType){try{var text=transport.responseText;if(text){if(contentType.indexOf("text/html")!=-1&&(text.indexOf('"smauthreason"')!=-1||text.indexOf("__FWK_LOGIN_PAGE__")!=-1||(text.indexOf("You will be forwarded to continue the authorization process.")!=-1&&text.indexOf('"SMPostPreserve"')!=-1))){return true}}if(contentType.indexOf("text/html")!=-1&&transport.status==302){return true}return false}catch(e){return true}}});var Decathlon={Version:"3.2.0"};Decathlon.CalendarUtils=Class.create();Object.extend(Decathlon.CalendarUtils,{customWeekNumberCallbackForCalendar:function(when,theCalendar){return Decathlon.CalendarUtils.customWeekNumberCallback(when,{firstDayOfWeek:theCalendar.firstDayOfWeek})},customWeekNumberCallback:function(when,options){try{var firstDayOfWeek=options.firstDayOfWeek;var minimalDaysInFirstWeek=3;var year=when.getFullYear();var month=when.getMonth();var day=when.getDate();var dayOfYear=((Date.UTC(year,when.getMonth(),when.getDate(),0,0,0)-Date.UTC(year,0,1,0,0,0))/1000/60/60/24)+1;var dayOfWeek=when.getDay();var relDow=(dayOfWeek+7-firstDayOfWeek)%7;var relDowJan1=(dayOfWeek-dayOfYear+701-firstDayOfWeek)%7;var woy=Math.floor((dayOfYear-1+relDowJan1)/7);if((7-relDowJan1)>=minimalDaysInFirstWeek){++woy}if(dayOfYear>359){var lastDoy=when.getYearLength();var lastRelDow=(relDow+lastDoy-dayOfYear)%7;if(lastRelDow<0){lastRelDow+=7}if(((6-lastRelDow)>=minimalDaysInFirstWeek)&&((dayOfYear+7-relDow)>lastDoy)){woy=1}}else{if(woy===0){var yearBefore=new Date(year-1,month,day,0,0,0);var prevDoy=dayOfYear+yearBefore.getYearLength();var periodStartDayOfWeek=(dayOfWeek-firstDayOfWeek-prevDoy+1)%7;if(periodStartDayOfWeek<0){periodStartDayOfWeek+=7}var weekNo=Math.floor((prevDoy+periodStartDayOfWeek-1)/7);if((7-periodStartDayOfWeek)>=minimalDaysInFirstWeek){++weekNo}woy=weekNo}}return woy}catch(e){alert("calendar-setup.js:getDktWeekNumber:Error computing week number:"+e)}},createDateHelper:function(){return new Salto.DateHelper({getWeekNumberFromDateCallback:Decathlon.CalendarUtils.customWeekNumberCallback,firstDayOfWeek:0})}});Salto.CalendarHelper.customWeekNumberCallbackForCalendar=Decathlon.CalendarUtils.customWeekNumberCallbackForCalendar;Salto.CalendarHelper.customWeekNumberCallback=Decathlon.CalendarUtils.customWeekNumberCallback;var _cmIDCount=0;var _cmIDName="cmSubMenuID";var _cmTimeOut=null;var _cmCurrentItem=null;var _cmNoAction=new Object();var _cmNoClick=new Object();var _cmSplit=new Object();var _cmItemList=new Array();var _cmNodeProperties={mainFolderLeft:"",mainFolderRight:"",mainItemLeft:"",mainItemRight:"",folderLeft:"",folderRight:"",itemLeft:"",itemRight:"",mainSpacing:0,subSpacing:0,delay:500,clickOpen:1};function cmNewID(){return _cmIDName+(++_cmIDCount)}function cmActionItem(item,prefix,isMain,idSub,orient,nodeProperties){var clickOpen=_cmNodeProperties.clickOpen;if(nodeProperties.clickOpen){clickOpen=nodeProperties.clickOpen}_cmItemList[_cmItemList.length]=item;var index=_cmItemList.length-1;idSub=(!idSub)?"null":("'"+idSub+"'");orient="'"+orient+"'";prefix="'"+prefix+"'";var onClick=(clickOpen==3)||(clickOpen==2&&isMain);var returnStr;if(onClick){returnStr=' onmouseover="cmItemMouseOver (this,'+prefix+","+isMain+","+idSub+","+index+')" onmousedown="cmItemMouseDownOpenSub (this,'+index+","+prefix+","+orient+","+idSub+')"'}else{returnStr=' onmouseover="cmItemMouseOverOpenSub (this,'+prefix+","+isMain+","+idSub+","+orient+","+index+')" onmousedown="cmItemMouseDown (this,'+index+')"'}var onmouseup="cmItemMouseUp (this,"+index+")";if(item.length>4){callback=item[4];if(callback!=null){onmouseup=callback}}return returnStr+' onmouseout="cmItemMouseOut (this, '+nodeProperties.delay+')" onmouseup="'+onmouseup+'"'}function cmNoClickItem(item,prefix,isMain,idSub,orient,nodeProperties){_cmItemList[_cmItemList.length]=item;var index=_cmItemList.length-1;idSub=(!idSub)?"null":("'"+idSub+"'");orient="'"+orient+"'";prefix="'"+prefix+"'";return' onmouseover="cmItemMouseOver (this,'+prefix+","+isMain+","+idSub+","+index+')" onmouseout="cmItemMouseOut (this,'+nodeProperties.delay+')"'}function cmNoActionItem(item,prefix){return item[1]}function cmSplitItem(prefix,isMain,vertical,nodeProperties){return nodeProperties.getSplitItem(isMain,vertical)}function cmDrawSubMenu(subMenu,prefix,id,orient,nodeProperties){var str='<div class="'+prefix+'SubMenu" id="'+id+'"><table summary="sub menu" cellspacing="'+nodeProperties.subSpacing+'" class="'+prefix+'SubMenuTable">';var strSub="";var item;var idSub;var hasChild;var i;var classStr;for(i=5;i<subMenu.length;++i){item=subMenu[i];if(!item){continue}if(item==_cmSplit){item=nodeProperties.getSplitItem(0,true)}hasChild=(item.length>6);idSub=hasChild?cmNewID():null;str+='<tr class="'+prefix+'MenuItem"';if(item[0]!=_cmNoClick){str+=cmActionItem(item,prefix,0,idSub,orient,nodeProperties)}else{str+=cmNoClickItem(item,prefix,0,idSub,orient,nodeProperties)}str+=">";if(item[0]==_cmNoAction||item[0]==_cmNoClick){str+=cmNoActionItem(item,prefix);str+="</tr>";continue}classStr=prefix+"Menu";classStr+=hasChild?"Folder":"Item";str+='<td class="'+classStr+'Left">';if(item[0]!=null){str+=item[0]}else{str+=hasChild?nodeProperties.folderLeft:nodeProperties.itemLeft}str+='</td><td class="'+classStr+'Text">'+item[1];str+='</td><td class="'+classStr+'Right">';if(hasChild){str+=nodeProperties.folderRight;strSub+=cmDrawSubMenu(item,prefix,idSub,orient,nodeProperties)}else{str+=nodeProperties.itemRight}str+="</td></tr>"}str+="</table></div>"+strSub;return str}function cmDraw(id,menu,orient,nodeProperties,prefix){var obj=cmGetObject(id);if(!nodeProperties){nodeProperties=_cmNodeProperties}if(!prefix){prefix=""}var str='<table summary="main menu" class="'+prefix+'Menu" cellspacing="'+nodeProperties.mainSpacing+'">';var strSub="";if(!orient){orient="hbr"}var orientStr=String(orient);var orientSub;var vertical;if(orientStr.charAt(0)=="h"){orientSub="v"+orientStr.substr(1,2);str+="<tr>";vertical=false}else{orientSub="v"+orientStr.substr(1,2);vertical=true}var i;var item;var idSub;var hasChild;var classStr;for(i=0;i<menu.length;++i){item=menu[i];if(!item){continue}str+=vertical?"<tr":"<td";str+=' class="'+prefix+'MainItem"';hasChild=(item.length>6);idSub=hasChild?cmNewID():null;str+=cmActionItem(item,prefix,1,idSub,orient,nodeProperties)+">";if(item==_cmSplit){item=nodeProperties.getSplitItem(1,vertical)}if(item[0]==_cmNoAction||item[0]==_cmNoClick){str+=cmNoActionItem(item,prefix);str+=vertical?"</tr>":"</td>";continue}classStr=prefix+"Main"+(hasChild?"Folder":"Item");str+=vertical?"<td":"<span";str+=' class="'+classStr+'Left">';str+=(item[0]==null)?(hasChild?nodeProperties.mainFolderLeft:nodeProperties.mainItemLeft):item[0];str+=vertical?"</td>":"</span>";str+=vertical?"<td":"<span";str+=' class="'+classStr+'Text">';str+=item[1];str+=vertical?"</td>":"</span>";str+=vertical?"<td":"<span";str+=' class="'+classStr+'Right">';str+=hasChild?nodeProperties.mainFolderRight:nodeProperties.mainItemRight;str+=vertical?"</td>":"</span>";str+=vertical?"</tr>":"</td>";if(hasChild){strSub+=cmDrawSubMenu(item,prefix,idSub,orientSub,nodeProperties)}}if(!vertical){str+="</tr>"}str+="</table>"+strSub;obj.innerHTML=str}function cmDrawFromText(id,orient,nodeProperties,prefix){var domMenu=cmGetObject(id);var menu=null;for(var currentDomItem=domMenu.firstChild;currentDomItem;currentDomItem=currentDomItem.nextSibling){if(!currentDomItem.tagName||currentDomItem.tagName.toLowerCase()!="ul"){continue}menu=cmDrawFromTextSubMenu(currentDomItem);break}if(menu){cmDraw(id,menu,orient,nodeProperties,prefix)}}function cmDrawFromTextSubMenu(domMenu){var items=new Array();for(var currentDomItem=domMenu.firstChild;currentDomItem;currentDomItem=currentDomItem.nextSibling){if(!currentDomItem.tagName||currentDomItem.tagName.toLowerCase()!="li"){continue}if(currentDomItem.firstChild==null){items[items.length]=_cmSplit;continue}var item=new Array();var currentItem=currentDomItem.firstChild;for(;currentItem;currentItem=currentItem.nextSibling){if(!currentItem.tagName||currentItem.tagName.toLowerCase()!="span"){continue}if(!currentItem.firstChild){item[0]=null}else{item[0]=currentItem.innerHTML}break}if(!currentItem){continue}for(;currentItem;currentItem=currentItem.nextSibling){if(!currentItem.tagName||currentItem.tagName.toLowerCase()!="a"){continue}item[1]=currentItem.innerHTML;item[2]=currentItem.href;item[3]=currentItem.target;item[4]=currentItem.title;if(item[4]==""){item[4]=null}break}for(;currentItem;currentItem=currentItem.nextSibling){if(!currentItem.tagName||currentItem.tagName.toLowerCase()!="ul"){continue}var subMenuItems=cmDrawFromTextSubMenu(currentItem);for(i=0;i<subMenuItems.length;++i){item[i+5]=subMenuItems[i]}break}items[items.length]=item}return items}function cmItemMouseOver(obj,prefix,isMain,idSub,index){clearTimeout(_cmTimeOut);if(!obj.cmPrefix){obj.cmPrefix=prefix;obj.cmIsMain=isMain}var thisMenu=cmGetThisMenu(obj,prefix);if(!thisMenu.cmItems){thisMenu.cmItems=new Array()}var i;for(i=0;i<thisMenu.cmItems.length;++i){if(thisMenu.cmItems[i]==obj){break}}if(i==thisMenu.cmItems.length){thisMenu.cmItems[i]=obj}if(_cmCurrentItem){if(_cmCurrentItem==obj||_cmCurrentItem==thisMenu){var item=_cmItemList[index];cmSetStatus(item);return }var thatPrefix=_cmCurrentItem.cmPrefix;var thatMenu=cmGetThisMenu(_cmCurrentItem,thatPrefix);if(thatMenu!=thisMenu.cmParentMenu){if(_cmCurrentItem.cmIsMain){_cmCurrentItem.className=thatPrefix+"MainItem"}else{_cmCurrentItem.className=thatPrefix+"MenuItem"}if(thatMenu.id!=idSub){cmHideMenu(thatMenu,thisMenu,thatPrefix)}}}_cmCurrentItem=obj;cmResetMenu(thisMenu,prefix);var item=_cmItemList[index];var isDefaultItem=cmIsDefaultItem(item);if(isDefaultItem){if(isMain){obj.className=prefix+"MainItemHover"}else{obj.className=prefix+"MenuItemHover"}}cmSetStatus(item)}function cmItemMouseOverOpenSub(obj,prefix,isMain,idSub,orient,index){cmItemMouseOver(obj,prefix,isMain,idSub,index);if(idSub){var subMenu=cmGetObject(idSub);cmShowSubMenu(obj,prefix,subMenu,orient)}}function cmItemMouseOut(obj,delayTime){if(!delayTime){delayTime=_cmNodeProperties.delay}_cmTimeOut=window.setTimeout("cmHideMenuTime ()",delayTime);window.defaultStatus=""}function cmItemMouseDown(obj,index){if(cmIsDefaultItem(_cmItemList[index])){if(obj.cmIsMain){obj.className=obj.cmPrefix+"MainItemActive"}else{obj.className=obj.cmPrefix+"MenuItemActive"}}}function cmItemMouseDownOpenSub(obj,index,prefix,orient,idSub){cmItemMouseDown(obj,index);if(idSub){var subMenu=cmGetObject(idSub);cmShowSubMenu(obj,prefix,subMenu,orient)}}function cmItemMouseUp(obj,index){var item=_cmItemList[index];var link=null,target=null,callback=null;if(item.length>2){link=item[2]}if(item.length>3&&item[3]){target=item[3]}if(item.length>4){callback=item[4]}if(link!=null){fwkDebug("Link : "+link+", target : "+target);if(target!=null){window.open(link,target)}else{AjaxCall(link)}}var prefix=obj.cmPrefix;var thisMenu=cmGetThisMenu(obj,prefix);var hasChild=(item.length>6);if(!hasChild){if(cmIsDefaultItem(item)){if(obj.cmIsMain){obj.className=prefix+"MainItem"}else{obj.className=prefix+"MenuItem"}}cmHideMenu(thisMenu,null,prefix)}else{if(cmIsDefaultItem(item)){if(obj.cmIsMain){obj.className=prefix+"MainItemHover"}else{obj.className=prefix+"MenuItemHover"}}}}function cmMoveSubMenu(obj,subMenu,orient){var mode=String(orient);var p=subMenu.offsetParent;var subMenuWidth=cmGetWidth(subMenu);var horiz=cmGetHorizontalAlign(obj,mode,p,subMenuWidth);if(mode.charAt(0)=="h"){if(mode.charAt(1)=="b"){subMenu.style.top=(cmGetYAt(obj,p)+cmGetHeight(obj))+"px"}else{subMenu.style.top=(cmGetYAt(obj,p)-cmGetHeight(subMenu))+"px"}if(horiz=="r"){subMenu.style.left=(cmGetXAt(obj,p))+"px"}else{subMenu.style.left=(cmGetXAt(obj,p)+cmGetWidth(obj)-subMenuWidth)+"px"}}else{if(horiz=="r"){subMenu.style.left=(cmGetXAt(obj,p)+cmGetWidth(obj))+"px"}else{subMenu.style.left=(cmGetXAt(obj,p)-subMenuWidth)+"px"}if(mode.charAt(1)=="b"){subMenu.style.top=(cmGetYAt(obj,p))+"px"}else{subMenu.style.top=(cmGetYAt(obj,p)+cmGetHeight(obj)-cmGetHeight(subMenu))+"px"}}}function cmGetHorizontalAlign(obj,mode,p,subMenuWidth){var horiz=mode.charAt(2);if(!(document.body)){return horiz}var body=document.body;var browserLeft;var browserRight;if(window.innerWidth){browserLeft=window.pageXOffset;browserRight=window.innerWidth+browserLeft}else{if(body.clientWidth){browserLeft=body.clientLeft;browserRight=body.clientWidth+browserLeft}else{return horiz}}if(mode.charAt(0)=="h"){if(horiz=="r"&&(cmGetXAt(obj)+subMenuWidth)>browserRight){horiz="l"}if(horiz=="l"&&(cmGetXAt(obj)+cmGetWidth(obj)-subMenuWidth)<browserLeft){horiz="r"}return horiz}else{if(horiz=="r"&&(cmGetXAt(obj,p)+cmGetWidth(obj)+subMenuWidth)>browserRight){horiz="l"}if(horiz=="l"&&(cmGetXAt(obj,p)-subMenuWidth)<browserLeft){horiz="r"}return horiz}}function cmShowSubMenu(obj,prefix,subMenu,orient){if(!subMenu.cmParentMenu){var thisMenu=cmGetThisMenu(obj,prefix);subMenu.cmParentMenu=thisMenu;if(!thisMenu.cmSubMenu){thisMenu.cmSubMenu=new Array()}thisMenu.cmSubMenu[thisMenu.cmSubMenu.length]=subMenu}cmMoveSubMenu(obj,subMenu,orient);subMenu.style.visibility="visible";if(document.all){if(!subMenu.cmOverlap){subMenu.cmOverlap=new Array()}cmHideControl("IFRAME",subMenu);cmHideControl("SELECT",subMenu);cmHideControl("OBJECT",subMenu)}}function cmResetMenu(thisMenu,prefix){if(thisMenu.cmItems){var i;var str;var items=thisMenu.cmItems;for(i=0;i<items.length;++i){if(items[i].cmIsMain){str=prefix+"MainItem"}else{str=prefix+"MenuItem"}if(items[i].className!=str){items[i].className=str}}}}function cmHideMenuTime(){if(_cmCurrentItem){var prefix=_cmCurrentItem.cmPrefix;cmHideMenu(cmGetThisMenu(_cmCurrentItem,prefix),null,prefix);_cmCurrentItem=null}}function cmHideMenu(thisMenu,currentMenu,prefix){var str=prefix+"SubMenu";if(thisMenu&&thisMenu.cmSubMenu){var i;for(i=0;i<thisMenu.cmSubMenu.length;++i){cmHideSubMenu(thisMenu.cmSubMenu[i],prefix)}}while(thisMenu&&thisMenu!=currentMenu){cmResetMenu(thisMenu,prefix);if(thisMenu.className==str){thisMenu.style.visibility="hidden";cmShowControl(thisMenu)}else{break}thisMenu=cmGetThisMenu(thisMenu.cmParentMenu,prefix)}}function cmHideSubMenu(thisMenu,prefix){if(thisMenu.style.visibility=="hidden"){return }if(thisMenu.cmSubMenu){var i;for(i=0;i<thisMenu.cmSubMenu.length;++i){cmHideSubMenu(thisMenu.cmSubMenu[i],prefix)}}cmResetMenu(thisMenu,prefix);thisMenu.style.visibility="hidden";cmShowControl(thisMenu)}function cmHideControl(tagName,subMenu){var x=cmGetX(subMenu);var y=cmGetY(subMenu);var w=subMenu.offsetWidth;var h=subMenu.offsetHeight;var eltsTags=document.all.tags(tagName);var size=eltsTags.length;for(var i=0;i<size;++i){var obj=eltsTags[i];if(!obj||!obj.offsetParent){continue}var ox=cmGetX(obj);var oy=cmGetY(obj);var ow=obj.offsetWidth;var oh=obj.offsetHeight;if(ox>(x+w)||(ox+ow)<x){continue}if(oy>(y+h)||(oy+oh)<y){continue}if(obj.style.visibility=="hidden"){continue}subMenu.cmOverlap[subMenu.cmOverlap.length]=obj;obj.style.visibility="hidden"}}function cmShowControl(subMenu){if(subMenu.cmOverlap){var i;for(i=0;i<subMenu.cmOverlap.length;++i){subMenu.cmOverlap[i].style.visibility=""}}subMenu.cmOverlap=null}function cmGetThisMenu(obj,prefix){var str1=prefix+"SubMenu";var str2=prefix+"Menu";while(obj){if(obj.className==str1||obj.className==str2){return obj}obj=obj.parentNode}return null}function cmIsDefaultItem(item){if(item==_cmSplit||item[0]==_cmNoAction||item[0]==_cmNoClick){return false}return true}function cmGetObject(id){if(document.all){return document.all[id]}return document.getElementById(id)}function cmGetWidth(obj){var width=obj.offsetWidth;if(width>0||!cmIsTRNode(obj)){return width}if(!obj.firstChild){return 0}return obj.lastChild.offsetLeft-obj.firstChild.offsetLeft+cmGetWidth(obj.lastChild)}function cmGetHeight(obj){var height=obj.offsetHeight;if(height>0||!cmIsTRNode(obj)){return height}if(!obj.firstChild){return 0}return obj.firstChild.offsetHeight}function cmGetX(obj){var x=0;do{x+=obj.offsetLeft;obj=obj.offsetParent}while(obj);return x}function cmGetXAt(obj,elm){var x=0;while(obj&&obj!=elm){x+=obj.offsetLeft;obj=obj.offsetParent}if(obj==elm){return x}return x-cmGetX(elm)}function cmGetY(obj){var y=0;do{y+=obj.offsetTop;obj=obj.offsetParent}while(obj);return y}function cmIsTRNode(obj){var tagName=obj.tagName;return tagName=="TR"||tagName=="tr"||tagName=="Tr"||tagName=="tR"}function cmGetYAt(obj,elm){var y=0;if(!obj.offsetHeight&&cmIsTRNode(obj)){var firstTR=obj.parentNode.firstChild;obj=obj.firstChild;y-=firstTR.firstChild.offsetTop}while(obj&&obj!=elm){y+=obj.offsetTop;obj=obj.offsetParent}if(obj==elm){return y}return y-cmGetY(elm)}function cmSetStatus(item){var descript="";if(item.length>4){descript=(item[4]!=null)?item[4]:(item[2]?item[2]:descript)}else{if(item.length>2){descript=(item[2]?item[2]:descript)}}window.defaultStatus=descript}function cmGetProperties(obj){if(obj==undefined){return"undefined"}if(obj==null){return"null"}var msg=obj+":\n";var i;for(i in obj){msg+=i+" = "+obj[i]+"; "}return msg}function selectMenuItem(menuId,menuItem){var lis=fwkGetAllChildren($(menuId),new Array("LI"),null);for(var i=0;i<lis.length;i++){Element.removeClassName(lis[i],"current")}var ulFwkMenuFound=false;var currentNode=menuItem;do{currentNode=currentNode.parentNode;if(currentNode.nodeName=="LI"){Element.addClassName(currentNode,"current")}ulFwkMenuFound=Element.hasClassName(currentNode,"fwk-menu")}while(!ulFwkMenuFound)}function activateMenu(nav){if(document.all&&document.getElementById(nav).currentStyle){var navroot=document.getElementById(nav);var lis=navroot.getElementsByTagName("LI");for(i=0;i<lis.length;i++){if(lis[i].lastChild.tagName=="UL"){lis[i].onmouseover=function(){Element.addClassName(this,"over");this.lastChild.style.display="block"};lis[i].onmouseout=function(){Element.removeClassName(this,"over");this.lastChild.style.display="none"}}}}}Salto.MenuTheme=Class.create();Salto.MenuTheme.prototype={initialize:function(){},setOptions:function(options){this.options={contextPath:null};Object.extend(this.options,options||{})},getSplitItem:function(isMain,vertical){if(isMain){if(vertical){return this.cmThemePanelMainHSplit}else{return this.cmThemePanelMainVSplit}}else{return this.cmThemePanelHSplit}}};Salto.MenuThemeOffice2003=Class.create();Salto.MenuThemeOffice2003.IMAGES_FOLDER="/fwk/style/fwk/menu/images/fwk/menu/office2003/";Salto.MenuThemeOffice2003.prototype=Object.extend(new Salto.MenuTheme(),{initialize:function(options){this.setOptions(options);var cmThemeOffice2003Base=this.options.contextPath+Salto.MenuThemeOffice2003.IMAGES_FOLDER;this.mainFolderLeft="&nbsp;";this.mainFolderRight="&nbsp;";this.mainItemLeft="&nbsp;";this.mainItemRight="&nbsp;";this.folderLeft='<img alt="" src="'+cmThemeOffice2003Base+'spacer.gif">';this.folderRight='<img alt="" src="'+cmThemeOffice2003Base+'arrow.gif">';this.itemLeft='<img alt="" src="'+cmThemeOffice2003Base+'spacer.gif">';this.itemRight='<img alt="" src="'+cmThemeOffice2003Base+'blank.gif">';this.mainSpacing=0;this.subSpacing=0;this.delay=500;this.cmThemePanelHSplit=[_cmNoClick,'<td class="ThemeOffice2003MenuItemLeft"></td><td colspan="2"><div class="ThemeOffice2003MenuSplit"></div></td>'];this.cmThemePanelMainHSplit=[_cmNoClick,'<td class="ThemeOffice2003MainItemLeft"></td><td colspan="2"><div class="ThemeOffice2003MenuSplit"></div></td>'];this.cmThemePanelMainVSplit=[_cmNoClick,"|"]},getName:function(){return"ThemeOffice2003"}});Salto.TabbedPane=Class.create();Salto.TabbedPane.TABBED_PANE_NUMBER_PARAMETER="_fwkTabbedPaneNumber";Salto.TabbedPane.NO_TAB_HEIGHT=-1;Salto.TabbedPane.TAB_AUTO_HEIGHT="auto";Object.extend(Salto.TabbedPane,{setHeight:function(element,height){if(height==="auto"){element.style.height="auto"}else{element.style.height=height+"px"}}});Salto.TabbedPane.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options,showActionsArray){try{Salto.MemTracker.register(this);this.logger=Log4js.getLogger("FWK_TABBEDPANE");this.logger.setLevel(Log4js.Level.ERROR);this.logger.addAppender(new Salto.FwkAjaxAppender(this.logger,Salto.FwkLogging.LOGGING_URL));this.containerId=containerId;this.container=$(containerId);options.onShowTab=this._onShowHandler.bind(this);this.buildComponent(containerId,options);fwkSetComponent(this.container,this);this.showActionsArray=showActionsArray}catch(e){var msg="tabbedpane.js:Salto.TabbedPane.initialize():Error initializing tab\n, detail="+fwkPrintError(e);this.logger.error(msg);alert(msg)}},release:function(){if(this.accordionTabs){for(var j=0;j<this.accordionTabs.length;j++){if(this.accordionTabs[j]){this.accordionTabs[j].accordion=null;this.accordionTabs[j].titleBar=null;this.accordionTabs[j].content=null;this.accordionTabs[j].onclick=null;this.accordionTabs[j].onmouseover=null;this.accordionTabs[j].onmouseout=null}}this.accordionTabs=null}if(this.container.onclick){this.container.onclick=null}this.container.modelObj=null;this.logger=null;this.container=null},_onShowHandler:function(shownTab){var tabNumber=shownTab.getTabNumber();var urlToCall=this.showActionsArray[tabNumber];if(urlToCall&&urlToCall.length>0){this._callServer(urlToCall,tabNumber)}},_callServer:function(selectedAction,tabNumber){var param="?";if(selectedAction.indexOf("?")>0){param="&"}var urlCalled=selectedAction+param+Salto.TabbedPane.TABBED_PANE_NUMBER_PARAMETER+"="+tabNumber;fwkDebug("AjaxCall of "+urlCalled);AjaxCall(urlCalled,this)},showTabByIndex:function(anIndex,animate){var doAnimate=arguments.length==1?true:animate;this.showTab(this.accordionTabs[anIndex],doAnimate)},collapseLastExpandedTab:function(){var lastExpandedTab=this.lastExpandedTab;if(this.lastExpandedTab===null){return }this.lastExpandedTab.showCollapsed();this.lastExpandedTab.content.style.height="1px";this.lastExpandedTab=null;this.collapseTabDone(lastExpandedTab)},_computeHeight:function(tab,size){if(size!=="auto"){return size}else{var element=tab.content;var oldHeight=element.style.height;var getStyleFunc=Prototype.Browser.IE?Element.getStyle:RicoUtil.getElementsComputedStyle;element.style.visibility="hidden";element.style.position="absolute";element.style.display="block";element.style.height="auto";var height=parseInt(getStyleFunc(element,"height"),10);var titleBarHeight=parseInt(getStyleFunc(tab.titleBar,"height"),10);if(isNaN(titleBarHeight)){titleBarHeight=tab.titleBar.offsetHeight}element.style.height=oldHeight;element.style.visibility="visible";element.style.display="";element.style.position="";return height+titleBarHeight}},showTab:function(accordionTab,animate){if(this.lastExpandedTab&&this.lastExpandedTab==accordionTab){return }var doAnimate=arguments.length==1?true:animate;if(this.options.onHideTab&&this.lastExpandedTab){this.options.onHideTab(this.lastExpandedTab)}var lastExpandedTab=null;if(this.lastExpandedTab){this.lastExpandedTab.showCollapsed();lastExpandedTab=this.lastExpandedTab;if(this.lastExpandedTab.getHeight()!="auto"){this.lastExpandedTab.content.style.height=(this.lastExpandedTab.getHeight()-1)+"px"}else{this.lastExpandedTab.content.style.height=this.lastExpandedTab.getHeight()}}var accordion=this;accordionTab.content.style.display="";if(doAnimate){var accordionTabHeight=this._computeHeight(accordionTab,accordionTab.getHeight());if(lastExpandedTab){new Rico.Effect.AccordionSize(this.lastExpandedTab.content,accordionTab.content,1,accordionTabHeight,100,10,{complete:function(){accordion.showTabDone(lastExpandedTab)}});this.lastExpandedTab=accordionTab}else{this.lastExpandedTab=accordionTab;new Rico.Effect.Size(accordionTab.content,null,accordionTabHeight,100,10,{complete:function(){accordion.showTabDone(lastExpandedTab)}})}}else{if(lastExpandedTab){this.lastExpandedTab.content.style.height="1px";Salto.TabbedPane.setHeight(accordionTab.content,accordionTab.getHeight())}this.lastExpandedTab=accordionTab;this.showTabDone(lastExpandedTab)}},collapseTabDone:function(collapsedTab){if(collapsedTab){collapsedTab.content.style.display="none"}if(this.options.onCollapseTab){this.options.onCollapseTab(collapsedTab)}},showTabDone:function(collapsedTab){if(collapsedTab){collapsedTab.content.style.display="none"}if(this.lastExpandedTab){this.lastExpandedTab.showExpanded();if(this.options.onShowTab){this.options.onShowTab(this.lastExpandedTab)}}},_attachBehaviors:function(){var panels=this._getDirectChildrenByTag(this.container,"DIV");for(var i=0;i<panels.length;i++){var tabChildren=this._getDirectChildrenByTag(panels[i],"DIV");if(tabChildren.length!=2){continue}var tabTitleBar=tabChildren[0];var tabContentBox=tabChildren[1];if(this.options.panelsHeights&&this.options.panelsHeights[i]){this.accordionTabs.push(new Salto.TabbedPane.Tab(this,tabTitleBar,tabContentBox,i,this.options.panelsHeights[i]))}else{this.accordionTabs.push(new Salto.TabbedPane.Tab(this,tabTitleBar,tabContentBox,i,Salto.TabbedPane.NO_TAB_HEIGHT))}}},setupHeights:function(){var theTabs=this.accordionTabs;for(var i=0;i<theTabs.length;i++){if(this.lastExpandedTab==theTabs[i]){Salto.TabbedPane.setHeight(this.lastExpandedTab.content,this.lastExpandedTab.getHeight())}}},_getDirectChildrenByTag:function(e,tagName){var kids=new Array();var allKids=e.childNodes;for(var i=0;i<allKids.length;i++){if(allKids[i]&&allKids[i].tagName&&allKids[i].tagName==tagName){kids.push(allKids[i])}}return kids},buildComponent:function(container,options){this.lastExpandedTab=null;this.accordionTabs=new Array();this.setOptions(options);this._attachBehaviors();if(!container){return }if(this.options.onLoadShowTab>=this.accordionTabs.length){this.options.onLoadShowTab=0}for(var i=0;i<this.accordionTabs.length;i++){if(i!=this.options.onLoadShowTab){this.accordionTabs[i].collapse();this.accordionTabs[i].content.style.display="none"}}if(this.options.onLoadShowTab>=0){this.lastExpandedTab=this.accordionTabs[this.options.onLoadShowTab]}if(this.options.panelHeight=="auto"){var tabToCheck=(this.options.onloadShowTab===0)?1:0;var titleBarSize=parseInt(RicoUtil.getElementsComputedStyle(this.accordionTabs[tabToCheck].titleBar,"height"));if(isNaN(titleBarSize)){titleBarSize=this.accordionTabs[tabToCheck].titleBar.offsetHeight}var totalTitleBarSize=this.accordionTabs.length*titleBarSize;var parentHeight=parseInt(RicoUtil.getElementsComputedStyle(this.container.parentNode,"height"));if(isNaN(parentHeight)){parentHeight=this.container.parentNode.offsetHeight}this.options.panelHeight=parentHeight-totalTitleBarSize-2}this.setupHeights();if(this.lastExpandedTab!=null){Salto.TabbedPane.setHeight(this.lastExpandedTab.content,this.lastExpandedTab.getHeight());this.lastExpandedTab.showExpanded()}else{this.accordionTabs[0].showCollapsed()}},setOptions:function(options){this.options={expandedClassNameArray:null,collapsedClassNameArray:null,hoveredClassNameArray:null,panelHeight:200,onHideTab:null,onShowTab:null,onLoadShowTab:0,panelsHeights:null};Object.extend(this.options,options||{})}});Salto.TabbedPane.Tab=Class.create();Salto.TabbedPane.Tab.prototype={initialize:function(accordion,titleBar,content,position,height){this.accordion=accordion;this.titleBar=titleBar;this.content=content;this.position=position;this.height=height;this._attachBehaviors()},collapse:function(){this.showCollapsed();this.content.style.height="1px"},getHeight:function(){var theHeight=((this.height==Salto.TabbedPane.NO_TAB_HEIGHT)?this.accordion.options.panelHeight:this.height);return theHeight},showCollapsed:function(){this.expanded=false;var classToRemove=this.accordion.options.expandedClassNameArray[this.position].split(" ");for(var j=0;j<classToRemove.length;j++){Element.removeClassName(this.titleBar,classToRemove[j])}Element.addClassName(this.titleBar,this.accordion.options.collapsedClassNameArray[this.position]);this.content.style.overflow="hidden"},getTabNumber:function(){return this.position},showExpanded:function(){this.expanded=true;var classToRemove=this.accordion.options.collapsedClassNameArray[this.position].split(" ");for(var j=0;j<classToRemove.length;j++){Element.removeClassName(this.titleBar,classToRemove[j])}Element.addClassName(this.titleBar,this.accordion.options.expandedClassNameArray[this.position]);this.content.style.overflow="auto"},titleBarClicked:function(e){if(this.accordion.lastExpandedTab==this){this.accordion.collapseLastExpandedTab()}else{this.accordion.showTab(this,true)}},hover:function(e){this.hovered=true;Element.addClassName(this.titleBar,this.accordion.options.hoveredClassNameArray[this.position])},unhover:function(e){this.hovered=false;var classToRemove=this.accordion.options.hoveredClassNameArray[this.position].split(" ");for(var j=0;j<classToRemove.length;j++){Element.removeClassName(this.titleBar,classToRemove[j])}},_attachBehaviors:function(){this.titleBar.onclick=this.titleBarClicked.bindAsEventListener(this);this.titleBar.onmouseover=this.hover.bindAsEventListener(this);this.titleBar.onmouseout=this.unhover.bindAsEventListener(this)}};Salto.Tab=Class.create();Salto.Onglet=Salto.Tab;Salto.Tab.TAB_CONTENT_ATTRIBUTE="fwkOngContent";Salto.Tab.TAB_DISABLED_TAB_STYLE="fwkDisabledTab";Salto.Tab.TAB_ENABLED_TAB_STYLE="fwkEnabledTab";Salto.Tab.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options,optionsround){try{Salto.MemTracker.register(this);this.logger=Log4js.getLogger("FWK_TABS");this.logger.setLevel(Log4js.Level.ERROR);this.logger.addAppender(new Salto.FwkAjaxAppender(this.logger,Salto.FwkLogging.LOGGING_URL));this.containerId=containerId;this.container=$(containerId);fwkSetComponent(this.container,this);this.setOptions(options);this.setOptionsRound(optionsround);this.options.height=this.normalizeHeightWidth(this.options.height);this.options.width=this.normalizeHeightWidth(this.options.width);this.buildComponent();this._attachBehaviors(this.container)}catch(e){var msg="onglet.js:Salto.Tab.initialize():Error initializing tab\n, detail="+fwkPrintError(e);this.logger.error(msg);alert(msg)}},normalizeHeightWidth:function(value){if(value&&(value=""+value)&&value.indexOf("%")==-1){if(value.indexOf("px")==-1){value=value+"px"}}return value},release:function(){if(this.container.onclick){this.container.onclick=null}this.container.modelObj=null;this.options=null;this.optionsRound=null;this.logger=null;this.container=null},setOptions:function(options){this.options={onglet_collapsed:"onglet_collapsed",onglet_selected:"onglet_selected",onHoverClass:"onglet_hover",tabContentClass:"onglet_content",height:null,width:null,curOngletNum:0,ongletClicked:0,reload:false,showClose:false};Object.extend(this.options,options||{})},setOptionsRound:function(options){this.optionsRound={corners:"top",color:"transparent"};Object.extend(this.optionsRound,options||{})},getNbPanels:function(theContainer){if(this.options.showClose){return theContainer.rows.item(0).cells.length-1}else{return theContainer.rows.item(0).cells.length}},_getHeader:function(){return $(this.containerId+"TabHeader")},_getTabsContainer:function(){return $(this.containerId+"Container")},buildComponent:function(theContainer){var theHeader=null;try{theHeader=this._getHeader();if(theHeader){Rico.Corner.round(theHeader,{corners:"tr",color:"transparent",numSlices:5})}}catch(e){theHeader=null}if(this.options.showClose){var tabsTitleRow=theContainer.rows.item(0);var cell=tabsTitleRow.insertCell(tabsTitleRow.cells.length);var tabDiv=Builder.node("div",{id:this.containerId+"Close",className:this.options.onglet_collapsed});cell.appendChild(tabDiv);tabDiv.innerHTML="<bold>&nbsp;X&nbsp;</bold>";Rico.Corner.round(tabDiv,this.optionsRound);cell.onclick=this._closeTabElement.bindAsEventListener(this)}},setContainerStyle:function(element){var theContainer=this._getTabsContainer();if(theContainer){if(this.options.height&&this.options.height.length>0){theContainer.style.height=this.options.height}if(this.options.width&&this.options.width.length>0){theContainer.style.width=this.options.width}if(!Element.hasClassName(theContainer,this.options.tabContentClass)){Element.addClassName(theContainer,this.options.tabContentClass)}theContainer.style.overflow="auto"}var children=theContainer.childNodes;for(var i=0;i<children.length;i++){if(children[i].nodeName=="DIV"){if(theContainer.offsetWidth-20>0){children[i].style.width=(theContainer.offsetWidth-20)+"px"}}}},_closeTabElement:function(evt){this.closeTab(this.options.curOngletNum)},closeTab:function(tabNumber){var theContainer=this.container;var tabsTitleRow=theContainer.rows.item(0);var nbPanels=this.getNbPanels(theContainer);if(tabNumber>=0&&tabNumber<nbPanels&&nbPanels>1){var changeOngletNum=false;if(this.options.curOngletNum==0){this.options.ongletClicked=1;changeOngletNum=true}else{this.options.ongletClicked=this.options.curOngletNum-1}var newNum=this.options.curOngletNum;this.showClickedTab();var cell=tabsTitleRow.cells[tabNumber];var id=cell.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE);Element.remove(id);tabsTitleRow.deleteCell(tabNumber);if(changeOngletNum){this.options.curOngletNum=this.options.curOngletNum-1}}},_onMouseOver:function(evt){var src=getSource(evt);src=fwkGetParentHavingAttribute(src,"TD","fwkOngContent");if(Element.hasClassName(src,this.options.onglet_selected)){return }if(!Element.hasClassName(src,this.options.onHoverClass)){Element.addClassName(src,this.options.onHoverClass)}},_onMouseOut:function(evt){var src=getSource(evt);src=fwkGetParentHavingAttribute(src,"TD","fwkOngContent");if(Element.hasClassName(src,this.options.onglet_selected)){return }Element.removeClassName(src,this.options.onHoverClass)},_attachBehaviors:function(theContainer){var panels=theContainer.rows.item(0).cells;var nbPanels=this.getNbPanels(theContainer);if(nbPanels>2||(panels.item(nbPanels-1).getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE)&&nbPanels==2)){theContainer.onclick=this._onclick.bindAsEventListener(this);for(var i=0;i<nbPanels;i++){var td=panels.item(i);td.onmouseover=this._onMouseOver.bindAsEventListener(this);td.onmouseout=this._onMouseOut.bindAsEventListener(this);var divCible=td.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE);var theTabContent=null;if(divCible&&(theTabContent=$(divCible))){var div=fwkGetChild(td,"DIV");if(i==this.options.curOngletNum){this._makeSelected(div);theTabContent.style.display=""}else{this._makeCollapsed(div);theTabContent.style.display="none"}this.setContainerStyle(theTabContent);Rico.Corner.round(div,this.optionsRound)}else{if(divCible){throw new Salto.TechnicalException({message:'fwkOngContent references an undefined DIV "'+divCible+'"'})}}}}else{var div=fwkGetChild(panels.item(0),"DIV");this.setContainerStyle(div);this._makeSelected(div);Rico.Corner.round(div,this.optionsRound)}},_enableDisableTab:function(position,enable){if(position>=0&&position<this.getNbPanels(this.container)){var theContainer=this.container;var containerRow=theContainer.rows.item(0);var td=containerRow.cells[position];if(td==null){return }if(enable){this.options.access[position]="true";Element.removeClassName(td,Salto.Tab.TAB_DISABLED_TAB_STYLE);Element.addClassName(td,Salto.Tab.TAB_ENABLED_TAB_STYLE)}else{this.options.access[position]="false";Element.removeClassName(td,Salto.Tab.TAB_ENABLED_TAB_STYLE);Element.addClassName(td,Salto.Tab.TAB_DISABLED_TAB_STYLE)}}else{var msg="Position "+position+" is outside the tabs range";throw new Salto.TechnicalException({message:msg})}},appendTab:function(tabId,tabTitle){var theContainer=this.container;var tabsTitleRow=theContainer.rows.item(0);var nbCells=this.getNbPanels(theContainer);fwkDebug("appending "+tabTitle+" with content from "+tabId+", nbCells="+nbCells);Element.hide(tabId);var tabContentId="content"+this.containerId+nbCells;var tabHeaderId="header_"+this.containerId+"_Tab_"+nbCells;var tabHeader=$(tabHeaderId);if(tabHeader==null){var headerCell=tabsTitleRow.insertCell(nbCells);var tabHeaderDiv=Builder.node("div",{id:tabHeaderId});headerCell.appendChild(tabHeaderDiv);headerCell.setAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE,tabContentId);headerCell.style.border="0px";headerCell.style.margin="0px";headerCell.style.padding="0px";Element.addClassName(tabHeaderDiv,this.options.onglet_collapsed);tabHeaderDiv.innerHTML=tabTitle;Rico.Corner.round(tabHeaderDiv,this.optionsRound);this.options.access.push("true");this.options.selectActions.push("");this.options.staticContent.push("true");var panels=tabsTitleRow.cells;nbCells=this.getNbPanels(theContainer);if(nbCells>1||(panels.item(nbCells-1).getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE)&&nbCells==2)){theContainer.onclick=this._onclick.bindAsEventListener(this)}var tabContentDiv=Builder.node("div",{id:tabContentId,className:"onglets_container onglet_page"});var theTabContainer=this._getTabsContainer();theTabContainer.appendChild(tabContentDiv);$(tabContentDiv).innerHTML=$(tabId).innerHTML}},showContentInTab:function(position,divContentId){if(position>=0&&position<this.getNbPanels(this.container)){var contentDivId="content"+this.containerId+""+position;$(contentDivId).innerHTML=$(divContentId).innerHTML;Element.hide(divContentId);this.showTab(position)}else{var msg="Position "+position+" is outside the tabs range";throw new Salto.TechnicalException({message:msg})}},enableTab:function(position){this._enableDisableTab(position,true)},disableTab:function(position){this._enableDisableTab(position,false)},removeTab:function(tabPosition){var theContainer=this.container;var tabsTitleRow=theContainer.rows.item(0);if(tabPosition<this.getNbPanels(theContainer)){cell=tabsTitleRow.deleteCell(tabPosition)}},_onclick:function(eventNS){var src=getSource(eventNS);var theContainer=this.container;var td=fwkGetParentHavingAttribute(src,"TD","fwkOngContent");if(td==null){return }var content=$(td.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE));if(!content){return }var previousCur=this.options.curOngletNum;var oldTd=theContainer.rows.item(0).cells[previousCur];var oldContent=$(oldTd.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE));var forms=oldContent.getElementsByTagName("FORM");this.options.ongletClicked=fwkCellIndex(td);var staticContent=this.options.staticContent[this.options.ongletClicked];var access=this.options.access[this.options.ongletClicked];var selectedAction=this.options.selectActions[this.options.ongletClicked];var isAccessOK=(access&&access=="true");var isStatic=(staticContent&&staticContent=="true");if(isAccessOK){if(selectedAction!=""&&this._hasNotBeenLoaded(td)===true&&!isStatic){this._callServer(selectedAction,forms,td)}else{this.showClickedTab()}}else{}},_callServer:function(selectedAction,forms,currentTD){var param="?";if(selectedAction.indexOf("?")>0){param="&"}if(forms.length>0){var urlCalled=selectedAction+param+"fwkNumTab="+this.options.ongletClicked+"&fwkTabsId="+this.containerId+"&fwkIdContent="+currentTD.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE);var theForm=forms.item(0);fwkDebug("FormAjaxCall of url "+urlCalled+" and form "+theForm.name);Salto.Ajax.serverCallWithParam({url:urlCalled,noHistory:true,theForm:theForm})}else{var urlCalled=selectedAction+param+"fwkNumTab="+this.options.ongletClicked+"&fwkTabsId="+this.containerId+"&fwkIdContent="+currentTD.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE);fwkDebug("AjaxCall of "+urlCalled);AjaxCall(urlCalled)}},_hasNotBeenLoaded:function(element){return element.getAttribute("fwkContent")!="done"},showClickedTab:function(){this.showTab(this.options.ongletClicked)},showLastTab:function(){var theContainer=this.container;this.options.ongletClicked=this.getNbPanels(theContainer)-1;this.showClickedTab()},showTab:function(tabNumber){var theContainer=this.container;this.options.ongletClicked=tabNumber;var containerRow=theContainer.rows.item(0);var td=containerRow.cells[tabNumber];if(td==null){return }var table=fwkGetParent(td,"TABLE");var previousCur=this.options.curOngletNum;if(previousCur!=-1){if(td==containerRow.cells[previousCur]){return }}var div=getChild(td,"DIV");var content=$(td.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE));if(div&&content){this._makeSelected(div)}else{return }content.style.display="";this.setContainerStyle(content);var cells=containerRow.cells;if(cells==null){return }this.colorOnglet(theContainer,td,cells);this.options.curOngletNum=fwkCellIndex(td);if(!this.options.reload){td.setAttribute("fwkContent","done")}if(previousCur!=-1){fwkCell=containerRow.cells[previousCur];div=getChild(fwkCell,"DIV");if(div){this._makeCollapsed(div)}var fwkOnglet=fwkCell.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE);if(fwkOnglet&&fwkOnglet!=""){$(fwkOnglet).style.display="none"}}},_makeCollapsed:function(divElement){var theTD=fwkGetParentHavingAttribute(divElement,"TD","fwkOngContent");Element.removeClassName(theTD,this.options.onHoverClass);Element.removeClassName(divElement,this.options.onglet_selected);if(!Element.hasClassName(divElement,this.options.onglet_collapsed)){Element.addClassName(divElement,this.options.onglet_collapsed)}},_makeSelected:function(divElement){var theTD=fwkGetParentHavingAttribute(divElement,"TD");Element.removeClassName(theTD,this.options.onHoverClass);Element.removeClassName(divElement,this.options.onglet_collapsed);if(!Element.hasClassName(divElement,this.options.onglet_selected)){Element.addClassName(divElement,this.options.onglet_selected)}},colorCorners:function(node,style){var nbNoeuds=node.childNodes.length;for(var j=0;j<nbNoeuds;j++){var fils=node.childNodes[j];if(fils.nodeName=="DIV"){var nbNoeudsFils=fils.childNodes.length;for(var i=1;i<=nbNoeudsFils;i++){var filscourant=fils.childNodes[i-1];if(filscourant.nodeName=="SPAN"){filscourant.style.backgroundColor="";filscourant.className=style}}}}},colorOnglet:function(theContainer,cell,cells){var nbOnglet=this.getNbPanels(theContainer);for(var i=0;i<nbOnglet;i++){var selected=true;if(i!=fwkCellIndex(cell)){selected=false}var theCurrentTD=cells.item(i);if(theCurrentTD.childNodes[0]!=null){try{var div=fwkGetChild(theCurrentTD,"DIV");var content=$(theCurrentTD.getAttribute(Salto.Tab.TAB_CONTENT_ATTRIBUTE));if(selected===true){this._makeSelected(div);content.style.display=""}else{this._makeCollapsed(div);content.style.display="none"}}catch(e){}}}}});Salto.NewTab=Class.create();Salto.NewTab.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options){try{Salto.MemTracker.register(this);this.logger=Log4js.getLogger("FWK_NEW_TABS");this.logger.setLevel(Log4js.Level.ERROR);this.logger.addAppender(new Salto.FwkAjaxAppender(this.logger,Salto.FwkLogging.LOGGING_URL));this.containerId=containerId;this.container=$(containerId);fwkSetComponent(this.container,this);this.setOptions(options);this._attachBehaviors(this.container)}catch(e){var msg="onglet.js:Salto.NewTab.initialize():Error initializing tab\n, detail="+fwkPrintError(e);this.logger.error(msg);alert(msg)}},release:function(){if(this.container.onclick){this.container.onclick=null}this.container.modelObj=null;this.options=null;this.logger=null;this.container=null},setOptions:function(options){this.options={curOngletNum:0,ongletClicked:0,reload:false};Object.extend(this.options,options||{})},_getNbTabs:function(theContainer){theContainer.cleanWhitespace();return theContainer.childNodes.length},_hasNotBeenLoaded:function(element){return !Element.hasClassName(element,"loaded")},_attachBehaviors:function(theContainer){var tabs=theContainer.getElementsByTagName("LI");for(var i=0;i<tabs.length;i++){if(i==this.options.curOngletNum){var li=tabs[i];Element.addClassName(li,"selected");var contentDiv=this.getContentDiv(i);contentDiv.style.display="block";return }}},_enableDisableTab:function(tabNumber,enable){if(tabNumber>=0&&tabNumber<this._getNbTabs(this.container)){var li=$("li"+this.containerId+tabNumber);if(li==null){return }if(enable){li.style.display="block;"}else{li.style.display="none;"}}else{var msg="Position "+tabNumber+" is outside the tabs range";throw new Salto.TechnicalException({message:msg})}},selectTab:function(tabNumber,li){if(tabNumber==this.options.curOngletNum){return }if(li==null){li=$("li"+this.containerId+tabNumber)}if(!Element.hasClassName(li,"selected")){Element.addClassName(li,"selected")}var contentDiv=this.getContentDiv(tabNumber);contentDiv.style.display="block";li=$("li"+this.containerId+this.options.curOngletNum);if(Element.hasClassName(li,"selected")){Element.removeClassName(li,"selected")}contentDiv=this.getContentDiv(this.options.curOngletNum);contentDiv.style.display="none";this.options.curOngletNum=tabNumber},getContentDiv:function(tabNumber){return $("content"+this.containerId+tabNumber)},enableTab:function(tabNumber){this._enableDisableTab(tabNumber,true)},disableTab:function(tabNumber){this._enableDisableTab(tabNumber,false)},showClickedTab:function(){this.selectTab(this.options.ongletClicked,null)}});function selectTabObject(tabsId,tabNumber){var theTabs=fwkGetComponent($(tabsId));theTabs.selectTab(tabNumber,null)}function callTabSelectAction(tabsId,tabNumber){var theTabs=fwkGetComponent($(tabsId));var selectAction=theTabs.options.selectActions[tabNumber];var linkedForm=theTabs.options.linkedForms[tabNumber];var param="?";if(selectAction.indexOf("?")>0){param="&"}theTabs.options.ongletClicked=tabNumber;var li=$("li"+theTabs.containerId+tabNumber);var staticContent=theTabs.options.staticContent[tabNumber];var isStatic=(staticContent&&staticContent=="true");if(selectAction!=""&&theTabs._hasNotBeenLoaded(li)===true&&!isStatic){var fwkIdContent="content"+tabsId+tabNumber;var urlCalled=selectAction+param+"fwkNumTab="+tabNumber+"&fwkTabsId="+tabsId+"&fwkIdContent="+fwkIdContent;if(!theTabs.options.reload&&!Element.hasClassName(li,"loaded")){Element.addClassName(li,"loaded")}fwkDebug("AjaxCall of "+urlCalled);if(linkedForm==""||$(linkedForm)==null){AjaxCall(urlCalled)}else{FormAjaxCall(urlCalled,$(linkedForm))}}else{theTabs.showClickedTab()}}Salto.Window=Class.create();Salto.Window.ID_PREFIX="SALTO_WINDOW_";Salto.Window.LAST_ID=0;Salto.Window.minimizeLeft=0;Salto.Window.minWinWidth=120;Salto.Window.winArray=[];Salto.Window.maxNumber=10000;Salto.Window.lastActive=null;Salto.Window.currentWindow=null;Salto.Window.SCROLL_HANDLER=null;Salto.Window.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(config){this.target=null;this.winDiv=null;this.titleArea=null;this.titleText=null;this.minButton=null;this.maxButton=null;this.closeButton=null;this.contentArea=null;this.statusArea=null;this.resizeArea=null;this.winNumber=0;if(config){config.showTitle=(config.showTitle==undefined)?true:config.showTitle;config.showRestoreButton=(config.showRestoreButton==undefined)?true:config.showRestoreButton;config.minWidth=(config.minWidth==undefined)?180:config.minWidth;config.minHeight=(config.minHeight==undefined)?70:config.minHeight;config.state="simple";config.titleWidth=(config.titleWidth==undefined)?0:config.titleWidth;config.contentWidth=(config.contentWidth==undefined)?0:config.contentWidth;config.statusWidth=(config.statusWidth==undefined)?0:config.statusWidth;config.heightDiff=(config.heightDiff==undefined)?0:config.heightDiff;config.left=(config.left==undefined)?0:config.left;config.top=(config.top==undefined)?0:config.top;config.width=(config.width==undefined)?0:config.width;config.height=(config.height==undefined)?0:config.height;config.showEffect=config.showEffect?config.showEffect:Element.show;config.showEffectOptions=config.showEffectOptions?config.showEffectOptions:null;config.closeEffect=config.closeEffect?config.closeEffect:Element.hide;config.closeEffectOptions=config.closeEffectOptions?config.closeEffectOptions:null;if(!config.id){config.id=this._generateId()}this.config=config;if(this.config.autoCloseAfterNMs){this._timeout=setTimeout(function(){this._timeout=null;this.close()}.bind(this),parseInt(this.config.autoCloseAfterNMs,10))}}else{this.config={};this.config.id=this._generateId();this.config.showTitle=true;this.config.showRestoreButton=false;this.config.minWidth=180;this.config.minHeight=70;this.config.state="simple";this.config.titleWidth=0;this.config.contentWidth=0;this.config.statusWidth=0;this.config.heightDiff=0;this.config.left=0;this.config.top=0;this.config.width=0;this.config.height=0;this.config.showEffect=Element.show;this.config.showEffectOptions=null;this.config.closeEffect=Element.hide;this.config.closeEffectOptions=null}this.setConfig(config)},_generateId:function(){return Salto.Window.ID_PREFIX+Salto.Window.LAST_ID},getId:function(){return this.config.id},release:function(){this.destroy()},setConfig:function(config){this.config.showMinButton=(typeof config.showMinButton!="undefined")?config.showMinButton==true:true;this.config.showMaxButton=(typeof config.showMaxButton!="undefined")?config.showMaxButton==true:true;this.config.showCloseButton=(typeof config.showCloseButton!="undefined")?config.showCloseButton==true:true;this.config.showStatus=(typeof config.showStatus!="undefined")?config.showStatus==true:true;this.config.canResize=(typeof config.showResize!="undefined")?config.showResize==true:true;this.config.raiseOnlyOnTitle=(typeof config.raiseOnlyOnTitle!="undefined")?config.raiseOnlyOnTitle==true:true;this.config.canDrag=(typeof config.canDrag!="undefined")?config.canDrag==true:true;this.config.modal=(typeof config.modal!="undefined")?config.modal==true:false;this.onContentLoad=(typeof config.onLoad!="undefined")?config.onLoad:function(){}},mouseDown:function(evt){var ev=evt||window.event;var win=this;this.target=this.getTarget(ev);var target=this.target;try{if(!this.target){return }if(!win.config.raiseOnlyOnTitle){win.raise()}else{if(target&&((target.buttonType=="move")||(target.buttonType=="min")||(target.buttonType=="max")||(target.buttonType=="close")||(target.buttonType=="restore"))){win.raise()}}if(target){switch(target.buttonType){case"move":if(!target.customMouseDown){if(win.config.canDrag&&win.config.state!="min"&&win.config.state!="max"){win.showStatus("Drag the window","temp");var posX=ev.pageX||ev.clientX+window.document.body.scrollLeft||0;var posY=ev.pageY||ev.clientY+window.document.body.scrollTop||0;var L=parseInt(win.winDiv.style.left,10)||0;var T=parseInt(win.winDiv.style.top,10)||0;win.winDiv.xOffs=(posX-L);win.winDiv.yOffs=(posY-T);win.titleArea.style.cursor="move"}}else{target.customMouseDown(ev,win,target)}break;case"resize":if(!target.customMouseDown){if(win.config.canResize&&win.config.state!="min"&&win.config.state!="max"){win.showStatus("resize the window","temp");win.winDiv.xOffs=parseInt(win.winDiv.style.left,10)||0;win.winDiv.yOffs=parseInt(win.winDiv.style.top,10)||0}}else{target.customMouseDown(ev,win,target)}break;case"close":if(!target.customMouseDown){}else{target.customMouseDown(ev,win,target)}break;case"min":if(!target.customMouseDown){}else{target.customMouseDown(ev,win,target)}break;case"max":if(!target.customMouseDown){}else{target.customMouseDown(ev,win,target)}break;case"restore":if(!target.customMouseDown){}else{target.customMouseDown(ev,win,target)}break}}}finally{win=null;if(target){Event.stop(ev);ev=null;target=null;return false}ev=null;target=null}},mouseMove:function(evt){var ev=evt||window.event;var win=this;var target=this.target;try{if(target){if(!this.target){return }switch(target.buttonType){case"move":if(!target.customMouseMove){if(win.config.canDrag&&win.config.state!="min"&&win.config.state!="max"){var posX=ev.pageX||ev.clientX+window.document.body.scrollLeft||0;var posY=ev.pageY||ev.clientY+window.document.body.scrollTop||0;var L=posX-win.winDiv.xOffs,T=posY-win.winDiv.yOffs;win.setPos(L,T)}}else{target.customMouseMove(ev,win,target)}break;case"resize":if(!target.customMouseMove){if(win.config.canResize&&win.config.state!="min"&&win.config.state!="max"){var posX=ev.pageX||ev.clientX+window.document.body.scrollLeft||0;var posY=ev.pageY||ev.clientY+window.document.body.scrollTop||0;var newWidth=posX-win.winDiv.xOffs;if(newWidth<win.config.minWidth){newWidth=win.config.minWidth}var newHeight=posY-win.winDiv.yOffs-win.config.heightDiff;if(newHeight<win.config.minHeight){newHeight=win.config.minHeight}win.setSize(newWidth,newHeight)}}else{target.customMouseMove(ev,win,target)}break}}}finally{win=null;if(target){Event.stop(ev);ev=null;target=null;return false}ev=null;target=null}},mouseUp:function(evt){var ev=evt||window.event;var win=this;var target=this.target;try{if(target){if(!this.target){return }switch(target.buttonType){case"move":if(!target.customMouseUp){if(win.config.canDrag){win.showStatus("","restore");win.titleArea.style.cursor="default"}}else{target.customMouseUp(ev,win,target)}break;case"resize":if(!target.customMouseUp){if(win.config.canResize){win.showStatus("","resize")}}else{target.customMouseUp(ev,win,target)}break;case"close":if(!target.customMouseUp){win.close()}else{target.customMouseUp(ev,win,target)}break;case"min":if(!target.customMouseUp){if(win.config.showMinButton&&win.state!="min"&&target==(ev.srcElement||ev.target)){if(win.contentArea){var style=win.titleArea.nextSibling.style;style.display="none";style=null}if(win.statusArea||win.resizeArea){style=win.titleArea.nextSibling.nextSibling.style;style.display="none";style=null}target.buttonType="restore";target.className="scWindowRestoreButton";win.winDiv.style.width=Salto.Window.minWinWidth+"px";if(win.titleText){win.titleText.style.width=(Salto.Window.minWinWidth-(win.config.width-win.config.titleWidth))+"px"}win.winDiv.style.left=Salto.Window.minimizeLeft+"px";Element.removeClassName(win.titleArea,"active");Element.addClassName(win.titleArea,"head");win.winDiv.style.top="";win.winDiv.style.bottom="0px";win.config.showMinButton=false;if(win.config.state=="max"){win.config.showMaxButton=true;win.maxButton.className="scWindowMaxButton";win.maxButton.buttonType="max"}else{win.config.showRestoreButton=true}win.config.state="min";if(Salto.Window.lastActive){Salto.Window.lastActive.setCurrent()}Salto.Window.minimizeLeft+=Salto.Window.minWinWidth+5}}else{target.customMouseUp(ev,win,target)}break;case"max":if(!target.customMouseUp){if(win.config.showMaxButton&&win.state!="max"&&target==(ev.srcElement||ev.target)){var sizes=fwkGetWindowSize();var windowWidth=sizes.width;var windowHeight=sizes.height;var style=win.winDiv.style;style.left="0px";style.top="0px";var diff=win.config.width-windowWidth;style.width=windowWidth+"px";style=null;Element.removeClassName(win.titleArea,"head");Element.addClassName(win.titleArea,"active");if(win.titleText&&win.config.titleWidth>=diff){win.titleText.style.width=(win.config.titleWidth-diff)+"px"}else{if(win.titleText){win.titleText.style.width="0px"}}if(win.contentArea&&win.config.contentWidth>=diff){win.contentArea.style.width=(win.config.contentWidth-diff)+"px"}else{if(win.contentArea){win.contentArea.style.width="0px"}}if(win.statusArea&&win.config.statusWidth>=diff){win.statusArea.style.width=(win.config.statusWidth-diff)+"px"}else{if(win.statusArea){win.statusArea.style.width="0px"}}win.contentArea.style.height=(windowHeight-win.config.heightDiff)+"px";if(win.config.state=="min"){if(win.contentArea){var style=win.titleArea.nextSibling.style;if(!Salto.is_ie){if(style.display!="table-row"){style.display="table-row"}}else{if(style.display!="block"){style.display="block"}}style=null}if(win.statusArea||win.resizeArea){var style=win.titleArea.nextSibling.nextSibling.style;if(!Salto.is_ie){if(style.display!="table-row"){style.display="table-row"}}else{if(style.display!="block"){style.display="block"}}style=null}win.winDiv.style.bottom="";win.config.showMinButton=true;win.minButton.className="scWindowMinButton";win.minButton.buttonType="min";this.sortMin(win)}else{win.config.showRestoreButton=true}win.config.showMaxButton=false;win.config.state="max";target.buttonType="restore";target.className="scWindowRestoreButton"}}else{target.customMouseUp(ev,win,target)}break;case"restore":if(!target.customMouseUp){if(win.config.showRestoreButton&&win.state!="simple"&&target==(ev.srcElement||ev.target)){if(win.contentArea){var style=win.titleArea.nextSibling.style;if(!Salto.is_ie){if(style.display!="table-row"){style.display="table-row"}}else{if(style.display!="block"){style.display="block"}}style=null}if(win.statusArea||win.resizeArea){var style=win.titleArea.nextSibling.nextSibling.style;if(!Salto.is_ie){if(style.display!="table-row"){style.display="table-row"}}else{if(style.display!="block"){style.display="block"}}style=null}win.winDiv.style.bottom="";win.config.showRestoreButton=false;if(win.config.state=="min"){win.config.showMinButton=true;target.buttonType="min";target.className="scWindowMinButton";this.sortMin(win)}else{if(win.config.state=="max"){win.config.showMaxButton=true;target.buttonType="max";target.className="scWindowMaxButton"}}win.config.state="simple";win.setPosAndSize(win.config.left,win.config.top,win.config.width,win.config.height)}}else{target.customMouseUp(ev,win,target)}break}}}finally{win=null;this.target=null;if(target){Event.stop(ev);ev=null;target=null;return false}ev=null;target=null}},attachBehaviour:function(){Event.observe(this.winDiv,"mousedown",this.mouseDown.bindAsEventListener(this),true);Event.observe(window.document,"mousemove",this.mouseMove.bindAsEventListener(this),true);Event.observe(window.document,"mouseup",this.mouseUp.bindAsEventListener(this),true)},getTarget:function(evt){var ev=evt||window.event;var target=getSource(ev);while(target&&!target.buttonType&&(target!=this.winDiv)){target=(target.parentNode?target.parentNode:null)}if(target&&!target.buttonType){target=null}ev=null;return target},showAtCenter:function(){var position=fwkGetCenterPosition(this.config.width,this.config.height);var left=position[0];var top=position[1];top+=Screen.getScrollTop();left+=Screen.getScrollLeft();if(top<0){top=0}if(left<0){left=0}this.showAt(left,top)},calculateSizes:function(){this.winDiv.style.display="block";if(this.titleArea){this.config.titleWidth=this.config.width-(this.winDiv.offsetWidth-this.titleText.offsetWidth);if(this.config.titleWidth<this.config.width){this.config.titleWidth=this.titleText.offsetWidth}}if(this.contentArea){this.config.contentWidth=this.config.width-(this.winDiv.offsetWidth-this.contentArea.offsetWidth);if(this.config.contentWidth<this.config.width){this.config.contentWidth=this.winDiv.offsetWidth}}if(this.statusArea){this.config.statusWidth=this.config.width-(this.winDiv.offsetWidth-this.statusArea.offsetWidth);if(this.config.statusWidth<this.config.width){this.config.statusWidth=this.statusArea.offsetWidth}}this.config.heightDiff=this.winDiv.offsetHeight-this.config.height;this.winDiv.style.display="none"},buildComponent:function(x,y,width,height){var noButtons=!((this.config.showMinButton==true)||(this.config.showMaxButton)||(this.config.showCloseButton));var config=this.config;var div=this.winDiv=this.createElement("div",null,true);div.id=this.config.id;div.className="fwk_compo_default";div.style.position="absolute";div.style.width=(this.config.width=width)+(width=="auto"?"":"px");div.style.display="none";this.config.visible=false;this.attachBehaviour();div=this.createElement("div",div,true);div.className="scWindow";var table=this.createElement("table",div,true);table.border=0;table.cellPadding="0";table.cellSpacing="0";var tbody=this.createElement("tbody",table,true);var tr=null;var td=null;if(config.showTitle==true){tr=this.titleArea=this.createElement("tr",tbody);tr.buttonType="move";tr.className="active scWindowTitleArea";td=this.createElement("td",tr);div=null;div=this.createElement("div",td);div.innerHTML="&nbsp;";td=null;td=this.createElement("td",tr);td.style.width=(this.config.width-45)+"px";div=null;div=this.titleText=this.createElement("div",td);div.className="scWindowTitleText";div.style.overflow="hidden";div.style.width="100%";div.style.height="100%";div.appendChild(document.createTextNode(""));td=null;td=this.createElement("td",tr);td.className="scWindowMinButton";if(config.showMinButton==true){div=null;div=this.minButton=this.createElement("div",td);div.style.overflow="hidden";div.buttonType="min";div=null}td=null;td=this.createElement("td",tr);td.className="scWindowMaxButton";if(config.showMaxButton==true){div=null;div=this.maxButton=this.createElement("div",td);div.style.overflow="hidden";div.buttonType="max";div=null}td=null;td=this.createElement("td",tr);td.className="scWindowCloseButton";if(config.showCloseButton==true){div=null;div=this.closeButton=this.createElement("div",td);div.style.overflow="hidden";div.buttonType="close";div=null}else{if(!Salto.is_ie&&noButtons){div=null;div=this.createElement("div",td);div.innerHTML="&nbsp;";div=null}}tr.firstChild.id="titleFirstCell";tr.lastChild.id="titleLastCell";tr=null;td=null}tr=null;tr=this.createElement("tr",tbody,true);td=null;td=this.createElement("td",tr,true);td.colSpan=5;td.id="contentCell";div=null;div=this.contentArea=document.createElement("div");td.appendChild(div);div.style.height=(this.config.height=height)+(height=="auto"?"":"px");div.style.overflow="auto";div.className="scWindowContent";div.appendChild(document.createTextNode(""));if(this.config.id==Salto.LOADING_POPUP_ID){div.style.padding="0"}if((config.showStatus==true)||(config.canResize==true)){tr=null;tr=this.createElement("tr",tbody);td=null;td=this.createElement("td",tr);td.colSpan=5;td.id="statusCell";table=null;table=this.createElement("table",td);table.height="100%";table.cellPadding="0";table.cellSpacing="0";tbody=null;tbody=this.createElement("tbody",table);tr=null;tr=this.createElement("tr",tbody);td=null;td=this.createElement("td",tr);td.style.verticalAlign="bottom";td.style.width="100%";if(config.showStatus==true){div=null;div=this.statusArea=this.createElement("div",td);div.style.overflow="hidden";div.style.width="100%";div.className="scWindowStatus";div.appendChild(document.createTextNode(""))}if(config.canResize==true){td=null;td=this.createElement("td",tr);td.style.verticalAlign="bottom";div=null;div=this.resizeArea=this.createElement("div",td);div.style.overflow="hidden";div.buttonType="resize";div.className="scWindowResize"}td=null;tr=null;tbody=null;table=null}window.document.body.appendChild(this.winDiv);this.calculateSizes();var size=fwkGetWindowSize();var br={};br.y=Screen.getScrollTop();br.x=Screen.getScrollLeft();if(x=="center"){if(screen.width){x=(size.width-this.config.width)/2+br.x}}if(y=="center"){if(screen.height){y=(size.height-(this.config.height+this.config.heightDiff))/2+br.y}}this.winDiv.style.left=(this.config.left=x)+"px";this.winDiv.style.top=(this.config.top=y)+"px";if(this.titleText){if(this.titleText.style.width.indexOf("%")==-1){this.titleText.style.width=this.config.titleWidth+"px"}}if(this.contentArea){this.contentArea.style.width=this.config.contentWidth+"px"}if(this.statusArea){this.statusArea.style.width=this.config.statusWidth+"px"}if(this.config.modal==true){this.modalLayer=this.createElement("DIV",document.body);var st=this.modalLayer.style;st.display="none";st.position="absolute";st.top=br.y+"px";st.left=br.x+"px";var dim=fwkGetWindowSize();st.width=dim.width+"px";st.height=dim.height+"px";st.zIndex=Salto.Window.maxNumber++;fwkDebug("Scroll Layer dimensions: top:"+st.top+",left:"+st.left+", width:"+st.width+",height:"+st.height);this.modalLayer.id="SALTO_INACTIVE_ZONE_ID";this.modalLayer.className="scWindowModal";if(Salto.Window.SCROLL_HANDLER==null){Salto.Window.SCROLL_HANDLER=new Salto.WindowEventHandler();var srcollListener=Salto.Window.SCROLL_HANDLER.handleTheScroll.bindAsEventListener(Salto.Window.SCROLL_HANDLER);Event.observe(window,"scroll",srcollListener,false);var resizeListener=Salto.Window.SCROLL_HANDLER.handleTheResize.bindAsEventListener(Salto.Window.SCROLL_HANDLER);Event.observe(window,"resize",resizeListener,false);resizeListener=null;srcollListener=null}Salto.Window.SCROLL_HANDLER.register(this.modalLayer);this.setupHandlers(false);st=null}this.setWindowNumber();this.winDiv.style.zIndex=Salto.Window.maxNumber++;Salto.Window.winArray.push(this);this.setCurrent();config=null;td=null;tr=null;tbody=null;table=null;div=null},handleKeyEvents:function(evt){if(Salto.Window.currentWindow!=this){return true}var e=(!evt)?window.event:evt;var source=getSource(e);if(fwkIsParent(this.contentArea,source)===true){e=null;source=null;return true}Event.stop(e);e=null;source=null;return false},handleMouseEvents:function(evt){if(Salto.Window.currentWindow!=this){return true}var e=(!evt)?window.event:evt;var source=getSource(e);if(fwkIsParent(this.contentArea,source)===true){e=null;source=null;return true}Event.stop(e);e=null;source=null;return false},createElement:function(type,parent,selectable){var el=Builder.node(type);if(typeof parent!="undefined"&&parent!=null){parent.appendChild(el)}if(!selectable){if(Salto.is_ie){el.setAttribute("unselectable",true)}if(Salto.is_gecko){el.style.setProperty("-moz-user-select","none","")}}return el},sortMin:function(raised){var place=parseInt(raised.winDiv.style.left,10),win;for(var i=0;i<Salto.Window.winArray.length;++i){var win=Salto.Window.winArray[i];if(win&&win.config.state=="min"){var left=parseInt(win.winDiv.style.left,10);if(left>place){left-=Salto.Window.minWinWidth+5;win.winDiv.style.left=left+"px"}}win=null}Salto.Window.minimizeLeft-=Salto.Window.minWinWidth+5},setWindowNumber:function(){this.winNumber=Salto.Window.maxNumber++},setCurrent:function(deb){var win=this;if(Salto.Window.currentWindow&&win!=Salto.Window.currentWindow){if(Salto.Window.currentWindow.winDiv){Element.removeClassName(Salto.Window.currentWindow.winDiv,"scWindowFront");Element.addClassName(Salto.Window.currentWindow.winDiv,"scWindowBack")}if(Salto.Window.currentWindow.winDiv&&Salto.Window.currentWindow.config.state!="min"){Salto.Window.lastActive=Salto.Window.currentWindow}else{var zIndex=0;Salto.Window.lastActive=null;for(var i=0;i<Salto.Window.winArray.length;++i){if(Salto.Window.winArray[i]&&(parseInt(Salto.Window.winArray[i].winDiv.style.zIndex,10)>zIndex)&&(Salto.Window.winArray[i].config.state!="min")&&(Salto.Window.winArray[i]!=win)){zIndex=parseInt(Salto.Window.winArray[i].winDiv.style.zIndex,10);Salto.Window.lastActive=Salto.Window.winArray[i]}}}}Salto.Window.currentWindow=win;Element.removeClassName(win.winDiv,"scWindowBack");Element.addClassName(win.winDiv,"scWindowFront");win=null},setContent:function(text){if(Salto.is_gecko){var node=Builder.node("DIV");node.innerHTML=text;this.contentArea.appendChild(node);node=null}else{this.contentArea.innerHTML=text;fwkEvaluateScriptText(text)}},setDivContent:function(div){if(typeof div=="string"){div=$(div)}if(typeof div=="object"){this.contentArea.appendChild(div)}},setContentUrl:function(url){alert("Not implemented")},setTitle:function(text){if(text==""){this.titleText.innerHTML="Window "+this.winNumber}else{if(this.config.showTitle){this.titleText.innerHTML=text}}},getTitle:function(){return this.config.title},setLeft:function(left){this.config.left=left;this.winDiv.style.left=(left+"px")},setTop:function(top){this.config.top=top;this.winDiv.style.top=(top+"px")},setWidth:function(width){var diff=this.config.width-width;if(Salto.is_gecko){}this.winDiv.style.width=(this.config.width=width)+"px";if(this.titleText&&this.config.titleWidth>=diff){this.titleText.style.width=(this.config.titleWidth-=diff)+"px"}else{if(this.titleText){this.config.titleWidth=0;this.titleText.style.width="0px"}}if(this.contentArea&&this.config.contentWidth>=diff){this.contentArea.style.width=(this.config.contentWidth-=diff)+"px"}else{if(this.contentArea){this.config.contentWidth=0;this.contentArea.style.width="0px"}}if(this.statusArea&&this.config.statusWidth>=diff){this.statusArea.style.width=(this.config.statusWidth-=diff)+"px"}else{if(this.statusArea){this.config.statusWidth=0;this.statusArea.style.width="0px"}}},setHeight:function(height){this.contentArea.style.height=(this.config.height=height)+"px"},setPos:function(left,top){this.setLeft(left);this.setTop(top)},setSize:function(width,height){this.setWidth(width);this.setHeight(height)},setPosAndSize:function(left,top,width,height){this.setPos(left,top);this.setSize(width,height)},focus:function(){this.raise()},raise:function(){this.winDiv.style.zIndex=Salto.Window.maxNumber++;this.setCurrent(this)},getZIndex:function(){return this.winDiv.style.zIndex},showStatus:function(message,mode){if(this.config.showStatus){switch(mode){case"temp":this.config.statusText=this.statusArea.innerHTML;break;case"restore":message=this.config.statusText;break}this.statusArea.innerHTML=message}},show:function(){if(this.config.visible===false){Salto.fwkDisableEnableSelects(true,this.contentArea)}this.config.visible=true;if(this.config.showEffect==Element.show){this.config.showEffect(this.winDiv);this.internalShow()}else{var theThis=this;var theOptions={afterFinish:function(){theThis.internalShow()}};theOptions=Object.extend(theOptions,this.config.showEffectOptions||{});this.config.showEffect(this.winDiv,theOptions);theOptions=null}},internalShow:function(){this.winDiv.style.display="block";if(this.config.modal==true&&this.modalLayer){this.modalLayer.style.display="block";var st=this.modalLayer.style;st.top=Screen.getScrollTop()+"px";st.left=Screen.getScrollLeft()+"px";var dim=fwkGetWindowSize();st.width=dim.width+"px";st.height=dim.height+"px";st=null}this.setupHandlers(false);this.setSize(this.config.width,this.config.height)},setupHandlers:function(destroy){if(!destroy){if(this.config.modal==true){if(!this.keyListener){this.keyListener=this.handleKeyEvents.bindAsEventListener(this);Event.observe(window.document,"keydown",this.keyListener,false)}if(!this.mouseListener){this.mouseListener=this.handleMouseEvents.bindAsEventListener(this);Event.observe(window.document,"mousedown",this.mouseListener,false)}}}else{if(this.keyListener){Event.stopObserving(window.document,"keydown",this.keyListener);this.keyListener=null}if(this.mouseListener){Event.stopObserving(window.document,"mousedown",this.mouseListener);this.mouseListener=null}}},hide:function(){this.winDiv.style.display="none";if(this.config.modal==true&&this.modalLayer){this.modalLayer.style.display="none"}if(this.config.visible===true){Salto.fwkDisableEnableSelects(false,this.contentArea)}this.config.visible=false;this.setupHandlers(true)},close:function(){if(this._timeout){clearTimeout(this._timeout)}if(this.config.closeEffect==Element.hide){this.config.closeEffect(this.winDiv);this.internalClose()}else{var theThis=this;var options={afterFinish:function(){theThis.internalClose()}};Object.extend(options,this.config.closeEffectOptions||{});this.config.closeEffect(this.winDiv,options);options=null}},internalClose:function(){Salto.fwkDisableEnableSelects(false,this.contentArea);if(this.mouseDown){Event.stopObserving(this.winDiv,"mousedown",this.mouseDown)}if(this.mouseMove){Event.stopObserving(window.document,"mousemove",this.mouseMove)}if(this.mouseUp){Event.stopObserving(window.document,"mouseup",this.mouseUp)}this.setupHandlers(true);if(this.config.modal==true&&this.modalLayer){Salto.Window.SCROLL_HANDLER.unregister(this.modalLayer);Element.remove(this.modalLayer)}if(this.titleArea){Element.remove(this.titleArea)}Element.remove(this.contentArea);Element.remove(this.winDiv);for(var i=0;i<Salto.Window.winArray.length;++i){if(Salto.Window.winArray[i]==this){Salto.Window.winArray[i]=null}}Salto.Window.winArray=Salto.Window.winArray.compact();if(Salto.Window.lastActive==this){Salto.Window.lastActive=null}if(Salto.Window.currentWindow==this){Salto.Window.currentWindow=null}try{this.statusArea=null;this.statusText=null;this.titleArea=null;this.titleText=null;this.minButton=null;this.maxButton=null;this.closeButton=null;this.resizeArea=null;this.contentArea=null;this.modalLayer=null;this.config.content=null;this.config.title=null;this.config.divContent=null;this.config.urlContent=null;this.config=null;this.target=null;delete this.winDiv}finally{this.winDiv=null}Salto.WindowUtils.focusCurrentPopup()},destroy:function(){this.close()},showAtElement:function(el,opts){var self=this;var p=fwkGetAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true}this.winDiv.style.display="block";var w=self.winDiv.offsetWidth;var h=self.winDiv.offsetHeight;self.winDiv.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1)}switch(valign){case"T":p.y-=h;break;case"B":p.y+=el.offsetHeight;break;case"C":p.y+=(el.offsetHeight-h)/2;break;case"t":p.y+=el.offsetHeight-h;break;case"b":break}switch(halign){case"L":p.x-=w;break;case"R":p.x+=el.offsetWidth;break;case"C":p.x+=(el.offsetWidth-w)/2;break;case"l":p.x+=el.offsetWidth-w;break;case"r":break}p.width=w;p.height=h;this.fixBoxPosition(p);self.showAt(p.x,p.y);self=null},fixBoxPosition:function(box){if(box.x<0){box.x=0}if(box.y<0){box.y=0}var cp=this.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";window.document.body.appendChild(cp);var br=fwkGetAbsolutePos(cp);window.document.body.removeChild(cp);br.y+=Screen.getScrollTop();br.x+=Screen.getScrollLeft();var tmp=box.x+box.width-br.x;if(tmp>0){box.x-=tmp}tmp=box.y+box.height-br.y;if(tmp>0){box.y-=tmp}cp=null;s=null},showAt:function(x,y){this.setPos(x,y);this.show()}});Salto.Window.setup=function(config){if(!config){config={}}if(config.popup){var win=new Salto.Window(config);if(typeof config.popup=="string"){config.popup=$(config.popup)}if(!config.popup){alert("You specified wrong trigger element!");win.destroy();return }if(!config.triggerEvent){config.triggerEvent="click"}if(!config.align){config.align=null}el=config.popup;el["on"+config.triggerEvent]=function(ev){if(!win.winDiv){win.buildComponent(0,0,config.width||win.config.minWidth,config.height||win.config.minHeight);if(config.title){win.setTitle(config.title)}if(config.content){win.setContent(config.content)}if(config.divContent){win.setDivContent(config.divContent)}if(config.urlContent){win.setContentUrl(config.urlContent)}}if(!win.config.visible){win.showAtElement(this,config.align)}win=null;return false};win=null;return }else{var win=new Salto.Window(config);win.buildComponent(config.left||0,config.top||0,config.width||win.config.minWidth,config.height||win.config.minHeight);if(config.title){win.setTitle(config.title)}if(config.content){win.setContent(config.content)}if(config.divContent){win.setDivContent(config.divContent)}if(config.urlContent){win.setContentUrl(config.urlContent)}win.show();return win}};Salto.WindowEventHandler=Class.create();Salto.WindowEventHandler.prototype={initialize:function(){this.list=[];this.currentScrollY=Screen.getScrollTop();this.currentScrollX=Screen.getScrollLeft()},register:function(node){fwkDebug("Registering"+node.style.top);var top=parseInt(node.style.top,10)||0;top-=Screen.getScrollTop();var left=parseInt(node.style.left,10)||0;left-=Screen.getScrollLeft();if(top<0){top=0}if(left<0){left=0}var scrollInfos=new Object();scrollInfos.node=node;scrollInfos.origTop=top;scrollInfos.origLeft=left;fwkDebug("scrollInfos="+scrollInfos);this.list[this.list.length]=scrollInfos;fwkDebug("Registered")},unregister:function(node){fwkDebug("Unregistering");for(var count=0;count<this.list.length;++count){var elm=this.list[count];if(node==elm.node){this.list.splice(count,1);fwkDebug("Unregistered, new length:"+this.list.length);return }elm=null}},handleTheScroll:function(evt){var posY=Screen.getScrollTop();var posX=Screen.getScrollLeft();var oldX=this.currentScrollX;var oldY=this.currentScrollY;this.currentScrollX=posX;this.currentScrollY=posY;var diffY=posY-oldY;var diffX=posX-oldX;fwkDebug("diffX:"+diffX+",diffY:"+diffY+", nb windows:"+this.list.length);for(var count=0;count<this.list.length;count++){var elm=this.list[count];if(elm){var node=elm.node;if(!elm.origTop){var positionNode=fwkGetAbsolutePos(node);elm.origTop=positionNode.y;elm.origLeft=positionNode.x;node.style.position="absolute"}var newOrigTop=parseInt(elm.origTop,10)+parseInt(diffY,10);var newOrigLeft=parseInt(elm.origLeft,10)+parseInt(diffX,10);node.style.top=newOrigTop+"px";node.style.left=newOrigLeft+"px";elm.origTop=newOrigTop;elm.origLeft=newOrigLeft;fwkDebug("Scrolling layer from Y:"+diffY+"X:"+diffX+" , new top:"+node.style.top+", height:"+node.style.height);node=null}elm=null}},handleTheResize:function(evt){var dim=fwkGetWindowSize();for(var count=0;count<this.list.length;count++){var elm=this.list[count];if(elm){var node=elm.node;node.style.width=dim.width;node.style.height=dim.height;fwkDebug("Resized to height="+dim.height+" , width="+dim.width);node=null}elm=null}}};Salto.TableSorter=Class.create();Salto.TableSorter.TYPE_STRING="string";Salto.TableSorter.TYPE_INSENSITIVE_STRING="insensitivestring";Salto.TableSorter.TYPE_NUMBER="number";Salto.TableSorter.TYPE_DATE="date";Salto.TableSorter.prototype={initialize:function(containerId,options){var tableContainer=$(containerId);this.setOptions(options);var headerCells=tableContainer.rows.item(0).cells;var typeMap=new Array();for(var i=0;i<headerCells.length;i++){typeMap[i]=headerCells[i].getAttribute(Salto.Table.CELL_TYPE_FORMAT)}this.typeMap=typeMap},setOptions:function(options){this.options={type:Salto.TableSorter.TYPE_STRING};Object.extend(this.options,options||{})},destroy:function(){},dateCellSort:function(cell1,cell2){var lhsValue=Salto.Table.getInnerText(cell1);var rhsValue=Salto.Table.getInnerText(cell2);var lhsTypeMap=this.typeMap[fwkCellIndex(cell1)];var rhsTypeMap=this.typeMap[fwkCellIndex(cell2)];var lhs=getDateFromFormat(lhsValue,lhsTypeMap);var rhs=getDateFromFormat(rhsValue,rhsTypeMap);return(lhs-rhs)},stringCellSort:function(cell1,cell2){var lhsValue=Salto.Table.getInnerText(cell1);var rhsValue=Salto.Table.getInnerText(cell2);if(lhsValue==rhsValue){return 0}else{if(lhsValue<rhsValue){return -1}else{return 1}}},numberCellSort:function(cell1,cell2){var lhsValue=Salto.Table.getInnerText(cell1);var rhsValue=Salto.Table.getInnerText(cell2);return(Number(lhsValue.replace(/(\s)+/g,"").replace(",","."))-Number(rhsValue.replace(/(\s)+/g,"").replace(",",".")))},insensitiveString:function(cell1,cell2){var lhsValue=Salto.Table.getInnerText(cell1);var rhsValue=Salto.Table.getInnerText(cell2);if(lhsValue!=null){lhsValue=lhsValue.toUpperCase()}if(rhsValue!=null){rhsValue=rhsValue.toUpperCase()}if(lhsValue==rhsValue){return 0}else{if(lhsValue<rhsValue){return -1}else{return 1}}},sort:function(array){var dtInit=new Date().getTime();var sortFunction=this.stringCellSort;if(this.options.type==Salto.TableSorter.TYPE_DATE){sortFunction=this.dateCellSort.bind(this)}else{if(this.options.type==Salto.TableSorter.TYPE_NUMBER){sortFunction=this.numberCellSort.bind(this)}else{if(this.options.type==Salto.TableSorter.TYPE_INSENSITIVE_STRING){sortFunction=this.insensitiveString.bind(this)}}}array.sort(sortFunction);if(array.length>0&&Prototype.Browser.IE){if(array[0].tagName==="TD"){var tableToSort=array[0].parentNode.parentNode.parentNode;var cbs=tableToSort.getElementsBySelector('input[type="checkbox"]');var i=0;for(;i<cbs.length;i++){cbs[i].defaultChecked=cbs[i].checked}}}}};Salto.Table=Class.create();Salto.Table.CELL_TYPE_FORMAT="fwkCellTypeFormat";Salto.Table.CELL_TYPE="fwkCellType";Salto.Table.DELETE_ACTION="deleteAction";Salto.Table.TABLE_SELECTED="tblSelected";Salto.Table.SELECT_DATA="selectData";Salto.Table.TRIGGER_SELECT_ACTION="triggerselectaction";Salto.Table.DELETE_DATA="deleteParameters";Salto.Table.ROW_ID="tblId";Salto.Table.COL_HEAD_NONE=0;Salto.Table.COL_HEAD_EDGE=1;Salto.Table.COL_HEAD_OVER=2;Salto.Table.COL_HEAD_SIZE=3;Salto.Table.COL_HEAD_DOWN=4;Salto.Table.COL_HEAD_MOVE=5;Salto.Table.ALIGN_AUTO=0;Salto.Table.ALIGN_LEFT=1;Salto.Table.ALIGN_CENTER=2;Salto.Table.ALIGN_RIGHT=3;Salto.Table.SORT_ASCENDING=1;Salto.Table.SORT_DESCENDING=-1;Salto.Table.DEFAULT_SORT=Salto.Table.SORT_DESCENDING;Salto.Table.getLeftPos=function(_el){var x=0;for(var el=_el;el;el=el.offsetParent){x+=el.offsetLeft}return x};Salto.Table.getInnerText=function(el){if(typeof el=="string"){return el}if(typeof el=="undefined"){return el}if(el.innerText){return el.innerText}var str="";var cs=el.childNodes;var l=cs.length;for(var i=0;i<l;i++){switch(cs[i].nodeType){case 1:str+=Salto.Table.getInnerText(cs[i]);break;case 3:str+=cs[i].nodeValue;break}}return str};Salto.Table.compareNumericAsc=function(n1,n2){if(Number(n1)<Number(n2)){return -1}if(Number(n1)>Number(n2)){return 1}return 0};Salto.Table.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options){Salto.MemTracker.register(this);this.logger=Log4js.getLogger("FWK_DATATABLE");this.logger.setLevel(Log4js.Level.ERROR);this.logger.addAppender(new Salto.FwkAjaxAppender(this.logger,Salto.FwkLogging.LOGGING_URL));this.containerId=containerId;this.container=$(containerId);this.divContainerId="tableContainer_"+this.containerId;this.divContainer=$(this.divContainerId);fwkSetComponent(this.container,this);this.sortCol=-1;this.sortAscDesc=Salto.Table.DEFAULT_SORT;this.lastSearchedRow=-1;this.setOptions(options);this.sortCol=this.options.defaultSort?this.options.defaultSort:this.sortCol;if(this.options.defaultSort==0){this.sortCol=0}this.sortAscDesc=this.options.defaultOrder?this.options.defaultOrder:this.sortAscDesc;this._headerOper=Salto.Table.COL_HEAD_NONE;this._headerData=null;this.nextRowIndex=this.container.rows.length;this._tableRows=this.container.rows;this._theTable=this.container;this.selectedRows=[];this._colorOddEvenRows();this._buildComponent();this._attachBehaviors();this.disableChildElementInInactiveLines()},disableChildElementInInactiveLines:function(){for(var i=0;i<this._tableRows.length;i++){if((!Element.hasClassName(this._tableRows[i],"inactive"))&&(!Element.hasClassName(this._tableRows[i],"disabled"))){continue}var elements=fwkGetAllChildren(this._tableRows[i],new Array("INPUT","BUTTON","SELECT","TEXTAREA"));for(var j=0;j<elements.length;j++){elements[j].disabled=true}}},setSelectAction:function(newSelectAction){this.options.selectAction=newSelectAction},setSortAction:function(newSortAction){this.options.sortAction=newSortAction},_buildComponent:function(){if(this.options.isSortable){var tableContainer=this.container;for(var i=0;i<this.options.isSortable.length;i++){if(this.options.isSortable[i]===true){this._setIsSortableColumn(tableContainer,i,false)}}}this.setSortedColumn(this.sortCol,this.sortAscDesc)},_attachBehaviors:function(){var divContainer=this.divContainer;if(this.options.selectActionOnSimpleClick===false){divContainer.ondblclick=this._ondblclick.bindAsEventListener(this)}divContainer.tabIndex="0";divContainer.onkeydown=this._onKeyDown.bindAsEventListener(this);if(this.options.allowColumnResizing){divContainer.onmousedown=this._mouseDown.bindAsEventListener(this);divContainer.onmousemove=this._mouseMove.bindAsEventListener(this)}divContainer.onmouseup=this._mouseUp.bindAsEventListener(this);this.container.rows[0].onselectstart=function(e){return false};if(this.options.columnSelection!=null){if($("datatable_columnChoiceOpen_"+this.containerId)==null){var div=document.createElement("div");div["id"]="datatable_columnChoiceOpen_"+this.containerId;div["className"]="datatable_columnChoiceOpen";document.getElementsByTagName("body")[0].appendChild(div);div=document.createElement("div");div["id"]="datatable_columnChoiceDetail_"+this.containerId;div["className"]="datatable_columnChoiceDetail";document.getElementsByTagName("body")[0].appendChild(div);$("datatable_columnChoiceOpen_"+this.containerId).hide();$("datatable_columnChoiceDetail_"+this.containerId).hide()}$$("#"+this.containerId+" th.head").invoke("observe","mouseover",this.shColMouveoverTableHeader.bindAsEventListener(this));$$("#"+this.containerId+" th.head").invoke("observe","mouseout",this.shColMouveoutTableHeader.bindAsEventListener(this));$("datatable_columnChoiceOpen_"+this.containerId).observe("mouseover",this.shColMouveoverTableHeader.bindAsEventListener(this));$("datatable_columnChoiceOpen_"+this.containerId).observe("mouseout",this.shColMouveoutTableHeader.bindAsEventListener(this));$("datatable_columnChoiceOpen_"+this.containerId).observe("click",this.shColFillChoice.bindAsEventListener(this));$("datatable_columnChoiceDetail_"+this.containerId).observe("mouseover",this.shColShowChoice.bindAsEventListener(this));$("datatable_columnChoiceDetail_"+this.containerId).observe("mouseout",this.shColHideChoice.bindAsEventListener(this));this.shColExecuteChoice(undefined)}},getGUIContainer:function(){return this.divContainer},release:function(){this.selectedRows.clear();var divContainer=this.divContainer;divContainer.onkeydown=null;divContainer.onmousedown=null;divContainer.onmousemove=null;divContainer.onmouseup=null;divContainer.onselectstart=null;this._tableRows=null;this._headerData=null;this.container.modelObj=null;this.container.ondblclick=null;this.container.onclick=null;this.options=null;this.logger=null;this.container=null;this.divContainer=null},setOptions:function(options){this.options={columnForSearch:-1,allowColumnResizing:false,selectActionOnSimpleClick:false,selectAction:null,deleteAction:null,confirmDeletionMsg:null,multipleSelection:true,rowSelection:true,isSortable:null,sortAction:null,sortAliases:null,coloredSelection:true,colorEvenRows:true,rowActiveCssClass:"rowActive active",rowSelectedCssClass:"rowSelected selected",evenRowCssClass:"even",oddRowCssClass:"odd",currColIdx:-1,sortAscImage:SALTO_FWK_CONTEXT_PATH+"/fwk/image/table/asc.png",sortDescImage:SALTO_FWK_CONTEXT_PATH+"/fwk/image/table/desc.png",sortableImage:SALTO_FWK_CONTEXT_PATH+"/fwk/image/table/sort.png",spacerImage:SALTO_FWK_CONTEXT_PATH+"/fwk/image/table/sortspacer.gif",sortSelectedClass:"selected",sortAscClass:"asc",sortDescClass:"desc",onselect:null,onsort:null,paginatorId:null,scrollOnSelect:true,columnSelection:null};Object.extend(this.options,options||{})},_onKeyDown:function(e){var el=Event.element(e);var key=(e)?e.keyCode:window.event.keyCode;this._handleRowKey(key,false,false,el);return true},selectRange:function(a,b){if(!this.options.rowSelection){return }var aRowIndex;if(typeof a=="number"){aRowIndex=new Array();for(var i=a;i<=b;i++){aRowIndex.push(i)}for(var i=b;i<=a;i++){aRowIndex.push(i)}}else{aRowIndex=a}for(var i=0;i<aRowIndex.length;i++){if((aRowIndex[i]<0)||(aRowIndex[i]>this._tableRows.length-1)){this.error="Unable to select rows, index out of range.";return 1}}var eRows=this._tableRows;while(this.selectedRows.length){if(this.options.colorEvenRows){this._setEvenOddClass(eRows[this.selectedRows[0]],this.selectedRows[0])}else{eRows[this.selectedRows[0]].className=""}this.selectedRows.splice(0,1)}var bMatch;for(var i=0;i<aRowIndex.length;i++){bMatch=false;for(var j=0;j<this.selectedRows.length;j++){if(this.selectedRows[j]==aRowIndex[i]){bMatch=true;break}}if(!bMatch){this.selectedRows.push(aRowIndex[i]);if(this.options.coloredSelection&&!Element.hasClassName(eRows[aRowIndex[i]],"inactive")&&!Element.hasClassName(eRows[aRowIndex[i]],"disabled")&&!Element.hasClassName(eRows[aRowIndex[i]],this.options.rowSelectedCssClass)){Element.addClassName(eRows[aRowIndex[i]],this.options.rowSelectedCssClass)}}}if(this.options.onselect){this.options.onselect(this.selectedRows)}return 0},selectRow:function(iRowIndex,callOnSelect,bMultiple,cell){if(!this.options.rowSelection){return }if((iRowIndex<0)||(iRowIndex>this._tableRows.length-1)){this.error="Unable to select row, index out of range.";return 1}var eRows=this._tableRows;var bSelect=true;if((!bMultiple)||(!this.options.multipleSelection)){for(var i=0;i<this.selectedRows.length;i++){if(this.selectedRows[i]==iRowIndex){bSelect=false}if(this.options.colorEvenRows){if(this.options.coloredSelection){var classToRemove=this.options.rowSelectedCssClass.split(" ");for(var j=0;j<classToRemove.length;j++){Element.removeClassName(eRows[this.selectedRows[i]],classToRemove[j])}}}else{eRows[this.selectedRows[i]].className=""}}this.selectedRows.clear()}else{for(var i=0;i<this.selectedRows.length;i++){if(this.selectedRows[i]==iRowIndex){if(this.options.colorEvenRows){if(this.options.coloredSelection){Element.removeClassName(eRows[this.selectedRows[i]],this.options.rowSelectedCssClass)}}else{eRows[this.selectedRows[i]].className=""}this.selectedRows.splice(i,1);bSelect=false;break}}}if(bSelect){this.selectedRows.push(iRowIndex);if(this.options.scrollOnSelect===true){if($("tableContainer_"+this.containerId)!=null&&Element.hasClassName($("tableContainer_"+this.containerId),"tableContainer")){var scrollToSet=0;for(var i=1;i<eRows.length;i++){if(i==iRowIndex){break}scrollToSet+=eRows[i].offsetHeight}$("tableContainer_"+this.containerId).scrollTop=scrollToSet;this.container.getElementsByTagName("TBODY")[0].scrollTop=scrollToSet}}if(this.options.coloredSelection&&!Element.hasClassName(eRows[iRowIndex],"inactive")&&!Element.hasClassName(eRows[iRowIndex],"disabled")&&!Element.hasClassName(eRows[iRowIndex],this.options.rowSelectedCssClass)){Element.addClassName(eRows[iRowIndex],this.options.rowSelectedCssClass)}}if(callOnSelect==true){if(this.options.selectActionOnSimpleClick===true){this.defaultOnSelect(this.selectedRows,cell)}else{if(this.options.onselect){this.options.onselect(this.selectedRows)}}}return 0},_handleRowKey:function(iKeyCode,bCtrl,bShift,element){var iActiveRow=-1;if(this.selectedRows.length!=0){iActiveRow=this.selectedRows[this.selectedRows.length-1]}if((!bCtrl)&&(!bShift)){if(element&&element.tagName&&(element.tagName=="INPUT"||element.tagName=="SELECT"||element.tagName=="OPTION"||element.tagName=="BUTTON"||element.tagName=="TEXTAREA")){return true}if(iKeyCode==Event.KEY_UP){if(iActiveRow>1){this.selectRow(iActiveRow-1,false)}return false}else{if(iKeyCode==Event.KEY_DOWN){if(iActiveRow<this._tableRows.length-1){this.selectRow(iActiveRow+1,false)}return false}else{if(iKeyCode==Event.KEY_TAB){var divContainer=this.divContainer;divContainer.onkeydown=null;return }else{if(iKeyCode==33){if(iActiveRow>10){this.selectRow(iActiveRow-10,false)}else{this.selectRow(1,false)}return false}else{if(iKeyCode==34){if(iActiveRow<this._tableRows.length-10){this.selectRow(iActiveRow+10,false)}else{this.selectRow(this._tableRows.length-1,false)}return false}else{if(iKeyCode==36){this.selectRow(1,false);return false}else{if(iKeyCode==35){this.selectRow(this._tableRows.length-1,false);return false}else{if(this.options.columnForSearch){if(iKeyCode==Event.KEY_DELETE){if(this.options.deleteAction){this.defaultOnDelete(this.selectedRows)}else{this.removeRow(iActiveRow)}return false}else{if(iKeyCode==Event.KEY_RETURN){if(this.options.selectAction){this.defaultOnSelect(this.selectedRows)}return false}else{if(this.options.columnForSearch!=-1){this.seekRow(iKeyCode,bCtrl,bShift)}return false}}}}}}}}}}return true}return true},seekRow:function(iKeyCode,bCtrl,bShift){if(this.options.columnForSearch<0||this.options.columnForSearch>=this._tableRows[0].cells.length){return }var character=String.fromCharCode(iKeyCode).toUpperCase();var length=this._tableRows.length;var currentIndice=1;if((this.lastSearchedCharacter==character)&&this.lastFoundRow>=1){currentIndice=this.lastFoundRow+1;if(currentIndice>length-1){currentIndice=1}}else{this.lastSearchedCharacter=character;this.lastFoundRow=-1}var searchCell=this.options.columnForSearch;var nbIterations=0;while(true){var text=Salto.Table.getInnerText(this._tableRows[currentIndice].cells[searchCell]);text=text.toUpperCase();if(text.indexOf(character)==0){this.lastFoundRow=currentIndice;this.selectRow(currentIndice,true,this.options.multipleSelection);this._tableRows[currentIndice].scrollIntoView(true);break}if(nbIterations==length){this.lastFoundRow=-1;break}currentIndice++;nbIterations++;if(currentIndice>length-1){currentIndice=1}}},defaultOnDelete:function(selectedRows){if(this.options.deleteAction&&selectedRows.length>0){if(this.options.confirmDeletionMsg!=null){if(!confirm(this.options.confirmDeletionMsg)){return }}var table=this.container;var params="";var eRows=this._tableRows;for(var i=0;i<selectedRows.length;i++){params+=eRows[selectedRows[i]].getAttribute(Salto.Table.ROW_ID);params+="&";params+=eRows[selectedRows[i]].getAttribute(Salto.Table.DELETE_DATA);params+="&";params+="position="+selectedRows[i];params+="&"}if(params[params.length-1]=="&"){params+="_fwk_table_delete=true&tableId="+table.getAttribute("id")}else{params+="&_fwk_table_delete=true&tableId="+table.getAttribute("id")}Salto.Ajax.serverCallWithParam({url:this.options.deleteAction,theParameters:params,isForm:true,noHistory:true,theNoPopup:false})}},setSortedColumn:function(columnIndice,ascDesc){if(columnIndice>=0){this._setArrow(this.container,columnIndice,ascDesc);this.sortCol=columnIndice;this.sortAscDesc=(ascDesc===Salto.Table.SORT_ASCENDING)?Salto.Table.SORT_ASCENDING:Salto.Table.SORT_DESCENDING}},getSortRequestParameters:function(){if(this.sortCol!=null&&this.sortCol>-1&&this.sortAscDesc!=null){var table=this.container;var parameters={tableId:table.getAttribute("id"),fwkTableSortAscDesc:((this.sortAscDesc===Salto.Table.SORT_ASCENDING)?"A":"D"),fwkSortColumnIndice:this.sortCol,fwkSortColumnName:this.options.sortAliases[this.sortCol],fwkTableSort:"true"};return $H(parameters).toQueryString()}return null},_sortOnServer:function(sortAscDesc,sortedColumnIndice){var table=this.container;var parameters={tableId:table.getAttribute("id"),fwkTableSortAscDesc:((sortAscDesc===Salto.Table.SORT_ASCENDING)?"A":"D"),fwkSortColumnIndice:sortedColumnIndice,fwkSortColumnName:this.options.sortAliases[sortedColumnIndice],fwkTableSort:"true"};var ajaxParameters=$H(parameters).toQueryString();if(this.options.paginatorId!=null){var paginatorComponent=fwkGetComponent(this.options.paginatorId);if(paginatorComponent!=null){var paginatorParameters=paginatorComponent.getPaginatorRequestParameters();ajaxParameters+="&"+paginatorParameters}}Salto.Ajax.serverCallWithParam({url:this.options.sortAction,theParameters:ajaxParameters})},defaultOnSelect:function(selectedRows,cell){if(this.options.selectAction&&selectedRows.length>0&&((cell!=null&&cell.getAttribute(Salto.Table.TRIGGER_SELECT_ACTION)=="true")||(cell==null))){var table=this.container;var params="";var eRows=this._tableRows;for(var i=0;i<selectedRows.length;i++){if((Element.hasClassName(eRows[selectedRows[i]],"disabled"))||(Element.hasClassName(eRows[selectedRows[i]],"inactive"))){continue}params+=eRows[selectedRows[i]].getAttribute(Salto.Table.ROW_ID);params+="&";params+=eRows[selectedRows[i]].getAttribute(Salto.Table.SELECT_DATA);params+="&"}if(params.length>0){if(params[params.length-1]=="&"){params+="tableId="+table.getAttribute("id")+"&fwkRowSelect=true"}else{params+="&tableId="+table.getAttribute("id")+"&fwkRowSelect=true"}Salto.Ajax.serverCallWithParam({url:this.options.selectAction,theParameters:params})}}},_setIsSortableColumn:function(table,cellIndex,displaySpacer){var firstRow=table.rows[0];var theCells=firstRow.cells;var theCell=theCells.item(cellIndex);try{theCell.style.cursor="pointer"}catch(e){theCell.style.cursor="hand"}var eImg=theCell.getElementsByTagName("img")[0];if(eImg&&displaySpacer){eImg.src=this.options.spacerImage}},_setArrow:function(table,cellIndex,order,oldSortedIndex){var firstRow=table.rows[0];var theCells=firstRow.cells;if(((oldSortedIndex>=0)&&(oldSortedIndex<theCells.length))){var oldItem=theCells.item(oldSortedIndex);var eImg=oldItem.getElementsByTagName("img")[0];if(eImg){this._setIsSortableColumn(table,oldSortedIndex,true)}Element.removeClassName(oldItem,this.options.sortSelectedClass);Element.removeClassName(oldItem,this.options.sortDescClass);Element.removeClassName(oldItem,this.options.sortAscClass)}var headerCell=theCells.item(cellIndex);var eImg=headerCell.getElementsByTagName("img")[0];eImg.src=(order===Salto.Table.SORT_ASCENDING)?this.options.sortAscImage:this.options.sortDescImage;eImg.style.display="";Element.addClassName(headerCell,this.options.sortSelectedClass);Element.addClassName(headerCell,(order===Salto.Table.SORT_ASCENDING)?this.options.sortAscClass:this.options.sortDescClass)},_handleRowSelection:function(evt){if(!Event.isLeftClick(evt)){return }var eventSource=getSource(evt);if(eventSource){var parentSrc=fwkGetParent(eventSource,"A");var isDeleteRow=Element.classNames(eventSource).toString().indexOf("salto-delete-row")>=0||(parentSrc!=null&&Element.classNames(parentSrc).toString().indexOf("salto-delete-row")>=0);if(isDeleteRow===false&&(eventSource.nodeName=="INPUT"||eventSource.nodeName=="A"||eventSource.nodeName=="IMG")){return }}var src=fwkGetParent(eventSource,"A");var tableContainer=this.container;if(src==null){src=eventSource}else{var classNames=Element.classNames(src).toString();if(classNames.indexOf("salto-delete-row")>=0){src=fwkGetParent(src,"TR");if(src&&src.rowIndex>0){var selectedRows=new Array();selectedRows[0]=src.rowIndex;this.defaultOnDelete(selectedRows)}}}if(src!=tableContainer){var srcTR=fwkGetParent(src,"TR");if(srcTR){if(srcTR.rowIndex>0){if(src.tagName!="TD"){src=fwkGetParent(src,"TD")}this.selectRow(srcTR.rowIndex,true,(evt)?evt.ctrlKey:window.event.ctrlKey,src)}}}},_ondblclick:function(evt){var src=getSource(evt);if(src==this.container){return }var srcTR=fwkGetParent(src,"TR");if(srcTR!=null){if(srcTR.rowIndex>0){var selectedRows=new Array();selectedRows[0]=srcTR.rowIndex;if(src.tagName!="TD"){src=fwkGetParent(src,"TD")}this.defaultOnSelect(selectedRows,src)}}},_sort:function(cell){var cellIndex=fwkCellIndex(cell);var bDescending=(this.sortCol==cellIndex)?(this.sortAscDesc*-1):Salto.Table.DEFAULT_SORT;var sortAlias=(this.options.sortAliases!=null?this.options.sortAliases[cellIndex]:undefined);this.sort(cellIndex,bDescending,sortAlias);this.selectedRows.clear();var eRows=this._tableRows;for(var i=0;i<eRows.length;i++){if(Element.hasClassName(eRows[i],this.options.rowSelectedCssClass)){this.selectedRows.push(i)}}},sort:function(cellIndex,bDescending,sortAlias){if(!this.options.isSortable||this.options.isSortable[cellIndex]===false){return }if(this.sortCol==cellIndex&&this.sortAscDesc==bDescending){return }if(!bDescending){bDescending=1}var tableContainer=this.container;var cell=tableContainer.rows[0].cells[cellIndex];var sortType=cell.getAttribute(Salto.Table.CELL_TYPE);var dtInit=new Date().getTime();var oldSortedIndex=this.sortCol;this.sortAlias=sortAlias;if(this.sortCol==cellIndex){this.sortAscDesc=this.sortAscDesc*-1}else{this.sortAscDesc=Salto.Table.DEFAULT_SORT;this.sortCol=cellIndex}if(this.options.sortAction){this._sortOnServer(this.sortAscDesc,this.sortCol);return }var sorter=new Salto.TableSorter(this.containerId,{type:sortType});var cells=new Array();var startRow=1;var rows=tableContainer.rows;var endRow=rows.length;for(var i=startRow;i<endRow;i++){cells[i-startRow]=rows.item(i).cells.item(cellIndex)}sorter.sort(cells);sorter.destroy();var tbody=tableContainer.tBodies[0];if(this.sortAscDesc===Salto.Table.SORT_ASCENDING){for(var i=0;i<cells.length;i++){tbody.appendChild(cells[i].parentNode)}}else{for(var i=cells.length-1;i>=0;i--){tbody.appendChild(cells[i].parentNode)}}this._setArrow(tableContainer,cellIndex,this.sortAscDesc,oldSortedIndex);this.selectedRows.clear();fwkDebug("Sort in "+(new Date().getTime()-dtInit)+" ms.");this._colorOddEvenRows();var tableBodyContainer=$(this.container.lastChild);var divTableContainer=this.divContainer;if(tableBodyContainer.scrollTop){tableBodyContainer.scrollTop=0}if(divTableContainer.scrollTop){divTableContainer.scrollTop=0}if(this.options.onsort){this.options.onsort(this.sortCol,this.sortAscDesc,this.sortAlias)}},_colorOddEvenRows:function(){if(!this.options.colorEvenRows){return }var tableContainer=this.container;var tr=tableContainer.tBodies[0].getElementsByTagName("tr");for(var j=0;j<tr.length;j++){var toChange=tr[j];toChange.onmouseover=this._lineHover.bindAsEventListener(this);toChange.onmouseout=this._lineBack.bindAsEventListener(this);if(j%2==0){Element.removeClassName(toChange,this.options.oddRowCssClass);if(!Element.hasClassName(toChange,this.options.evenRowCssClass)){Element.addClassName(toChange,this.options.evenRowCssClass)}}else{Element.removeClassName(toChange,this.options.evenRowCssClass);if(!Element.hasClassName(toChange,this.options.oddRowCssClass)){Element.addClassName(toChange,this.options.oddRowCssClass)}}}},addRowWithHtml:function(htmlContent){this.addRowsWithHtml(htmlContent,true)},addRowsWithHtml:function(htmlContent,onlyLastLine){var newDivElement=document.createElement("div");newDivElement.innerHTML=htmlContent;var trs=newDivElement.getElementsByTagName("tr");if(!trs||trs.length==0){return }var startLine=1;if(onlyLastLine){startLine=trs.length-1}var nbLines=trs.length;var tableContainer=this.container;var parent=tableContainer.tBodies[0];for(var i=startLine;i<nbLines;i++){trs[i].setAttribute(Salto.Table.ROW_ID,"rowId="+this.getNextRowId());parent.appendChild(trs[i].cloneNode(true))}var localContainerId=this.containerId;$$("#"+localContainerId+" th[columnnb]").each(function(th){var colNb=th.getAttribute("columnnb");var visible=th.getAttribute("columnvisible");var action=(visible=="true")?"show":"hide";$$("#"+localContainerId+' *[columnnb="'+colNb+'"]').invoke(action)});this._colorOddEvenRows()},getNextRowId:function(){var resu=this.nextRowIndex;this.nextRowIndex++;return resu},removeRange:function(a,b){var aRowIndex=new Array();if(typeof a=="number"){for(var i=a;i<=b;i++){aRowIndex.push(i)}}else{for(var i=0;i<a.length;i++){aRowIndex.push(a[i])}aRowIndex.sort(Salto.Table.compareNumericAsc)}while((i=aRowIndex.pop())>=0){var rc=this._removeRow(i)}this._colorOddEvenRows();if(this.options.onselect){this.options.onselect(this.selectedRows)}return 0},clear:function(){return this.removeRange(1,this._tableRows.length-1)},deleteRow:function(){if(this.selectedRows.length>0){var rowNum=this.selectedRows[0];this.deleteRowAt(rowNum)}},removeRow:function(iRowIndex){return this.deleteRowAt(iRowIndex)},deleteRowAt:function(iRowIndex){var rc=this._removeRow(iRowIndex);if(rc){return rc}this._colorOddEvenRows();this.selectRow((iRowIndex>2)?iRowIndex-1:1,true);if(this.options.onselect){this.options.onselect(this.selectedRows)}return 0},_removeRow:function(iRowIndex){if((iRowIndex<1)||(iRowIndex>this._tableRows.length-1)){this.error="Unable to remove row, row index out of range.";return 1}for(var i=this.selectedRows.length-1;i>=0;i--){if(this.selectedRows[i]==iRowIndex){this.selectedRows.splice(i,1)}}var tableContainer=this.container;var tr=tableContainer.deleteRow(iRowIndex);return 0},findRowsWhereAttributeIs:function(attributeName,attributeValue){return this.container.getElementsBySelector("tr["+attributeName+'="'+attributeValue+'"]')},findRowWhereAttributeIs:function(attributeName,attributeValue){var result=this.findRowsWhereAttributeIs(attributeName,attributeValue);if(result.length>0){return result[0]}else{return null}},deleteLastColumn:function(){var tableContainer=this.container;var colId=tableContainer.rows[0].cells.length-1;this.deleteColumn(colId)},deleteColumn:function(colId){var tableContainer=this.container;if(colId>=0&&colId<tableContainer.rows[0].cells.length){for(var i=0;i<tableContainer.rows.length;i++){tableContainer.rows[i].deleteCell(colId)}}else{alert("Please, select a cell before")}},deselectAllRows:function(){for(var i=0;i<this.selectedRows.length;i++){var tableRows=this._tableRows;if(this.options.colorEvenRows){if(this.options.coloredSelection){Element.removeClassName(tableRows[this.selectedRows[i]],this.options.rowSelectedCssClass)}}else{tableRows[this.selectedRows[i]].className=""}}this.selectedRows.clear()},getSelectedRow:function(){return(this.selectedRows.length)?this.selectedRows[this.selectedRows.length-1]:-1},getSelectedRange:function(){return(this.selectedRows.length)?this.selectedRows:-1},getRowCount:function(){return this._tableRows.length-1},getCellValue:function(iRowIndex,iColIndex,bHTML){if((iRowIndex<1)||(iRowIndex>this._tableRows.length-1)){this.error="Unable to get cell value , row index out of range.";return null}if((iColIndex<0)||(iColIndex>this._tableRows[0].cells.length-1)){this.error="Unable to get cell value , row index out of range.";return null}var el=this._tableRows[iRowIndex].cells[iColIndex];return(bHTML)?el.innerHTML:Salto.Table.getInnerText(el)},setCellValue:function(iRowIndex,iColIndex,sValue,bHTML){if((iRowIndex<1)||(iRowIndex>this._tableRows.length-1)){this.error="Unable to set cell value , row index out of range.";return 1}if((iColIndex<0)||(iColIndex>this._tableRows[0].cells.length-1)){this.error="Unable to set cell value , row index out of range.";return 2}var el=this._tableRows[iRowIndex].cells[iColIndex];if(bHTML){el.innerHTML=sValue}else{while(el.firstChild!=el.lastChild){el.removeChild(el.lastChild)}if(el.firstChild){el.firstChild.nodeValue=sValue}else{el.appendChild(document.createTextNode(sValue))}}return 0},_lineHover:function(evt){var src=Event.element(evt);if(src.tagName!="TD"){return }var src=fwkGetParent(src,"TR");if(src.hasClassName("inactive")){return }if(src.hasClassName("disabled")){return }var found=false;for(var i=0;!found&&i<this._tableRows.length;i++){found=(src==this._tableRows[i])}if(found){if(!Element.hasClassName(src,this.options.rowActiveCssClass)){Element.addClassName(src,this.options.rowActiveCssClass)}}},_lineBack:function(evt){var src=Event.element(evt);if(src.tagName!="TD"){return }src=fwkGetParent(src,"TR");if(src.hasClassName("inactive")){return }if(src.hasClassName("disabled")){return }var found=false;for(var i=0;!found&&i<this._tableRows.length;i++){found=(src==this._tableRows[i])}if(found){var classToRemove=this.options.rowActiveCssClass.split(" ");for(var j=0;j<classToRemove.length;j++){Element.removeClassName(src,classToRemove[j])}}},_setEvenOddClass:function(toChange,position){if(position%2==0){Element.removeClassName(toChange,this.options.oddRowCssClass);if(!Element.hasClassName(toChange,this.options.evenRowCssClass)){Element.addClassName(toChange,this.options.evenRowCssClass)}}else{Element.removeClassName(toChange,this.options.evenRowCssClass);if(!Element.hasClassName(toChange,this.options.oddRowCssClass)){Element.addClassName(toChange,this.options.oddRowCssClass)}}},_mouseMove:function(e){var w,tw,ox,rx,i,l;var el=Event.element(e);var x=Event.pointerX(e);var nbColumns=this._tableRows[0].cells.length;if(this._headerOper==Salto.Table.COL_HEAD_DOWN){this._headerOper=Salto.Table.COL_HEAD_MOVE;var container=this.container;container.style.cursor="move";if(this.options.isSortable&&this.options.isSortable[fwkCellIndex(el)]){el.style.cursor="move"}w=this._headerData[2]+(x-this._headerData[1]);if(!this._moveEl){this._moveEl=document.createElement("div");var position=Position.page(this._tableRows[0].cells[0]);this._moveEl.appendChild(document.createTextNode(this._headerData[0].firstChild.nodeValue));this._moveEl.className="salto-datatable-move-header";this.divContainer.appendChild(this._moveEl);this._moveEl.style.top=(position[1]-this._tableRows[0].cells[0].offsetHeight)+"px";if(this.options.columnAlign){switch(this._aColumnAlign[this._headerData[0].cellIndex]){case Salto.Table.ALIGN_LEFT:this._moveEl.style.textAlign="left";break;case Salto.Table.ALIGN_CENTER:this._moveEl.style.textAlign="center";break;case Salto.Table.ALIGN_RIGHT:this._moveEl.style.textAlign="right";break;case Salto.Table.ALIGN_AUTO:default:switch(this._aColumnTypes[this._headerData[0].cellIndex]){case Salto.Table.TYPE_NUMBER:this._moveEl.style.textAlign="right";break;default:this._moveEl.style.textAlign="left"}}}}else{this._moveEl.firstChild.nodeValue=this._headerData[0].firstChild.nodeValue}this._moveEl.style.width=this._headerData[0].clientWidth+"px";if(!this._moveSepEl){this._moveSepEl=document.createElement("div");this._moveSepEl.className="salto-datatable-separator-header";this.divContainer.appendChild(this._moveSepEl);var theContainer=this.container;var position=Position.page(this._tableRows[0]);this._moveSepEl.style.top=(position[1])+"px"}}if(this._headerOper==Salto.Table.COL_HEAD_MOVE){ox=this._headerData[1]+(x-this._headerData[2]);if(this._moveEl){this._moveEl.style.left=(x-this._headerData[1])+"px"}var _eHeadCols=this._tableRows[0].cells;ox=0,rx=x-this._headerData[3];for(i=0;i<nbColumns;i++){ox+=_eHeadCols[i].offsetWidth;if(ox>=rx){break}}if(i==nbColumns){this._moveSepEl.style.left=(_eHeadCols[nbColumns-1].offsetLeft+_eHeadCols[nbColumns-1].offsetWidth-1)+"px"}else{if(this._moveSepEl){this._moveSepEl.style.left=_eHeadCols[i].offsetLeft+"px"}}this._headerData[4]=i}else{if(this._headerOper==Salto.Table.COL_HEAD_SIZE){w=this._headerData[1]+x-this._headerData[2];tw=((w-this._headerData[1])+this._headerData[3])+1;var _eHeadTable=this._theTable;_eHeadTable.style.width=tw+"px";if(w>5){this._headerData[0].style.width=w+"px"}}else{this._checkHeaderOperation(el,x)}}},_mouseDown:function(e){var el=Event.element(e);var x=Event.pointerX(e);if(((el.tagName=="TD")||(el.tagName=="TH"))&&((el.parentNode.parentNode.parentNode.parentNode.className=="salto-datatable")||(el.parentNode.parentNode.parentNode.parentNode.className=="tableContainer"))){this._checkHeaderOperation(el,x);if(this._headerOper==Salto.Table.COL_HEAD_EDGE){this._headerOper=Salto.Table.COL_HEAD_SIZE}else{if(this._headerOper==Salto.Table.COL_HEAD_OVER){this._headerOper=Salto.Table.COL_HEAD_DOWN}}}},_mouseUp:function(e){var divContainer=this.divContainer;divContainer.onkeydown=this._onKeyDown.bindAsEventListener(this);var el=Event.element(e);var x=Event.pointerX(e);if(this._headerOper==Salto.Table.COL_HEAD_SIZE){}else{if(this._headerOper==Salto.Table.COL_HEAD_MOVE){var container=this.divContainer;if(this._moveEl){container.removeChild(this._moveEl);this._moveEl=null}if(this._moveSepEl){container.removeChild(this._moveSepEl);this._moveSepEl=null}this._moveColumn(this._headerData[0].cellIndex,this._headerData[4])}else{if(this._isClickOnHeader(el)===false){this._handleRowSelection(e)}}}if(this._headerOper!=Salto.Table.COL_HEAD_NONE){var container=this.container;this._headerOper=Salto.Table.COL_HEAD_NONE;container.style.cursor="default";this._headerData=null}},_isClickOnHeader:function(el){if(((el.tagName=="TD")||(el.tagName=="TH"))&&((el.parentNode.parentNode.tagName=="THEAD"))){var cell=fwkGetParent(el,"TD","TR");if(cell==null){cell=fwkGetParent(el,"TH","TR")}this._sort(cell);return true}return false},_moveColumInArray:function(theArray,oldIndice,newIndice){var length=theArray.length;var arrayResult=new Array();for(var i=0,j=0;i<length;i++){if(i==newIndice){arrayResult[j]=theArray[oldIndice];j++;arrayResult[j]=theArray[i];j++}else{if(i!=oldIndice){arrayResult[j]=theArray[i];j++}}}if(newIndice==length){arrayResult[newIndice-1]=theArray[oldIndice]}return arrayResult},_moveColumn:function(iCol,iNew){if(iCol==iNew){return }var beforeIndex=iNew;if(iNew>iCol){beforeIndex=iNew+1}this.options.sortAliases=this._moveColumInArray(this.options.sortAliases,iCol,beforeIndex);this.options.isSortable=this._moveColumInArray(this.options.isSortable,iCol,beforeIndex);var nbColumns=this._tableRows[0].cells.length;var nbRows=this._tableRows.length;var oCol=this._tableRows[0].cells[iCol];var oParent=oCol.parentNode;var oBefore;if(iNew==nbColumns-1){oParent.removeChild(oCol);oParent.appendChild(oCol)}else{oBefore=this._tableRows[0].cells[beforeIndex];oParent.removeChild(oCol);oParent.insertBefore(oCol,oBefore)}var aRows=this._tableRows;for(var i=1;i<nbRows;i++){oCol=aRows[i].cells[iCol];oParent=aRows[i];if(iNew==nbColumns-1){oParent.removeChild(oCol);oParent.appendChild(oCol)}else{oBefore=aRows[i].cells[beforeIndex];oParent.removeChild(oCol);oParent.insertBefore(oCol,oBefore)}}if(iCol==this.sortCol){this.sortCol=iNew}},_checkHeaderOperation:function(el,x){var prev,next,left,right,l,r;if(((el.tagName=="TD")||(el.tagName=="TH"))&&((el.parentNode.parentNode.tagName=="THEAD"))){if(el.tagName=="IMG"){el=el.parentNode}prev=fwkGetPreviousBrother(el,"TD");next=fwkGetBrother(el,"TD");left=Salto.Table.getLeftPos(el);right=left+el.offsetWidth;l=(x-5)-left;r=right-x;if((l<5)&&(prev)){this.container.style.cursor="e-resize";if(this.options.isSortable&&this.options.isSortable[fwkCellIndex(el)]){el.style.cursor="e-resize"}this._headerOper=Salto.Table.COL_HEAD_EDGE;this._headerData=[prev,prev.offsetWidth-5,x,this._theTable.offsetWidth]}else{if(r<5){this.container.style.cursor="e-resize";if(this.options.isSortable&&this.options.isSortable[fwkCellIndex(el)]){el.style.cursor="e-resize"}this._headerOper=Salto.Table.COL_HEAD_EDGE;this._headerData=[el,el.offsetWidth-5,x,this._theTable.offsetWidth]}else{this.container.style.cursor="default";if(this.options.isSortable&&this.options.isSortable[fwkCellIndex(el)]){el.style.cursor="pointer"}this._headerOper=Salto.Table.COL_HEAD_OVER;this._headerData=[el,el.offsetLeft,x,Salto.Table.getLeftPos(this.container),fwkCellIndex(el)]}}}else{this.container.style.cursor="default";this._headerOper=Salto.Table.COL_HEAD_NONE;this._headerData=null}},_fwkTreeTableCloseChildren:function(idNode,treeId,del){var max_childs=5000;for(var i=0;i<max_childs;i++){var tr=document.getElementById(idNode+"_"+i);if(tr==null&&i==0){continue}if(tr==null){return }if(i>0){this._fwkTreeTableCloseChildren(idNode+"_"+i,treeId,del)}if(tr.rowIndex!=-1){if(del){var table=fwkGetParent(tr,"TABLE");table.deleteRow(tr.rowIndex)}else{var folder=document.getElementById("folder-"+idNode);var newClassName=folder.className.replace("icon-open","icon-closed");folder.setAttribute("class",newClassName);folder.setAttribute("className",newClassName);tr.style.display="none"}}}},_fwkTreeTableDisplayChildren:function(idNode,treeId){var max_childs=5000;for(var i=1;i<max_childs;i++){var tr=document.getElementById(idNode+"_"+i);if(tr==null){return }if(tr.rowIndex!=-1){tr.style.display=""}}},_fwkTreeTableClickNode:function(selectUrl,closeUrl,idNode,treeId,scrollColumnObject,reload,noWaitingIcon){if(scrollColumnObject!=null){var scrollParameters="&firstColumn="+scrollColumnObject.firstColumn+"&lastColumn="+scrollColumnObject.lastColumn;scrollParameters=scrollParameters+"&leftFixedColumn="+scrollColumnObject.leftFixedColumn+"&rightFixedColumn="+scrollColumnObject.rightFixedColumn;selectUrl=selectUrl+scrollParameters}var div=document.getElementById(idNode);var folder=document.getElementById("folder-"+idNode);var className=folder.getAttribute("class");if(className==null){className=folder.getAttribute("className")}var callAjax=true;if(reload&&reload=="false"&&className.indexOf("loaded")>=0){callAjax=false}var noWaitingIconBool=(noWaitingIcon==true);if(className.indexOf("icon-closed")>-1){if(callAjax){AjaxCall(selectUrl,undefined,undefined,noWaitingIconBool)}else{this._fwkTreeTableDisplayChildren(idNode,treeId)}className=className.replace("icon-closed","icon-open");className+=" loaded";folder.setAttribute("class",className);folder.setAttribute("className",className)}else{if(callAjax){if(closeUrl!=""){AjaxCall(closeUrl,undefined,undefined,noWaitingIconBool)}this._fwkTreeTableCloseChildren(idNode,treeId,true)}else{this._fwkTreeTableCloseChildren(idNode,treeId,false)}className=className.replace("icon-open","icon-closed");folder.setAttribute("class",className);folder.setAttribute("className",className)}},shColMouveoverTableHeader:function(event){if(this.timeoutIdColumnChoiceSelect){clearTimeout(this.timeoutIdColumnChoiceSelect);this.timeoutIdColumnChoiceSelect=undefined}var div=$("datatable_columnChoiceOpen_"+this.containerId);if(div.visible()){return }var pos=Position.cumulativeOffset(this.container);div.style.position="absolute";div.style.top=pos[1]+"px";if(this.options.columnSelection=="outerLeftAndUp"||this.options.columnSelection=="outerLeftAndDown"){div.style.left=(pos[0]-div.getWidth())+"px"}else{if(this.options.columnSelection=="innerLeftAndUp"||this.options.columnSelection=="innerLeftAndDown"){div.style.left=(pos[0])+"px"}else{if(this.options.columnSelection=="innerRightAndUp"||this.options.columnSelection=="innerRightAndDown"){div.style.left=(pos[0]+this.container.getWidth()-div.getWidth())+"px"}else{div.style.left=(pos[0]+this.container.getWidth())+"px"}}}div.show();if(Salto.is_ie6){var img=div.getStyle("background-image");if(img&&img.indexOf(".png")!=-1){var iebg=img.split('url("')[1].split('")')[0];div.setStyle({"background-image":"none"});div.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')"}}},shColMouveoutTableHeader:function(event){this.timeoutIdColumnChoiceSelect=setTimeout("$('datatable_columnChoiceOpen_"+this.containerId+"').hide()",50)},shColFillChoice:function(event){var divArrowChoice=$("datatable_columnChoiceOpen_"+this.containerId);var divId=$("datatable_columnChoiceDetail_"+this.containerId);var divArrowHeight=divArrowChoice.getHeight();divArrowChoice.hide();var data="";$$("#"+this.containerId+" th.head").each(function(elem){var isChecked=(elem.getAttribute("columnvisible")=="true");var nbColumn=elem.getAttribute("columnnb");var texte=(elem.down("span").innerHTML);var checkclass=(isChecked?"columnChoice_selected":"columnChoice_not_selected");data+="<span class='"+checkclass+"' choicecolumn=''><input type='hidden' name='"+nbColumn+"' value='"+isChecked+"' />"+texte+"</span><br />"});data+="<div class='columnChoice_validate'>&nbsp;</div>";divId.innerHTML=data;if(Salto.is_ie6){divId.descendants().each(function(elem){var img=elem.getStyle("background-image");if(img&&img.indexOf(".png")!=-1){var iebg=img.split('url("')[1].split('")')[0];elem.setStyle({"background-image":"none"});elem.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')"}})}$$("#datatable_columnChoiceDetail_"+this.containerId+" span[choicecolumn]").invoke("observe","click",this.shColSwitchColChoice.bindAsEventListener(this));$$("#datatable_columnChoiceDetail_"+this.containerId+" div.columnChoice_validate").invoke("observe","click",this.shColExecuteChoice.bindAsEventListener(this));divId.show();var maxWidth=25;$$("#datatable_columnChoiceDetail_"+this.containerId+" span[choicecolumn]").each(function maxlen(elem){maxWidth=(maxWidth<elem.getWidth()?elem.getWidth():maxWidth)});divId.style.width=maxWidth+5;var pos=Position.cumulativeOffset(this.container);divId.style.position="absolute";if(this.options.columnSelection=="outerLeftAndUp"||this.options.columnSelection=="outerLeftAndDown"){divId.style.left=(pos[0]-divId.getWidth())+"px"}else{if(this.options.columnSelection=="innerLeftAndUp"||this.options.columnSelection=="innerLeftAndDown"){divId.style.left=(pos[0])+"px"}else{if(this.options.columnSelection=="innerRightAndUp"||this.options.columnSelection=="innerRightAndDown"){divId.style.left=(pos[0]+this.container.getWidth()-divId.getWidth())+"px"}else{divId.style.left=(pos[0]+this.container.getWidth())+"px"}}}if(this.options.columnSelection=="innerLeftAndUp"||this.options.columnSelection=="outerLeftAndUp"||this.options.columnSelection=="innerRightAndUp"||this.options.columnSelection=="outerRightAndUp"){divId.style.top=(pos[1]-divId.getHeight()+divArrowHeight)+"px"}else{divId.style.top=(pos[1])+"px"}this.shColShowChoice(event)},shColSwitchColChoice:function(event){var element=Event.element(event);var input=element.down("input");var isChecked=(input.value=="true");if(isChecked){input.value="false";element.removeClassName("columnChoice_selected");element.addClassName("columnChoice_not_selected")}else{input.value="true";element.removeClassName("columnChoice_not_selected");element.addClassName("columnChoice_selected")}},shColExecuteChoice:function(event){var localContainerId=this.containerId;$$("#datatable_columnChoiceDetail_"+this.containerId+" input").each(function(elem){$$("#"+localContainerId+' th[columnnb="'+elem.name+'"].head').each(function(th){th.setAttribute("columnvisible",elem.value)});var action=(elem.value=="true")?"show":"hide";$$("#"+localContainerId+' *[columnnb="'+elem.name+'"]').invoke(action)});this.shColHideChoice()},shColShowChoice:function(event){if(this.timeoutIdColumnChoiceDetail){clearTimeout(this.timeoutIdColumnChoiceDetail);this.timeoutIdColumnChoiceDetail=undefined}$("datatable_columnChoiceDetail_"+this.containerId).show()},shColHideChoice:function(event){this.timeoutIdColumnChoiceDetail=setTimeout("$('datatable_columnChoiceDetail_"+this.containerId+"').hide()",50)}});function deleteRow(theTable){var saltoTable=fwkGetComponent($(theTable.id));saltoTable.deleteRow()}function addRowWithHtml(theTable,html){var saltoTable=fwkGetComponent($(theTable.id));saltoTable.addRowsWithHtml(html,false)}function deleteRowWhereAttributeIs(theTable,attributeName,attributeValue){var tableComponent=fwkGetComponent($(theTable.id));var rowToDelete=findRowWhereAttributeIs(theTable,attributeName,attributeValue);if(rowToDelete!=null){tableComponent.deleteRowAt(rowToDelete.rowIndex)}}function findRowWhereAttributeIs(theTable,attributeName,attributeValue){var saltoTable=fwkGetComponent($(theTable.id));return saltoTable.findRowWhereAttributeIs(attributeName,attributeValue)}function deleteLastColumn(theTable){var saltoTable=fwkGetComponent($(theTable.id));var colId=saltoTable.options.currColIdx;saltoTable.deleteLastColumn(colId)}Salto.Treeview=Class.create();Salto.Treeview.ServerCallbacks=Class.create();Object.extend(Salto.Treeview.ServerCallbacks,{unfoldToNode:function(treeId,startFromNodeId,xmlObj){var rows=xmlObj.firstChild.data;var tree=$(treeId);tree._loadNodesHierarchy(startFromNodeId,rows)},loadTreeChild:function(src,xmlObj){var rows=xmlObj.firstChild.data;fwkGetComponent(src)._loadChildNodes(rows)},newloadTreeChildForRefresh:function(src,xmlObj){var rows=xmlObj.firstChild.data;fwkGetComponent(src)._loadChildNodes(rows);if(Salto.Treeview.ARRAY_NODE_TO_REFRESH!=null&&Salto.Treeview.ARRAY_NODE_TO_REFRESH.length>1){Salto.Treeview.ARRAY_NODE_TO_REFRESH.pop();fwkGetComponent(src).foldUnfoldNode(Salto.Treeview.ARRAY_NODE_TO_REFRESH[Salto.Treeview.ARRAY_NODE_TO_REFRESH.length-1],true)}}});Salto.Treeview.DATA_TO_SEND="data2send";Salto.Treeview.CONTENT_NODE_TAG_NAME="SPAN";Salto.Treeview.LEVEL="level";Salto.Treeview.TREE_ID="fwkTreeId";Salto.Treeview.NODE_TYPE="fwkTVType";Salto.Treeview.CONTENT_NODE="content";Salto.Treeview.IMAGES_OPEN_FOLDER_SUFFIX="open.gif";Salto.Treeview.IMAGES_CLOSED_FOLDER_SUFFIX="closed.gif";Salto.Treeview.IMAGES_FOLDER_OPEN_CLASS="treeviewIFO";Salto.Treeview.IMAGES_FOLDER_CLOSED_CLASS="treeviewIFC";Salto.Treeview.OPEN_NODE_CLASS="treeviewOpenedFolder";Salto.Treeview.CLOSED_NODE_CLASS="treeviewClosedFolder";Salto.Treeview.IMAGES_MINUS_LAST_NODE="mlastnode.gif";Salto.Treeview.IMAGES_PLUS_LAST_NODE="plastnode.gif";Salto.Treeview.IMAGES_PLUS_NODE="pnode.gif";Salto.Treeview.IMAGES_MINUS_NODE="mnode.gif";Salto.Treeview.ARRAY_NODE_TO_REFRESH=null;Salto.Treeview.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options){Salto.MemTracker.register(this);this.containerId=containerId;this.container=$(containerId);fwkSetComponent(this.container,this);this.setOptions(options);this._attachBehaviors(this.container,options)},getGUIContainer:function(){return this.container},release:function(){this.container.onclick=null;this.container.modelObj=null;this.options=null;Element.remove(this.container)},isFoldedNode:function(nodeId){var contentNode=$(nodeId);if(contentNode){var row=null;var src=null;try{row=$(fwkGetParent(contentNode,"TR"));if(row.readAttribute("level")=="1"||row.readAttribute("level")=="0"){src=row.down("img",0)}else{src=row.down("img",1)}return this._isUnfoldAction(src)}finally{row=null;src=null}}else{throw new Salto.TechnicalException({message:"Undefined node:"+nodeId})}},launchRefreshMode:function(arrayNodeToRefresh){if(arrayNodeToRefresh!=null&&arrayNodeToRefresh.length>0){Salto.Treeview.ARRAY_NODE_TO_REFRESH=arrayNodeToRefresh.reverse(false);var currentNode=$(Salto.Treeview.ARRAY_NODE_TO_REFRESH[Salto.Treeview.ARRAY_NODE_TO_REFRESH.length-1]);var currentNodeId=currentNode.getAttribute("id");if(currentNode.getAttribute("loaded")=="true"){this.foldUnfoldNode(currentNodeId);currentNode.setAttribute("loaded","false")}this.foldUnfoldNode(currentNode,true)}},foldUnfoldNode:function(nodeId){var refreshMode=($A(arguments).length>1)?$A(arguments)[1]:false;var contentNode=$(nodeId);if(contentNode){var parentNode=fwkGetParent(contentNode,"TR");this._foldUnfold(parentNode,null,refreshMode)}else{throw new Salto.TechnicalException({message:"Undefined node:"+nodeId})}},_getTreeviewNodeById:function(id){return fwkGetParentHavingAttribute($(id),"TR",Salto.Treeview.LEVEL)},getClientChildrenNodes:function(theContent){var node=fwkGetParent(theContent,"TR");while(node.getAttribute(Salto.Treeview.DATA_TO_SEND)==null){node=fwkGetParent(node,"TR")}var level=parseInt(node.getAttribute(Salto.Treeview.LEVEL),10);var table=this.container;var index=node.rowIndex+1;var result=new Array();var i=0;while(true){if(index>=table.rows.length){break}var nextRow=table.rows.item(index);var brotherLevel=nextRow.getAttribute(Salto.Treeview.LEVEL);if(parseInt(brotherLevel,10)>level){result[i]=fwkGetFirstChildWithAttribute(nextRow,Salto.Treeview.NODE_TYPE,Salto.Treeview.CONTENT_NODE);i++;index++}else{break}}return result},addOrUpdateData2Send:function(theContent,paramName,paramValue){var node=fwkGetParent(theContent,"TR");while(node.getAttribute(Salto.Treeview.DATA_TO_SEND)==null){node=fwkGetParent(node,"TR")}var data2send=node.getAttribute(Salto.Treeview.DATA_TO_SEND);var indexOfParam=data2send.indexOf(paramName);if(indexOfParam>-1){var beginPos=indexOfParam+paramName.length;var begin=data2send.substring(0,beginPos);var indexOfNextParam=data2send.indexOf("&",beginPos);var end="";if(indexOfNextParam>-1){end=data2send.substring(indexOfNextParam,data2send.length)}data2send=begin+"="+paramValue+end}else{data2send+="&"+paramName+"="+paramValue}node.setAttribute(Salto.Treeview.DATA_TO_SEND,data2send)},_attachBehaviors:function(component,options){component.onclick=this._gestTreeview.bindAsEventListener(this);component=null},setOptions:function(options){this.options={style:"treeView",loadChildAction:"",selectNodeAction:"",jsCallback:null,contextPath:null,imgDir:null,imgPrefix:"",clickedRow:null,previousNode:null};Object.extend(this.options,options||{})},setSelectNodeAction:function(newValue){this.options.selectNodeAction=newValue},setLoadChildAction:function(newValue){this.options.loadChildAction=newValue},_loadChildNodes:function(rows){var tmp=document.createElement("DIV");tmp.innerHTML="<TABLE>"+rows+"</TABLE>";var newTableRows=tmp.firstChild.rows;var source=this.clickedRow;var table=this.container;var next=table.rows.item(source.rowIndex+1);var len=newTableRows.length;var tbodyToFill=source.parentNode;for(var i=(len-1);i>=0;i--){next=tbodyToFill.insertBefore(newTableRows.item(i),next)}source.setAttribute("loaded","true");tmp=null},_loadNodesHierarchy:function(startFromNodeId,rows){var tmp=document.createElement("DIV");tmp.innerHTML="<TABLE>"+rows+"</TABLE>";var node=this._getTreeviewNodeById(startFromNodeId);this._removeChildrenNodes(node);var newTableRows=tmp.firstChild.rows;var source=this.clickedRow;var table=this.container;var next=table.rows.item(source.rowIndex+1);var len=newTableRows.length;var tbodyToFill=source.parentNode;for(var i=(len-1);i>=0;i--){next=tbodyToFill.insertBefore(newTableRows.item(i),next)}source.setAttribute("loaded","true");tmp=null},_handleNodeSelection:function(src){var spanNode=fwkGetParent(src,Salto.Treeview.CONTENT_NODE_TAG_NAME);if(spanNode!=null){if(this.options.previousNode){Element.removeClassName(this.options.previousNode,"treeviewSelectedItem");Element.removeClassName(this.options.previousNode,"selected")}this.options.previousNode=spanNode;Element.addClassName(spanNode,"treeviewSelectedItem");Element.addClassName(spanNode,"selected");if(this.options.selectNodeAction!=""){var row=fwkGetParent(src,"TR");var data2send=row.getAttribute(Salto.Treeview.DATA_TO_SEND);fwkDebug("Calling "+this.options.selectNodeAction+" with arguments "+data2send);if(data2send!=null){data2send="&"+data2send}else{data2send=""}Salto.Ajax.serverCallWithParam({url:this.options.selectNodeAction,theParameters:Salto.Treeview.TREE_ID+"="+this.containerId+"&level="+row.getAttribute(Salto.Treeview.LEVEL)+data2send,noHistory:true})}else{if(this.options.jsCallback){var row=fwkGetParent(src,"TR");var data2send=row.getAttribute(Salto.Treeview.DATA_TO_SEND);this.options.jsCallback(this.options.contextPath,this.containerId,row.getAttribute(Salto.Treeview.LEVEL),data2send)}}}},_handleRootNodeClick:function(initSrc){var imagePath=this.options.imgDir+this.options.imgPrefix;var imgPrefix=this.options.imgPrefix;var display=false;var row=fwkGetParent(initSrc,"TR");var table=fwkGetParent(row,"TABLE");for(var i=row.rowIndex+1;i<table.rows.length;i++){var row=table.rows.item(i);if(Number(row.getAttribute(Salto.Treeview.LEVEL))==1){if(row.style.display=="none"){display=true;row.style.display=""}else{row.style.display="none"}}else{if(display){row.style.display=row.getAttribute("displayed")}else{row.setAttribute("displayed",row.style.display);row.style.display="none"}}}var spanNode=fwkGetBrother(initSrc,Salto.Treeview.CONTENT_NODE_TAG_NAME);this._toggleNode(display,null,spanNode,null,initSrc)},_removeChildrenNodes:function(node){var level=parseInt(node.getAttribute(Salto.Treeview.LEVEL),10);var nbRemovedNodes=0;var table=this.container;var index=node.rowIndex+1;while(true){if(index>=table.rows.length){break}var nextRow=table.rows.item(index);var brotherLevel=nextRow.getAttribute(Salto.Treeview.LEVEL);if(parseInt(brotherLevel,10)>level){table.deleteRow(index);nbRemovedNodes++}else{break}}return nbRemovedNodes},_isUnfoldAction:function(node){return node.src.indexOf("plastnode")>0||node.src.indexOf("pnode")>0||node.src.indexOf(Salto.Treeview.IMAGES_CLOSED_FOLDER_SUFFIX)>0},_gestTreeview:function(eventNS){if(!this.options.imgPrefix){return false}try{var src=getSource(eventNS);var initSrc=src;if(src.nodeName==undefined){return }if(src.nodeName!="IMG"){if(src.nodeName!="INPUT"){this._handleNodeSelection(src)}}else{var imgPrefix=this.options.imgPrefix;if(src.nodeName=="IMG"&&(this._isFolderNode(src))){src=fwkGetPreviousBrother(src,"IMG")}if(src==null){this._handleRootNodeClick(initSrc);return }if(src.nodeName=="IMG"&&this._isPlusOrMinusImg(src)){var row=fwkGetParent(src,"TR");this._foldUnfold(row,src)}initSrc=null;src=null}}catch(e){alert("treeview.js:_gestTreeview():,"+fwkPrintError(e))}},_isPlusOrMinusImg:function(node){return node.src.indexOf("pnode")>0||node.src.indexOf("mnode")>0||node.src.indexOf("plastnode")>0||node.src.indexOf("mlastnode")>0},_isFolderNode:function(node){return(node.className==Salto.Treeview.IMAGES_FOLDER_OPEN_CLASS)||(node.className==Salto.Treeview.IMAGES_FOLDER_CLOSED_CLASS)},_foldUnfold:function(row,src){var refreshMode=($A(arguments).length>2)?$A(arguments)[2]:false;var imagePath=this.options.imgDir+this.options.imgPrefix;var imgPrefix=this.options.imgPrefix;if(src==undefined||src==null){src=fwkGetFirstChild(row,"IMG");var childs=src.parentNode.childNodes;for(var i=0;i<childs.length;i++){if(childs[i].tagName==="IMG"&&this._isPlusOrMinusImg(childs[i])){src=childs[i];break}}}var display=false;var level=Number(row.getAttribute(Salto.Treeview.LEVEL));var nbCells=row.cells[0].childNodes.length;var table=fwkGetParent(row,"TABLE");if(row.getAttribute("loaded")=="false"||(this._isUnfoldAction(src)&&row.getAttribute("reloadable")=="true")){var nbRemovedNodes=this._removeChildrenNodes(row);var theData2Send=row.getAttribute(Salto.Treeview.DATA_TO_SEND);this.clickedRow=row;fwkDebug("Calling "+this.options.loadChildAction+" with arguments "+theData2Send);Salto.Ajax.serverCallWithParam({url:this.options.loadChildAction,theParameters:Salto.Treeview.TREE_ID+"="+this.containerId+"&level="+row.getAttribute(Salto.Treeview.LEVEL)+"&"+theData2Send+"&treeId="+this.containerId+"&imgDir="+this.options.imgDir+"&imgPrefix="+this.options.imgPrefix+"&refreshMode="+refreshMode,noHistory:true})}else{for(var i=row.rowIndex+1;i<table.rows.length;i++){var theRow=null;try{theRow=table.rows.item(i);if(Number(theRow.getAttribute(Salto.Treeview.LEVEL))<=level){break}else{if(Number(theRow.getAttribute(Salto.Treeview.LEVEL))==(level+1)){if(theRow.style.display=="none"){display=true;theRow.style.display=""}else{theRow.style.display="none"}}else{if(display){var oldValue=theRow.getAttribute("displayed");if(oldValue!=undefined&&oldValue!==null){theRow.style.display=oldValue}else{theRow.style.display="none"}}else{theRow.setAttribute("displayed",theRow.style.display);theRow.style.display="none"}}}}finally{theRow=null}}}var img=fwkGetBrother(src,"IMG");var spanNode=fwkGetBrother(src,Salto.Treeview.CONTENT_NODE_TAG_NAME);if(level==0){var imgNode=fwkGetFirstChild(row,"IMG");var isUnfold=this._isUnfoldAction(imgNode);this._toggleNode(isUnfold,null,spanNode,null,imgNode)}else{if(src.src.indexOf("pnode")>0){this._toggleNode(true,src,spanNode,Salto.Treeview.IMAGES_MINUS_NODE,img)}else{if(src.src.indexOf("plastnode")>0){this._toggleNode(true,src,spanNode,Salto.Treeview.IMAGES_MINUS_LAST_NODE,img)}else{if(src.src.indexOf("mlastnode")>0){this._toggleNode(false,src,spanNode,Salto.Treeview.IMAGES_PLUS_LAST_NODE,img)}else{this._toggleNode(false,src,spanNode,Salto.Treeview.IMAGES_PLUS_NODE,img)}}}}img=null;spanNode=null},_toggleNode:function(openClosed,imgSrc,spanNode,targetImgSrc,folderImageNode){if(imgSrc){imgSrc.src=this.options.imgDir+this.options.imgPrefix+targetImgSrc}this._setFolderImage(openClosed,folderImageNode);if(openClosed){Element.removeClassName(spanNode,Salto.Treeview.CLOSED_NODE_CLASS);Element.addClassName(spanNode,Salto.Treeview.OPEN_NODE_CLASS)}else{Element.removeClassName(spanNode,Salto.Treeview.OPEN_NODE_CLASS);Element.addClassName(spanNode,Salto.Treeview.CLOSED_NODE_CLASS)}},_setFolderImage:function(open,imgNode){var imagePath=this.options.imgDir+this.options.imgPrefix;if(open){var oldSuffix=Salto.Treeview.IMAGES_CLOSED_FOLDER_SUFFIX;var newSuffix=Salto.Treeview.IMAGES_OPEN_FOLDER_SUFFIX}else{var oldSuffix=Salto.Treeview.IMAGES_OPEN_FOLDER_SUFFIX;var newSuffix=Salto.Treeview.IMAGES_CLOSED_FOLDER_SUFFIX}var oldPath=imgNode.src;var lastIndexOf=oldPath.lastIndexOf(oldSuffix);var newPath=oldPath.substring(0,lastIndexOf);newPath+=newSuffix;imgNode.src=newPath}});Salto.Wizard=Class.create();Salto.Wizard.WIZARD_ID_PARAMETER="fwkWizardId";Salto.Wizard.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options,optionsround){Salto.MemTracker.register(this);this.logger=Log4js.getLogger("FWK_WIZARD");this.logger.setLevel(Log4js.Level.ERROR);this.logger.addAppender(new Salto.FwkAjaxAppender(this.logger,Salto.FwkLogging.LOGGING_URL));this.containerId=containerId;this.container=$(containerId);fwkSetComponent(this.container,this);this.setOptions(options);this.stack=new Salto.Stack();this._attachBehaviors(this.container,optionsround);this.loadedSteps=new Array();this.loadedSteps[0]=true},getGUIContainer:function(){return this.container},release:function(){if(this.stack){this.stack.clear();this.stack=null}if(this.container){if(this.container.onclick){}this.container.onclick=null;if(this.loadedSteps){this.loadedSteps.clear();this.loadedSteps=null}Element.remove(this.container)}this.container=null;this.options=null;this.logger=null},_attachBehaviors:function(theContainer,optionsround){var panels=theContainer.rows.item(0).cells;var opts=new Object();theContainer.onclick=this._onclick.bindAsEventListener(this);for(var i=0;i<panels.length;i++){var div=fwkGetChild(panels.item(i),"DIV");var theDirection=div.getAttribute("direction");if(theDirection&&theDirection!=""){div.className=this.options.style;Rico.Corner.round(div,optionsround)}div=null}var tableId=theContainer.getAttribute("id");if(tableId){if($(tableId+"Step")){$(tableId+"Step").innerHTML=this.options.curStep}}panels=null},setOptions:function(options){this.options={style:"wizard",curStep:1,wizardFormName:null};Object.extend(this.options,options||{})},goToStep:function(increment){var container=this.container;try{var tableId=container.getAttribute("id");var current=$(tableId+this.options.curStep);var nbNext=this.options.curStep+increment;var next=$(tableId+nbNext);if(next){if(increment>1){for(var j=0;j<increment-1;++j){var stepToClean=this.options.curStep+j+1;$(tableId+stepToClean).innerHTML="";this.loadedSteps[stepToClean-1]=false}}this.stack.push(this.options.curStep);current.style.display="none";this.options.curStep=nbNext;next.style.display="";$(tableId+"Step").innerHTML=this.options.curStep;$(tableId+"NextLabel").innerHTML=next.getAttribute("nextLabel");$(tableId+"PreviousLabel").innerHTML=next.getAttribute("previousLabel");this.loadedSteps[this.options.curStep-1]=true;if(!$(tableId+(nbNext+1))){container.rows.item(0).cells.item(2).style.display="none"}container.rows.item(0).cells.item(0).style.visibility="visible"}else{throw new Salto.TechnicalException({message:"No step content for "+tableId+nbNext+", step "+nbNext+"might be false"})}next=null}catch(e){var msg="wizard.js:Salto.Wizard.goToStep():Error "+fwkPrintError(e);this.logger.error(msg);alert(msg);throw e}finally{container=null}},_onclick:function(eventNS){var src=getSource(eventNS);try{var td=fwkGetParent(src,"TD","TABLE");if(td===null){return }var table=fwkGetParent(td,"TABLE");var div=getChild(td,"DIV");if(div){var direction=div.getAttribute("direction");var tableId=table.getAttribute("id");if(direction){if(direction=="previous"){var thePreviousStep=this.stack.pop();if(thePreviousStep&&thePreviousStep!==null){var current=$(tableId+this.options.curStep);this.options.curStep=thePreviousStep;var previous=$(tableId+this.options.curStep);current.style.display="none";previous.style.display="inline";$(tableId+"Step").innerHTML=this.options.curStep;$(tableId+"NextLabel").innerHTML=previous.getAttribute("nextLabel");$(tableId+"PreviousLabel").innerHTML=previous.getAttribute("previousLabel");if(this.options.curStep<=1){td.style.visibility="hidden"}var previousArrowStyle=table.rows.item(0).cells.item(2).style;previousArrowStyle.visibility="visible";previousArrowStyle.display="block";current=null}}else{if(direction=="next"){var current=$(tableId+this.options.curStep);var nbNext=this.options.curStep+1;var next=$(tableId+nbNext);var selectActionValue=current.getAttribute("selectAction");if(selectActionValue&&selectActionValue!=""){var form=null;if(this.options.wizardFormName!==null){form=eval("document."+this.options.wizardFormName);if(form==undefined||form===null){throw new Salto.TechnicalException({message:"Form "+this.options.wizardFormName+" was not found"})}}else{var forms=current.getElementsByTagName("FORM");fwkDebug("Found "+forms.length+" forms");if(forms.length>0){form=forms.item(0)}}if(form!==null){fwkDebug("Submitting FormAjaxCall with url "+selectActionValue+" and form "+form.name+" and next:"+nbNext);var loadedStepsHash="";for(var i=0;i<this.loadedSteps.length;i++){loadedStepsHash+=(i+"="+this.loadedSteps[i])+"&"}var parameters={fwkWizardId:this.containerId,fwkStep:nbNext,fwkIdContent:(tableId+nbNext),fwkLoadedSteps:loadedStepsHash};var indexOfHyphen=selectActionValue.indexOf("?");var newUrl=indexOfHyphen>=0?selectActionValue.substring(0,indexOfHyphen):selectActionValue;Object.extend(parameters,selectActionValue.toQueryParams());Salto.Ajax.serverCallWithParam({url:newUrl+"?"+$H(parameters).toQueryString(),theForm:form,noHistory:true})}else{fwkDebug("Submitting AjaxCall with url "+selectActionValue+" and next:"+nbNext);var loadedStepsHash="";for(var i=0;i<this.loadedSteps.length;i++){loadedStepsHash+=(i+"="+this.loadedSteps[i])+"&"}var parameters={fwkWizardId:this.containerId,fwkStep:nbNext,fwkIdContent:(tableId+nbNext),fwkLoadedSteps:loadedStepsHash};Salto.Ajax.serverCallWithParam({url:selectActionValue,theParameters:$H(parameters).toQueryString(),noHistory:true})}form=null}else{if(next&&next.getAttribute("id")){this.stack.push(this.options.curStep);this.options.curStep=nbNext;current.style.display="none";next.style.display="inline";$(tableId+"Step").innerHTML=this.options.curStep;if(!$(tableId+(nbNext+1))){td.style.visibility="hidden"}table.rows.item(0).cells.item(0).style.visibility="visible"}}}}}}}catch(e){var msg=fwkPrintError(e);this.logger.error("wizard.js:Salto.Wizard.onclick():"+msg);alert(msg)}finally{src=null}}});Salto.Paginator=Class.create();Salto.Paginator.JUMP_INPUT_SUFFIX="_JUMP";Salto.Paginator.JUMP_BUTTON_SUFFIX="_JUMP_BUTTON";Salto.Paginator.BAD_VALUE_CLASS="badValue";Salto.Paginator.SORT_IN_PAGINATION="fwkSortInPagination";Salto.Paginator.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(containerId,options){try{Salto.MemTracker.register(this);this.logger=Log4js.getLogger("FWK_PAGINATOR");this.logger.setLevel(Log4js.Level.ERROR);this.elementsToClean=new Array();this.logger.addAppender(new Salto.FwkAjaxAppender(this.logger,Salto.FwkLogging.LOGGING_URL));this.containerId=containerId;this.jumpInputId=this.containerId+Salto.Paginator.JUMP_INPUT_SUFFIX;this.container=$(containerId);fwkSetComponent(this.container,this);this.setOptions(options);this._attachBehaviors();if(this.options.useJumpToPage&&this.options.focus){if((typeof (this.jumpInput)!="undefined")&&this.jumpInput!==null){this.jumpInput.focus()}}}catch(e){var msg="paginator.js:Salto.Paginator.initialize():Error initializing paginator\n, detail="+fwkPrintError(e);this.logger.error(msg);alert(msg)}},_detachBehaviors:function(){for(var i=0;i<this.elementsToClean.length;i++){if(this.elementsToClean[i]){this.elementsToClean[i].onclick=null;if(this.elementsToClean[i].paginatorData){this.elementsToClean[i].paginatorData=null}this.elementsToClean[i]=null}}this.elementsToClean.clear();if(this.options.useJumpToPage){if(this.jumpInput){this.jumpInput.onkeyup=null;this.jumpInput=null}if(this.jumpButton){this.jumpButton.onclick=null;this.jumpButton=null}}},release:function(){this._detachBehaviors();this.container.modelObj=null;this.options=null;this.logger=null;this.container=null},setOptions:function(options){this.options={minPage:null,maxPage:null,selectedPage:null,pageAttributeName:null,actionUrl:null,parametersMap:null,firstPage:null,lastPage:null,previousPage:null,nextPage:null,focus:false,contextPath:null,jsCallback:null,useJumpToPage:false,datatableId:null};Object.extend(this.options,options||{})},_findElementsWithClassName:function(theLiParentNode,elementName,className){var children=theLiParentNode.childNodes;var arrayOfElement=new Array();for(var i=0;i<children.length;i++){var child=children[i];if(child.tagName===elementName&&Element.hasClassName(child,className)){arrayOfElement.push(child)}}return arrayOfElement},_attachBehaviors:function(){var baseElement=this.container;var theLiParentNode=fwkGetFirstChild(baseElement,"UL");this.elementsToClean.push(this._attachOnClickEventToListElement(theLiParentNode,"firstLink",this.options.firstPage));this.elementsToClean.push(this._attachOnClickEventToListElement(theLiParentNode,"previousLink",this.options.previousPage));this.elementsToClean.push(this._attachOnClickEventToListElement(theLiParentNode,"nextLink",this.options.nextPage));this.elementsToClean.push(this._attachOnClickEventToListElement(theLiParentNode,"lastLink",this.options.lastPage));var arrayOfLinks=this._findElementsWithClassName(theLiParentNode,"LI","numberLink");for(var i=0;i<arrayOfLinks.length;i++){this.elementsToClean.push(arrayOfLinks[i]);arrayOfLinks[i].onclick=this._onClick.bindAsEventListener(this);var aNode=fwkGetFirstChild(arrayOfLinks[i],"A");arrayOfLinks[i].paginatorData=Salto.Table.getInnerText(aNode);aNode=null}arrayOfLinks.clear();arrayOfLinks=null;if(this.options.useJumpToPage){var elementToFocus=$(this.jumpInputId);this.jumpInput=elementToFocus;var jumpButtonId=this.containerId+Salto.Paginator.JUMP_BUTTON_SUFFIX;this.jumpInput.onkeyup=this._handleInputKey.bindAsEventListener(this);this.jumpButton=$(jumpButtonId);this.jumpButton.onclick=this._handleButtonClick.bindAsEventListener(this)}},_attachOnClickEventToListElement:function(theLiParentNode,className,value){if(value){var lastLinks=this._findElementsWithClassName(theLiParentNode,"LI",className);if(lastLinks.length>0){lastLinks[0].onclick=this._onClick.bindAsEventListener(this);lastLinks[0].paginatorData=value;return lastLinks[0]}}},_onClick:function(event){var src=Event.findElement(event,"LI");if(src){this._doServerCall(src.paginatorData)}src=null},getPaginatorRequestParameters:function(){var parameters=$H(this.options.parametersMap).toQueryString();parameters+="&"+this.options.pageAttributeName+"="+encodeURIComponent(this.options.selectedPage);if(parameters.startsWith("&")){return parameters.substring(1)}else{return parameters}},_doServerCall:function(pageNumber){var parameters=$H(this.options.parametersMap).toQueryString();parameters+="&"+this.options.pageAttributeName+"="+encodeURIComponent(pageNumber);if(this.options.datatableId!=null&&this.options.datatableId!="null"){var datatableComponent=fwkGetComponent(this.options.datatableId);if(datatableComponent!=null){var sortParameters=datatableComponent.getSortRequestParameters();if(sortParameters!=null){parameters+="&"+sortParameters+"&"+Salto.Paginator.SORT_IN_PAGINATION+"=true"}}}if(this.options.jsCallback){this.options.jsCallback(this.options.contextPath,parameters.substring(1))}else{AjaxCall(this.options.actionUrl,this.container,parameters)}},_handleInputKey:function(event){var value=$F(this.jumpInputId);var isEmpty=(value=="");var isValid=Salto.NumberUtils.isInRange(value,this.options.minPage,this.options.maxPage);if(!isEmpty&&isValid&&Salto.EventUtils.isReturnKey(event)){this._doServerCall(value)}this._setInputClass(this.jumpInput,isEmpty||isValid)},_handleButtonClick:function(event){var value=$F(this.jumpInputId);var isEmpty=(value=="");var isValid=Salto.NumberUtils.isInRange(value,this.options.minPage,this.options.maxPage);if(!isEmpty&&isValid){this._doServerCall(value)}},_setInputClass:function(elementId,isValid){if(isValid){Element.removeClassName(elementId,Salto.Paginator.BAD_VALUE_CLASS)}else{Element.addClassName(elementId,Salto.Paginator.BAD_VALUE_CLASS)}}});Salto.TOCElement=Class.create();Salto.TOCElement.prototype={initialize:function(el,text,level){this.element=el;this.text=text;this.level=level}};Salto.TOCGenerator=Class.create();Salto.TOCGenerator.prototype={initialize:function(containerId,options){this.containerId=containerId;this.setOptions(options);this._buildComponent()},setOptions:function(options){this.options={startElement:null};Object.extend(this.options,options||{})},_buildComponent:function(){this.generateTOC(this.containerId)},generateTOC:function(parent_id){var parent=$(parent_id);Element.addClassName(parent,"toc");var hs=null;var startElement=document.getElementsByTagName("body")[0];if(this.options.startElement){startElement=$(this.options.startElement)}var hs=this.getHeadlines(startElement);for(var i=0;i<hs.length;++i){var hi=hs[i];var d=document.createElement("div");if(hi.element.id==""){hi.element.id="gen"+i}var a=document.createElement("a");a.href="#"+hi.element.id;a.appendChild(document.createTextNode(hi.text));d.appendChild(a);d.className="toc_level"+hi.level;parent.appendChild(d)}},getHeadlines:function(el){var l=new Array;var rx=/[hH]([1-6])/;var theToc=this;var rec=function(el){for(var i=el.firstChild;i!=null;i=i.nextSibling){if(i.nodeType==1){if(rx.exec(i.tagName)){var text=theToc.getHeadlineText(i);l[l.length]=new Salto.TOCElement(i,text,parseInt(RegExp.$1))}rec(i)}}};rec(el);return l},getHeadlineText:function(el){var text="";for(var i=el.firstChild;i!=null;i=i.nextSibling){if(i.nodeType==3){text+=i.data}else{if(i.firstChild!=null){text+=this.getHeadlineText(i)}}}return text}};Aspects=new Object();Aspects.addBefore=function(obj,fname,before){var oldFunc=obj[fname];obj[fname]=function(){return oldFunc.apply(this,before(arguments,oldFunc,this))}};Aspects.addAfter=function(obj,fname,after){var oldFunc=obj[fname];obj[fname]=function(){return after(oldFunc.apply(this,arguments),arguments,oldFunc,this)}};Aspects.addAround=function(obj,fname,around){var oldFunc=obj[fname];obj[fname]=function(){return around(arguments,oldFunc,this)}};Salto.MemTracker=Class.create();Object.extend(Salto.MemTracker,{isActive:function(){return Prototype.Browser.IE}});Salto.MemTracker.prototype={initialize:function(){this.references=new Array();var theThis=this;if(Salto.MemTracker.isActive()){Event.observe(window,"unload",theThis.cleanupAll.bindAsEventListener(theThis),true);Ajax.Responders.register({onCreate:function(){},onComplete:function(){theThis.run()}})}},addReference:function(object){this.references.push(object)},run:function(){this._cleanup(false)},_cleanup:function(cleanAll){var stillReferenced=new Array();var nbReferences=this.references.length;for(var i=0;i<nbReferences;i++){var component=this.references[i];try{if(component){if(component.isGUIReferenced()&&(cleanAll===false)){stillReferenced.push(component);continue}else{component.release()}}component=null}catch(exception){}}this.references=null;this.references=stillReferenced},cleanupAll:function(){this._cleanup(true)},gc:function(){this._cleanup(false)},_isElementReferenced:function(elt){if(!elt.parentNode||elt.parentNode==null){return false}else{return true}}};Salto.MemTracker.FWK_GARBAGE_COLLECTOR=new Salto.MemTracker();Object.extend(Salto.MemTracker,{register:function(obj){if(Salto.MemTracker.isActive()){Salto.MemTracker.FWK_GARBAGE_COLLECTOR.addReference(obj)}}});Salto.Tooltip=Class.create();Salto.Tooltip.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(id,srcId,options){Salto.MemTracker.register(this);this.containerId=id;this.container=$(id);this.srcId=srcId;this.setOptions(options);this._registerEvent();this._createDivContainer()},setOptions:function(options){this.options={styleSuffix:"",callbackClass:Salto.Tooltip.OverlibCallback,callbackClassOptions:{}};Object.extend(this.options,options||{})},release:function(){this.container.onmouseover=null;this.container.onmouseout=null;this.containerId=null;this.container=null;this.srcId=null;if(this.callback!=null){this.callback.release()}},_registerEvent:function(){if(this.container){this.container.onmouseover=this._showTooltip.bindAsEventListener(this);this.container.onmouseout=this._hideTooltip.bindAsEventListener(this)}},_showTooltip:function(e){this.callback.show(e,document.getElementById(this.srcId).innerHTML)},_hideTooltip:function(e){this.callback.hide(e)},_createDivContainer:function(){this.options.callbackClassOptions.styleSuffix=this.options.styleSuffix;this.options.callbackClassOptions.iframeEmptyPageUrl=this.options.iframeEmptyPageUrl;this.callback=new this.options.callbackClass(this.options.callbackClassOptions);this.callback.createTooltipContainer()}});Salto.Tooltip.AbstractCallback=Class.create();Salto.Tooltip.AbstractCallback.prototype={initialize:function(options){this.setOptions(options);this.iframe=null;this.intval=null},release:function(){this.iframe=null},getIframe:function(){if(this.iframe==null){var idAndName="dynaTooltipHideWindowedElement";this.iframe=$(idAndName);if(this.iframe==null){var iframe=document.createElement("IFRAME");iframe.setAttribute("src",this.options.iframeEmptyPageUrl);iframe.setAttribute("id",idAndName);iframe.setAttribute("name",idAndName);iframe.setAttribute("frameBorder","0px");iframe.style.position="absolute";iframe.style.top="0px";iframe.style.left="0px";iframe.style.width="0px";iframe.style.height="0px";iframe.style.display="none";iframe.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";iframe.style.backgroundColor="transparent";iframe.style.border="none";document.body.appendChild(iframe);this.iframe=$(idAndName)}}return this.iframe},setOptions:function(options){},createTooltipContainer:function(){throw new Salto.TechnicalException({message:"Not Implemented"})},show:function(evt,content){throw new Salto.TechnicalException({message:"Not Implemented"})},hide:function(evt){throw new Salto.TechnicalException({message:"Not Implemented"})}};Salto.Tooltip.OverlibCallback=Class.create();Salto.Tooltip.OverlibCallback.prototype=Object.extend(new Salto.Tooltip.AbstractCallback(),{initialize:function(options){this.setOptions(options)},createTooltipContainer:function(){var ttDiv=document.getElementById(this.options.tooltipContainerId);if(ttDiv==null){ttDiv=document.createElement("DIV");ttDiv.id=this.options.tooltipContainerId;ttStyle=ttDiv.style;ttStyle.position="absolute";ttStyle.visibility="hidden";ttStyle.zIndex=50000;$(ttDiv).addClassName(this.options.tooltipContainerClass+this.options.styleSuffix);document.body.appendChild(ttDiv)}},setOptions:function(options){this.options={tooltipContainerId:"overDiv",tooltipContainerClass:"tooltip-container",styleSuffix:"",showOptions:null,iframeEmptyPageUrl:""};Object.extend(this.options,options||{})},show:function(evt,content){$(this.options.tooltipContainerId).className=this.options.tooltipContainerClass+this.options.styleSuffix;if(Salto.is_ie6){var overlibDiv=$(this.options.tooltipContainerId);var iframeToUpdate=this.getIframe();iframeToUpdate.setStyle({"display":"block","zIndex":1});this.intval=setInterval(function(){var style={"top":overlibDiv.style.top,"left":overlibDiv.style.left,"height":overlibDiv.getHeight()+"px","width":overlibDiv.getWidth()+"px"};iframeToUpdate.setStyle(style)},100)}if(this.options.showOptions==null){return overlib(content)}else{return eval("overlib('"+content+"', "+this.options.showOptions+")")}},hide:function(evt){if(Salto.is_ie6){this.getIframe().setStyle({"display":"none"});if(this.intval!=null){clearInterval(this.intval);this.intval=null}}return nd()}});Salto.Tooltip.DefaultCallback=Class.create();Salto.Tooltip.DefaultCallback.prototype=Object.extend(new Salto.Tooltip.AbstractCallback(),{initialize:function(options){this.setOptions(options)},createTooltipContainer:function(){var ttDiv=document.getElementById(this.options.tooltipContainerId);if(ttDiv==null){ttDiv=document.createElement("DIV");ttDiv.id=this.options.tooltipContainerId;var ttStyle=ttDiv.style;ttStyle.position="absolute";ttStyle.visibility="hidden";ttStyle.zIndex=50000;ttDiv.innerHTML='<div id="'+this.options.tooltipContentId+'"></div>';document.body.appendChild(ttDiv)}},setOptions:function(options){this.options={tooltipContentId:"tooltip_content",tooltipContainerId:"tooltip_container",tooltipContainerClass:"tooltip-container",styleSuffix:"",iframeEmptyPageUrl:""};Object.extend(this.options,options||{})},show:function(evt,content){var x=Event.pointerX(evt);var y=Event.pointerY(evt);return this._setTooltip(content,x,y)},hide:function(evt){var tt=$(this.options.tooltipContainerId);try{if(Salto.is_ie6){this.getIframe().setStyle({"display":"none"});if(this.intval!=null){clearInterval(this.intval);this.intval=null}}tt.removeClassName(this.options.tooltipContainerClass+this.options.styleSuffix);tt.style.visibility="hidden"}finally{tt=null}},_isXInScreen:function(x,eltWidth){if((x+eltWidth)>Screen.getViewportWidth()){return false}return true},_isYInScreen:function(y,eltHeight){if((y+eltHeight)>Screen.getViewportHeight()){return false}return true},_setTooltip:function(content,x,y){var ttDiv=document.getElementById(this.options.tooltipContentId);ttDiv.innerHTML=content;var tt=$(this.options.tooltipContainerId);var ttWidth=tt.clientWidth;var ttHeight=tt.clientHeight;var xInScreen=this._isXInScreen(x,ttWidth);if(xInScreen){tt.style.left=x+5+"px"}else{tt.style.left=(x-10-ttWidth)+"px"}var yInScreen=this._isYInScreen(y,ttHeight);if(yInScreen){tt.style.top=y+5+"px"}else{tt.style.top=(y-10-ttHeight)+"px"}tt.style.visibility="visible";tt.addClassName(this.options.tooltipContainerClass+this.options.styleSuffix);if(Salto.is_ie6){var iframeToUpdate=this.getIframe();iframeToUpdate.setStyle({"display":"block","zIndex":1});this.intval=setInterval(function(){var style={"top":tt.style.top,"left":tt.style.left,"height":tt.getHeight()+"px","width":tt.getWidth()+"px"};iframeToUpdate.setStyle(style)},100)}}});Salto.applyTooltipByName=function(name,srcId,options){var elts=document.getElementsByName(name);if(elts){for(var i=0;i<elts.length;i++){if(elts[i].id){new Salto.Tooltip(elts[i].id,srcId,options)}}}};Salto.Doubleselect=Class.create();Salto.Doubleselect.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(doubleselectId,options){Salto.MemTracker.register(this);this.containerId=doubleselectId;this.container=$(doubleselectId);fwkSetComponent(this.container,this);this.setOptions(options);this._initValues();this._attachBehaviors(this.container,options);component=null},release:function(){this.container.onclick=null;this.container.modelObj=null;this.options=null;Element.remove(this.container);this.container=null},setOptions:function(options){this.options={idLeftSelect:"",idRightSelect:"",nameRightSelect:"",arrayRightSelect:null,divIdHiddenValues:"",sortSelect:false,sortOrderDesc:true,leftToRightCallback:undefined,rightToLeftCallback:undefined};Object.extend(this.options,options||{})},_attachBehaviors:function(component,options){component.onclick=this._gestDoubleSelect.bindAsEventListener(this);component=null},_initValues:function(){if(this.options.arrayRightSelect!=null){this._setHiddenValues(this.options.arrayRightSelect)}this._fwkSortOptions(document.getElementById(this.options.idLeftSelect));this._fwkSortOptions(document.getElementById(this.options.idRightSelect))},_setHiddenValues:function(array){var div=document.getElementById(this.options.divIdHiddenValues);var buffer="";for(var i=0;i<array.length;i++){buffer+='<input type="hidden" value="'+array[i]+'" name="'+this.options.nameRightSelect+'"/>'}div.innerHTML=buffer;div=null},_gestDoubleSelect:function(eventNS){try{var src=getSource(eventNS);var initSrc=src;if(src.nodeName==undefined){return }if(src.nodeName=="INPUT"){var selectLeft=document.getElementById(this.options.idLeftSelect);var selectRight=document.getElementById(this.options.idRightSelect);if(src.id.indexOf("fwk_button_left_")>-1){this._fwkDSmoveDoubleSelect(selectLeft,selectRight,this.options.leftToRightCallback);this._fwkSortOptions(selectRight)}else{this._fwkDSmoveDoubleSelect(selectRight,selectLeft,this.options.rightToLeftCallback);this._fwkSortOptions(selectLeft)}var t1=selectRight.options.length;var tab=new Array();for(var i=0;i<t1;i++){tab[i]=selectRight.options[i].value}this._setHiddenValues(tab)}}catch(e){alert("doubleselect.js:_gestDoubleSelect():,"+fwkPrintError(e))}},_fwkDSmoveDoubleSelect:function(l1,l2,cbfunction){if(l1.options.selectedIndex>=0){if(cbfunction){cbfunction(l1.options[l1.options.selectedIndex].value)}var o=new Option(l1.options[l1.options.selectedIndex].text,l1.options[l1.options.selectedIndex].value);l2.options[l2.options.length]=o;l1.options[l1.options.selectedIndex]=null;this._fwkDSmoveDoubleSelect(l1,l2,cbfunction)}},_fwkSortOptions:function(l2){if(this.options.sortSelect===true){this._fwkDSsortSelect(l2,this.options.sortOrderDesc)}},_fwkDSsortSelect:function(obj,sortDesc){var o=new Array();for(var i=0;i<obj.options.length;i++){o[o.length]={text:obj.options[i].text,value:obj.options[i].value,defaultSelected:obj.options[i].defaultSelected,selected:obj.options[i].selected}}if(o.length==0){return }o=o.sort(this.options.sortOrderDesc?this.sortAsc:this.sortDesc);obj.options.length=0;for(var i=0;i<o.length;i++){obj.options[i]=new Option(o[i].text,o[i].value,o[i].defaultSelected,o[i].selected)}},sortAsc:function(a,b){if(a.text<b.text){return -1}if(a.text>b.text){return +1}return 0},sortDesc:function(a,b){if(a.text>b.text){return -1}if(a.text<b.text){return +1}return 0}});function changeColumn(direction,treetableId,scrollColumn){if(direction>0){var numToHide=scrollColumn.firstColumn;var numToShow=scrollColumn.lastColumn+1}else{var numToHide=scrollColumn.lastColumn;var numToShow=scrollColumn.firstColumn-1}var table=document.getElementById(treetableId);var row=table.getElementsByTagName("tr");var cell=row[0].getElementsByTagName("th");if(numToShow>scrollColumn.leftFixedColumn&&numToShow<scrollColumn.rightFixedColumn){cell[scrollColumn.lastColumn].className=cell[scrollColumn.lastColumn].className.replace("leftFixedColumn","");cell[scrollColumn.lastColumn+direction].className=cell[scrollColumn.lastColumn+direction].className+" leftFixedColumn";cell[numToHide].className=cell[numToHide].className+" hideColumn";cell[numToShow].className=cell[numToShow].className.replace("hideColumn","");for(var i=1;i<row.length;i++){var cell=row[i].getElementsByTagName("td");cell[scrollColumn.lastColumn].className=cell[scrollColumn.lastColumn].className.replace("leftFixedColumn","");cell[scrollColumn.lastColumn+direction].className=cell[scrollColumn.lastColumn+direction].className+" leftFixedColumn";cell[numToHide].className=cell[numToHide].className+" hideColumn";cell[numToShow].className=cell[numToShow].className.replace("hideColumn","")}if(direction>0){scrollColumn.firstColumn=numToHide+direction;scrollColumn.lastColumn=numToShow}else{scrollColumn.lastColumn=numToHide+direction;scrollColumn.firstColumn=numToShow}}}function ScrollColumn(firstScrollColumn,lastColumn,leftFixedColumn,rightFixedColumn){this.firstColumn=firstScrollColumn;this.lastColumn=lastColumn;this.leftFixedColumn=leftFixedColumn;this.rightFixedColumn=rightFixedColumn}function LZ(x){return(x<0||x>9?"":"0")+x}function isDate(val,format){var date=getDateFromFormat(val,format);if(date==0){return false}return true}function compareDates(date1,dateformat1,date2,dateformat2){var d1=getDateFromFormat(date1,dateformat1);var d2=getDateFromFormat(date2,dateformat2);if(d1==0||d2==0){return -1}else{if(d1>d2){return 1}}return 0}function formatDate(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length<4){y=""+(y-0+1900)}value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=LZ(M);value["MMM"]=MONTH_NAMES[M-1];value["NNN"]=MONTH_NAMES[M+11];value["d"]=d;value["dd"]=LZ(d);value["E"]=DAY_NAMES[E+7];value["EE"]=DAY_NAMES[E];value["H"]=H;value["HH"]=LZ(H);if(H==0){value["h"]=12}else{if(H>12){value["h"]=H-12}else{value["h"]=H}}value["hh"]=LZ(value["h"]);if(H>11){value["K"]=H-12}else{value["K"]=H}value["k"]=H+1;value["KK"]=LZ(value["K"]);value["kk"]=LZ(value["k"]);if(H>11){value["a"]="PM"}else{value["a"]="AM"}value["m"]=m;value["mm"]=LZ(m);value["s"]=s;value["ss"]=LZ(s);while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++)}if(value[token]!=null&&value[token]!=undefined){result=result+value[token]}else{result=result+token}}return result}function _isInteger(val){var digits="1234567890";for(var i=0;i<val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false}}return true}function _getInt(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length<minlength){return null}if(_isInteger(token)){return token}}return null}function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++)}if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4}if(token=="yy"){x=2;y=2}if(token=="y"){x=2;y=4}year=_getInt(val,i_val,x,y);if(year==null){return 0}i_val+=year.length;if(year.length==2){if(year>70){year=1900+(year-0)}else{year=2000+(year-0)}}}else{if(token=="MMM"||token=="NNN"){month=0;for(var i=0;i<MONTH_NAMES.length;i++){var month_name=MONTH_NAMES[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){if(token=="MMM"||(token=="NNN"&&i>11)){month=i+1;if(month>12){month-=12}i_val+=month_name.length;break}}}if((month<1)||(month>12)){return 0}}else{if(token=="EE"||token=="E"){for(var i=0;i<DAY_NAMES.length;i++){var day_name=DAY_NAMES[i];if(val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()){i_val+=day_name.length;break}}}else{if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return 0}i_val+=month.length}else{if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return 0}i_val+=date.length}else{if(token=="hh"||token=="h"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>12)){return 0}i_val+=hh.length}else{if(token=="HH"||token=="H"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>23)){return 0}i_val+=hh.length}else{if(token=="KK"||token=="K"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>11)){return 0}i_val+=hh.length}else{if(token=="kk"||token=="k"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>24)){return 0}i_val+=hh.length;hh--}else{if(token=="mm"||token=="m"){mm=_getInt(val,i_val,token.length,2);if(mm==null||(mm<0)||(mm>59)){return 0}i_val+=mm.length}else{if(token=="ss"||token=="s"){ss=_getInt(val,i_val,token.length,2);if(ss==null||(ss<0)||(ss>59)){return 0}i_val+=ss.length}else{if(token=="a"){if(val.substring(i_val,i_val+2).toLowerCase()=="am"){ampm="AM"}else{if(val.substring(i_val,i_val+2).toLowerCase()=="pm"){ampm="PM"}else{return 0}}i_val+=2}else{if(val.substring(i_val,i_val+token.length)!=token){return 0}else{i_val+=token.length}}}}}}}}}}}}}}if(i_val!=val.length){return 0}if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return 0}}else{if(date>28){return 0}}}if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return 0}}if(hh<12&&ampm=="PM"){hh=hh-0+12}else{if(hh>11&&ampm=="AM"){hh-=12}}var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime()}function parseDate(val){var preferEuro=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var checkList=new Array("generalFormats",preferEuro?"dateFirst":"monthFirst",preferEuro?"monthFirst":"dateFirst");var d=null;for(var i=0;i<checkList.length;i++){var l=window[checkList[i]];for(var j=0;j<l.length;j++){d=getDateFromFormat(val,l[j]);if(d!=0){return new Date(d)}}}return null}Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.selectHourMode="Mouse";this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.computeWeekNumbers=function(when,theCalendar){return when.getWeekNumber()};this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len)}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len)}Calendar._SMN=ar}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft){SL=el.scrollLeft}if(is_div&&el.scrollTop){ST=el.scrollTop}var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y}return r};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement}else{if(type=="mouseout"){related=evt.toElement}}}while(related){if(related==el){return true}related=related.parentNode}return false};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return }var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i]}}el.className=ar.join(" ")};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName)){f=f.parentNode}return f};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1){f=f.parentNode}return f};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false}else{ev.preventDefault();ev.stopPropagation()}return false};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func)}else{if(el.addEventListener){el.addEventListener(evname,func,true)}else{el["on"+evname]=func}}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func)}else{if(el.removeEventListener){el.removeEventListener(evname,func,true)}else{el["on"+evname]=null}}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type)}else{el=document.createElement(type)}if(typeof parent!="undefined"){parent.appendChild(el)}return el};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}if(el.navtype==50&&el.calendar.selectHourMode=="Keyboard"){addEvent(el,"click",mouseClick);addEvent(el,"keypress",keyPress)}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el}else{if(typeof el.parentNode.month!="undefined"){return el.parentNode}}return null};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el}else{if(typeof el.parentNode.year!="undefined"){return el.parentNode}}return null};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite")}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active")}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";var pos=Position.positionedOffset(cd);if(cd.navtype<0){s.left=pos[0]+"px"}else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined"){mcw=50}s.left=(pos[0]+cd.offsetWidth-mcw)+"px"}s.top=(pos[1]+cd.offsetHeight)+"px"};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite")}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active")}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true}else{yr.style.display="none"}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep}if(show){var s=yc.style;s.display="block";var pos=Position.positionedOffset(cd);if(cd.navtype<0){s.left=pos[0]+"px"}else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined"){ycw=50}s.left=(pos[0]+cd.offsetWidth-ycw)+"px"}s.top=(pos[1]+cd.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return }var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite")}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2))){Calendar.removeClass(el,"active")}Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite")}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false}else{dx=pos.x-x}if(dx<0){dx=0}var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;){if(range[i]==current){break}}while(count-->0){if(decrease){if(--i<0){i=range.length-1}}else{if(++i>=range.length){i=0}}}var newval=range[i];el.value=newval;cal.onUpdateTime()}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite")}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite")}}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite")}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite")}Calendar.addClass(year,"hilite");cal.hilitedYear=year}else{if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite")}}}else{if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite")}}}return Calendar.stopEvent(ev)};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev)}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posX=ev.pageX;posY=ev.pageY}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.value;if(cal.selectHourMode=="Keyboard"){return false}addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.calendar.dateHelper.formatDate(el.caldate,el.calendar.ttDateFormat);+el.ttip.substr(1)}el.calendar.tooltips.innerHTML=el.ttip}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite")}}return Calendar.stopEvent(ev)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT["SEL_DATE"]}return stopEvent(ev)}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl){cal._toggleMultipleDate(new Date(date))}else{newdate=!el.disabled}if(other_month){cal._init(cal.firstDayOfWeek,date)}}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return }date=new Date(cal.date);if(el.navtype==0){date.setDateOnly(new Date())}cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max)}date.setMonth(m)}switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:""}else{text="Help and about box text is not translated into this language.\n"}alert(text);return ;case -2:if(year>cal.minYear){date.setFullYear(year-1)}break;case -1:if(mon>0){setMonth(mon-1)}else{if(year-->cal.minYear){date.setFullYear(year);setMonth(11)}}break;case 1:if(mon<11){setMonth(mon+1)}else{if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0)}}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1)}break;case 100:cal.setFirstDayOfWeek(el.fdow);return ;case 50:if(cal.selectHourMode!="Mouse"){return false}var range=el._range;var current=el.value;for(var i=range.length;--i>=0;){if(range[i]==current){break}}if(ev&&ev.shiftKey){if(--i<0){i=range.length-1}}else{if(++i>=range.length){i=0}}var newval=range[i];el.value=newval;cal.onUpdateTime();return ;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false}break}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true}else{if(el.navtype==0){newdate=closing=true}}}if(newdate){ev&&cal.callHandler()}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler()}};Calendar.keyPress=function(ev){(Calendar.is_ie)&&(ev=window.event);var el=Calendar.getElement(ev);if(el.navtype!=50){return true}var cal=el.calendar;var chr=String.fromCharCode(ev.charCode==undefined?ev.keyCode:ev.charCode);var beginChar=el._range[0].charAt(0);if((beginChar>="a"&&beginChar<="z")||(beginChar>="A"&&beginChar<="Z")){for(i=0;i<el._range.length;i++){if(chr==el._range[i].charAt(0)){el.value=el._range[i];cal.onUpdateTime();break}}el.select();return Calendar.stopEvent(ev)}if(chr>="0"&&chr<="9"){var lastChr="";var len=el.value.length;if(len>0){lastChr=el.value.charAt(len-1)}var value=parseInt(""+lastChr+chr,10);for(i=0;i<el._range.length;i++){if(value==el._range[i]){el.value=el._range[i];cal.onUpdateTime();el.select();return Calendar.stopEvent(ev)}}if(chr=="0"){el.value=el._range[0]}else{el.value="0"+chr}cal.onUpdateTime();el.select();return Calendar.stopEvent(ev)}return true};Calendar.mouseClick=function(ev){var el=Calendar.getElement(ev);if(el.navtype!=50){return true}el.select();return Calendar.stopEvent(ev)};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true}else{parent=_par;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none"}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2){cell.className+=" nav"}else{if(navtype==400){cell.className+=" help"}else{if(navtype==200){cell.className+=" close"}}}Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"]}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"]}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell)}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row)}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell)}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("input",cell);part.type="text";part.className=className;part.value=init;part.calendar=cal;if(cal.selectHourMode=="Mouse"){part.ttip=Calendar._TT["TIME_PART"]}part.navtype=50;part._range=[];if(typeof range_start!="number"){part._range=range_start}else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10){txt="0"+i}else{txt=""+i}part._range[part._range.length]=txt}}Calendar._add_evs(part);return part}var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm){hrs-=12}var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12){AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"])}else{cell.innerHTML="&nbsp;"}cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm){hrs-=12}if(hrs==0){hrs=12}AP.value=pm?"pm":"am"}H.value=(hrs<10)?("0"+hrs):hrs;M.value=(mins<10)?("0"+mins):mins};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.value,10);if(t12){if(/pm/i.test(AP.value)&&h<12){h+=12}else{if(/am/i.test(AP.value)&&h==12){h=0}}}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.value,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move"}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn)}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr)}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element)};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple){return false}(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;var elem=Calendar.getTargetElement(ev);if((elem.navtype==50)&&(cal.selectHourMode=="Keyboard")){return true}if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false}}else{switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x]}setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date)}function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date)}while(1){switch(K){case 37:if(--x>=0){ne=cal.ar_days[y][x]}else{x=6;K=38;continue}break;case 38:if(--y>=0){ne=cal.ar_days[y][x]}else{prevMonth();setVars()}break;case 39:if(++x<7){ne=cal.ar_days[y][x]}else{x=0;K=40;continue}break;case 40:if(++y<cal.ar_days.length){ne=cal.ar_days[y][x]}else{nextMonth();setVars()}break}break}if(ne){if(!ne.disabled){Calendar.cellClick(ne)}else{if(prev){prevMonth()}else{nextMonth()}}}}break;case 13:if(act){Calendar.cellClick(cal.currentDateEl,ev)}break;default:return false}}return Calendar.stopEvent(ev)};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year)}else{if(year>this.maxYear){year=this.maxYear;date.setFullYear(year)}}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0){day1+=7}date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=this.computeWeekNumbers(date,this);cell=cell.nextSibling}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue}}else{cell.otherMonth=false;hasdays=true}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates){dates[this.dateHelper.formatDate(date,"yyyyMMdd")]=cell}if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip){cell.title=toolTip}}if(status===true){cell.className+=" disabled";cell.disabled=true}else{if(/disabled/i.test(status)){cell.disabled=true}cell.className+=" "+status}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"]}if(weekend.indexOf(wday.toString())!=-1){cell.className+=cell.otherMonth?" oweekend":" weekend"}}}if(!(hasdays||this.showsOtherMonths)){row.className="emptyrow"}}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d){continue}if(cell){cell.className+=" selected"}}}};Calendar.prototype.defaultComputeWeekNumber=function(when,theCalendar){return when.getWeekNumber()};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=this.dateHelper.formatDate(date,"yyyyMMdd");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds]}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.dateHelper.formatDate(this.date,this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el)};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode){}if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev)}};Calendar.validateDateOnChange=function(specialWeekNumbers,inputField,inputFieldFormat,inputClass,errorClass,hiddenField,hiddenFieldFormat,flatDisplayId){var field=$(inputField);var date=field.value;var dte=null;var helper=Calendar.getDateHelper(specialWeekNumbers);var is=date==null||date===""||helper.isDate(date,inputFieldFormat);if(is){field.className=inputClass;dte=new Date(helper.parseDate(date,inputFieldFormat))}else{field.className=errorClass;if(hiddenField){$(hiddenField).value=field.value}}if(is&&hiddenField){if(date==""){$(hiddenField).value=""}else{$(hiddenField).value=helper.formatDate(dte,hiddenFieldFormat)}}if(is&&flatDisplayId&&$(flatDisplayId).calendar!=undefined){var c=$(flatDisplayId).calendar;if(date==""){c.dateStr=""}else{c.setDate(dte)}}return is};Calendar.getDateHelper=function(specialWeekNumbers){return(specialWeekNumbers!=null&&specialWeekNumbers=="true"?Decathlon.CalendarUtils.createDateHelper():new Salto.DateHelper())};Calendar.isWeekFormat=function(inputFieldFormat){return(inputFieldFormat.indexOf("ww")!=-1)};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show()};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true}function fixPosition(box){if(box.x<0){box.x=0}if(box.y<0){box.y=0}var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft}else{br.y+=window.scrollY;br.x+=window.scrollX}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1)}switch(valign){case"T":p.y-=h;break;case"B":p.y+=el.offsetHeight;break;case"C":p.y+=(el.offsetHeight-h)/2;break;case"t":p.y+=el.offsetHeight-h;break;case"b":break}switch(halign){case"L":p.x-=w;break;case"R":p.x+=el.offsetWidth;break;case"C":p.x+=(el.offsetWidth-w)/2;break;case"l":p.x+=el.offsetWidth-w;break;case"r":break}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str};Calendar.prototype.parseDate=function(str,fmt){if(!fmt){fmt=this.dateFormat}this.setDate(this.dateHelper.parseDate(str,fmt))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return }function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof (document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){value=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility")}else{value=""}}else{if(obj.currentStyle){value=obj.currentStyle.visibility}else{value=""}}}return value}var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc)}cc.style.visibility=cc.__msh_save_visibility}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc)}cc.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell)}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend")}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return }this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(val,format,specialWeekNumbers){return Calendar.getDateHelper(specialWeekNumbers).parseDate(val,format)};Date.formatDate=function(date,format,specialWeekNumbers){return Calendar.getDateHelper(specialWeekNumbers).formatDate(date,format)};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth()}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29}else{return Date._MD[month]}};Date.prototype.isLeapYear=function(){var theYear=this.getFullYear();return((theYear%4==0)&&(((theYear%100)!=0)||((theYear%400)==0)))};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY)};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*86400000))+1};Date.prototype.getYearLength=function(){if(this.isLeapYear()){return 366}else{return 365}};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()))};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate())};Date.prototype.print=function(str){return new Salto.DateHelper().formatDate(this,str)};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(y)};window._dynarch_popupCalendar=null;Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def}}param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","yyyy/MM/dd");param_default("daFormat","yyyy/MM/dd");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Bl");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("selectHourMode","Mouse");param_default("timeFormat","24");param_default("electric",false);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);param_default("computeWeekNumbers",null);var dateHelper=null;var firstDay=params.firstDay?params.firstDay:0;if(params.getWeekNumberFromDateCallback){dateHelper=new Salto.DateHelper({getWeekNumberFromDateCallback:params.getWeekNumberFromDateCallback,firstDayOfWeek:firstDay})}else{dateHelper=new Salto.DateHelper({firstDayOfWeek:firstDay})}params.dateHelper=dateHelper;var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]])}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.dateHelper.formatDate(cal.date,p.ifFormat)}if(update&&p.displayArea){if(p.displayArea.value!=undefined){p.displayArea.value=cal.dateHelper.formatDate(cal.date,p.daFormat)}else{p.displayArea.innerHTML=cal.dateHelper.formatDate(cal.date,p.daFormat)}}if(update&&p.inputField){if(typeof p.inputField.onchange=="function"){p.inputField.onchange()}}if(update&&typeof p.onUpdate=="function"){p.onUpdate(cal)}if(update&&p.flat){if(typeof p.flatCallback=="function"){p.flatCallback(cal)}}if(update&&p.singleClick&&cal.dateClicked){cal.callCloseHandler()}}if(params.flat!=null){if(typeof params.flat=="string"){params.flat=document.getElementById(params.flat)}if(!params.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.dateHelper=params.dateHelper;cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.selectHourMode=params.selectHourMode;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat)}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value)}cal.create(params.flat);Salto.CalendarUtils._fixCalendarZIndex(cal);cal.show();return cal}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl){params.date=params.dateHelper.parseDate(dateEl.value||dateEl.innerHTML,dateFmt)}if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide()});cal.dateHelper=params.dateHelper;cal.showsTime=params.showsTime;cal.selectHourMode=params.selectHourMode;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true}else{if(params.date){cal.setDate(params.date)}cal.hide()}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=cal.dateHelper.formatDate(d,"yyyyMMdd");cal.multiple[ds]=d}}if(params.computeWeekNumbers){cal.computeWeekNumbers=params.computeWeekNumbers}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate){cal.create();Salto.CalendarUtils._fixCalendarZIndex(cal)}cal.refresh();if(!params.position){cal.showAtElement(params.button||params.displayArea||params.inputField,params.align)}else{cal.showAt(params.position[0],params.position[1])}return false};return cal};window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(options){var that=this;window.historyStorage.setup(options);if(options&&options.baseTitle){if(options.baseTitle.indexOf("@@@")<0&&historyStorage.debugMode){throw new Error("Programmer error: options.baseTitle must contain the replacement parameter '@@@' to be useful.")}this.baseTitle=options.baseTitle}var UA=navigator.userAgent.toLowerCase();var platform=navigator.platform.toLowerCase();var vendor=navigator.vendor||"";if(vendor==="KDE"){this.isKonqueror=true;this.isSupported=false}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true}else{if(vendor.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(platform.indexOf("mac")>-1)}else{if(UA.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true}}}}}if(this.isSafari){this.createSafari()}else{if(this.isOpera){this.createOpera()}}var initialHash=this.getCurrentLocation();this.currentLocation=initialHash;if(this.isIE){if(options&&options.blankURL){var u=options.blankURL;this.blankURL=(u.indexOf("?")!=u.length-1?u+"?":u)}this.createIE(initialHash)}var unloadHandler=function(){that.firstLoad=null};this.addEventListener(window,"unload",unloadHandler);if(this.isIE){this.ignoreLocationChange=true}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.ignoreLocationChange=false;this.firstLoad=false;this.fireOnNewListener=true}}var locationHandler=function(){that.checkLocation()};setInterval(locationHandler,100)},initialize:function(listener){this.originalTitle=document.title;if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.fireOnNewListener=true;this.firstLoad=false}}if(listener){this.addListener(listener)}},addListener:function(listener){this.listener=listener;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false}},changeTitle:function(historyData){var winTitle=(historyData&&historyData.newTitle?this.baseTitle.replace("@@@",historyData.newTitle):this.originalTitle);if(document.title==winTitle){return }document.title=winTitle;if(this.isIE){this.iframe.contentWindow.document.title=winTitle}if(!this.isIE&&!this.isOpera){var hash=decodeURIComponent(document.location.hash);if(hash!=""){var encodedHash=encodeURIComponent(this.removeHash(hash));document.location.hash=encodedHash}else{}}},add:function(newLocation,historyData){var that=this;var encodedLocation=encodeURIComponent(this.removeHash(newLocation));if(this.isSafari){historyStorage.put(newLocation,historyData);this.currentLocation=encodedLocation;window.location.hash=encodedLocation;this.putSafariState(encodedLocation);this.changeTitle(historyData)}else{var addImpl=function(){if(that.currentWaitTime>0){that.currentWaitTime=that.currentWaitTime-that.waitTime}if(document.getElementById(encodedLocation)&&that.debugMode){var e="Exception: History locations can not have the same value as _any_ IDs that might be in the document, due to a bug in IE; please ask the developer to choose a history location that does not match any HTML IDs in this document. The following ID is already taken and cannot be a location: "+newLocation;throw new Error(e)}historyStorage.put(newLocation,historyData);that.ignoreLocationChange=true;that.ieAtomicLocationChange=true;that.currentLocation=encodedLocation;window.location.hash=encodedLocation;if(that.isIE){that.iframe.src=that.blankURL+encodedLocation}that.ieAtomicLocationChange=false;that.changeTitle(historyData)};window.setTimeout(addImpl,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime}},isFirstLoad:function(){return this.firstLoad},getVersion:function(){return this.VERSIONNUMBER},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",VERSIONNUMBER:"0.8",baseTitle:"@@@",originalTitle:null,blankURL:"blank.html?",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false)}else{if(o.attachEvent){o.attachEvent("on"+e,function(){l(window.event)})}}},createIE:function(initialHash){this.waitTime=400;var styles=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var iframeID="rshHistoryFrame";var iframeHTML='<iframe frameborder="0" id="'+iframeID+'" style="'+styles+'" src="'+this.blankURL+initialHash+'"></iframe>';document.write(iframeHTML);this.iframe=document.getElementById(iframeID)},createOpera:function(){this.waitTime=400;var imgHTML='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';document.write(imgHTML)},createSafari:function(){var formID="rshSafariForm";var stackID="rshSafariStack";var lengthID="rshSafariLength";var formStyles=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var stackStyles=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var lengthStyles=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var safariHTML='<form id="'+formID+'" style="'+formStyles+'"><textarea style="'+stackStyles+'" id="'+stackID+'">[]</textarea><input type="text" style="'+lengthStyles+'" id="'+lengthID+'" value=""/></form>';document.write(safariHTML);this.safariStack=document.getElementById(stackID);this.safariLength=document.getElementById(lengthID);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint}else{this.safariHistoryStartPoint=this.safariLength.value}},getCurrentLocation:function(){var r=(this.isSafari?this.getSafariState():this.getCurrentHash());return r},getCurrentHash:function(){var r=window.location.href;var i=r.indexOf("#");return(i>=0?r.substr(i+1):"")},getSafariStack:function(){var r=this.safariStack.value;return historyStorage.fromJSON(r)},getSafariState:function(){var stack=this.getSafariStack();var state=stack[history.length-this.safariHistoryStartPoint-1];return state},putSafariState:function(newLocation){var stack=this.getSafariStack();stack[history.length-this.safariHistoryStartPoint]=newLocation;this.safariStack.value=historyStorage.toJSON(stack)},fireHistoryEvent:function(newHash){var decodedHash=decodeURIComponent(newHash);var historyData=historyStorage.get(decodedHash);this.changeTitle(historyData);this.listener.call(null,decodedHash,historyData)},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return }if(!this.isIE&&this.ieAtomicLocationChange){return }var hash=this.getCurrentLocation();if(hash==this.currentLocation){return }this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=hash){this.iframe.src=this.blankURL+hash}else{if(this.isIE){return }}this.currentLocation=hash;this.ieAtomicLocationChange=false;this.fireHistoryEvent(hash)},getIframeHash:function(){var doc=this.iframe.contentWindow.document;var hash=String(doc.location.search);if(hash.length==1&&hash.charAt(0)=="?"){hash=""}else{if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1)}}return hash},removeHash:function(hashValue){var r;if(hashValue===null||hashValue===undefined){r=null}else{if(hashValue===""){r=""}else{if(hashValue.length==1&&hashValue.charAt(0)=="#"){r=""}else{if(hashValue.length>1&&hashValue.charAt(0)=="#"){r=hashValue.substring(1)}else{r=hashValue}}}}return r},iframeLoaded:function(newLocation){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return }var hash=String(newLocation.search);if(hash.length==1&&hash.charAt(0)=="?"){hash=""}else{if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1)}}window.location.hash=hash;this.fireHistoryEvent(hash)}};window.historyStorage={setup:function(options){if(typeof options!=="undefined"){if(options.debugMode){this.debugMode=options.debugMode}if(options.toJSON){this.toJSON=options.toJSON}if(options.fromJSON){this.fromJSON=options.fromJSON}}var formID="rshStorageForm";var textareaID="rshStorageField";var formStyles=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var textareaStyles=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var textareaHTML='<form id="'+formID+'" style="'+formStyles+'"><textarea id="'+textareaID+'" style="'+textareaStyles+'"></textarea></form>';document.write(textareaHTML);this.storageField=document.getElementById(textareaID);if(typeof window.opera!=="undefined"){this.storageField.focus()}},put:function(key,value){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);if(this.hasKey(key)){this.remove(key)}this.storageHash[encodedKey]=value;this.saveHashTable()},get:function(key){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);this.loadHashTable();var value=this.storageHash[encodedKey];if(value===undefined){value=null}return value},remove:function(key){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);this.loadHashTable();delete this.storageHash[encodedKey];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash={}},hasKey:function(key){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);this.loadHashTable();return(typeof this.storageHash[encodedKey]!=="undefined")},isValidKey:function(key){return(typeof key==="string")},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1000px;height:300px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var isValid=this.isValidKey(key);if(!isValid&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+key+".")}},loadHashTable:function(){if(!this.hashLoaded){var serializedHashTable=this.storageField.value;if(serializedHashTable!==""&&serializedHashTable!==null){this.storageHash=this.fromJSON(serializedHashTable);this.hashLoaded=true}}},saveHashTable:function(){this.loadHashTable();var serializedHashTable=this.toJSON(this.storageHash);this.storageField.value=serializedHashTable},toJSON:function(o){return o.toJSONString()},fromJSON:function(s){return s.parseJSON()}};var tinyMCE_GZ={settings:{themes:"",plugins:"",languages:"",disk_cache:true,page_name:"fwk/tiny/tiny_mce_gzip.jsp",debug:false,suffix:""},init:function(s,cb,sc){var t=this,n,i,nl=document.getElementsByTagName("script");for(n in s){t.settings[n]=s[n]}s=t.settings;for(i=0;i<nl.length;i++){n=nl[i];if(n.src&&n.src.indexOf("/js/")!=-1&&n.src.indexOf("/fwk/")!=-1){t.baseURL=n.src.substring(0,n.src.lastIndexOf("/js/")+3)}}if(!t.coreLoaded){t.loadScripts(1,s.themes,s.plugins,s.languages,cb,sc)}},loadScripts:function(co,th,pl,la,cb,sc){var t=this,x,w=window,q,c=0,ti,s=t.settings;function get(s){x=0;try{x=new ActiveXObject(s)}catch(s){}return x}q="js=true&diskcache="+(s.disk_cache?"true":"false")+"&core="+(co?"true":"false")+"&suffix="+escape(s.suffix)+"&themes="+escape(th)+"&plugins="+escape(pl)+"&languages="+escape(la);if(co){t.coreLoaded=1}x=w.XMLHttpRequest?new XMLHttpRequest():get("Msxml2.XMLHTTP")||get("Microsoft.XMLHTTP");x.overrideMimeType&&x.overrideMimeType("text/javascript");x.open("GET",t.baseURL+"/"+s.page_name+"?"+q,!!cb);x.send("");if(cb){ti=w.setInterval(function(){if(x.readyState==4||c++>10000){w.clearInterval(ti);if(c<10000&&x.status==200){t.loaded=1;t.eval(x.responseText);tinymce.dom.Event.domLoaded=true;cb.call(sc||t,x)}ti=x=null}},10)}else{t.eval(x.responseText)}},start:function(){var t=this,each=tinymce.each,s=t.settings,ln=s.languages.split(",");tinymce.suffix=s.suffix;function load(u){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(u))}each(ln,function(c){if(c){load("/langs/"+c+".js")}});each(s.themes.split(","),function(n){if(n){load("/themes/"+n+"/editor_template"+s.suffix+".js");each(ln,function(c){if(c){load("/themes/"+n+"/langs/"+c+".js")}})}});each(s.plugins.split(","),function(n){if(n){load("/plugins/"+n+"/editor_plugin"+s.suffix+".js");each(ln,function(c){if(c){load("/plugins/"+n+"/langs/"+c+".js")}})}})},end:function(){},eval:function(co){var w=window;if(!w.execScript){if(/Gecko/.test(navigator.userAgent)){eval(co,w)}else{eval.call(w,co)}}else{w.execScript(co)}}};Decathlon.Suggest=Class.create();Decathlon.Suggest.prototype=Object.extend(new Salto.BaseGUIComponent(),{initialize:function(param){Salto.MemTracker.register(this);if(!document.getElementById){return 0}this.fld=_b.DOM.gE(param.id);this.containerId=param.id;if(!this.fld){return 0}this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.iHighMouse=0;this.wasT=false;this.notF=true;this.iframe=null;this.iframeEmptyPageUrl=param.iframeEmptyPageUrl;this.oP=param?param:{};var k,def={minchars:1,meth:"get",varname:"input",className:"autosuggest fwk_compo_default",timeout:2500,delay:500,offsety:-2,shownoresults:true,noresults:"No results!",errorMsg:"Technical Error!",maxheight:250,cache:true,maxentries:25};for(k in def){if(typeof (this.oP[k])!=typeof (def[k])){this.oP[k]=def[k]}}var p=this;this.fld.onkeydown=function(ev){return p.onKeyDown(ev)};this.fld.onkeyup=function(ev){return p.onKeyUp(ev)};this.fld.onblur=function(ev){return p.onBlur(ev)};this.fld.setAttribute("autocomplete","off")},getIframe:function(){if(this.iframe==null){var idAndName="dynaSuggestHideWindowedElement";this.iframe=$(idAndName);if(this.iframe==null){var iframe=document.createElement("IFRAME");iframe.setAttribute("src",this.iframeEmptyPageUrl);iframe.setAttribute("id",idAndName);iframe.setAttribute("name",idAndName);iframe.setAttribute("frameBorder","0px");iframe.style.position="absolute";iframe.style.top="0px";iframe.style.left="0px";iframe.style.width="0px";iframe.style.height="0px";iframe.style.display="none";iframe.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";iframe.style.backgroundColor="transparent";iframe.style.border="none";document.body.appendChild(iframe);this.iframe=$(idAndName)}}return this.iframe},getGUIContainer:function(){return this.fld},onKeyDown:function(ev){var key=(window.event)?window.event.keyCode:ev.keyCode;var RETURN=13;var TAB=9;var ESC=27;var bubble=true;switch(key){case TAB:case RETURN:bubble=this.setHighlightedValue();break;case ESC:this.clearSuggestions();break}return bubble},onBlur:function(ev){if(Salto.is_ie6){var target=document.activeElement;if(target!=null&&target.id==this.idAs){this.fld.focus();return true}}var bubble=true;bubble=this.setHighlightedValue();return bubble},onKeyUp:function(ev){var key=(window.event)?window.event.keyCode:ev.keyCode;var ARRUP=38;var ARRDN=40;var bubble=true;switch(key){case ARRUP:case ARRDN:this.changeHighlight(key);bubble=false;break;default:this.getSuggestions(this.fld.value)}return bubble},getSuggestions:function(val){if(val==this.sInp){return 0}_b.DOM.remE(this.idAs);if(Salto.is_ie6){this.getIframe().setStyle({"display":"none"})}this.sInp=val;if(val.length<this.oP.minchars){this.wasT=false;this.aSug=[];this.nInpC=val.length;return 0}var ol=this.nInpC;this.nInpC=val.length?val.length:0;var l=this.aSug.length;if(this.nInpC>ol&&this.wasT&&!this.notF&&this.oP.cache){var arr=[];for(var i=0;i<l;i++){if(this.aSug[i].value.substr(0,val.length).toLowerCase()==val.toLowerCase()){arr.push(this.aSug[i])}}this.aSug=arr;this.createList(this.aSug);return false}else{this.wasT=false;var pointer=this;var input=this.sInp;clearTimeout(this.ajID);this.ajID=setTimeout(function(){pointer.doAjaxRequest(input)},this.oP.delay)}return false},doAjaxRequest:function(input){if(input!=this.fld.value){return false}var pointer=this;var oldinput=this.sInp;if(typeof (this.oP.script)=="function"){this.setSuggestions(this.oP.script(this.sInp),oldinput)}else{if(!this.oP.script){return false}var suggestparams={};suggestparams["__AjaxCall__"]=true;suggestparams["maxentries"]=this.oP.maxentries;suggestparams[this.oP.varname]=this.sInp;var onSuccessFunc=function(req){pointer.setSuggestions(req,input)};var onErrorFunc=function(status){alert("AJAX error: "+status)};new Ajax.Request(this.oP.script,{"onSuccess":onSuccessFunc,"onFailure":onErrorFunc,"parameters":suggestparams,"method":this.oP.meth})}},setSuggestions:function(req,input){if(input!=this.fld.value){return false}this.aSug=[];if(this.oP.json){var jsondata=eval("("+req.responseText+")");for(var i=0;i<jsondata.results.length;i++){this.aSug.push({"id":jsondata.results[i].id,"value":jsondata.results[i].value,"info":jsondata.results[i].info})}}else{var xml=req.responseXML;var xmlResults=xml.getElementsByTagName("results");if(xmlResults.length>0){var results=xmlResults[0].childNodes;for(var i=0;i<results.length-1;i++){if(results[i].hasChildNodes()){var value=null;var info=null;var childElt=null;if(Prototype.Browser.IE){for(var j=0;(value==null||info==null)&&j<results[i].childNodes.length;j++){childElt=results[i].childNodes[j];if(childElt.childNodes[0]==null){continue}if(value==null&&childElt.nodeName=="value"){value=childElt.childNodes[0].nodeValue}else{if(info==null&&childElt.nodeName=="info"){info=childElt.childNodes[0].nodeValue}}}}else{value=results[i].childNodes[1].textContent;info=results[i].childNodes[0].textContent}this.aSug.push({"id":results[i].getAttribute("id"),"value":value,"info":info})}}this.notF=results[i].getAttribute("value")=="true"}else{this.errorInLastCall=true}}this.idAs="as_"+this.fld.id;this.wasT=true;this.createList(this.aSug)},createList:function(arr){var pointer=this;_b.DOM.remE(this.idAs);this.killTimeout();if(this.errorInLastCall===false&&(arr.length==0&&!this.oP.shownoresults)){return false}var div=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});var hcorner=_b.DOM.cE("div",{className:"as_corner"});var hbar=_b.DOM.cE("div",{className:"as_bar"});var header=_b.DOM.cE("div",{className:"as_header"});header.appendChild(hcorner);header.appendChild(hbar);div.appendChild(header);var ul=_b.DOM.cE("ul",{id:"as_ul",className:"standard"});for(var i=0;i<arr.length;i++){var val=arr[i].value;var st=val.toLowerCase().indexOf(this.sInp.toLowerCase());var output=val.substring(0,st)+"<em>"+val.substring(st,st+this.sInp.length)+"</em>"+val.substring(st+this.sInp.length);var span=_b.DOM.cE("span",{},output,true);if(arr[i].info!=null&&arr[i].info!=""){var br=_b.DOM.cE("br",{});span.appendChild(br);var small=_b.DOM.cE("small",{},arr[i].info);span.appendChild(small)}var a=_b.DOM.cE("a",{href:"#"});var tl=_b.DOM.cE("span",{className:"tl"}," ");var tr=_b.DOM.cE("span",{className:"tr"}," ");a.appendChild(tl);a.appendChild(tr);a.appendChild(span);a.name=i+1;a.onclick=function(){pointer.setHighlightedValue();return false};a.onmouseover=function(){pointer.setHighlightMouse(this.name)};var li=_b.DOM.cE("li",{className:((i%2==0)?"even":"odd")},a);ul.appendChild(li)}if(arr.length==0&&this.oP.shownoresults){var li=null;if(this.errorInLastCall===true){this.errorInLastCall=false;li=_b.DOM.cE("li",{className:"even as_warning"},this.oP.errorMsg)}else{li=_b.DOM.cE("li",{className:"even as_warning"},this.oP.noresults)}ul.appendChild(li)}div.appendChild(ul);var fcorner=_b.DOM.cE("div",{className:"as_corner"});var fbar=_b.DOM.cE("div",{className:"as_bar"});var footer=_b.DOM.cE("div",{className:"as_footer"});footer.appendChild(fcorner);footer.appendChild(fbar);div.appendChild(footer);var pos=_b.DOM.getPos(this.fld);div.style.left=pos.x+"px";div.style.top=(pos.y+this.fld.offsetHeight+this.oP.offsety)+"px";div.onmouseover=function(){pointer.killTimeout()};div.onmouseout=function(){pointer.resetTimeout()};document.getElementsByTagName("body")[0].appendChild(div);var boxWidth=this.fld.offsetWidth;if(this.oP.width){boxWidth=this.oP.width}div.style.width=boxWidth+"px";var diff=div.scrollHeight-ul.scrollHeight;var boxHeight=this.oP.maxheight;if(div.scrollHeight<boxHeight){boxHeight=div.scrollHeight+4}ul.style.height=(boxHeight-diff)+"px";if(Salto.is_ie6){var style={"display":"block","top":div.style.top,"left":div.style.left,"width":div.style.width,"height":boxHeight+"px","zIndex":1};this.getIframe().setStyle(style)}this.iHigh=0;var pointer=this;this.toID=setTimeout(function(){pointer.clearSuggestions()},this.oP.timeout)},changeHighlight:function(key){var list=_b.DOM.gE("as_ul");if(!list){return false}var n;var liChild;if(key==40){n=this.iHigh+1;if(n>1&&n<=list.childNodes.length){liChild=list.childNodes[n-1];list.scrollTop+=(liChild.offsetHeight+4)}}else{if(key==38){n=this.iHigh-1;if(n>0&&n<list.childNodes.length){liChild=list.childNodes[n];list.scrollTop-=(liChild.offsetHeight+4)}}}if(n>list.childNodes.length){n=list.childNodes.length}if(n<1){n=1}this.setHighlight(n)},setHighlight:function(n){var list=_b.DOM.gE("as_ul");if(!list){return false}this.clearHighlight();this.iHigh=Number(n);Element.addClassName(list.childNodes[this.iHigh-1],"active");Element.addClassName(list.childNodes[this.iHigh-1],"as_highlight");this.killTimeout()},setHighlightMouse:function(n){this.setHighlight(n,true);var list=_b.DOM.gE("as_ul");if(!list){return false}this.clearHighlight();this.iHighMouse=Number(n);Element.addClassName(list.childNodes[this.iHighMouse-1],"active");Element.addClassName(list.childNodes[this.iHighMouse-1],"as_highlight");this.killTimeout()},clearHighlight:function(){var list=_b.DOM.gE("as_ul");if(!list){return false}if(this.iHigh>0){Element.removeClassName(list.childNodes[this.iHigh-1],"active");Element.removeClassName(list.childNodes[this.iHigh-1],"as_highlight");this.iHigh=0}if(this.iHighMouse>0){Element.removeClassName(list.childNodes[this.iHighMouse-1],"active");Element.removeClassName(list.childNodes[this.iHighMouse-1],"as_highlight");this.iHighMouse=0}},setHighlightedValue:function(){if(this.iHighMouse>0){this.iHigh=this.iHighMouse}if(this.iHigh>0){this.sInp=this.fld.value=this.aSug[this.iHigh-1].value;this.fld.focus();if(this.fld.selectionStart){this.fld.setSelectionRange(this.sInp.length,this.sInp.length)}this.clearSuggestions();if((typeof (this.oP.callback)=="function")&&(this.previousValueInCallback!=this.aSug[this.iHigh-1].value)){this.previousValueInCallback=this.aSug[this.iHigh-1].value;this.oP.callback(this.aSug[this.iHigh-1])}this.iHigh=-1;return false}else{if((this.iHigh!=-1)||(this.iHigh==-1&&this.fld.value=="")){if((typeof (this.oP.callback)=="function")&&(this.previousValueInCallback!=this.fld.value)){this.previousValueInCallback=this.fld.value;var emptyArr=[];emptyArr.push({"id":null,"value":this.fld.value,"info":null});this.oP.callback(emptyArr[0])}}return true}},killTimeout:function(){clearTimeout(this.toID)},resetTimeout:function(){clearTimeout(this.toID);var pointer=this;this.toID=setTimeout(function(){pointer.clearSuggestions()},1000)},clearSuggestions:function(){this.killTimeout();var ele=_b.DOM.gE(this.idAs);var pointer=this;if(ele){var fade=new _b.Fader(ele,1,0,250,function(){_b.DOM.remE(pointer.idAs)});if(Salto.is_ie6){this.getIframe().setStyle({"display":"none"})}}},release:function(){this.fld.onkeydown=null;this.fld.onkeyup=null;this.fld=null;this.oP=null;this.sInp=null;this.nInpC=null;this.aSug=null;this.iHigh=null;this.iframe=null;this.iframeEmptyPageUrl=null}});if(typeof (bsn)=="undefined"){_b=bsn={}}if(typeof (_b.DOM)=="undefined"){_b.DOM={}}_b.DOM.cE=function(type,attr,cont,html){var ne=document.createElement(type);if(!ne){return 0}for(var a in attr){ne[a]=attr[a]}var t=typeof (cont);if(t=="string"&&!html){ne.appendChild(document.createTextNode(cont))}else{if(t=="string"&&html){ne.innerHTML=cont}else{if(t=="object"){ne.appendChild(cont)}}}return ne};_b.DOM.gE=function(e){var t=typeof (e);if(t=="undefined"){return 0}else{if(t=="string"){var re=document.getElementById(e);if(!re){return 0}else{if(typeof (re.appendChild)!="undefined"){return re}else{return 0}}}else{if(typeof (e.appendChild)!="undefined"){return e}else{return 0}}}};_b.DOM.remE=function(ele){var e=this.gE(ele);if(!e){return 0}else{if(e.parentNode.removeChild(e)){return true}else{return 0}}};_b.DOM.getPos=function(e){var e=this.gE(e);var obj=e;var offset=Position.cumulativeOffset(obj);var scroll=absoluteOffset(obj);var curleft=offset[0]-scroll[0];var curtop=offset[1]-scroll[1];return{x:curleft,y:curtop}};if(typeof (_b.Fader)=="undefined"){_b.Fader={}}_b.Fader=function(ele,from,to,fadetime,callback){if(!ele){return 0}this.e=ele;this.from=from;this.to=to;this.cb=callback;this.nDur=fadetime;this.nInt=50;this.nTime=0;var p=this;this.nID=setInterval(function(){p._fade()},this.nInt)};_b.Fader.prototype._fade=function(){this.nTime+=this.nInt;var ieop=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);var op=ieop/100;if(this.e.filters){try{this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop}catch(e){this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+ieop+")"}}else{this.e.style.opacity=op}if(this.nTime==this.nDur){clearInterval(this.nID);if(this.cb!=undefined){this.cb()}}};_b.Fader.prototype._tween=function(t,b,c,d){return b+((c-b)*(t/d))};var itemClickedId=null;InputLink.isSupported=typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number";InputLink.setup=function(params){function params_default(pname,def){if((typeof params[pname]=="undefined")||(params[pname]=="null")){params[pname]=def}}params_default("oElement",null);params_default("id",null);params_default("inputMenuId",null);var il=new InputLink(params.oElement,params.id,params.inputMenuId);return il};function InputLink(oElement,id,inputMenuId){if(!oElement){return }if(InputLink.isSupported&&oElement){this.document=oElement.ownerDocument||oElement.document;this.element=oElement;this._id=id;this.element.inputlink=this;this._inputMenuId=inputMenuId;this.element.className="";this._arrow=this.getArrowElement();this.oArrow=new Arrow(this._arrow,this.getId(),this.getInputMenuId(),this);if(this.getInputMenuLink(inputMenuId)){var a=this.getInputMenuLink(inputMenuId);this.oInputMenuLink=this.getInputMenuLink(inputMenuId)}}var oThis=this;if(InputLink.isSupported&&oElement){this.element.onmouseover=InputLink.eventHandlers.onmouseover;this.element.onmouseout=InputLink.eventHandlers.onmouseout}}InputLink.eventHandlers={getEvent:function(e,el){if(!e){if(el){e=el.document.parentWindow.event}else{e=window.event}}if(!e.srcElement){var el=e.target;while(el!=null&&el.nodeType!=1){el=el.parentNode}e.srcElement=el}if(typeof e.offsetX=="undefined"){e.offsetX=e.layerX;e.offsetY=e.layerY}return e},getDocument:function(e){if(e.target){return e.target.ownerDocument}return e.srcElement.document},getInputLink:function(e){var el=e.target||e.srcElement;while(el!=null&&el.inputlink==null){el=el.parentNode}if(el){return el.inputlink}return null},onmouseover:function(e){e=InputLink.eventHandlers.getEvent(e,this);var il=this.inputlink;il.showArrow()},onmouseout:function(e){e=InputLink.eventHandlers.getEvent(e,this);var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;try{if(reltg.nodeName=="SPAN"){return }}catch(e){}var il=this.inputlink;il.hideArrow();il.getArrow().hideMenu()}};InputLink.prototype.getId=function(){return this._id};InputLink.prototype.getInputMenuId=function(){return this._inputMenuId};InputLink.prototype.getArrowElement=function(){var name=this.getId().concat("Arrow");return document.getElementById(name)};InputLink.prototype.getArrow=function(){return this.oArrow};InputLink.prototype.showArrow=function(){var arrows=document.getElementsByClassName("inputHint");for(var i=0;i<arrows.length;i++){if(arrows[i].style.display="inline"){arrows[i].style.display="none"}}this.getArrowElement().style.display="inline"};InputLink.prototype.hideArrow=function(){this.getArrowElement().style.display="none"};InputLink.prototype.getInputMenuLink=function(inputMenuId){return document.getElementById(inputMenuId)};Arrow.isSupported=typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number";function Arrow(oElement,prefix,inputMenuId,inputLink){this.document=oElement.ownerDocument||oElement.document;this.element=oElement;this._prefix=prefix;this._inputMenuId=inputMenuId;this._inputLink=inputLink;this.element.arrow=this;this._menu=this.getMenu(inputMenuId);this.getImage().onclick=Arrow.eventHandlers.onclick;this.element.onmouseout=Arrow.eventHandlers.onmouseout}Arrow.eventHandlers={getEvent:function(e,el){if(!e){if(el){e=el.document.parentWindow.event}else{e=window.event}}if(!e.srcElement){var el=e.target;while(el!=null&&el.nodeType!=1){el=el.parentNode}e.srcElement=el}if(typeof e.offsetX=="undefined"){e.offsetX=e.layerX;e.offsetY=e.layerY}return e},getArrow:function(e){var el=e.target||e.srcElement;while(el!=null&&el.arrow==null){el=el.parentNode}if(el){return el.arrow}return null},onclick:function(e){e=Arrow.eventHandlers.getEvent(e,this);var arrow=Arrow.eventHandlers.getArrow(e);itemClickedId=null;arrow.showMenu()},onmouseout:function(e){e=Arrow.eventHandlers.getEvent(e,this)}};Arrow.prototype.getImage=function(){var name=this.getPrefix().concat("Img");return document.getElementById(name)};Arrow.prototype.getPrefix=function(){return this._prefix};Arrow.prototype.getInputMenuId=function(){return this._inputMenuId};Arrow.prototype.showMenu=function(){var menu=this.getMenu(this.getInputMenuId());this.element.parentNode.appendChild(menu);menu.style.display="block";menu.style.right="-"+menu.offsetWidth+"px"};Arrow.prototype.hideMenu=function(){var menu=this.getMenu(this.getInputMenuId());menu.style.display="none"};Arrow.prototype.getMenu=function(inputMenuId){return document.getElementById(inputMenuId)};InputMenuLink.isSupported=typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number";InputMenuLink.setup=function(params){function params_default(pname,def){if((typeof params[pname]=="undefined")||(params[pname]=="null")){params[pname]=def}}params_default("oElement",null);params_default("id",null);var iml=new InputMenuLink(params.oElement,params.id);return iml};function InputMenuLink(oElement,id){if(!oElement){return }if(InputMenuLink.isSupported&&oElement){this.document=oElement.ownerDocument||oElement.document;this.element=oElement;this._id=id;this.element.inputMenulink=this}var oThis=this;if(InputMenuLink.isSupported&&oElement){this.element.onmouseout=InputMenuLink.eventHandlers.onmouseout}}InputMenuLink.eventHandlers={getEvent:function(e,el){if(!e){if(el){e=el.document.parentWindow.event}else{e=window.event}}if(!e.srcElement){var el=e.target;while(el!=null&&el.nodeType!=1){el=el.parentNode}e.srcElement=el}if(typeof e.offsetX=="undefined"){e.offsetX=e.layerX;e.offsetY=e.layerY}return e},getDocument:function(e){if(e.target){return e.target.ownerDocument}return e.srcElement.document},getInputMenuLink:function(e){var el=e.target||e.srcElement;while(el!=null&&el.inputMenuLink==null){el=el.parentNode}if(el){return el.inputMenuLink}return null},onmouseout:function(e){if(!e){var e=window.event}var tg=(window.event)?e.srcElement:e.target;if(tg.nodeName!="DIV"){return }divid=tg.id;lastchr=divid.charAt(divid.length-1);divid="div"+lastchr;var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;while(reltg!=tg&&reltg.nodeName!="#document"){reltg=reltg.parentNode}if(reltg==tg){return }var iml=this.inputMenulink;iml.hideMenu();iml.hideArrows()}};InputMenuLink.prototype.hideMenu=function(){this.getMenu().style.display="none"};InputMenuLink.prototype.getMenu=function(){return document.getElementById(this.getId())};InputMenuLink.prototype.getId=function(){return this._id};InputMenuLink.prototype.hideArrows=function(){var arrows=document.getElementsByClassName("inputHint");for(var i=0;i<arrows.length;i++){if(arrows[i].style.display="inline"){arrows[i].style.display="none"}}};InputMenuLinkItem.isSupported=typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number";InputMenuLinkItem.setup=function(params){function params_default(pname,def){if((typeof params[pname]=="undefined")||(params[pname]=="null")){params[pname]=def}}params_default("oElement",null);params_default("selectAction",null);params_default("cssClass",null);params_default("id",null);params_default("formId",null);var imli=new InputMenuLinkItem(params.oElement,params.selectAction,params.cssClass,params.id,params.formId);return imli};function InputMenuLinkItem(oElement,selectAction,cssClass,id,formId){if(!oElement){return }if(InputMenuLink.isSupported&&oElement){this.document=oElement.ownerDocument||oElement.document;this.element=oElement;this._id=id;this._selectAction=selectAction;this._formId=formId;this.element.inputMenuLinkItem=this;if(cssClass!=null){this.element.className=this.element.className+" "+cssClass}}var oThis=this;if(InputMenuLinkItem.isSupported&&oElement){this.element.onclick=InputMenuLinkItem.eventHandlers.onclick}}InputMenuLinkItem.eventHandlers={getEvent:function(e,el){if(!e){if(el){e=el.document.parentWindow.event}else{e=window.event}}if(!e.srcElement){var el=e.target;while(el!=null&&el.nodeType!=1){el=el.parentNode}e.srcElement=el}if(typeof e.offsetX=="undefined"){e.offsetX=e.layerX;e.offsetY=e.layerY}return e},getDocument:function(e){if(e.target){return e.target.ownerDocument}return e.srcElement.document},getInputMenuLinkItem:function(e){var el=e.target||e.srcElement;while(el!=null&&el.inputMenuLinkItem==null){el=el.parentNode}if(el){return el.inputMenuLinkItem}return null},getInputLink:function(e){var el=e.target||e.srcElement;while(el!=null&&el.className!="inputcontainer"){el=el.parentNode}if(el){var elChild;var childs=el.childNodes;for(var i=0;i<childs.length&&!elChild;i++){if(childs[i]&&childs[i].inputlink!=null){elChild=childs[i]}}if(elChild){return elChild.inputlink}}return null},onclick:function(e){e=InputMenuLinkItem.eventHandlers.getEvent(e,this);var attachedInputLink=InputMenuLinkItem.eventHandlers.getInputLink(e);var inputMenuLinkItem=InputMenuLinkItem.eventHandlers.getInputMenuLinkItem(e);attachedInputLink.getArrow().hideMenu();attachedInputLink.hideArrow();if(inputMenuLinkItem._selectAction!=null&&inputMenuLinkItem._selectAction!=""){var param="?";if(inputMenuLinkItem._selectAction.indexOf("?")>0){param="&"}param=param+"inputId="+attachedInputLink.getId()+"&";var urlCalled=inputMenuLinkItem._selectAction+param;if(inputMenuLinkItem._formId.length>0&&inputMenuLinkItem._formId!=null){var theForm=document.getElementById(inputMenuLinkItem._formId);fwkDebug("FormAjaxCall of url "+urlCalled+" and form "+inputMenuLinkItem._formId);FormAjaxCall(urlCalled,theForm,theForm,false);return false}else{fwkDebug("AjaxCall of "+urlCalled);AjaxCall(urlCalled)}}else{itemClickedId=attachedInputLink.getId()}}};var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}()