
IAJS.CONTROLLER.BaseController=function(node){this.objectType="BaseController";this.node=node;this.input;this.response;this.elattr;this.validationCode;this.isEnabled;this.formObjects=new Array();};IAJS.CONTROLLER.BaseController.prototype.init=function(){}
IAJS.CONTROLLER.BaseController.prototype.hookAfterInit=function(){}
IAJS.CONTROLLER.BaseController.prototype.hookBeforeSubmit=function(){if(this.validationCode==IAJS.RESPONSE.FALLTHROUGH&&this.elattr.required){this.validationCode=IAJS.RESPONSE.MANDATORY;}
this.responseAction();}
IAJS.CONTROLLER.BaseController.prototype.validate=function(){return IAJS.RESPONSE.INVALID;}
IAJS.CONTROLLER.BaseController.prototype.getResponse=function(input_id){return YAHOO.util.Dom.get("response_"+input_id);}
IAJS.CONTROLLER.BaseController.prototype.initAttribute=function(){if(!YAHOO.lang.isObject(this.elattr)){this.elattr=new Object();if(this.node){attrStr=this.node.getAttribute("elattr");if(YAHOO.lang.isString(attrStr)){attrArr=attrStr.split(";");IAJS.log(attrArr,"info",this);if(YAHOO.lang.isArray(attrArr)){for(i=0;i<attrArr.length;i++){if(YAHOO.lang.isString(attrArr[i])){kv=attrArr[i].split(":");val=(kv[1]==='false')?false:kv[1];this.elattr[kv[0]]=val;IAJS.log("attr "+kv[0]+":"+kv[1],"time",this);}}}}}}}
IAJS.CONTROLLER.BaseController.prototype.getAttr=function(attr){return(this.elattr&&this.elattr[attr])?this.elattr[attr]:false;}
IAJS.CONTROLLER.BaseController.prototype.setAttr=function(elattr,value){if(this.elattr)this.elattr['attr']=value;}
IAJS.CONTROLLER.BaseController.prototype.initForm=function(){var result=false;if(this.getCheckInsideForm()){var nodeForm=YAHOO.util.Dom.getAncestorByTagName(this.node,"form");if(nodeForm){IAJS.FORMS.getInstance().register(this,nodeForm);result=true;}else{IAJS.log("Could not find form element for controller","warn",this);}}
return result;}
IAJS.CONTROLLER.BaseController.prototype.parseAttr=function(elm){if(elm&&elm.getAttribute("elattr")){attrStr=elm.getAttribute("elattr");if(YAHOO.lang.isString(attrStr)){var attrValue=new Object();attrArr=attrStr.split(";");if(YAHOO.lang.isArray(attrArr)){for(i=0;i<attrArr.length;i++){if(YAHOO.lang.isString(attrArr[i])){kv=attrArr[i].split(":");val=(kv[1]==='false')?false:kv[1];attrValue[kv[0]]=val;}}}}}
return(attrValue)?attrValue:false;}
IAJS.CONTROLLER.BaseController.prototype.getControllerId=function(){if(!this.controllerId)this.controllerId=this.initControllerId();return this.controllerId;}
IAJS.CONTROLLER.BaseController.prototype.initControllerId=function(){if(this.elattr&&this.elattr.id)return this.elattr.id;if(this.node&&this.node.id)return this.node.id;if(this.input&&this.input.id)return this.input.id;if(this.objectType)return this.objectType+"_"+IAJS.CONFIG.controllerIdCounter++;return("controller_"+IAJS.CONFIG.controllerIdCounter++);}
IAJS.CONTROLLER.BaseController.prototype.hasResponse=function(){return(this.input&&this.response);}
IAJS.CONTROLLER.BaseController.prototype.getCheckInsideForm=function(){return false;}
IAJS.CONTROLLER.BaseController.prototype.getEvents=function(){return(this.event)?this.event:false;}
IAJS.CONTROLLER.BaseController.prototype.setEnabled=function(value,args,me){if(args){var m=IAJS.ELATTR.getMaster(this);value=(m&&m.element==args[0].target)?true:false;}
IAJS.log("setEnabled"+value,"info",this);if(this.input){(value)?this.input.removeAttribute("disabled"):this.input.setAttribute("disabled","disabled");}
if(this.hasResponse){if(value){this.validate();}else{if(this.validationCode&&this.validationCode!=IAJS.RESPONSE.OK){Response.clear(this.response);}}}
if(this.enabled)this.enabled=value;if(this.event&&this.event.onEnableChange&&this.event.onEnableChange!=null){this.event.onEnableChange.fire({enabled:value});}}
IAJS.CONTROLLER.BaseController.prototype.enabledHandler=function(e){var elm=YAHOO.util.Event.getTarget(e);try{this.setEnabled(elm.checked);IAJS.log("enabledHandler: "+elm.id+", "+elm.checked+", "+elm.value+", "+e.type,"info",this);}catch(e){IAJS.log("enabledHandler: could not call handler for "+elm.type,"warn",this);}}
IAJS.CONTROLLER.BaseController.prototype.hasEvent=function(type){return(this.event&&this.event[type]);}
IAJS.CONTROLLER.BaseController.prototype.setMaster=function(){var master=IAJS.ELATTR.getMaster(this);if(master){if(master.controller){var masterCtl=IAJS.controllerCollection[master.controller];switch(m.action){case'enable':IAJS.Event.On(masterCtl,"onEnable",this.onMasterChange,this);IAJS.Event.On(masterCtl,"onDisable",this.onMasterChange,this);break;case'valid':IAJS.Event.On(master,"onValidationChange",this.onMasterChange,this);break;case'change':default:IAJS.Event.On(masterCtl,"onChange",this.onMasterChange,this);this.onMasterChange();break;}}
if(master.element){var masterCtl=IAJS.controllerCollection[master.element];switch(m.action){case'enable':IAJS.Event.On(masterCtl,"onEnable",this.onMasterChange,this);IAJS.Event.On(masterCtl,"onDisable",this.onMasterChange,this);break;case'valid':IAJS.Event.On(masterCtl,"onValidationChange",this.onMasterChange,this);break;case'change':default:IAJS.Event.On(masterCtl,"onChange",this.onMasterChange,this);this.onMasterChange();break;}}}}
IAJS.CONTROLLER.BaseController.prototype.setSubordinate=function(){var subordinate=IAJS.ELATTR.getSubordinate(this);if(subordinate){IAJS.Event.On(subordinate.controller,"onChange",this.onSubordinateChange,this);this.onSubordinateChange();}}
IAJS.CONTROLLER.BaseController.prototype.addListeners=function(){this.setMaster();this.setSubordinate();}
IAJS.CONTROLLER.BaseController.prototype.onSubordinateChange=function(){return false;}
IAJS.CONTROLLER.BaseController.prototype.onMasterChange=function(){}
IAJS.CONTROLLER.BaseController.prototype._initEvent=function(){return false;}
IAJS.CONTROLLER.Form=function(formElement){this.form=formElement;this.submitValidateEvent;this.objectType="Form";}
IAJS.CONTROLLER.Form.prototype.init=function(){this.submitValidateEvent=new YAHOO.util.CustomEvent("validateOnSubmitEvent",this);}
IAJS.CONTROLLER.Form.prototype.hookAfterInit=function(){}
IAJS.CONTROLLER.Form.prototype.hookBeforeSubmit=function(){this.validate();}
IAJS.CONTROLLER.Form.prototype.validate=function(){}
IAJS.CONTROLLER.Form.prototype.responseAction=function(){}
IAJS.CONTROLLER.Form.prototype.getControllerId=function(){return this.form.id;}
IAJS.CONTROLLER.Form.prototype.getOnSubmitEvent=function(){return this.submitValidateEvent;}
IAJS.CONTROLLER.Form.prototype.doNothing=function(e){YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.Forms=function(){this.formCollection=new Object;this.objectType="Forms";}
IAJS.CONTROLLER.Forms.prototype.init=function(){}
IAJS.CONTROLLER.Forms.prototype.register=function(elm,formElm){var form=new IAJS.CONTROLLER.Form(formElm);var formId=form.getControllerId();if(this.formCollection[formId]==null){form.init();this.formCollection[formId]=form;}else{form=this.formCollection[formId];}
form.getOnSubmitEvent().subscribe(elm.hookBeforeSubmit,elm);}
IAJS.CONTROLLER.Forms.prototype.info=function(){for(var i in this.formCollection){var id=this.formCollection[i].getControllerId();IAJS.log("ID: "+i+" "+id,"error");var listeners=YAHOO.util.Event.getListeners(this.formCollection[i].form)
IAJS.log("subscr "+this.formCollection[i].getOnSubmitEvent().subscribers.length,"error")
if(listeners){for(var j=0;j<listeners.length;j++){IAJS.log("listener: "+listeners[j].type);}}else{IAJS.log("nobody found listening");}}}
IAJS.CONTROLLER.DefinitionListBase=function(node){this.node=node;this.deflistName;this.deftextnode;this.floater;this.objectType="DefinitionListBase";}
function DefListWorld(){this.showEvent=new YAHOO.util.CustomEvent("showEvent",this);}
var world=new DefListWorld();YAHOO.lang.extend(IAJS.CONTROLLER.DefinitionListBase,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.DefinitionListBase.prototype.init=function(deflistName){this.deflistName=deflistName;if(this.node){this.deflists=YAHOO.util.Dom.getElementsByClassName(this.deflistName,"div");YAHOO.util.Dom.addClass(this.deflists,"hidden")
var deflink=YAHOO.util.Dom.get("di_"+this.node.getAttribute('name'));if(deflink){this.deftextnode=deflink.parentNode.nextSibling;if(this.deftextnode.nodeType==3){this.deftextnode=deflink.parentNode.nextSibling.nextSibling;}
var name="#"+this.node.id;var backlinks=YAHOO.util.Dom.getElementsBy(function(el){return el.href.indexOf(name)>-1;},"a",this.deftextnode);if(backlinks.length>0)
YAHOO.util.Dom.batch(backlinks,function(el){YAHOO.util.Dom.setStyle(el,"display","none");});}
YAHOO.util.Event.on(this.node,"click",this.show,this,true);YAHOO.util.Event.on(this.node,"click",this.doNothing,this,true);this.world=world;this.world.showEvent.subscribe(this.onShowEvent,this);}}
IAJS.CONTROLLER.DefinitionListBase.prototype.onShowEvent=function(type,floater,me){if(YAHOO.util.Dom.getStyle(me.floater,"visibility")=="visible"){YAHOO.util.Dom.setStyle(me.floater,"visibility","hidden");YAHOO.util.Event.on(me.node,"click",me.show,me,true);YAHOO.util.Event.removeListener(document,"keyup",me.hide);YAHOO.util.Event.removeListener(document,"click",me.hide);}}
IAJS.CONTROLLER.DefinitionListBase.prototype.doNothing=function(e){YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.DefinitionListBase.prototype.show=function(e){var elt=YAHOO.util.Event.getTarget(e);var reg=YAHOO.util.Dom.getRegion(elt);var x=YAHOO.util.Dom.getX(elt);var y=YAHOO.util.Dom.getY(elt)+(reg.bottom-reg.top);var imgX=14;var imgY=7;YAHOO.util.Dom.setXY(this.floater,[x-imgX,y+imgY]);var $D=YAHOO.util.Dom;var elt=YAHOO.util.Event.getTarget(e);var viewportRegion=new YAHOO.util.Region(0,$D.getViewportWidth(),$D.getViewportHeight(),0);var floatRegion=new $D.getRegion(this.floater);var width=floatRegion.right-floatRegion.left;var height=floatRegion.bottom-floatRegion.top;var eltReg=YAHOO.util.Dom.getRegion(elt);var eltX=YAHOO.util.Dom.getX(elt);var eltY=YAHOO.util.Dom.getY(elt)+(eltReg.bottom-eltReg.top);if(floatRegion.right<viewportRegion.right&&floatRegion.bottom<viewportRegion.bottom){if(this["hookOnTopLeft"])this.hookOnTopLeft();}
YAHOO.util.Dom.addClass(this.speechBubble,"tl");if(floatRegion.right>viewportRegion.right&&floatRegion.bottom<viewportRegion.bottom){var x=eltX-width+(eltReg.right-eltReg.left);var y=eltY;$D.setXY(this.floater,[x,y]);if(this["hookOnTopRight"])this.hookOnTopRight();}
if(floatRegion.right>viewportRegion.right&&floatRegion.bottom>viewportRegion.bottom){var x=eltX-width+(eltReg.right-eltReg.left);var y=eltY-height-(eltReg.bottom-eltReg.top);$D.setXY(this.floater,[x,y]);if(this["hookOnBottomRight"])this.hookOnBottomRight();}
if(floatRegion.right<viewportRegion.right&&floatRegion.bottom>viewportRegion.bottom){var x=eltX-imgX;var y=eltY-height-(eltReg.bottom-eltReg.top)-imgY;$D.setXY(this.floater,[x,y]);if(this["hookOnBottomLeft"])this.hookOnBottomLeft();}
this.world.showEvent.fire(this.floater);YAHOO.util.Dom.setStyle(this.floater,"visibility","visible");YAHOO.util.Event.on(document,"keyup",this.hide,this,true);YAHOO.util.Event.on(document,"click",this.hide,this,true);YAHOO.util.Event.removeListener(this.node,"click",this.show);YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.DefinitionListBase.prototype.hide=function(e){var elt=YAHOO.util.Event.getTarget(e);if(elt&&(elt.parentNode==this.floater||elt==this.floater)){return;}
if(e.type=="keyup"){if(YAHOO.util.Event.getCharCode(e)==27){YAHOO.util.Dom.setStyle(this.floater,"visibility","hidden");}else{return;}}else if(elt&&elt.type=="text"){return;}else{YAHOO.util.Dom.setStyle(this.floater,"visibility","hidden");}
YAHOO.util.Event.on(this.node,"click",this.show,this,true);YAHOO.util.Event.removeListener(document,"keyup",this.hide);YAHOO.util.Event.removeListener(document,"click",this.hide);}
IAJS.CONTROLLER.DefinitionListBase=function(node){this.node=node;this.deflistName;this.deftextnode;this.floater;this.objectType="DefinitionListBase";}
function DefListWorld(){this.showEvent=new YAHOO.util.CustomEvent("showEvent",this);}
var world=new DefListWorld();YAHOO.lang.extend(IAJS.CONTROLLER.DefinitionListBase,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.DefinitionListBase.prototype.init=function(deflistName){this.deflistName=deflistName;if(this.node){this.deflists=YAHOO.util.Dom.getElementsByClassName(this.deflistName,"div");YAHOO.util.Dom.addClass(this.deflists,"hidden")
var deflink=YAHOO.util.Dom.get("di_"+this.node.getAttribute('name'));if(deflink){this.deftextnode=deflink.parentNode.nextSibling;if(this.deftextnode.nodeType==3){this.deftextnode=deflink.parentNode.nextSibling.nextSibling;}
var name="#"+this.node.id;var backlinks=YAHOO.util.Dom.getElementsBy(function(el){return el.href.indexOf(name)>-1;},"a",this.deftextnode);if(backlinks.length>0)
YAHOO.util.Dom.batch(backlinks,function(el){YAHOO.util.Dom.setStyle(el,"display","none");});}
YAHOO.util.Event.on(this.node,"click",this.show,this,true);YAHOO.util.Event.on(this.node,"click",this.doNothing,this,true);this.world=world;this.world.showEvent.subscribe(this.onShowEvent,this);}}
IAJS.CONTROLLER.DefinitionListBase.prototype.onShowEvent=function(type,floater,me){if(YAHOO.util.Dom.getStyle(me.floater,"visibility")=="visible"){YAHOO.util.Dom.setStyle(me.floater,"visibility","hidden");YAHOO.util.Event.on(me.node,"click",me.show,me,true);YAHOO.util.Event.removeListener(document,"keyup",me.hide);YAHOO.util.Event.removeListener(document,"click",me.hide);}}
IAJS.CONTROLLER.DefinitionListBase.prototype.doNothing=function(e){YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.DefinitionListBase.prototype.show=function(e){var elt=YAHOO.util.Event.getTarget(e);var reg=YAHOO.util.Dom.getRegion(elt);var x=YAHOO.util.Dom.getX(elt);var y=YAHOO.util.Dom.getY(elt)+(reg.bottom-reg.top);var imgX=14;var imgY=7;YAHOO.util.Dom.setXY(this.floater,[x-imgX,y+imgY]);var $D=YAHOO.util.Dom;var elt=YAHOO.util.Event.getTarget(e);var viewportRegion=new YAHOO.util.Region(0,$D.getViewportWidth(),$D.getViewportHeight(),0);var floatRegion=new $D.getRegion(this.floater);var width=floatRegion.right-floatRegion.left;var height=floatRegion.bottom-floatRegion.top;var eltReg=YAHOO.util.Dom.getRegion(elt);var eltX=YAHOO.util.Dom.getX(elt);var eltY=YAHOO.util.Dom.getY(elt)+(eltReg.bottom-eltReg.top);if(floatRegion.right<viewportRegion.right&&floatRegion.bottom<viewportRegion.bottom){if(this["hookOnTopLeft"])this.hookOnTopLeft();}
YAHOO.util.Dom.addClass(this.speechBubble,"tl");if(floatRegion.right>viewportRegion.right&&floatRegion.bottom<viewportRegion.bottom){var x=eltX-width+(eltReg.right-eltReg.left);var y=eltY;$D.setXY(this.floater,[x,y]);if(this["hookOnTopRight"])this.hookOnTopRight();}
if(floatRegion.right>viewportRegion.right&&floatRegion.bottom>viewportRegion.bottom){var x=eltX-width+(eltReg.right-eltReg.left);var y=eltY-height-(eltReg.bottom-eltReg.top);$D.setXY(this.floater,[x,y]);if(this["hookOnBottomRight"])this.hookOnBottomRight();}
if(floatRegion.right<viewportRegion.right&&floatRegion.bottom>viewportRegion.bottom){var x=eltX-imgX;var y=eltY-height-(eltReg.bottom-eltReg.top)-imgY;$D.setXY(this.floater,[x,y]);if(this["hookOnBottomLeft"])this.hookOnBottomLeft();}
this.world.showEvent.fire(this.floater);YAHOO.util.Dom.setStyle(this.floater,"visibility","visible");YAHOO.util.Event.on(document,"keyup",this.hide,this,true);YAHOO.util.Event.on(document,"click",this.hide,this,true);YAHOO.util.Event.removeListener(this.node,"click",this.show);YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.DefinitionListBase.prototype.hide=function(e){var elt=YAHOO.util.Event.getTarget(e);if(elt&&(elt.parentNode==this.floater||elt==this.floater)){return;}
if(e.type=="keyup"){if(YAHOO.util.Event.getCharCode(e)==27){YAHOO.util.Dom.setStyle(this.floater,"visibility","hidden");}else{return;}}else if(elt&&elt.type=="text"){return;}else{YAHOO.util.Dom.setStyle(this.floater,"visibility","hidden");}
YAHOO.util.Event.on(this.node,"click",this.show,this,true);YAHOO.util.Event.removeListener(document,"keyup",this.hide);YAHOO.util.Event.removeListener(document,"click",this.hide);}
IAJS.CONTROLLER.Beban=function(node){this.objectType="Beban";this.node=node;}
YAHOO.lang.extend(IAJS.CONTROLLER.Beban,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Beban.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.response=this.getResponse(this.input.id);}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);YAHOO.util.Event.on(this.country,"change",this.validate,this,true);}}
IAJS.CONTROLLER.Beban.prototype.hookAfterInit=function(){this.validate();}
IAJS.CONTROLLER.Beban.prototype.hookBeforeSubmit=function(){}
IAJS.CONTROLLER.Beban.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.bankaccount('BE',this.input.value);this.responseAction();}
IAJS.CONTROLLER.Beban.prototype.responseAction=function(){IAJS.log("Bank account responseAction "+this.validationCode,"info",this);switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.BANKACCOUNT_INVALID);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}}
IAJS.CONTROLLER.Beban.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Niss=function(node){this.node=node;this.objectType="Niss";}
YAHOO.lang.extend(IAJS.CONTROLLER.Niss,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Niss.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.response=this.getResponse(this.input.id);}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}}
IAJS.CONTROLLER.Niss.prototype.hookAfterInit=function(){this.validate();}
IAJS.CONTROLLER.Niss.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.niss(this.input.value);this.responseAction();}
IAJS.CONTROLLER.Niss.prototype.responseAction=function(){IAJS.log("niss validation is "+this.validationCode,"info");switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.NISS_INVALID);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.NISS_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:Response.clear(this.response);default:Response.clear(this.response);}}
IAJS.CONTROLLER.Niss.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Checkbox=function(node,owner){this.node=node;this.owner=owner;this.isSelected=false;this.objectType="Checkbox";};YAHOO.lang.extend(IAJS.CONTROLLER.Checkbox,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Checkbox.prototype.init=function(){if(this.node){this.id=this.node.getAttribute("id");YAHOO.util.Event.on(this.id,"click",this.owner.select,this,this.owner);}};IAJS.CONTROLLER.Checkbox.prototype.select=function(){this.isSelected=this.node.checked;}
IAJS.CONTROLLER.Checkbox.prototype.validate=function(){return false;};IAJS.CONTROLLER.Checkbox.prototype.responseAction=function(){return false;};IAJS.CONTROLLER.Checkboxlist=function(node){this.node=node;this.objectType="Checkboxlist";this.group=new Object;this.id;this.event={onEnableChange:null,onChange:null};IAJS.CONTROLLER.Date.superclass.constructor.call(this,node);};YAHOO.lang.extend(IAJS.CONTROLLER.Checkboxlist,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Checkboxlist.prototype.init=function(){this.initAttribute();this.id=this.elattr.id;this._initEvent();var rows=YAHOO.util.Dom.getElementsBy(function(el){return(el.getAttribute("type")=="checkbox")},"input",this.node);if(rows){for(i=0;i<rows.length;i++){node=rows[i];nodeId=node.getAttribute("id");if(nodeId.substring(0,this.elattr.id.length)==this.elattr.id){checkbox=new IAJS.CONTROLLER.Checkbox(node,this);checkbox.init();this.group[nodeId]=checkbox;}}
for(var i in this.group){this.select(false,this.group[i]);}}
else{IAJS.log("no checkboxes found","warn",this);}};IAJS.CONTROLLER.Checkboxlist.prototype.hookAfterInit=function(){return false};IAJS.CONTROLLER.Checkboxlist.prototype.hookBeforeSubmit=function(){return false};IAJS.CONTROLLER.Checkboxlist.prototype.validate=function(){};IAJS.CONTROLLER.Checkboxlist.prototype.select=function(e,obj){this.group[obj.id].select();this.event.onChange.fire();}
IAJS.CONTROLLER.Checkboxlist.prototype.getSelected=function(){var selected={};for(key in this.group)selected[key]=this.group[key].isSelected;return selected;}
IAJS.CONTROLLER.Checkboxlist.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.EMAIL_INVALID);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.EMAIL_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}};IAJS.CONTROLLER.Checkboxlist.prototype._initEvent=function(){this.event.onChange=new YAHOO.util.CustomEvent("onChange",this);this.event.onEnableChange=new YAHOO.util.CustomEvent("onEnableChange",this);}
IAJS.CONTROLLER.Dropdownlist=function(node){this.node=node;this.objectType="Dropdownlist";this.id;this.dropdown;this.rows;this.event={onEnableChange:null,onChange:null};};YAHOO.lang.extend(IAJS.CONTROLLER.Dropdownlist,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Dropdownlist.prototype.init=function(){this.initAttribute();this._initEvent();this.dropdown=YAHOO.util.Dom.getElementsBy(function(){return true;},"select",this.node)[0];if(this.dropdown){YAHOO.util.Event.on(this.dropdown.id,"change",this.select,this,true);}};IAJS.CONTROLLER.Dropdownlist.prototype._initEvent=function(){this.event.onChange=new YAHOO.util.CustomEvent("onChange",this);this.event.onEnableChange=new YAHOO.util.CustomEvent("onEnableChange",this);}
IAJS.CONTROLLER.Dropdownlist.prototype.hookAfterInit=function(){return false};IAJS.CONTROLLER.Dropdownlist.prototype.hookBeforeSubmit=function(){return false};IAJS.CONTROLLER.Dropdownlist.prototype.validate=function(){};IAJS.CONTROLLER.Dropdownlist.prototype.getSelected=function(){var selected={};var rows=YAHOO.util.Dom.getElementsBy(function(){return true;},"option",this.node);for(var i=0;i<rows.length;i++){selected[rows[i].value]=rows[i].selected;}
return selected;}
IAJS.CONTROLLER.Dropdownlist.prototype.select=function(e,obj){this.event.onChange.fire();}
IAJS.CONTROLLER.Dropdownlist.prototype.setEnabledChanged=function(){this.event.onEnableChange.fire();}
IAJS.CONTROLLER.Radiolist=function(node){this.node=node;this.objectType="Radiolist";this.group=new Object;this.id;this.event={onEnableChange:null,onChange:null};};YAHOO.lang.extend(IAJS.CONTROLLER.Radiolist,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Radiolist.prototype.init=function(){this.initAttribute();this._initEvent();id=this.getControllerId();var rows=YAHOO.util.Dom.getElementsBy(function(el){return(el.getAttribute("type")=="radio")},"input",this.node);if(rows){for(i=0;i<rows.length;i++){node=rows[i];nodeId=node.getAttribute("id");if(nodeId.substring(0,this.controllerId.length)==this.controllerId){radio=new IAJS.CONTROLLER.Radio(node,this);radio.init();this.group[nodeId]=radio;}}
this.select();}
else{IAJS.log("Radiolist: no radiobuttons found","warn");}};IAJS.CONTROLLER.Radiolist.prototype._initEvent=function(){this.event.onChange=new YAHOO.util.CustomEvent("onChange",this);this.event.onEnableChange=new YAHOO.util.CustomEvent("onEnableChange",this);}
IAJS.CONTROLLER.Radiolist.prototype.hookAfterInit=function(){return false};IAJS.CONTROLLER.Radiolist.prototype.hookBeforeSubmit=function(){return false};IAJS.CONTROLLER.Radiolist.prototype.validate=function(){};IAJS.CONTROLLER.Radiolist.prototype.getSelected=function(){var selected={};for(key in this.group)selected[key]=this.group[key].isSelected;return selected;}
IAJS.CONTROLLER.Radiolist.prototype.select=function(e,obj){for(var i in this.group){this.group[i].select();}
this.event.onChange.fire();}
IAJS.CONTROLLER.Radiolist.prototype.setEnabledChanged=function(){this.event.onEnableChange.fire();}
IAJS.CONTROLLER.Radiolist.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.EMAIL_INVALID);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.EMAIL_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}};IAJS.CONTROLLER.Radiolist.prototype.initControllerId=function(){return(this.elattr.id)?this.elattr.id:this.objectType+"_"+IAJS.CONFIG.controllerIdCounter++;}
IAJS.CONTROLLER.Radio=function(node,owner){this.node=node;this.owner=owner;this.isSelected=false;this.objectType="Radio";};YAHOO.lang.extend(IAJS.CONTROLLER.Radio,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Radio.prototype.init=function(){if(this.node){this.id=this.node.getAttribute("id");YAHOO.util.Event.on(this.id,"click",this.owner.select,this,this.owner);}};IAJS.CONTROLLER.Radio.prototype.select=function(){this.isSelected=this.node.checked;}
IAJS.CONTROLLER.Radio.prototype.validate=function(){return false;};IAJS.CONTROLLER.Radio.prototype.responseAction=function(){return false;};IAJS.CONTROLLER.Date=function(node){this.objectType="Date";this.node=node;this.id;this.date=null;this.dateFormat=IAJS.CONFIG.defaultDateFormat;this.event={onEnableChange:null,onChange:null,onValidationChange:null};IAJS.CONTROLLER.Date.superclass.constructor.call(this,node);}
YAHOO.lang.extend(IAJS.CONTROLLER.Date,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Date.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();this._initEvent();}else{return false;}
if(this.input){this.id=this.input.id;this.response=this.getResponse(this.id);if(this.elattr.format)this.dateFormat=this.elattr.format;this.date=new IAJS.Date(this.input.value,this.dateFormat).init();var hasDatePicker=document.getElementById("datepicker_"+this.id);if(hasDatePicker){this.datepicker=new IAJS.CONTROLLER.DatePicker(this);if(this.datepicker){this.datepicker.init();}else{IAJS.log("could not create datepicker","error",this);}}}else{return false;}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}
return true;}
IAJS.CONTROLLER.Date.prototype._initEvent=function(){this.event.onChange=new YAHOO.util.CustomEvent("onChange",this);this.event.onEnableChange=new YAHOO.util.CustomEvent("onEnableChange",this);this.event.onValidationChange=new YAHOO.util.CustomEvent("onValidationChange",this);}
IAJS.CONTROLLER.Date.prototype.setDate=function(date){this.input.value=date;this.validate();}
IAJS.CONTROLLER.Date.prototype.focus=function(){this.input.focus();}
IAJS.CONTROLLER.Date.prototype.getDate=function(){return(this.date)?this.input.value:false;}
IAJS.CONTROLLER.Date.prototype.hookAfterInit=function(){this.validate();}
IAJS.CONTROLLER.Date.prototype.validate=function(){var v=this.validationCode;this.validationCode=this._validate();this.responseAction();if(v!=this.validationCode)this.event.onValidationChange.fire();this.event.onChange.fire();}
IAJS.CONTROLLER.Date.prototype._validate=function(){this.date=new IAJS.Date(this.input.value,this.dateFormat).init();if(this.date.isEmpty())return IAJS.RESPONSE.FALLTHROUGH;if(!this.date.isDate())return IAJS.RESPONSE.INVALID;mindate=false;maxdate=false;dif=false;var m=IAJS.ELATTR.getMaster(this);if(m){var master=(m.controller)?IAJS.controllerCollection[m.controller]:IAJS.controllerCollection[m.element];if(master.validationCode==IAJS.RESPONSE.OK){nr=this.elattr.diff;prefix=nr.substring(0,1);if(prefix=="-"){mindate=new IAJS.Date(master.date.asFormattedString(),this.dateFormat).init();mindate.addDay(nr*1);}
else if(prefix=="+"){maxdate=new IAJS.Date(master.date.asFormattedString(),this.dateFormat).init();maxdate.addDay(nr*1);}
else{nr=nr*1;mindate=new IAJS.Date(master.date.asFormattedString(),this.dateFormat).init();mindate.addDay(-nr);maxdate=new IAJS.Date(master.date.asFormattedString(),this.dateFormat).init();maxdate.addDay(nr);}
dif=true;}}else{if(this.elattr.mindate)mindate=new IAJS.Date(this.elattr.mindate).init();if(this.elattr.maxdate)maxdate=new IAJS.Date(this.elattr.maxdate).init();}
if(dif){if(!this.date.isInRange(mindate,maxdate))return IAJS.RESPONSE.OUTOFRANGE;}
else{if(mindate){if(this.date.isBefore(mindate))return IAJS.RESPONSE.TOLOW;}
if(maxdate){if(this.date.isAfter(maxdate))return IAJS.RESPONSE.TOHIGH;}}
return IAJS.RESPONSE.OK;}
IAJS.CONTROLLER.Date.prototype.responseAction=function(){IAJS.log("response date = "+this.validationCode,"info",this);switch(this.validationCode){case IAJS.RESPONSE.OK:Response.set(this.response,"confirmation",this.date.toReadableDate("%DayName% %j% %MonthName% %Y%"));break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.DATE_INVALID);break;case IAJS.RESPONSE.OUTOFRANGE:case IAJS.RESPONSE.TOHIGH:case IAJS.RESPONSE.TOLOW:Response.set(this.response,"error",this.date.toReadableDate("%DayName% %j% %MonthName% %Y%")+" "+LOCALIZE.messages.DATE_OUT_OF_RANGE);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.DATE_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}}
IAJS.CONTROLLER.Date.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Date.prototype.setEnabled=function(value){IAJS.CONTROLLER.Date.superclass.setEnabled.call(this,value);if(this.datepicker)this.datepicker.setEnabled(value);}
IAJS.CONTROLLER.Date.prototype.initControllerId=function(){return(this.input&&this.input.id)?this.input.id:this.objectType+"_"+IAJS.CONFIG.controllerIdCounter++;}
IAJS.CONTROLLER.Date.prototype.onSubordinateChange=function(){var subordinate=IAJS.ELATTR.getSubordinate(this);if(subordinate){var selected=IAJS.controllerCollection[subordinate.controller].getSelected();if(selected)this.setEnabled(selected[subordinate.element]);}}
IAJS.CONTROLLER.Email=function(node){this.node=node;this.objectType="Email";IAJS.CONTROLLER.Email.superclass.constructor.call(this,node);};YAHOO.lang.extend(IAJS.CONTROLLER.Email,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Email.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();this._initEvent();this.response=this.getResponse(this.input.id);}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}};IAJS.CONTROLLER.Email.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.email(this.input.value);this.responseAction();};IAJS.CONTROLLER.Email.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.EMAIL_INVALID);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.EMAIL_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}};IAJS.CONTROLLER.Email.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Number=function(node){this.node=node;this.objectType="Number";}
YAHOO.lang.extend(IAJS.CONTROLLER.Number,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Number.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();this.response=this.getResponse(this.input.id);}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}}
IAJS.CONTROLLER.Number.prototype.hookAfterInit=function(){this.validate();}
IAJS.CONTROLLER.Number.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.number(this.input.value,this.elattr['min'],this.elattr['max'],this.elattr['decimals']);this.responseAction();}
IAJS.CONTROLLER.Number.prototype.responseAction=function(){IAJS.log("number validation for "+this.input.id+" is "+this.validationCode,"info");switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.NUMBER_INVALID);break;case IAJS.RESPONSE.TOLOW:Response.set(this.response,"error",LOCALIZE.messages.NUMBER_TOO_LOW);break;case IAJS.RESPONSE.TOHIGH:Response.set(this.response,"error",LOCALIZE.messages.NUMBER_TOO_HIGH);break;case IAJS.RESPONSE.NUMBER.EXCEED_DECIMAL:Response.set(this.response,"error",LOCALIZE.messages.NUMBER_EXCEED_DECIMAL);break;case IAJS.RESPONSE.NUMBER.NO_FLOAT:Response.set(this.response,"error",LOCALIZE.messages.NUMBER_NO_FLOAT);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.NUMBER_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:Response.clear(this.response);break;default:Response.clear(this.response);}}
IAJS.CONTROLLER.Number.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.DatePicker=function(owner){this.node=null;this.id=null;this.owner=owner;this.calendar;this.calendarImg;this.calendarDiv;this.visible=false;this.enabled=true;this.objectType="DatePicker";}
IAJS.CONTROLLER.DatePicker.prototype.init=function(){this.node=document.getElementById("datepicker_"+this.owner.id+"");if(this.node){this.id=this.node.id;this.createPickerImage();IAJS.log("date picker init","info",this);YAHOO.util.Event.on(this.calendarA.getAttribute('id'),"click",this.show,this,true);YAHOO.util.Event.on(this.calendarA.getAttribute('id'),"click",this.doNothing,this,true);this.world=IAJS.OBSERVER.getInstance();this.world.subscribe(this.onShowEvent,this,true);}else{return false;}}
IAJS.CONTROLLER.DatePicker.prototype.createPickerImage=function(){this.calendarA=document.createElement('A');this.calendarA.setAttribute("href","javascript:void(0)");this.calendarA.setAttribute("id","datepickerControl_"+this.owner.id);this.calendarImg=document.createElement('IMG');this.calendarImg.setAttribute("src","style/img/icons/icon_datepicker.gif");this.calendarImg.setAttribute("alt",LOCALIZE.translation.DATEPICKER);this.calendarDiv=document.createElement('DIV');this.calendarDiv.setAttribute("id","calendarContainer_"+this.id);this.calendarA.appendChild(this.calendarImg);this.node.appendChild(this.calendarA);this.node.appendChild(this.calendarDiv);YAHOO.util.Dom.setStyle(this.calendarDiv,'display','none');YAHOO.util.Dom.setStyle(this.calendarDiv,'position','absolute');YAHOO.util.Dom.setStyle(this.calendarDiv,'z-index',100);}
IAJS.CONTROLLER.DatePicker.prototype.onShowEvent=function(type,panel){if(this.visible)this.hide();}
IAJS.CONTROLLER.DatePicker.prototype.doNothing=function(e){YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.DatePicker.prototype.create=function(ownerDate){this.calendar=new YAHOO.widget.Calendar("calendar_"+this.id,this.calendarDiv.getAttribute('id'),{draggable:true,title:LOCALIZE.translation.CHOOSE_DATE,close:true});if(this.owner.elattr.mindate){var minDate=new IAJS.Date(this.owner.elattr.mindate).init();this.calendar.cfg.setProperty("mindate",minDate.getDateObject());}
if(this.owner.elattr.maxdate){var maxDate=new IAJS.Date(this.owner.elattr.maxdate).init();this.calendar.cfg.setProperty("maxdate",maxDate.getDateObject());}
var pagedate=false;if(this.owner.date.isDate()){this.calendar.cfg.setProperty("pagedate",this.owner.date.getMonth()+"/"+this.owner.date.getYear());this.calendar.cfg.setProperty("selected",this.owner.date.asFormattedString(IAJS.CONFIG.dateFormat.american,"/"),false);}
this.calendar.selectEvent.subscribe(this.selectEventHandler,this,true);this.calendar.render();}
IAJS.CONTROLLER.DatePicker.prototype.selectEventHandler=function(type,args,obj){var dates=args[0];var date=dates[0];this.owner.setDate(date[2]+"-"+date[1]+"-"+date[0]);this.hide();}
IAJS.CONTROLLER.DatePicker.prototype.show=function(e){if(!this.enabled)return false;this.create();this.world.fire(this.calendar);try{this.calendar.show();this.visible=true;}catch(e){this.visible=false;}finally{YAHOO.util.Event.on(document,"keyup",this.hide,this,true);YAHOO.util.Event.on(document,"click",this.hide,this,true);YAHOO.util.Event.removeListener(this.calendarA.getAttribute('id'),"click",this.show);YAHOO.util.Event.stopEvent(e);}}
IAJS.CONTROLLER.DatePicker.prototype.hide=function(e){IAJS.log("IAJS.CONTROLLER.DatePicker.prototype.hide","time",this);if(e){var elt=YAHOO.util.Event.getTarget(e);if(e.type=="keyup"&&YAHOO.util.Event.getCharCode(e)!=27)return false;}
this.calendar.hide();this.visible=false;delete this.calendar;YAHOO.util.Event.on(this.calendarA.getAttribute('id'),"click",this.show,this,true);YAHOO.util.Event.removeListener(document,"keyup",this.hide);YAHOO.util.Event.removeListener(document,"click",this.hide);this.owner.focus();}
IAJS.CONTROLLER.DatePicker.prototype.now=function(){var currentTime=new Date();return new Array(currentTime.getDate(),currentTime.getMonth()+1,currentTime.getFullYear());}
IAJS.CONTROLLER.DatePicker.prototype.compare=function(date1,date2){if(date1[2]>date2[2])return 1;else if(date1[2]<date2[2])return-1;else if(date1[1]>date2[1])return 1;else if(date1[1]<date2[1])return-1;else if(date1[0]>date1[0])return 1;else if(date1[0]<date1[0])return-1;else return 0;}
IAJS.CONTROLLER.DatePicker.prototype.setEnabled=function(value){this.enabled=value;}
IAJS.CONTROLLER.ExpandCollapseBox=function(node){this.node=node;this.cnode;this.box;this.boxHeight;this.control;this.animate;this.objectType="ExpandCollapseBox";}
YAHOO.lang.extend(IAJS.CONTROLLER.ExpandCollapseBox,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.ExpandCollapseBox.prototype.init=function(){this.animate=(IAJS.CONFIG.animateCE===true)?true:false;this.speed=(YAHOO.lang.isNumber(IAJS.CONFIG.animateCESpeed))?IAJS.CONFIG.animateCESpeed:0.2;if(this.node){this.box=YAHOO.util.Dom.getElementsByClassName("box","div",this.node)[0];this.cnode=(this.node.firstChild.nodeType==1)?this.node.firstChild:this.node.firstChild.nextSibling;ctrl=YAHOO.util.Dom.getElementsByClassName("control","div",this.node)[0];this.control=ctrl.getElementsByTagName("A")[0];this.control.setAttribute("href","javascript:void(null)");var region=YAHOO.util.Dom.getRegion(this.box);this.boxHeight=region.bottom-region.top;}
if(this.box&&this.control){if(this.animate&&YAHOO.util.Anim){this.hasAnimation=true;this.animExpand=new YAHOO.util.Anim(this.box,null,this.speed);this.animCollapse=new YAHOO.util.Anim(this.box,null,this.speed);this.animExpand.onStart.subscribe(this.prepareAnim,this,true);this.animExpand.onComplete.subscribe(this.toggleCollapse,this,true);this.animCollapse.onComplete.subscribe(this.toggleCollapse,this,true);YAHOO.util.Event.addListener(this.control,"click",this.toggleCollapseAnim,this,true);}else{IAJS.log("toggleCollapse","warn",this);YAHOO.util.Event.addListener(this.control,"click",this.toggleCollapse,this,true);}}}
IAJS.CONTROLLER.ExpandCollapseBox.prototype.toggleCollapseAnim=function(){if(this.isCollapsed()){this.calculateHeight();YAHOO.util.Dom.setStyle(this.box,"height",0);YAHOO.util.Dom.setStyle(this.box,"visibility","visible");YAHOO.util.Dom.setStyle(this.box,"display","block");this.animExpand.attributes.height={from:0,to:this.boxHeight,unit:'px'};this.animExpand.animate();}
else{this.animCollapse.attributes.height={from:this.boxHeight,to:0,unit:'px'};this.animCollapse.animate();}}
IAJS.CONTROLLER.ExpandCollapseBox.prototype.prepareAnim=function(){YAHOO.util.Dom.setStyle(this.box,"height",0);YAHOO.util.Dom.setStyle(this.box,"visibility","visible");YAHOO.util.Dom.setStyle(this.box,"display","block");}
IAJS.CONTROLLER.ExpandCollapseBox.prototype.toggleCollapse=function(){IAJS.log("toggleCollapse","warn",this);if(this.isCollapsed()){if(YAHOO.util.Dom.hasClass(this.cnode,"collapse"))YAHOO.util.Dom.replaceClass(this.cnode,"collapse","expand");else YAHOO.util.Dom.addClass(this.cnode,"expand");}
else{if(YAHOO.util.Dom.hasClass(this.cnode,"expand"))YAHOO.util.Dom.replaceClass(this.cnode,"expand","collapse");else YAHOO.util.Dom.addClass(this.cnode,"collapse");if(this.hasAnimation){YAHOO.util.Dom.setStyle(this.box,"visibility","hidden");YAHOO.util.Dom.setStyle(this.box,"display","none");}}}
IAJS.CONTROLLER.ExpandCollapseBox.prototype.isCollapsed=function(){var isExpanded=YAHOO.util.Dom.hasClass(this.cnode,"expand");var isCollapsed=YAHOO.util.Dom.hasClass(this.cnode,"collapse");return((!isExpanded&&!isCollapsed)||isCollapsed)?true:false;}
IAJS.CONTROLLER.ExpandCollapseBox.prototype.calculateHeight=function(){if(!this.boxHeight||this.boxHeight=="NaN"){YAHOO.util.Dom.setStyle(this.box,"top","-999em");YAHOO.util.Dom.setStyle(this.box,"left","-999em");YAHOO.util.Dom.setStyle(this.box,"display","block");region=YAHOO.util.Dom.getRegion(this.box);this.boxHeight=region.bottom-region.top;YAHOO.util.Dom.setStyle(this.box,"top","0");YAHOO.util.Dom.setStyle(this.box,"left","0");YAHOO.util.Dom.setStyle(this.box,"display","none");}}
IAJS.CONTROLLER.Textarea=function(node){this.node=node;this.rows;this.x=0;this.y=0;this.remaining;this.maxExpand;this.maxLength=0;this.objectType="Textarea";}
YAHOO.lang.extend(IAJS.CONTROLLER.Textarea,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Textarea.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("","textarea",this.node)[0]
this.initAttribute();if(this.input)this.rows=(this.input.getAttribute("rows"))?this.input.getAttribute("rows"):5;this.setExpand();this.remaining=YAHOO.util.Dom.getElementsByClassName("remaining","span",this.node)[0];this.response=this.getResponse(this.input.id);this.maxLength=this.elattr["maxlength"];}
if(this.hasResponse()){this.resizer=YAHOO.util.Dom.getElementsByClassName("boxSizer","div",this.node)[0];this.spanResizer=YAHOO.util.Dom.getElementsByClassName("spanResizer","span",this.node)[0];YAHOO.util.Event.on(this.input,"keyup",this.keyup,this,true);YAHOO.util.Event.on(this.input,"change",this.keyup,this,true);YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}}
IAJS.CONTROLLER.Textarea.prototype.hookAfterInit=function(){this.validate();this.updateRemaining();this.updateRows();}
IAJS.CONTROLLER.Textarea.prototype.keyup=function(e){this.updateRemaining();this.updateRows();}
IAJS.CONTROLLER.Textarea.prototype.setExpand=function(){doExpand=IAJS.CONFIG.expandTextarea;attr=this.elattr['maxexpand']*1;if(IAJS.CONFIG.expandTextarea===false||attr===false){this.maxExpand=false;}else{this.maxExpand=(attr>this.rows)?attr:this.rows*2;}}
IAJS.CONTROLLER.Textarea.prototype.updateRows=function(){if(this.maxExpand){var number_of_enters=this.input.value.split("\n").length;var number_of_lines=parseInt(this.input.value.length/this.input.getAttribute("cols"));var number_rows=(number_of_enters>=number_of_lines)?number_of_enters:number_of_lines;if(number_rows<=this.rows){this.input.rows=this.rows;}else if(number_rows<=this.maxExpand){YAHOO.util.Dom.setStyle(this.input,"height","");this.input.rows=number_rows;}}}
IAJS.CONTROLLER.Textarea.prototype.mousedown=function(e){IAJS.log("IAJS.CONTROLLER.Textarea.prototype.mousedown","warn");YAHOO.util.Dom.setStyle(this.input,"color","#ff0000");var reg=new YAHOO.util.Dom.getRegion(this.input);YAHOO.util.Event.on(this.input,"mousemove",this.mousemove,this,true);YAHOO.util.Event.on(this.input,"mouseup",this.mouseup,this,true);}
IAJS.CONTROLLER.Textarea.prototype.mouseup=function(){IAJS.log("IAJS.CONTROLLER.Textarea.prototype.mouseup","warn");YAHOO.util.Dom.setStyle(this.input,"color","#000000");YAHOO.util.Event.removeListener(this.input,"mousemove",this.mousemove);}
IAJS.CONTROLLER.Textarea.prototype.mousemove=function(e){IAJS.log("IAJS.CONTROLLER.Textarea.prototype.mousemove","warn");YAHOO.util.Dom.setStyle(this.input,"color","#00ff00");return true;var xy=YAHOO.util.Event.getXY(e);YAHOO.util.Dom.setStyle(this.spanResizer,'width',parseInt(xy[0]));YAHOO.util.Dom.setStyle(this.spanResizer,'height',parseInt(xy[1]));}
IAJS.CONTROLLER.Textarea.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.textarea(this.input.value,this.elattr.maxlength);this.responseAction();}
IAJS.CONTROLLER.Textarea.prototype.updateRemaining=function(){if(this.maxLength>0){var remaining=this.maxLength-this.input.value.length;txt=(remaining<0)?"<span class='tooMuchChars'>"+LOCALIZE.translation.REMAINING+" "+remaining+"</span>":LOCALIZE.translation.REMAINING+" "+remaining;this.remaining.innerHTML=txt;}}
IAJS.CONTROLLER.Textarea.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.TEXT_MANDATORY);break;case IAJS.RESPONSE.TEXT.TOLONG:Response.set(this.response,"error",LOCALIZE.messages.TEXT_TOLONG);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}}
IAJS.CONTROLLER.Textarea.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Url=function(node){this.node=node;this.objectType="Url";}
YAHOO.lang.extend(IAJS.CONTROLLER.Url,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Url.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();if(!this.getAttr('allowedScheme'))this.setAttr('allowedScheme','http, https');this.response=this.getResponse(this.input.id);}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}};IAJS.CONTROLLER.Url.prototype.hookAfterInit=function(){this.validate();};IAJS.CONTROLLER.Url.prototype.hookBeforeSubmit=function(){if(this.validationCode==IAJS.RESPONSE.FALLTHROUGH&&!this.elattr['isOptional']){this.validationCode=IAJS.RESPONSE.MANDATORY;}
this.responseAction();};IAJS.CONTROLLER.Url.prototype.validate=function(){var urlString=this.input.value;urlString=urlString.toStructuredUrl(this.elattr['assumeScheme']);this.validationCode=IAJS.VALIDATION.url(urlString,this.elattr['allowedScheme']);this.responseAction();};IAJS.CONTROLLER.Url.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.URL_INVALID);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.URL_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}};IAJS.CONTROLLER.Url.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.FieldLevelHelp=function(node){this.node=node;this.cNode;this.deflistName;this.deftextnode;this.panel;this.visible=false;this.objectType="FieldLevelHelp";}
YAHOO.lang.extend(IAJS.CONTROLLER.FieldLevelHelp,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.FieldLevelHelp.prototype.init=function(){if(this.node){this.id=this.node.id;this.initAttribute();this.deflists=YAHOO.util.Dom.getElementsByClassName("fieldHelpList","div");YAHOO.util.Dom.addClass(this.deflists,"hidden")
var deflink=YAHOO.util.Dom.get("def_"+this.node.getAttribute('id'));if(deflink){this.deftextnode=deflink.parentNode.nextSibling;if(this.deftextnode.nodeType==3){this.deftextnode=deflink.parentNode.nextSibling.nextSibling;}
var name="#"+this.node.id;var backlinks=YAHOO.util.Dom.getElementsBy(function(el){return el.href.indexOf(name)>-1;},"a",this.deftextnode);if(backlinks.length>0)
YAHOO.util.Dom.batch(backlinks,function(el){YAHOO.util.Dom.setStyle(el,"display","none");});YAHOO.util.Event.on(this.node,"click",this.show,this,true);YAHOO.util.Event.on(this.node,"click",this.doNothing,this,true);this.fldWorld=IAJS.OBSERVER.getInstance();this.fldWorld.subscribe(this.onShowEvent,this,true);IAJS.log("FieldLevelHelp "+this.id+" "+"flh_"+this.node.getAttribute('name'),"window",this);}else{IAJS.log("no fieldHelpList entry for "+this.node.getAttribute('id'),"error",this);}}}
IAJS.CONTROLLER.FieldLevelHelp.prototype.create=function(){IAJS.log("CREATING PANEL","info",this);this.panel=new YAHOO.widget.Panel("panel_"+this.id,{width:"15em",visible:false,draggable:true,close:true,constraintoviewport:true});var titleNode=document.getElementById("def_"+this.id);this.panel.setHeader(titleNode.innerHTML);this.panel.setBody(this.deftextnode.innerHTML);this.panel.cfg.setProperty('context',[this.id,'tr']);this.panel.render(document.body);this.panel.show();}
IAJS.CONTROLLER.FieldLevelHelp.prototype.onShowEvent=function(type,panel){if(this.visible)this.hide();}
IAJS.CONTROLLER.FieldLevelHelp.prototype.doNothing=function(e){YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.FieldLevelHelp.prototype.hide=function(e){if(e){var elt=YAHOO.util.Event.getTarget(e);if(("help_"+elt.getAttribute('id'))===this.getControllerId())return false;if(e.type=="click"&&elt.parentNode.getAttribute('id')=="panel_"+this.id)return false;if(e.type=="keyup"){charCode=YAHOO.util.Event.getCharCode(e);hide=false;if(charCode==27||charCode==9)hide=true;if(!hide)return false;}}
this.panel.hide();this.visible=false;YAHOO.util.Event.on(this.node,"click",this.show,this,true);YAHOO.util.Event.removeListener(document,"keyup",this.hide);YAHOO.util.Event.removeListener(document,"click",this.hide);}
IAJS.CONTROLLER.FieldLevelHelp.prototype.show=function(e){if(!this.panel)this.create();this.fldWorld.fire(this.panel);this.panel.cfg.setProperty('context',[this.id,'tl','br']);this.panel.show();this.visible=true;YAHOO.util.Event.on(document,"keyup",this.hide,this,true);YAHOO.util.Event.on(document,"click",this.hide,this,true);YAHOO.util.Event.removeListener(this.id,"click",this.show);YAHOO.util.Event.stopEvent(e);}
IAJS.CONTROLLER.Time=function(node){this.objectType="Time";this.node=node;this.id;this.event={onChange:null};IAJS.CONTROLLER.Time.superclass.constructor.call(this,node);}
YAHOO.lang.extend(IAJS.CONTROLLER.Time,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Time.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();this._initEvent();}else{return false;}
if(this.input){this.id=this.input.id;this.response=this.getResponse(this.input.id);}else{return false;}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}
return true;}
IAJS.CONTROLLER.Time.prototype._initEvent=function(){this.event.onChange=new YAHOO.util.CustomEvent("onChange",this);}
IAJS.CONTROLLER.Time.prototype.hookAfterInit=function(){this.validate();};IAJS.CONTROLLER.Time.prototype.getTime=function(){return(this.input)?this.input.value:false;}
IAJS.CONTROLLER.Time.prototype.validate=function(){var m=IAJS.ELATTR.getMaster(this);if(m){var master=(m.controller)?IAJS.controllerCollection[m.controller]:IAJS.controllerCollection[m.element];if(master&&master.validationCode==IAJS.RESPONSE.OK){this.validationCode=IAJS.VALIDATION.timeRange(this.getTime(),master.getTime(),this.elattr.mintimediff,this.elattr.maxtimediff);}else{return false;}}else{this.validationCode=IAJS.VALIDATION.time(this.input.value,this.elattr['mintime'],this.elattr['maxtime']);}
this.responseAction();};IAJS.CONTROLLER.Time.prototype.responseAction=function(){IAJS.log("time validationCode = "+this.validationCode+" - "+this.id,"info");switch(this.validationCode){case IAJS.RESPONSE.OK:var timeString,dateTime=this.input.value.toStructuredTime().toReadableTime(null);if(dateTime.getSeconds()==0&&dateTime.getMinutes()==0)
timeString=dateTime.format("%G% u");if(dateTime.getSeconds()==0&&dateTime.getMinutes()!=0)
timeString=dateTime.format("%G% u %i%");if(!timeString)
timeString=dateTime.format("%G% u %i%, %S% sec");Response.set(this.response,"confirmation",timeString);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.TIME_INVALID);break;case IAJS.RESPONSE.OUTOFRANGE:var timeString,dateTime=this.input.value.toStructuredTime().toReadableTime(null);if(dateTime.getSeconds()==0&&dateTime.getMinutes()==0)
timeString=dateTime.format("%G% u");if(dateTime.getSeconds()==0&&dateTime.getMinutes()!=0)
timeString=dateTime.format("%G% u %i%");if(!timeString)
timeString=dateTime.format("%G% u %i%, %S% sec");Response.set(this.response,"error",timeString+" "+LOCALIZE.messages.TIME_OUT_OF_RANGE);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.TIME_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}};IAJS.CONTROLLER.Time.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Time.prototype.initControllerId=function(){return(this.input&&this.input.id)?this.input.id:this.objectType+"_"+IAJS.CONFIG.controllerIdCounter++;}
IAJS.CONTROLLER.Time.prototype.onSubordinateChange=function(){var subordinate=IAJS.ELATTR.getSubordinate(this);if(subordinate)me.setEnabled(args[0].value==subordinate.element);}
IAJS.CONTROLLER.VatBase=function(node){this.node=node;this.insideForm=true;this.objectType="VatBase";}
YAHOO.extend(IAJS.CONTROLLER.VatBase,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.VatBase.prototype.init=function(node){this.node=node;if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();this.response=this.getResponse(this.input.id);if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}}}
IAJS.CONTROLLER.VatBase.prototype.getCountry=function(){};IAJS.CONTROLLER.VatBase.prototype.hookAfterInit=function(){this.validate();};IAJS.CONTROLLER.VatBase.prototype.hookBeforeSubmit=function(){};IAJS.CONTROLLER.VatBase.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.vat(this.getCountry(),this.input.value);this.responseAction();};IAJS.CONTROLLER.VatBase.prototype.responseAction=function(){IAJS.log("Vat responseAction "+this.validationCode,"info");switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.VAT_INVALID);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}};IAJS.CONTROLLER.VatBase.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Vat=function(node){this.node=node;this.countryElm;this.objectType="Vat";}
YAHOO.extend(IAJS.CONTROLLER.Vat,IAJS.CONTROLLER.VatBase);IAJS.CONTROLLER.Vat.prototype.init=function(){if(this.node){IAJS.CONTROLLER.Vat.superclass.init.call(this,this.node);this.countryElm=YAHOO.util.Dom.getElementsBy(function(el){return true},"select",this.node)[0];this.initAttribute();this._initEvent();if(this.hasResponse()){YAHOO.util.Event.on(this.countryElm,"change",this.validate,this,true);}}}
IAJS.CONTROLLER.Vat.prototype.getCountry=function(){return(this.countryElm)?this.countryElm.options[this.countryElm.selectedIndex].value:null;};IAJS.CONTROLLER.VatBelgium=function(node){this.node=node;this.objectType="VatBelgium";}
YAHOO.extend(IAJS.CONTROLLER.VatBelgium,IAJS.CONTROLLER.VatBase);IAJS.CONTROLLER.VatBelgium.prototype.init=function(){if(this.node){IAJS.CONTROLLER.VatBelgium.superclass.init.call(this,this.node);this.initAttribute();this._initEvent();}}
IAJS.CONTROLLER.VatBelgium.prototype.getCountry=function(){return"BE";}
IAJS.CONTROLLER.Tabpane=function(node){this.node=node;this.tabView;this.objectType="Tabpane";}
YAHOO.extend(IAJS.CONTROLLER.Tabpane,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Tabpane.prototype.init=function(){if(this.node){this.node.setAttribute("id",this.getControllerId());this.tabView=new YAHOO.widget.TabView(this.controllerId);}}
IAJS.CONTROLLER.TelephoneBase=function(node){this.node=node;this.objectType="TelephoneBase";}
YAHOO.extend(IAJS.CONTROLLER.TelephoneBase,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.TelephoneBase.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.response=this.getResponse(this.input.id);this.initAttribute();}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);}}
IAJS.CONTROLLER.TelephoneBase.prototype.getCountry=function(){};IAJS.CONTROLLER.TelephoneBase.prototype.hookAfterInit=function(){this.validate();}
IAJS.CONTROLLER.TelephoneBase.prototype.hookBeforeSubmit=function(){}
IAJS.CONTROLLER.TelephoneBase.prototype.validate=function(){this.validationCode=IAJS.VALIDATION.telephone(this.getCountry(),this.input.value);this.responseAction();}
IAJS.CONTROLLER.TelephoneBase.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.set(this.response,"confirmation",this.input.value.toReadablePhone());break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.PHONE_INVALID);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}}
IAJS.CONTROLLER.TelephoneBase.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.TelephoneBase.prototype.initControllerId=function(){return this.input.id;}
IAJS.CONTROLLER.TelephoneSimple=function(node){this.node=node;this.objectType="TelephoneSimple";}
YAHOO.extend(IAJS.CONTROLLER.TelephoneSimple,IAJS.CONTROLLER.TelephoneBase);IAJS.CONTROLLER.TelephoneSimple.prototype.init=function(){if(this.node){IAJS.CONTROLLER.TelephoneSimple.superclass.init.call(this,this.node);}}
IAJS.CONTROLLER.TelephoneSimple.prototype.getCountry=function(){return"BE";};IAJS.CONTROLLER.TelephoneExtended=function(node){this.node=node;this.countryElm;this.objectType="TelephoneExtended";}
YAHOO.extend(IAJS.CONTROLLER.TelephoneExtended,IAJS.CONTROLLER.TelephoneBase);IAJS.CONTROLLER.TelephoneExtended.prototype.init=function(){if(this.node){IAJS.CONTROLLER.Vat.superclass.init.call(this,this.node);this.countryElm=YAHOO.util.Dom.getElementsBy(function(el){return true},"select",this.node)[0];if(this.hasResponse()){YAHOO.util.Event.on(this.countryElm,"blur",this.validate,this,true);}}}
IAJS.CONTROLLER.TelephoneExtended.prototype.getCountry=function(){return(this.countryElm)?this.countryElm.options[this.countryElm.selectedIndex].value:null;};IAJS.CONTROLLER.Textfield=function(node){this.node=node;this.objectType="Textfield";}
YAHOO.extend(IAJS.CONTROLLER.Textfield,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Textfield.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.initAttribute();}}
IAJS.CONTROLLER.Textfield.prototype.hookAfterInit=function(){}
IAJS.CONTROLLER.Textfield.prototype.setEnabled=function(value){IAJS.CONTROLLER.Textfield.superclass.setEnabled.call(this,value);}
IAJS.CONTROLLER.Textfield.prototype.setVisible=function(value){IAJS.log("IAJS.CONTROLLER.Textfield.prototype.setVisible "+value,"error");(value)?this.input.removeAttribute("hidden"):this.input.setAttribute("hidden","hidden");}
IAJS.CONTROLLER.Textfield.prototype.initControllerId=function(){return(this.input&&this.input.id)?this.input.id:this.objectType+"_"+IAJS.CONFIG.controllerIdCounter++;}
IAJS.CONTROLLER.Textfield.prototype.hookBeforeSubmit=function(){return false};IAJS.CONTROLLER.Textfield.prototype.onSubordinateChange=function(){var subordinate=IAJS.ELATTR.getSubordinate(this);if(subordinate){var selected=IAJS.controllerCollection[subordinate.controller].getSelected();if(selected)this.setEnabled(selected[subordinate.element]);if(!this.labelChecked&&IAJS.controllerCollection[subordinate.controller].objectType=="Dropdownlist"){var l=YAHOO.util.Dom.getElementsBy(function(el){return(el.getAttribute("for"));},"label",this.node)[0];YAHOO.util.Dom.addClass(l,"hidden");}
this.labelChecked=true;}};IAJS.CONTROLLER.DefinitionLink=function(node){this.node=node;this.objectType="DefinitionLink";IAJS.log("DefinitionLink NODE: "+this.node.getAttribute('name'),"info",this);IAJS.CONTROLLER.DefinitionLink.superclass.constructor.call(this,node);this.speechBubble;}
YAHOO.extend(IAJS.CONTROLLER.DefinitionLink,IAJS.CONTROLLER.DefinitionListBase);IAJS.CONTROLLER.DefinitionLink.prototype.init=function(){IAJS.log("DefinitionLink INIT","time",this);IAJS.CONTROLLER.DefinitionLink.superclass.init.call(this,"definitionList","di_");if(this.deftextnode){IAJS.log("D deftextnode");var div1=document.createElement("div");YAHOO.util.Dom.addClass(div1,"definitionBox");YAHOO.util.Dom.setStyle(div1,"visibility","hidden");var div2=document.createElement("div");YAHOO.util.Dom.addClass(div2,"speechBubble");YAHOO.util.Dom.addClass(div2,"tl");div1.appendChild(div2);for(var k=0;k<this.deftextnode.childNodes.length;k++){div1.appendChild(this.deftextnode.childNodes[k].cloneNode(true));}
document.body.appendChild(div1);this.floater=div1;this.speechBubble=div2;}}
IAJS.CONTROLLER.DefinitionLink.prototype.hookOnTopLeft=function(){YAHOO.util.Dom.removeClass(this.speechBubble,"tr");YAHOO.util.Dom.removeClass(this.speechBubble,"bl");YAHOO.util.Dom.addClass(this.speechBubble,"tl");}
IAJS.CONTROLLER.DefinitionLink.prototype.hookOnTopRight=function(){YAHOO.util.Dom.removeClass(this.speechBubble,"tl");YAHOO.util.Dom.removeClass(this.speechBubble,"bl");YAHOO.util.Dom.addClass(this.speechBubble,"tr");}
IAJS.CONTROLLER.DefinitionLink.prototype.hookOnBottomRight=function(){YAHOO.util.Dom.removeClass(this.speechBubble,"tl");YAHOO.util.Dom.removeClass(this.speechBubble,"bl");YAHOO.util.Dom.addClass(this.speechBubble,"br");}
IAJS.CONTROLLER.DefinitionLink.prototype.hookOnBottomLeft=function(){YAHOO.util.Dom.removeClass(this.speechBubble,"tl");YAHOO.util.Dom.removeClass(this.speechBubble,"br");YAHOO.util.Dom.addClass(this.speechBubble,"bl");}
IAJS.CONTROLLER.Iban=function(node){this.node=node;this.objectType="Iban";}
YAHOO.lang.extend(IAJS.CONTROLLER.Iban,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Iban.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("textfield","input",this.node)[0];this.response=this.getResponse(this.input.id);}
if(this.hasResponse()){YAHOO.util.Event.on(this.input,"blur",this.validate,this,true);YAHOO.util.Event.on(this.country,"change",this.validate,this,true);}}
IAJS.CONTROLLER.Iban.prototype.hookAfterInit=function(){this.validate();}
IAJS.CONTROLLER.Iban.prototype.hookBeforeSubmit=function(){}
IAJS.CONTROLLER.Iban.prototype.validate=function(){IAJS.log("validating Belgian Bank Account Number","info");this.validationCode=IAJS.VALIDATION.Iban(this.input.value);this.responseAction();}
IAJS.CONTROLLER.Iban.prototype.responseAction=function(){IAJS.log("Bank account responseAction "+this.validationCode,"info");switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.BANKACCOUNT_INVALID);break;case IAJS.RESPONSE.FALLTHROUGH:default:Response.clear(this.response);}}
IAJS.CONTROLLER.Iban.prototype.getCheckInsideForm=function(){return true;}
IAJS.CONTROLLER.Transferlist=function(node){this.node=node;this.label;this.objectType="Transferlist";}
YAHOO.lang.extend(IAJS.CONTROLLER.Transferlist,IAJS.CONTROLLER.BaseController);IAJS.CONTROLLER.Transferlist.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("fileselect","select",this.node)[0];this.label=YAHOO.util.Dom.getElementsBy(function(el){return(el.getAttribute("for"));},"label",this.node)[0];this.initAttribute();this.response=this.getResponse(this.input.id);if(this.input){this.createTransferList();}
else IAJS.log("create transferlist: no input","error");}}
IAJS.CONTROLLER.Transferlist.prototype.createTransferList=function(){this.list=new IAJS.CONTROLLER.TransferlistObject(this);this.list.init();}
IAJS.CONTROLLER.Transferlist.prototype.hookAfterInit=function(){}
IAJS.CONTROLLER.Transferlist.prototype.validate=function(){}
IAJS.CONTROLLER.Transferlist.prototype.responseAction=function(){switch(this.validationCode){case IAJS.RESPONSE.OK:Response.clear(this.response);break;case IAJS.RESPONSE.INVALID:Response.set(this.response,"error",LOCALIZE.messages.TRANSFER_INVALID);break;case IAJS.RESPONSE.MANDATORY:Response.set(this.response,"error",LOCALIZE.messages.TRANSFER_MANDATORY);break;case IAJS.RESPONSE.FALLTHROUGH:break;default:Response.clear(this.response);}}
IAJS.CONTROLLER.TransferlistObject=function(owner){this.owner=owner;this.originalId;this.pickContainerId;this.selectedContainerId;this.selectButtonId;this.deSelectButtonId;this.cloneContainerId;this.pickListArray;this.selectedListArray;this.objectType="TransferlistObject";}
IAJS.CONTROLLER.TransferlistObject.prototype.init=function(){this.originalId=this.owner.input.id;this.pickContainerId="pick_"+this.originalId;this.selectedContainerId="select_"+this.originalId;this.selectOneButtonId="selectOne_"+this.originalId;this.deSelectOneButtonId="deSelectOne_"+this.originalId;this.selectAllButtonId="selectAll_"+this.originalId;this.deSelectAllButtonId="deSelectAll_"+this.originalId;this.cloneContainerId="cloneContainer_"+this.originalId;this.pickListArray=new Array();this.selectedListArray=new Array();div=document.createElement("DIV");YAHOO.util.Dom.setStyle(div,'display','none');div.setAttribute("id",this.cloneContainerId);copy=this.owner.input.cloneNode(true);div.appendChild(copy);this.owner.node.parentNode.appendChild(div);this.copySelectedOptions(this.owner.input,copy);try{this.owner.node.innerHTML=this._fromTemplate();this.original=document.getElementById(this.originalId);this.picker=document.getElementById(this.pickContainerId);this.selector=document.getElementById(this.selectedContainerId);this.fill();YAHOO.util.Event.on(this.picker,"dblclick",this.selectOne,this,true);YAHOO.util.Event.on(this.selector,"dblclick",this.deSelectOne,this,true);YAHOO.util.Event.on(this.selectOneButtonId,"click",this.selectOne,this,true);YAHOO.util.Event.on(this.deSelectOneButtonId,"click",this.deSelectOne,this,true);YAHOO.util.Event.on(this.selectAllButtonId,"click",this.selectAll,this,true);YAHOO.util.Event.on(this.deSelectAllButtonId,"click",this.deSelectAll,this,true);YAHOO.util.Event.on(this.pickContainerId,"click",this.checkButtons,this,true);YAHOO.util.Event.on(this.selectedContainerId,"click",this.checkButtons,this,true);}catch(e){IAJS.log("TransferlistObject: "+e,"error");}}
IAJS.CONTROLLER.TransferlistObject.prototype.fill=function(){this.clear();arr=this.original.options;for(i=0;i<arr.length;i++){opt=arr[i];obj=new Option(opt.text,opt.value);if(opt.selected)this.selector.options.add(obj);else this.picker.options.add(obj);}
this.checkButtons();}
IAJS.CONTROLLER.TransferlistObject.prototype.clear=function(){while(this.picker.options.length!=0){this.picker.remove(this.picker.options.length-1);}
while(this.selector.options.length!=0){this.selector.remove(this.selector.options.length-1);}}
IAJS.CONTROLLER.TransferlistObject.prototype.selectOne=function(){for(i=0;i<this.picker.options.length;i++){opt=this.picker.options[i];if(opt.selected){for(j=0;j<this.original.options.length;j++){if(opt.value==this.original.options[j].value)this.original.options[j].selected=true;}}}
this.fill();}
IAJS.CONTROLLER.TransferlistObject.prototype.selectAll=function(){for(i=0;i<this.original.options.length;i++){this.original.options[i].selected=true;}
this.fill();}
IAJS.CONTROLLER.TransferlistObject.prototype.deSelectOne=function(){for(i=0;i<this.selector.options.length;i++){opt=this.selector.options[i];if(opt.selected){for(j=0;j<this.original.options.length;j++){if(opt.value==this.original.options[j].value)this.original.options[j].selected=false;}}}
this.fill();}
IAJS.CONTROLLER.TransferlistObject.prototype.deSelectAll=function(){for(i=0;i<this.original.options.length;i++){this.original.options[i].selected=false;}
this.fill();}
IAJS.CONTROLLER.TransferlistObject.prototype.checkButtons=function(e){target=(e)?e.target.parentNode:false;status=false;this.enableButton(this.selectOneButtonId,this.picker.options.length);this.enableButton(this.selectAllButtonId,this.picker.options.length);this.enableButton(this.deSelectAllButtonId,this.selector.options.length);this.enableButton(this.deSelectOneButtonId,this.selector.options.length);}
IAJS.CONTROLLER.TransferlistObject.prototype.enableButton=function(id,bool){obj=document.getElementById(id);(bool)?obj.removeAttribute('disabled'):obj.setAttribute('disabled','disabled');}
IAJS.CONTROLLER.TransferlistObject.prototype.copySelectedOptions=function(from,to){for(i=0;i<from.options.length;i++){if(from.options[i].selected)to.options[i].selected=true;}}
IAJS.CONTROLLER.TransferlistObject.prototype._fromTemplate = function() {
	IAJS.log("T","time");
	var tagReplace = {
		"selectAll"  : '<button id="selectAll_{id}" type="button" title="{selectall}">>></button><br />',
		"selectOne" : '<button id="selectOne_{id}" title="{selectone}" type="button">></button><br />',
		"deselectAll" : '<button id="deSelectOne_{id}" type="button" title="{deselectone}" disabled="disabled"><</button><br />',
		"deselectOne" : '<button id="deSelectAll_{id}" type="button" title="{deselectall}" disabled="disabled"><<</button><br />',
		"selectall" : LOCALIZE.messages.TRANSFER_SELECTALL,
		"selectone" : LOCALIZE.messages.TRANSFER_SELECTONE,
		"deselectone" : LOCALIZE.messages.TRANSFER_DESELECTONE,
		"deselectall" : LOCALIZE.messages.TRANSFER_DESELECTALL,
		"id" : this.owner.input.id
		};
	var template = this._getTemplate();
	for(key in tagReplace){
		var template1split = template.split("{"+key+"}");
		template = template1split.join(tagReplace[key]);
	}
	IAJS.log("T","time");
	return template;
}
/**
 * @private
 */
IAJS.CONTROLLER.TransferlistObject.prototype._getTemplate = function() {
	return '<fieldset class="combined">\
		<legend class="combined"><span class="label">choice<span class="required">*</span></span></legend>\
		<div class="positionerRight">\
		<div class="combineWrapper clearfix">\
		<label class="hidden" for="pick_{id}">label left</label>\
		<select	name="pick_{id}" id="pick_{id}" title="transferPickList" multiple="multiple" class="fileselect leftFloat" size="10"></select>\
		<span class="actions leftFloat">\
		{selectAll}{selectOne}{deselectAll}{deselectOne}\
		<button id="deSelectAll_{id}" type="button" title="deselect all" disabled="disabled"><<</button>\
		</span>\
		<label class="hidden" for="select_{id}">label right</label>\
		<select name="select_{id}" id="select_{id}" title="transferSelectedList" multiple="multiple" class="fileselect leftFloat" size="10"></select>\
		</div>\
		</div>\
		</fieldset>';	
}