/** ------------------------------------
 * SweetDEV RIA library
 * Copyright [2006] [Ideo Technologies]
 * ------------------------------------
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 		http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * For more information, please contact us at:
 *         Ideo Technologies S.A
 *        124 rue de Verdun
 *        92800 Puteaux - France
 *
 *      France & Europe Phone : +33 1.46.25.09.60
 *         USA & Canada Phone : (201) 984-7514
 *
 *        web : http://www.ideotechnologies.com
 *        email : Sweetdev_ria_sales@ideotechnologies.com
 *
 *
 * @version 1.2-RC1
 * @author Ideo Technologies
 */

function Log(level,logger,prefix){var _currentLevel=Log.WARN;var _logger=Log.writeLogger;var _prefix=false;this.setPrefix=function(pre){if(pre!='undefined'){_prefix=pre;}
else{_prefix=false;}}
this.setLogger=function(logger){if(logger!='undefined'){_logger=logger;}}
this.setLevel=function(level){if(level!='undefined'&&typeof level=='number'){_currentLevel=level;}else if(level!='undefined'){if(level=='debug'){_currentLevel=Log.DEBUG;}
else if(level=='info'){_currentLevel=Log.INFO;}
else if(level=='error'){_currentLevel=Log.ERROR;}
else if(level=='fatal'){_currentLevel=Log.FATAL;}
else if(level=='warn'){_currentLevel=Log.WARN;}
else{_currentLevel=Log.NONE;}}}
this.getPrefix=function(){return _prefix;}
this.getLogger=function(){return _logger;}
this.getLevel=function(){return _currentLevel;}
if(level!='undefined'){this.setLevel(level);}
if(logger!='undefined'){this.setLogger(logger);}
if(prefix!='undefined'){this.setPrefix(prefix);}}
Log.prototype.debug=function(s){if(this.getLevel()<=Log.DEBUG){this._log(s,"DEBUG",this);}}
Log.prototype.info=function(s){if(this.getLevel()<=Log.INFO){this._log(s,"INFO",this);}}
Log.prototype.warn=function(s){if(this.getLevel()<=Log.WARN){this._log(s,"WARN",this);}}
Log.prototype.error=function(s){if(this.getLevel()<=Log.ERROR){this._log(s,"ERROR",this);}}
Log.prototype.fatal=function(s){if(this.getLevel()<=Log.FATAL){this._log(s,"FATAL",this);}}
Log.prototype._log=function(msg,level,obj){if(this.getPrefix()){this.getLogger()(this.getPrefix()+" - "+msg,level,obj);}else{this.getLogger()(msg,level,obj);}}
Log.DEBUG=1;Log.INFO=2;Log.WARN=3;Log.ERROR=4;Log.FATAL=5;Log.NONE=6;Log.alertLogger=function(msg,level){alert(level+" - "+msg);}
Log.writeLogger=function(msg,level){document.writeln(level+"&nbsp;-&nbsp;"+msg+"<br/>");}
Log.consoleLogger=function(msg,level,obj){if(window.console){window.console.log(level+" - "+msg);}else{Log.popupLogger(msg,level,obj);}}
Log.popupLogger=function(msg,level,obj){if(obj.popupBlocker){return;}
if(!obj._window||!obj._window.document){obj._window=window.open("",'logger_popup_window','width=420,height=320,scrollbars=1,status=0,toolbars=0,resizeable=1');if(!obj._window){obj.popupBlocker=true;alert("You have a popup window manager blocking the log4js log popup display.\n\nThis must be disabled to properly see logged events.");return;}
if(!obj._window.document.getElementById('loggerTable')){obj._window.document.writeln("<table width='100%' id='loggerTable'><tr><th align='left'>Time</th><th width='100%' colspan='2' align='left'>Message</th></tr></table>");obj._window.document.close();}}
var tbl=obj._window.document.getElementById("loggerTable");var row=tbl.insertRow(-1);var cell_1=row.insertCell(-1);var cell_2=row.insertCell(-1);var cell_3=row.insertCell(-1);var d=new Date();var h=d.getHours();if(h<10){h="0"+h;}
var m=d.getMinutes();if(m<10){m="0"+m;}
var s=d.getSeconds();if(s<10){s="0"+s;}
var date=(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear()+"&nbsp;-&nbsp;"+h+":"+m+":"+s;cell_1.style.fontSize="8pt";cell_1.style.fontWeight="bold";cell_1.style.paddingRight="6px";cell_2.style.fontSize="8pt";cell_3.style.fontSize="8pt";cell_3.style.whiteSpace="nowrap";cell_3.style.width="100%";if(tbl.rows.length%2==0){cell_1.style.backgroundColor="#eeeeee";cell_2.style.backgroundColor="#eeeeee";cell_3.style.backgroundColor="#eeeeee";}
cell_1.innerHTML=date
cell_2.innerHTML=level;cell_3.innerHTML=msg;}
Log.dumpObject=function(obj,indent){if(!indent){indent="";}
if(indent.length>20){return;}
var s="{\n";for(var p in obj){s+=indent+p+":";var type=typeof(obj[p]);type=type.toLowerCase();if(type=='object'){s+=Log.dumpObject(obj[p],indent+"----");}else{s+=obj[p];}
s+="\n";}
s+=indent+"}";return s;}
AjaxAnywhere.defaultInstanceName="default";function AjaxAnywhere(){this.id=AjaxAnywhere.defaultInstanceName;this.formName=null;this.notSupported=false;this.delayBeforeContentUpdate=true;this.delayInMillis=100;if(window.XMLHttpRequest){this.req=new XMLHttpRequest();}else if(window.ActiveXObject){try{this.req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{this.req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e1){this.notSupported=true;}}}
if(this.req==null||typeof this.req=="undefined")
this.notSupported=true;}
AjaxAnywhere.prototype.substitutedSubmitButtons=new Array();AjaxAnywhere.prototype.substitutedSubmitButtonsInfo=new Object();AjaxAnywhere.prototype.findForm=function(){var form;if(this.formName!=null)
form=document.forms[this.formName];else if(document.forms.length>0)
form=document.forms[0];if(typeof form!="object")
alert("AjaxAnywhere error: Form with name ["+this.formName+"] not found");return form;}
AjaxAnywhere.prototype.bindById=function(){var key="AjaxAnywhere."+this.id;window[key]=this;}
AjaxAnywhere.findInstance=function(id){var key="AjaxAnywhere."+id;return window[key];}
AjaxAnywhere.prototype.submitAJAX=function(additionalPostData,submitButton){if(this.notSupported)
return this.onSubmitAjaxNotSupported(additionalPostData);if(additionalPostData==null||typeof additionalPostData=="undefined")
additionalPostData="";this.bindById();var form=this.findForm();var actionAttrNode=form.attributes["action"];var url=actionAttrNode==null?null:actionAttrNode.nodeValue;var pos=url.indexOf("#");if(pos!=-1)
url=url.substring(0,pos);if((url==null)||(url==""))
url=location.href;pos=url.indexOf("#");if(pos!=-1)
url=url.substring(0,pos);var zones=this.getZonesToReload(url,submitButton);if(zones==null){if(typeof form.submit_old=="undefined")
form.submit();else
form.submit_old();return;}
this.dropPreviousRequest();this.req.open("POST",url,true);this.req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.req.setRequestHeader("Accept","text/xml");var postData=this.preparePostData(submitButton);if(zones!="")
postData='&aazones='+encodeURIComponent(zones)+"&"+postData+"&"+additionalPostData;else
postData+="&"+additionalPostData;this.sendPreparedRequest(postData);}
AjaxAnywhere.prototype.getAJAX=function(url,zonesToRefresh){if(this.notSupported)
return this.onGetAjaxNotSupported(url);this.bindById();if(zonesToRefresh==null||typeof zonesToRefresh=="undefined")
zonesToRefresh="";var urlDependentZones=this.getZonesToReload(url);if(urlDependentZones==null){location.href=url;return;}
if(urlDependentZones.length!=0)
zonesToRefresh+=","+urlDependentZones;this.dropPreviousRequest();url+=(url.indexOf("?")!=-1)?"&":"?";url+="aa_rand="+Math.random();if(zonesToRefresh!=null&&zonesToRefresh!="")
url+='&aazones='+encodeURIComponent(zonesToRefresh);this.req.open("GET",url,true);this.req.setRequestHeader("Accept","text/xml");this.sendPreparedRequest("");}
AjaxAnywhere.prototype.sendPreparedRequest=function(postData){var callbackKey=this.id+"_callbackFunction";if(typeof window[callbackKey]=="undefined")
window[callbackKey]=new Function("AjaxAnywhere.findInstance(\""+this.id+"\").callback(); ");this.req.onreadystatechange=window[callbackKey];this.showLoadingMessage();this.req.setRequestHeader("aaxmlrequest","true");this.req.send(postData);}
AjaxAnywhere.prototype.dropPreviousRequest=function(){if(this.req.readyState!=0&&this.req.readyState!=4){this.req.abort();this.handlePrevousRequestAborted();}}
AjaxAnywhere.prototype.preparePostData=function(submitButton){var form=this.findForm();var result="";for(var i=0;i<form.elements.length;i++){var el=form.elements[i];if(el.tagName.toLowerCase()=="select"){for(var j=0;j<el.options.length;j++){var op=el.options[j];if(op.selected)
result+="&"+encodeURIComponent(el.name)+"="+encodeURIComponent(op.value);}}else if(el.tagName.toLowerCase()=="textarea"){result+="&"+encodeURIComponent(el.name)+"="+encodeURIComponent(el.value);}else if(el.tagName.toLowerCase()=="input"){if(el.type.toLowerCase()=="checkbox"||el.type.toLowerCase()=="radio"){if(el.checked)
result+="&"+encodeURIComponent(el.name)+"="+encodeURIComponent(el.value);}else if(el.type.toLowerCase()=="submit"){if(el==submitButton)
result+="&"+encodeURIComponent(el.name)+"="+encodeURIComponent(el.value);}else if(el.type.toLowerCase()!="button"){result+="&"+encodeURIComponent(el.name)+"="+encodeURIComponent(el.value);}}}
if(typeof submitButton!='undefined'&&submitButton!=null&&submitButton.type.toLowerCase()=="image"){if(submitButton.name==null||submitButton.name==""||typeof submitButton.name=="undefined")
result+="&x=1&y=1";else
result+="&"+encodeURIComponent(submitButton.name)+".x=1&"+
encodeURIComponent(submitButton.name)+".y=1";}
return result;}
function delay(millis){var date=new Date();var curDate=null;do{var curDate=new Date();}
while(curDate-date<millis);}
AjaxAnywhere.prototype.callback=function(){if(this.req.readyState==4){this.onBeforeResponseProcessing();this.hideLoadingMessage();if(this.req.status==200){if(this.req.getResponseHeader('content-type').toLowerCase().substring(0,8)!='text/xml')
alert("AjaxAnywhere error : content-type in not text/xml : ["+this.req.getResponseHeader('content-type')+"]");var docs=this.req.responseXML.getElementsByTagName("document");var redirects=this.req.responseXML.getElementsByTagName("redirect");var zones=this.req.responseXML.getElementsByTagName("zone");var exceptions=this.req.responseXML.getElementsByTagName("exception");var scripts=this.req.responseXML.getElementsByTagName("script");var images=this.req.responseXML.getElementsByTagName("image");if(redirects.length!=0){var newURL=redirects[0].firstChild.data;location.href=newURL;}
if(docs.length!=0){var newContent=docs[0].firstChild.data;delete this.req;document.close();document.write(newContent);document.close();}
if(images.length!=0){var preLoad=new Array(images.length);for(var i=0;i<images.length;i++){var img=images[i].firstChild;if(img!=null){preLoad[i]=new Image();preLoad[i].src=img.data;}}
if(this.delayBeforeContentUpdate){delay(this.delayInMillis);}}
if(zones.length!=0){for(var i=0;i<zones.length;i++){var zoneNode=zones[i];var name=zoneNode.getAttribute("name");var fc=zoneNode.firstChild;var html=(fc==null)?"":fc.data;var zoneHolder=document.getElementById("aazone."+name);if(zoneHolder!=null&&typeof(zoneHolder)!="undefined"){zoneHolder.innerHTML=html;}}}
if(exceptions.length!=0){var e=exceptions[0];var type=e.getAttribute("type");var stackTrace=e.firstChild.data;this.handleException(type,stackTrace);}
if(scripts.length!=0){for(var $$$$i=0;$$$$i<scripts.length;$$$$i++){var script=scripts[$$$$i].firstChild;if(script!=null){script=script.data;if(script.indexOf("document.write")!=-1){this.handleException("document.write","This script contains document.write(), which is not compatible with AjaxAnywhere : \n\n"+script);}else{eval(script);}}}
var globals=this.getGlobalScriptsDeclarationsList(script);if(globals!=null)
for(var i in globals){var objName=globals[i];try{window[objName]=eval(objName);}catch(e){}}}}else{if(this.req.status!=0)
this.handleHttpErrorCode(this.req.status);}
this.restoreSubstitutedSubmitButtons();this.onAfterResponseProcessing();}}
AjaxAnywhere.prototype.showLoadingMessage=function(){var div=document.getElementById("AA_"+this.id+"_loading_div");if(div==null){div=document.createElement("DIV");document.body.appendChild(div);div.id="AA_"+this.id+"_loading_div";div.innerHTML="&nbsp;Loading...";div.style.position="absolute";div.style.border="1 solid black";div.style.color="white";div.style.backgroundColor="blue";div.style.width="100px";div.style.heigth="50px";div.style.fontFamily="Arial, Helvetica, sans-serif";div.style.fontWeight="bold";div.style.fontSize="11px";}
div.style.top=document.body.scrollTop+"px";div.style.left=(document.body.offsetWidth-100-(document.all?20:0))+"px";div.style.display="";}
AjaxAnywhere.prototype.hideLoadingMessage=function(){var div=document.getElementById("AA_"+this.id+"_loading_div");if(div!=null)
div.style.display="none";}
AjaxAnywhere.prototype.substituteFormSubmitFunction=function(){this.bindById();var form=this.findForm();form.submit_old=form.submit;var code="var ajax = AjaxAnywhere.findInstance(\""+this.id+"\"); "+"if (typeof ajax !='object' || ! ajax.isFormSubmitByAjax() ) "+"ajax.findForm().submit_old();"+" else "+"ajax.submitAJAX();"
form.submit=new Function(code);}
AjaxAnywhere.prototype.substituteSubmitButtonsBehavior=function(keepExistingOnClickHandler,elements){var form=this.findForm();if(elements==null||typeof elements=="undefined"){var elements=new Array();for(var i=0;i<form.elements.length;i++){elements.push(form.elements[i]);}
var inputs=document.getElementsByTagName("input");for(var i=0;i<inputs.length;i++){var input=inputs[i];if(input.type!=null&&typeof input.type!="undefined"&&input.type.toLowerCase()=="image"&&input.form==form){elements.push(input);}}
for(var i=0;i<elements.length;i++){var el=elements[i];if(el.tagName.toLowerCase()=="input"&&(el.type.toLowerCase()=="submit"||el.type.toLowerCase()=="image")){this.substituteSubmitBehavior(el,keepExistingOnClickHandler);}}}else{for(var i=0;i<elements.length;i++){var el=elements[i];if(el==null)
continue;if(typeof el!="object")
form.elements[el];if(typeof el!="undefined"){if(el.tagName.toLowerCase()=="input"&&(el.type.toLowerCase()=="submit"||el.type.toLowerCase()=="image"))
this.substituteSubmitBehavior(el,keepExistingOnClickHandler);}}}}
AjaxAnywhere.prototype.substituteSubmitBehavior=function(el,keepExistingOnClickHandler){var inList=false;for(var i=0;i<this.substitutedSubmitButtons.length;i++){var btnName=this.substitutedSubmitButtons[i];if(btnName==el.name){inList=true;break;}}
if(!inList)
this.substitutedSubmitButtons.push(el.name);this.substitutedSubmitButtonsInfo[el.name]=keepExistingOnClickHandler;if(keepExistingOnClickHandler&&(typeof el.onclick!="undefined")&&(el.onclick!=null)&&(el.onclick!="")){el.AA_old_onclick=el.onclick;}
el.onclick=handleSubmitButtonClick;el.ajaxAnywhereId=this.id;}
AjaxAnywhere.prototype.restoreSubstitutedSubmitButtons=function(){if(this.substitutedSubmitButtons.length==0)
return;var form=this.findForm();for(var i=0;i<this.substitutedSubmitButtons.length;i++){var name=this.substitutedSubmitButtons[i];var el=form.elements[name];if(el!=null&&typeof el!="undefined"){if(el.onclick!=handleSubmitButtonClick){var keepExistingOnClickHandler=this.substitutedSubmitButtonsInfo[el.name];this.substituteSubmitBehavior(el,keepExistingOnClickHandler);}}else{if(name!=null&&typeof name!="undefined"&&name.length!=0){var elements=document.getElementsByName(name);if(elements!=null)
for(var j=0;j<elements.length;j++){el=elements[j];if(el!=null&&typeof el!="undefined"&&el.tagName.toLowerCase()=="input"&&typeof el.type!="undefined"&&el.type.toLowerCase()=="image"){if(el.onclick!=handleSubmitButtonClick){var keepExistingOnClickHandler=this.substitutedSubmitButtonsInfo[el.name];this.substituteSubmitBehavior(el,keepExistingOnClickHandler);}}}}}}}
function handleSubmitButtonClick(_event){if(typeof this.AA_old_onclick!="undefined"){if(false==this.AA_old_onclick(_event))
return false;if(typeof window.event!="undefined")
if(window.event.returnValue==false)
return false;}
var onsubmit=this.form.onsubmit;if(typeof onsubmit=="function"){if(false==onsubmit(_event))
return false;if(typeof window.event!="undefined")
if(window.event.returnValue==false)
return false;}
AjaxAnywhere.findInstance(this.ajaxAnywhereId).submitAJAX('',this);return false;}
AjaxAnywhere.prototype.isFormSubmitByAjax=function(){return true;}
AjaxAnywhere.prototype.setDelayBeforeLoad=function(isDelay){this.delayBeforeContentUpdate=isDelay;}
AjaxAnywhere.prototype.isDelayBeforeLoad=function(){return this.delayBeforeContentUpdate;}
AjaxAnywhere.prototype.setDelayTime=function(delayMillis){this.delayInMillis=delayMillis;}
AjaxAnywhere.prototype.getDelayTime=function(){return this.delayInMillis;}
AjaxAnywhere.prototype.handleException=function(type,details){alert(details);}
AjaxAnywhere.prototype.handleHttpErrorCode=function(code){var details=confirm("AjaxAnywhere default error handler. XMLHttpRequest HTTP Error code:"+code+" \n\n Would you like to view the response content in a new window?");if(details){var win=window.open("",this.id+"_debug_window");if(win!=null){win.document.write("<html><body><xmp>"+this.req.responseText);win.document.close();win.focus();}else{alert("Please, disable your pop-up blocker for this site first.");}}}
AjaxAnywhere.prototype.handlePrevousRequestAborted=function(){alert("AjaxAnywhere default error handler. INFO: previous AJAX request dropped")}
AjaxAnywhere.prototype.getGlobalScriptsDeclarationsList=function(script){return null;}
AjaxAnywhere.prototype.getZonesToReload=function(url,submitButton){return this.getZonesToReaload();}
AjaxAnywhere.prototype.getZonesToReaload=function(url,submitButton){return"";}
AjaxAnywhere.prototype.onRequestSent=function(){};AjaxAnywhere.prototype.onBeforeResponseProcessing=function(){};AjaxAnywhere.prototype.onAfterResponseProcessing=function(){};AjaxAnywhere.prototype.onGetAjaxNotSupported=function(url){location.href=url;return false;};AjaxAnywhere.prototype.onSubmitAjaxNotSupported=function(additionalPostData){var form=this.findForm();var actionAttrNode=form.attributes["action"];var url=actionAttrNode==null?null:actionAttrNode.nodeValue;var url_backup=url;if(typeof additionalPostData!='undefined'&&additionalPostData!=null){url+=(url.indexOf("?")!=-1)?"&":"?";url+=additionalPostData;form.setAttribute("action",url);form.setAttribute("method","post");}
if(typeof form.submit_old=="undefined")
form.submit();else
form.submit_old();form.setAttribute("action",url_backup);return false;};ajaxAnywhere=new AjaxAnywhere();ajaxAnywhere.bindById();var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}
var levels=ns.split(".");var nsobj=YAHOO;for(var i=(levels[0]=="YAHOO")?1:0;i<levels.length;++i){nsobj[levels[i]]=nsobj[levels[i]]||{};nsobj=nsobj[levels[i]];}
return nsobj;};YAHOO.log=function(sMsg,sCategory,sSource){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(sMsg,sCategory,sSource);}else{return false;}};YAHOO.extend=function(subclass,superclass){var f=function(){};f.prototype=superclass.prototype;subclass.prototype=new f();subclass.prototype.constructor=subclass;subclass.superclass=superclass.prototype;if(superclass.prototype.constructor==Object.prototype.constructor){superclass.prototype.constructor=superclass;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example");YAHOO.util.CustomEvent=function(type,oScope,silent){this.type=type;this.scope=oScope||window;this.silent=silent;this.subscribers=[];if(YAHOO.util.Event){YAHOO.util.Event.regCE(this);}
if(!this.silent){}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,bOverride){this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,bOverride));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
return found;},fire:function(){var len=this.subscribers.length;var args=[];for(var i=0;i<arguments.length;++i){args.push(arguments[i]);}
if(!this.silent){}
for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}
var scope=(s.override)?s.obj:this.scope;s.fn.call(scope,this.type,args,s.obj);}}},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
delete this.subscribers[index];},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,bOverride){this.fn=fn;this.obj=obj||null;this.override=(bOverride);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return(this.fn==fn&&this.obj==obj);};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var delayedListeners=[];var unloadListeners=[];var customEvents=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;return{POLL_RETRYS:200,POLL_INTERVAL:50,EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),addDelayedListener:function(el,sType,fn,oScope,bOverride){delayedListeners[delayedListeners.length]=[el,sType,fn,oScope,bOverride];if(loadComplete){retryCount=this.POLL_RETRYS;this.startTimeout(0);}},startTimeout:function(interval){var i=(interval||interval===0)?interval:this.POLL_INTERVAL;var self=this;var callback=function(){self._tryPreloadAttach();};this.timeout=setTimeout(callback,i);},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override});retryCount=this.POLL_RETRYS;this.startTimeout(0);},addListener:function(el,sType,fn,oScope,bOverride){if(!fn||!fn.call){return false;}
if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=(this.on(el[i],sType,fn,oScope,bOverride)&&ok);}
return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(loadComplete&&oEl){el=oEl;}else{this.addDelayedListener(el,sType,fn,oScope,bOverride);return true;}}
if(!el){return false;}
if("unload"==sType&&oScope!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,oScope,bOverride];return true;}
var scope=(bOverride)?oScope:el;var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),oScope);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(index);}else if(el.addEventListener){el.addEventListener(sType,wrappedFn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,wrappedFn);}
return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var index=le[i];if(index){var li=listeners[index];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}else{delete le[i];}}}
return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}
return false;},removeListener:function(el,sType,fn,index){if(!fn||!fn.call){return false;}
if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){delete unloadListeners[i];return true;}}
return false;}
var cacheItem=null;if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(el.removeEventListener){el.removeEventListener(sType,cacheItem[this.WFN],false);}else if(el.detachEvent){el.detachEvent("on"+sType,cacheItem[this.WFN]);}
delete listeners[index][this.WFN];delete listeners[index][this.FN];delete listeners[index];return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&node.nodeName&&"#TEXT"==node.nodeName.toUpperCase()){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){return ev.charCode||((ev.type=="keypress")?ev.keyCode:0);},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
return id;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},regCE:function(ce){customEvents.push(ce);},_load:function(e){loadComplete=true;},_tryPreloadAttach:function(){if(this.locked){return false;}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
var stillDelayed=[];for(var i=0,len=delayedListeners.length;i<len;++i){var d=delayedListeners[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete delayedListeners[i];}else{stillDelayed.push(d);}}}
delayedListeners=stillDelayed;var notAvail=[];for(i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){el=this.getEl(item.id);if(el){var scope=(item.override)?item.obj:el;item.fn.call(scope,item.obj);delete onAvailStack[i];}else{notAvail.push(item);}}}
retryCount=(stillDelayed.length===0&&notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startTimeout();}
this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.SCOPE],adjust:l[this.ADJ_SCOPE],index:i});}}}
return(elListeners.length)?elListeners:null;},_unload:function(e,me){for(var i=0,len=unloadListeners.length;i<len;++i){var l=unloadListeners[i];if(l){var scope=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(scope,this.getEvent(e),l[this.SCOPE]);}}
if(listeners&&listeners.length>0){for(i=0,len=listeners.length;i<len;++i){l=listeners[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN],i);}}
this.clearCache();}
for(i=0,len=customEvents.length;i<len;++i){customEvents[i].unsubscribeAll();delete customEvents[i];}
for(i=0,len=legacyEvents.length;i<len;++i){delete legacyEvents[i][0];delete legacyEvents[i];}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement;db=document.body;if(dd&&dd.scrollTop){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}
YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var isOpera=(ua.indexOf('opera')>-1);var isSafari=(ua.indexOf('safari')>-1);var isIE=(window.ActiveXObject);var id_counter=0;var util=YAHOO.util;var property_cache={};var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf('-')>-1){property=convert(property);}
return property;};var toHyphen=function(property){if(property.indexOf('-')>-1){return property;}
var converted='';for(var i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}
return converted;};var cacheConvertedProperties=function(property){property_cache[property]={camel:toCamel(property),hyphen:toHyphen(property)};};return{get:function(el){if(typeof el!='string'&&!(el instanceof Array)){return el;}
if(typeof el=='string'){return document.getElementById(el);}
else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=util.Dom.get(el[i]);}
return collection;}
return null;},getStyle:function(el,property){var f=function(el){var value=null;var dv=document.defaultView;if(!property_cache[property]){cacheConvertedProperties(property);}
var camel=property_cache[property]['camel'];var hyphen=property_cache[property]['hyphen'];if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}else if(el.style[camel]){value=el.style[camel];}
else if(isIE&&el.currentStyle&&el.currentStyle[camel]){value=el.currentStyle[camel];}
else if(dv&&dv.getComputedStyle){var computed=dv.getComputedStyle(el,'');if(computed&&computed.getPropertyValue(hyphen)){value=computed.getPropertyValue(hyphen);}}
return value;};return util.Dom.batch(el,f,util.Dom,true);},setStyle:function(el,property,val){if(!property_cache[property]){cacheConvertedProperties(property);}
var camel=property_cache[property]['camel'];var f=function(el){switch(property){case'opacity':if(isIE&&typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}
break;default:el.style[camel]=val;}};util.Dom.batch(el,f,util.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||this.getStyle(el,'display')=='none'){return false;}
var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)){var doc=parent.document;while(doc&&!this.isAncestor(doc.documentElement,el)){doc=parent.document;}}
var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}
else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}
if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}
if(el.parentNode){parentNode=el.parentNode;}
else{parentNode=null;}
while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML')
{pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;if(parentNode.parentNode){parentNode=parentNode.parentNode;}
else{parentNode=null;}}
return pos;};return util.Dom.batch(el,f,util.Dom,true);},getX:function(el){return util.Dom.getXY(el)[0];},getY:function(el){return util.Dom.getXY(el)[1];},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
var pageXY=this.getXY(el);if(pageXY===false){return false;}
var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}};util.Dom.batch(el,f,util.Dom,true);},setX:function(el,x){util.Dom.setXY(el,[x,null]);},setY:function(el,y){util.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new YAHOO.util.Region.getRegion(el);return region;};return util.Dom.batch(el,f,util.Dom,true);},getClientWidth:function(){return util.Dom.getViewportWidth();},getClientHeight:function(){return util.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return util.Dom.hasClass(el,className)};return util.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el['className']);};return util.Dom.batch(el,f,util.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}
el['className']=[el['className'],className].join(' ');};util.Dom.batch(el,f,util.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}
var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};util.Dom.batch(el,f,util.Dom,true);},replaceClass:function(el,oldClassName,newClassName){var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};util.Dom.batch(el,f,util.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=util.Dom.get(el);}else{el={};}
if(!el.id){el.id=prefix+id_counter++;}
return el.id;};return util.Dom.batch(el,f,util.Dom,true);},isAncestor:function(haystack,needle){haystack=util.Dom.get(haystack);if(!haystack||!needle){return false;}
var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}
else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}
else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}
else if(parent.tagName.toUpperCase()=='HTML'){return false;}
parent=parent.parentNode;}
return false;}};return util.Dom.batch(needle,f,util.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return util.Dom.batch(el,f,util.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=util.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}
for(var i=0,len=elements.length;i<len;++i)
{if(method(elements[i])){nodes[nodes.length]=elements[i];}}
return nodes;},batch:function(el,method,o,override){var id=el;el=util.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}
return method.call(scope,el,o);}
var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=id[i];}
collection[collection.length]=method.call(scope,el[i],o);}
return collection;},getDocumentHeight:function(){var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;var marginTop=parseInt(util.Dom.getStyle(document.body,'marginTop'),10);var marginBottom=parseInt(util.Dom.getStyle(document.body,'marginBottom'),10);var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':scrollHeight=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);windowHeight=[document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a,b){return(a-b);})[1];bodyHeight=document.body.offsetHeight+marginTop+marginBottom;break;default:scrollHeight=document.body.scrollHeight;bodyHeight=document.body.clientHeight;}}else{scrollHeight=document.documentElement.scrollHeight;windowHeight=self.innerHeight;bodyHeight=document.documentElement.clientHeight;}
var h=[scrollHeight,windowHeight,bodyHeight].sort(function(a,b){return(a-b);});return h[2];},getDocumentWidth:function(){var docWidth=-1,bodyWidth=-1,winWidth=-1;var marginRight=parseInt(util.Dom.getStyle(document.body,'marginRight'),10);var marginLeft=parseInt(util.Dom.getStyle(document.body,'marginLeft'),10);var mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth||-1;break;default:bodyWidth=document.body.clientWidth;winWidth=document.body.scrollWidth;break;}}else{docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth;}
var w=[docWidth,bodyWidth,winWidth].sort(function(a,b){return(a-b);});return w[2];},getViewportHeight:function(){var height=-1;var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':height=document.documentElement.clientHeight;break;default:height=document.body.clientHeight;}}else{height=self.innerHeight;}
return height;},getViewportWidth:function(){var width=-1;var mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':width=document.documentElement.clientWidth;break;default:width=document.body.clientWidth;}}else{width=self.innerWidth;}
return width;}};}();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}
this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=YAHOO.util.Dom.get(this.id);}
return this._domRef;},getDragEl:function(){return YAHOO.util.Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);YAHOO.util.Event.addListener(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;YAHOO.util.Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
var dx=diffX||0;var dy=diffY||0;var p=YAHOO.util.Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.deltaSetXY=null;this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||YAHOO.util.Dom.getXY(this.getEl());this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){YAHOO.util.Event.addListener(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);},unreg:function(){YAHOO.util.Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var EU=YAHOO.util.Event;var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
if(this.isLocked()){return;}
this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(EU.getPageX(e),EU.getPageY(e));if(this.DDM.isOverTarget(pt,this)){var srcEl=EU.getTarget(e);if(this.isValidHandleChild(srcEl)&&(this.id==this.handleElId||this.DDM.handleWasClicked(srcEl,this.id))){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}}},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!YAHOO.util.Dom.hasClass(node,this.invalidHandleClasses[i]);}
return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=new function(){this.ids={};this.handleIds={};this.dragCurrent=null;this.dragOvers={};this.deltaX=0;this.deltaY=0;this.preventDefault=true;this.stopPropagation=true;this.initalized=false;this.locked=false;this.init=function(){this.initialized=true;};this.POINT=0;this.INTERSECT=1;this.mode=this.POINT;this._execOnAll=function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
oDD[sMethod].apply(oDD,args);}}};this._onLoad=function(){this.init();var EU=YAHOO.util.Event;EU.on(document,"mouseup",this.handleMouseUp,this,true);EU.on(document,"mousemove",this.handleMouseMove,this,true);EU.on(window,"unload",this._onUnload,this,true);EU.on(window,"resize",this._onResize,this,true);};this._onResize=function(e){this._execOnAll("resetConstraints",[]);};this.lock=function(){this.locked=true;};this.unlock=function(){this.locked=false;};this.isLocked=function(){return this.locked;};this.locationCache={};this.useCache=true;this.clickPixelThresh=3;this.clickTimeThresh=1000;this.dragThreshMet=false;this.clickTimeout=null;this.startX=0;this.startY=0;this.regDragDrop=function(oDD,sGroup){if(!this.initialized){this.init();}
if(!this.ids[sGroup]){this.ids[sGroup]={};}
this.ids[sGroup][oDD.id]=oDD;};this.removeDDFromGroup=function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}};this._remove=function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}
delete this.handleIds[oDD.id];};this.regHandle=function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}
this.handleIds[sDDId][sHandleId]=sHandleId;};this.isDragDrop=function(id){return(this.getDDById(id))?true:false;};this.getRelated=function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}
if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
return oDDs;};this.isLegalTarget=function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
return false;};this.isTypeOfDD=function(oDD){return(oDD&&oDD.__ygDragDrop);};this.isHandle=function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);};this.getDDById=function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
return null;};this.handleMouseDown=function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);};this.startDrag=function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}
this.dragThreshMet=true;};this.handleMouseUp=function(e){if(!this.dragCurrent){return;}
clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}
this.stopDrag(e);this.stopEvent(e);};this.stopEvent=function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}};this.stopDrag=function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
this.dragCurrent.onMouseUp(e);}
this.dragCurrent=null;this.dragOvers={};};this.handleMouseMove=function(e){if(!this.dragCurrent){return true;}
if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}
if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}
this.stopEvent(e);return true;};this.fireEvents=function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
if(!this.isOverTarget(pt,ddo,this.mode)){outEvts.push(ddo);}
oldOvers[i]=true;delete this.dragOvers[i];}
for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}
for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}
if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
this.dragOvers[oDD.id]=oDD;}}}}}
if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);}
if(enterEvts.length){dc.onDragEnter(e,enterEvts);}
if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);}
if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){dc.b4DragOut(e,outEvts[i].id);dc.onDragOut(e,outEvts[i].id);}
for(i=0,len=enterEvts.length;i<len;++i){dc.onDragEnter(e,enterEvts[i].id);}
for(i=0,len=overEvts.length;i<len;++i){dc.b4DragOver(e,overEvts[i].id);dc.onDragOver(e,overEvts[i].id);}
for(i=0,len=dropEvts.length;i<len;++i){dc.b4DragDrop(e,dropEvts[i].id);dc.onDragDrop(e,dropEvts[i].id);}}};this.getBestMatch=function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){winner=dd;break;}else{if(!winner||winner.overlap.getArea()<dd.overlap.getArea()){winner=dd;}}}}
return winner;};this.refreshCache=function(groups){for(sGroup in groups){if("string"!=typeof sGroup){continue;}
for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}};this.verifyEl=function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
return false;};this.getLocation=function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
var el=oDD.getEl();var aPos=null;try{aPos=YAHOO.util.Dom.getXY(el);}catch(e){}
if(!aPos){return null;}
x1=aPos[0];x2=x1+el.offsetWidth;y1=aPos[1];y2=y1+el.offsetHeight;var t=y1-oDD.padding[0];var r=x2+oDD.padding[1];var b=y2+oDD.padding[2];var l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);};this.isOverTarget=function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
if(!loc){return false;}
oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
oTarget.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}};this._onUnload=function(e,me){this.unregAll();};this.unregAll=function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
this.elementCache={};this.ids={};};this.elementCache={};this.getElWrapper=function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
return oWrapper;};this.getElement=function(id){return YAHOO.util.Dom.get(id);};this.getCss=function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;};this.ElementWrapper=function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;};this.getPosX=function(el){return YAHOO.util.Dom.getX(el);};this.getPosY=function(el){return YAHOO.util.Dom.getY(el);};this.swapNode=function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}};this.getScroll=function(){var t,l;if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;}
return{top:t,left:l};};this.getStyle=function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);};this.getScrollTop=function(){return this.getScroll().top;};this.getScrollLeft=function(){return this.getScroll().left;};this.moveToEl=function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);};this.getClientHeight=function(){return YAHOO.util.Dom.getClientHeight();};this.getClientWidth=function(){return YAHOO.util.Dom.getClientWidth();};this.numericSort=function(a,b){return(a-b);};this._timeoutCount=0;this._addListeners=function(){if(YAHOO.util.Event&&document){this._onLoad();}else{if(this._timeoutCount>1000){}else{var DDM=YAHOO.util.DDM;setTimeout(function(){DDM._addListeners();},10);if(document&&document.body){this._timeoutCount+=1;}}}};this.handleWasClicked=function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
return false;};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop);YAHOO.util.DD.prototype.scroll=true;YAHOO.util.DD.prototype.autoOffset=function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);};YAHOO.util.DD.prototype.setDelta=function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;};YAHOO.util.DD.prototype.setDragElPos=function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);};YAHOO.util.DD.prototype.alignElWithMouse=function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);};YAHOO.util.DD.prototype.cachePosition=function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}};YAHOO.util.DD.prototype.autoScroll=function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}};YAHOO.util.DD.prototype.getTargetCoord=function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
if(x>this.maxX){x=this.maxX;}}
if(this.constrainY){if(y<this.minY){y=this.minY;}
if(y>this.maxY){y=this.maxY;}}
x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};};YAHOO.util.DD.prototype.applyConfig=function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);};YAHOO.util.DD.prototype.b4MouseDown=function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.b4Drag=function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.toString=function(){return("DD "+this.id);};YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD);YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.util.DDProxy.prototype.resizeFrame=true;YAHOO.util.DDProxy.prototype.centerFrame=false;YAHOO.util.DDProxy.prototype._previousSize=[-1,-1];YAHOO.util.DDProxy.prototype.createFrame=function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}};YAHOO.util.DDProxy.prototype.initFrame=function(){this.createFrame();};YAHOO.util.DDProxy.prototype.applyConfig=function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);};YAHOO.util.DDProxy.prototype.showFrame=function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");};YAHOO.util.DDProxy.prototype._resizeProxy=function(){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();if(this.resizeFrame){var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
if(isNaN(br)){br=0;}
if(isNaN(bb)){bb=0;}
if(isNaN(bl)){bl=0;}
var newWidth=el.offsetWidth-br-bl;var newHeight=el.offsetHeight-bt-bb;if(this._previousSize[0]!==newWidth&&this._previousSize[1]!==newHeight){DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");this._previousSize=[newWidth,newHeight];}}};YAHOO.util.DDProxy.prototype.b4MouseDown=function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);};YAHOO.util.DDProxy.prototype.b4StartDrag=function(x,y){this.showFrame(x,y);};YAHOO.util.DDProxy.prototype.b4EndDrag=function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");};YAHOO.util.DDProxy.prototype.endDrag=function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");};YAHOO.util.DDProxy.prototype.toString=function(){return("DDProxy "+this.id);};YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop);YAHOO.util.DDTarget.prototype.toString=function(){return("DDTarget "+this.id);};function ygLogger(sModuleName){if(this.setModuleName)
this.setModuleName(sModuleName);}
ygLogger.DEBUG_ENABLED=true;ygLogger.targetEl=null;ygLogger.logStack=[];ygLogger.startLog=new Date().getTime();ygLogger.lastLog=new Date().getTime();ygLogger.locked=true;ygLogger.logTimeout=null;ygLogger.init=function(oHostElement){if(oHostElement){ygLogger.targetEl=oHostElement;}else{}};ygLogger.prototype.setModuleName=function(sModuleName){this.logName=sModuleName;};ygLogger.prototype.debug=function(){if(ygLogger.DEBUG_ENABLED){var newDate=new Date();var newTime=newDate.getTime();var timeStamp=newTime-ygLogger.lastLog;var totalSeconds=(newTime-ygLogger.startLog)/1000;ygLogger.lastLog=newTime;for(var i=0;i<arguments.length;i++){ygLogger.logStack[ygLogger.logStack.length]=timeStamp+" ms("+totalSeconds+") "+
newDate.toLocaleTimeString()+"<br />"+
this.logName+": <b>"+arguments[i]+"</b>";}
if(ygLogger.logTimeout==null){ygLogger.logTimeout=setTimeout("ygLogger._outputMessages()",1);}}};ygLogger.disable=function(){ygLogger.DEBUG_ENABLED=false;try{ygLogger.targetEl.style.visibility="hidden";}catch(e){}};ygLogger.enable=function(){ygLogger.DEBUG_ENABLED=true;try{ygLogger.targetEl.style.visibility="";}catch(e){}};ygLogger._outputMessages=function(){if(ygLogger.targetEl!=null){for(var i=0;i<ygLogger.logStack.length;i++){var sMsg=ygLogger.logStack[i];var oNewElement=ygLogger.targetEl.appendChild(document.createElement("p"));oNewElement.innerHTML=sMsg;}
ygLogger.logStack=[];ygLogger.targetEl.scrollTop=ygLogger.targetEl.scrollHeight;}
ygLogger.logTimeout=null;};YAHOO.widget.DateMath=new function(){this.DAY="D";this.WEEK="W";this.YEAR="Y";this.MONTH="M";this.ONE_DAY_MS=1000*60*60*24;this.add=function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
return d;};this.subtract=function(date,field,amount){return this.add(date,field,(amount*-1));};this.before=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}};this.after=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}};this.between=function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}};this.getJan1=function(calendarYear){return new Date(calendarYear,0,1);};this.getDayOffset=function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;};this.getWeekNumber=function(date,calendarYear,weekStartsOn){date.setHours(12,0,0,0);if(!weekStartsOn){weekStartsOn=0;}
if(!calendarYear){calendarYear=date.getFullYear();}
var weekNum=-1;var jan1=this.getJan1(calendarYear);var jan1Offset=jan1.getDay()-weekStartsOn;var jan1DayOfWeek=(jan1Offset>=0?jan1Offset:(7+jan1Offset));var endOfWeek1=this.add(jan1,this.DAY,(6-jan1DayOfWeek));endOfWeek1.setHours(23,59,59,999);var month=date.getMonth();var day=date.getDate();var year=date.getFullYear();var dayOffset=this.getDayOffset(date,calendarYear);if(dayOffset<0||this.before(date,endOfWeek1)){weekNum=1;}else{weekNum=2;var weekBegin=new Date(endOfWeek1.getTime()+1);var weekEnd=this.add(weekBegin,this.WEEK,1);while(!this.between(date,weekBegin,weekEnd)){weekBegin=this.add(weekBegin,this.WEEK,1);weekEnd=this.add(weekEnd,this.WEEK,1);weekNum+=1;}}
return weekNum;};this.isYearOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
return overlaps;};this.isMonthOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
return overlaps;};this.findMonthStart=function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;};this.findMonthEnd=function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;};this.clearTime=function(date){date.setHours(0,0,0,0);return date;};}
YAHOO.widget.Calendar_Core=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar_Core.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")==0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar_Core.DATE="D";YAHOO.widget.Calendar_Core.MONTH_DAY="MD";YAHOO.widget.Calendar_Core.WEEKDAY="WD";YAHOO.widget.Calendar_Core.RANGE="R";YAHOO.widget.Calendar_Core.MONTH="M";YAHOO.widget.Calendar_Core.DISPLAY_DAYS=42;YAHOO.widget.Calendar_Core.STOP_RENDER="S";YAHOO.widget.Calendar_Core.prototype={Config:null,parent:null,index:-1,cells:null,weekHeaderCells:null,weekFooterCells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,pageDate:null,_pageDate:null,minDate:null,maxDate:null,selectedDates:null,_selectedDates:null,shellRendered:false,table:null,headerCell:null};YAHOO.widget.Calendar_Core.prototype.init=function(id,containerId,monthyear,selected){this.setupConfig();this.id=id;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(containerId);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var month;var year;if(monthyear){var aMonthYear=monthyear.split(this.Locale.DATE_FIELD_DELIMITER);month=parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);year=parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);}else{month=this.today.getMonth()+1;year=this.today.getFullYear();}
this.pageDate=new Date(year,month-1,1);this._pageDate=new Date(this.pageDate.getTime());if(selected){this.selectedDates=this._parseDates(selected);this._selectedDates=this.selectedDates.concat();}else{this.selectedDates=new Array();this._selectedDates=new Array();}
this.wireDefaultEvents();this.wireCustomEvents();};YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents=function(){this.doSelectCell=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){if(cal.Options.MULTI_SELECT){var link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{var link=cell.getElementsByTagName("A")[0];link.blur()
cal.selectCell(index);}}}
this.doCellMouseOver=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(cell,cal.Style.CSS_CELL_HOVER);}}
this.doCellMouseOut=function(e,cal){YAHOO.util.Dom.removeClass(this,cal.Style.CSS_CELL_HOVER);}
this.doNextMonth=function(e,cal){cal.nextMonth();}
this.doPreviousMonth=function(e,cal){cal.previousMonth();}}
YAHOO.widget.Calendar_Core.prototype.wireCustomEvents=function(){}
YAHOO.widget.Calendar_Core.prototype.setupConfig=function(){this.Config=new Object();this.Config.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_CONTAINER:"yui-calcontainer",CSS_2UPWRAPPER:"yui-cal2upwrapper",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};this.Style=this.Config.Style;this.Config.Locale={MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],MONTHS_LONG:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKDAYS_1CHAR:["S","M","T","W","T","F","S"],WEEKDAYS_SHORT:["Su","Mo","Tu","We","Th","Fr","Sa"],WEEKDAYS_MEDIUM:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WEEKDAYS_LONG:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DATE_DELIMITER:",",DATE_FIELD_DELIMITER:"/",DATE_RANGE_DELIMITER:"-",MY_MONTH_POSITION:1,MY_YEAR_POSITION:2,MD_MONTH_POSITION:1,MD_DAY_POSITION:2,MDY_MONTH_POSITION:1,MDY_DAY_POSITION:2,MDY_YEAR_POSITION:3};this.Locale=this.Config.Locale;this.Config.Options={MULTI_SELECT:false,SHOW_WEEKDAYS:true,START_WEEKDAY:0,SHOW_WEEK_HEADER:false,SHOW_WEEK_FOOTER:false,HIDE_BLANK_WEEKS:false,NAV_ARROW_LEFT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/callt.gif",NAV_ARROW_RIGHT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/calrt.gif"};this.Options=this.Config.Options;this.customConfig();if(!this.Options.LOCALE_MONTHS){this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;}
if(!this.Options.LOCALE_WEEKDAYS){this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;}
if(this.Options.START_WEEKDAY>0){for(var w=0;w<this.Options.START_WEEKDAY;++w){this.Locale.WEEKDAYS_SHORT.push(this.Locale.WEEKDAYS_SHORT.shift());this.Locale.WEEKDAYS_MEDIUM.push(this.Locale.WEEKDAYS_MEDIUM.shift());this.Locale.WEEKDAYS_LONG.push(this.Locale.WEEKDAYS_LONG.shift());}}};YAHOO.widget.Calendar_Core.prototype.customConfig=function(){};YAHOO.widget.Calendar_Core.prototype.buildMonthLabel=function(){var text=this.Options.LOCALE_MONTHS[this.pageDate.getMonth()]+" "+this.pageDate.getFullYear();return text;};YAHOO.widget.Calendar_Core.prototype.buildDayLabel=function(workingDate){var day=workingDate.getDate();return day;};YAHOO.widget.Calendar_Core.prototype.buildShell=function(){this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.table.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();YAHOO.util.Event.addListener(window,"unload",this._unload,this);};YAHOO.widget.Calendar_Core.prototype.buildShellHeader=function(){var head=document.createElement("THEAD");var headRow=document.createElement("TR");var headerCell=document.createElement("TH");var colSpan=7;if(this.Config.Options.SHOW_WEEK_HEADER){this.weekHeaderCells=new Array();colSpan+=1;}
if(this.Config.Options.SHOW_WEEK_FOOTER){this.weekFooterCells=new Array();colSpan+=1;}
headerCell.colSpan=colSpan;YAHOO.widget.Calendar_Core.setCssClasses(headerCell,[this.Style.CSS_HEADER_TEXT]);this.headerCell=headerCell;headRow.appendChild(headerCell);head.appendChild(headRow);if(this.Options.SHOW_WEEKDAYS){var row=document.createElement("TR");var fillerCell;YAHOO.widget.Calendar_Core.setCssClasses(row,[this.Style.CSS_WEEKDAY_ROW]);if(this.Config.Options.SHOW_WEEK_HEADER){fillerCell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);row.appendChild(fillerCell);}
for(var i=0;i<this.Options.LOCALE_WEEKDAYS.length;++i){var cell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_WEEKDAY_CELL]);cell.innerHTML=this.Options.LOCALE_WEEKDAYS[i];row.appendChild(cell);}
if(this.Config.Options.SHOW_WEEK_FOOTER){fillerCell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);row.appendChild(fillerCell);}
head.appendChild(row);}
this.table.appendChild(head);};YAHOO.widget.Calendar_Core.prototype.buildShellBody=function(){this.tbody=document.createElement("TBODY");for(var r=0;r<6;++r){var row=document.createElement("TR");for(var c=0;c<this.headerCell.colSpan;++c){var cell;if(this.Config.Options.SHOW_WEEK_HEADER&&c===0){cell=document.createElement("TH");this.weekHeaderCells[this.weekHeaderCells.length]=cell;}else if(this.Config.Options.SHOW_WEEK_FOOTER&&c==(this.headerCell.colSpan-1)){cell=document.createElement("TH");this.weekFooterCells[this.weekFooterCells.length]=cell;}else{cell=document.createElement("TD");this.cells[this.cells.length]=cell;YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL]);YAHOO.util.Event.addListener(cell,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(cell,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(cell,"mouseout",this.doCellMouseOut,this);}
row.appendChild(cell);}
this.tbody.appendChild(row);}
this.table.appendChild(this.tbody);};YAHOO.widget.Calendar_Core.prototype.buildShellFooter=function(){};YAHOO.widget.Calendar_Core.prototype.renderShell=function(){this.oDomContainer.appendChild(this.table);this.shellRendered=true;};YAHOO.widget.Calendar_Core.prototype.render=function(){if(!this.shellRendered){this.buildShell();this.renderShell();}
this.resetRenderers();this.cellDates.length=0;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.pageDate);this.renderHeader();this.renderBody(workingDate);this.renderFooter();this.onRender();};YAHOO.widget.Calendar_Core.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar_Core.prototype.renderBody=function(workingDate){this.preMonthDays=workingDate.getDay();if(this.Options.START_WEEKDAY>0){this.preMonthDays-=this.Options.START_WEEKDAY;}
if(this.preMonthDays<0){this.preMonthDays+=7;}
this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekRowIndex=0;for(var c=0;c<this.cells.length;++c){var cellRenderers=new Array();var cell=this.cells[c];this.clearElement(cell);cell.index=c;cell.id=this.id+"_cell"+c;this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];if(workingDate.getDay()==this.Options.START_WEEKDAY){var rowHeaderCell=null;var rowFooterCell=null;if(this.Options.SHOW_WEEK_HEADER){rowHeaderCell=this.weekHeaderCells[weekRowIndex];this.clearElement(rowHeaderCell);}
if(this.Options.SHOW_WEEK_FOOTER){rowFooterCell=this.weekFooterCells[weekRowIndex];this.clearElement(rowFooterCell);}
if(this.Options.HIDE_BLANK_WEEKS&&this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){continue;}else{if(rowHeaderCell){this.renderRowHeader(workingDate,rowHeaderCell);}
if(rowFooterCell){this.renderRowFooter(workingDate,rowFooterCell);}}}
var renderer=null;if(workingDate.getFullYear()==this.today.getFullYear()&&workingDate.getMonth()==this.today.getMonth()&&workingDate.getDate()==this.today.getDate()){cellRenderers[cellRenderers.length]=this.renderCellStyleToday;}
if(this.isDateOOM(workingDate)){cellRenderers[cellRenderers.length]=this.renderCellNotThisMonth;}else{for(var r=0;r<this.renderStack.length;++r){var rArray=this.renderStack[r];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar_Core.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(r,1);}
break;case YAHOO.widget.Calendar_Core.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(r,1);}
break;case YAHOO.widget.Calendar_Core.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(r,1);}}
break;case YAHOO.widget.Calendar_Core.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
break;}
if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=this.renderCellStyleSelected;}
if(this.minDate){this.minDate=YAHOO.widget.DateMath.clearTime(this.minDate);}
if(this.maxDate){this.maxDate=YAHOO.widget.DateMath.clearTime(this.maxDate);}
if((this.minDate&&(workingDate.getTime()<this.minDate.getTime()))||(this.maxDate&&(workingDate.getTime()>this.maxDate.getTime()))){cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=this.renderCellDefault;}
for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call(this,workingDate,cell)==YAHOO.widget.Calendar_Core.STOP_RENDER){break;}}
workingDate=YAHOO.widget.DateMath.add(workingDate,YAHOO.widget.DateMath.DAY,1);if(workingDate.getDay()==this.Options.START_WEEKDAY){weekRowIndex+=1;}
YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);if(c>=0&&c<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);}
if((c%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}
if(((c+1)%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}
var postDays=this.postMonthDays;if(postDays>=7&&this.Options.HIDE_BLANK_WEEKS){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
if(c>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(e,cal){for(var c in cal.cells){c=null;}
cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;}
YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_HEADER);var useYear=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)){useYear=workingDate.getFullYear();}
var weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useYear,this.Options.START_WEEKDAY);cell.innerHTML=weekNum;if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML="";var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.addMonths=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.addYears=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar_Core.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar_Core.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar_Core.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar_Core.prototype.reset=function(){this.selectedDates.length=0;this.selectedDates=this._selectedDates.concat();this.pageDate=new Date(this._pageDate.getTime());this.onReset();};YAHOO.widget.Calendar_Core.prototype.clear=function(){this.selectedDates.length=0;this.pageDate=new Date(this.today.getTime());this.onClear();};YAHOO.widget.Calendar_Core.prototype.select=function(date){this.onBeforeSelect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(this._indexOfSelectedFieldArray(toSelect)==-1){this.selectedDates[this.selectedDates.length]=toSelect;}}
if(this.parent){this.parent.sync(this);}
this.onSelect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.selectCell=function(cellIndex){this.onBeforeSelect();this.cells=this.tbody.getElementsByTagName("TD");var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();this.selectedDates.push(selectDate);if(this.parent){this.parent.sync(this);}
this.renderCellStyleSelected(dCellDate,cell);this.onSelect();this.doCellMouseOut.call(cell,null,this);return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselect=function(date){this.onBeforeDeselect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];var index=this._indexOfSelectedFieldArray(toSelect);if(index!=-1){this.selectedDates.splice(index,1);}}
if(this.parent){this.parent.sync(this);}
this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectCell=function(i){this.onBeforeDeselect();this.cells=this.tbody.getElementsByTagName("TD");var cell=this.cells[i];var cellDate=this.cellDates[i];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.pageDate.getMonth()==dCellDate.getMonth()&&this.pageDate.getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}
this.selectedDates.splice(cellDateIndex,1);}
if(this.parent){this.parent.sync(this);}
this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var count=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this);}
if(count>0){this.onDeselect();}
return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(date){var returnDate=new Array();if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
return returnDate;};YAHOO.widget.Calendar_Core.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar_Core.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
return match;};YAHOO.widget.Calendar_Core.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;for(var s=0;s<this.selectedDates.length;++s){var sArray=this.selectedDates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
return selected;};YAHOO.widget.Calendar_Core.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.pageDate.getMonth()){isOOM=true;}
return isOOM;};YAHOO.widget.Calendar_Core.prototype.onBeforeSelect=function(){if(!this.Options.MULTI_SELECT){this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}};YAHOO.widget.Calendar_Core.prototype.onSelect=function(){};YAHOO.widget.Calendar_Core.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar_Core.prototype.onDeselect=function(){};YAHOO.widget.Calendar_Core.prototype.onChangePage=function(){var me=this;this.renderHeader();if(this.renderProcId){clearTimeout(this.renderProcId);}
this.renderProcId=setTimeout(function(){me.render();me.renderProcId=null;},1);};YAHOO.widget.Calendar_Core.prototype.onRender=function(){};YAHOO.widget.Calendar_Core.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar_Core.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar_Core.prototype.validate=function(){return true;};YAHOO.widget.Calendar_Core.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar_Core.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar_Core.DATE;}
return rArray;};YAHOO.widget.Calendar_Core.prototype._parseDates=function(sDates){var aReturn=new Array();var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
return aReturn;};YAHOO.widget.Calendar_Core.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=new Array();results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
return results;};YAHOO.widget.Calendar_Core.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar_Core.prototype.clearElement=function(cell){cell.innerHTML="&nbsp;";cell.className="";};YAHOO.widget.Calendar_Core.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar_Core.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar_Core.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar_Core.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar_Core.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar_Core.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar_Core.MONTH,[month],fnRender);};YAHOO.widget.Calendar_Core.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar_Core.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar_Core.setCssClasses=function(element,aStyles){element.className="";var className=aStyles.join(" ");element.className=className;};YAHOO.widget.Calendar_Core.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar_Core.prototype.setMonth=function(month){this.pageDate.setMonth(month);};YAHOO.widget.Calendar_Core.prototype.setYear=function(year){this.pageDate.setFullYear(year);};YAHOO.widget.Calendar_Core.prototype.getSelectedDates=function(){var returnDates=new Array();for(var d=0;d<this.selectedDates.length;++d){var dateArray=this.selectedDates[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort();return returnDates;};YAHOO.widget.Calendar_Core._getBrowser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1)
return'opera';else if(ua.indexOf('msie')!=-1)
return'ie';else if(ua.indexOf('safari')!=-1)
return'safari';else if(ua.indexOf('gecko')!=-1)
return'gecko';else
return false;}
YAHOO.widget.Calendar_Core.prototype.toString=function(){return"Calendar_Core "+this.id;}
YAHOO.widget.Cal_Core=YAHOO.widget.Calendar_Core;YAHOO.widget.Calendar=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar.prototype.buildShell=function(){this.border=document.createElement("DIV");this.border.className=this.Style.CSS_CONTAINER;this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.border.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();};YAHOO.widget.Calendar.prototype.renderShell=function(){this.border.appendChild(this.table);this.oDomContainer.appendChild(this.border);this.shellRendered=true;};YAHOO.widget.Calendar.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.previousMonth);}
this.linkLeft=document.createElement("A");this.linkLeft.innerHTML="&nbsp;";YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.previousMonth,this,true);this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.nextMonth);}
this.linkRight=document.createElement("A");this.linkRight.innerHTML="&nbsp;";YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.nextMonth,this,true);this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;headerContainer.appendChild(this.linkLeft);headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));headerContainer.appendChild(this.linkRight);this.headerCell.appendChild(headerContainer);};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(pageCount,id,containerId,monthyear,selected){if(arguments.length>0){this.init(pageCount,id,containerId,monthyear,selected);}}
YAHOO.widget.CalendarGroup.prototype.init=function(pageCount,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p<pageCount;++p){var cal=this.constructChild(id+"_"+p,this.containerId+"_"+p,monthyear,selected);cal.parent=this;cal.index=p;cal.pageDate.setMonth(cal.pageDate.getMonth()+p);cal._pageDate=new Date(cal.pageDate.getFullYear(),cal.pageDate.getMonth(),cal.pageDate.getDate());this.pages.push(cal);}
this.doNextMonth=function(e,calGroup){calGroup.nextMonth();};this.doPreviousMonth=function(e,calGroup){calGroup.previousMonth();};};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){for(var p=0;p<this.pageCount;++p){this.pages[p][fnName]=fn;}}
YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){for(var p=0;p<this.pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}}
YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,monthyear,selected){return new YAHOO.widget.Calendar_Core(id,containerId,monthyear,selected);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];if((cal.pageDate.getMonth()+1)==1&&p>0)
{year+=1;}
cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.render();}};YAHOO.widget.CalendarGroup.prototype.select=function(date){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.select(date);}
return ret;};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.selectCell(cellIndex);}
return ret;};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.deselect(date);}
return ret;};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.deselectAll();}
return ret;};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.deselectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p)
{var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.sync=function(caller){var calendar;if(caller)
{this.selectedDates=caller.selectedDates.concat();}else{var hash=new Object();var combinedDates=new Array();for(var p=0;p<this.pages.length;++p)
{calendar=this.pages[p];var values=calendar.selectedDates;for(var v=0;v<values.length;++v)
{var valueArray=values[v];hash[valueArray.toString()]=valueArray;}}
for(var val in hash)
{combinedDates[combinedDates.length]=hash[val];}
this.selectedDates=combinedDates.concat();}
for(p=0;p<this.pages.length;++p)
{calendar=this.pages[p];if(!calendar.Options.MULTI_SELECT){calendar.clearAllBodyCellStyles(calendar.Config.Style.CSS_CELL_SELECTED);}
calendar.selectedDates=this.selectedDates.concat();}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=new Array();for(var d=0;d<this.selectedDates.length;++d)
{var dateArray=this.selectedDates[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort();return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.wireEvent=function(eventName,fn){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal[eventName]=fn;}};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;}
YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up_Cal=function(id,containerId,monthyear,selected){if(arguments.length>0)
{this.init(id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.index==0){if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth);}
this.linkLeft=document.createElement("A");this.linkLeft.innerHTML="&nbsp;";this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth,this.parent);headerContainer.appendChild(this.linkLeft);}
headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));if(this.index==1){if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.parent.doNextMonth);}
this.linkRight=document.createElement("A");this.linkRight.innerHTML="&nbsp;";this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.parent.doNextMonth,this.parent);headerContainer.appendChild(this.linkRight);}
this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar2up=function(id,containerId,monthyear,selected){if(arguments.length>0)
{this.buildWrapper(containerId);this.init(2,id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar2up.prototype=new YAHOO.widget.CalendarGroup();YAHOO.widget.Calendar2up.CSS_2UPWRAPPER="yui-cal2upwrapper";YAHOO.widget.Calendar2up.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.Calendar2up.CSS_2UPCONTAINER="cal2up";YAHOO.widget.Calendar2up.CSS_2UPTITLE="title";YAHOO.widget.Calendar2up.CSS_2UPCLOSE="close-icon";YAHOO.widget.Calendar2up.prototype.constructChild=function(id,containerId,monthyear,selected){var cal=new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);return cal;};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);outerContainer.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var innerContainer=document.createElement("DIV");innerContainer.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;innerContainer.id=containerId+"_inner";var cal1Container=document.createElement("DIV");cal1Container.id=containerId+"_0";cal1Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;cal1Container.style.marginRight="10px";var cal2Container=document.createElement("DIV");cal2Container.id=containerId+"_1";cal2Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;outerContainer.appendChild(innerContainer);innerContainer.appendChild(cal1Container);innerContainer.appendChild(cal2Container);this.innerContainer=innerContainer;this.outerContainer=outerContainer;}
YAHOO.widget.Calendar2up.prototype.render=function(){this.renderHeader();YAHOO.widget.CalendarGroup.prototype.render.call(this);this.renderFooter();};YAHOO.widget.Calendar2up.prototype.renderHeader=function(){if(!this.title){this.title="";}
if(!this.titleDiv)
{this.titleDiv=document.createElement("DIV");if(this.title=="")
{this.titleDiv.style.display="none";}}
this.titleDiv.className=YAHOO.widget.Calendar2up.CSS_2UPTITLE;this.titleDiv.innerHTML=this.title;if(this.outerContainer.style.position=="absolute")
{var linkClose=document.createElement("A");linkClose.href="javascript:void(null)";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this);var imgClose=document.createElement("IMG");imgClose.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.linkClose=linkClose;this.titleDiv.appendChild(linkClose);}
this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild);}
YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal)
{cal=this;}
cal.outerContainer.style.display="none";}
YAHOO.widget.Calendar2up.prototype.renderFooter=function(){}
YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._expandAnim=type;}},setCollapseAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._collapseAnim=type;}},animateExpand:function(el){if(this._expandAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){tree.expandComplete();});if(a){++this._animCount;a.animate();}
return true;}
return false;},animateCollapse:function(el){if(this._collapseAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){tree.collapseComplete();});if(a){++this._animCount;a.animate();}
return true;}
return false;},expandComplete:function(){--this._animCount;},collapseComplete:function(){--this._animCount;},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}
this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);},draw:function(){var html=this.root.getHtml();this.getEl().innerHTML=html;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}
return this._el;},regNode:function(node){this._nodes[node.index]=node;},getRoot:function(){return this.root;},setDynamicLoad:function(fnDataLoader,iconMode){this.root.setDynamicLoad(fnDataLoader,iconMode);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(nodeIndex){var n=this._nodes[nodeIndex];return(n)?n:null;},getNodeByProperty:function(property,value){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){return n;}}
return null;},getNodesByProperty:function(property,value){var values=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){values.push(n);}}
return(values.length)?values:null;},removeNode:function(node,autoRefresh){if(node.isRoot()){return false;}
var p=node.parent;if(p.parent){p=p.parent;}
this._deleteNode(node);if(autoRefresh&&p&&p.childrenRendered){p.refresh();}
return true;},removeChildren:function(node){while(node.children.length){this._deleteNode(node.children[0]);}
node.childrenRendered=false;node.dynamicLoadComplete=false;node.expand();node.collapse();},_deleteNode:function(node){this.removeChildren(node);this.popNode(node);},popNode:function(node){var p=node.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=node){a[a.length]=p.children[i];}}
p.children=a;p.childrenRendered=false;if(node.previousSibling){node.previousSibling.nextSibling=node.nextSibling;}
if(node.nextSibling){node.nextSibling.previousSibling=node.previousSibling;}
delete this._nodes[node.index];},toString:function(){return"TreeView "+this.id;},generateId:function(el){var id=el.id;if(!id){id="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;YAHOO.widget.TreeView.counter++;}
return id;},onExpand:function(node){null;},onCollapse:function(node){null;}};YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(treeId){var t=YAHOO.widget.TreeView.trees[treeId];return(t)?t:null;};YAHOO.widget.TreeView.getNode=function(treeId,nodeIndex){var t=YAHOO.widget.TreeView.getTree(treeId);return(t)?t.getNodeByIndex(nodeIndex):null;};YAHOO.widget.TreeView.addHandler=function(el,sType,fn,capture){capture=(capture)?true:false;if(el.addEventListener){el.addEventListener(sType,fn,capture);}else if(el.attachEvent){el.attachEvent("on"+sType,fn);}else{el["on"+sType]=fn;}};YAHOO.widget.TreeView.preload=function(prefix){prefix=prefix||"ygtv";var styles=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<styles.length;++i){sb[sb.length]='<span class="'+prefix+styles[i]+'">&#160;</span>';}
var f=document.createElement("DIV");var s=f.style;s.position="absolute";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,_type:"Node",init:function(oData,oParent,expanded){this.data=oData;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=expanded;if(oParent){oParent.appendChild(this);}},applyParent:function(parentNode){if(!parentNode){return false;}
this.tree=parentNode.tree;this.parent=parentNode;this.depth=parentNode.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}
if(!this.multiExpand){this.multiExpand=parentNode.multiExpand;}
this.tree.regNode(this);parentNode.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}
return true;},appendChild:function(childNode){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=childNode;childNode.previousSibling=sib;}
this.children[this.children.length]=childNode;childNode.applyParent(this);return childNode;},appendTo:function(parentNode){return parentNode.appendChild(this);},insertBefore:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
var refIndex=node.isChildOf(p);p.children.splice(refIndex,0,this);if(node.previousSibling){node.previousSibling.nextSibling=this;}
this.previousSibling=node.previousSibling;this.nextSibling=node;node.previousSibling=this;this.applyParent(p);}
return this;},insertAfter:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
var refIndex=node.isChildOf(p);if(!node.nextSibling){return this.appendTo(p);}
p.children.splice(refIndex+1,0,this);node.nextSibling.previousSibling=this;this.previousSibling=node;this.nextSibling=node.nextSibling;node.nextSibling=this;this.applyParent(p);}
return this;},isChildOf:function(parentNode){if(parentNode&&parentNode.children){for(var i=0,len=parentNode.children.length;i<len;++i){if(parentNode.children[i]===this){return i;}}}
return-1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl())){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl())){this.getChildrenEl().style.display="none";}},getElId:function(){return"ygtv"+this.index;},getChildrenElId:function(){return"ygtvc"+this.index;},getToggleElId:function(){return"ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return"YAHOO.widget.TreeView.getNode(\'"+this.tree.id+"\',"+
this.index+").toggle()";},collapse:function(){if(!this.expanded){return;}
var ret=this.tree.onCollapse(this);if("undefined"!=typeof ret&&!ret){return;}
if(!this.getEl()){this.expanded=false;return;}
this.hideChildren();this.expanded=false;if(this.hasIcon){this.getToggleEl().className=this.getStyle();}},expand:function(){if(this.expanded){return;}
var ret=this.tree.onExpand(this);if("undefined"!=typeof ret&&!ret){return;}
if(!this.getEl()){this.expanded=true;return;}
if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{null;}
this.expanded=true;if(this.hasIcon){this.getToggleEl().className=this.getStyle();}
if(this.isLoading){this.expanded=false;return;}
if(!this.multiExpand){var sibs=this.getSiblings();for(var i=0;i<sibs.length;++i){if(sibs[i]!=this&&sibs[i].expanded){sibs[i].collapse();}}}
this.showChildren();},getStyle:function(){if(this.isLoading){return"ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var type="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){type=(this.expanded)?"m":"p";}
return"ygtv"+loc+type;}},getHoverStyle:function(){var s=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){s+="h";}
return s;},expandAll:function(){for(var i=0;i<this.children.length;++i){var c=this.children[i];if(c.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else if(!c.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{c.expand();c.expandAll();}}},collapseAll:function(){for(var i=0;i<this.children.length;++i){this.children[i].collapse();this.children[i].collapseAll();}},setDynamicLoad:function(fnDataLoader,iconMode){if(fnDataLoader){this.dataLoader=fnDataLoader;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}
if(iconMode){this.iconMode=iconMode;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){var lazy=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return lazy;},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(checkForLazyLoad){return(this.children.length>0||(checkForLazyLoad&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){var sb=[];sb[sb.length]='<div class="ygtvitem" id="'+this.getElId()+'">';sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]='</div>';return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]='<div class="ygtvchildren"';sb[sb.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded){sb[sb.length]=' style="display:none;"';}
sb[sb.length]='>';if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){sb[sb.length]=this.renderChildren();}
sb[sb.length]='</div>';return sb.join("");},renderChildren:function(){var node=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){node.dataLoader(node,function(){node.loadComplete();});},10);}else if(this.tree.root.dataLoader){setTimeout(function(){node.tree.root.dataLoader(node,function(){node.loadComplete();});},10);}else{return"Error: data loader not found or not specified.";}
return"";}else{return this.completeRender();}},completeRender:function(){var sb=[];for(var i=0;i<this.children.length;++i){this.children[i].childrenRendered=false;sb[sb.length]=this.children[i].getHtml();}
this.childrenRendered=true;return sb.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand();this.tree.locked=false;},getAncestor:function(depth){if(depth>=this.depth||depth<0){return null;}
var p=this.parent;while(p.depth>depth){p=p.parent;}
return p;},getDepthStyle:function(depth){return(this.getAncestor(depth).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return"Node ("+this.index+")";}};YAHOO.widget.RootNode=function(oTree){this.init(null,null,true);this.tree=oTree;};YAHOO.widget.RootNode.prototype=new YAHOO.widget.Node();YAHOO.widget.RootNode.prototype.getNodeHtml=function(){return"";};YAHOO.widget.RootNode.prototype.toString=function(){return"RootNode";};YAHOO.widget.RootNode.prototype.loadComplete=function(){this.tree.draw();};YAHOO.widget.TextNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}};YAHOO.widget.TextNode.prototype=new YAHOO.widget.Node();YAHOO.widget.TextNode.prototype.labelStyle="ygtvlabel";YAHOO.widget.TextNode.prototype.labelElId=null;YAHOO.widget.TextNode.prototype.label=null;YAHOO.widget.TextNode.prototype.setUpLabel=function(oData){if(typeof oData=="string"){oData={label:oData};}
this.label=oData.label;if(oData.href){this.href=oData.href;}
if(oData.target){this.target=oData.target;}
if(oData.style){this.labelStyle=oData.style;}
this.labelElId="ygtvlabelel"+this.index;};YAHOO.widget.TextNode.prototype.getLabelEl=function(){return document.getElementById(this.labelElId);};YAHOO.widget.TextNode.prototype.getNodeHtml=function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'">&#160;</td>';}
var getNode='YAHOO.widget.TreeView.getNode(\''+
this.tree.id+'\','+this.index+')';sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]=getNode+'.getStyle()"';}
sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'">';sb[sb.length]='&#160;';sb[sb.length]='</td>';sb[sb.length]='<td>';sb[sb.length]='<a';sb[sb.length]=' id="'+this.labelElId+'"';sb[sb.length]=' class="'+this.labelStyle+'"';sb[sb.length]=' href="'+this.href+'"';sb[sb.length]=' target="'+this.target+'"';sb[sb.length]=' onclick="return '+getNode+'.onLabelClick('+getNode+')"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getStyle()"';}
sb[sb.length]=' >';sb[sb.length]=this.label;sb[sb.length]='</a>';sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");};YAHOO.widget.TextNode.prototype.onLabelClick=function(me){null;};YAHOO.widget.TextNode.prototype.toString=function(){return"TextNode ("+this.index+") "+this.label;};YAHOO.widget.MenuNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}
this.multiExpand=false;};YAHOO.widget.MenuNode.prototype=new YAHOO.widget.TextNode();YAHOO.widget.MenuNode.prototype.toString=function(){return"MenuNode ("+this.index+") "+this.label;};YAHOO.widget.HTMLNode=function(oData,oParent,expanded,hasIcon){if(oData){this.init(oData,oParent,expanded);this.initContent(oData,hasIcon);}};YAHOO.widget.HTMLNode.prototype=new YAHOO.widget.Node();YAHOO.widget.HTMLNode.prototype.contentStyle="ygtvhtml";YAHOO.widget.HTMLNode.prototype.contentElId=null;YAHOO.widget.HTMLNode.prototype.content=null;YAHOO.widget.HTMLNode.prototype.initContent=function(oData,hasIcon){if(typeof oData=="string"){oData={html:oData};}
this.html=oData.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=hasIcon;};YAHOO.widget.HTMLNode.prototype.getContentEl=function(){return document.getElementById(this.contentElId);};YAHOO.widget.HTMLNode.prototype.getNodeHtml=function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'">&#160;</td>';}
if(this.hasIcon){sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getStyle()"';}
sb[sb.length]='>&#160;</td>';}
sb[sb.length]='<td';sb[sb.length]=' id="'+this.contentElId+'"';sb[sb.length]=' class="'+this.contentStyle+'"';sb[sb.length]=' >';sb[sb.length]=this.html;sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");};YAHOO.widget.HTMLNode.prototype.toString=function(){return"HTMLNode ("+this.index+")";};YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(type,el,callback){if(YAHOO.widget[type]){return new YAHOO.widget[type](el,callback);}else{return null;}},isValid:function(type){return(YAHOO.widget[type]);}};}();YAHOO.widget.TVFadeIn=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var tvanim=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var tvanim=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};function DisplayManager(){this.topZIndex=1000;}
DisplayManager._instance=new DisplayManager();DisplayManager.getInstance=function(){return DisplayManager._instance;};DisplayManager.prototype.getTopZIndex=function(){this.topZIndex=this.topZIndex+1;return this.topZIndex;};DisplayManager.prototype.getMaxZindex=function(){return this.topZIndex;};DisplayManager.prototype._getMaxZindex=function(){var allElems=document.getElementsByTagName("*");var maxZIndex=0;var str="";for(var i=0;i<allElems.length;i++){var elem=allElems[i];var cStyle=null;str+=elem.tagName+" : ";if(elem.currentStyle){cStyle=elem.currentStyle;}
else if(document.defaultView&&document.defaultView.getComputedStyle){cStyle=document.defaultView.getComputedStyle(elem,"");}
var sNum;if(cStyle){sNum=Number(cStyle.zIndex);}else{sNum=Number(elem.style.zIndex);}
str+=sNum+"\n";if(!isNaN(sNum)){maxZIndex=Math.max(maxZIndex,sNum);}}
this.topZIndex=maxZIndex;};DisplayManager.prototype.onload=function(){YAHOO.util.Event.addListener(window,"load",DisplayManager.prototype._getMaxZindex);};function MessageHelper(){this._instance=null;}
MessageHelper.prototype.getMessage=MessageHelper_getMessage;MessageHelper.prototype.completeAllParams=MessageHelper_completeAllParams;MessageHelper.prototype.completeParam=MessageHelper_completeParam;MessageHelper._instance=new MessageHelper();MessageHelper.getInstance=function(){return MessageHelper._instance;};function MessageHelper_getMessage(message,param1,param2,param3,param4,param5){if(message!==null){message=this.completeAllParams(message,param1,param2,param3,param4,param5);}
return message;}
function MessageHelper_completeAllParams(message,param1,param2,param3,param4,param5){message=this.completeParam(message,param1,0);message=this.completeParam(message,param2,1);message=this.completeParam(message,param3,2);message=this.completeParam(message,param4,3);message=this.completeParam(message,param5,4);return message;}
function MessageHelper_completeParam(message,param,index){if(param!==null){var strToFind="{"+index+"}";var idx=message.indexOf(strToFind);while(idx>-1){message=message.replace(strToFind,param);idx=message.indexOf(strToFind);}}
return message;}
function SweetDevRiaLog(level,logger){this._log=new Log(level,logger,null);}
SweetDevRiaLog.prototype.getMessage=SweetDevRiaLog_getMessage;SweetDevRiaLog.prototype.debug=SweetDevRiaLog_debug;SweetDevRiaLog.prototype.info=SweetDevRiaLog_info;SweetDevRiaLog.prototype.warn=SweetDevRiaLog_warn;SweetDevRiaLog.prototype.error=SweetDevRiaLog_error;SweetDevRiaLog.prototype.fatal=SweetDevRiaLog_fatal;function SweetDevRiaLog_getMessage(message,param1,param2,param3,param4,param5){var messageHelper=MessageHelper.getInstance();message=messageHelper.getMessage(message,param1,param2,param3,param4,param5);return message;}
function SweetDevRiaLog_debug(message,param1,param2,param3,param4,param5){message=SweetDevRiaLog_debug.caller.name+" :: "+message;message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.debug(message);}
function SweetDevRiaLog_info(message,param1,param2,param3,param4,param5){message=SweetDevRiaLog_info.caller.name+" :: "+message;message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.info(message);}
function SweetDevRiaLog_warn(message,param1,param2,param3,param4,param5){message=SweetDevRiaLog_warn.caller.name+" :: "+message;message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.warn(message);}
function SweetDevRiaLog_error(message,param1,param2,param3,param4,param5){message=SweetDevRiaLog_error.caller.name+" :: "+message;message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.error(message);}
function SweetDevRiaLog_fatal(message,param1,param2,param3,param4,param5){message=SweetDevRiaLog_fatal.caller.name+" :: "+message;message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.fatal(message);}
function DomHelper(){null;}
DomHelper.get=DomHelper_get;DomHelper.getChild=DomHelper_getChild;DomHelper.removeChild=DomHelper_removeChild;DomHelper.removeNode=DomHelper_removeNode;DomHelper.removeChildren=DomHelper_removeChildren;DomHelper.getIntersect=DomHelper_getIntersect;DomHelper.getParent=DomHelper_getParent;DomHelper.insertChild=DomHelper_insertChild;DomHelper.insertChildAtFirst=DomHelper_insertChildAtFirst;DomHelper.insertChildAtIndex=DomHelper_insertChildAtIndex;DomHelper.getPos=DomHelper_getPos;DomHelper.addClassName=DomHelper_addClassName;DomHelper.removeClassName=DomHelper_removeClassName;DomHelper.hasClassName=DomHelper_hasClassName;DomHelper.cssClassExist=DomHelper_cssClassExist;DomHelper.indexCssStyles=DomHelper_indexCssStyles;DomHelper.getProperty=DomHelper_getProperty;DomHelper.getX=DomHelper_getX;DomHelper.getY=DomHelper_getY;DomHelper.getXY=DomHelper_getXY;DomHelper.setX=DomHelper_setX;DomHelper.setY=DomHelper_setY;DomHelper.setXY=DomHelper_setXY;DomHelper.getStyle=DomHelper_getStyle;DomHelper.setStyle=DomHelper_setStyle;DomHelper.parsePx=DomHelper_parsePx;function DomHelper_get(elementId){return YAHOO.util.Dom.get(elementId);}
function DomHelper_getX(element){return YAHOO.util.Dom.getX(element);}
function DomHelper_getY(element){return YAHOO.util.Dom.getY(element);}
function DomHelper_getXY(element){return[DomHelper.getX(element),DomHelper.getY(element)];}
function DomHelper_setX(element,x){YAHOO.util.Dom.setX(element,x);}
function DomHelper_setY(element,y){YAHOO.util.Dom.setY(element,y);}
function DomHelper_setXY(element,xy){YAHOO.util.Dom.setXY(element,xy);}
function DomHelper_getStyle(element,propertyName){return YAHOO.util.Dom.getStyle(element,propertyName);}
function DomHelper_setStyle(element,propertyName,propertyValue){YAHOO.util.Dom.setStyle(element,propertyName,propertyValue);}
function DomHelper_getIntersect(elemId1,elemId2){var elem1=DomHelper.get(elemId1);var elem2=DomHelper.get(elemId2);var region1=YAHOO.util.Region.getRegion(elem1);var region2=YAHOO.util.Region.getRegion(elem2);var intersect=region1.intersect(region2);if(intersect!==null){var area=intersect.getArea();if(area&&area>0){return area;}
else{return null;}}
return null;}
function DomHelper_isIntersect(elemId1,elemId2){return(DomHelper_getIntersect(elemId1,elemId2)!==null);}
function DomHelper_removeChild(elem,childId){var child=DomHelper.getChild(elem,childId);if(child!==null){elem.removeChild(child);return true;}
return false;}
function DomHelper_removeNode(elem){elem.parentNode.removeChild(elem);}
function DomHelper_removeChildren(elem){if(elem.childNodes!==null){while(elem.childNodes.length){DomHelper_removeNode(elem.childNodes[0]);}}}
function DomHelper_getPos(elem,childId,textNode){if(textNode===null){textNode=false;}
var pos=0;var children=elem.childNodes;for(var i=0;i<children.length;i++){var child=children[i];if((child.nodeType!=3)||textNode){if(child.id==childId){return pos;}
pos++;}}
return null;}
function DomHelper_getChild(elem,childId){var children=elem.childNodes;if(children!==null){for(var i=0;i<children.length;i++){var child=children[i];if(child.id==childId){return child;}}}
return null;}
function DomHelper_insertChildAtIndex(parentNode,childtoAdd,index){var children=parentNode.childNodes;if(index<0)index=0;if(children!==null){if(index>=children.length){parentNode.appendChild(childtoAdd);}
else{for(var i=0;i<children.length;i++){var child=children[i];if(index==i){parentNode.insertBefore(childtoAdd,child);}}}}
else{parentNode.appendChild(childtoAdd);}}
function DomHelper_insertChild(parentNode,childtoAdd){parentNode.appendChild(childtoAdd);return true;}
function DomHelper_insertChildAtFirst(parentNode,childtoAdd){return DomHelper.insertChildAtIndex(parentNode,childtoAdd,0);}
function DomHelper_getParent(elem){return elem.parentNode;}
function DomHelper_parsePx(value){if(typeof(value)=="string"){value=value.toLowerCase();var index=value.indexOf("px");if(index){value=value.substring(0,index);}
value=parseInt(value);}
return value;}
function DomHelper_addClassName(element,className){YAHOO.util.Dom.addClass(element,className);}
function DomHelper_removeClassName(element,className){YAHOO.util.Dom.removeClass(element,className);}
function DomHelper_hasClassName(element,className){return YAHOO.util.Dom.hasClass(element,className);}
function getAllSheets(){if(document.getElementsByTagName){var Lt=document.getElementsByTagName('LINK');var St=document.getElementsByTagName('STYLE');}else{return[];}
for(var x=0,os=[];Lt[x];x++){var rel=null;if(Lt[x].rel){rel=Lt[x].rel;}else if(Lt[x].getAttribute){rel=Lt[x].getAttribute('rel');}else{rel='';}
if(typeof(rel)=='string'&&rel.toLowerCase().indexOf('style')+1){os[os.length]=Lt[x];}}
for(var x2=0;St[x2];x2++){os[os.length]=St[x2];}
return os;}
document.cssStyles=null;function DomHelper_indexCssStyles(){if(document.cssStyles===null){document.cssStyles={};var styleSheets=document.styleSheets;if(styleSheets===null){styleSheets=getAllSheets();}
for(var i=0;i<styleSheets.length;i++){var cssRules=styleSheets[i].cssRules;if(!cssRules){cssRules=styleSheets[i].rules;}
if(cssRules){for(var j=0;j<cssRules.length;j++){var style=cssRules[j];document.cssStyles[style.selectorText]=style;}}}}}
function DomHelper_cssClassExist(cssClassName){var styleClass=document.cssStyles[cssClassName];return((styleClass!==null)&&(styleClass!='undefined'));}
function DomHelper_getProperty(className,propertyName){DomHelper.indexCssStyles();var value=null;var cssClass=document.cssStyles["."+className];if(cssClass){if(cssClass.style.getPropertyValue)
value=cssClass.style.getPropertyValue(propertyName);else{value=cssClass.style[propertyName];}}
return value;}
function HoverHack4IE(){this.csshoverReg=null;this.currentSheet=null;this.doc=window.document;this.hoverEvents=[];this.activators={onhover:{on:'onmouseover',off:'onmouseout'}};}
HoverHack4IE._instance=new HoverHack4IE();HoverHack4IE.getInstance=function(){return HoverHack4IE._instance;};HoverHack4IE.prototype.parseStylesheets=function(){if(!/MSIE(5|6)/.test(navigator.userAgent))return;var sheets=this.doc.styleSheets,l=sheets.length;for(var i=0;i<l;i++)
this.parseStylesheet(sheets[i]);};HoverHack4IE.prototype.unhookHoverEvents=function(){if(!/MSIE(5|6)/.test(navigator.userAgent))return;for(var e,i=0;i<this.hoverEvents.length;i++){e=this.hoverEvents[i];e.node.detachEvent(e.type,e.handler);}};HoverHack4IE.prototype.parseStylesheet=function(sheet){if(sheet.imports){try{var imports=sheet.imports;var l=imports.length;for(var i=0;i<l;i++)this.parseStylesheet(sheet.imports[i]);}catch(securityException){}}
try{var rules=(this.currentSheet=sheet).rules;var le=rules.length;for(var j=0;j<le;j++)this.parseCSSRule(rules[j]);}catch(securityException){}};HoverHack4IE.prototype.parseCSSRule=function(rule){var select=rule.selectorText,style=rule.style.cssText;if(!this.csshoverReg.test(select)||!style)return;var pseudo=select.replace(/[^:]+:([a-z-]+).*/i,'on$1');var newSelect=select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi,'.$2'+pseudo);var className=(/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1];var affected=select.replace(/:(hover|active).*$/,'');var elements=this.getElementsBySelect(affected);if(elements.length===0)return;this.currentSheet.addRule(newSelect,style);for(var i=0;i<elements.length;i++)
new HoverElement(elements[i],className,this.activators[pseudo]);};function HoverElement(node,className,events){if(!node.hovers)node.hovers={};if(node.hovers[className])return;node.hovers[className]=true;this.hookHoverEvent(node,events.on,function(){node.className+=' '+className;});this.hookHoverEvent(node,events.off,function(){node.className=node.className.replace(new RegExp('\\s+'+className,'g'),'');});}
HoverElement.prototype.hookHoverEvent=function(node,type,handler){node.attachEvent(type,handler);HoverHack4IE.getInstance().hoverEvents[HoverHack4IE.getInstance().hoverEvents.length]={node:node,type:type,handler:handler};};HoverHack4IE.prototype.getElementsBySelect=function(rule){var parts,nodes=[this.doc];parts=rule.split(' ');for(var i=0;i<parts.length;i++){nodes=this.getSelectedNodes(parts[i],nodes);}return nodes;};HoverHack4IE.prototype.getSelectedNodes=function(select,elements){var result,node,nodes=[];var identify=(/\#([a-z0-9_-]+)/i).exec(select);if(identify){var element=this.doc.getElementById(identify[1]);return element?[element]:nodes;}
var classname=(/\.([a-z0-9_-]+)/i).exec(select);var tagName=select.replace(/(\.|\#|\:)[a-z0-9_-]+/i,'');var classReg=classname?new RegExp('\\b'+classname[1]+'\\b'):false;for(var i=0;i<elements.length;i++){result=tagName?elements[i].all.tags(tagName):elements[i].all;for(var j=0;j<result.length;j++){node=result[j];if(classReg&&!classReg.test(node.className))continue;nodes[nodes.length]=node;}}
return nodes;};function EventHelper(){null;}
EventHelper.addListener=EventHelper_addListener;EventHelper.removeListener=EventHelper_removeListener;EventHelper.getEvent=EventHelper_getEvent;EventHelper.customEvent=EventHelper_customEvent;EventHelper.fireMouseEvent=EventHelper_fireMouseEvent;EventHelper.stopPropagation=EventHelper_stopPropagation;EventHelper.preventDefault=EventHelper_preventDefault;EventHelper.MOUSE_LEFT=1;EventHelper.MOUSE_RIGHT=2;EventHelper.MOUSE_MIDDLE=3;function EventHelper_addListener(element,type,handler,oScope,bOverride){return YAHOO.util.Event.addListener(element,type,handler,oScope,bOverride);}
function EventHelper_removeListener(element,type,handler,index){return YAHOO.util.Event.removeListener(element,type,handler,index);}
function EventHelper_getEvent(evt){if(!evt){evt=window.event;}
evt.src=evt.target;if(!evt.src){evt.src=evt.srcElement;}
if(evt.button){evt.clickedButton=evt.button;if(evt.clickedButton===0){evt.clickedButton=EventHelper.MOUSE_LEFT;}
if(evt.clickedButton===4){evt.clickedButton=EventHelper.MOUSE_MIDDLE;}}else if(evt.which!==null&&evt.which!==undefined){evt.clickedButton=evt.which;if(evt.clickedButton===3){evt.clickedButton=EventHelper.MOUSE_RIGHT;}else if(evt.clickedButton===2){evt.clickedButton=EventHelper.MOUSE_MIDDLE;}}
evt.leftButton=(evt.clickedButton==EventHelper.MOUSE_LEFT);evt.rightButton=(evt.clickedButton==EventHelper.MOUSE_RIGHT);evt.middleButton=(evt.clickedButton==EventHelper.MOUSE_MIDDLE);return evt;}
function EventHelper_customEvent(type,src){return new YAHOO.util.CustomEvent(type,src);}
function EventHelper_fireMouseEvent(element,eventType,x,y,button){if(button===null){button=1;}
var evObj=null;if(document.createEvent){evObj=document.createEvent('MouseEvents');evObj.initMouseEvent(eventType,true,false,window,0,x,y,x,y,false,false,false,false,button,element);element.dispatchEvent(evObj);}else if(document.createEventObject){evObj=document.createEventObject();evObj.clientX=x;evObj.clientY=y;evObj.button=button;element.fireEvent('on'+eventType,evObj);}}
function EventHelper_stopPropagation(event){if(!event)event=window.event;YAHOO.util.Event.stopPropagation(event);}
function EventHelper_preventDefault(evt){if(!evt)evt=window.event;if(evt){if(evt.preventDefault){evt.preventDefault();}
else{evt.returnValue=false;}}}
if(typeof DOMParser=="undefined"){DOMParser=function(){null;};DOMParser.prototype.parseFromString=function(str,contentType){if(typeof ActiveXObject!="undefined"){var d=getMsXmlObject("DomDocument");d.loadXML(str);return d;}else if(typeof XMLHttpRequest!="undefined"){var req=new XMLHttpRequest;req.open("GET","data:"+(contentType||"application/xml")+";charset=utf-8,"+encodeURIComponent(str),false);if(req.overrideMimeType){req.overrideMimeType(contentType);}
req.send(null);return req.responseXML;}};}
function Ajax(id){this.id=id;Ajax.repository[id]=this;this.xmlhttp=null;this.status=null;this.responseText=null;this.responseXML=null;this.callback=null;this.readyState=null;}
Ajax.prototype.send=Ajax_send;Ajax.prototype.post=Ajax_post;Ajax.prototype.get=Ajax_get;Ajax.prototype.reset=Ajax_reset;Ajax.prototype.getResponseText=Ajax_getResponseText;Ajax.prototype.getResponseXML=Ajax_getResponseXML;Ajax.prototype.getStatus=Ajax_getStatus;Ajax.prototype.getReadyState=Ajax_getReadyState;Ajax.prototype.getCallback=Ajax_getCallback;Ajax.prototype.setCallback=Ajax_setCallback;Ajax.prototype.bindCallback=Ajax_bindCallback;Ajax.repository={};Ajax.getInstance=function(id){return Ajax.repository[id];};function Ajax_reset(){this.xmlhttp=null;this.status=null;this.responseText=null;this.responseXML=null;this.callback=null;this.readyState=null;}
function getMsXmlHttp(){var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var xmlHttp;for(var i=0;i<prefixes.length;i++){try{xmlHttp=new ActiveXObject(prefixes[i]+".XmlHttp");return xmlHttp;}
catch(ex){null;}}
throw new Error("Could not find an installed XML parser");}
function getMsXmlObject(object){var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var xmlHttp;for(var i=0;i<prefixes.length;i++){try{xmlHttp=new ActiveXObject(prefixes[i]+"."+object);return xmlHttp;}
catch(ex){}}
throw new Error("Could not find an installed XML parser");}
function Ajax_getXmlHttpRequest(){var xmlhttp=null;if(typeof ActiveXObject!="undefined"){xmlhttp=getMsXmlObject("XmlHttp");}else{xmlhttp=new XMLHttpRequest();}
return xmlhttp;}
function Ajax_send(method,url,param,callback){this.xmlhttp=Ajax_getXmlHttpRequest();this.xmlhttp.open(method,url,true);this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');this.xmlhttp.onreadystatechange=new Function("Ajax.getInstance (\""+this.id+"\").bindCallback();");this.xmlhttp.send(param);}
function Ajax_post(url,param){return this.send("POST",url,param);}
function Ajax_get(url){return this.send("GET",url,"");}
function Ajax_setRequestHeader(name,value){if(this.xmlhttp){this.xmlhttp.setRequestHeader(name,value);}}
function Ajax_getResponseText(){return this.responseText;}
function Ajax_getResponseXML(){return this.responseXML;}
function Ajax_getStatus(){return this.status;}
function Ajax_setCallback(callback){this.callback=callback;}
function Ajax_getCallback(){return this.callback;}
function Ajax_getReadyState(){return this.readyState;}
function Ajax_bindCallback(){if(this.xmlhttp){this.readyState=this.xmlhttp.readyState;if(this.readyState==4){this.responseText=this.xmlhttp.responseText;this.responseXML=this.xmlhttp.responseXML;try{var xmlParser=new DOMParser();this.responseXML=xmlParser.parseFromString(this.responseText,'text/xml');}
catch(e){this.responseXML.loadXML(this.responseText);}
this.status=this.xmlhttp.status;if(this.callback){this.callback();}}}}
function AjaxPooler(){this.pooler={};this.poolSize=0;}
AjaxPooler._instance=new AjaxPooler();AjaxPooler.getInstance=AjaxPooler_getInstance;AjaxPooler.PREFIXE_ID="AjaxInstance_";function AjaxPooler_getInstance(){var pooler=AjaxPooler._instance;for(var i in pooler.pooler){var ajax=pooler.pooler[i];if(ajax.readyState==4){ajax.reset();return ajax;}}
var newAjax=new Ajax(AjaxPooler.PREFIXE_ID+pooler.poolSize);pooler.pooler[newAjax.id]=newAjax;pooler.poolSize++;return newAjax;}
function ComHelper(){this.callbackRepository={};}
ComHelper.call=ComHelper_call;ComHelper.fireEvent=ComHelper_fireEvent;ComHelper.invoke=ComHelper_invoke;ComHelper.invokesTraitement=ComHelper_invokesTraitement;ComHelper.createXmlInvoke=ComHelper_createXmlInvoke;ComHelper.invokeTraitement=ComHelper_invokeTraitement;ComHelper.callback=ComHelper_callback;ComHelper.fireEvents=ComHelper_fireEvents;ComHelper._instance=new ComHelper();ComHelper.getInstance=function(){return ComHelper._instance;};ComHelper.formatParameter=ComHelper_formatParameter;ComHelper.INVOKES_TAG="Invokes";ComHelper.INVOKE_TAG="Invoke";ComHelper.OBJECT_TAG="Object";ComHelper.METHOD_TAG="Method";ComHelper.PARAM_TAG="Param";ComHelper.OBJECT_ID_ATTR="id";ComHelper.OBJECT_SCOPE_ATTR="scope";ComHelper.METHOD_NAME_ATTR="name";ComHelper.PARAM_TYPE_ATTR="type";ComHelper.INVOKE_XML_PARAM="invokeXml";ComHelper.EVENT_XML_PARAM="eventXml";ComHelper.ID_PAGE="__RiaPageId";ComHelper.PROXY_URL=SweetDevRIAPath+"/RiaController";function ComHelper_invoke(beanId,scope,methodName,args,callback){var comHelper=ComHelper.getInstance();var ajax=AjaxPooler.getInstance();ajax.setCallback(ComHelper_callback);comHelper.callbackRepository[ajax.id]=callback;var invokeXml=ComHelper.createXmlInvoke(beanId,scope,methodName,args);var paramStr=ComHelper.ID_PAGE+"="+window[ComHelper.ID_PAGE]+"&"+ComHelper.INVOKE_XML_PARAM+"="+invokeXml;ajax.post(ComHelper.PROXY_URL,paramStr);return paramStr;}
function ComHelper_fireEvent(evt,callback){var comHelper=ComHelper.getInstance();var ajax=AjaxPooler.getInstance();ajax.setCallback(ComHelper_callback);comHelper.callbackRepository[ajax.id]=callback;var eventXml=evt.toXml();var paramStr=ComHelper.ID_PAGE+"="+window[ComHelper.ID_PAGE]+"&"+ComHelper.EVENT_XML_PARAM+"="+eventXml;ajax.post(ComHelper.PROXY_URL,paramStr);return paramStr;}
function ComHelper_createXmlInvoke(beanId,scope,methodName,args){var xml="";if(beanId&&methodName){xml+="<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";xml+="<"+ComHelper.INVOKES_TAG+">";xml+="<"+ComHelper.INVOKE_TAG+">";xml+="<"+ComHelper.OBJECT_TAG+" "+ComHelper.OBJECT_ID_ATTR+"=\""+beanId+"\"";if(scope){xml+=" "+ComHelper.OBJECT_SCOPE_ATTR+"=\""+scope+"\"";}
xml+="/>";xml+="<"+ComHelper.METHOD_TAG+" "+ComHelper.METHOD_NAME_ATTR+"=\""+methodName+"\"/>";if(args&&args.length){for(var i=0;i<args.length;i++){xml+="<"+ComHelper.PARAM_TAG+">";xml+=ComHelper.formatParameter(args[i]);xml+="</"+ComHelper.PARAM_TAG+">";}}
xml+="</"+ComHelper.INVOKE_TAG+">";xml+="</"+ComHelper.INVOKES_TAG+">";}
return xml;}
function ComHelper_formatParameter(param){var str=null;if(typeof(param)=="object"){if(param.length){str="[";for(var i=0;i<param.length;i++){str+=ComHelper.formatParameter(param[i]);if(i<param.length-1){str+=",";}}
str+="]";}
else{str="{";var hasElement=false;for(var j in param){hasElement=true;str+="\""+j+"\":"+ComHelper.formatParameter(param[j]);str+=",";}
if(hasElement){str=str.substring(0,str.length-1);}
str+="}";}}
else if(typeof(param)=="string"){str="\""+escape(param)+"\"";}
else{str=param+"";}
return str;}
function ComHelper_call(url,args,callback){var comHelper=ComHelper.getInstance();var ajax=AjaxPooler.getInstance();ajax.setCallback(ComHelper_callback);comHelper.callbackRepository[ajax.id]=callback;var argsStr=ComHelper.ID_PAGE+"="+window[ComHelper.ID_PAGE];for(var i in args){argsStr+="&"+i+"="+args[i];}
ajax.post(url,argsStr);return(url+"?"+argsStr);}
function ComHelper_fireEvents(xml){if(xml){var riaEventsNodes=xml.getElementsByTagName(RiaEvent.RIA_EVENTS_TAG);for(var i=0;i<riaEventsNodes.length;i++){var riaEventNodes=riaEventsNodes[i].getElementsByTagName(RiaEvent.RIA_EVENT_TAG);for(var j=0;j<riaEventNodes.length;j++){ComHelper_fireEventNode(riaEventNodes[j]);}}}}
function ComHelper_fireEventNode(node){var idSrc=node.getAttribute(RiaEvent.RIA_EVENT_IDSRC_ATTR);var type=node.getAttribute(RiaEvent.RIA_EVENT_TYPE_ATTR);var params=null;var paramNodes=node.getElementsByTagName(RiaEvent.PARAM_TAG);if(paramNodes){if(paramNodes.length){params={};}
for(var j=0;j<paramNodes.length;j++){var paramNode=paramNodes[j];var id=paramNode.getAttribute("id");var value=null;try{value=eval(paramNode.firstChild.data);}
catch(e){value=paramNode.firstChild.data;}
params[id]=value;}}
var evt=new RiaEvent(type,idSrc,params);if(evt.xml!==null){var xmlParser=new DOMParser();evt.xml=evt.xml.substring(1,evt.xml.length-1);evt.xml=xmlParser.parseFromString(evt.xml,'text/xml');}
var proxy=SweetDevRiaProxy.getInstance();proxy.fireEvent(evt);}
function ComHelper_invokesTraitement(xml){if(xml){var invokesNode=xml.getElementsByTagName(ComHelper.INVOKES_TAG);for(var i=0;i<invokesNode.length;i++){var invokeNodes=invokesNode[i].getElementsByTagName(ComHelper.INVOKE_TAG);for(var j=0;j<invokeNodes.length;j++){ComHelper_invokeTraitement(invokeNodes[j]);}}}}
function ComHelper_callback(){var comHelper=ComHelper.getInstance();ComHelper.invokesTraitement(this.responseXML);ComHelper.fireEvents(this.responseXML);var callback=comHelper.callbackRepository[this.id];if(callback){callback.call(this);}}
function ComHelper_invokeTraitement(invokeNode){var objectNode=invokeNode.getElementsByTagName(ComHelper.OBJECT_TAG)[0];var objectId=objectNode.getAttribute(ComHelper.OBJECT_ID_ATTR);var object=SweetDevRia.getComponent(objectId);var methodNode=invokeNode.getElementsByTagName(ComHelper.METHOD_TAG)[0];var methodName=methodNode.getAttribute(ComHelper.METHOD_NAME_ATTR);var args=null;var paramNodes=invokeNode.getElementsByTagName(ComHelper.PARAM_TAG);if(paramNodes){if(paramNodes.length){args=[];}
for(var j=0;j<paramNodes.length;j++){var paramNode=paramNodes[j];var type=paramNode.getAttribute(ComHelper.PARAM_TYPE_ATTR);var value=paramNode.firstChild.data;if(type&&(type.toLowerCase()=="array")||(type.toLowerCase()=="object")){value=eval(value);}
else if(type&&(type.toLowerCase()=="boolean")){if(value.toLowerCase()=="true")
value=true;else if(value.toLowerCase()=="false")
value=false;else
value=null;}
else if(type&&(type.toLowerCase()=="string")){if(value){value=value.substring(1,value.length-1);}}
args[args.length]=value;}}
if(object&&methodName){object[methodName].apply(object,args);}}
function MultiSelect(){null;}
MultiSelect.getSelectedObjs=MultiSelect_getSelectedObjs;MultiSelect.isSelected=MultiSelect_isSelected;MultiSelect.haveSelected=MultiSelect_haveSelected;MultiSelect.addSelected=MultiSelect_addSelected;MultiSelect.removeSelected=MultiSelect_removeSelected;MultiSelect.swapSelected=MultiSelect_swapSelected;MultiSelect.selectedObjects=[];function MultiSelect_getSelectedObjs(){var selectedObjs=MultiSelect.selectedObjects;if(selectedObjs){return selectedObjs;}
else{return[];}}
function MultiSelect_isSelected(id){var selectedObjs=MultiSelect.selectedObjects;if(selectedObjs){for(var i=0;i<selectedObjs.length;i++){if(selectedObjs[i].id==id){return true;}}}
return false;}
function MultiSelect_haveSelected(){var selectedObjs=MultiSelect.selectedObjects;if(selectedObjs){return(selectedObjs.length>0);}
return false;}
function MultiSelect_addSelected(id){var selectedObjs=MultiSelect.selectedObjects;if(selectedObjs===null){MultiSelect.selectedObjects=[];selectedObjs=MultiSelect.selectedObjects;}
var selectedObj=YAHOO.util.DragDropMgr.getDDById(id);DomHelper.setStyle(selectedObj.getEl(),"border","1px solid");DomHelper.setStyle(selectedObj.getEl(),"borderColor","blue");selectedObjs[selectedObjs.length]=selectedObj;}
function MultiSelect_removeSelected(id){var selectedObjs=MultiSelect.selectedObjects;if(selectedObjs){var res=[];for(var i=0;i<selectedObjs.length;i++){var selectedObj=selectedObjs[i];if(selectedObj.id!=id){res[res.length]=selectedObj;}
else{DomHelper.setStyle(selectedObj.getEl(),"border","0px solid");DomHelper.setStyle(selectedObj.getEl(),"borderColor","black");}}
MultiSelect.selectedObjects=res;}}
function MultiSelect_swapSelected(id){if(MultiSelect.isSelected(id)){MultiSelect.removeSelected(id);}
else{MultiSelect.addSelected(id);}}
function extendsClass(childClass){var parents=arguments;for(var i=1;i<parents.length;i++){var parentClass=parents[i];var tmp=new parentClass;for(var j in tmp){childClass.prototype[j]=tmp[j];}}}
function superClass(child,parentClass){var args=[];for(var i=2;i<arguments.length;i++){args[args.length]=arguments[i];}
child.base=parentClass;child.base.apply(child,args);}
function SweetDevRia(){this.repository={};EventHelper.addListener(window,"load",SweetDevRia_init);}
SweetDevRia.get=SweetDevRia_get;SweetDevRia.set=SweetDevRia_set;SweetDevRia.register=SweetDevRia_register;SweetDevRia.getComponent=SweetDevRia_getComponent;SweetDevRia.getUrlParams=SweetDevRia_getUrlParams;SweetDevRia.addUrlParam=SweetDevRia_addUrlParam;SweetDevRia.getInstances=SweetDevRia_getInstances;SweetDevRia.setInstance=SweetDevRia_setInstance;SweetDevRia.removeInstance=SweetDevRia_removeInstance;SweetDevRia.size=SweetDevRia_size;SweetDevRia.dp=SweetDevRia_displayProperties;SweetDevRia._instance=new SweetDevRia();SweetDevRia.getInstance=function(){return SweetDevRia._instance;};SweetDevRia.log=new SweetDevRiaLog(Log.NONE,Log.alertLogger);SweetDevRia.errorLog=new SweetDevRiaLog(Log.NONE,Log.alertLogger);SweetDevRia.CONTAINER_SUFFIXE="_container";SweetDevRia.COMPONENTS_REPOSITORY="componentsRepository";SweetDevRia.CLASSNAME_SUFFIXE="_Instances";function SweetDevRia_init(){var proxy=SweetDevRiaProxy.getInstance();proxy.fireEvent(new RiaEvent(RiaEvent.INIT_TYPE,proxy.id));window.initialized=true;}
function SweetDevRia_register(component){SweetDevRia.set(component.id,SweetDevRia.COMPONENTS_REPOSITORY,component);SweetDevRia.setInstance(component.className,component.id);}
function SweetDevRia_unregister(component){SweetDevRia.remove(component.id,SweetDevRia.COMPONENTS_REPOSITORY);SweetDevRia.removeInstance(component.className,component.id);}
function SweetDevRia_getComponent(componentId){return SweetDevRia.get(componentId,SweetDevRia.COMPONENTS_REPOSITORY);}
function SweetDevRia_get(key,repositoryKey){var instance=SweetDevRia.getInstance();var repository=instance.repository;if((repositoryKey!==null)&&(repositoryKey!==undefined)){repository=instance.repository[repositoryKey];}
if(repository){return repository[key];}
else{return null;}}
function SweetDevRia_set(key,repositoryKey,value){var instance=SweetDevRia.getInstance();var repository=instance.repository;if(repositoryKey!==null){repository=instance.repository[repositoryKey];if((repository===null)||(repository==undefined)){instance.repository[repositoryKey]={};repository=instance.repository[repositoryKey];}}
repository[key]=value;}
function SweetDevRia_remove(key,repositoryKey){var instance=SweetDevRia.getInstance();var repository=instance.repository;if(repositoryKey!==null){repository=instance.repository[repositoryKey];}
if(repository!==null){repository[key]=null;}}
function SweetDevRia_getInstance(className,id){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo!==null)&&(instancesRepo!=undefined)){for(var i=0;i<instancesRepo.length;i++){if(instancesRepo[i]==id){return instancesRepo[i];}}}
return null;}
function SweetDevRia_getInstances(className){var repository=SweetDevRia.getInstance().repository;return repository[className+SweetDevRia.CLASSNAME_SUFFIXE];}
function SweetDevRia_setInstance(className,id){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo===null)||(instancesRepo==undefined)){repository[className+SweetDevRia.CLASSNAME_SUFFIXE]=[];instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];}
instancesRepo[instancesRepo.length]=id;}
function SweetDevRia_removeInstance(className,id){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo!==null)&&(instancesRepo!==undefined)){var tmp=[];for(var i=0;i<instancesRepo.length;i++){if(instancesRepo[i]!=id){tmp[tmp.length]=instancesRepo[i];}}
instancesRepo=tmp;}}
function SweetDevRia_size(className){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo!==null)&&(instancesRepo!==undefined)){return instancesRepo.length;}
return 0;}
function SweetDevRia_displayProperties(obj){var rep="";for(var i in obj){if(typeof(i)=="function")
rep+=i+" :: (function)\n";else
rep+=i+" :: "+obj[i]+"\n";}
return rep;}
function SweetDevRia_getUrlParams(){var params={};var location=window.location+"";var index=location.indexOf("?");if(index>0){location=location.substring(index+1);var tab=location.split("&");for(var i=0;i<tab.length;i++){var equalIndex=tab[i].indexOf("=");if(equalIndex>0){var name=tab[i].substring(0,equalIndex);var value=tab[i].substring(equalIndex+1);params[name]=value;}}}
return params;}
function SweetDevRia_addUrlParam(name,value){var location=window.location+"";var index=location.indexOf("?");if(index>0){location+="&";}
else{location+="?";}
location+=name+"="+value;alert("SweetDevRia_addUrlParam !!")
window.location=location;}
function RiaEvent(type,idSrc,params){this.type=type;this.idSrc=idSrc;this.params=params;this.sendServer=false;for(var id in this.params){if((id!="type")&&(id!="idSrc")&&(id!="params")){this[id]=this.params[id];}}}
RiaEvent.RIA_EVENTS_TAG="riaEvents";RiaEvent.RIA_EVENT_TAG="riaEvent";RiaEvent.RIA_EVENT_IDSRC_ATTR="idSrc";RiaEvent.RIA_EVENT_TYPE_ATTR="type";RiaEvent.PARAM_TAG="param";RiaEvent.PARAM_TAG_ID_ATTR="id";RiaEvent.KEYBOARD_TYPE=1;RiaEvent.MOUSE_TYPE=2;RiaEvent.APPLICATION_TYPE=3;RiaEvent.COPY_TYPE=4;RiaEvent.CUT_TYPE=5;RiaEvent.PASTE_TYPE=6;RiaEvent.INIT_TYPE=7;RiaEvent.OPEN_EDIT_TYPE=9;RiaEvent.CLOSE_EDIT_TYPE=10;RiaEvent.HASH_TYPE=11;RiaEvent.CLOSE_WINDOW_TYPE=12;RiaEvent.MINIMIZE_WINDOW_TYPE=13;RiaEvent.MAXIMIZE_WINDOW_TYPE=14;RiaEvent.RESTORE_WINDOW_TYPE=15;RiaEvent.CHANGE_VALUE_TYPE="changeValue";RiaEvent.LOAD_NODE="loadNode";RiaEvent.prototype.toXml=RiaEvent_toXml;function RiaEvent_toXml(){var xml="<"+RiaEvent.RIA_EVENT_TAG;xml+=" "+RiaEvent.RIA_EVENT_IDSRC_ATTR+"=\""+this.idSrc+"\"";xml+=" "+RiaEvent.RIA_EVENT_TYPE_ATTR+"=\""+this.type+"\"";xml+=">";for(var id in this.params){if(id!="sendServer"){xml+="<"+RiaEvent.PARAM_TAG+" "+RiaEvent.PARAM_TAG_ID_ATTR+"=\""+id+"\">";xml+=ComHelper.formatParameter(this.params[id]);xml+="</"+RiaEvent.PARAM_TAG+">";}}
xml+="</"+RiaEvent.RIA_EVENT_TAG+">";return xml;}
function EventManager(){this.listeners={};}
EventManager.prototype.addEventListener=EventManager_addEventListener;EventManager.prototype.removeEventListener=EventManager_removeEventListener;EventManager.prototype.fireEvent=EventManager_fireEvent;function EventManager_addEventListener(listener){if(listener){this.listeners[listener.id]=listener;}}
function EventManager_removeEventListener(listener){if(listener){this.listeners[listener.id]=null;}}
function EventManager_fireEvent(evt){var type=evt.type;for(var id in this.listeners){var listener=this.listeners[id];if(listener){if(listener.priorityHandleEvent){if(!listener.priorityHandleEvent(evt)){return false;}}
if(listener.handleEvent){if(!listener.handleEvent(evt)){return false;}}}}
return true;}
function SweetDevRiaProxy(id){if(id){this.base=EventManager;this.base();this.id=id;}}
SweetDevRiaProxy.SWEETDEV_RIA_PROXY_ID="__SweetDEV_RIA_Proxy";SweetDevRiaProxy.prototype=new EventManager;SweetDevRiaProxy._instance=new SweetDevRiaProxy(SweetDevRiaProxy.SWEETDEV_RIA_PROXY_ID);SweetDevRiaProxy.getInstance=function(){return SweetDevRiaProxy._instance;};SweetDevRiaProxy.prototype.handleEvent=SweetDevRiaProxy_handleEvent;function SweetDevRiaProxy_handleEvent(evt){if(evt!==null&&evt.sendServer!==false){ComHelper.fireEvent(evt);}
return true;}
function KeyListener(id){if(id){this.base=EventManager;this.base(id);EventHelper.addListener(document,"keydown",KeyListener_handleEvent);}}
KeyListener.KEY_LISTENER_ID="__SweetDEV_RIA_KeyListener";KeyListener.ESCAPE_KEY=27;KeyListener.ENTER_KEY=13;KeyListener.SPACE_KEY=32;KeyListener.ENTER_KEY=13;KeyListener.ARROW_LEFT_KEY=37;KeyListener.ARROW_UP_KEY=38;KeyListener.ARROW_RIGHT_KEY=39;KeyListener.ARROW_DOWN_KEY=40;KeyListener.STAR_KEY=106;KeyListener.MINUS_KEY=109;KeyListener.PLUS_KEY=107;KeyListener.X_KEY=88;KeyListener.C_KEY=67;KeyListener.V_KEY=86;KeyListener.INSERT_KEY=45;KeyListener.DELETE_KEY=46;KeyListener.F2_KEY=113;KeyListener.F4_KEY=115;KeyListener.F5_KEY=116;KeyListener.F6_KEY=117;KeyListener.F7_KEY=118;KeyListener.prototype=new EventManager;KeyListener._instance=new KeyListener(KeyListener.KEY_LISTENER_ID);KeyListener.getInstance=function(){return KeyListener._instance;};function KeyListener_handleEvent(evt){if(!evt||!evt.keyCode){SweetDevRia.log.warn("Event or keyCode is null");return;}
switch(evt.keyCode){case KeyListener.ESCAPE_KEY:case KeyListener.SPACE_KEY:case KeyListener.ARROW_LEFT_KEY:case KeyListener.ARROW_UP_KEY:case KeyListener.ARROW_RIGHT_KEY:case KeyListener.ARROW_DOWN_KEY:case KeyListener.STAR_KEY:case KeyListener.MINUS_KEY:case KeyListener.PLUS_KEY:case KeyListener.ENTER_KEY:case KeyListener.INSERT_KEY:case KeyListener.DELETE_KEY:case KeyListener.F2_KEY:KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.KEYBOARD_TYPE,this.id,{"srcEvent":evt,"keyCode":evt.keyCode}));break;default:break;}
if((evt.keyCode==KeyListener.X_KEY&&evt.ctrlKey)||(evt.keyCode==KeyListener.DELETE_KEY&&evt.shiftKey)){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.CUT_TYPE,this.id,{"srcEvent":evt}));}else if((evt.keyCode==KeyListener.C_KEY&&evt.ctrlKey)||(evt.keyCode==KeyListener.INSERT_KEY&&evt.ctrlKey)){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.COPY_TYPE,this.id,{"srcEvent":evt}));}else if((evt.keyCode==KeyListener.V_KEY&&evt.ctrlKey)||(evt.keyCode==KeyListener.INSERT_KEY&&evt.shiftKey)){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.PASTE_TYPE,this.id,{"srcEvent":evt}));}else if(evt.keyCode==KeyListener.F4_KEY&&evt.ctrlKey&&evt.shiftKey){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.CLOSE_WINDOW_TYPE,this.id,{"srcEvent":evt}));}else if(evt.keyCode==KeyListener.F5_KEY&&evt.ctrlKey&&evt.shiftKey){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.MAXIMIZE_WINDOW_TYPE,this.id,{"srcEvent":evt}));}else if(evt.keyCode==KeyListener.F6_KEY&&evt.ctrlKey&&evt.shiftKey){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.MINIMIZE_WINDOW_TYPE,this.id,{"srcEvent":evt}));}else if(evt.keyCode==KeyListener.F7_KEY&&evt.ctrlKey&&evt.shiftKey){KeyListener.getInstance().fireEvent(new RiaEvent(RiaEvent.RESTORE_WINDOW_TYPE,this.id,{"srcEvent":evt}));}}
function Browser(){var ua,s,i;this.isIE=false;this.isNS=false;this.version=null;ua=navigator.userAgent;s="MSIE";if((i=ua.indexOf(s))>=0)this.version=parseFloat(ua.substr(i+s.length));s="Netscape6/";if((i=ua.indexOf(s))>=0)this.version=parseFloat(ua.substr(i+s.length));s="Gecko";if((i=ua.indexOf(s))>=0)this.version=6.1;if(document.all)this.isIE=true;else this.isNS=true;}
var browser=new Browser();function Timer(){this.obj=(arguments.length)?arguments[0]:window;return this;}
Timer.prototype.setInterval=function(func,msec){var i=Timer.getNew();var t=Timer.buildCall(this.obj,i,arguments);Timer.set[i].timer=window.setInterval(t,msec);return i;};Timer.prototype.setTimeout=function(func,msec){var i=Timer.getNew();Timer.buildCall(this.obj,i,arguments);Timer.set[i].timer=window.setTimeout("Timer.callOnce("+i+");",msec);return i;};Timer.prototype.clearInterval=function(i){if(!Timer.set[i])return;window.clearInterval(Timer.set[i].timer);Timer.set[i]=null;};Timer.prototype.clearTimeout=function(i){if(!Timer.set[i])return;window.clearTimeout(Timer.set[i].timer);Timer.set[i]=null;};Timer.set=new Array();Timer.buildCall=function(obj,i,args){var t="";Timer.set[i]=new Array();if(obj!=window){Timer.set[i].obj=obj;t="Timer.set["+i+"].obj.";}
t+=args[0]+"(";if(args.length>2){Timer.set[i][0]=args[2];t+="Timer.set["+i+"][0]";for(var j=1;(j+2)<args.length;j++){Timer.set[i][j]=args[j+2];t+=", Timer.set["+i+"]["+j+"]";}}
t+=");";Timer.set[i].call=t;return t;};Timer.callOnce=function(i){if(!Timer.set[i])return;eval(Timer.set[i].call);Timer.set[i]=null;};Timer.getNew=function(){var i=0;while(Timer.set[i])i++;return i;};function PageLocator(propertyToUse,dividingCharacter){this.propertyToUse=propertyToUse;this.defaultQS=null;this.dividingCharacter=dividingCharacter;}
PageLocator.prototype.getLocation=PageLocator_getLocation;PageLocator.prototype.getHash=PageLocator_getHash;PageLocator.prototype.getHref=PageLocator_getHref;PageLocator.prototype.makeNewLocation=PageLocator_makeNewLocation;function PageLocator_getLocation(){return eval(this.propertyToUse);}
function PageLocator_getHash(){var url=this.getLocation();if(url.indexOf(this.dividingCharacter)>-1){var url_elements=url.split(this.dividingCharacter);return url_elements[url_elements.length-1];}else{return this.defaultQS;}}
function PageLocator_getHref(){var url=this.getLocation();var url_elements=url.split(this.dividingCharacter);return url_elements[0];}
function PageLocator_makeNewLocation(new_qs){return this.getHref()+this.dividingCharacter+new_qs;}
function BackHelper(id){if(id){this.id=id;this.timer=new Timer(this);if(browser.isIE){this.locator=new PageLocator("document.frames['"+BackHelper.IFRAME_ID+"'].getLocation()","?hash=");this.windowlocator=new PageLocator("window.location.href","#");}
else{this.locator=new PageLocator("window.location.href","#");this.windowlocator=null;}
var sweetDevRiaProxy=SweetDevRiaProxy.getInstance();sweetDevRiaProxy.addEventListener(this);}}
BackHelper.IFRAME_ID="__backIframe";BackHelper.MOCK_URL=SweetDevRIAPath+"/resources/jsp/mock.html";BackHelper.BACK_HELPER_ID="__Back_Helper";BackHelper.SEPARATOR="&";BackHelper.VALUE_OPEN="[";BackHelper.VALUE_CLOSE="]";BackHelper.prototype=new EventManager;BackHelper.prototype.delayInit=BackHelper_delayInit;BackHelper.prototype.checkBookmark=BackHelper_checkBookmark;BackHelper.prototype.checkWhetherChanged=BackHelper_checkWhetherChanged;BackHelper.prototype.handleEvent=BackHelper_handleEvent;BackHelper.addHash=BackHelper_addHash;BackHelper.getInstance=function(){return BackHelper._instance;};function BackHelper_handleEvent(evt){if(evt.type==RiaEvent.INIT_TYPE){if(this.windowlocator){var iframe=document.createElement("IFRAME");var body=document.body;iframe.setAttribute("id",BackHelper.IFRAME_ID);iframe.setAttribute("src",BackHelper.MOCK_URL);iframe.setAttribute("style","display:none;");body.appendChild(iframe);iframe.style.display="none";this.delayInit(0);}
else{this.checkWhetherChanged(0);}}
return true;}
function BackHelper_checkWhetherChanged(location){if(this.locator&&this.locator.getHash()!=location){var locatorHash=this.locator.getHash()+"";var hashes=locatorHash.split(BackHelper.SEPARATOR);for(var i=0;i<hashes.length;i++){var hashStr=hashes[i];var valueOpenIndex=hashStr.indexOf(BackHelper.VALUE_OPEN);var valueCloseIndex=hashStr.indexOf(BackHelper.VALUE_CLOSE);if(valueOpenIndex>-1&&valueCloseIndex>valueOpenIndex){var id=hashStr.substring(0,valueOpenIndex);var hash=hashStr.substring(valueOpenIndex+1,valueCloseIndex);this.fireEvent(new RiaEvent(RiaEvent.HASH_TYPE,this.id,{"hashId":id,"hashValue":hash}));}}
if(this.windowlocator){window.location=this.windowlocator.makeNewLocation(locatorHash);}}
this.timer.setTimeout("checkWhetherChanged",200,this.locator.getHash());}
function BackHelper_delayInit(){this.timer.setTimeout("checkBookmark",100,"");}
function BackHelper_checkBookmark(){window.location=this.windowlocator.makeNewLocation(this.locator.getHash());this.checkWhetherChanged(0);}
function BackHelper_addHash(id,hash){var backHelper=BackHelper.getInstance();if(id&&hash){var hashStr=id+BackHelper.VALUE_OPEN+hash+BackHelper.VALUE_CLOSE;if(backHelper.windowlocator){var iframe=DomHelper.get(BackHelper.IFRAME_ID);if(iframe){iframe.setAttribute('src',BackHelper.MOCK_URL+"?hash="+hashStr);}}
else{window.location.hash=hashStr;}}}
function RiaComponent(id,className){if(id){this.baseRiaComponent=EventManager;this.baseRiaComponent();this.id=id;this.className=className;SweetDevRia.register(this);KeyListener.getInstance().addEventListener(this);var sweetDevRiaProxy=SweetDevRiaProxy.getInstance();this.addEventListener(sweetDevRiaProxy);sweetDevRiaProxy.addEventListener(this);if(window.initialized){if(!document.toInitialize){document.toInitialize={};}
document.toInitialize[id]=true;}
this.load();}}
RiaComponent.prototype=new EventManager;RiaComponent.prototype.setActive=RiaComponent_setActive;RiaComponent.prototype.isActive=RiaComponent_isActive;RiaComponent.prototype.toString=RiaComponent_toString;RiaComponent.prototype.addHash=RiaComponent_addHash;RiaComponent.prototype.priorityHandleEvent=RiaComponent_priorityHandleEvent;RiaComponent.prototype.load=RiaComponent_load;function RiaComponent_setActive(active){if(active){ActiveManager.setActiveComponent(this);}else{ActiveManager.removeComponent(this);}}
function RiaComponent_load(){null;}
function RiaComponent_isActive(){var activeComp=ActiveManager.getActiveComponent();if(activeComp&&(activeComp.id==this.id)){return true;}
return false;}
function RiaComponent_toString(){return this.id+" [ "+this.className+" ]";}
function RiaComponent_addHash(hash){}
function RiaComponent_priorityHandleEvent(evt){if(evt.type==RiaEvent.INIT_TYPE){if(this.initialize){this.initialize();}
return true;}
else if(evt.idSrc==this.id){var type=evt.type;if(type&&type.length){var functionName="on"+type.substring(0,1).toUpperCase()+type.substring(1,type.length);if(this[functionName]){return this[functionName].call(this,evt);}}}
return true;}
function DragDrop(id,handler){if(id){superClass(this,RiaComponent,id,"DragDrop");superClass(this,YAHOO.util.DDProxy,id);this.handler=handler;this.mode=DragDrop.ALL_MODE;this.type=DragDrop.DUPLICATE_TYPE;this.multiSelect=true;this.origZ=0;this.selectedObjects=[];this.lock=false;YAHOO.util.DragDropMgr.clickTimeThresh=100000;this.dragStartEvt=new EventHelper.customEvent("dragStart",this);this.dragEndEvt=new EventHelper.customEvent("dragEnd",this);this.dragEnterEvt=new EventHelper.customEvent("dragEnter",this);this.dragOverEvt=new EventHelper.customEvent("dragOver",this);this.dragOutEvt=new EventHelper.customEvent("dragOut",this);this.dragStartEvt.subscribe(DragDrop_handler,this);this.dragEndEvt.subscribe(DragDrop_handler,this);this.dragEnterEvt.subscribe(DragDrop_handler,this);this.dragOverEvt.subscribe(DragDrop_handler,this);this.dragOutEvt.subscribe(DragDrop_handler,this);}}
extendsClass(DragDrop,RiaComponent,YAHOO.util.DDProxy);DragDrop.prototype.init=DragDrop_init;DragDrop.prototype.startDrag=DragDrop_startDrag;DragDrop.prototype.endDrag=DragDrop_endDrag;DragDrop.prototype.onDragOver=DragDrop_onDragOver;DragDrop.prototype.onDragOut=DragDrop_onDragOut;DragDrop.prototype.onDragEnter=DragDrop_onDragEnter;DragDrop.prototype.onDragDrop=DragDrop_onDragDrop;DragDrop.prototype.handleEvent=DragDrop_handleEvent;DragDrop.prototype.setLock=DragDrop_setLock;DragDrop.prototype.multiSelectHandleMouseDown=DragDrop_multiSelectHandleMouseDown;DragDrop.prototype.b4StartDrag=DragDrop_b4StartDrag;DragDrop.prototype.addDragZone=DragDrop_addDragZone;DragDrop.prototype.addDragZoneCoord=DragDrop_addDragZoneCoord;DragDrop.prototype.addDropZone=DragDrop_addDropZone;DragDrop.GROUP_SUFFIXE=0;DragDrop.VERTICAL_MODE=1;DragDrop.HORIZONTAL_MODE=2;DragDrop.ALL_MODE=3;DragDrop.DUPLICATE_TYPE=0;DragDrop.CADRE_TYPE=1;DragDrop.DIRECT_TYPE=2;DragDrop.DUPLICATE_OPACITY="0.5";function DragDrop_handleEvent(evt){if(evt.type==RiaEvent.INIT_TYPE){this.isTarget=false;this.init(this.id,this.id+DragDrop.GROUP_SUFFIXE);if(this.type!=DragDrop.DIRECT_TYPE){this.initFrame();}
else{this.setDragElId(this.id);}
this.specificHandler=this.handler;this.addDropZone(DropZone.DOCUMENT_ID);if(this.mode==DragDrop.VERTICAL_MODE){this.setXConstraint(0,0);}
if(this.mode==DragDrop.HORIZONTAL_MODE){this.setYConstraint(0,0);}}
return true;}
function DragDrop_init(id,sGroup){if(this.id!==null&&this.id!="undefined"){this.initTarget(id,sGroup);if(this.multiSelect){YAHOO.util.Event.addListener(id,"mousedown",this.multiSelectHandleMouseDown,this,true);}
else{YAHOO.util.Event.addListener(id,"mousedown",this.handleMouseDown,this,true);}}}
function DragDrop_setLock(lock){this.lock=lock;}
function DragDrop_b4StartDrag(x,y){if(this.lock)return;var dragEl=this.getDragEl();var DOM=YAHOO.util.Dom;this._previousSize[0]=DOM.getStyle(dragEl,"width");this._previousSize[1]=DOM.getStyle(dragEl,"height");if(this.type==DragDrop.DUPLICATE_TYPE){var clone=this.getEl().cloneNode(true);clone.id=dragEl.id;clone.style.position=dragEl.style.position;clone.style.zIndex=dragEl.style.zIndex;dragEl.parentNode.replaceChild(clone,dragEl);}
if(this.type!=DragDrop.DIRECT_TYPE){this.showFrame(x,y);}}
function DragDrop_multiSelectHandleMouseDown(evt){if(this.lock)return;evt=EventHelper.getEvent(evt);if(evt.leftButton&&evt.ctrlKey){MultiSelect.swapSelected(this.id);}
else{var selectedObjs=MultiSelect.getSelectedObjs();var selected=null;if((!MultiSelect.isSelected(this.id))&&MultiSelect.haveSelected()){for(var i=0;i<selectedObjs.length;i++){selected=selectedObjs[i];MultiSelect.removeSelected(selected.id);}}
if(MultiSelect.haveSelected()){var dragEl=this.getDragEl();for(var j=0;j<selectedObjs.length;j++){selected=selectedObjs[j];var selectedEl=selected.getEl();var div=document.createElement("div");div.style.border=dragEl.style.border;div.style.width=selectedEl.style.width;div.style.height=selectedEl.style.height;dragEl.appendChild(div);}
DomHelper.setStyle(dragEl,"border","");}
this.handleMouseDown(evt);}}
function DragDrop_startDrag(x,y){if(this.lock)return;var el=this.getEl();var dragEl=this.getDragEl();this.onDropZone=null;var style=this.getDragEl().style;this.origZ=style.zIndex;style.zIndex=999;this.oldWidth=DomHelper.getStyle(this.getEl(),"width");this.oldHeight=DomHelper.getStyle(this.getEl(),"height");if(this.type!=DragDrop.DUPLICATE_TYPE){this.oldOpacity=DomHelper.getStyle(el,"opacity");DomHelper.setStyle(el,"opacity",DragDrop.DUPLICATE_OPACITY);}
this.dragStartEvt.fire(x,y);}
function DragDrop_endDrag(e){if(this.lock)return;e=EventHelper.getEvent(e);var el=this.getEl();var dragEl=this.getDragEl();this.getDragEl().style.zIndex=this.origZ;DomHelper.setStyle(this.getEl(),"width",this.oldWidth);DomHelper.setStyle(this.getEl(),"height",this.oldHeight);if(this.onDropZone!==null){dragEl.style.visibility="";el.style.visibility="hidden";YAHOO.util.DDM.moveToEl(el,dragEl);dragEl.style.visibility="hidden";el.style.visibility="";}
else{dragEl.style.visibility="hidden";}
if(this.type!=DragDrop.DUPLICATE_TYPE){DomHelper.setStyle(el,"opacity",this.oldOpacity);}
if(MultiSelect.haveSelected()){var selectedObjs=MultiSelect.getSelectedObjs();selectedObjs[0].dragEndEvt.fire(this.onDropZone,e);for(var i=0;i<selectedObjs.length;i++){var selected=selectedObjs[i];MultiSelect.removeSelected(selected.id);}}
else{this.dragEndEvt.fire(this.onDropZone,e);}
if(this.type!=DragDrop.DIRECT_TYPE){DomHelper.removeChildren(dragEl);}}
function DragDrop_onDragOver(e,id){if(this.lock)return;e=EventHelper.getEvent(e);this.dragOverEvt.fire(id,e);}
function DragDrop_onDrag(e){if(this.lock)return;}
function DragDrop_onDragOut(e,id){if(this.lock)return;var evt=EventHelper.getEvent(e);this.dragOutEvt.fire(id,evt);}
function DragDrop_onDragEnter(e,id){if(this.lock)return;var evt=EventHelper.getEvent(e);this.dragEnterEvt.fire(id,evt);}
function DragDrop_onDragDrop(e,id){if(this.lock)return;var elem=YAHOO.util.DragDropMgr.getDDById(id);if(elem&&elem.isTarget){this.onDropZone=elem.id;}}
function DragDrop_handler(type,args,src){if(this.lock)return;if(MultiSelect.haveSelected()){var selectedObjs=MultiSelect.getSelectedObjs();for(var i=0;i<selectedObjs.length;i++){var selected=selectedObjs[i];if(src.specificHandler){src.specificHandler.apply(selected,[type,args,src]);}}}
else{if(src.specificHandler){src.specificHandler.apply(this,[type,args,src]);}}}
function DragDrop_addDragZoneCoord(x,y,width,height){var elPos=YAHOO.util.Region.getRegion(this.getEl());var ileft=elPos.left-x;var iright=x+width-elPos.right;this.setXConstraint(ileft,iright,0);var iup=elPos.top-y;var idown=y+height-elPos.bottom;this.setYConstraint(iup,idown,0);if(this.mode==DragDrop.VERTICAL_MODE){this.setXConstraint(0,0);}
if(this.mode==DragDrop.HORIZONTAL_MODE){this.setYConstraint(0,0);}}
function DragDrop_addDragZone(id){var dragZone=DomHelper.get(id);if(dragZone){var r2=YAHOO.util.Region.getRegion(dragZone);this.addDragZoneCoord(r2.left,r2.top,r2.right-r2.left,r2.bottom-r2.top);}}
function DragDrop_addDropZone(id){var dropZone=YAHOO.util.DragDropMgr.getDDById(id);if(dropZone){dropZone.addToGroup(this.id+DragDrop.GROUP_SUFFIXE);this.dragStartEvt.subscribe(DropZone.handler,dropZone);this.dragEndEvt.subscribe(DropZone.handler,dropZone);this.dragEnterEvt.subscribe(DropZone.handler,dropZone);this.dragOverEvt.subscribe(DropZone.handler,dropZone);this.dragOutEvt.subscribe(DropZone.handler,dropZone);}}
var oldIsOverTarget=YAHOO.util.DDM.isOverTarget;YAHOO.util.DDM.isOverTarget=DragDrop_isOverTarget;function DragDrop_isOverTarget(pt,oTarget,intersect){if(oTarget.id==DropZone.DOCUMENT_ID){return true;}
return oldIsOverTarget.call(YAHOO.util.DDM,pt,oTarget,intersect);}
function DropZone(id,handler){if(id){superClass(this,RiaComponent,id,"DropZone");superClass(this,YAHOO.util.DDTarget,id);this.specificHandler=handler;}}
extendsClass(DropZone,RiaComponent,YAHOO.util.DDTarget);DropZone.prototype.handler=DropZone_handleEventInst;DropZone.handler=DropZone_handler;DropZone.DROP_SELECTED_BORDER_COLOR="red";DropZone.DROP_BORDER_COLOR="yellow";DropZone.DOCUMENT_ID="#document";function DropZone_handleEventInst(evt){if(evt.type==RiaEvent.INIT_TYPE){this.isTarget=true;this.init(this.id,"defaultGroup");}
return true;}
function DropZone_handler(type,args,src){var elem=src.getEl();if(!elem){return;}
if(type=="dragStart"){this.oldBoderColor=DomHelper.getStyle(elem,"borderColor");DomHelper.setStyle(elem,"borderColor",DropZone.DROP_BORDER_COLOR);}
else if(type=="dragEnd"){DomHelper.setStyle(elem,"borderColor","black");}
else if(type=="dragEnter"){if(src.id==args[0])
DomHelper.setStyle(elem,"borderColor",DropZone.DROP_SELECTED_BORDER_COLOR);}
else if(type=="dragOut"){if(src.id==args[0]){DomHelper.setStyle(elem,"borderColor",DropZone.DROP_BORDER_COLOR);}}
if(MultiSelect.haveSelected()){var selectedObjs=MultiSelect.getSelectedObjs();for(var i=0;i<selectedObjs.length;i++){var selected=selectedObjs[i];if(src.specificHandler){src.specificHandler.apply(selected,[type,args,src]);}}}
else{if(src.specificHandler){src.specificHandler.apply(this,[type,args,src]);}}}
new DropZone(DropZone.DOCUMENT_ID);function ActiveManager(id){this.id=id;this.activeComponents=[];}
ActiveManager.ACTIVE_MANAGER_ID="__SweetDEV_RIA_ActiveManager";ActiveManager._instance=new ActiveManager(ActiveManager.ACTIVE_MANAGER_ID);ActiveManager.getInstance=function(){return ActiveManager._instance;};ActiveManager.setActiveComponent=ActiveManager_setActiveComponent;ActiveManager.getActiveComponent=ActiveManager_getActiveComponent;ActiveManager.removeActiveComponent=ActiveManager_removeActiveComponent;ActiveManager.removeComponent=ActiveManager_removeComponent;function ActiveManager_setActiveComponent(component){var activeManager=ActiveManager.getInstance();activeManager.activeComponents[activeManager.activeComponents.length]=component;}
function ActiveManager_getActiveComponent(){var activeManager=ActiveManager.getInstance();return activeManager.activeComponents[activeManager.activeComponents.length-1];}
function ActiveManager_removeActiveComponent(){var activeManager=ActiveManager.getInstance();activeManager.activeComponents=activeManager.activeComponents.slice(0,activeManager.activeComponents.length-1);}
function ActiveManager_removeComponent(component){var activeManager=ActiveManager.getInstance();var activeComponents=[];for(var i=0;i<activeManager.activeComponents.length;i++){if(activeManager.activeComponents[i].id!=component.id)
activeComponents[activeComponents.length]=activeManager.activeComponents[i];}
activeManager.activeComponents=activeComponents;}
DateFormat=function(){null;};DateFormat.pattern="MM/DD/YYYY";DateFormat.separator="-";DateFormat.multiDateSeparator=",";DateFormat.getDateFromPattern=function(year,month,day){if(!DateFormat.pattern||!day||!month||!year){SweetDevRia.log.error("Pattern or argument(s) is/are null");return"";}
try{year=Number(year);month=Number(month);day=Number(day);var result=DateFormat.pattern,day2Num=(day<10)?"0"+day:day,month2Num=(month<10)?"0"+month:month,year4Num=year,year2Num=((year%1000)<10)?"0"+(year%1000):year%1000;result=result.replace(/DD/,day2Num);result=result.replace(/MM/,month2Num);result=result.replace(/YYYY/,year4Num);result=result.replace(/YY/,year2Num);result=result.replace(/\//g,DateFormat.separator);}catch(e){SweetDevRia.log.warn("Error on parsing date ["+e+"]");}
return result;};DateFormat.getDay=function(day){if(!day){SweetDevRia.log.error("Argument is null");return"";}
day=Number(day);return String((day<10)?"0"+day:day);};DateFormat.getMonth=function(month){if(!month){SweetDevRia.log.error("Argument is null");return"";}
month=Number(month);return String((month<10)?"0"+month:month);};DateFormat.getYear=function(year){if(!year){SweetDevRia.log.error("Argument is null");return"";}
year=Number(year);if(DateFormat.pattern.indexOf("YYYY")!=-1){return String(year);}else{return String(((year%1000)<10)?"0"+(year%1000):(year%1000));}};DateFormat.getDate=function(year,month,day){year=parseInt(year,10);month=parseInt(month,10)-1;day=parseInt(day,10);var dat=new Date(year,month,day);if(dat.getDate()==day&&dat.getMonth()==month&&dat.getFullYear()==year){return dat;}
return null;};DateFormat.prepareDateField=function(formField){if(formField&&formField.value.length>0){var sep="";var separatorRegEx=new RegExp(DateFormat.separator+"+","g");formField.value=formField.value.replace(separatorRegEx,DateFormat.separator);formField.value=formField.value.replace(/[A-Z]+/ig,"");var tabDate=formField.value.split(DateFormat.separator);if(tabDate){formField.value="";for(var i=0;i<tabDate.length;i++){if(tabDate[i].length==1){tabDate[i]="0"+tabDate[i];}
formField.value+=sep+tabDate[i];sep=DateFormat.separator;}}}};DateFormat.parseDate=function(value){if(value.length===0){return new Date();}
var day,month,year,yearPattern=4;var format=DateFormat.pattern.toUpperCase();var posDay=format.indexOf("DD");if(posDay>=0){day=value.substring(posDay,posDay+2);var posMonth=format.indexOf("MM");if(posMonth>=0){month=value.substring(posMonth,posMonth+2);var posYear=format.indexOf("YYYY");if(posYear==-1){posYear=format.indexOf("YY");yearPattern=2;}
if(posYear>=0){year=value.substring(posYear,posYear+yearPattern);if(yearPattern==2){year="20"+year;}
var t=/^[0-9]*$/;if(t.test(year)&&t.test(month)&&t.test(day)){year=parseInt(year,10);month=parseInt(month,10)-1;day=parseInt(day,10);var dat=new Date(year,month,day);if(dat.getDate()==day&&dat.getMonth()==month&&dat.getFullYear()==year){return dat;}}}}}
return null;};Array.prototype.copy=function(array){this.length=0;for(var i=0;i<array.length;i++){this[i]=array[i];}};Array.prototype.contains=function(value){for(var i=0;i<this.length;i++){if(this[i]==value){return true;}}
return false;};Array.prototype.remove=function(value){for(var i=0;i<this.length;i++){if(this[i]==value){this.splice(i,1);return true;}}
return false;};function isVisible(name){var contents=document.getElementsByName("collaps:content:"+name);for(var i=0;i<contents.length;i++){if(contents[i].style.display=="none")
return false;}
return true;}
function switchCollaps(event,name){var toVisible=!isVisible(name);var contents=document.getElementsByName("collaps:content:"+name);for(var i=0;i<contents.length;i++){contents[i].style.display=toVisible?"":"none";}
var ifHiddens=document.getElementsByName("collaps:ifHidden:"+name);for(var j=0;j<ifHiddens.length;j++){ifHiddens[j].style.display=toVisible?"none":"";}
var ifVisibles=document.getElementsByName("collaps:ifVisible:"+name);for(var k=0;k<ifVisibles.length;k++){ifVisibles[k].style.display=toVisible?"":"none";}
var visibility=document.getElementsByName("visibility:collaps:content:"+name);if(visibility[0])
visibility[0].value=toVisible?"1":"";event.cancelBubble=true;}
PresentList=function(){this.set=new Array();this.register=function(name){for(var i=0;i<this.set.length;i++){if(this.set[i].indexOf(name)!=-1)
return;}
this.set.push(name);};this.unregister=function(name){for(var i=0;i<this.set.length;i++){if(this.set[i].indexOf(name)!=-1){this.set.splice(i,1);}}};this.size=function(){return this.set.length;};};var LayoutManager=new Object();LayoutManager={getViewportHeight:function(){if(window.innerHeight!=window.undefined)return window.innerHeight;if(document.compatMode=='CSS1Compat')return document.documentElement.clientHeight;if(document.body)return document.body.clientHeight;return window.undefined;},getViewportWidth:function(){if(window.innerWidth!=window.undefined)return window.innerWidth;if(document.compatMode=='CSS1Compat')return document.documentElement.clientWidth;if(document.body)return document.body.clientWidth;return window.undefined;},changeSelectVisibility:function(el,visible){if(!browser.isIE||el===null)
return true;var visibility=(visible==true)?'':'hidden',selects=el.getElementsByTagName('SELECT');for(var e=0;e<selects.length;e++){if(browser.version<6){var selectVisi=selects[e].style.visibility,anteriorVisibility=selects[e].getAttribute("anteriorVisibility");if(!visible){if(selectVisi!='hidden'){selects[e].style.visibility=visibility;selects[e].setAttribute('anteriorVisibility','true');}}else{if(anteriorVisibility){selects[e].style.visibility=visibility;}}}}},changeSelectState:function(el,state){if(!browser.isIE||el===null)
return true;var selects=el.getElementsByTagName('SELECT');for(var e=0;e<selects.length;e++){if(browser.version==6){var disabled=selects[e].getAttribute("disabled"),anteriorDisabled=selects[e].getAttribute("anteriorDisabled");if(!state){if(!disabled){selects[e].setAttribute('disabled','true');selects[e].setAttribute('anteriorDisabled','true');}}else{if(anteriorDisabled){selects[e].removeAttribute('disabled');}}}}},addMaskIFrame:function(id,obj){if(!browser.isIE)
return true;var iframe=DomHelper.get(id+'-iframe-mask');if(!iframe){iframe=document.createElement('iframe');iframe.setAttribute('id',id+'-iframe-mask');iframe.setAttribute('src','');iframe.setAttribute('scrolling','no');iframe.setAttribute('frameBorder','0');iframe.style.position='absolute';iframe.style.display='none';iframe.style.filter='alpha(opacity=0)';document.body.appendChild(iframe);}
this.moveIFrame(id,obj);this.setIFrameZIndex(id,obj);iframe.style.display="block";},removeTransparentIFrame:function(id,obj){if(!browser.isIE)
return true;var iframe=DomHelper.get(id+'-iframe-mask');if(iframe)
iframe.style.display="none";},moveIFrame:function(id,obj){if(!browser.isIE)
return true;var iframe=DomHelper.get(id+'-iframe-mask');if(iframe){iframe.style.width=obj.offsetWidth;iframe.style.height=obj.offsetHeight;iframe.style.top=obj.offsetTop;iframe.style.left=obj.offsetLeft;}},setIFrameZIndex:function(id,obj){if(!browser.isIE)
return true;var iframe=DomHelper.get(id+'-iframe-mask');if(iframe){iframe.style.zIndex=obj.style.zIndex-1;}}};function ClickToOpen(id,shiftX,shiftY){superClass(this,RiaComponent,id,"ClickToOpen");this.frame=DomHelper.get(id);this.shiftX=shiftX;this.shiftY=shiftY;this.opened=false;this.useFixedZIndex=false;this.zIndex=0;this.autoClose=true;this.refererTimerChecker=0;this.refererPosX=null;this.refererPosY=null;var closeLink=DomHelper.get('closeLinkCTO'+this.id);if(closeLink){EventHelper.addListener(closeLink,"click",this.doClose,this);}
var closeBtn=DomHelper.get('closeBtnCTO'+this.id);if(closeBtn){closeBtn.onmouseover=function(){this.src=ClickToOpen.IMG_CLOSE_HOVER_SRC;};closeBtn.onmouseout=function(){this.src=ClickToOpen.IMG_CLOSE_SRC;};}
EventHelper.addListener(this.frame,"click",this.toTop,this);if(browser.isNS){if(this.frame.parentNode&&this.frame.parentNode.nodeName){var parentNode=this.frame.parentNode.nodeName;if(parentNode=="TD"){var body=document.getElementsByTagName("BODY")[0];body.appendChild(this.frame);}}}}
extendsClass(ClickToOpen,RiaComponent);ClickToOpen.IMG_CLOSE_SRC=SweetDevRIAImagesPath+'/close.gif';ClickToOpen.IMG_CLOSE_HOVER_SRC=SweetDevRIAImagesPath+'/close_hover.gif';ClickToOpen.prototype.open=function(aLink){if(this.opened){this.close();return false;}
if(this.frame.parentNode!=document.body){document.body.appendChild(this.frame);}
var top=parseInt(DomHelper.getY(aLink),10);var left=parseInt(DomHelper.getX(aLink),10);var scrollX=(document.all)?document.body.scrollLeft:window.pageXOffset;var scrollY=(document.all)?document.body.scrollTop:window.pageYOffset;var topScroll=top-scrollY;var leftScroll=left-scrollX;var frameWidth=0;var frameHeight=0;var smartPosition=true;if(!isNaN(this.shiftY)&&(parseInt(this.shiftY,10)!==0)){top+=parseInt(this.shiftY,10);smartPosition=false;}
if(!isNaN(this.shiftX)&&(parseInt(this.shiftX,10)!==0)){left+=parseInt(this.shiftX,10);smartPosition=false;}
this.frame.style.display='block';if(smartPosition){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 if(document.body){frameWidth=document.body.clientWidth;frameHeight=document.body.clientHeight;}
var offsetRight=frameWidth-(leftScroll+this.frame.scrollWidth),offsetLeft=(leftScroll+aLink.offsetWidth-this.frame.scrollWidth),offsetBottom=frameHeight-(topScroll+aLink.offsetHeight+this.frame.scrollHeight),offsetTop=(topScroll-this.frame.scrollHeight);if(offsetRight>0){null;}
else if(offsetLeft>offsetRight){left-=this.frame.scrollWidth-aLink.scrollWidth;}
if(offsetBottom>0){top+=aLink.scrollHeight+2;}else if(offsetTop>offsetBottom){top-=this.frame.scrollHeight;}else{top+=aLink.scrollHeight+2;}}
if(browser.isNS){var parentScrollTop=0;var parent=this.frame.parentNode;while(parent!==null&&parent!=document.body){parentScrollTop+=parent.scrollTop;parent=parent.parentNode;}}
DomHelper.setY(this.frame,top);DomHelper.setX(this.frame,left);if(this.useFixedZIndex){this.frame.style.zIndex=this.zIndex;}else{this.frame.style.zIndex=DisplayManager.getInstance().getTopZIndex();}
this.setActive(true);this.opened=true;LayoutManager.changeSelectVisibility(document,false);LayoutManager.addMaskIFrame(this.id,this.frame);if(this.autoClose){this.refererTimerChecker=window.setInterval("checkReferer('"+this.id+"','"+aLink.id+"',"+parseInt(DomHelper.getY(aLink),10)+","+parseInt(DomHelper.getX(aLink),10)+")",500);}
return true;};function checkReferer(tooltip,refererLink,oldTop,oldLeft){var top=parseInt(DomHelper.getY(refererLink),10);var left=parseInt(DomHelper.getX(refererLink),10);if(oldTop!=top||oldLeft!=left){SweetDevRia.getComponent(tooltip).close();}}
ClickToOpen.prototype.doClose=function(e,tooltip){tooltip.close();return false;};ClickToOpen.prototype.close=function(){this.frame.style.zIndex=0;this.frame.style.display='none';this.opened=false;this.setActive(false);if(navigator.userAgent.indexOf("Firefox/1.0")!=-1){DomHelper.get('closeBtnCTO'+this.id).onmouseout();}
if(SweetDevRia.size(this.className)===0){LayoutManager.changeSelectVisibility(document,true);}
LayoutManager.removeTransparentIFrame(this.id,this.frame);if(this.autoClose){window.clearInterval(this.refererTimerChecker);this.refererTimerChecker=0;}
return true;};ClickToOpen.prototype.setFixedZIndex=function(zIndex){this.useFixedZIndex=true;this.zIndex=zIndex;};ClickToOpen.prototype.handleEvent=function(evt){if(!this.isActive()){return true;}
if(evt&&evt.type){if(evt.type==RiaEvent.KEYBOARD_TYPE){if(evt.keyCode==KeyListener.ESCAPE_KEY){this.close();EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);return false;}}}};ClickToOpen.prototype.toTop=function(e,tooltip){tooltip.frame.style.zIndex=DisplayManager.getInstance().getTopZIndex();};function EditableText(id){if(id){superClass(this,RiaComponent,id,"EditableText");this.elements={};this.activeElement=null;}}
EditableText.ID="__EditableText";EditableText.COMP_ID="__EditableTextComp";EditableText.EDIT_ZONE="_editZone";EditableText.INPUT_TYPE=0;EditableText.SELECT_TYPE=1;EditableText.RADIO_TYPE=2;EditableText.CALENDAR_TYPE=3;EditableText.TEXTAREA_TYPE=4;extendsClass(EditableText,RiaComponent);EditableText._instance=new EditableText(EditableText.ID);EditableText.getInstance=function(){return EditableText._instance;};EditableText.prototype.init=EditableText_init;EditableText.prototype.initElement=EditableText_initElement;EditableText.add=EditableText_add;EditableText.active=EditableText_active;EditableText.valid=EditableText_valid;EditableText.close=EditableText_close;EditableText.prototype.handleEvent=EditableText_handleEvent;EditableText.prototype.exist=EditableText_exist;EditableText.switchElement=EditableText_switchElement;EditableText.getEditComp=EditableText_getEditComp;EditableText.findEditComp=EditableText_findEditComp;EditableText.getType=EditableText_getType;EditableText.setEditCompValue=EditableText_setEditCompValue;EditableText.getEditCompValue=EditableText_getEditCompValue;EditableText.getTextValue=EditableText_getTextValue;EditableText.setTextValue=EditableText_setTextValue;EditableText.addEditCompEvent=EditableText_addEditCompEvent;function EditableText_exist(id){return(this.elements[id]!==null&&this.elements[id]!==undefined);}
function EditableText_init(){var editableText=EditableText.getInstance();for(var id in editableText.elements){var elem=DomHelper.get(editableText.elements[id][0]);editableText.initElement(elem,editableText.elements[id][2]);}}
function EditableText_initElement(elem,listenersId){if(elem&&!elem.isInitialized){EventHelper.addListener(elem,"dblclick",EditableText_dblClickHandler);if(listenersId){for(var i=0;i<listenersId.length;i++){var listener=SweetDevRia.getComponent(listenersId[i]);if(listener){this.addEventListener(listener);}}}
elem.editComp=EditableText.getEditComp(elem);elem.type=EditableText.getType(elem.editComp);var value=EditableText.getEditCompValue(elem);if(value===null||value===""){value="Cliquez içi pour saisir une valeur";}
EditableText.setTextValue(elem,value);elem.isInitialized=true;}}
function EditableText_add(id,editComp,srcId,listenersId,init){var editableText=EditableText.getInstance();if(!srcId){srcId=id;}
editableText.elements[id]=[id,editComp,srcId,listenersId];var elem=DomHelper.get(id);elem.isInitialized=false;if(init||window.initialized){editableText.initElement(elem,listenersId);}
EventHelper.addListener(window,"load",EditableText_init);}
function EditableText_setEditCompValue(elem,value){var comp=elem.editComp;var type=elem.type;if(type==EditableText.INPUT_TYPE){comp.value=value;comp.focus();}
else if(type==EditableText.TEXTAREA_TYPE){comp.value=value;comp.focus();}
else if(type==EditableText.RADIO_TYPE){for(var i=0;i<comp.length;i++){if(comp[i].value==value){comp[i].checked=true;comp[i].focus();}}}
else if(type==EditableText.SELECT_TYPE){var options=comp.options;for(var j=0;j<options.length;j++){if(options[j].value==value){options[j].selected=true;}}
comp.focus();}
else if(type==EditableText.CALENDAR_TYPE){null;}}
function EditableText_getEditCompValue(elem){var comp=elem.editComp;var type=elem.type;if(type==EditableText.INPUT_TYPE){return comp.value;}
else if(type==EditableText.TEXTAREA_TYPE){return comp.value;}
else if(type==EditableText.RADIO_TYPE){for(var i=0;i<comp.length;i++){if(comp[i].checked){var label=getLabel(comp[i].id);if(label){return label;}
else{return comp[i].value;}}}}
else if(type==EditableText.SELECT_TYPE){var options=comp.options;for(var j=0;j<options.length;j++){if(options[j].selected){return options[j].text;}}}
else if(type==EditableText.CALENDAR_TYPE){if(comp.singleDateField){return comp.singleDateField.value;}}
return null;}
function EditableText_getTextValue(elem){var comp=elem.editComp;var type=elem.type;if(type==EditableText.INPUT_TYPE){return elem.innerHTML;}
else if(type==EditableText.TEXTAREA_TYPE){return elem.innerHTML;}
else if(type==EditableText.RADIO_TYPE){for(var i=0;i<comp.length;i++){var label=getLabel(comp[i].id);if(label===null){label=comp[i].value;}
if(label==elem.innerHTML){return comp[i].value;}}}
else if(type==EditableText.SELECT_TYPE){var options=comp.options;for(var j=0;j<options.length;j++){if(options[j].text==elem.innerHTML){return options[j].value;}}}
else if(type==EditableText.CALENDAR_TYPE){return elem.innerHTML;}
return null;}
function EditableText_setTextValue(elem,value){elem.innerHTML=value;}
function EditableText_addEditCompEvent(elem){var comp=elem.editComp;var type=elem.type;if(type==EditableText.INPUT_TYPE){EventHelper.addListener(comp,"blur",EditableText_blurHandler);}
else if(type==EditableText.TEXTAREA_TYPE){EventHelper.addListener(comp,"blur",EditableText_blurHandler);}
else if(type==EditableText.RADIO_TYPE){for(var i=0;i<comp.length;i++){EventHelper.addListener(comp[i],"click",EditableText_valid);}}
else if(type==EditableText.SELECT_TYPE){EventHelper.addListener(comp,"change",EditableText_valid);}
else if(type==EditableText.CALENDAR_TYPE){if(comp.singleDateField){EventHelper.addListener(comp.singleDateField,"change",EditableText_valid);}}}
function EditableText_getType(comp){var type=null;if(comp.className&&comp.className=="CalendarBase"){type=EditableText.CALENDAR_TYPE;}
else{var tagName=comp.nodeName;if(tagName){tagName=tagName.toLowerCase();if(tagName=="input"){type=EditableText.INPUT_TYPE;var typeAttr=comp.getAttribute("type");if(typeAttr){typeAttr=typeAttr.toLowerCase();if(typeAttr=="radio"){type=EditableText.RADIO_TYPE;}}}
else if(tagName=="select"){type=EditableText.SELECT_TYPE;}
else if(tagName=="textarea"){type=EditableText.TEXTAREA_TYPE;}}
else{if(comp.length){type=EditableText.getType(comp[0]);}}}
return type;}
function EditableText_findEditComp(parent){var tagName=parent.nodeName.toLowerCase();if(tagName=="select"||tagName=="textarea"){return parent;}
else if(tagName=="input"){var type=parent.getAttribute("type");if(type&&type.toLowerCase()=="radio"){var name=parent.getAttribute("name");return document.getElementsByName(name);}
if(type===null||type.toLowerCase()!="hidden"){return parent;}}
else{var children=parent.childNodes;for(var i=0;i<children.length;i++){var child=children[i];var find=EditableText.findEditComp(child);if(find){return find;}}}
return null;}
function EditableText_getEditComp(elem){var editableText=EditableText.getInstance();var editComp=editableText.elements[elem.id][1];var comp=null;if(editComp&&editComp!==""){comp=SweetDevRia.getComponent(editComp);if(comp===null||comp===undefined){comp=document.getElementById(editComp);if(comp===null||comp=="undefined"||(comp.getAttribute("type")&&comp.getAttribute("type").toLowerCase()=="radio")){comp=document.getElementsByName(editComp);}}}
else{var editZoneId=elem.id+EditableText.EDIT_ZONE;var editZone=document.getElementById(editZoneId);comp=EditableText.findEditComp(editZone);}
return comp;}
function EditableText_switchElement(toEdition,elem){var tooltip=SweetDevRia.getComponent(elem.id+EditableText.EDIT_ZONE);var editZoneId=elem.id+EditableText.EDIT_ZONE;var editZone=document.getElementById(editZoneId);if(toEdition){if(tooltip){tooltip.open(elem);}
else{editZone.style.display="";elem.style.display="none";}}
else{if(tooltip){tooltip.close();}
else{editZone.style.display="none";elem.style.display="";}}}
function EditableText_active(elem){if(elem){var editableText=EditableText.getInstance();if(editableText.exist(elem.id)){EditableText.close();var value=EditableText.getTextValue(elem);EditableText.switchElement(true,elem);EditableText.setEditCompValue(elem,value);EditableText.addEditCompEvent(elem);editableText.activeElement=elem;var evt=new RiaEvent(RiaEvent.OPEN_EDIT_TYPE,editableText.id,{"elemId":elem.id,"value":value,"sendServer":false});editableText.fireEvent(evt);}}}
function getLabel(elemId){var labels=document.getElementsByTagName("label");if(labels){for(var i=0;i<labels.length;i++){var label=labels[i];if(label){var forAttr=label.getAttribute("for");if(forAttr===null)forAttr=label.getAttribute("htmlFor");if(forAttr&&forAttr==elemId){return label.childNodes[0].nodeValue;}}}}
return null;}
function EditableText_valid(){var editableText=EditableText.getInstance();var elem=editableText.activeElement;if(elem){var oldValue=EditableText.getTextValue(elem);var newValue=EditableText.getEditCompValue(elem);EditableText.close();EditableText.setTextValue(elem,newValue);var evt=new RiaEvent(RiaEvent.CHANGE_VALUE_TYPE,elem.id,{"elemId":editableText.elements[elem.id][2],"oldValue":oldValue,"newValue":newValue,"sendServer":true});editableText.fireEvent(evt);}}
function EditableText_close(){var editableText=EditableText.getInstance();var elem=editableText.activeElement;if(elem){EditableText.switchElement(false,elem);editableText.activeElement=null;var evt=new RiaEvent(RiaEvent.CLOSE_EDIT_TYPE,editableText.id,{"elemId":elem.id,"sendServer":false});editableText.fireEvent(evt);}}
function EditableText_blurHandler(evt){EditableText.close();}
function EditableText_dblClickHandler(evt){evt=EventHelper.getEvent(evt);var elem=evt.src;EditableText.active(elem);}
function EditableText_handleEvent(evt){if(evt&&evt.type){if(evt.type==RiaEvent.KEYBOARD_TYPE){if(evt.keyCode==KeyListener.ENTER_KEY){EditableText.valid();}
else if(evt.keyCode==KeyListener.ESCAPE_KEY){EditableText.close();this.setActive(false);EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);}}}
return true;}
function FileUpload(id){if(id){superClass(this,RiaComponent,id,"FileUpload");}}
FileUpload.LINK="_link";extendsClass(FileUpload,RiaComponent);FileUpload.prototype.getInputFile=FileUpload_getInputFile;FileUpload.prototype.getLink=FileUpload_getLink;FileUpload.prototype.upload=FileUpload_upload;FileUpload.prototype.loaded=FileUpload_loaded;FileUpload.prototype.deleteFile=FileUpload_deleteFile;FileUpload.prototype.isUploaded=FileUpload_isUploaded;function FileUpload_getInputFile(){return document.getElementById(this.id);}
function FileUpload_getLink(){return document.getElementById(this.id+FileUpload.LINK);}
function FileUpload_upload(){this.uploaded=false;this.getInputFile().form.submit();}
function FileUpload_loaded(){this.getInputFile().disabled=true;var link=this.getLink();if(link){link.style.display="";}
this.uploaded=true;}
function FileUpload_isUploaded(){return this.uploaded;}
function FileUpload_deleteFile(){var link=this.getLink();if(link){link.style.display="none";}
ComHelper.fireEvent(new RiaEvent("deleteFile",this.id,{"sendServer":true}));this.getInputFile().form.reset()
this.getInputFile().disabled=false;this.uploaded=true;}
function Node(){this.data={};this.editable=null;this.target=null;}
Node.DIV_PREF="div_";Node.prototype.select=Node_select;Node.prototype.unselect=Node_unselect;Node.prototype.getDivId=Node_getDivId;Node.prototype.getDiv=Node_getDiv;Node.prototype.drawChildren=Node_drawChildren;Node.prototype.removeChild=Node_removeChild;Node.prototype.initialize=Node_initialize;Node.prototype.expand=Node_expand;Node.prototype.collapse=Node_collapse;Node.prototype.initializeChildren=Node_initializeChildren;Node.prototype.toggle=Node_toggle;Node.prototype.clone=Node_clone;Node.prototype.appendChild=Node_appenChild;Node.prototype.getLabelLink=Node_getLabelLink;Node.prototype.labelAction=Node_labelAction;Node.prototype.findChild=Node_findChild;Node.prototype.isEditable=Node_isEditable;function Node_select(){var selection=this.tree.getNodeByIndex(this.tree.selecNodeIndex);if(selection){selection.unselect();}
this.tree.selectNode(this.index);var foundNodes=this.tree.foundNodes;if(!foundNodes.contains(this.index)){for(var i=0;i<foundNodes.length;i++){var node=this.tree.getNodeByIndex(foundNodes[i]);var label=node.getLabelEl();if(label){DomHelper.removeClassName(label,"foundNode");}}
this.tree.foundNodes=[];}
ComHelper.fireEvent(new RiaEvent("selectNode",this.tree.id,{"nodeId":this.data.id,"select":true,"sendServer":true}));}
function Node_unselect(){ComHelper.fireEvent(new RiaEvent("selectNode",this.tree.id,{"nodeId":this.data.id,"select":false,"sendServer":true}));}
function Node_expand(){this.parentClass.prototype.expand.call(this);if(!this.isLoading){this.initializeChildren();ComHelper.fireEvent(new RiaEvent("expandNode",this.tree.id,{"nodeId":this.data.id,"expand":true,"sendServer":true}));}}
function Node_collapse(){if(!this.expanded){return;}
this.parentClass.prototype.collapse.call(this);ComHelper.fireEvent(new RiaEvent("expandNode",this.tree.id,{"nodeId":this.data.id,"expand":false,"sendServer":true}));}
function Node_drawChildren(){this.getChildrenEl().innerHTML=this.renderChildren();this.initializeChildren();}
function Node_removeChild(node){if(node.previousSibling){node.previousSibling.nextSibling=node.nextSibling;}
if(node.nextSibling){node.nextSibling.previousSibling=node.previousSibling;}
node.nextSibling=null;node.previousSibling=null;this.children.remove(node);node.tree=null;node.parent=null;node.depth=null;node.multiExpand=null;}
function Node_initialize(){var label=this.getLabelEl();if(label){var tree="YAHOO.widget.TreeView.getTree('"+this.tree.id+"')";label.focus=new Function("if ("+tree+".selecNodeIndex != "+this.index+") "+tree+".selectNode("+this.index+")");label.blur=new Function(tree+".setActive(false)");}
var div=this.getDiv();if(div){div.node=this;}
if(!this.isRoot()){var dropZoneId=this.tree.root.getChildrenElId();var dragDrop=new DragDrop(Node.DIV_PREF+this.index);dragDrop.addDropZone(dropZoneId);}}
function Node_initializeChildren(){for(var i=0;i<this.children.length;i++){var child=this.children[i];child.initialize();if(child.isEditable()){var label=child.getLabelEl();if(label){EditableText.add(label.id,null,label.id,[child.tree.id],true);label.node=child;}}
if(child.childrenRenderer){child.initializeChildren();}}}
function Node_isEditable(){return(this.editable||(this.tree.editable&&(this.editable!==false||this.editable!==null)));}
function Node_toggle(){this.parentClass.prototype.toggle.call(this);this.select();}
function Node_getLabelLink(){return"YAHOO.widget.TreeView.getNode(\'"+this.tree.id+"\',"+
this.index+").labelAction()";}
function Node_labelAction(){if(this.uncompleted==true){this.childrenRendered=false;this.expanded=false;this.dynamicLoadComplete=false;this.toggle();}
else if(this.expanded!=true){this.toggle();}
else{this.select();}
if(this.href&&this.target){var target=DomHelper.get(this.target);if(target){if(target.nodeName=="IFRAME"){target.src=this.href+"?treeId="+this.tree.id+"&nodeId="+this.data.id;}
else{var node=this;function myCallback(){target.innerHTML=this.getResponseText();var scripts=target.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){eval(scripts[i].innerHTML);}
var proxy=SweetDevRiaProxy.getInstance();var evt=new RiaEvent(RiaEvent.INIT_TYPE,proxy.id);for(var id in document.toInitialize){var comp=SweetDevRia.getComponent(id);if(comp&&document.toInitialize[id]&&comp.handleEvent){comp.handleEvent(evt);}}
document.toInitialize=null;}
ComHelper.call(this.href,{"treeId":this.tree.id,"nodeId":this.data.id},myCallback);}}}}
function Node_clone(parent){var clone=new this.className(this.data,parent,false);for(var i=0;i<this.children.length;i++){var childClone=this.children[i].clone(clone);}
return clone;}
function Node_appenChild(node){node.children=[];this.parentClass.prototype.appendChild.call(this,node);node.tree=this.tree;node.parent=this;node.depth=this.depth+1;node.multiExpand=this.multiExpand;}
function Node_getDivId(){return Node.DIV_PREF+this.index;}
function Node_getDiv(){return DomHelper.get(this.getDivId());}
function Node_findChild(nodeId){if(this.data.id==nodeId){return this;}
for(var i=0;i<this.children.length;i++){var child=this.children[i];var found=child.findChild(nodeId);if(found){return found;}}
return null;}
function HTMLNode(data,parent,extended,hasIcon){superClass(this,YAHOO.widget.HTMLNode,data,parent,extended,hasIcon);superClass(this,Node);this.className=HTMLNode;this.parentClass=YAHOO.widget.HTMLNode;}
extendsClass(HTMLNode,YAHOO.widget.HTMLNode);extendsClass(HTMLNode,Node);HTMLNode.prototype.select=HTMLNode_select;HTMLNode.prototype.initialize=HTMLNode_initialize;HTMLNode.prototype.clone=HTMLNode_clone;function HTMLNode_select(){Node.prototype.select.call(this);var div=DomHelper.get(this.getElId());if(div){div.focus();}}
function HTMLNode_initialize(){var div=DomHelper.get(this.getElId());if(div){div.focus=new Function("YAHOO.widget.TreeView.getTree('"+this.tree.id+"').selectNode("+this.index+")");div.blur=new Function("YAHOO.widget.TreeView.getTree('"+this.tree.id+"').setActive(false)");div.node=this;}
if(!this.isRoot()){var dropZoneId=this.tree.root.getChildrenElId();var dragDrop=new DragDrop(this.getElId());dragDrop.addDropZone(dropZoneId);}}
function HTMLNode_clone(parent){var clone=new this.className(this.data,parent,this.extended,this.hasIcon);for(var i=0;i<this.children.length;i++){var childClone=this.children[i].clone(clone);}
return clone;}
function TextNode(data,parent,expanded){superClass(this,Node);superClass(this,YAHOO.widget.TextNode,data,parent,expanded);this.className=TextNode;this.parentClass=YAHOO.widget.TextNode;var editable=data["editable"];if(typeof(editable)=="String"){this.editable=eval(editable);}
else{this.editable=editable;}
var hasChild=data["hasChild"];if(typeof(hasChild)=="String"){this.hasChild=eval(hasChild);}
else{this.hasChild=hasChild;}
this.style=data["style"];if(!data["styleClass"]){this.styleClass="nodeLevel"+(parent.depth+1);}
else{this.styleClass=data["styleClass"];}}
extendsClass(TextNode,YAHOO.widget.TextNode);extendsClass(TextNode,Node);TextNode.prototype.getNodeHtml=TextNode_getNodeHtml;TextNode.prototype.select=TextNode_select;TextNode.prototype.unselect=TextNode_unselect;TextNode.prototype.getRiaStyle=TextNode_getRiaStyle;TextNode.prototype.getRiaStyleClass=TextNode_getRiaStyleClass;TextNode.prototype.getRiaStyleClassName=TextNode_getRiaStyleClassName;TextNode.prototype.getRiaIconStyleClass=TextNode_getRiaIconStyleClass;TextNode.prototype.getIconWidth=TextNode_getIconWidth;TextNode.prototype.updateIcon=TextNode_updateIcon;TextNode.prototype.getStyle=TextNode_getStyle;function TextNode_unselect(){Node.prototype.unselect.call(this);var selectedLabel=this.getLabelEl();if(selectedLabel){DomHelper.removeClassName(selectedLabel,"selectedNode");}}
function TextNode_getRiaStyle(){return this.style;}
function TextNode_getRiaStyleClassName(className){var name=null;if(className){DomHelper.indexCssStyles();var opened=this.expanded;if(opened){name=className+"_open";}
else{name=className+"_close";}
if(name&&!DomHelper.cssClassExist(name)){name=className;}
if(name&&!DomHelper.cssClassExist(name)){name=null;}
if(name&&(name.indexOf(".")===0)){name=name.substring(1);}}
return name;}
function TextNode_getRiaStyleClass(){var classes=this.labelStyle;var riaStyleClassName=this.getRiaStyleClassName("."+this.styleClass);if(riaStyleClassName){classes+=" "+riaStyleClassName+" ";}
if(this.tree.foundNodes.contains(this.index)){classes+=" foundNode ";}
if(this.tree.selecNodeIndex==this.index){classes+=" selectedNode ";}
return classes;}
function TextNode_getRiaIconStyleClass(){return this.labelStyle+" "+this.getRiaStyleClassName("."+this.styleClass+"_icon");}
function TextNode_updateIcon(){var className=this.getRiaIconStyleClass();var id=this.labelElId+"_icon";var elem=DomHelper.get(id);if(elem){elem['className']=className;}
className=this.getRiaStyleClass();id=this.labelElId;elem=DomHelper.get(id);if(elem){elem['className']=className;DomHelper.setStyle(elem,"margin-left",this.getIconWidth());}}
function TextNode_select(){Node.prototype.select.call(this);var nodeLabel=this.getLabelEl();if(nodeLabel){nodeLabel.focus();DomHelper.addClassName(nodeLabel,"selectedNode");}}
function TextNode_getIconWidth(){var className=this.getRiaStyleClassName("."+this.styleClass+"_icon");var width=DomHelper.getProperty(className,"width");return width;}
function TextNode_getStyle(){if(this.isLoading){return"ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var type="n";if(this.hasChild){type=(this.expanded)?"m":"p";}
return"ygtv"+loc+type;}}
function TextNode_getNodeHtml(){var sb=new Array();sb[sb.length]='<div id="'+this.getDivId()+'">';sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0" width="100%">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'">&nbsp;</td>';}
var getTree="YAHOO.widget.TreeView.getTree('"+this.tree.id+"')";var getNode='YAHOO.widget.TreeView.getNode(\''+
this.tree.id+'\','+this.index+')';sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';if(this.hasChild||this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]=getNode+'.getStyle()"';}
sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'">&nbsp;';sb[sb.length]='</td>';sb[sb.length]='<td>';sb[sb.length]='<span';sb[sb.length]=' class="'+this.getRiaIconStyleClass()+'"';sb[sb.length]=' style="width:100%"';sb[sb.length]=' id="'+this.labelElId+'_icon"';sb[sb.length]=' onclick="javascript:'+this.getLabelLink()+'" ';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getStyle()"';}
sb[sb.length]=' >';sb[sb.length]='<span id="'+this.labelElId+'_editZone"  style="display:none">';sb[sb.length]='<input value="'+this.data.label+'"/></span>';sb[sb.length]=' <span style="margin-left:'+this.getIconWidth()+'" ';sb[sb.length]=' class="'+this.getRiaStyleClass()+'" ';sb[sb.length]=' id="'+this.labelElId+'"';sb[sb.length]=' >';sb[sb.length]='</span>';sb[sb.length]='</span>';sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';sb[sb.length]='</div>';return sb.join("");}
function RootNode(oTree){superClass(this,YAHOO.widget.RootNode,oTree);superClass(this,Node);this.className=RootNode;this.parentClass=YAHOO.widget.RootNode;}
extendsClass(RootNode,YAHOO.widget.RootNode);extendsClass(RootNode,Node);function RiaTreeview(id){superClass(this,RiaComponent,id,"RiaTreeview");superClass(this,YAHOO.widget.TreeView,id);this.selecNodeIndex=null;this.copiedNode=null;this.cuttedNode=null;this.hoverNode=null;this.foundNodes=[];}
extendsClass(RiaTreeview,RiaComponent,YAHOO.widget.TreeView);RiaTreeview.prototype.handleEvent=RiaTreeview_handleEvent;RiaTreeview.prototype.selectNode=RiaTreeview_selectNode;RiaTreeview.prototype.changeSelection=RiaTreeview_changeSelection;RiaTreeview.prototype.pasteNode=RiaTreeview_pasteNode;RiaTreeview.prototype.init=RiaTreeview_init;RiaTreeview.prototype.initializeNodes=RiaTreeview_initializeNodes;RiaTreeview.prototype.getPreviousNode=RiaTreeview_getPreviousNode;RiaTreeview.prototype.getNextNode=RiaTreeview_getNextNode;RiaTreeview.prototype.testPaste=RiaTreeview_testPaste;RiaTreeview.prototype.addXmlNode=RiaTreeview_addXmlNode;RiaTreeview.prototype.addNodes=RiaTreeview_addNodes;RiaTreeview.prototype.loadDataForNode=RiaTreeview_loadDataForNode;RiaTreeview.prototype.addNode=RiaTreeview_add;RiaTreeview.prototype.editNode=RiaTreeview_edit;RiaTreeview.prototype.modifyNode=RiaTreeview_modify;RiaTreeview.prototype.deleteNode=RiaTreeview_delete;RiaTreeview.prototype.searchByLabel=RiaTreeview_searchByLabel;RiaTreeview.prototype.searchById=RiaTreeview_searchById;RiaTreeview.prototype.onLoadNode=RiaTreeview_onLoadNode;RiaTreeview.prototype.onPasteNode=RiaTreeview_onPasteNode;RiaTreeview.prototype.onAddNode=RiaTreeview_onAddNode;RiaTreeview.prototype.onSearchById=RiaTreeview_onSearchById;RiaTreeview.prototype.onSearchByLabel=RiaTreeview_onSearchByLabel;function RiaTreeview_init(id){YAHOO.widget.TreeView.prototype.init.call(this,id);this.root=new RootNode(this);}
function RiaTreeview_handleEvent(evt){var copiedNode=null;var cuttedNode=null;if(evt.type==RiaEvent.INIT_TYPE){this.initializeNodes();return true;}
else if(evt.type==RiaEvent.HASH_TYPE){if(evt.hashId==this.id&&evt.hashValue&&evt.hashValue!==""){var nodeIndex=evt.hashValue;var select=this.getNodeByIndex(nodeIndex);if(select&&select.index&&select.index!=this.selecNodeIndex){select.labelAction();}}}
else if(this.isActive()){var compId=null;var elem=null;var dragdrop=null;if(evt.type==RiaEvent.CHANGE_VALUE_TYPE){this.modifyNode(evt.idSrc,evt.oldValue,evt.newValue);}
else if(evt.type==RiaEvent.OPEN_EDIT_TYPE){compId=evt.compId;if(compId==this.id){this.editMode=true;elem=DomHelper.get(evt.elemId);dragdrop=SweetDevRia.getComponent(Node.DIV_PREF+elem.node.index);dragdrop.setLock(true);}}
else if(evt.type==RiaEvent.CLOSE_EDIT_TYPE){compId=evt.compId;if(compId==this.id){this.editMode=false;elem=DomHelper.get(evt.elemId);dragdrop=SweetDevRia.getComponent(Node.DIV_PREF+elem.node.index);dragdrop.setLock(false);}}
if(!this.editMode){if(evt.type==RiaEvent.KEYBOARD_TYPE){var keyCode=evt.keyCode;var selection=null;switch(keyCode){case KeyListener.ESCAPE_KEY:this.setActive(false);selection=this.getNodeByIndex(this.selecNodeIndex);if(selection!==null){selection.unselect();}
break;case KeyListener.ARROW_LEFT_KEY:case KeyListener.MINUS_KEY:selection=this.getNodeByIndex(this.selecNodeIndex);selection.collapse();break;case KeyListener.ARROW_RIGHT_KEY:case KeyListener.PLUS_KEY:selection=this.getNodeByIndex(this.selecNodeIndex);selection.expand();break;case KeyListener.ARROW_UP_KEY:case KeyListener.ARROW_DOWN_KEY:this.changeSelection(keyCode);break;case KeyListener.STAR_KEY:selection=this.getNodeByIndex(this.selecNodeIndex);selection.expandAll();selection.expand();break;case KeyListener.DELETE_KEY:this.deleteNode();break;case KeyListener.INSERT_KEY:this.addNode();break;case KeyListener.F2_KEY:this.editNode();break;default:break;}}
else if(evt.type==RiaEvent.COPY_TYPE){this.copiedNode=this.selecNodeIndex;}
else if(evt.type==RiaEvent.CUT_TYPE){this.cuttedNode=this.selecNodeIndex;}
else if(evt.type==RiaEvent.PASTE_TYPE){if(this.cuttedNode){cuttedNode=this.getNodeByIndex(this.cuttedNode);}
if(this.copiedNode){copiedNode=this.getNodeByIndex(this.copiedNode);}
this.pasteNode();}
if(evt.srcEvent!==null&&evt.srcEvent!==undefined){EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);}}
return false;}
return true;}
function RiaTreeview_testPaste(copyCutNode,targetNode,dragdrop){if(!targetNode.isRoot()){if(copyCutNode.index==targetNode.index){return false;}
if(dragdrop&&(copyCutNode.parent.index==targetNode.index)){return false;}
else{return RiaTreeview_testPaste(copyCutNode,targetNode.parent);}}
return true;}
function RiaTreeview_pasteNode(dragdrop){var selection=this.getNodeByIndex(this.selecNodeIndex);if(this.copiedNode!==null){var copiedNode=this.getNodeByIndex(this.copiedNode);if(copiedNode&&selection&&selection.isEditable()&&RiaTreeview_testPaste(copiedNode,selection,dragdrop)){ComHelper.fireEvent(new RiaEvent("pasteNode",this.id,{"nodeId":copiedNode.data.id,"parentId":selection.data.id,"typePaste":"copy","all":(!selection.childrenRendered),"sendServer":true}));}}
else if(this.cuttedNode!==null){var cuttedNode=this.getNodeByIndex(this.cuttedNode);if(cuttedNode&&selection&&selection.isEditable()&&RiaTreeview_testPaste(cuttedNode,selection,dragdrop)){ComHelper.fireEvent(new RiaEvent("pasteNode",this.id,{"nodeId":cuttedNode.data.id,"parentId":selection.data.id,"typePaste":"cut","all":(!selection.childrenRendered),"sendServer":true}));}}
selection.expand();this.copiedNode=null;this.cuttedNode=null;}
function RiaTreeview_onPasteNode(evt){var selection=this.getNodeByIndex(this.selecNodeIndex);if(evt.typePaste=="copy"){this.addNodes(selection,evt.xml);}
else if(evt.typePaste=="cut"){var cuttedNode=this.root.findChild(evt.nodeId);var parent=cuttedNode.parent;parent.removeChild(cuttedNode);var el=cuttedNode.getEl();el.parentNode.removeChild(el);this.addNodes(selection,evt.xml);}
return true;}
function RiaTreeview_selectNode(nodeIndex){if(this.selecNodeIndex!=nodeIndex){this.selecNodeIndex=nodeIndex;this.setActive(true);var selection=this.getNodeByIndex(this.selecNodeIndex);if(selection){selection.updateIcon();}
this.addHash(nodeIndex);}}
function RiaTreeview_getPreviousNode(node){var previousNode=null;var previousSibling=node.previousSibling;if(previousSibling){if(previousSibling.hasChildren()&&previousSibling.expanded){while(previousNode===null){var lastChild=previousSibling.children[previousSibling.children.length-1];if(lastChild.hasChildren()&&lastChild.expanded){previousSibling=lastChild;}
else{previousNode=lastChild;}}}
else{previousNode=node.previousSibling;}}
else{if(node.parent.isRoot()){previousNode=node;}
else{previousNode=node.parent;}}
return previousNode;}
function RiaTreeview_getNextNode(node){var nextNode=null;if(node.hasChildren()&&node.expanded){nextNode=node.children[0];}
else{if(node.nextSibling){nextNode=node.nextSibling;}
else{var parent=node.parent;while((parent!==null)&&(parent.nextSibling===null)){parent=parent.parent;}
if(parent!==null){nextNode=parent.nextSibling;}
else{nextNode=node;}}}
return nextNode;}
function RiaTreeview_changeSelection(keyCode){var selectNode=this.selectNode;var selection=this.getNodeByIndex(this.selecNodeIndex);if(selection){var newSelection=null;switch(keyCode){case KeyListener.ARROW_UP_KEY:newSelection=this.getPreviousNode(selection);break;case KeyListener.ARROW_DOWN_KEY:newSelection=this.getNextNode(selection);break;default:break;}
if(newSelection){newSelection.select();}}}
function RiaTreeview_initializeNodes(){var dropZoneId=this.root.getChildrenElId();var dropZone=new DropZone(dropZoneId,RiaTreeview_dropHandler);this.root.initializeChildren();}
function RiaTreeview_dropHandler(type,args,src){var el=this.getEl();var node=el.node;var tree=node.tree;var nodeId=node.index;var targetNode=null;if(type=="dragStart"){node.select();}
else if(type=="dragEnd"){DomHelper.setStyle(el,"opacity","1");el.style.left=0;el.style.top=0;var ctrlKey=args[1].ctrlKey;targetNode=RiaTreeview_getTargetNode(el,this.getDragEl());if(targetNode!==null){tree.selecNodeIndex=targetNode.index;if(ctrlKey){tree.cuttedNode=nodeId;}
else{tree.copiedNode=nodeId;}
tree.pasteNode(true);}
if(this.hoverNode){DomHelper.removeClassName(this.hoverNode,"hoverNode");}
node.unselect();}
else if((type=="dragOver")&&(args[0]!==null)&&(args[0]==src.id)){DomHelper.setStyle(el,"opacity","0.5");targetNode=RiaTreeview_getTargetNode(el,this.getDragEl());if(targetNode!==null&&targetNode.labelElId!==null){if((this.hoverNode!==null)&&(this.hoverNode!==undefined)){DomHelper.removeClassName(this.hoverNode,"hoverNode");}
this.hoverNode=DomHelper.get(targetNode.labelElId);DomHelper.addClassName(this.hoverNode,"hoverNode");}}}
function RiaTreeview_getTargetNode(el,dragEl,testedNode){var tree=el.node.tree;if((testedNode===null)||(testedNode==undefined)){testedNode=tree.root;}
var y=DomHelper.getY(dragEl);var testedEl=testedNode.getDiv();var testedY=0;var testedHeight=0;if(testedEl){testedY=DomHelper.getY(testedEl);testedHeight=DomHelper_parsePx(DomHelper.getStyle(testedEl,"height"));var region=YAHOO.util.Region.getRegion(testedEl);testedHeight=region.bottom-region.top;}
if(y<testedY){var previousNode=tree.getPreviousNode(testedNode);if(previousNode!==testedNode){return RiaTreeview_getTargetNode(el,dragEl,previousNode);}}
else if(y>(testedY+testedHeight)){var nextNode=tree.getNextNode(testedNode);if(nextNode!==testedNode){return RiaTreeview_getTargetNode(el,dragEl,nextNode);}}
return testedNode;}
function RiaTreeview_addXmlNode(node,xml,active,search){if(xml.nodeName=="node"){var id=xml.getAttribute("id");var tmpNode=null;if(id&&id!==""){var expanded=(search&&xml.childNodes.length>0);tmpNode=this.root.findChild(id);if(!tmpNode){var objToAdd={id:xml.getAttribute("id"),label:xml.getAttribute("label"),href:xml.getAttribute("href"),target:xml.getAttribute("target"),editable:eval(xml.getAttribute("editable")),hasChild:eval(xml.getAttribute("hasChild")),style:xml.getAttribute("style"),styleClass:xml.getAttribute("styleClass")};expanded=expanded||xml.getAttribute("expanded");var selected=xml.getAttribute("selected");tmpNode=new TextNode(objToAdd,node,expanded);node.hasChild=true;if(node.getChildrenEl()){var elem=document.createElement("div");elem.innerHTML=tmpNode.getHtml();var child=elem.childNodes[0];if(child){node.getChildrenEl().appendChild(child);tmpNode.initialize();}}}
else{tmpNode.expanded=expanded;}
if(search&&!xml.childNodes.length){this.foundNodes[this.foundNodes.length]=tmpNode.index;}}
else{tmpNode=node;}
tmpNode.uncompleted=search;if(search&&node.updateIcon&&node.getChildrenEl()){node.getChildrenEl().style.display="";node.updateIcon();}
for(var j=0;j<xml.childNodes.length;j++){this.addXmlNode(tmpNode,xml.childNodes[j],active,search);}}}
function RiaTreeview_addNodes(node,xml,active,search){if(active===null)active=false;if(search===null)search=false;if(!xml){SweetDevRia.log.debug("RiaTreeview_addNodes : 'xml' is null ! No XML or empty response (wich means no child in this node).");return;}
var treeview=xml.getElementsByTagName("treeview")[0];if(treeview){var children=treeview.childNodes;for(var i=0;i<children.length;i++){var child=children[i];this.addXmlNode(node,child,active,search);}}}
function RiaTreeview_loadDataForNode(node){if(node.children.length===0||node.toReload===true){ComHelper.fireEvent(new RiaEvent("loadNode",this.tree.id,{"nodeId":node.data.id,"sendServer":true}));}else{node.loadComplete();}
if(node.uncompleted==true){node.toReload=true;}}
function RiaTreeview_onLoadNode(evt){var node=this.root.findChild(evt.nodeId);if(node){this.addNodes(node,evt.xml);node.updateIcon();node.toReload=false;node.uncompleted=false;node.loadComplete();}
return true;}
function RiaTreeview_add(){var selection=this.getNodeByIndex(this.selecNodeIndex);if(!selection){selection=this.root;}
if(selection&&selection.isEditable()){ComHelper.fireEvent(new RiaEvent("addNode",this.id,{"nodeId":selection.data.id,"sendServer":true}));}}
function RiaTreeview_onAddNode(evt){var node=this.root.findChild(evt.nodeId);this.addNodes(node,evt.xml,true);return true;}
function RiaTreeview_edit(){var selection=this.getNodeByIndex(this.selecNodeIndex);if(selection&&selection.isEditable()){var label=DomHelper.get(selection.labelElId);if(label){EditableText.active(label);}}}
function RiaTreeview_modify(labelId,oldValue,newValue){var label=DomHelper.get(labelId);if(label){var node=label.node;if(node&&node.isEditable()){ComHelper.fireEvent(new RiaEvent("modifyNode",this.id,{"nodeId":node.data.id,"oldValue":oldValue,"newValue":newValue,"sendServer":true}));node.data.label=newValue;}}}
function RiaTreeview_delete(){var selection=this.getNodeByIndex(this.selecNodeIndex);if(selection&&!selection.isRoot()&&selection.isEditable()){ComHelper.fireEvent(new RiaEvent("deleteNode",this.id,{"nodeId":selection.data.id,"sendServer":true}));var parent=selection.parent;parent.removeChild(selection);var el=selection.getEl();el.parentNode.removeChild(el);parent.select();}}
function RiaTreeview_searchByLabel(label){if(label){this.foundNodes=[];ComHelper.fireEvent(new RiaEvent("searchByLabel",this.id,{"label":label,"sendServer":true}));}}
function RiaTreeview_onSearchByLabel(evt){this.addNodes(this.root,evt.xml,null,true);if(this.foundNodes.length){var lastId=this.foundNodes[this.foundNodes.length-1];var node=this.getNodeByIndex(lastId);if(node){node.labelAction();}}
return true;}
function RiaTreeview_searchById(id){if(id){this.foundNodes=[];ComHelper.fireEvent(new RiaEvent("searchById",this.id,{"nodeId":id,"sendServer":true}));}}
function RiaTreeview_onSearchById(evt){this.addNodes(this.root,evt.xml,null,true);return true;}
function ComboMulti(self,domInput,domData,divName,serviceURL){superClass(this,RiaComponent,self,"ComboMulti");this.strName=self;this.domInput=domInput;this.domData=domData;this.strDivName=divName;this.strUrlService=serviceURL;this.strLastUrlService=this.strUrlService;this.cssStyle="";this.cssStyleClass="";this.enabled=true;this.multiSelect=true;this.strTexts={};this.intTypeDelay=1000;this.minCharactersTrigger=3;this.strFilterMode='startsWith';this.boolSingleRequestMode=true;this.strLastInput='';this.strCurrentListFor='';this.thrSuggest=null;this.boolIsCaseSensitive=false;this.chrDelimiter='"';this.chrSeparator=';';this.intActiveRequests=0;this.replaceMode=false;this.arrResultsSet=[];this.arrResultsSet["for"]=null;this.arrResultsSet["truncated"]=false;this.arrResultsSet['results']=[];this.arrMessages=[];this.arrItemsList=[];this.strLastItemSelectedName='';this.arrSelectedItems=[];this.arrSelectedItemsLabels=[];this.boolFormattedInput=false;this.strLastFormattedInput='';this.boolListShown=false;this.boolShowSelection=false;this.callbackOnAfterValidate=null;this.offsetBetweenListAndInput=3;this.customMessageFormatter=null;this.filterMatchingRule=this.filterMatchingRuleStartsWithCI;this.disabledButton=DomHelper.get(this.strName+'Disabled');this.enabledButton=DomHelper.get(this.strName+'Enabled');}
extendsClass(ComboMulti,RiaComponent);ComboMulti.prototype.handleEvent=ComboMulti_handleEvent;ComboMulti.prototype.protoItem=ComboMulti_protoItem;ComboMulti.prototype.clearResults=ComboMulti_clearResults;ComboMulti.prototype.suppressItems=ComboMulti_suppressItems;ComboMulti.prototype.addItem=ComboMulti_addItem;ComboMulti.prototype.protoMessage=ComboMulti_protoMessage;ComboMulti.prototype.addMessage=ComboMulti_addMessage;ComboMulti.prototype.filterMatchingRuleContainsCI=ComboMulti_filterMatchingRuleContainsCI;ComboMulti.prototype.filterMatchingRuleContainsCS=ComboMulti_filterMatchingRuleContainsCS;ComboMulti.prototype.filterMatchingRuleStartsWithCI=ComboMulti_filterMatchingRuleStartsWithCI;ComboMulti.prototype.filterMatchingRuleStartsWithCS=ComboMulti_filterMatchingRuleStartsWithCS;ComboMulti.prototype.filterMatchingRuleEndsWithCI=ComboMulti_filterMatchingRuleEndsWithCI;ComboMulti.prototype.filterMatchingRuleEndsWithCS=ComboMulti_filterMatchingRuleEndsWithCS;ComboMulti.prototype.filterResultsFromCache=ComboMulti_filterResultsFromCache;ComboMulti.prototype.serializeResponse=ComboMulti_serializeResponse;ComboMulti.prototype.isInSelection=ComboMulti_isInSelection;ComboMulti.prototype.suggest=ComboMulti_suggest;ComboMulti.prototype.executeSuggest=ComboMulti_executeSuggest;ComboMulti.prototype.prepareUrl=ComboMulti_prepareUrl;ComboMulti.prototype.doINeedToDestroyCacheDueToDynamicParam=ComboMulti_doINeedToDestroyCacheDueToDynamicParam;ComboMulti.prototype.handleDynamicParam=ComboMulti_handleDynamicParam;ComboMulti.prototype.clickOnItem=ComboMulti_clickOnItem;ComboMulti.prototype.changeItemBg=ComboMulti_changeItemBg;ComboMulti.prototype.getItemHTML=ComboMulti_getItemHTML;ComboMulti.prototype.refreshList=ComboMulti_refreshList;ComboMulti.prototype.validateSelection=ComboMulti_validateSelection;ComboMulti.prototype.getFormattedInput=ComboMulti_getFormattedInput;ComboMulti.prototype.showSelection=ComboMulti_showSelection;ComboMulti.prototype.allUnSelect=ComboMulti_allUnSelect;ComboMulti.prototype.showSuggestsList=ComboMulti_showSuggestsList;ComboMulti.prototype.hideSuggestsList=ComboMulti_hideSuggestsList;ComboMulti.prototype.cancel=ComboMulti_cancel;ComboMulti.prototype.EvtFocus=ComboMulti_EvtFocus;ComboMulti.prototype.EvtBlur=ComboMulti_EvtBlur;ComboMulti.prototype.getHTML=ComboMulti_getHTML;ComboMulti.prototype.loadingStarted=ComboMulti_loadingStarted;ComboMulti.prototype.loadingEnded=ComboMulti_loadingEnded;ComboMulti.prototype.setStrCurrentListFor=ComboMulti_setStrCurrentListFor;ComboMulti.prototype.setStrLastInput=ComboMulti_setStrLastInput;ComboMulti.prototype.setStrUrlService=ComboMulti_setStrUrlService;ComboMulti.prototype.compareCaseSensitive=ComboMulti_compareCaseSensitive;ComboMulti.prototype.containsCaseSensitive=ComboMulti_containsCaseSensitive;ComboMulti.prototype.setTypeDelay=ComboMulti_setTypeDelay;ComboMulti.prototype.setTitleText=ComboMulti_setTitleText;ComboMulti.prototype.setValidBtnText=ComboMulti_setValidBtnText;ComboMulti.prototype.setCancelBtnText=ComboMulti_setCancelBtnText;ComboMulti.prototype.setAllUnselectBtnText=ComboMulti_setAllUnselectBtnText;ComboMulti.prototype.setTruncatedNoticeText=ComboMulti_setTruncatedNoticeText;ComboMulti.prototype.setMinCharactersTrigger=ComboMulti_setMinCharactersTrigger;ComboMulti.prototype.setResponseDelimiter=ComboMulti_setResponseDelimiter;ComboMulti.prototype.setResponseSeparator=ComboMulti_setResponseSeparator;ComboMulti.prototype.setReplaceMode=ComboMulti_setReplaceMode;ComboMulti.prototype.setCssStyle=ComboMulti_setCssStyle;ComboMulti.prototype.setCssStyleClass=ComboMulti_setCssStyleClass;ComboMulti.prototype.setEnabled=ComboMulti_setEnabled;ComboMulti.prototype.updateFilterRule=ComboMulti_updateFilterRule;ComboMulti.prototype.setFilterMode=ComboMulti_setFilterMode;ComboMulti.prototype.setCaseSensitiveMode=ComboMulti_setCaseSensitiveMode;ComboMulti.prototype.setSingleRequestMode=ComboMulti_setSingleRequestMode;ComboMulti.prototype.setCustomMessageFormatter=ComboMulti_setCustomMessageFormatter;ComboMulti.prototype.setCallBackOnAfterValidate=ComboMulti_setCallBackOnAfterValidate;ComboMulti.prototype.showSelectionSwitch=ComboMulti_showSelectionSwitch;function ComboMulti_protoItem(id,nom){this.id=id;this.nom=nom;}
function ComboMulti_clearResults(){this.arrSelectedItems=[];this.arrSelectedItemsLabels=[];}
function ComboMulti_suppressItems(){this.arrResultsSet['results']=[];this.arrItemsList=[];}
function ComboMulti_addItem(id,nom){this.arrResultsSet['results'].push(new this.protoItem(id,nom));this.arrItemsList.push(new this.protoItem(id,nom));}
function ComboMulti_protoMessage(cssClass,message){this.cssClass=cssClass;this.message=message;}
function ComboMulti_addMessage(cssClass,message){this.arrMessages.push(new this.protoMessage(cssClass,message));}
function ComboMulti_filterMatchingRuleContainsCI(strFor,val){if(val.toLowerCase().indexOf(strFor.toLowerCase())>=0){return true;}
return false;}
function ComboMulti_filterMatchingRuleContainsCS(strFor,val){if(val.indexOf(strFor)>=0){return true;}
return false;}
function ComboMulti_filterMatchingRuleStartsWithCI(strFor,val){if(val.toLowerCase().indexOf(strFor.toLowerCase())===0){return true;}
return false;}
function ComboMulti_filterMatchingRuleStartsWithCS(strFor,val){if(val.indexOf(strFor)===0){return true;}
return false;}
function ComboMulti_filterMatchingRuleEndsWithCI(strFor,val){if(val.toLowerCase().indexOf(strFor.toLowerCase())===(val.length-strFor.length)){return true;}
return false;}
function ComboMulti_filterMatchingRuleEndsWithCS(strFor,val){if(val.indexOf(strFor)===(val.length-strFor.length)){return true;}
return false;}
function ComboMulti_filterResultsFromCache(strFor){if((this.arrResultsSet['results']!==null)&&(!this.arrResultsSet['truncated']||this.compareCaseSensitive(this.arrResultsSet['for'],strFor))){if(this.containsCaseSensitive(this.arrResultsSet['for'],strFor)){this.arrItemsList=[];for(var i=0;i<this.arrResultsSet['results'].length;i++){if(this.filterMatchingRule(strFor,this.arrResultsSet['results'][i].nom)){this.arrItemsList.push(this.arrResultsSet['results'][i]);}}
this.refreshList(false);this.strCurrentListFor=strFor;return true;}}
return false;}
function ComboMulti_serializeResponse(){var tmp='';var del=this.chrDelimiter;var sep=this.chrSeparator;for(var i=0;i<this.arrSelectedItems.length;i++){tmp+=(i>0?sep:'')+del+this.arrSelectedItems[i]+del;}
DomHelper.get(this.domData).value=tmp;}
function ComboMulti_isInSelection(id){for(var i=0;i<this.arrSelectedItems.length;i++){if(this.arrSelectedItems[i]===id){return i;}}
return-1;}
function ComboMulti_suggest(){var input=DomHelper.get(this.domInput).value;window.clearTimeout(this.thrSuggest);if(input.length>=this.minCharactersTrigger){var inputHasChanged=!this.compareCaseSensitive(input,this.strCurrentListFor);var urlToCall=this.handleDynamicParam();var urlHasChanged=this.doINeedToDestroyCacheDueToDynamicParam(urlToCall);if(inputHasChanged||urlHasChanged){if(this.replaceMode)this.clearResults();if(urlHasChanged||!this.filterResultsFromCache(input)){this.setStrLastInput(input);this.setStrUrlService(urlToCall);this.thrSuggest=setTimeout(this.strName+'.executeSuggest(false)',this.intTypeDelay);}}else{this.showSuggestsList();}}else{this.arrItemsList=[];this.hideSuggestsList();}}
function ComboMulti_executeSuggest(force){if(this.boolSingleRequestMode&&this.intActiveRequests>0){return false;}
var urlToCall=this.prepareUrl(force);this.intActiveRequests++;sendDataSweet(urlToCall,'GET',force,this.strName);return true;}
function ComboMulti_prepareUrl(force){var urlToCall=this.handleDynamicParam();var input=DomHelper.get(this.domInput).value;var op='?';if(urlToCall.indexOf('?')!==-1){op='&';}
var param=op+'id='+this.strName;if(!force){if(!this.compareCaseSensitive(input,this.strLastInput)){return false;}
param+='&for='+escape(this.strLastInput);}
return urlToCall+param;}
function ComboMulti_doINeedToDestroyCacheDueToDynamicParam(urlToCall){var ret=true;if(this.strLastUrlService==urlToCall){ret=false;}
return ret;}
function ComboMulti_handleDynamicParam(){var begIdx=0,endIdx=-1;var workUrl=this.strUrlService,begUrl,endUrl;while((begIdx=workUrl.indexOf('{',begIdx))!==-1){begIdx++;if((endIdx=workUrl.indexOf('}',begIdx))!==-1){var htmlId=workUrl.substring(begIdx,endIdx);var htmlEl=DomHelper.get(htmlId);if(htmlEl){if(htmlEl.value!==""){begUrl=workUrl.substring(0,begIdx-1);endUrl=workUrl.substring(endIdx+1);workUrl=begUrl+htmlId+'='+htmlEl.value+endUrl;}}else{SweetDevRia.log.warn("HTML element with Id='"+htmlId+"' was not found on page.");workUrl=workUrl.replace('&{'+htmlId+'}','');}
begIdx=0;}}
return workUrl;}
function ComboMulti_clickOnItem(id,divPortefeuille,inSelectList){var isPresent=this.isInSelection(id);if(isPresent>-1){this.arrSelectedItems.splice(isPresent,1);this.arrSelectedItemsLabels.splice(isPresent,1);isPresent=false;}else{if(this.multiSelect===false&&this.arrSelectedItems.length!==0){this.clearResults()}
var tmp=divPortefeuille.innerHTML;this.arrSelectedItems.push(id);this.arrSelectedItemsLabels.push(tmp);this.strLastItemSelectedName=tmp;isPresent=true;}
this.changeItemBg(divPortefeuille,(isPresent?'selected':'hover'),-1);if(inSelectList){var tmp2=DomHelper.get('item'+this.strName+id);if(tmp2){this.changeItemBg(tmp2,(isPresent?'selected':'normal'),-1);}}else{var tmp3=DomHelper.get('itemSel'+this.strName+id);if(tmp3){this.changeItemBg(tmp3,(isPresent?'selected':'normal'),-1);}}
if(this.arrSelectedItems.length>0){if(this.disabledButton){this.disabledButton.style.display='none';}
if(this.enabledButton){this.enabledButton.style.display='';}}else{if(this.enabledButton){this.enabledButton.style.display='none';}
if(this.disabledButton){this.disabledButton.style.display='';}}
if(this.multiSelect===false&&this.arrSelectedItems.length!==0){this.validateSelection();}
return true;}
function ComboMulti_changeItemBg(div,state,id){switch(state){case'hover':if((id!=="")&&(this.isInSelection(id)>-1))return;break;case'normal':if((id!=="")&&(this.isInSelection(id)>-1))return;break;default:break;}
div.className=state;}
function ComboMulti_getItemHTML(itemId,divId,label,inSelectList,cssclass){var html='<div id="'+divId+'"  class="'+cssclass+'" ';html+='onmouseover="'+this.strName+'.changeItemBg(this, \'hover\', \''+itemId+'\');" ';html+='onmouseout="'+this.strName+'.changeItemBg(this, \'normal\', \''+itemId+'\');" ';html+='onclick="tmp='+this.strName+'.clickOnItem(\''+itemId+'\', this, '+inSelectList+');" ';html+='>'+label+'</div>';return html;}
function ComboMulti_refreshList(onlySelection){var html='';if(this.arrSelectedItems&&this.arrSelectedItems.length>0){html+='<div class="selectionList">';var tmpDivPrefix='itemSel'+this.strName;for(var i=0;i<this.arrSelectedItems.length;i++){id=this.arrSelectedItems[i];html+=this.getItemHTML(id,tmpDivPrefix+id,this.arrSelectedItemsLabels[i],true,(this.arrSelectedItems.contains(id)?'selected':'normal'));}
html+='</div>';html+='<div class="listsSeparator"></div>';}
var msgCtr=DomHelper.get('comboMultiMessagesContainer');msgCtr.innerHTML="";for(var j=0;j<this.arrMessages.length;j++){var msgToShow=this.arrMessages[j].message;if(this.customMessageFormatter){msgToShow=this.customMessageFormatter(this.arrMessages[j].cssClass,this.arrMessages[j].message);}
msgCtr.innerHTML+="<div class='"+this.arrMessages[j].cssClass+"'>"+msgToShow+"</div>";}
if(!onlySelection){tmpDivPrefix='item'+this.strName;for(var k=0;k<this.arrItemsList.length;k++){var id=this.arrItemsList[k].id;html+=this.getItemHTML(id,tmpDivPrefix+id,this.arrItemsList[k].nom,false,(this.arrSelectedItems.contains(id)?'selected':'normal'));}
if(this.arrResultsSet['truncated']){html+='<span class="warning">'+this.strTexts['truncatedNotice']+'</span>';}}
DomHelper.get(this.strDivName).innerHTML=html;this.showSuggestsList();this.boolShowSelection=onlySelection;}
function ComboMulti_validateSelection(){this.hideSuggestsList();var tmp=this.getFormattedInput();this.strLastFormattedInput=tmp;DomHelper.get(this.domInput).value=tmp;this.serializeResponse();if(this.callbackOnAfterValidate!==null){this.callbackOnAfterValidate();}}
function ComboMulti_getFormattedInput(){this.boolFormattedInput=false;if(this.arrSelectedItems.length===0)return'';this.boolFormattedInput=true;if(this.arrSelectedItems.length>1)
return this.strTexts['inputFormatterMulti'].replace(/%d/,this.arrSelectedItems.length);if(this.arrSelectedItems.length===1)
return this.strLastItemSelectedName;}
function ComboMulti_showSelectionSwitch(){if(this.boolShowSelection){this.hideSuggestsList();}else{this.refreshList(true);}}
function ComboMulti_showSelection(){this.serializeResponse();}
function ComboMulti_allUnSelect(){this.strLastItemSelectedName='';this.arrSelectedItems=[];this.arrSelectedItemsLabels=[];DomHelper.get(this.domInput).value=this.strLastInput;this.refreshList(false);if(this.disabledButton){this.disabledButton.style.display='';}
if(this.enabledButton){this.enabledButton.style.display='none';}}
function ComboMulti_showSuggestsList(){if(!this.boolListShown){var container=DomHelper.get(this.strDivName+'Container'),input=DomHelper.get(this.domInput);container.style.top=-203;container.style.left=DomHelper.getX(input)-178;container.style.zIndex=DisplayManager.getInstance().getTopZIndex();container.style.display='block';this.boolListShown=true;}
LayoutManager.changeSelectVisibility(document,false);LayoutManager.addMaskIFrame(this.strDivName,DomHelper.get(this.strDivName+'Container'));SweetDevRia.setInstance(this.className,this.id);this.setActive(true);}
function ComboMulti_hideSuggestsList(){SweetDevRia.removeInstance(this.className,this.strName);if(SweetDevRia.size(this.className)===0){LayoutManager.changeSelectVisibility(document,true);}
LayoutManager.removeTransparentIFrame(this.strDivName,DomHelper.get(this.strDivName+'Container'));DomHelper.get(this.strDivName+'Container').style.display='none';this.boolListShown=false;this.boolShowSelection=false;this.setActive(false);}
function ComboMulti_cancel(){this.allUnSelect();this.hideSuggestsList();this.strLastFormattedInput=DomHelper.get(this.domInput).value=DomHelper.get(this.domData).value='';}
function ComboMulti_EvtFocus(){if(this.boolFormattedInput){DomHelper.get(this.domInput).value='';this.boolFormattedInput=false;}}
function ComboMulti_EvtBlur(){if(!this.boolListShown){DomHelper.get(this.domInput).value=this.strLastFormattedInput;this.boolFormattedInput=true;}}
function ComboMulti_getHTML(){var html='<input size="'+sizeInputCombo+'" class="'+classInputCombo+'" name="'+this.domInput+'" autocomplete="off" type="text" id="'+this.domInput+'" onkeyup="'+this.strName+'.suggest()" onfocus="'+this.strName+'.EvtFocus()" onblur="'+this.strName+'.EvtBlur()" '+((this.enabled===false)?' disabled ':'')+'>';html+='<div id="'+this.strDivName+'Container" class="comboMultiContainer '+this.cssStyleClass+'" style="'+this.cssStyle+'">';if(this.strTexts['title']&&this.strTexts['title']!=="")
html+='<h1 class="comboMulti">'+this.strTexts['title']+'</h1>';html+='<div class="comboMultiInner" id="'+this.strDivName+'"></div>';html+='<div class="actionButtonsContainer">';if(this.multiSelect===true){html+='<input type="button" value="'+this.strTexts['btnAllUnselect']+'" onclick="'+this.strName+'.allUnSelect();"/>';html+='<input type="button" class="comboMulti" value="'+this.strTexts['btnValid']+'" onclick="'+this.strName+'.validateSelection()"/>';}
html+='<input type="button"  class="'+classBtnCancelar+'" value="'+this.strTexts['btnCancel']+'" onclick="'+this.strName+'.cancel();"/>';html+='<input type="hidden" id="'+this.domData+'" name="'+this.domData+'" />';html+='</div>';html+='<div id="comboMultiMessagesContainer" class="messages"></div>';html+='</div>';return html;}
function ComboMulti_loadingStarted(force){this.showSuggestsList()}
//;if(this.strLastInput&&this.strLastInput.length>0)
//DomHelper.get(this.strDivName).innerHTML=this.strTexts['loadingForText']+' '+((force)?'*':this.strLastInput);else
//DomHelper.get(this.strDivName).innerHTML=this.strTexts['loadingText'];}
function ComboMulti_loadingEnded(){null;}
function ComboMulti_setStrCurrentListFor(str){this.strCurrentListFor=(this.boolIsCaseSensitive?str:str.toLowerCase());}
function ComboMulti_setStrLastInput(str){this.strLastInput=(this.boolIsCaseSensitive?str:str.toLowerCase());}
function ComboMulti_setStrUrlService(strLastUrl){this.strLastUrlService=strLastUrl;}
function ComboMulti_compareCaseSensitive(s1,s2){if(s1===null||s2===null)return false;return(this.boolIsCaseSensitive?(s1===s2):(s1.toLowerCase()===s2.toLowerCase()));}
function ComboMulti_containsCaseSensitive(strFind,strIn){if(strFind===null||strIn===null)return false;if(this.boolIsCaseSensitive)return(strIn.indexOf(strFind)>-1);else return(strIn.toLowerCase().indexOf(strFind.toLowerCase())>-1);}
function ComboMulti_setTypeDelay(val){this.intTypeDelay=val;}
function ComboMulti_setTitleText(val){this.strTexts['title']=val;}
function ComboMulti_setValidBtnText(val){this.strTexts['btnValid']=val;}
function ComboMulti_setCancelBtnText(val){this.strTexts['btnCancel']=val;}
function ComboMulti_setAllUnselectBtnText(val){this.strTexts['btnAllUnselect']=val;}
function ComboMulti_setTruncatedNoticeText(val){this.strTexts['truncatedNotice']=val;}
function ComboMulti_setMinCharactersTrigger(val){this.minCharactersTrigger=val;}
function ComboMulti_setResponseDelimiter(val){this.chrDelimiter=val;}
function ComboMulti_setResponseSeparator(val){this.chrSeparator=val;}
function ComboMulti_setReplaceMode(val){this.replaceMode=val;}
function ComboMulti_setCssStyle(val){this.cssStyle=val;}
function ComboMulti_setCssStyleClass(val){this.cssStyleClass=val;}
function ComboMulti_setEnabled(enabled){this.enabled=enabled;}
function ComboMulti_updateFilterRule(){switch(this.strFilterMode){case'contains':this.filterMatchingRule=(this.boolIsCaseSensitive)?this.filterMatchingRuleContainsCS:this.filterMatchingRuleContainsCI;break;case'endsWith':this.filterMatchingRule=(this.boolIsCaseSensitive)?this.filterMatchingRuleEndsWithCS:this.filterMatchingRuleEndsWithCI;break;case'startsWith':default:this.filterMatchingRule=(this.boolIsCaseSensitive)?this.filterMatchingRuleStartsWithCS:this.filterMatchingRuleStartsWithCI;break;}}
function ComboMulti_setFilterMode(val){switch(val){case'contains':this.strFilterMode='contains';break;case'endsWith':this.strFilterMode='endsWith';break;case'startsWith':default:this.strFilterMode='startsWith';break;}
this.updateFilterRule();}
function ComboMulti_setCaseSensitiveMode(boolCS){this.boolIsCaseSensitive=boolCS;this.updateFilterRule();}
function ComboMulti_setSingleRequestMode(val){this.boolSingleRequestMode=val;}
function ComboMulti_setCustomMessageFormatter(functionName){this.customMessageFormatter=functionName;}
function ComboMulti_setCallBackOnAfterValidate(OnAfterValidate){this.callbackOnAfterValidate=OnAfterValidate;}
function ComboMulti_handleEvent(evt){if(evt&&evt.type){if(evt.type==RiaEvent.KEYBOARD_TYPE){if(evt.keyCode==KeyListener.ESCAPE_KEY){var isActive=this.isActive();if(isActive){this.setActive(false);this.hideSuggestsList();EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);return false;}}}}
return true;}
function sendDataSweet(sUri,method,force,nomObjet){var comboMulti=window[nomObjet];var xmlHttp=AjaxPooler.getInstance();var done=function(){var tmp='';var suggestFor=null;var truncated=true;comboMulti.intActiveRequests--;comboMulti.loadingEnded();if(xmlHttp.getResponseText()!==''){var xmlDoc=xmlHttp.getResponseXML();var root=xmlDoc.getElementsByTagName('items');if(root.length>0){truncated=(root.item(0).getAttribute('truncated')==='false')?false:true;var suggestsFor=root.item(0).getAttribute('for');if(force||(comboMulti.compareCaseSensitive(DomHelper.get(comboMulti.domInput).value,suggestsFor))){var port=xmlDoc.getElementsByTagName('item');comboMulti.suppressItems();for(var i=0;i<port.length;i++){var id=port.item(i).attributes[0].value;var nom=port.item(i).firstChild.data;comboMulti.addItem(id,nom);}
comboMulti.arrResultsSet['truncated']=truncated;comboMulti.arrResultsSet['for']=suggestsFor;comboMulti.strCurrentListFor=suggestsFor;comboMulti.arrMessages=[];var msgs=xmlDoc.getElementsByTagName('message');for(var j=0;j<msgs.length;j++){var cssClass=msgs.item(j).attributes[0].value;var message=msgs.item(j).firstChild.data;comboMulti.addMessage(cssClass,message);}
comboMulti.refreshList(false);}else{if(comboMulti.boolSingleRequestMode){comboMulti.suggest();}}}}};comboMulti.loadingStarted(force);xmlHttp.setCallback(done);xmlHttp.send(method,sUri,true);}
function DataGrid(_name,_instanceName){superClass(this,RiaComponent,_name,"DataGrid");this.name=_name;this.instanceName=_instanceName;this.width=0;this.columns=null;this.units="percents";this.setPostBackUrl("");this.scrollerSize=0;this.showWaitMessage=true;this.startDragX=true;this.maxDragX=0;this.lastDropTimestamp=0;this.selectionType='none';this.chrDelimiter='\"';this.chrSeparator=';';this.selectedLines=new Array();this.lastClickedLine=null;this.theForm=null;this.initialFormAction=null;this.selectedKeysField=null;this.ajaxAnywhereInstance=null;this.onPostBack=null;this.checkSizeTimerActive=false;DomHelper.get(this.name+'_container').style.visibility='hidden';HoverHack4IE.getInstance().csshoverReg=/.ct_row:hover/i;var dg=this;setTimeout(function(){if(dg.getForm()!==null)
dg.deleteFormField(dg.getForm(),dg.name+"_dg_col_prop_chg");},50);}
extendsClass(DataGrid,RiaComponent);DataGrid.prototype.deleteFormField=function(form,fieldName){var field=form.elements[fieldName];if(field){form.removeChild(field);}};DataGrid.prototype.setPostBackUrl=function(url){this.postBackUrl=url;if(this.postBackUrl===""){this.postBackUrl=location.href;}
var sep="&";if(this.postBackUrl.indexOf("?")==-1){sep="?";}
this.postBackUrl+=sep+ComHelper.ID_PAGE+"="+window[ComHelper.ID_PAGE];};DataGrid.prototype.minimalColumnWidth=10;DataGrid.MINIMAL_HEIGHT=10;DataGrid.prototype.getForm=function(){if(this.theForm===null)
this.theForm=DomHelper.get(this.name+"_prefs_form");return this.theForm;};DataGrid.prototype.rowSelectedCallBack=null;DataGrid.prototype.rowUnselectedCallBack=null;DataGrid.prototype.toPercents=function(width){this.units="percents";if(typeof width==="undefined")
width=this.width;for(var i=0;i<this.columns.length;i++){var col=this.columns[i];col.widthPercent=col.width*100/(width);}};DataGrid.prototype.toPixels=function(){this.units="pixels";var totalPercents=0;var col=null;for(var i=0;i<this.columns.length;i++){col=this.columns[i];totalPercents+=col.widthPercent;}
var sumWidth=0;for(var j=0;j<this.columns.length-1;j++){col=this.columns[j];col.widthPercent=col.widthPercent*100/totalPercents;col.width=Math.floor(this.width*col.widthPercent/100);sumWidth+=col.width;}
if(this.columns.length>0){this.columns[this.columns.length-1].width=(this.width-sumWidth)-1;}};DataGrid.prototype.saveColumnsVisible=function(form){this.dgPreferences.fillIn(this.name+"_currentlyVisible",this.getCurrentlyVisibleColumns());var instance=window[this.name+"_instance"];var el=form.elements[this.name+"_currentlyVisible"];for(var i=0;i<el.options.length;i++)
el.options[i].selected=true;};DataGrid.prototype.saveColumnsWidth=function(){this.dgPreferences.updateWidthField();};DataGrid.prototype.saveColumnsSort=function(){this.dgPreferences.fillSortLists(this.getAllColumns());};DataGrid.prototype.addFieldToForm=function(form,fieldName){var field=form.elements[fieldName];if(!field){field=document.createElement("input");field.id=field.name=fieldName;field.type="hidden";form.appendChild(field);}
field.value=fieldName;};DataGrid.prototype.sort=function(id){var form=this.getForm();if(form===null)
return false;form.elements[this.name+'_idColumnToSort'].value=id;this.saveColumnsVisible(form);this.saveColumnsWidth();this.addFieldToForm(form,this.name+"_sort_one_col");this.submit(form);form.removeChild(DomHelper.get(this.name+'_sort_one_col'));return true;};DataGrid.prototype.sortingTrigger=function(id){if(new Date().getTime()-this.lastDropTimestamp>500){this.sort(id);}
this.lastDropTimestamp=0;};DataGrid.prototype.waitMessage=function(show){var divMsg=DomHelper.get(this.name+'_waitMessage');var divContainer=DomHelper.get(this.name+'_table_data');if(divMsg===null||divContainer===null)return;divMsg.style.top=(DomHelper.getY(divContainer)+Math.ceil((parseInt(divContainer.style.height,10)-divMsg.offsetHeight)/2))+'px';divMsg.style.left=(DomHelper.getX(divContainer)+Math.ceil(this.width-divMsg.offsetWidth)/2)+'px';DomHelper.get(this.name+'_waitMessage').style.visibility=(show===true?'visible':'hidden');if(show===true){this.loadSelectedKeys();}};DataGrid.prototype.setWaitMessage=function(msg,activated){DomHelper.get(this.name+'_waitMessage').innerHTML='<img src="'+SweetDevRIAImagesPath+'/spinner.gif" align="absmiddle"> '+msg;this.showWaitMessage=activated;};DataGrid.prototype.initWaitMessage=function(){var divName=this.name+'_waitMessage';var divContainer=DomHelper.get(this.name+'_container');if(document.all){divContainer.insertAdjacentHTML('afterBegin','<div class="datagridWaitMessage" id="'+divName+'"></div>');}else{var wm=document.createElement("div");wm.setAttribute('id',divName);wm.setAttribute('class','datagridWaitMessage');divContainer.appendChild(wm);}
this.setWaitMessage('Please wait...',true);};DataGrid.prototype.applyAll=function(firstTime){if(this.showWaitMessage){this.waitMessage(true);if(firstTime)
this.applyAll_run();else
window.setTimeout(this.instanceName+'.applyAll_run()',50);}else this.applyAll_run();};DataGrid.prototype.applyAll_run=function(){var ss=document.styleSheets[document.styleSheets.length-1];var rules=ss.rules?ss.rules:ss.cssRules;for(var i=0;i<this.columns.length;i++){var col=this.columns[i];var selector="."+this.name+"_cell_"+i;for(var j=0;j<rules.length;j++){if(rules[j].selectorText===selector){if(parseInt(rules[j].style.width,10)!==col.width)
rules[j].style.width=col.width+'px';if(parseInt(rules[j].style.marginLeft,10)!==col.marginLeft)
rules[j].style.marginLeft=col.marginLeft+'px';selector=null;break;}}
if(selector!==null){if(ss.addRule){ss.addRule(selector,"width:"+(col.width)+"px; margin-left:"+col.marginLeft+"px");}else{ss.insertRule(selector+"{width:"+col.width+"px; margin-left:"+col.marginLeft+"px}",ss.cssRules.length);}}
var splitter=DomHelper.get(this.name+"_splitter_"+i);var header=DomHelper.get(this.name+"_header_cell_"+i);if(splitter!==null&&header!==null){var x=0;header.style.left=(col.showStart+x)+'px';header.style.width=(col.width-3)+'px';splitter.style.left=(col.showStart+x+col.width-3)+'px';splitter.defx=(col.showStart+x+col.width-3);var nextColWidth=this.getNextColWidth(col);if(nextColWidth>0)nextColWidth--;splitter.maxoffl=col.width-4;splitter.maxoffr=nextColWidth;}}
DomHelper.get(this.name+'_container').style.visibility='visible';if(this.showWaitMessage)this.waitMessage(false);};DataGrid.prototype.calcAll=function(){if(this.units==="percents")
this.toPixels();var left=0;for(var i=0;i<this.columns.length;i++){var col=this.columns[i];col.realStart=left;left+=col.width;col.realEnd=left-1;}
left=0;for(var m=0;m<this.columns.length;m++){var col2;var idx;for(var j=0;j<this.columns.length;j++){var c=this.columns[j];if(c.showPos===m){col2=c;idx=j;break;}}
col2.showStart=left;left+=col2.width;col2.showEnd=left-1;col2.dragLimitL=col2.showStart+col.width;col2.dragLimitR=this.width-col2.showStart;}
left=0;for(var k=0;k<this.columns.length;k++){var col3=this.columns[k];col3.marginLeft=col3.showStart-left;left=Math.max(col3.showEnd+1,left);}};DataGrid.prototype.getSize=function(){var divLay=DomHelper.get(this.name+"_sizer");if(this.scrollerSize===0){var divScrollSize=DomHelper.get(this.name+"_scrollSize");if(divScrollSize!==null){this.scrollerSize=divScrollSize.offsetWidth-divScrollSize.clientWidth;}}
if(divLay!==null){return divLay.offsetWidth-this.scrollerSize;}};DataGrid.prototype.getX=function(){return(DomHelper.getX(DomHelper.get(this.name+"_container")));};DataGrid.prototype.checkSizePeriodically=function(following){if(this.checkSizeTimerActive&&following!==true)
return;this.checkSizeTimerActive=true;var size=this.getSize();if(this.width!==size){if((this.width<size-3)||this.width>size){if(this.units!=="percents")
this.toPercents();this.initSize();}}
setTimeout(this.instanceName+".checkSizePeriodically(true)",500);};DataGrid.prototype.isTooSmall=function(){return this.width<4*this.columns.length||this.scrollerSize===0;};DataGrid.prototype.initSize=function(firstTime){this.width=this.getSize();if(this.isTooSmall())
return;DomHelper.get(this.name+"_table").style.width=this.width+this.scrollerSize;DomHelper.get(this.name+"_header_row").style.width=this.width;this.calcAll();this.applyAll(firstTime);};DataGrid.prototype.fixColumns=function(){var lay=DomHelper.get(this.name+"_mask");lay.style.width=this.width;lay.style.height=40;lay.style.zIndex=100;lay.style.visibility='visible';};DataGrid.prototype.restoreColumns=function(){var lay=DomHelper.get(this.name+"_mask");lay.style.height=1;lay.style.zIndex=1;lay.style.visibility='hidden';};DataGrid.prototype.wakeUpSplitter=function(idx){var splitter=DomHelper.get(this.name+"_splitter_"+idx);};DataGrid.prototype.deadenSplitter=function(idx){null;};DataGrid.prototype.getConstraintSplitter=function(idx){var delta=DomHelper.get(this.name+"_splitter_"+idx).offsetLeft;var x1=delta-this.columns[idx].width+this.minimalColumnWidth;var x2=null;if(this.columns[idx].showPos===this.columns.length-1){var divContainer=DomHelper.get(this.name+'_container');x2=delta+divContainer.offsetLeft;}
else{x2=delta+this.columnsOrdered[this.columns[idx].showPos+1].width-this.minimalColumnWidth;}
return new Array(x1,x2);};DataGrid.prototype.getConstraintHeader=function(idx){var obj=DomHelper.get(this.name+"_container");var x1=DomHelper.getX(obj);var x2=x1+obj.offsetWidth;for(var i=0;i<this.columns.length;i++){if(this.columns[i].alwaysVisible){var tmp=DomHelper.get(this.columns[i].divId);x1+=tmp.offsetWidth;}
else{break;}}
return new Array(x1,x2);};DataGrid.prototype.initColumns=function(){if(this.columns!==null){null;}
this.units="percents";this.columns=new Array();this.dragElems=new Object();for(var i=0;i<255;i++){var spl=DomHelper.get(this.name+"_splitter_"+i);if(spl===null){break;}
this.dragElems['splitter'+i]=new DragColumnSplitter(spl.id,this.instanceName,this,i,spl.id);}
for(var k=0;k<255;k++){var el=DomHelper.get(this.name+"_header_cell_"+k);if(el===null){break;}
if(typeof el.onclick!=="function"){el.onclick=new Function(this.instanceName+".sortingTrigger('"+el.getAttribute("columnId")+"'); return false;");}
this.columns.push({divId:el.id,id:el.getAttribute("columnId"),widthPercent:parseInt(el.getAttribute("widthPercent")),showPos:parseInt(el.getAttribute("showPos")),alwaysVisible:"true"===(el.getAttribute("alwaysVisible")),sortAscending:"true"===(el.getAttribute("sortAscending")),label:el.getAttribute("columnLabel"),sortPriority:parseInt(el.getAttribute("sortPriority")),defaultVisible:"true"===(el.getAttribute("defaultVisible")),defaultShowPos:parseInt(el.getAttribute("defaultShowPos")),realPos:k});if(!this.columns[this.columns.length-1].alwaysVisible){this.dragElems['header'+k]=new DragColumnHeader(el.id,this.instanceName,k,this);}}
this.columnsOrdered=new Array(this.columns.length);for(var j=0;j<this.columns.length;j++){var col=this.columns[j];this.columnsOrdered[col.showPos]=col;}};DataGrid.prototype.getNextColWidth=function(col){var nextColWidth=0;for(var j=0;j<this.columns.length;j++){if(this.columns[j].showPos===col.showPos+1){nextColWidth=this.columns[j].width-3;break;}}
return nextColWidth;};DataGrid.prototype.onSplitterDrop=function(idx){var splitter=DomHelper.get(this.name+"_splitter_"+idx);var delta=splitter.offsetLeft-splitter.defx;if(this.columns[idx].showPos===this.columns.length-1){this.columns[idx].width+=delta;this.toPercents(this.width+delta);this.toPixels();}else{this.columns[idx].width+=delta;this.columnsOrdered[this.columns[idx].showPos+1].width-=delta;}
this.initSize();var form=this.getForm();if(form!==null){this.saveColumnsVisible(form);this.saveColumnsWidth();this.saveColumnsSort();this.addFieldToForm(form,this.name+"_dg_col_prop_chg");this.units="pixels";}};DataGrid.prototype.getNewHeaderPos=function(header,pixelPos){var newPos=0;var pos=pixelPos-this.getX()+(header.offsetWidth/2);for(var i=0;i<this.columnsOrdered.length;i++){var col=this.columnsOrdered[i];var middle=(col.showStart+col.showEnd)/2;if(pos<middle){newPos=i;break;}}
if(i===this.columnsOrdered.length&&pos>middle)
newPos=this.columnsOrdered.length;return newPos;};DataGrid.prototype.onHeaderDrop=function(idx,pixelPos){pixelPos=parseInt(pixelPos,10);var header=DomHelper.get(this.name+"_header_cell_"+idx);var newPos=this.getNewHeaderPos(header,pixelPos);var col=this.columns[idx];DomHelper.get(this.name+'_header_locator').style.visibility='hidden';this.lastDropTimestamp=new Date().getTime();if(this.maxDragX<2){this.sort(this.columns[idx].id);return;}
if(col.showPos===newPos-1||col.showPos===newPos){this.initSize();return;}
if(newPos<col.showPos){for(var i=newPos;i<col.showPos;i++){this.columnsOrdered[i].showPos++;}
col.showPos=newPos;}else{for(var j=col.showPos+1;j<=newPos-1;j++){this.columnsOrdered[j].showPos--;}
col.showPos=newPos-1;}
this.updateColumnsOrder();this.initSize();var form=this.getForm();if(form!==null){this.saveColumnsVisible(form);this.saveColumnsWidth();this.saveColumnsSort();this.addFieldToForm(form,this.name+"_dg_col_prop_chg");this.units="pixels";}};DataGrid.prototype.updateColumnsOrder=function(){this.columnsOrdered=new Array(this.columns.length);for(var i=0;i<this.columns.length;i++){this.columnsOrdered[this.columns[i].showPos]=this.columns[i];}};DataGrid.prototype.onHeaderDrag=function(idx,pixelPos){pixelPos=parseInt(pixelPos,10);if(this.maxDragX<Math.abs(this.startDragX-pixelPos)){this.maxDragX=Math.abs(this.startDragX-pixelPos);}
var header=DomHelper.get(this.name+"_header_cell_"+idx);var newPos=this.getNewHeaderPos(header,pixelPos);var offset=DomHelper.get(this.name+'_header_row').offsetLeft;var newOffset=0;if((newPos>0)&&((newPos-1)<=this.columnsOrdered.length)){newOffset=this.columnsOrdered[newPos-1].showStart+this.columnsOrdered[newPos-1].width;}
DomHelper.get(this.name+'_header_locator').style.left=offset+newOffset-3;DomHelper.get(this.name+'_header_locator').style.visibility='visible';};DataGrid.prototype.getAlwaysVisibleColumns=function(){var res=new Array();for(var i=0;i<this.columns.length;i++){var col=this.columns[i];if(col.alwaysVisible)
res.push(col);}
return res;};DataGrid.prototype.getInvisibleColumns=function(){return this.invisibleColumns;};DataGrid.prototype.getCurrentlyVisibleColumns=function(){var res=new Array();for(var i=0;i<this.columnsOrdered.length;i++){var col=this.columnsOrdered[i];if(!col.alwaysVisible)
res.push(col);}
return res;};DataGrid.prototype.getAllColumns=function(){var res=new Array();for(var i=0;i<this.columns.length;i++){res.push(this.columns[i]);}
for(var j=0;j<this.invisibleColumns.length;j++){res.push(this.invisibleColumns[j]);}
return res;};DataGrid.prototype.getDefaultInvisibleColumns=function(){var res=new Array();var all=this.getAllColumns();for(var i=0;i<all.length;i++){if(!all[i].alwaysVisible&&!all[i].defaultVisible)
res.push(all[i]);}
return res;};DataGrid.prototype.getDefaultVisibleColumns=function(){var res=new Array();var all=this.getAllColumns();for(var i=0;i<all.length;i++){if(!all[i].alwaysVisible&&all[i].defaultVisible)
res.push(all[i]);}
return res;};DataGrid.prototype.clearSelection=function(){var selections=this.selectedLines;if(selections){var length=selections.length;for(var i=0;i<length;i++){this.unselectRowById(selections[0]);}}};DataGrid.prototype.selectRowById=function(rowId){var line=this.getRow(rowId);if(line){this.addRowToSelection(line);this.lastClickedLine=line;}};DataGrid.prototype.unselectRowById=function(rowId){this.removeRowToSelection(this.getRow(rowId));};DataGrid.prototype.getRow=function(rowId){var rows=DomHelper.get(this.name+'_table_data').getElementsByTagName("div");if(rows!==null&&rows.length>0){for(var k=0;k<rows.length;k++){if(rows[k]!==null&&rows[k].nodeName==='DIV'&&rows[k].getAttribute('selectionKey')!==null){var selKey=rows[k].getAttribute('selectionKey');if(selKey==rowId){return rows[k];}}}}
return null;};DataGrid.prototype.selectRow=function(event,line){if(event){EventHelper.stopPropagation(event);}
if(line===null)return;if(line.getAttribute('selectable')==="false"){return false;}
var lineKey=line.getAttribute('selectionKey');if(this.hasSubRows(line.getElementsByTagName("DIV")[0])){return false;}
switch(this.selectionType){case'single':this.clearSelection();this.addRowToSelection(line);this.lastClickedLine=line;break;case'multiple':if(!DomHelper.hasClassName(line,'row_selected')){this.addRowToSelection(line);}else{this.removeRowToSelection(line);}
break;case'none':default:return false;}
return true;};DataGrid.prototype.addRowToSelection=function(line){if(line===null||DomHelper.hasClassName(line,'row_selected')){return false;}
DomHelper.addClassName(line,'row_selected');var lineKey=line.getAttribute('selectionKey');if(!this.selectedLines.contains(lineKey)){this.selectedLines.push(lineKey);this.serializeResponse(this.selectedKeysField);if(this.rowSelectedCallBack)
this.rowSelectedCallBack(line);}
return true;};DataGrid.prototype.removeRowToSelection=function(line){if(line===null||!DomHelper.hasClassName(line,'row_selected')){return false;}
DomHelper.removeClassName(line,'row_selected');var lineKey=line.getAttribute('selectionKey');if(this.selectedLines.contains(lineKey)){this.selectedLines.remove(lineKey);this.serializeResponse(this.selectedKeysField);if(this.rowUnselectedCallBack)
this.rowUnselectedCallBack(line);}
return true;};DataGrid.prototype.hasSubRows=function(element){var childs=element.childNodes;if(childs){for(var i=0;i<childs.length;i++){if(childs[i].nodeName==="DIV"&&DomHelper.hasClassName(childs[i],"ct_row")){return true;}else if(childs[i].nodeName!=="#text"){if(this.hasSubRows(childs[i])===true){return true;}}}}
return false;};DataGrid.prototype.selectSubRows=function(element,fn){var childs=element.childNodes;if(childs){for(var i=0;i<childs.length;i++){if(childs[i].nodeName==="DIV"&&DomHelper.hasClassName(childs[i],"ct_row")){fn.call(this,childs[i]);}else if(childs[i].nodeName!=="#text"){this.selectSubRows(childs[i],fn);}}}};DataGrid.prototype.getParentRow=function(element){element=element.parentNode;if(element===null){return null;}else if(element.nodeName==="DIV"&&DomHelper.hasClassName(element,"ct_row")){return element;}else{if(element.parentNode){return this.getParentRow(element);}}
return false;};DataGrid.prototype.scrollTo=function(){var scrollTo=DomHelper.get(this.name+'_scrollTo');if(scrollTo!==null&&scrollTo.value!==""){setTimeout("DomHelper.get('"+this.name+"_table_data').scrollTop = "+scrollTo.value,45);}};DataGrid.prototype.loadSelectedKeys=function(){HoverHack4IE.getInstance().parseStylesheets();if(!this.selectedKeysField||!this.selectedKeysField.value)
return false;var reg=new RegExp(this.chrDelimiter,"g");var value=this.selectedKeysField.value.replace(reg,"");var keys=value.split(this.chrSeparator);for(var i=0;i<keys.length;i++){if(!this.selectedLines.contains(keys[i])){this.selectedLines.push(keys[i]);}}
var rows=DomHelper.get(this.name+'_table_data').getElementsByTagName("div"),selKey=null,nbRow=0,firstPass=true;if(rows!==null&&rows.length>0){for(var k=0;k<rows.length;k++){if(rows[k]!==null&&rows[k].nodeName==='DIV'&&rows[k].getAttribute('selectionKey')!==null){selKey=rows[k].getAttribute('selectionKey');var end=false,j=0;while(end===false&&j<keys.length){if(keys[j]===selKey){this.addRowToSelection(rows[k]);end=true;if(firstPass){firstPass=!firstPass;setTimeout("DomHelper.get('"+this.name+"_table_data').scrollTop = "+nbRow+" * DomHelper.get('"+this.name+"_table_data').getElementsByTagName('div')["+k+"].offsetHeight",50);}}
j++;}
nbRow++;}}}
return true;};DataGrid.prototype.serializeResponse=function(selectedKeys){selectedKeys.value=this.getSelectedKeys();};DataGrid.prototype.getSelectedKeys=function(){var tmp='';var del=this.chrDelimiter;var sep=this.chrSeparator;var set=new Object();for(var i=0;i<this.selectedLines.length;i++){var item=this.selectedLines[i];if(typeof set[item]==="undefined"){set[item]=true;tmp+=((i>0)?sep:'')+del+item+del;}}
return tmp;};DataGrid.prototype.setResponseDelimiter=function(val){this.chrDelimiter=val;};DataGrid.prototype.setResponseSeparator=function(val){this.chrSeparator=val;};DataGrid.prototype.setSelectionType=function(val){this.selectionType=val;if(typeof DomHelper.get(this.name+'_container').onselectstart!=="undefined"){DomHelper.get(this.name+'_container').onselectstart=new Function("return false");}else{DomHelper.get(this.name+'_container').onmousedown=new Function("return false");DomHelper.get(this.name+'_container').onmouseup=new Function("return true");}};DataGrid.prototype.updatePreferencesWindow=function(){null;};DataGrid.prototype.goToItem=function(groupId,event,startOn){EventHelper.stopPropagation(event);this.updateStartOnRowField(groupId,startOn);var form=this.getForm();if(form!==null){this.cleanForm(form);this.submit(form);}};DataGrid.prototype.cleanForm=function(form){if(form===null){return false;}
var dgColProp=document.getElementById(this.name+'_dg_col_prop_chg');if(dgColProp!==null){form.removeChild(dgColProp);}};DataGrid.prototype.updateStartOnRowField=function(groupId,value){var startOnRowField=DomHelper.get(this.name+'_startOnRow'),values=startOnRowField.value.split(","),isSet=false;if(groupId===null){for(var i=0;i<values.length;i++){if(values[i].indexOf("=")===-1){values[i]=value;isSet=true;}}
if(isSet===false){values[values.length]=value;}
DomHelper.get(this.name+'_scrollTo').value="";}else{for(var j=0;j<values.length;j++){var lgrpId=values[j].split("=");if(lgrpId.length==2&&lgrpId[0]===groupId){values[j]=groupId+"="+value;isSet=true;}}
if(isSet===false){values[values.length]=groupId+"="+value;}
var divContainer=DomHelper.get(this.name+'_table_data');if(divContainer!==null){DomHelper.get(this.name+'_scrollTo').value=divContainer.scrollTop;}}
startOnRowField.value=values.toString().replace("[","").replace("]","");};DataGrid.prototype.submit=function(form,submitButton){this.saveFormAction(form);form.attributes["action"].nodeValue=this.postBackUrl;if(this.onPostBack&&this.onPostBack.length>0)
eval(this.onPostBack);HoverHack4IE.getInstance().unhookHoverEvents();if(form!==null)
this.submitForm(form,submitButton);this.restoreFormAction(form);HoverHack4IE.getInstance().parseStylesheets();};DataGrid.prototype.submitForm=function(form,submitButton){var aa;if(this.ajaxAnywhereInstance!==null){aa=AjaxAnywhere.findInstance(this.ajaxAnywhereInstance);}else{this.ajaxAnywhereInstance=this.name+"_ajaxAnywhereInstance";aa=new AjaxAnywhere();aa.id=this.ajaxAnywhereInstance;aa.handleException=function(){null;};aa.handleHttpErrorCode=function(code){document.close();document.write("<html><body>Error:"+code+"<br><xmp>"+this.req.responseText);document.close();};aa.handlePrevousRequestAborted=function(){null;};aa.dataGrid=this;aa.showLoadingMessage=function(){this.dataGrid.waitMessage(true);};aa.hideLoadingMessage=function(){this.dataGrid.waitMessage(false);};}
if(typeof form.attributes["name"]==="undefined"){if(form.id)
form.setAttribute("name",form.id);else
form.attributes["name"].nodeValue=this.id+"_form";}
aa.formName=form.attributes["name"].nodeValue;aa.onAfterResponseProcessing=function(){EditableText_init();}
aa.submitAJAX("aazones="+encodeURIComponent(this.name+"_zone"),submitButton);};DataGrid.prototype.saveModelAndExport=function(link){this.submit(this.getForm());setTimeout("window.location.href='"+link+"'",500);return true;};DataGrid.prototype.saveFormAction=function(form){this.initialFormAction=form.attributes["action"].nodeValue;};DataGrid.prototype.restoreFormAction=function(form){form.attributes["action"].nodeValue=this.initialFormAction;};DataGrid.prototype.resize=function(id,height){height=DomHelper.parsePx(height);if(height>0){DomHelper.get(id+'_table_data').style.height=height;DomHelper.get(id+'_height').value=height;}};DataGrid.prototype.increaseSize=function(id,value){this.resize(id,parseInt(DomHelper.get(id+'_table_data').style.height,10)+value);};DataGrid.prototype.decreaseSize=function(id,value){this.resize(id,parseInt(DomHelper.get(id+'_table_data').style.height,10)-value);};DataGrid.prototype.checkSize=function(id,value){var tableHeight=parseInt(DomHelper.get(id+'_table_data').style.height,10);if(value+tableHeight<DataGrid.MINIMAL_HEIGHT){return 0;}
return value;};DataGrid.prototype.scrollerHandler=function(type,args,src){if(type==="dragStart"){this.YScrollPos=DomHelper.getY(this.id);}else if(type==="dragEnd"){var newPos=parseInt(DomHelper.getY(this.id));var dataGridId=this.id.replace("_scroller","");if(dataGridId!==""){var diff=DataGrid.prototype.checkSize(dataGridId,parseInt(newPos-this.YScrollPos));DataGrid.prototype.increaseSize(dataGridId,diff);DomHelper.setY(this.id,parseInt(this.YScrollPos+(diff)));}}};function DragColumnSplitter(id,sGroup,dataGrid,idx,splId){if(id){this.init(id,sGroup);this.dataGrid=dataGrid;this.idx=idx;this.splId=splId;this.setYConstraint(0,0);this.origZ=null;}}
DragColumnSplitter.prototype=new YAHOO.util.DD();DragColumnSplitter.prototype.startDrag=function(e,id){this.origZ=YAHOO.util.Dom.getStyle(this.getEl(),'zIndex');YAHOO.util.Dom.setStyle(this.getEl(),'zIndex',999);DomHelper.addClassName(this.getEl(),"ct_header_splitter_hover");this.dataGrid.fixColumns();this.constraint=this.dataGrid.getConstraintSplitter(this.idx);var tmp=this.getEl().offsetLeft;this.resetConstraints();this.setYConstraint(0,0);this.setXConstraint(tmp-this.constraint[0],this.constraint[1]-tmp);};DragColumnSplitter.prototype.endDrag=function(e,id){DomHelper.removeClassName(this.getEl(),"ct_header_splitter_hover");this.dataGrid.restoreColumns();this.dataGrid.onSplitterDrop(this.idx);EventHelper.stopPropagation(e);this.getEl().style.zIndex=this.origZ;};function DragColumnHeader(id,sGroup,idx,dataGrid){if(id){this.init(id,sGroup);this.dataGrid=dataGrid;this.idx=idx;this.setYConstraint(0,0);this.origZ=null;}}
DragColumnHeader.prototype=new YAHOO.util.DD();DragColumnHeader.prototype.startDrag=function(x,y){this.origZ=this.getEl().style.zIndex;YAHOO.util.Dom.setStyle(this.getEl(),'zIndex',999);YAHOO.util.Dom.setStyle(this.getEl(),'opacity','0.7');this.dataGrid.maxDragX=0;this.dataGrid.fixColumns();this.constraint=this.dataGrid.getConstraintHeader(this.idx);this.dataGrid.startDragX=YAHOO.util.Dom.getX(this.getEl());var tmp=YAHOO.util.Dom.getX(this.getEl());this.resetConstraints();this.setYConstraint(0,0);this.setXConstraint(tmp-this.constraint[0],this.constraint[1]-tmp);};DragColumnHeader.prototype.onDrag=function(e){this.dataGrid.onHeaderDrag(this.idx,YAHOO.util.Dom.getX(this.getEl()));};DragColumnHeader.prototype.endDrag=function(e){this.dataGrid.restoreColumns(this.idx);this.dataGrid.onHeaderDrop(this.idx,YAHOO.util.Dom.getX(this.getEl()));EventHelper.stopPropagation(e);YAHOO.util.Dom.setStyle(this.getEl(),'opacity','1');YAHOO.util.Dom.setStyle(this.getEl(),'zIndex',this.origZ);};function DataGridPreferences(_dataGrid,_form,_onPostBack){this.dgInstance=_dataGrid;this.theForm=_form;this.onPostBack=_onPostBack;VirtualWindowsManager.createFromLayer(_dataGrid.name+'_wnd',false,true,true);VirtualWindowsManager.get(_dataGrid.name+'_wnd').resizeTo(750,550);_dataGrid.updatePreferencesWindow=function(){this.dgPreferences.init();};}
DataGridPreferences.prototype.init=function(){var colChg=this.theForm.elements[this.dgInstance.name+'_dg_col_prop_chg'];if(colChg)colChg.parentNode.removeChild(colChg);this.assignEvents(this);this.fillIn(this.dgInstance.name+"_available",this.dgInstance.getInvisibleColumns());this.fillIn(this.dgInstance.name+"_currentlyVisible",this.dgInstance.getCurrentlyVisibleColumns());this.fillIn(this.dgInstance.name+"_alwaysVisible",this.dgInstance.getAlwaysVisibleColumns());this.fillSortLists(this.dgInstance.getAllColumns());};DataGridPreferences.prototype.fillIn=function(selectName,columns){var select=this.theForm.elements[selectName];select.options.length=0;for(var i=0;i<columns.length;i++){var col=columns[i];select.options[select.options.length]=new Option(col.label,col.id);}};DataGridPreferences.moveSelected=function(from,to){for(var i=from.options.length-1;i>=0;i--){var src=from.options[i];if(src.selected){from.options[i]=null;to.options[to.options.length]=src;}}};DataGridPreferences.reorder=function(el,moveUp){for(var i=el.options.length-1;i>=0;i--){var src=el.options[i];if(src.selected){if(moveUp&&i!==0){el.options[i]=new Option(el.options[i-1].innerHTML,el.options[i-1].value);el.options[i-1]=src;}else if(!moveUp&&i!==el.options.length-1){el.options[i]=new Option(el.options[i+1].innerHTML,el.options[i+1].value);el.options[i+1]=src;}
break;}}};DataGridPreferences.prototype.assignEvents=function(){this.theForm.elements[this.dgInstance.name+"_right"].onclick=this.theForm.elements[this.dgInstance.name+"_available"].ondblclick=function(){DataGridPreferences.moveSelected(this.form.elements[this.form.dgInstance.name+"_available"],this.form.elements[this.form.dgInstance.name+"_currentlyVisible"]);};this.theForm.elements[this.dgInstance.name+"_left"].onclick=this.theForm.elements[this.dgInstance.name+"_currentlyVisible"].ondblclick=function(){DataGridPreferences.moveSelected(this.form.elements[this.form.dgInstance.name+"_currentlyVisible"],this.form.elements[this.form.dgInstance.name+"_available"]);};this.theForm.elements[this.dgInstance.name+"_up"].onclick=this.theForm.elements[this.dgInstance.name+"_down"].onclick=this.theForm.elements[this.dgInstance.name+"_up"].ondblclick=this.theForm.elements[this.dgInstance.name+"_down"].ondblclick=function(){DataGridPreferences.reorder(this.form.elements[this.form.dgInstance.name+"_currentlyVisible"],this.name.substring(this.name.length-2,this.name.length)==="up");};this.theForm.elements[this.dgInstance.name+"_resetSort"].onclick=function(){for(var i=0;true;i++){var select=this.form.elements[this.form.dgInstance.name+"_sortBy"+i];if(select===null||typeof select==="undefined")
break;select.options[0].selected=true;if(this.form.elements[this.form.dgInstance.name+"_order"+i]&&this.form.elements[this.form.dgInstance.name+"_order"+i][0])
this.form.elements[this.form.dgInstance.name+"_order"+i][0].checked=true;}};this.theForm.dgInstance=this.dgInstance;this.theForm.dgPrefsInstance=this;this.theForm.elements[this.dgInstance.name+"_restore"].onclick=function(){this.form.dgPrefsInstance.fillIn(this.form.dgInstance.name+"_available",this.form.dgInstance.getDefaultInvisibleColumns());this.form.dgPrefsInstance.fillIn(this.form.dgInstance.name+"_currentlyVisible",this.form.dgInstance.getDefaultVisibleColumns());};this.theForm.elements[this.dgInstance.name+"_applyPersist"].onclick=this.theForm.elements[this.dgInstance.name+"_applySession"].onclick=function(){var el=this.form.elements[this.form.dgInstance.name+"_currentlyVisible"];for(var i=0;i<el.options.length;i++)
el.options[i].selected=true;this.form.elements[this.form.dgInstance.name+'_widths'].value="";if(this.form.elements[this.form.dgInstance.name+'_rememberColumnsSize'].checked===true)
this.form.dgPrefsInstance.updateWidthField();this.form.dgInstance.submit(this.form,this);VirtualWindowsManager.get(this.form.dgInstance.name+'_wnd').close();return false;};};DataGridPreferences.prototype.updateWidthField=function(){var widths="";this.dgInstance.toPercents();for(var i=0;i<this.dgInstance.columns.length;i++){var col=this.dgInstance.columns[i];widths+=col.id+"/"+Math.round(0.499+col.widthPercent)+"/";}
this.theForm.elements[this.dgInstance.name+"_widths"].value=widths;};DataGridPreferences.prototype.fillSortLists=function(columns){var col=null;var select=null;for(var i=0;true;i++){select=this.theForm.elements[this.dgInstance.name+"_sortBy"+i];if(select===null||typeof select==="undefined")
break;select.options.length=0;select.options[0]=new Option("","");for(var j=0;j<columns.length;j++){col=columns[j];select.options[select.options.length]=new Option(col.label,col.id);}}
for(var k=0;k<columns.length;k++){col=columns[k];if(typeof(col.sortPriority)==='number'&&col.sortPriority>-1){select=this.theForm.elements[this.dgInstance.name+"_sortBy"+col.sortPriority];if(select===null)break;for(var m=0;m<select.options.length;m++){if(col.id===select.options[m].value){select.selectedIndex=m;break;}}
var sortOrder=this.theForm.elements[this.dgInstance.name+"_order"+col.sortPriority];for(var iInput=0;iInput<sortOrder.length;iInput++){if(sortOrder[iInput].value==="asc"&&col.sortAscending){sortOrder[iInput].checked=true;break;}else if(sortOrder[iInput].value==="des"&&!col.sortAscending){sortOrder[iInput].checked=true;break;}}}}};if(!document.all)
document.onkeypress=keyDownHandler;VirtualWindowsManager={winList:{},presentList:new PresentList(),maxzIndex:100,resizeCornerSize:16,minimizedTextWidth:100,inMoveDrag:false,inResizeDrag:false,hiddenIFrame:null,gTabIndexes:new Array(),gTabbableTags:new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME"),imgMaximize:new Image(),imgRestore:new Image(),imgClose:new Image(),imgCloseHover:new Image(),imgMinimize:new Image(),imgMinimizeHover:new Image(),imgMaximize:new Image(),imgMaximizeHover:new Image(),get:function(win){return this.winList[win];},open:function(win){this.winList[win].open();},openURL:function(win,url){this.winList[win].open(url);},getNextZIndex:function(){this.maxzIndex+=2;return this.maxzIndex;},createFromLayerWithIFrame:function(divId,isModal,isMin,isMax,width,height){var d=DomHelper.get(divId);var h=d.innerHTML;var myWindow=DomHelper.get(divId),myClientArea=DomHelper.get('clientArea'+divId),myIframe=DomHelper.get('iframe'+divId);myClientArea.style.height=height+'px';myWindow.width=width+'px';myIframe.style.height='100%';if(browser.isIE)myIframe.style.display='none';d.style.zIndex=(isModal?DisplayManager.getInstance().getTopZIndex():this.getNextZIndex());d.className="window";this.winList[divId]=new VirtualWindow(d,'dynamic',divId,isModal,isMin,isMax);if(document.all){this.winList[divId].ieCheckSizeThread=setInterval("VirtualWindowsManager.get('"+divId+"').checkSize();",1000);}},createFromLayer:function(divId,isModal,isMin,isMax){var d=DomHelper.get(divId);var h=d.innerHTML;d.style.zIndex=(isModal?DisplayManager.getInstance().getTopZIndex():this.getNextZIndex());d.className="window";this.winList[divId]=new VirtualWindow(d,'inline',divId,isModal,isMin,isMax);},hideWindowsFrames:function(){for(var w in this.winList){if(this.winList[w].iframe){this.winList[w].iframe.style.visibility='hidden';}}},showWindowsFrames:function(){for(var w in this.winList){if(this.winList[w].iframe){this.winList[w].iframe.style.visibility='visible';}}},updateMask:function(){var maskDiv=DomHelper.get('popupMask');if(maskDiv===null){maskDiv=document.createElement("DIV");maskDiv.setAttribute('id','popupMask');document.getElementsByTagName('body').item(0).appendChild(maskDiv);}
maskDiv.style.width=document.body.scrollWidth;maskDiv.style.height=document.body.scrollHeight;}};var mouseOvers=new Array();var mouseOuts=new Array();var CLOSE_IMG=0,MINIMIZE_IMG=1,MAXIMIZE_IMG=2;mouseOuts[CLOSE_IMG]=new Image();mouseOuts[CLOSE_IMG].src=SweetDevRIAImagesPath+'/close.gif';mouseOuts[MINIMIZE_IMG]=new Image();mouseOuts[MINIMIZE_IMG].src=SweetDevRIAImagesPath+'/minimize.gif';mouseOuts[MAXIMIZE_IMG]=new Image();mouseOuts[MAXIMIZE_IMG].src=SweetDevRIAImagesPath+'/maximize.gif';mouseOvers[CLOSE_IMG]=new Image();mouseOvers[CLOSE_IMG].src=SweetDevRIAImagesPath+'/close_hover.gif';mouseOvers[MINIMIZE_IMG]=new Image();mouseOvers[MINIMIZE_IMG].src=SweetDevRIAImagesPath+'/minimize_hover.gif';mouseOvers[MAXIMIZE_IMG]=new Image();mouseOvers[MAXIMIZE_IMG].src=SweetDevRIAImagesPath+'/maximize_hover.gif';function VirtualWindow(el,type,id,isModal,canMinimize,canMaximize){var i;this.componentName='DHTMLWindow';this.id=id;this.type=type;this.isModal=isModal;this.canMinimize=canMinimize;this.canMaximize=canMaximize;this.frame=el;this.titleBar=winFindByClassName(el,"titleBar");this.titleBarText=winFindByClassName(el,"titleBarText");this.clientArea=winFindByClassName(el,"clientArea");this.iframe=(this.type=="inline")?null:this.clientArea.getElementsByTagName('IFRAME').item(0);this.ieCheckSizeThread=null;var minBtn=DomHelper.get('minimizeBtn'+this.id),maxBtn=DomHelper.get('maximizeBtn'+this.id),closeBtn=DomHelper.get('closeBtn'+this.id);if(minBtn){minBtn.onmouseover=function(){this.src=mouseOvers[MINIMIZE_IMG].src;};minBtn.onmouseout=function(){this.src=mouseOuts[MINIMIZE_IMG].src;};}
if(maxBtn){maxBtn.onmouseover=function(){this.src=mouseOvers[MAXIMIZE_IMG].src;};maxBtn.onmouseout=function(){this.src=mouseOuts[MAXIMIZE_IMG].src;};}
if(closeBtn){closeBtn.onmouseover=function(){this.src=mouseOvers[CLOSE_IMG].src;};closeBtn.onmouseout=function(){this.src=mouseOuts[CLOSE_IMG].src;};}
this.init=function(){this.isOpen=false;this.isMinimized=false;this.isMaximized=false;this.isResizable=true;this.open=winOpen;this.openURL=winOpenURL;this.close=winClose;this.maximize=winMaximize;this.minimize=winMinimize;this.restore=winRestore;this.minimizeRestore=winMinimizeRestore;this.maxRestore=winMaxRestore;this.maximizeRestore=winMaximizeRestore;this.makeActive=winMakeActive;this.center=winCenter;this.titleBar.parentWindow=this;this.frame.parentWindow=this;if(this.isResizable){this.frame.onmousemove=winResizeCursorSet;this.frame.onmouseout=winResizeCursorRestore;this.frame.onmousedown=winResizeDragStart;}
this.titleBar.parentWindow=this;this.titleBar.onmousedown=winMoveDragStart;this.titleBar.ondblclick=function(){this.parentWindow.maximizeRestore();};this.clientArea.parentWindow=this;this.clientArea.onclick=winClientAreaClick;for(i=0;i<this.titleBar.childNodes.length;i++){if(this.titleBar.childNodes[i].tagName=="A"||this.titleBar.childNodes[i].tagName=="IMG")
this.titleBar.childNodes[i].parentWindow=this;}
var initLt,initWd,w,dw;initLt=this.frame.style.left;initWd=parseInt(this.frame.style.width);this.frame.style.left=-this.titleBarText.offsetWidth+"px";if(browser.isIE){this.titleBarText.style.display="none";w=this.clientArea.offsetWidth;this.widthDiff=this.frame.offsetWidth-w;this.clientArea.style.width=w+"px";dw=this.clientArea.offsetWidth-w;w-=dw;this.widthDiff+=dw;this.titleBarText.style.display="";}
w=this.frame.offsetWidth;this.frame.style.width=w+"px";dw=this.frame.offsetWidth-w;w-=dw;if(w>0)
this.frame.style.width=w+"px";if(browser.isIE)
this.widthDiff-=dw;this.isOpen=true;this.minimize();if(browser.isNS&&browser.version>=1.2)
this.minimumWidth=this.frame.offsetWidth;else
this.minimumWidth=this.frame.offsetWidth-dw;this.titleBarText.style.width="";this.clipTextMinimumWidth=this.frame.offsetWidth-dw;this.minimumHeight=1;this.restore();this.isOpen=false;initWd=Math.max(initWd,this.minimumWidth);this.frame.style.width=initWd;if(browser.isIE){this.clientArea.style.width=(initWd-this.widthDiff)+"px";}else{this.frame.style.display='none';}
if(this.clipTextMinimumWidth>=this.minimumWidth){this.titleBarText.style.width=(VirtualWindowsManager.minimizedTextWidth+initWd-this.minimumWidth)+"px";}
this.frame.style.left=initLt;};this.setTitle=function(title){this.titleBarText.innerHTML=title;};this.moveBy=function(dx,dy){this.frame.style.left=parseInt(this.frame.style.left,10)+dx+'px';this.frame.style.top=parseInt(this.frame.style.top,10)+dy+'px';};this.moveTo=function(x,y){this.frame.style.left=x+'px';this.frame.style.top=y+'px';};this.resizeBy=function(dx,dy){this.frame.style.width=(parseInt(this.frame.style.width,10)+dx)+'px';this.clientArea.style.width=(parseInt(this.clientArea.style.width,10)+dx)+'px';this.clientArea.style.height=(parseInt(this.clientArea.style.height,10)+dy)+'px';};this.resizeTo=function(x,y){var diff=this.frame.offsetWidth-this.clientArea.offsetWidth;this.frame.style.width=x+'px';if(document.all)this.clientArea.style.width=(x-diff)+'px';this.clientArea.style.height=y+'px';};this.checkSize=function(){var iw=this.iframe.offsetWidth;var ih=this.iframe.offsetHeight;var cw=this.clientArea.offsetWidth;var ch=this.clientArea.offsetHeight;if((iw!=cw)||(ih-ch)){this.iframe.style.width=cw+'px';this.iframe.style.height=ch+'px';}};if(browser.isIE)
setTimeout("VirtualWindowsManager.get('"+id+"').init();",500);else
this.init();}
function winOpen(){if(this.isModal){VirtualWindowsManager.updateMask();DomHelper.get('popupMask').style.display="block";disableTabIndexes();}
if(this.isOpen){this.center();LayoutManager.moveIFrame(this.id,this.frame);return;}
this.makeActive();this.isOpen=true;if(this.isMinimized)this.restore();this.frame.style.visibility='visible';this.frame.style.display='';if(this.iframe){this.iframe.style.visibility='visible';this.iframe.style.display='';this.iframe.onload=new Function("DomHelper.get('"+this.iframe.id+"').style.display='block';");}
this.center();LayoutManager.changeSelectVisibility(document,false);if(this.isModal)
LayoutManager.changeSelectState(document,false);LayoutManager.changeSelectVisibility(this.clientArea,true);if(this.isModal)
LayoutManager.changeSelectState(this.clientArea,true);LayoutManager.addMaskIFrame(this.id,this.frame);VirtualWindowsManager.presentList.register(this.id);}
function winOpenURL(url,refreshSource){if(this.iframe){if((this.iframe.src===""||this.iframe.src==="about:blank")||(refreshSource)){this.iframe.src=SweetDevRIAJSPPath+'/waiting.jsp';setTimeout("VirtualWindowsManager.get('"+this.id+"').iframe.src = '"+url+"'",500);}}
this.open();}
function winClose(){VirtualWindowsManager.presentList.unregister(this.id);if(this.isModal){DomHelper.get('popupMask').style.display="none";restoreTabIndexes();}
if(VirtualWindowsManager.presentList.size()===0){LayoutManager.changeSelectVisibility(document,true);}else{for(var w in VirtualWindowsManager.winList){if(VirtualWindowsManager.winList[w].isOpen===true&&VirtualWindowsManager.winList[w]!==this){VirtualWindowsManager.winList[w].makeActive();break;}}}
if(this.isModal)
LayoutManager.changeSelectState(document,true);LayoutManager.removeTransparentIFrame(this.id,this.frame);this.frame.style.display="none";this.frame.style.visibility="hidden";this.isOpen=false;VirtualWindowsManager.showWindowsFrames();if(navigator.userAgent.indexOf("Firefox/1.0")!=-1){DomHelper.get('closeBtn'+this.id).onmouseout();}}
function winMaximizeRestore(){if(!this.canMaximize)
return;if(this.isMaximized){if(this.isResizable){this.frame.onmousemove=winResizeCursorSet;this.frame.onmouseout=winResizeCursorRestore;this.frame.onmousedown=winResizeDragStart;this.titleBar.onmousedown=winMoveDragStart;}
this.maxRestore();}else if(this.isMinimized){this.minimizeRestore();}else{if(this.isResizable){this.frame.onmousemove=function(){null;};this.frame.onmouseout=function(){null;};this.frame.onmousedown=function(){null;};this.titleBar.onmousedown=function(){null;};}
this.maximize();LayoutManager.moveIFrame(this.id,this.frame);}}
function winMaximize(){if(!this.canMaximize)
return;VirtualWindowsManager.showWindowsFrames();if(!this.isOpen||this.isMaximized)return;this.makeActive();this.restoreFrameTop=parseInt(this.frame.style.top,10);this.restoreFrameLeft=parseInt(this.frame.style.left,10);this.restoreFrameWidth=this.frame.style.width;this.restoreFrameHeight=this.frame.style.height;this.restoreClientHeight=this.clientArea.style.height;this.restoreClientWidth=this.clientArea.style.width;this.restoreTextWidth=this.titleBarText.style.width;this.moveTo(0,0);var diff=this.frame.offsetHeight-this.clientArea.offsetHeight;this.clientArea.style.height=(LayoutManager.getViewportHeight()-diff)+"px";diff=parseInt(this.frame.style.width,10)-parseInt(this.clientArea.style.width,10);var w=LayoutManager.getViewportWidth()-8;this.frame.style.width=w+"px";this.clientArea.style.width=(w-diff)+'px';this.isMaximized=true;LayoutManager.moveIFrame(this.id,this.frame);}
function winMaxRestore(){if(!this.canMaximize)
return;VirtualWindowsManager.showWindowsFrames();if(!this.isOpen||!this.isMaximized)return;this.makeActive();this.moveTo(this.restoreFrameLeft,this.restoreFrameTop);this.frame.style.width=this.restoreFrameWidth;this.frame.style.height=this.restoreFrameHeight;this.clientArea.style.width=this.restoreClientWidth;this.clientArea.style.height=this.restoreClientHeight;this.titleBarText.style.width=this.restoreTextWidth;this.isMaximized=false;LayoutManager.moveIFrame(this.id,this.frame);}
function winMinimizeRestore(){if(this.isMinimized){this.restore();}else{this.minimize();}
LayoutManager.moveIFrame(this.id,this.frame);}
function winMinimize(){if(this.isMaximized)
this.maxRestore();VirtualWindowsManager.showWindowsFrames();if(!this.isOpen||this.isMinimized)return;this.makeActive();this.restoreFrameWidth=this.frame.style.width;this.restoreTextWidth=this.titleBarText.style.width;this.clientArea.style.display="none";if(this.minimumWidth)this.frame.style.width=this.minimumWidth+"px";else this.frame.style.width="";this.titleBarText.style.width=VirtualWindowsManager.minimizedTextWidth+"px";this.isMinimized=true;LayoutManager.moveIFrame(this.id,this.frame);}
function winRestore(){VirtualWindowsManager.showWindowsFrames();if(!this.isOpen||!this.isMinimized)return;this.makeActive();this.clientArea.style.display="";this.frame.style.width=this.restoreFrameWidth;this.titleBarText.style.width=this.restoreTextWidth;this.isMinimized=false;LayoutManager.moveIFrame(this.id,this.frame);}
function winMakeActive(){var tmp,tmp2,maxZ;if(VirtualWindowsManager.active==this)
return;if(VirtualWindowsManager.active){LayoutManager.changeSelectVisibility(VirtualWindowsManager.active.clientArea,false);DomHelper.addClassName(VirtualWindowsManager.active.frame,'inactive');DomHelper.removeClassName(VirtualWindowsManager.active.frame,'active');if(browser.isNS&&browser.version<6.1)
VirtualWindowsManager.active.clientArea.style.overflow="hidden";if(VirtualWindowsManager.active.inactiveButtonsImage)
VirtualWindowsManager.active.titleBarButtons.src=VirtualWindowsManager.active.inactiveButtonsImage;}
DomHelper.addClassName(this.frame,'active');DomHelper.removeClassName(this.frame,'inactive');if(browser.isNS&&browser.version<6.1)
this.clientArea.style.overflow="auto";if(this.inactiveButtonsImage)
this.titleBarButtons.src=this.activeButtonsImage;if(!this.isModal)
this.frame.style.zIndex=VirtualWindowsManager.getNextZIndex();LayoutManager.changeSelectVisibility(this.clientArea,true);LayoutManager.setIFrameZIndex(this.id,this.frame);VirtualWindowsManager.active=this;}
function winClientAreaClick(event){if(this.parentWindow.isOpen)
this.parentWindow.makeActive();}
function winMoveDragStart(event){var target;var x,y;if(browser.isIE)target=window.event.srcElement.tagName;if(browser.isNS)target=event.target.tagName;if(target=="AREA")return;this.parentWindow.makeActive();if(browser.isIE){x=window.event.x;y=window.event.y;}
if(browser.isNS){x=event.pageX;y=event.pageY;}
VirtualWindowsManager.xOffset=VirtualWindowsManager.active.frame.offsetLeft-x;VirtualWindowsManager.yOffset=VirtualWindowsManager.active.frame.offsetTop-y;EventHelper.addListener(document,'mousemove',winMoveDragGo);EventHelper.addListener(document,'mouseup',winMoveDragStop);VirtualWindowsManager.inMoveDrag=true;}
function winMoveDragGo(event){var x,y;if(!VirtualWindowsManager.inMoveDrag)return;if(browser.isIE){x=window.event.x;y=window.event.y;window.event.cancelBubble=true;window.event.returnValue=false;}
if(browser.isNS){x=event.pageX;y=event.pageY;event.preventDefault();}
var oldX=x;var oldY=y;VirtualWindowsManager.active.frame.style.left=Math.max(0,x+VirtualWindowsManager.xOffset)+"px";VirtualWindowsManager.active.frame.style.top=Math.max(0,y+VirtualWindowsManager.yOffset)+"px";LayoutManager.moveIFrame(VirtualWindowsManager.active.id,VirtualWindowsManager.active.frame);}
function winMoveDragStop(event){VirtualWindowsManager.inMoveDrag=false;VirtualWindowsManager.showWindowsFrames();VirtualWindowsManager.updateMask();EventHelper.removeListener(document,'mousemove',winMoveDragGo);EventHelper.removeListener(document,'mouseup',winMoveDragStop);}
function winResizeCursorSet(event){var target;var xOff,yOff;if(this.parentWindow.isMinimized||VirtualWindowsManager.inResizeDrag)
return;if(browser.isIE)
target=window.event.srcElement;if(browser.isNS)
target=event.target;if(target!=this.parentWindow.frame)
return;if(browser.isIE){xOff=window.event.offsetX;yOff=window.event.offsetY;}
if(browser.isNS){xOff=event.layerX;yOff=event.layerY;}
VirtualWindowsManager.resizeDirection="";if(yOff<=VirtualWindowsManager.resizeCornerSize)
VirtualWindowsManager.resizeDirection+="n";else if(yOff>=this.parentWindow.frame.offsetHeight-VirtualWindowsManager.resizeCornerSize)
VirtualWindowsManager.resizeDirection+="s";if(xOff<=VirtualWindowsManager.resizeCornerSize)
VirtualWindowsManager.resizeDirection+="w";else if(xOff>=this.parentWindow.frame.offsetWidth-VirtualWindowsManager.resizeCornerSize)
VirtualWindowsManager.resizeDirection+="e";if(VirtualWindowsManager.resizeDirection===""){this.onmouseout(event);return;}
if(browser.isIE)
document.body.style.cursor=VirtualWindowsManager.resizeDirection+"-resize";if(browser.isNS)
this.parentWindow.frame.style.cursor=VirtualWindowsManager.resizeDirection+"-resize";}
function winResizeCursorRestore(event){if(VirtualWindowsManager.inResizeDrag)
return;if(browser.isIE)
document.body.style.cursor="";if(browser.isNS)
this.parentWindow.frame.style.cursor="";}
function winResizeDragStart(event){var target;VirtualWindowsManager.hideWindowsFrames();if(browser.isIE)target=window.event.srcElement;if(browser.isNS)target=event.target;if(target!=this.parentWindow.frame)return;this.parentWindow.makeActive();if(this.parentWindow.isMinimized)return;if(browser.isIE){VirtualWindowsManager.xPosition=window.event.x;VirtualWindowsManager.yPosition=window.event.y;}
if(browser.isNS){VirtualWindowsManager.xPosition=event.pageX;VirtualWindowsManager.yPosition=event.pageY;}
VirtualWindowsManager.oldLeft=parseInt(this.parentWindow.frame.style.left,10);VirtualWindowsManager.oldTop=parseInt(this.parentWindow.frame.style.top,10);VirtualWindowsManager.oldWidth=parseInt(this.parentWindow.frame.style.width,10);VirtualWindowsManager.oldHeight=parseInt(this.parentWindow.clientArea.style.height,10);Event.observe(document,'mousemove',winResizeDragGo,false);Event.observe(document,'mouseup',winResizeDragStop,false);VirtualWindowsManager.inResizeDrag=true;}
function winResizeDragGo(event){var north,south,east,west;var dx,dy;var w,h;if(!VirtualWindowsManager.inResizeDrag)return;north=(VirtualWindowsManager.resizeDirection.charAt(0)=="n");south=(VirtualWindowsManager.resizeDirection.charAt(0)=="s");east=(VirtualWindowsManager.resizeDirection.indexOf("e")>-1);west=(VirtualWindowsManager.resizeDirection.indexOf("w")>-1);if(browser.isIE){dx=window.event.x-VirtualWindowsManager.xPosition;dy=window.event.y-VirtualWindowsManager.yPosition;}
if(browser.isNS){dx=event.pageX-VirtualWindowsManager.xPosition;dy=event.pageY-VirtualWindowsManager.yPosition;}
if(west)
dx=-dx;if(north)
dy=-dy;w=VirtualWindowsManager.oldWidth+dx;h=VirtualWindowsManager.oldHeight+dy;if(w<=VirtualWindowsManager.active.minimumWidth){w=VirtualWindowsManager.active.minimumWidth;dx=w-VirtualWindowsManager.oldWidth;}
if(h<=VirtualWindowsManager.active.minimumHeight){h=VirtualWindowsManager.active.minimumHeight;dy=h-VirtualWindowsManager.oldHeight;}
if(east||west){VirtualWindowsManager.active.frame.style.width=w+"px";if(browser.isIE)
VirtualWindowsManager.active.clientArea.style.width=(w-VirtualWindowsManager.active.widthDiff)+"px";}
if(north||south)
VirtualWindowsManager.active.clientArea.style.height=h+"px";if(east||west){if(w<VirtualWindowsManager.active.clipTextMinimumWidth)
VirtualWindowsManager.active.titleBarText.style.width=(VirtualWindowsManager.minimizedTextWidth+w-VirtualWindowsManager.active.minimumWidth)+"px";else
VirtualWindowsManager.active.titleBarText.style.width="";}
if(west)
VirtualWindowsManager.active.frame.style.left=(VirtualWindowsManager.oldLeft-dx)+"px";if(north)
VirtualWindowsManager.active.frame.style.top=Math.max(VirtualWindowsManager.oldTop-dy,0)+"px";if(browser.isIE){window.event.cancelBubble=true;window.event.returnValue=false;}
if(browser.isNS)
event.preventDefault();LayoutManager.moveIFrame(VirtualWindowsManager.active.id,VirtualWindowsManager.active.frame);}
function winResizeDragStop(event){VirtualWindowsManager.inResizeDrag=false;VirtualWindowsManager.showWindowsFrames();VirtualWindowsManager.updateMask();EventHelper.removeListener(document,'mousemove',winResizeDragGo);EventHelper.removeListener(document,'mouseup',winResizeDragStop);}
function winFindByClassName(el,className){var i,tmp;if(el.className==className)return el;for(i=0;i<el.childNodes.length;i++){tmp=winFindByClassName(el.childNodes[i],className);if(tmp!==null)return tmp;}
return null;}
function winCenter(){var win=this.frame;var scrollTop=parseInt(document.body.scrollTop,10),scrollLeft=parseInt(document.body.scrollLeft,10);win.style.top=(Math.max(0,(Math.ceil((LayoutManager.getViewportHeight()-(parseInt(win.offsetHeight,10)+20))/2)))+scrollTop)+'px';win.style.left=(Math.max(0,(Math.ceil((LayoutManager.getViewportWidth()-parseInt(win.offsetWidth,10))/2)))+scrollLeft)+'px';}
function keyDownHandler(e){if(VirtualWindowsManager.popupsShown&&e.keyCode==9)return false;}
function disableTabIndexes(){if(document.all){var i=0;for(var j=0;j<VirtualWindowsManager.gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(VirtualWindowsManager.gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){VirtualWindowsManager.gTabIndexes[i]=tagElements[k].tabIndex;tagElements[k].tabIndex="-1";i++;}}}}
function restoreTabIndexes(){if(document.all){var i=0;for(var j=0;j<VirtualWindowsManager.gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(VirtualWindowsManager.gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){tagElements[k].tabIndex=VirtualWindowsManager.gTabIndexes[i];tagElements[k].tabEnabled=true;i++;}}}}
BaseCalendar=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);superClass(this,RiaComponent,id,"CalendarBase");}
this.tooltip=null;this.mustBeRendered=false;this.acronymCounter=0;this.acronymDates=null;this.acronymList=null;this.acronymCss=null;};extendsClass(BaseCalendar,RiaComponent,YAHOO.widget.Calendar);BaseCalendar.prototype._unload=function(e,cal){if(!cal){return;}
for(var c in cal.cells){c=null;}
cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};BaseCalendar.prototype.render=function(){if(this.tooltip&&!this.tooltip.opened){this.mustBeRendered=true;return;}
if(!this.shellRendered){this.table=DomHelper.get(this.id+"table");this.tbody=DomHelper.get(this.id+"tbody");this.headerCell=DomHelper.get(this.id+"header");EventHelper.addListener(window,"unload",this._unload,this);this.addCells(this.tbody);this.shellRendered=true;this.buildShellFooter();}
this.resetRenderers();this.acronymCounter=0;this.cellDates.length=0;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.pageDate);this.renderHeader();this.renderBody(workingDate);this.renderFooter();this.onRender();};BaseCalendar.prototype.addCells=function(node){if(node&&node.childNodes&&node.childNodes.length>0){for(var i=0;i<node.childNodes.length;i++){if(!node.childNodes[i]){continue;}
if(node.childNodes[i].nodeName=="TD"){this.cells[this.cells.length]=node.childNodes[i];YAHOO.util.Event.addListener(node.childNodes[i],"click",this.doSelectCell,this);YAHOO.util.Event.addListener(node.childNodes[i],"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(node.childNodes[i],"mouseout",this.doCellMouseOut,this);}else{if(node.childNodes[i].childNodes&&node.childNodes[i].childNodes.length>0){this.addCells(node.childNodes[i]);}}}}};BaseCalendar.prototype.renderHeader=function(){if(!this.linkMonthLeft){this.linkMonthLeft=DomHelper.get(this.id+"navMonthLeft");if(this.linkMonthLeft){this.addListenerPrevionsMonth(this.linkMonthLeft);}}
if(!this.linkYearLeft){this.linkYearLeft=DomHelper.get(this.id+"navYearLeft");if(this.linkYearLeft){this.addListenerPrevionsYear(this.linkYearLeft);}}
if(!this.linkMonthRight){this.linkMonthRight=DomHelper.get(this.id+"navMonthRight");if(this.linkMonthRight){this.addListenerNextMonth(this.linkMonthRight);}}
if(!this.linkYearRight){this.linkYearRight=DomHelper.get(this.id+"navYearRight");if(this.linkYearRight){this.addListenerNextYear(this.linkYearRight);}}
if(!this.labelMonth){this.labelMonth=DomHelper.get(this.id+"Month");}
if(this.labelMonth){this.labelMonth.innerHTML=this.buildMonthLabel();}};BaseCalendar.prototype.addListenerPrevionsMonth=function(link){if(this.parent){YAHOO.util.Event.addListener(link,"mousedown",this.parent.doPreviousMonth,this.parent);}else{YAHOO.util.Event.addListener(link,"mousedown",this.previousMonth,this,true);}};BaseCalendar.prototype.addListenerPrevionsYear=function(link){if(this.parent){YAHOO.util.Event.addListener(link,"mousedown",this.parent.doPreviousYear,this.parent);}else{YAHOO.util.Event.addListener(link,"mousedown",this.previousYear,this,true);}};BaseCalendar.prototype.addListenerNextMonth=function(link){if(this.parent){YAHOO.util.Event.addListener(link,"mousedown",this.parent.doNextMonth,this.parent);}else{YAHOO.util.Event.addListener(link,"mousedown",this.nextMonth,this,true);}};BaseCalendar.prototype.addListenerNextYear=function(link){if(this.parent){YAHOO.util.Event.addListener(link,"mousedown",this.parent.doNextYear,this.parent);}else{YAHOO.util.Event.addListener(link,"mousedown",this.nextYear,this,true);}};BaseCalendar.prototype.buildShellFooter=function(){if(!this.linkToday){this.linkToday=DomHelper.get(this.id+"Today");this.addListenerGoOnToday(this.linkToday);}
if(!this.linkClear){this.linkClear=DomHelper.get(this.id+"Clear");this.addListenerClear(this.linkClear);}
if(!this.linkClose){this.linkClose=DomHelper.get(this.id+"Close");this.addListenerClose(this.linkClose);}};BaseCalendar.prototype.addListenerGoOnToday=function(link){if(this.parent){YAHOO.util.Event.addListener(link,"mousedown",this.parent.doGoOnToday,this.parent);}else{YAHOO.util.Event.addListener(link,"mousedown",this.goOnToday,this,true);}};BaseCalendar.prototype.addListenerClear=function(link){if(this.parent){YAHOO.util.Event.addListener(link,"mousedown",this.parent.doResetCalendar,this.parent);}else{YAHOO.util.Event.addListener(link,"mousedown",this.resetCalendar,this,true);}};BaseCalendar.prototype.addListenerClose=function(link){YAHOO.util.Event.addListener(link,"mousedown",this.close,this,true);};BaseCalendar.prototype.goOnToday=function(){var now=new Date();this.setMonth(now.getMonth());this.setYear(now.getFullYear());this.render();};BaseCalendar.prototype.focus=function(){if(this.selectedDates.length===0){this.goOnToday();}
if(this.setActive){this.setActive(true);}};BaseCalendar.prototype.addAcronymRender=function(dateList,acronymList,cssStyleClass){this.acronymDates=this._parseDates(dateList);this.acronymList=acronymList;this.acronymCss=cssStyleClass;this.render();};BaseCalendar.prototype.renderCellDefault=function(workingDate,cell){var acronymAndCss=null;cell.innerHTML="";if((this.acronymDates&&this.acronymDates.length!==0)&&(this.acronymCounter<this.acronymDates.length)){acronymAndCss=this.getAcronymAndCss(workingDate);if(acronymAndCss){this.acronymCounter++;var acronym=document.createElement("ACRONYM");acronym.title=acronymAndCss[0];cell.appendChild(acronym);YAHOO.util.Dom.addClass(cell,acronymAndCss[1]);cell=acronym;}}
var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};BaseCalendar.prototype.getAcronymAndCss=function(workingDate){var tstYear=true;var dat=null,i=0;for(;i<this.acronymDates.length;++i){var aDate=this.acronymDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){SweetDevRia.log.debug("Range mode is not available for acronym render.");}else{dat=new Date();dat.setMonth(parseInt(aDate[0],10)-1);dat.setDate(parseInt(aDate[1],10));}}else if(aDate.length==3){dat=new Date(parseInt(aDate[0],10),parseInt(aDate[1],10)-1,parseInt(aDate[2],10),0,0,0);tstYear=(dat.getFullYear()==workingDate.getFullYear());}
if(tstYear&&(dat.getMonth()==workingDate.getMonth())&&(dat.getDate()==workingDate.getDate())){return new Array(this.acronymList[i],this.acronymCss[i]);}}
return null;};BaseCalendar.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RESTRICTED);cell.innerHTML=workingDate.getDate();return;};BaseCalendar.prototype.handleEvent=function(evt){if(!this.isActive()){return true;}
if(evt&&evt.type&&evt.type==RiaEvent.KEYBOARD_TYPE){if(evt.keyCode==KeyListener.ESCAPE_KEY){if(this.setActive){EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);this.close();this.setActive(false);return false;}}}
return true;};BaseCalendar.prototype.close=function(){if(this.tooltip){if(this.setActive){this.setActive(false);}
this.tooltip.close();return true;}else if(this.parent&&this.parent.tooltip){if(this.setActive){this.setActive(false);}
this.parent.tooltip.setActive(false);this.parent.tooltip.close();return true;}
return false;};BaseCalendar.prototype.getIndex=function(dat){for(var i=0;i<this.cellDates.length;i++){if(dat.getFullYear()==this.cellDates[i][0]&&dat.getMonth()+1==this.cellDates[i][1]&&dat.getDate()==this.cellDates[i][2]){return i;}}
return-1;};BaseCalendar.prototype.onCurrentMonth=function(dat){return dat.getMonth()+1==this.cellDates[15][1];};BaseCalendar.prototype.openTooltip=function(tooltipLink){if(SweetDevRia.getComponent(this.id+'tooltip').open(tooltipLink)){if(this.focus){this.focus();}
if(this.mustBeRendered==true){this.mustBeRendered=false;this.render();}}
return false;}
function SimpleCalendar(id,containerId,monthyear,selected){if(arguments.length>0)
{this.init(id,containerId,monthyear,selected);superClass(this,BaseCalendar,id,"CalendarSimple");}
this.singleDateField=null;this.dateDayField=null;this.dateMonthField=null;this.dateYearField=null;this.hiddenDateField=null;this.CssBadFormat="calBadFormat";}
extendsClass(SimpleCalendar,BaseCalendar);SimpleCalendar.prototype.isSelectedDateValid=function(){if(this.dateMonthField){return!DomHelper.hasClassName(this.dateMonthField,this.CssBadFormat);}
if(this.singleDateField){return!DomHelper.hasClassName(this.singleDateField,this.CssBadFormat);}};SimpleCalendar.prototype.addSingleDateField=function(singleDateFieldId){this.singleDateField=DomHelper.get(singleDateFieldId);this.singleDateField.calInstance=this;YAHOO.util.Event.addListener(this.singleDateField,"blur",this.acceptDate,this);YAHOO.util.Event.addListener(this.singleDateField,"focus",this.deactivate,this);YAHOO.util.Event.addListener(this.singleDateField,"keydown",this.handleInputEvent,this);};SimpleCalendar.prototype.handleInputEvent=function(event){EventHelper.stopPropagation(event);return true;};SimpleCalendar.prototype.deactivate=function(){this.calInstance.close();};SimpleCalendar.prototype.addExplodedDateField=function(yearFieldId,monthFieldId,dayFieldId){this.dateYearField=DomHelper.get(yearFieldId);this.dateMonthField=DomHelper.get(monthFieldId);this.dateDayField=DomHelper.get(dayFieldId);this.dateYearField.calInstance=this;this.dateMonthField.calInstance=this;this.dateDayField.calInstance=this;YAHOO.util.Event.addListener(this.dateYearField,"blur",this.acceptDate,this);YAHOO.util.Event.addListener(this.dateMonthField,"blur",this.acceptDate,this);YAHOO.util.Event.addListener(this.dateDayField,"blur",this.acceptDate,this);YAHOO.util.Event.addListener(this.dateYearField,"focus",this.deactivate,this);YAHOO.util.Event.addListener(this.dateMonthField,"focus",this.deactivate,this);YAHOO.util.Event.addListener(this.dateDayField,"focus",this.deactivate,this);YAHOO.util.Event.addListener(this.dateYearField,"keydown",this.handleInputEvent,this);YAHOO.util.Event.addListener(this.dateMonthField,"keydown",this.handleInputEvent,this);YAHOO.util.Event.addListener(this.dateDayField,"keydown",this.handleInputEvent,this);};SimpleCalendar.prototype.addHiddenDateField=function(hiddenDateFieldId){this.hiddenDateField=DomHelper.get(hiddenDateFieldId);};SimpleCalendar.prototype.clearBadFormat=function(){DomHelper.removeClassName(this.singleDateField,this.CssBadFormat);DomHelper.removeClassName(this.dateYearField,this.CssBadFormat);DomHelper.removeClassName(this.dateMonthField,this.CssBadFormat);DomHelper.removeClassName(this.dateDayField,this.CssBadFormat);};SimpleCalendar.prototype.acceptDate=function(){if(!this||!this.calInstance){SweetDevRia.log.error("acceptDate : 'this' is null !");return false;}
if((this.parent&&((this.parent.tooltip&&this.parent.tooltip.opened)||!this.parent.tooltip))||!this.tooltip||(this.tooltip&&this.tooltip.opened)){this.calInstance.setActive(true);}
DomHelper.removeClassName(this,this.CssBadFormat);this.calInstance.clearBadFormat();this.calInstance.deselectAll();var verif,dateValue;try{if(this.calInstance.singleDateField==this){var datePattern="^"+DateFormat.pattern.toUpperCase()+"$";datePattern=datePattern.replace("YYYY","[0-9]{4,4}").replace("YY","[0-9]{1,2}").replace("DD","[0-9]{1,2}").replace("MM","[0-9]{1,2}").replace(/\//g,DateFormat.separator);verif=new RegExp(datePattern);if(verif.test(this.value)){DateFormat.prepareDateField(this);dateValue=DateFormat.parseDate(this.value);if(dateValue===null){throw("BadDateException");}}else{throw("BadFormatException");}}else{if(this==this.calInstance.dateYearField&&DateFormat.pattern.toUpperCase().indexOf("YYYY")!==-1){verif=new RegExp("^[0-9]{4,4}$");}else{verif=new RegExp("^[0-9]{1,2}$");}
if(verif.test(this.value)){DateFormat.prepareDateField(this);if(this.calInstance.dateDayField.value.length>0&&this.calInstance.dateMonthField.value.length>0&&this.calInstance.dateYearField.value.length>0){dateValue=DateFormat.getDate(this.calInstance.dateYearField.value,this.calInstance.dateMonthField.value,this.calInstance.dateDayField.value);if(dateValue===null){throw("BadDateException");}}}else{throw("BadFormatException");}}
if(dateValue){this.calInstance.clearBadFormat();this.calInstance.select(dateValue);this.calInstance.setNewDate(dateValue);}}catch(e){this.calInstance.render();DomHelper.addClassName(this,this.calInstance.CssBadFormat);DomHelper.addClassName(this.calInstance.dateYearField,this.calInstance.CssBadFormat);DomHelper.addClassName(this.calInstance.dateMonthField,this.calInstance.CssBadFormat);DomHelper.addClassName(this.calInstance.dateDayField,this.calInstance.CssBadFormat);SweetDevRia.log.warn("Error on parsing date ["+e+"]");}};SimpleCalendar.prototype.resetCalendar=function(){if(this.parent){this.parent.resetCalendar();this.close();return true;}else{this.emptyDatefields();this.deselectAll();this.setMonth(new Date().getMonth());this.setYear(new Date().getFullYear());this.render();this.setActive(false);return true;}
return false;};SimpleCalendar.prototype.goOnToday=function(){this.deselectAll();this.select(new Date());BaseCalendar.prototype.goOnToday.call(this);this.fillDateInfields();this.setActive(true);};SimpleCalendar.prototype.fillDateInfields=function(){if(this.parent){this.parent.fillDateInfields();}else{if(this.getSelDates().length===0){this.emptyDatefields();return false;}else if(this.getSelDates().length==1){this.clearBadFormat();if(this.singleDateField!==null){this.singleDateField.value=DateFormat.getDateFromPattern(this.getSelDates()[0][0],this.getSelDates()[0][1],this.getSelDates()[0][2]);}
if(this.hiddenDateField!==null){this.hiddenDateField.value=DateFormat.getDateFromPattern(this.getSelDates()[0][0],this.getSelDates()[0][1],this.getSelDates()[0][2]);}
if(this.dateDayField!==null){this.dateDayField.value=DateFormat.getDay(this.getSelDates()[0][2]);}
if(this.dateMonthField!==null){this.dateMonthField.value=DateFormat.getMonth(this.getSelDates()[0][1]);}
if(this.dateYearField!==null){this.dateYearField.value=DateFormat.getYear(this.getSelDates()[0][0]);}}else{if(this.hiddenDateField!==null){this.hiddenDateField.value="";for(var i=0;i<this.getSelDates().length;i++){this.hiddenDateField.value+=((i>0)?DateFormat.multiDateSeparator:"")+DateFormat.getDateFromPattern(this.getSelDates()[i][0],this.getSelDates()[i][1],this.getSelDates()[i][2]);}}}}};SimpleCalendar.prototype.getSelDates=function(){if(this.parent){return this.parent.selectedDates;}else{return this.selectedDates;}};SimpleCalendar.prototype.emptyDatefields=function(){this.clearBadFormat();if(this.singleDateField!==null){this.singleDateField.value="";}
if(this.hiddenDateField!==null){this.hiddenDateField.value="";}
if(this.dateDayField!==null){this.dateDayField.value="";}
if(this.dateMonthField!==null){this.dateMonthField.value="";}
if(this.dateYearField!==null){this.dateYearField.value="";}};SimpleCalendar.prototype.handleEvent=function(evt){if(!this.isActive()){return true;}
if(evt&&evt.type){if(evt.type==RiaEvent.KEYBOARD_TYPE){var dat=null,keyCode=evt.keyCode;if(this.getSelDates().length==1){dat=new Date(this.getSelDates()[0][0],this.getSelDates()[0][1]-1,this.getSelDates()[0][2]);}
switch(keyCode){case KeyListener.ARROW_UP_KEY:if(dat){dat=YAHOO.widget.DateMath.subtract(dat,YAHOO.widget.DateMath.DAY,7);}
break;case KeyListener.ARROW_LEFT_KEY:if(dat){dat=YAHOO.widget.DateMath.subtract(dat,YAHOO.widget.DateMath.DAY,1);}
break;case KeyListener.ARROW_DOWN_KEY:if(dat){dat=YAHOO.widget.DateMath.add(dat,YAHOO.widget.DateMath.DAY,7);}
break;case KeyListener.ARROW_RIGHT_KEY:if(dat){dat=YAHOO.widget.DateMath.add(dat,YAHOO.widget.DateMath.DAY,1);}
break;case KeyListener.ESCAPE_KEY:this.resetCalendar();break;case KeyListener.ENTER_KEY:case KeyListener.SPACE_KEY:EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);this.close();this.setActive(false);return false;default:break;}
if(this.Options.MULTI_SELECT){SweetDevRia.log.warn("No keyboard support for multidate calendar !");EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);return true;}
while(this.isRestrictedDate(dat)){switch(keyCode){case KeyListener.ARROW_UP_KEY:case KeyListener.ARROW_LEFT_KEY:if(dat){dat=YAHOO.widget.DateMath.subtract(dat,YAHOO.widget.DateMath.DAY,1);}
break;case KeyListener.ARROW_DOWN_KEY:case KeyListener.ARROW_RIGHT_KEY:if(dat){dat=YAHOO.widget.DateMath.add(dat,YAHOO.widget.DateMath.DAY,1);}
break;default:break;}}
this.setNewDateAndFillDateInFields(dat);EventHelper.stopPropagation(evt.srcEvent);EventHelper.preventDefault(evt.srcEvent);return false;}}};SimpleCalendar.prototype.isRestrictedDate=function(dat){for(var r=0;r<this._renderStack.length;++r){var rArray=this._renderStack[r];var type=rArray[0];var fn=rArray[2];var month,day,year;if(fn==this.renderBodyCellRestricted){switch(type){case YAHOO.widget.Calendar_Core.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(year==dat.getFullYear()&&month==(dat.getMonth()+1)&&day==dat.getDate()){return true;}
break;case YAHOO.widget.Calendar_Core.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(month==(dat.getMonth()+1)&&day==dat.getDate()){return true;}
break;case YAHOO.widget.Calendar_Core.RANGE:break;case YAHOO.widget.Calendar_Core.WEEKDAY:break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(month==(dat.getMonth()+1)){return true;}
break;default:break;}}}
return false;};SimpleCalendar.prototype.setNewDateAndFillDateInFields=function(dat){this.select(dat);this.setNewDate(dat);this.fillDateInfields();return true;};SimpleCalendar.prototype.setNewDate=function(dat){var idx=this.getIndex(dat);if(this.parent){var sameMonth=true;if(this.selectedDates.length==1){sameMonth=(this.selectedDates[0][1]==this.pageDate.getMonth()+1);}
if(idx==-1||!sameMonth){this.parent.setMonth(dat.getMonth());this.parent.setYear(dat.getFullYear());this.parent.render();}else{this.selectCell(idx);}
return true;}else{if(idx==-1){this.setMonth(dat.getMonth());this.setYear(dat.getFullYear());this.render();}else{this.selectCell(idx);}
return true;}
return false;};SimpleCalendar.prototype.wireCustomEvents=function(){this.doSelectCell=function(e,cal){cal.setActive(true);var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){var link=null;if(cal.Options.MULTI_SELECT){link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{link=cell.getElementsByTagName("A")[0];link.blur();cal.selectCell(index);}}
cal.fillDateInfields();if(!cal.Options.MULTI_SELECT){cal.close();}};};StandAloneCalendar=function(id,containerId,monthyear,selected){if(arguments.length>0)
{this.init(id,containerId,monthyear,selected);}
superClass(this,BaseCalendar,id,"CalendarStandAlone");};extendsClass(StandAloneCalendar,BaseCalendar);StandAloneCalendar.prototype.select=null;StandAloneCalendar.prototype.setActive=null;StandAloneCalendar.prototype.focus=null;StandAloneCalendar.prototype.wireCustomEvents=function(){this.doSelectCell=function(e,cal){null;};this.doCellMouseOver=function(e,cal){null;};this.doCellMouseOut=function(e,cal){null;};};function DateRangeCalendar(id,containerId,monthyear,selected){if(arguments.length>0)
{this.init(id,containerId,monthyear,selected);superClass(this,SimpleCalendar,id,"CalendarSimple");this.Options.MULTI_SELECT=true;this._renderStack=new Array();}
this.oldRenderStack=new Array();}
extendsClass(DateRangeCalendar,SimpleCalendar);DateRangeCalendar.prototype.selectCell=function(cellIndex){return this.doSelectCellIfRange(BaseCalendar.prototype.selectCell,cellIndex);};DateRangeCalendar.prototype.select=function(date){return this.doSelectCellIfRange(YAHOO.widget.Calendar_Core.prototype.select,date);};DateRangeCalendar.prototype.doSelectCellIfRange=function(fct,arg){var ret;if(this.getSelDates().length>=2){ret=false;}else{ret=fct.call(this,arg);if(this.getSelDates().length==2){this.highlightPeriod();}
this.fillDateInfields();}
return ret;};DateRangeCalendar.prototype.onDeselect=function(){if(this.getSelDates().length==1){if(this.parent&&this.parent.clearPeriodDateRange){this.parent.clearPeriodDateRange();this.parent.render();}else{this._renderStack.copy(this.oldRenderStack);this.render();}}
if(this.getSelDates().length===0){this.emptyDatefields();}else{this.fillDateInfields();}};DateRangeCalendar.prototype.resetCalendar=function(){this._renderStack.copy(this.oldRenderStack);SimpleCalendar.prototype.resetCalendar.call(this);};DateRangeCalendar.prototype.goOnToday=function(){this._renderStack.copy(this.oldRenderStack);SimpleCalendar.prototype.goOnToday.call(this);};DateRangeCalendar.prototype.highlightPeriod=function(){if(this.getSelDates().length!=2){return false;}
if(this.parent){for(var p=0;p<this.parent.pages.length;++p){var cal=this.parent.pages[p];cal.renderStack.copy(cal.oldRenderStack);}}else{if(this.renderStack){this.renderStack.copy(this.oldRenderStack);}}
var d1=new Date(this.getSelDates()[0][0],this.getSelDates()[0][1]-1,this.getSelDates()[0][2]),d2=new Date(this.getSelDates()[1][0],this.getSelDates()[1][1]-1,this.getSelDates()[1][2]),dateList="";if(YAHOO.widget.DateMath.after(d1,d2)){var dtmp=d1;d1=d2;d2=dtmp;}
d1=YAHOO.widget.DateMath.add(d1,YAHOO.widget.DateMath.DAY,1);if(d1.valueOf()==d2.valueOf()){return;}
d2=YAHOO.widget.DateMath.subtract(d2,YAHOO.widget.DateMath.DAY,1);dateList=(d1.getMonth()+1)+"/"+d1.getDate()+"/"+d1.getFullYear()+"-"+
(d2.getMonth()+1)+"/"+d2.getDate()+"/"+d2.getFullYear();this.addPeriodRenderer(dateList);if(this.parent){this.parent.render();}else{this.render();}};DateRangeCalendar.prototype.addPeriodRenderer=function(dateList){var toCall=(this.parent)?this.parent:this;toCall.addRenderer(dateList,this.highlightCell);};DateRangeCalendar.prototype.highlightCell=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,"calRangeSel");};MultiCalendar=function(nbMonth,childCalClass,id,containerId,monthyear,selected){if(arguments.length>0){this.buildWrapper(containerId);this.init(nbMonth,childCalClass,id,containerId,monthyear,selected);superClass(this,RiaComponent,id,"MultiCalendar");}
this.tooltip=null;this.mustBeRendered=false;this.singleDateField=null;this.dateDayField=null;this.dateMonthField=null;this.dateYearField=null;this.hiddenDateField=null;this.CssBadFormat="calBadFormat";this.Options=new Array();this.Options.MULTI_SELECT=false;};extendsClass(MultiCalendar,RiaComponent,YAHOO.widget.CalendarGroup);MultiCalendar.prototype.init=function(pageCount,childCalClass,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p<pageCount;++p){var cal=this.constructChild(id+"_"+p,childCalClass,this.containerId+"_"+p,monthyear,selected);cal.parent=this;cal.index=p;cal.pageDate.setMonth(cal.pageDate.getMonth()+p);cal._pageDate=new Date(cal.pageDate.getFullYear(),cal.pageDate.getMonth(),cal.pageDate.getDate());this.pages.push(cal);}
this.doNextMonth=function(e,calGroup){calGroup.nextMonth();};this.doNextYear=function(e,calGroup){calGroup.nextYear();};this.doPreviousMonth=function(e,calGroup){calGroup.previousMonth();};this.doPreviousYear=function(e,calGroup){calGroup.previousYear();};};MultiCalendar.prototype.customConfig=function(){null;};MultiCalendar.prototype.setupConfig=function(){for(var p=0;p<this.pages.length;++p){if(this.customConfig){this.pages[p].customConfig=this.customConfig;this.pages[p].setupConfig();}}};MultiCalendar.prototype.renderBodyCellRestricted=BaseCalendar.prototype.renderBodyCellRestricted;MultiCalendar.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){this.pages[p].addRenderer(sDates,fnRender);}};MultiCalendar.prototype.addAcronymRender=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){this.pages[p].addAcronymRender(sDates,fnRender);}};MultiCalendar.prototype.constructChild=function(id,childCalClass,containerId,monthyear,selected){var cal=new childCalClass(id,containerId,monthyear,selected);if(cal.doSelectCellIfRange){this.select=MultiCalendar.prototype.selectOnDateRange;this.selectCell=MultiCalendar.prototype.selectCellOnDateRange;this.doResetCalendar=MultiCalendar.prototype.doResetCalendarOnDateRange;this.doGoOnToday=MultiCalendar.prototype.doGoOnTodayOnDateRange;this.doSelectCellIfRange=DateRangeCalendar.prototype.doSelectCellIfRange;this.highlightPeriod=DateRangeCalendar.prototype.highlightPeriod;this.highlightCell=DateRangeCalendar.prototype.highlightCell;}
return cal;};MultiCalendar.prototype.selectCellOnDateRange=function(cellIndex){return this.doSelectCellIfRange(YAHOO.widget.CalendarGroup.prototype.selectCell,cellIndex);};MultiCalendar.prototype.selectOnDateRange=function(date){return this.doSelectCellIfRange(YAHOO.widget.CalendarGroup.prototype.select,date);};MultiCalendar.prototype.doResetCalendarOnDateRange=function(e,calGroup){calGroup.clearPeriodDateRange();calGroup.resetCalendar();};MultiCalendar.prototype.doGoOnTodayOnDateRange=function(e,calGroup){calGroup.clearPeriodDateRange();calGroup.goOnToday();};MultiCalendar.prototype.clearPeriodDateRange=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal._renderStack.copy(cal.oldRenderStack);}};MultiCalendar.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);var innerContainer=document.getElementById(containerId+"_inner");this.innerContainer=innerContainer;this.outerContainer=outerContainer;};MultiCalendar.prototype.render=function(){if(this.tooltip&&!this.tooltip.opened){this.mustBeRendered=true;return;}
for(var p=0;p<this.pages.length;++p){if(this.minDate!==null){this.pages[p].minDate=this.minDate;}
if(this.maxDate!==null){this.pages[p].maxDate=this.maxDate;}
if(this.Options.MULTI_SELECT!==this.pages[p].Options.MULTI_SELECT){this.pages[p].Options.MULTI_SELECT=this.Options.MULTI_SELECT;}}
YAHOO.widget.CalendarGroup.prototype.render.call(this);};MultiCalendar.prototype.doGoOnToday=function(e,calGroup){calGroup.goOnToday();};MultiCalendar.prototype.goOnToday=function(){var now=new Date();this.deselectAll();if(this.pages[0].select){this.select(now);}
this.setMonth(now.getMonth());this.setYear(now.getFullYear());this.render();if(this.pages[0].setActive){this.pages[0].setActive(true);}
this.fillDateInfields(now);};MultiCalendar.prototype.doResetCalendar=function(e,calGroup){calGroup.resetCalendar();};MultiCalendar.prototype.resetCalendar=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectAll();cal.render();if(cal.setActive){cal.setActive(false);}}
this.emptyDatefields();this.setActive(false);};MultiCalendar.prototype.focus=function(){if(this.pages[0].focus){this.pages[0].focus();}};MultiCalendar.prototype.getSelDates=function(){return this.selectedDates;};MultiCalendar.prototype.setNewDate=function(dat){this.setMonth(dat.getMonth());this.setYear(dat.getFullYear());this.render();return true;};MultiCalendar.prototype.addSingleDateField=SimpleCalendar.prototype.addSingleDateField;MultiCalendar.prototype.addExplodedDateField=SimpleCalendar.prototype.addExplodedDateField;MultiCalendar.prototype.addHiddenDateField=SimpleCalendar.prototype.addHiddenDateField;MultiCalendar.prototype.clearBadFormat=SimpleCalendar.prototype.clearBadFormat;MultiCalendar.prototype.acceptDate=SimpleCalendar.prototype.acceptDate;MultiCalendar.prototype.emptyDatefields=SimpleCalendar.prototype.emptyDatefields;MultiCalendar.prototype.fillDateInfields=SimpleCalendar.prototype.fillDateInfields;MultiCalendar.prototype.openTooltip=BaseCalendar.prototype.openTooltip;MultiCalendar.prototype.addAcronymRender=function(dateList,acronymList,cssStyleClass){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addAcronymRender(dateList,acronymList,cssStyleClass);}};MultiCalendar.prototype.addPeriodRenderer=function(dateList){for(var p=0;p<this.pages.length;++p){this.pages[p].addPeriodRenderer(dateList);}};

