if(!self.Ida)
{try
{var Ida=top.Ida||top.opener&&top.opener.Ida;}catch(e)
{}Ida=self.Ida||function()
{var ida=
{name: 'ida'
, ELEMENT_NODE: 1
, ATTRIBUTE_NODE: 2
, TEXT_NODE: 3
, IE: document.all ? true : false
, dump: function(s)
{return s;}, extensions : []
, getActiveWindow: function()
{return Ida.activeWindow||self;}, getLangString: function(str)
{var isObject=typeof str=="object"&&str;var s=isObject?(str.key||""):str;if(!s) return str;try
{var r=this.getLangString.strings[s];if(!r&&Ida.course)
{r=Ida.course.getContent(s, 'global');if(!r)
{r=Ida.course.getContent(s, 'msg');if(!r)
{r=Ida.course.getContent(s, 'meta');}}}var a=arguments;var d=0;if(a.length==2&&(a[1] instanceof Array)&&a[1].length)
{a=a[1];++d;}var appendArgs=[];var retVal="";if(r)
{for(var i=1;i<a.length + d&&i<9;++i)
{var o=r;r=r.replace(new RegExp('%' + i, 'g'), a[i-d]);if(o==r)
{appendArgs.push(a[i-d]);}}retVal=r;for(var i=9-d;i<a.length;++i)
{if(o==r)
{appendArgs.push(a[i]);}}}else if(!isObject)
{retVal=str;for(var i=1-d;i<a.length;++i)
{if(o==r)
{appendArgs.push(a[i]);}}}if(appendArgs.length)
{retVal +='\n';for(i=0;i<appendArgs.length;++i)
{retVal +='\n' + appendArgs[i];}}}catch(e)
{this.handleError(e, 'Error in Ida.getLangString.\nNo translation found for "' + retVal + '".');}if(isObject)
{str.value=retVal;return str;}return retVal;}, getPref: function(aPref, aType)
{if(this.settings&&typeof this.settings[aPref]!='undefined') return this.settings[aPref];else return null;}, handleError: function(e, fun, msg)
{if(e&&typeof e=='object'&&!e.name&&!e.message&&!e.fileName&&!e.lineNumber)
{e='' + e;}if(!e||typeof e!='object')
{if(arguments.length>1)
{var s=this.getLangString('errGeneral', fun);if(msg)
{s +='\n'+msg;}}else
{s=this.getLangString('errGeneral');}if(arguments.length)
{if(arguments.length>1) s +='\n';s +='\n'+e;}}else
{if(typeof msg=='undefined') msg='';if(!e.name&&e.getName&&typeof e.getName=='function')
{e.name=e.getName();}try
{var detailed=0;switch(Ida.getPref('Ida.errors.detailLevel'))
{case 1 :
detailed=!!(Ida.development)&&1;break;case 2 :
detailed=!!(Ida.development)&&2;break;case 3 :
detailed=!!(Ida.development)&&2||1;break;case 4 : detailed=2;break;}}catch(e)
{}if(detailed)
{if(detailed<2)
{e.stack='';}}else
{e.stack='';e.fileName='';e.lineNumber='';}s=this.getLangString('errException', e.name, e.message, fun, e.fileName, e.lineNumber, msg, e.stack);}if(s)
{var alert=Ida.error||Ida.getActiveWindow().alert;alert(s);}}, IdaError: function(errCode, errFile, msg)
{var e=new Error();var b=0, c=0;var s=e.stack||'';do
{b=s.indexOf('@', b);}while(++c<3&&++b>0);this.stack=b<0?s:s.substr(b);if(s)
{var e=s.indexOf('@', b);s=s.substring(b, e>b?e:s.length);var r=/@(.)+?\s{1}\(/;e=s.match(r);this.lineNumber=e&&e[0]||'';e=this.lineNumber.lastIndexOf(':');if(e<0)
{this.lineNumber='';}else
{if(!errFile)
{errFile=this.lineNumber.substring(1, e);}this.lineNumber=parseInt(this.lineNumber.substr(e + 1, this.lineNumber.length - e - 3));}}if(arguments.length>2)
{if(!(msg instanceof Ida.IdaErrorMsg))
{this.args=[];for(var i=2;i<arguments.length;++i)
{this.args.push(arguments[i]);}msg=Ida.getLangString(errCode, this.args);}}else
{msg=Ida.getLangString(errCode);}this.name=errCode||'ERR_NOERR';this.message=msg||'';this.fileName=''+errFile;this.toString=Ida.IdaError.toString;}, IdaErrorMsg: function(key)
{if(!key)
{throw new this.IdaError('ERR_MISSING_ARGUMENT', 'ida.js#IdaErrorMsg', 'key');}this.key=key;this.args=[];for(var i=1;i<arguments.length&&i<10;++i)
{this.args.push('' + arguments[i]);}}, importLangStrings: function(so, pfx)
{if(so&&typeof so=='object')
{pfx='' +(pfx?pfx + '_':'');for(var i in so)
{if(typeof so[i]=='string')
{this.getLangString.strings[pfx + i]=so[i];}}}}, include: function(p, callBackFunction)
{var me=Ida.include;var load=!p;me.fileIsLoaded=false;if(!me.fileLoaded)
{me.fileLoaded=function(file)
{var me=Ida.include;var found=false;for(var i=0;i<me.loading.length;++i)
{if(me.loading[i].file==file)
{found=true;var o=me.loading.splice(i, 1)[0];if(o.fun)
{o.fun(o.file);}break;}}if(me.loading.length&&found)
{me();}else if(!found)
{Ida.handleError('Could not find file"' + file + '" as file pending to load.','Ida.include.fileLoaded');return;}};}if(!me.loading)
{me.loading=[];}if(p)
{if(typeof p=='object'&&p.length)
{for(i=0;i<p.length;++i)
{if(p[i]&&p[i][0])
{me.loading.push({file : p[i][0], fun : p[i][1]});load=load||me.loading.length==1;}}}else
{me.loading.push({file : p, fun : callBackFunction});}}if(me.loading.length==1||load&&me.loading.length>0)
{var loader=self.document.getElementById('frame_fileloader');var lc=false&&loader&&loader.contentWindow;if(loader)
{p='fileloader.html?'
+(Ida.getPref('Ida.runtime.fileloader.param')||'idafile')
+ '=';me.file=me.loading[0].file;if(lc)
{lc.location.replace(p + me.file, true);}else
{loader.src=p + me.file;}}else
{Ida.handleError('missing fileloader.html','Ida.include');}}}, init: function(e)
{e=e||self.event;if(Ida.Event)
{new Ida.Event("Load", this).dispatch();}else
{(Ida.alert||self.alert)('The event module is missing. IDA is inoparable.');}}, isMac: function()
{return Ida.isMac.value||(Ida.isMac.value=navigator.platform.toLowerCase().indexOf('mac')>=0);}, log: function(msg)
{}, reportError : function(msg)
{if(Ida.getPref('Ida.runtime.showErrorReport'))
{alert(msg);}}, windows :{}};ida.IdaErrorMsg.prototype=
{toString:function()
{return Ida.getLangString(this.key, this.args);}};ida.getLangString.strings=[];var e=ida.IdaError;e.toString=function(errObj)
{if(!arguments.length)
{errObj=this;}if(typeof errObj=='object'&&(errObj.name||errObj.fileName||errObj.message||errObj.stack))
{var s='' +(errObj.name||'')+ '\n';try
{var detailed=false;switch(Ida.getPref('Ida.errors.detailLevel'))
{case 1 :
detailed=!!(Ida.development);break;case 2 : detailed=true;break;}}catch(e)
{}if(detailed&&errObj.fileName)
{s +=errObj.fileName +(errObj.lineNumber?':' + errObj.lineNumber : '') + '\n';}if(errObj.message) s +=errObj.message;if(detailed&&errObj.stack)
{s +='\n\n' + errObj.stack;}}else
{s=String(errObj);}return s;};return ida;}();}

Ida.Event=function(aType,aSrc,aTarget)
{this.type=aType;this.src=aSrc;this.targets=(aTarget)?((aTarget instanceof Array) ? aTarget:new Array(aTarget)) : Ida.Event.getAllObjects(aType);this.target=this.targets[0];this.currentTarget=null;};Ida.Event.prototype=
{dispatch: function()
{var lRetVal=true;if(this.type)
{var isAuthor=Ida.isAuthor?Ida.isAuthor():true;var lEvent="on"+this.type;if(this.targets)
{for(var i=0;i<this.targets.length;i++)
{var t=this.targets[i];if(t&&(isAuthor||!t.authorOnlyEvents))
{this.currentTarget=t
if(t.isDLayer)
{if(t.dispatchEvent(this)===false)
{lRetVal=false;}}else
{if(t[lEvent])
{if(t[lEvent](this)===false)
{lRetVal=false;}}}}}}else if(document[lEvent]&&document[lEvent](this)===false)
{lRetVal=false;}}return lRetVal;}, addTarget: function(aTarget)
{if(aTarget){for(var i=0;i<this.targets.length;i++){if(this.targets[i]==aTarget) return false;}this.targets[this.targets.length]=aTarget;if(this.targets.length==1)
this.target=this.targets[0];return true;}else return false
}, setTarget: function(aTarget)
{if(aTarget){this.targets=new Array(aTarget);this.target=aTarget;return true;}else return false
}, setType: function(aType)
{this.type=aType;}};Ida.Event.registeredObjects=[];Ida.Event.tempEvents={};Ida.Event.toString=function()
{return "[object Ida.Event]";};Ida.Event.register=function(aObj, aNice)
{if(typeof aNice!='number'||isNaN(aNice)) aNice=Ida.Event.DEFAULT;if(this.isRegistered(aObj)) return;if(!this.registeredObjects[aNice])
{this.registeredObjects[aNice]=[];}aObj.IdaEventIndex=[aNice, this.registeredObjects[aNice].push(aObj) - 1];};Ida.Event.isRegistered=function(aObj)
{return(aObj.IdaEventIndex&&typeof aObj.IdaEventIndex=="object");};Ida.Event.remove=Ida.Event.unregister=function(aObj)
{if(aObj.IdaEventIndex)
{var nice=aObj.IdaEventIndex[0];var indexPos=aObj.IdaEventIndex[1];try
{if(this.registeredObjects[nice])
{while(indexPos>=0)
{if(this.registeredObjects[nice][indexPos]==aObj)
{Array.removeAt(this.registeredObjects[nice],indexPos);}indexPos--;}}}catch(e)
{Ida.handleError(e);}try
{delete aObj.IdaEventIndex;}catch(e)
{if(aObj)
{aObj.IdaEventIndex=null;}}}};Ida.Event.registerTemporary=function(aObj,eventType)
{var reg=this.registeredObjects[this.TEMP];if(!reg){this.registeredObjects[this.TEMP]=[];reg=this.registeredObjects[this.TEMP];}var pos=Array.indexOf(reg,aObj);if(pos==-1){pos=reg.length;reg[pos]=aObj;}if(!this.tempEvents[eventType])
{this.tempEvents[eventType]=[];}this.tempEvents[eventType].push(aObj);};Ida.Event.clearTemp=function()
{var reg=this.registeredObjects[this.TEMP];if(reg&&reg.length)
{reg.splice(0, reg.length);}for(var i in this.tempEvents)
{delete this.tempEvents[i];}};Ida.Event.getAllObjects=function(eventType)
{var res=[];for(var i=0;i<Ida.Event.registeredObjects.length;++i)
{if(Ida.Event.registeredObjects[i])
{if(i==this.TEMP)
{res=res.concat(this.tempEvents[eventType]);}else
{res=res.concat(Ida.Event.registeredObjects[i]);}}}return res;};Ida.Event.getObjects=function(aNice)
{if(typeof aNice!='number'||isNaN(aNice))
{var res=[];for(var i=0;i<Ida.Event.registeredObjects.length;++i)
{res=res.concat(Ida.Event.registeredObjects[i]);}return res;}else
{return Ida.Event.registeredObjects[aNice]||[];}};Ida.Event.getTempObjects=function()
{return Ida.Event.registeredObjects[Ida.Event.TEMP];};Ida.Event.FIRST=0;Ida.Event.NORMAL=1;Ida.Event.TEMP=2;Ida.Event.GUI=3;Ida.Event.DEFAULT=Ida.Event.NORMAL;

Ida.f=
{setObjectPropertiesFormat : function(obj){var val, prop;for(var i in obj)
obj[i]=this.getFormatedProperty(obj[i]);}, getFormatedProperty : function(prop){if(prop=="true")
prop=true;else if(prop=="false")
prop=false;else{if(!isNaN(prop))
prop=parseFloat(prop);}return prop;}, getFileExtension : function(aFileName)
{var dotIndex=aFileName.lastIndexOf('.');return(dotIndex>-1)?aFileName.substring(dotIndex+1):"";}, setFileExtension : function(aFileName,aExt){var dotIndex=aFileName.lastIndexOf('.');if(dotIndex>-1)
return aFileName.substring(0, dotIndex+1) + aExt;else
return aFileName + "." + aExt;}, getFileName : function(aFile,includeExtension){if(!aFile) return "";var lPos=aFile.lastIndexOf("/");if(lPos==-1)
lPos=aFile.lastIndexOf("\\");if(lPos>-1){aFile=aFile.substring(lPos+1);}if(includeExtension===true) return aFile;var dotIndex=aFile.lastIndexOf('.');return(dotIndex>-1)?aFile.substring(0,dotIndex):aFile;}, setFileName : function(aFile, aName){var lPos=aFile.lastIndexOf("/");if(lPos==-1)
lPos=aFile.lastIndexOf("\\");var lPath="";if(lPos>-1){lPath=aFile.substring(0,lPos+1);aFile=aFile.substring(lPos+1);}var dotIndex=-1;if(aName.lastIndexOf('.')==-1)
dotIndex=aFile.lastIndexOf('.');return lPath + aName +((dotIndex>-1)?aFile.substring(dotIndex):"");}, getFilePath : function(aFile){var lPos=aFile.lastIndexOf("/");if(lPos==-1)
lPos=aFile.lastIndexOf("\\");if(lPos>-1)
aFile=aFile.substring(0,lPos);return aFile;}, getAbsoluteURL : function(rel){var path=this.getFilePath(self.location.href);var pos=rel.indexOf("../");var pPos;while(pos>=0){rel=rel.substring(3);pPos=path.lastIndexOf("/");if(pPos>=0)
path=path.substring(0,pPos);pos=rel.indexOf("../");}return path + "/" + rel;}, isURL : function(url)
{return url.indexOf("www")==0||
url.indexOf("http:")==0||
url.indexOf("https:")==0||
url.indexOf("ftp:")==0||
url.indexOf("mailto:")==0;}, removeClassName: function(elm, clName){var lClassNames=elm.className.split(' ');var i=this.findClassNameIndex(elm, clName);if(i>=0){Array.removeAt(lClassNames,i);elm.className=lClassNames.join(' ');return clName;}return false;}, addClassName: function(elm, clName)
{if(elm&&!Ida.f.hasClassName(elm, clName))
{var lClassNames=elm.className.split(' ');lClassNames.push(clName);elm.className=lClassNames.join(' ');return clName;}return false;}, changeClassName: function(elm, aFromName, aToName, aForce){var i=this.findClassNameIndex(elm, aFromName);if(i>=0){var lClassNames=elm.className.split(' ');lClassNames[i]=aToName;elm.className=lClassNames.join(' ');return aToName;}if(aForce){return this.addClassName(elm, aToName);}return false;}, findClassNameIndex: function(elm, clName){if(elm&&clName&&elm.className){var lClassNames=elm.className.split(' ');for(var i in lClassNames){if(lClassNames[i]==clName) return i;}}return -1;}, hasClassName: function(elm, clName)
{return this.findClassNameIndex(elm, clName)>=0;}, toggleClassName: function(elm,name,on)
{if(typeof on!="boolean")
{on=!Ida.f.hasClassName(elm,name);}if(on)
{this.addClassName(elm,name);}else
{this.removeClassName(elm,name);}return on;}, getStyle: function(elm, aStyle, aType){var retVal;if(elm.ownerDocument&&elm.ownerDocument.defaultView){aStyle=aStyle.replace(/([A-Z])/g, "-$1").toLowerCase();if(aStyle=="border-width"||aStyle=="border-style"||aStyle=="border-color"){var styleArray=aStyle.split(/-/);var borders=["top","right","bottom","left"];var retStyles=[];var different=false;for(var i=0;i<4;i++){var l=retStyles.length;retStyles[l]=this.getStyle(elm, styleArray[0] + "-" + borders[i] + "-" + styleArray[1], aType);if(!different&&i>0&&retStyles[l]!=retStyles[l-1])
different=true;}return different?retStyles.join(" "):retStyles[0];}retVal=elm.ownerDocument.defaultView.getComputedStyle(elm,"").getPropertyValue(aStyle);if(retVal=="auto"){if(aStyle=="width")
retVal=elm.offsetWidth;else if(aStyle=="height")
retVal=elm.offsetHeight;}}else if(elm.currentStyle){retVal=elm.currentStyle[aStyle];}else
return null;if(aType=="number")
return this.measureToNumber(retVal);else
return retVal;}, isNode: function(aNode){return(typeof aNode=="object"&&typeof aNode.nodeType!="undefined");}, getParentNodeByName: function(node,parentName,includeMe){if(!node||!parentName) return null;parentName=parentName.toLowerCase();if(!includeMe)
node=node.parentNode;while(node&&typeof node.nodeName=="string"){if(node.nodeName.toLowerCase()==parentName)
return node;node=node.parentNode;}return null;}, isLink: function(aObj){while(aObj&&!aObj.dLayer){if(aObj.nodeName.toLowerCase()=="a")
return aObj;aObj=aObj.parentNode;}return false;}, isFunction: function(aObj)
{var lType=typeof aObj;return lType=="function"||Ida.IE&&aObj&&lType=="object";}, getDocument: function(aNode){if(!aNode) return document;if(typeof aNode.ownerDocument!="undefined")
return aNode.ownerDocument;else if(typeof aNode.document!="undefined")
return aNode.document;else return document;}, getWindow: function(aNode){var doc=this.getDocument(aNode);if(doc){return doc.parentWindow||doc.defaultView||window;}return null;}, cloneObject: function(aObj,aDeep){var objectClone=new aObj.constructor();if(typeof aDeep!="boolean")
aDeep=false;for(var property in aObj){if(aDeep&&aObj[property]!=null&&typeof aObj[property]=='object')
objectClone[property]=this.cloneObject(aObj[property],true);else
objectClone[property]=aObj[property];}return objectClone;}, getNextFocusElement: function(elm,restart,dir,_looped){var doc=elm?this.getDocument(elm):Ida.getDocument();var allElm=doc.getElementsByTagName("*");var found=elm?false:true;var allowedElements="input,textarea,a,button";if(!dir) dir=1;var start=dir>0?0:allElm.length-1;var end=dir>0?allElm.length:-1;for(var i=start;i!=end;i+=dir){if(!found){if(elm&&allElm[i]==elm){if(_looped)
return null;found=true;continue;}}if(found||(restart&&_looped)){if(allElm[i].focus&&(!elm||allElm[i]!=elm)){if(allElm[i].nodeName.toLowerCase().isInList(allowedElements)&&this.isVisible(allElm[i]))
return allElm[i];}}}return(!elm||_looped)?null:this.getNextFocusElement(elm,true,dir,true);}, getProperties: function(aObj,separator){var lProps=[];var x=0;for(var i in aObj) lProps[x++]=i;lProps=lProps.sort();if(separator) return lProps.join(separator);else return lProps;}, getPropertyList: function(aObj,separator,showAll){var lProps=Ida.f.getProperties(aObj);if(!showAll){for(var i in lProps){try{lProps[i] +="=" +((typeof aObj[lProps[i]]=="function")?"[function]":aObj[lProps[i]]);}catch(e){}}}return lProps.join(separator?separator:"\n");}, getTime: function(){return(new Date().getTime());}, numberToHEX: function(nr){return(nr).toString(16);}, HEXToNumber: function(hex){return parseInt(hex,16);}, convertTo: function(aVar, aType){if(typeof aType=="undefined") return aVar;var retVal;if(aType=="string")
retVal=String(aVar);else if(aType=="number")
retVal=Number(aVar);else if(aType=="boolean"||aType=="bool"){if(typeof aVar=="string")
retVal=(aVar=="true");else if(typeof aVar=="number")
retVal=(aVar==1);else retVal=Boolean(aVar);}else retVal=aVar;return retVal;}, measureToNumber: function(aMeasure){if(typeof aMeasure=="string"){var num=Number(aMeasure.replace(/[^0-9.]/g,""));return aMeasure.charAt(0)=="-"?-num:num;}else if(typeof aMeasure=="number") return aMeasure;else return 0;}, getRandomNumber: function(startPos,endPos,excl){if(typeof startPos!="number")
startPos=0;if(typeof endPos!="number")
endPos=100;var diff=endPos - startPos;var isNumber=typeof excl=="number";do{var ret=Math.round(diff * Math.random()) + startPos;}while(isNumber&&ret==excl&&startPos!=endPos);return ret;}, argumentsToArray: function(aArg){var arr=[];for(var i=0;i<aArg.length;i++){arr.push(aArg[i]);}return arr;}, getAbsoluteX: function(elm){var x=0;if(elm&&typeof elm.offsetParent!="undefined"){while(elm&&typeof elm.offsetLeft=="number"){x +=elm.offsetLeft;elm=elm.offsetParent;}}return x;}, getAbsoluteY: function(elm){var y=0;if(elm&&typeof elm.offsetParent!="undefined"){while(elm&&typeof elm.offsetTop=="number"){y +=elm.offsetTop;elm=elm.offsetParent;}}return y;}, getInnerWidth: function(elm){return elm.offsetWidth -(parseInt(elm.style.borderLeftWidth)||0) -(parseInt(elm.style.borderRightWidth)||0);}, getInnerHeight: function(elm){return elm.offsetHeight -(parseInt(elm.style.borderTopWidth)||0) -(parseInt(elm.style.borderBottomWidth)||0);}, getBorderWidth : function(elm,side){if(!elm||!side||elm.nodeType!=1) return 0;else return parseInt(Ida.f.getStyle(elm, "border" +side+ "Width"))||0;}, setAbsoluteX: function(elm,x){var diff=Ida.f.getAbsoluteX(elm) - elm.offsetLeft;var margin=Ida.f.getStyle(elm,"marginLeft","number");var border=Ida.f.getBorderWidth(elm.parentNode,"Left");if(!margin||typeof margin!="number") margin=0;var pos=x-diff-margin-border;elm.style.left=pos + "px";return pos;}, setAbsoluteY: function(elm,y){var diff=Ida.f.getAbsoluteY(elm) - elm.offsetTop;var margin=Ida.f.getStyle(elm,"marginTop","number");var border=Ida.f.getBorderWidth(elm.parentNode,"Top");if(!margin||typeof margin!="number") margin=0;var pos=y-diff-margin-border;elm.style.top=pos + "px";return pos;}, setAbsoluteW: function(elm,w){elm.style.width=w + "px";return w;var boxOffset=Ida.f.getStyle(elm,"paddingLeft","number") + Ida.f.getStyle(elm,"paddingRight","number") + Ida.f.getStyle(elm,"borderLeftWidth","number") + Ida.f.getStyle(elm,"borderRightWidth","number");elm.style.width=(w-boxOffset) + "px";return w-boxOffset;}, setAbsoluteH: function(elm,h){elm.style.height=h + "px";return h;var boxOffset=Ida.f.getStyle(elm,"paddingTop","number") + Ida.f.getStyle(elm,"paddingBottom","number") + Ida.f.getStyle(elm,"borderTopWidth","number") + Ida.f.getStyle(elm,"borderBottomWidth","number");elm.style.height=(h-boxOffset) + "px";return h-boxOffset;}, isPosInObject: function(xPos,yPos,elm){if(!elm) return false;var x=elm.offsetLeft;var y=elm.offsetTop;var w=elm.offsetWidth;var h=elm.offsetHeight;var lParent=elm.offsetParent;while(lParent&&typeof lParent.offsetLeft!="undefined"){if(x>xPos||y>yPos) return false;x +=lParent.offsetLeft;y +=lParent.offsetTop;lParent=lParent.offsetParent;}return(xPos>=x&&xPos<=x+w&&yPos>=y&&yPos<=y+h);}, getHiddenPart: function(elm, aSurroundingObj, aOffset){if(!aOffset)
aOffset=0;var curX=Ida.f.getAbsoluteX(elm);var curY=Ida.f.getAbsoluteY(elm);var outerX2=Ida.f.getAbsoluteX(aSurroundingObj) + aSurroundingObj.offsetWidth;var outerY2=Ida.f.getAbsoluteY(aSurroundingObj) + aSurroundingObj.offsetHeight;var retVal="";if(outerX2<(curX + elm.offsetWidth + aOffset))
retVal +="x";if(outerY2<(curY + elm.offsetHeight + aOffset))
retVal +="y";return retVal;}, showWithinObject: function(elm, aSurroundingObj, aOffset){if(!aOffset)
aOffset=0;var curX=Ida.f.getAbsoluteX(elm);var curY=Ida.f.getAbsoluteY(elm);var outerX2=Ida.f.getAbsoluteX(aSurroundingObj) + aSurroundingObj.offsetWidth;var outerY2=Ida.f.getAbsoluteY(aSurroundingObj) + aSurroundingObj.offsetHeight;if(outerX2<(curX + elm.offsetWidth + aOffset))
this.setAbsoluteX(elm,(outerX2 - elm.offsetWidth - aOffset));if(outerY2<(curY + elm.offsetHeight + aOffset))
this.setAbsoluteY(elm,(outerY2 - elm.offsetHeight - aOffset));}, isVisible: function(elm){if(!elm||!elm.style||elm.style.visibility=="hidden"||elm.style.display=="none")
return false;else{var p=elm.parentNode;return(p&&p.dLayer&&!p.dLayer.isPage)?Ida.f.isVisible(p):true;}}, setOpacity: function(elm,aOpac){var set=!isNaN(parseFloat(aOpac));if(typeof elm.style.filter!="undefined")
elm.style.filter=set?"Alpha(opacity=" +(aOpac*100) + ")":"";else if(typeof elm.style.MozOpacity!="undefined")
elm.style.MozOpacity=set?aOpac:"";}, getOpacity: function(elm){if(!elm||typeof elm.style=="undefined")
return 1;var val=1;if(typeof elm.style.filter!="undefined"){var match=String(Ida.f.getStyle(elm,"filter")).match(/opacity\s*=\s*(\d+)/);if(match){val=match[1];if(!isNaN(val))
val=val/100;}}else if(typeof elm.style.MozOpacity!="undefined")
val=Ida.f.getStyle(elm,"MozOpacity");return(val==null||isNaN(val))?1:val;}, usedSystemKeys: function(e){return e.shiftKey*Ida.SYSSHIFT + e.ctrlKey*Ida.SYSCTRL + e.altKey*Ida.SYSALT;}, getMouseButton: function(e){if(typeof e.stopPropagation!="undefined"){switch(e.button){case 0: return "left";case 1: return "middle";case 2: return "right";}}else if(e.srcElement){switch(e.button){case 0: // No button is pressed.(This might be the case on click)
case 1: // Left button is pressed.
case 5: // Left and middle buttons both are pressed.
return "left";case 2: // Right button is pressed.
case 6: // Right and middle buttons are both pressed.
return "right";case 4: // Middle button is pressed.
return "middle";case 3: // Left and right buttons are both pressed.
case 7: // All three buttons are pressed.
return null;}}return "left";}, getElm: function(id){return document.getElementById(id);}, getCookie: function(prop){var cookie=document.cookie;if(cookie){var vals=cookie.split(";");for(var i=0;i<vals.length;i++){curVal=vals[i].split("=");if(curVal[0].trim()==prop)
return unescape(curVal[1]);}}return null;}, setCookie: function(prop,val,days){var exp=new Date(new Date().getTime() +((days||365)*24*60*60*1000));document.cookie=prop+"="+escape(val)+";expires="+exp.toGMTString()+";";}, removeCookie: function(prop)
{this.setCookie(prop,"",-1);}, stringToObject: function(str,propSep,valSep){var obj={};var props=String(str).split(propSep||";");var prop, propString;for(var i=0;i<props.length;i++){propString=String(props[i]).split(valSep||":");prop=propString[0].trim();if(prop!=="")
obj[prop]=propString[1];}return obj;}, getElementsByAttribute: function(aNode, aAttrib, aValue, elm){lAttribs={};lAttribs[aAttrib]=aValue||null;return this.getElementsByAttributes(aNode,lAttribs,elm);}, getElementsByAttributes: function(aNode, aAttribObj, elm){var lRetArray=[];var lAllCorrect;var lAllElm=aNode.getElementsByTagName(elm?elm:'*');for(var i=0;i<lAllElm.length;i++){lAllCorrect=true;for(var lAttrib in aAttribObj){if(aAttribObj[lAttrib]==null){if(!lAllElm[i].hasAttribute(lAttrib))
lAllCorrect=false;}else if(lAllElm[i].getAttribute(lAttrib)!=aAttribObj[lAttrib])
lAllCorrect=false;}if(lAllCorrect){lRetArray[lRetArray.length]=lAllElm[i];}}return lRetArray;}, cssShortHandArray : function(value){var v=value.toString().split(' ');if(v.length==1){return [v[0], v[0], v[0], v[0]];}else if(v.length==2){return [v[0], v[1], v[0], v[1]];}else if(v.length==3){return [v[0], v[1], v[2], v[1]];}else if(v.length==4){return v;}else{return [];}}};Ida.f.asType=Ida.f.convertTo;Ida.SYSALT=1;Ida.SYSCTRL=10;Ida.SYSSHIFT=100;

Ida.language={strings :{}, // Collection of different strings filled
languages :{}, // A object holding the name of the
codes : [],
defaultLanguage : Ida.getPref("Ida.lang.defaultLanguage"),
currentLanguage : this.defaultLanguage,
getLanguage : function(aCode){return this.languages[aCode];},
getCurrentLanguage : function(){if(!this.currentLanguage)
{this.currentLanguage=this.defaultLanguage||(this.defaultLanguage=Ida.getPref("Ida.lang.defaultLanguage"));if(!this.currentLanguage)
{throw new Ida.IdaError('ERR_MISSING_SETTING', 'language.js#getCurrentLanguage', 'Ida.lang.defaultLanguage');}}return this.currentLanguage;},
setCurrentLanguage : function(aCode, setDir, setName, ignoreInTemplates)
{try
{if(!aCode||this.currentLanguage==aCode) return;var e=new Ida.Event("LanguageChange",this);e.oldLanguage=this.currentLanguage;e.newLanguage=aCode;e.templateSetDir=setDir;e.templateSetName=setDir&&setName;if(e.dispatch())
{this.currentLanguage=aCode;e.ignoreInTemplates=ignoreInTemplates;e.setType("BeforeLanguageChanged");e.dispatch();e.ignoreInTemplates=false;e.setType("LanguageChanged");e.dispatch();}}catch(e)
{Ida.handleError(e);}},
register : function(aLang,aCode){if(!aLang||!aCode) return;if(!this.languages[aCode])
{this.languages[aCode]=aLang;this.codes.push(aCode);}}};Ida.Language=function(code,name,image,imageSmall){this.code=code||"";this.name=name||"";this.image=image||"";this.imageSmall=imageSmall||"";};

Ida.Path=function(aFile)
{if(aFile)
{this.setFile(aFile);}};Ida.Path.prototype.setFile=function(aFile)
{var lRoot=aFile?'../':'';var lFile=aFile||'';this.applicationDir=lRoot;if(!Ida.course||!Ida.course.lms)
{var pathEnd=aFile?(self.location.href.indexOf("_wbt/")>0) ? "_wbt/":"/" : '';this.systemDir=lRoot + lFile + pathEnd;}else
{this.systemDir=Ida.course.lms.books[lFile]||'';}this.pageDir=this.systemDir + "pages/";this.contentDir=this.pageDir + "content_" + Ida.language.getCurrentLanguage() + "/";this.pictureDir=this.systemDir + "pictures/";this.mediaDir=this.systemDir + "media/";this.templateDir=this.systemDir + "sets/";this.templateCssDir=this.templateDir + "css/";this.templatePicDir=this.templateDir + "pic/";this.templateSetDir=this.templateDir + "set/";this.templateSetPictureDir=this.templateDir + "set/pic/";this.templateSetHtmlDir=this.templateDir + "set/html/";this.documentDir=this.systemDir + "documents/";};Ida.Path.prototype=
{getContentDir : function(langCode)
{return this.pageDir + "content_" +(langCode||Ida.language.getCurrentLanguage()) + "\\";}, applicationDir : "" // path to the root of the loaded application. This is where the *.ida file is located
, systemDir : "" // path to the system directory of the loaded application
, pageDir : "pages/" // path to the page directory of the loaded application
, mediaDir : "media/" // path to the media directory of the loaded application
, pictureDir : "pictures/" // path to the picture directory of the loaded application
, templateDir : "sets/" // path to the template directory of the loaded application
, templateCssDir : "sets/css/" // path to the template css(common to all sets)
, templatePictureDir : "sets/pic/" // path to the template Pictures(common to all sets)
, templateSetDir : "sets/set/" // path to the loaded templateset directory of the loaded application
, templateSetPictureDir : "sets/set/pic/" // path to the picture directory within the loaded templateset of the loaded application
, templateSetHtmlDir : "sets/set/html/" // path to the html dir of the templateSet
, idaDir : "scripting/" // path to the IDA chrome directory
};Ida.directory=new Ida.Path();Ida.Event.register(Ida.directory);Ida.directory.webtemplateDir=Ida.directory.templateDir;Ida.directory.idaTemplateDir=Ida.directory.templateDir;Ida.directory.coreTemplateDir=Ida.directory.templateDir;Ida.directory.rootDir="";Ida.directory.onCourseLoad=function(e)
{this.setFile(e.file);};Ida.directory.getContentDir=function()
{return this.pageDir + "content_" + Ida.language.getCurrentLanguage() + "/";};Ida.directory.getTemplateContentDir=function(code)
{return this.idaTemplateDir + "content_" +(code||Ida.language.getCurrentLanguage()) + "/";};Ida.directory.getTemplateSetContentDir=function(code)
{return this.templateSetDir + "content_" +(code||Ida.language.getCurrentLanguage()) + "/";};Ida.directory.onBeforeOpen=function(aFile)
{this.update(aFile);};Ida.directory.getRelativePath=function(aPath, asSet)
{var offset=0;if(asSet&&aPath.indexOf(Ida.directory.templateSetDir)==0)
return "SET\\" + aPath.substring(Ida.directory.templateSetDir.length);else if(aPath.indexOf(Ida.directory.idaDir)==0)
offset=Ida.directory.idaDir.length;else if(aPath.indexOf(Ida.directory.systemDir)==0)
offset=Ida.directory.systemDir.length;return offset>0?aPath.substring(offset):aPath;};Ida.directory.getRelativeSetPath=function(aPath)
{return this.getRelativePath(aPath,true);};Ida.directory.update=function(aFile)
{};Ida.directory.setTemplateSetDir=function(aDir)
{this.templateSetDir=aDir;};Ida.directory.onLoad=function()
{this.idaDir=window.location.href;this.rootDir=this.idaDir;this.idaTemplateDir=this.idaDir + "templates/";this.coreTemplateDir=this.idaTemplateDir + "core/";this.webtemplateDir=this.idaTemplateDir + "web/";this.tempDir=this.idaDir + "tmp/";};Ida.directory.getFullPath=function(aValue)
{if(!aValue.indexOf("SET"))
{aValue=aValue.replace("SET/","");aValue=this.templateSetDir + aValue;}return this.getURL(this.systemDir + aValue);};Ida.directory.getFullURL=function(url)
{if(url&&url.indexOf("://")>-1)
{return url;}url=escape(url);if(url.indexOf("SET")==0)
{url=url.replace("SET\\","").replace("SET/","");url=this.templateSetDir + url;return url;}return Ida.f.isURL(url)?url:this.systemDir + url;};Ida.directory.getRelativeURL=function(aPath)
{return this.getRelativePath(aPath).replace(/\\/g, "\/");};Ida.directory.getURL=function(aPath){return aPath.replace(/\ /g, "%20").replace(/\\/g, "\/");};

String.prototype.trim=function(charsToTrim){var val=this.replace(/^\s+/, '').replace(/\s+$/, '');if(charsToTrim)
val=val.replace(new RegExp("^["+charsToTrim+"]+"),"").replace(new RegExp("["+charsToTrim+"]+$"),"");return val;};String.prototype.trimHTML=function(){var str=this.trim();return str.replace(/<br ?\/?>$/,"");};String.prototype.hasString=function(aSearch,caseSensitive){var ret=this.toString();if(!aSearch) return false;if(typeof aSearch!="string") aSearch=String(aSearch);if(caseSensitive!==true){ret=ret.toLowerCase();aSearch=aSearch.toLowerCase();}return(ret.indexOf(aSearch)>=0);};String.prototype.listContains=function(item,sep,caseSensitive){if(typeof item=="undefined")
return false;var list=this.toString();item=String(item);if(caseSensitive!==true){item=item.toLowerCase();list=list.toLowerCase();}if(!sep) sep=",";return((sep+list+sep).indexOf(sep+item+sep)>-1);};String.prototype.isInList=function(list,sep,caseSensitive){return typeof list=="undefined"?false:String(list).listContains(this,sep,caseSensitive);};String.prototype.getListItemIndex=function(item, sep, caseSensitive){var list=this.toString();if(item!=null&&typeof item!="string")
item=String(item);if(caseSensitive!==true){if(item!=null)
item=item.toLowerCase();list=list.toLowerCase();}return Array.indexOf(list.getListArray(sep||","), item);};String.prototype.removeListItem=function(item, sep, caseSensitive){var list=this.toString();var pos=list.getListItemIndex(item, sep, caseSensitive);if(pos>=0){if(!sep) sep=",";var listArray=list.getListArray(sep);Array.removeAt(listArray, pos);list=listArray.join(sep);}return list;};String.prototype.setListItem=function(item,sep,caseSensitive){var list=this.toString();item=(item===0)?"0":String(item);if(!list) return item;if(!sep) sep=",";var listArray=list.getListArray(sep);Array.registerElement(listArray, item, caseSensitive);return listArray.join(sep);};String.prototype.setListItems=function(items,sep,caseSensitive){if(!sep) sep=",";var listArray=this.getListArray(sep);var itemsArray=String(items).getListArray(sep);Array.registerElements(listArray, itemsArray, caseSensitive);return listArray.join(sep);};String.prototype.getNumberList=function(){var result=[];var list=this.toString();var ranges=list.getListArray();for(var i in ranges){var vals=ranges[i].split('-');for(var j=parseInt(vals[0]);j<=parseInt(vals[vals.length-1]);j++)
result[result.length]=j;}result.sort(Array.numsort);return result;};String.prototype.getListArray=function(sep){var list=this.toString();return list==null?[]:list.split(sep||",");};String.prototype.wordCount=function(){return this.toString().split(/\s/).length;};String.prototype.getWord=function(num){return this.toString().split(/\s/)[num];};String.prototype.lastChar=function(){var l=this.length;return l>0?this.charAt(l-1):"";};String.prototype.getTextline=function(num){return this.getTextlines(num,num);};String.prototype.getTextlines=function(aFirstLine, aLastLine){var strArray=this.replace(/\r\n/g,'\n').replace(/\r/g,'\n').split("\n");var retStr="";if(aLastLine===undefined)
{aLastLine=strArray.length - 1;}if(aFirstLine<strArray.length)
{for(var i=aFirstLine;i<=aLastLine;i++)
{if(retStr) retStr +="\n";retStr +=strArray[i]||'';}}return retStr;};String.prototype.replaceTextlines=function(lineContent, aFirstLine, aLastLine)
{var strArray=this.replace(/\r\n/g,'\n').replace(/\r/g,'\n').split("\n");var retStr="";if(typeof aLastLine!='number'||aLastLine<aFirstLine)
{aLastLine=aFirstLine;}for(var i=0;i<=aLastLine;i++)
{if(retStr)
{retStr +="\n";}if(i==aFirstLine)
{lineContent=lineContent.replace(/\r\n/g,'\n').replace(/\r/g,'\n');if(lineContent&&lineContent.charAt(lineContent.length - 1)=='\n')
{lineContent=lineContent.substr(0, lineContent.length - 1);}retStr +=lineContent;i=aLastLine;}else
{retStr +=strArray[i];}}return retStr;};String.prototype.replaceString=function(oldStr, newStr, caseSensitive){return this.replace(new RegExp(oldStr,"g" +(caseSensitive?"":"i")),newStr);};String.prototype.setCharAt=function(aChar,aPos){if(aPos>this.length-1) return this;if(aPos>0){if(aPos<this.length-1)
return this.substring(0,aPos) + aChar + this.substring(aPos+1);else
return this.substring(0,aPos) + aChar;}else{return aChar + this.substring(aPos+1);}};String.prototype.insertCharAt=function(aChar, aPos){if(aPos>this.length) return this;if(aPos>0){if(aPos<this.length)
return this.substring(0,aPos) + aChar + this.substring(aPos);else
return this + aChar;}else{return aChar + this;}};String.prototype.upperCaseCharAt=function(aPos){if(aPos==0&&this.length==1)
return this.toUpperCase();return this.setCharAt(this.charAt(aPos).toUpperCase(),aPos);};String.prototype.lowerCaseCharAt=function(aPos){if(aPos==0&&this.length==1)
return this.toLowerCase();return this.setCharAt(this.charAt(aPos).toLowerCase(),aPos);};String.prototype.multiplyString=function(count){var lRetVal="";for(var i=0;i<count;i++) lRetVal +=this;return lRetVal;};String.prototype.getSingleLine=function(){return this.replace(/\n|\r/g,"");};String.prototype.expandString=function(){var s=this.valueOf();var args=typeof arguments[0]=="object"?arguments[0]:arguments;for(var i=0;i<9;++i)
{var rex=new RegExp("%" +(i+1),"g");s=s.replace(rex, args[i]);}return s;};String.prototype.escape=function()
{return this.replace(/\\/g,'\\\\').replace(/'/g,'\\\'').replace(/"/g,'\\"').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/\t/g,'\\t');};String.prototype.unescape=function()
{return eval("(function(){return '" + this.replace(/.'/g, function(a){return a=='\\\''?a:a[0] + '\\\'';}) + "';})();");};String.prototype.escapeUnicode=function(noLeadingZeros)
{return this.escape().replace(/[\u0080-\uFFFF]/g, function(a){return "\\u" +((noLeadingZeros?0x100:0x10000) + a.charCodeAt()).toString(16).substring(1);});};String.prototype.unicodeEntities=function(noLeadingZeros)
{return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/[\u0080-\uFFFF]/g, function(a){return "&#x" +((noLeadingZeros?0x100:0x10000) + a.charCodeAt()).toString(16).substring(1) + ";";});};String.prototype.decodeEntities=function()
{return this.replace(/(&#[0-9]+;|&#x[0-9a-zA-Z]{2,4};|&amp;|&lt;|&gt;|&quot;)/g
, function(a)
{a=a.substr(1, a.length -2);switch(a)
{case 'amp': return '&';case 'lt': return '<';case 'gt': return '>';case 'quot': return '"';default:
if(a[1]=='x')
{return String.fromCharCode(parseInt(a.substr(2), 16));}else
{return String.fromCharCode(parseInt(a.substr(1)));}}});};

function getElm(id){return document.getElementById(id);};function getTime(){return Ida.f.getTime();}var ON=true;var OFF=false;

Array.alphaSort=function(ary){var asq={"ï¿½": "a", "ï¿½": "o", "ï¿½": "u", "ï¿½": "s"}, asr=/[ï¿½ï¿½ï¿½ï¿½]/g,
asf=function(c){return asq[c]||c},
ast=function(a, b){return a[0]<b[0]? -1 : a[0]>b[0]? 1 : 0},
i, rets=[], tmps=[];for(i=0;i<ary.length;i++)
tmps[i]=[ ary[i].toString().toLowerCase().replace(asr, asf), i ];tmps.sort(ast);for(i=0;i<ary.length;i++) rets[i]=ary[tmps[i][1]];return rets;};Array.numsort=function(a,b){return a-b;};Array.indexOf=function(ary, elem){if(!ary) return -1;for(var i=0;i<ary.length;i++) if(ary[i]==elem) return i;return -1;};Array.insertAt=function(ary, aIndex, aNewElm){ary.splice(aIndex, 0, aNewElm);};Array.removeAt=function(ary, aIndex){ary.splice(aIndex, 1);};Array.removeElement=function(ary, elm){var lIndex=Array.indexOf(ary,elm);if(lIndex>-1)
Array.removeAt(ary,lIndex);return lIndex;};Array.registerElement=function(ary, elm){var l=ary.length;for(var x=0;x<l;x++){if(ary[x]===elm)
return x;}ary[l]=elm;return l;};Array.registerElements=function(ary, elms){for(var i=0;i<elms.length;i++)
Array.registerElement(ary,elms[i]);};Array.randomize=function(arr){var l=arr.length;if(l>1){arr.reverse();var tmp, num, num2;for(var i=0;i<l*2;i++){num=Ida.f.getRandomNumber(0,l-1);num2=Ida.f.getRandomNumber(0,l-1,num);tmp=arr[num];arr[num]=arr[num2];arr[num2]=tmp;}}};

Math.roundExt=function(val,cnt){var tmp=Math.pow(10,cnt||2);return Math.round(val*tmp)/tmp;};

Ida.Collection=function(){this.init();};Ida.Collection.prototype={toString : function(){return this.items;},
init : function(){this.items=[];this.length=0;},
swapPos : function(pos1, pos2){var tmp=this.items[pos1];this.items[pos1]=this.items[pos2];this.items[pos2]=tmp;},
item : function(aItemIndex){return this.items[aItemIndex];},
has : function(aItem){return this.getIndex(aItem)>=0;},
getIndex : function(aItem){for(var i=0;i<this.items.length;i++){if(this.items[i]==aItem)
return i;}return -1;},
add : function(aItem){if(!aItem) return undefined;try{if(aItem instanceof Ida.Collection)
{this.items=this.items.concat(aItem.items);}else if(aItem instanceof Array){this.items=this.items.concat(aItem);}else{for(var i=0;i<arguments.length;i++)
{this.items[this.items.length]=arguments[i];}}this.length=this.items.length;}catch(e){Ida.handleError(e);}return aItem;},
remove : function(aItem){if(!aItem) return;if(aItem instanceof Ida.Collection){for(var x=0;x<aItem.length;x++){for(var i=this.items.length-1;i>=0;i--){if(this.items[i]==aItem.items[x]){Array.removeAt(this.items,i);i=0;}}}}else{for(var x=arguments.length-1;x>=0;x--){for(var i=this.items.length-1;i>=0;i--){if(this.items[i]==arguments[x]){Array.removeAt(this.items,i);i=0;}}}}this.length=this.items.length;},
removeAt : function(aIndex){Array.removeAt(this.items,aIndex);this.length=this.items.length;},
filterCollection : function(aProp, aVal){if(aProp=="_number"){for(var i=this.length-1;i>=0;i--){if(this.item(i)!=aVal)
this.removeAt(i);}}else{var elm;for(var i=this.length-1;i>=0;i--){elm=this.item(i);if(!elm[aProp]||elm[aProp]!=aVal){this.removeAt(i);}}}this.length=this.items.length;},
removeAll : function(){for(var i=0;i<this.items.length;i++)
this.items[i]=null;this.init();}};

Ida.DLayer=function(){this.style=new Ida.PropertyList("style");this.script=new Ida.PropertyList("script");this.content=new Ida.PropertyList("content");this.userdefined=new Ida.PropertyList("userdefined");this.events={};this.methods={};this.actions={};this.animations={};this._animations=[];this.isDLayer=true;this.htmlElement=null;this.attributes={};this.courseElement=null;this.id=null;this.name=null;this.nameGenerated=false;this.objectName="Ida.DLayer";this.created=false;this.exists=true;this.complete=false;this.elm=null;this.parent=null;this.parentElm=(typeof Ida.editor!="undefined")?Ida.editor.pageObject:(document.getElementById("idapage")||document.body);this.selected=false;this.childIndex=0;this.isPage=false;this.isOnPage=true;this.isOnTemplate=false;this.stbElement=null;this.document=null;};Ida.Event.register(Ida.DLayer);Ida.DLayer.setDefaultButton=function(elm,set){if(set) Ida.f.addClassName(elm.elm,"default-button");else Ida.f.removeClassName(elm.elm,"default-button");if(this._settingDB||(!set&&(!this.defaultButton||this.defaultButton!=elm)))
return;this._settingDB=true;if(this.defaultButton&&this.defaultButton!=elm)
this.defaultButton.set("defaultButton",false);this.defaultButton=set?elm:null;this._settingDB=false;};Ida.DLayer.pushDefaultButton=function(){if(this.defaultButton)
return this.defaultButton.runAction("click",true);return false;};Ida.DLayer.getDLayerListByIDs=function(list){var listArr=[];if(list){if(typeof list!="string")
list=String(list);list=list.split(",");var obj;for(var i=0;i<list.length;i++){obj=Ida.getObjectById(list[i]);if(obj)
listArr[listArr.length]=obj;}}return listArr;};Ida.DLayer.destroy=function(e){this.defaultButton=null;new Ida.Event("PageUnload",this).dispatch();Ida.Event.clearTemp();for(var i=0;i<this.allElements.length;i++){if(!this.allElements[i]) continue
this.allElements[i].destroy();this.allElements[i]=null;}this.allElements=[];this.count=0;this.zIndex=0;};Ida.DLayer.onBeforePageShown=function(e){Ida.DLayer.updateElementsOnTop();};Ida.DLayer.onPageShown=function(e){var page=Ida.getPageObject();if(page){var fe=page.get("focusedObject");if(fe){var elm=page.getChildById(fe,true);if(elm) elm.focus();}}};Ida.DLayer.updateElementsOnTop=function()
{var page=Ida.getPageObject();if(page)
{var pageElm=page.template;for(var x=0;x<2;x++)
{if(!pageElm||!pageElm.children) return;for(var i=0;i<pageElm.children.length;i++)
{if(pageElm.children[i].get("alwaysOnTop")) pageElm.children[i].toFront(false);}pageElm=page;}}};Ida.DLayer.onLanguageChanged=function(e){if(Ida.course&&Ida.course.loaded&&Ida.course.getCurrentCourseElement().elementType=="page")
Ida.course.getCurrentCourseElement().reload();};Ida.DLayer.registerNotifyObject=function(aObj, event){Ida.Event.registerTemporary(aObj, event);};Ida.DLayer.allElements=[];Ida.DLayer.count=0;Ida.DLayer.zIndex=0;Ida.DLayer.getDLayer=function(elm,retNull){while(elm){if(elm.dLayer)
return elm.dLayer.exists?elm.dLayer:null;elm=elm.parentNode;}if(retNull) return null;if(Ida.getPage)
{var page=Ida.getPage();}return(page&&page.dLayer&&page.dLayer.exists)?page.dLayer:null;};Ida.DLayer.EventMethod=function(e){var elm;if(document.attachEvent)
elm=e.srcElement;else
elm=this;var dLayer=Ida.DLayer.getDLayer(elm,true);if(dLayer&&dLayer.events[e.type])
return dLayer.dispatchEvent(e);return true;};Ida.DLayer.toString=function(){return "[prototype Ida.DLayer]";};Ida.DLayer.HTMLOBJECT_EVENTS="dblclick,mouseup,mousedown,mouseover,mouseout,mousemove,keyup,keydown,keypress,focus,blur,change,select,selectionchange,resize";Ida.DLayer.NOTIFY_EVENTS="VariableChanged,PageUnload,PageLoaded,Ready,BeforePageShown,PageShown,GoNextPage,GoPreviousPage,GoToPage,GoMenu,ShowGlossary,ShowOverview";Ida.DLayer.document=document;Ida.DLayer.prototype={toString : function(){var lType=this.objectType;var lName=this.objectName;if(!lName) lName="Ida.DLayer";return "[Ida.DLayer " + lName + " - type:" + lType + ";name:" + this.name + ";id:" + this.id + "]";},
create : function create(silent, courseElement){var lRegistered=false;if(this.created) return;this.dispatchEvent({type:"BeforeCreate"});var lPropValue, lRef, lRefArray, lDLayerBackRef;var lHtmlElm=this.htmlElement||"div";var isRun=Ida.isRuntime();this.doc=Ida.DLayer.document;this.elm=this.doc.createElement(lHtmlElm);try{for(var i in this.attributes)
this.elm.setAttribute(i,this.attributes[i]);}catch(e){}var cls="DLayer" + this.objectName;if(this.objectName!=this.objectType)
cls +=" DLayer" + this.objectType;var textusage=this.get("textusage");if(textusage=="speaker") cls +=" speakertext";this.elm.className=cls;if(!silent){Ida.DLayer.count++;Ida.DLayer.zIndex++;}this.courseElement=courseElement||Ida.course.selectedCourseElement;this.isPage=this.script.isPage||false;this.name=this.get("name");if(!this.changeable&&this.parent&&!(this.parent.changeable==="undefined"))
this.changeable=this.parent.changeable;if(!this.id){if(this.isPage)
this.id="gPage";else{var pId;if(this.parent.isPage) pId="Page";else pId=this.parent.id;this.id=pId + "_" + this.objectName + String(this.childIndex);}this.idGenerated=true;}this.elm.dLayer=this;if(this.isPage)
this.elm.style.visibility="hidden";if(this.isPage&&this.template){var t=this.template;t.parent=this;t.elm=this.elm;t.parentElm=this.parentElm;t.courseElement=this.courseElement;t.isOnTemplate=true;t.isOnPage=false;for(var i in t.style){this.style[i]=t.style[i];}if(t.children){for(var i=0;i<t.children.length;i++){t.children[i].parent=t;t.children[i].parentElm=t.elm;t.children[i].isOnTemplate=true;t.children[i].isOnPage=false;t.children[i].childIndex=i;t.children[i].create();}}if(t.events){for(var i in t.events){if(i.isInList(Ida.DLayer.HTMLOBJECT_EVENTS))
this.addEventListener(i,Ida.DLayer.EventMethod);else if(i.isInList(Ida.DLayer.NOTIFY_EVENTS))
Ida.DLayer.registerNotifyObject(t, i);}}}var lNumber, lNewVal;try
{var style=isRun?this.style:this.style.IdaProperties;var isIFrame=this.objectType=="IFrame";for(var i in style)
{lNewVal=isRun?style[i]:style[i].get();if(lNewVal||lNewVal===0)
{if(isIFrame&&i=="scrolling")
{this.elm.setAttribute("scrolling",lNewVal);}else if(i=="backgroundImage")
{this.elm.style.backgroundImage=this.makeCSSURI(lNewVal);}else if(i=="visibility")
{Ida.f.toggleClassName(this.elm,"hidden",lNewVal=="hidden");}else if(Ida.IE)
{if(i=="cursor")
{if(lNewVal=="pointer")
{lNewVal="hand";}}else if(i=="MozOpacity")
{i="filter";lNewVal="Alpha(opacity=" + Math.floor(100*lNewVal) + ")";}else if(i=="cssFloat")
{i="styleFloat"
}lNewVal=String(lNewVal).trim();}this.elm.style[i]=lNewVal;}}}catch(e)
{showErr=String(Ida.getPref('Ida.runtime.showCssErrors'))=='true';if(showErr) Ida.handleError(e,"Ida.DLayer.create(): " + i + " : " + lNewVal);}this.parentElm.appendChild(this.elm);this.created=true;if(this.children){for(var i=0;i<this.children.length;i++){this.children[i].parent=this;this.children[i].parentElm=this.elm;this.children[i].isOnTemplate=this.isOnTemplate;this.children[i].isOnPage=this.isOnPage;this.children[i].childIndex=i;this.children[i].create();}}if(this.events){lRegistered=false;for(var i in this.events){if(i.isInList(Ida.DLayer.HTMLOBJECT_EVENTS))
this.addEventListener(i,Ida.DLayer.EventMethod);else if(i.isInList(Ida.DLayer.NOTIFY_EVENTS))
Ida.DLayer.registerNotifyObject(this,i);}}if(this.isOnPage){this.loadContent();this.updateContent();}if(this.isPage){this.courseElement.overlayTemplate();this.setTemplateContent(this.template);}this.loadExtensions();this.dispatchEvent({type:"Create"});this.dispatchEvent({type:"AfterCreate"});if(!silent)
Ida.DLayer.allElements[Ida.DLayer.allElements.length]=this;this.complete=true;if(Ida.IE){if(lHtmlElm!="img"){var bgC=this.elm.currentStyle.backgroundColor;var bgI=this.elm.currentStyle.backgroundImage;if((!bgC||bgC=="transparent")&&(!bgI||bgI=="none")){if(this.get("title")||this.hasActions()||this.hasExtension("highlight")||this.get("dnd_draggable")||this.get("dep_courseElements")||this.hasInteractionAnimations())
this.elm.style.backgroundImage="url('pic/pixel.gif')";}}}if(this.isPage)
{if(!this.get("width"))
{this.setA("width",this.courseElement.course.width);}if(!this.get("height"))
{this.setA("height",this.courseElement.course.height);}var e=new Ida.Event("PageLoaded",this);e.courseElement=this.courseElement;e.dispatch();new Ida.Event("Ready",this).dispatch();if(this.exists)
{new Ida.Event("BeforePageShown",this).dispatch();if(this.exists)
{this.elm.style.visibility="visible";self.setTimeout("new Ida.Event('PageShown',Ida.DLayer).dispatch();",10);}}}else if(this.courseElement.dLayerLoaded)
{this.dispatchEvent({type:"Ready"});}},
setTemplateContent : function(obj,ref){if(obj){if(!ref)
ref=obj.parent&&obj.parent.template==obj?"template":"page";if(obj.children&&obj.children.length){for(var i=0;i<obj.children.length;i++)
this.setTemplateContent(obj.children[i],ref);}obj.loadContent(ref);if(obj.elm)
obj.updateContent();}},
addChild : function addChild(aObj,pos){try{if(!aObj||!aObj.isDLayer) return false;if(!this.courseElement)
this.courseElement=Ida.getPage();aObj.courseElement=this.courseElement;if(aObj.created){if(pos==aObj.childIndex&&aObj.parent==this)
return true;Array.removeElement(aObj.parent.children,aObj);for(var i=0;i<aObj.parent.children.length;i++)
aObj.parent.children[i].childIndex=i;var append=false;if(typeof pos=="undefined"||pos>=this.children.length){pos=this.children.length;append=true;}Array.insertAt(this.children,pos,aObj);for(i=0;i<this.children.length;i++)
this.children[i].childIndex=i;}else{aObj.checkReference(true);this.children[this.children.length]=aObj;aObj.childIndex=this.children.length-1;}aObj.parent=this;aObj.parentElm=this.elm;if(aObj.created){if(!append&&pos<this.children.length-1)
this.elm.insertBefore(aObj.elm,this.children[pos+1].elm);else
this.elm.appendChild(aObj.elm);this.courseElement.xmlDocument.addChild(this,aObj,pos);var e=new Ida.Event("ObjectLayerChanged",this);e.dLayer=aObj;e.dispatch();}else{if(this.created&&!aObj.created)
aObj.create();var a=aObj.animations;for(var i in a){if(a[i].target==aObj||!a[i].target){a[i].target=aObj.elm;}}var e=new Ida.Event("ObjectCreated",this);e.dLayer=aObj;e.parent=this;e.courseElement=this.courseElement;e.xmlDocument=this.courseElement.xmlDocument;e.xmlContentDocument=this.courseElement.xmlContentDocument;e.dispatch();e.setTarget(aObj);e.dispatch();}}catch(e){Ida.handleError(e);}return undefined;},
checkReference : function(){},
remove : function remove(){return this.parent.removeChild(this);},
removeChild : function removeChild(aChild){try{if(!aChild.isOnPage) return false;if(aChild.children){for(var i=aChild.children.length-1;i>=0;i--){aChild.removeChild(aChild.children[i]);}}var e=new Ida.Event("RemoveObject",aChild);e.addTarget(aChild);e.dLayer=aChild;e.courseElement=aChild.courseElement;e.xmlDocument=aChild.courseElement.xmlDocument;e.xmlContentDocument=aChild.courseElement.xmlContentDocument;e.dispatch();aChild.removeAllAnimations();Array.removeElement(this.children,aChild);for(i=0;i<this.children.length;i++)
this.children[i].childIndex=i;if(aChild.created&&aChild.elm)
aChild.elm.parentNode.removeChild(aChild.elm);aChild.destroy();var lPos=Array.indexOf(Ida.DLayer.allElements,aChild);if(lPos>=0)
delete Ida.DLayer.allElements[lPos];new Ida.Event("ObjectRemoved").dispatch();}catch(e){Ida.handleError(e,"Ida.DLayer.removeChild()");return false;}return true;},
setActions : function(aActions){for(var i in this.actions) this.actions[i].destroy();this.actions=aActions;for(var x in aActions){aActions[x].dLayer=this;aActions[x].register();}},
setActionList : function DLayer_setActionList(aActionlist){if(this.actions[aActionlist.name]) this.actions[aActionlist.name].destroy();this.actions[aActionlist.name]=aActionlist;aActionlist.dLayer=this;aActionlist.register();},
dispatchEvent : function dispatchEvent(aEventObject){if(aEventObject&&aEventObject.type&&typeof this.events[aEventObject.type]=="function"){if(aEventObject.type.isInList(Ida.DLayer.HTMLOBJECT_EVENTS)&&!Ida.areUserEventsAllowedFor(this)) return undefined;this.eventMethod=this.events[aEventObject.type];return this.eventMethod(aEventObject);}return undefined;},
callMethod : function callMethod(aMethodName){if(!aMethodName) return;var a=arguments;if(Ida.f.isFunction(this[aMethodName])){this[aMethodName](a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);}else{this.forward(aMethodName,a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);}},
hasExtension : function(ext){return ext.isInList(this.get("extensions"));},
loadExtensions : function(){Ida.DLayerExtension.extend(this);var all=this.get("extensions");if(!all) return;all=all.split(",");for(var i=0;i<all.length;i++)
Ida.DLayerExtension(all[i],this);},
loadContent : function DLayer_loadContent(){if(!this.get("languageDependent")) return;var lPage=this.getPage();var lContRef=(this.isOnPage)?"page":"template";var lContentObj=lPage.pageContent[lContRef][this.id];if(lContentObj){for(var i in lContentObj){this.content[i]=lContentObj[i];}}else if(this.isOnTemplate&&lPage.template.pageContent&&lPage.template.pageContent[lContRef]){var lContentObj=lPage.template.pageContent[lContRef][lName];if(lContentObj){for(var i in lContentObj){this.content[i]=lContentObj[i];}}}},
updateContent : function updateContent()
{if(!this.elm) return;var lContent,lPropValue;for(var i in this.content)
{lPropValue=this.content[i];if(typeof lPropValue=="string"||typeof lPropValue=="number"||lPropValue==="")
{if(i=="src")
{this.elm.src=this.makeURI(lPropValue);}else if(i=="text"||i=="innerHTML")
{lPropValue=Ida.formatContent(lPropValue,this.elm);this.setHtml(lPropValue);}else if(i=="title")
{this.elm.setAttribute("idatooltip",lPropValue);}}e=new Ida.Event("ContentSet",this,this);e.value=String(lPropValue);e.name=i;this.dispatchEvent(e);}},
onContentChanged : function(e){if(e.property){return this.updateContent();}else return false;},
hasChild : function(child,aDeep){if(aDeep===false) return child.parent==this;while(child){if(child.parent==this)
return true;child=child.parent;}return false;},
hasChildren : function(){return(this.children&&this.children.length);},
getChildByName : function getChildByName(aName,aDeep){if(aDeep!==false) aDeep=true;if(this.children&&this.children.length>0){for(var i=0;i<this.children.length;i++){if(this.children[i].script.name==aName) return this.children[i];else if(aDeep&&typeof this.children[i].children!="undefined"&&this.children[i].children.length>0){lSubChild=this.children[i].getChildByName(aName,aDeep);if(lSubChild) return lSubChild;}}}if(this.isPage&&this.template)
return this.template.getChildByName(aName,aDeep);else
return undefined;},
getChildById : function getChildById(aId,aDeep){if(aDeep!==false) aDeep=true;if(this.children&&this.children.length>0){for(var i=0;i<this.children.length;i++){if(this.children[i].id==aId) return this.children[i];else if(aDeep&&typeof this.children[i].children!="undefined"&&this.children[i].children.length>0){var lSubChild=this.children[i].getChildById(aId,aDeep);if(lSubChild) return lSubChild;}}}if(this.isPage&&this.template)
return this.template.getChildById(aId,aDeep);else
return undefined;},
getChildrenByObjectName : function getChildrenByObjectName(aName,aDeep){return this.getChildrenByJSProperty("objectName",aName,aDeep=!false);},
getChildrenByObjectType : function getChildrenByObjectType(aType,aDeep){return this.getChildrenByJSProperty("objectType",aType,aDeep=!false);},
getChildrenByProperty : function(prop, val, deep){return this._getChildrenByProperty(prop, val, deep, false);},
getChildrenByJSProperty : function(prop, val, deep){return this._getChildrenByProperty(prop, val, deep, true);},
_getChildrenByProperty : function(propName,val,deep,onlyjs, _ary){if(!_ary) _ary=[];var prop;var checkVal=typeof val!="undefined"&&val!==null;var getAll=val=="*";for(var i=0;i<this.children.length;i++){var c=this.children[i];if(!c.ignore){if(onlyjs){if(c[propName]!=undefined&&(getAll||c[propName]==val))
_ary.push(c);}else{prop=c.get(propName);if((checkVal&&prop==val)||(!checkVal&&prop!=undefined))
_ary.push(c);}if(deep&&c.hasChildren())
c._getChildrenByProperty(propName,val,true,onlyjs,_ary);}}return _ary;},
get : function get(aProperty,aAttribute)
{var prop=this.getPropertyObject(aProperty);return prop;},
set : function set(aProperty,aValue,aAttribute)
{var propContainer=this.getPropertyContainer(aProperty);if(!propContainer)
{propContainer=this.userdefined;this.userdefined.aProperty=null;}var oldValue=propContainer[aProperty];propContainer[aProperty]=aValue;if(propContainer==this.style&&this.elm)
{try
{this.elm.style[aProperty]=aValue;}catch(e)
{if(Ida.getPref('Ida.runtime.showCssErrors'))
{alert(Ida.getLangString('ERR_STYLE_SET_FAILED', aProperty, this.elm.nodeName||this.elm.tagName||this.elm.outerHTML, aValue, e.message||e,'dlayer.js#set'));}}}var e=new Ida.Event("PropertyChanged",this,this);e.property=aProperty;e.value=aValue;e.oldValue=oldValue;this.dispatchEvent(e);if(aProperty=="visibility"&&this.elm)
{Ida.f.toggleClassName(this.elm,"hidden",aValue=="hidden");}if(propContainer==this.content)
{e=new Ida.Event("ContentChanged",this,this);e.property=aProperty;this.onContentChanged(e);}return true;},
setA : function setA(aProperty,aValue,aAttribute){return this.set(aProperty,aValue,aAttribute);},
setMessage : function DLayer_setMessage(msg,aContent){if(!msg) return;msg="msg_" + msg;if(typeof this.content[msg]=="undefined"&&!aContent){return;}this.set(msg,aContent);},
getMessage : function DLayer_getMessage(msg){if(!msg) return null;return this.get("msg_" + msg)||Ida.course.getMessage(msg);},
hasProperty : function(prop){return(typeof this.getPropertyObject(prop)!="undefined");},
getPropertyObject : function getPropertyObject(aProperty){var myProps=new Array(this.script,this.content,this.style,this.userdefined);for(var i=0;i<myProps.length;i++){if(typeof myProps[i][aProperty]!="undefined")
return myProps[i][aProperty];}return undefined;},
getPropertyContainer : function getPropertyContainer(aProperty){var myProps=new Array(this.script,this.content,this.style,this.userdefined);for(var i=0;i<myProps.length;i++){if(typeof myProps[i][aProperty]!="undefined")
return myProps[i];}return undefined;},
isContent : function isContent(aProperty){return(this.content[aProperty]);},
getPage : function getPage(){return this.courseElement?this.courseElement.dLayer:(this.isPage ? this :(this.parent ? this.parent.getPage() : null));},
getCourse : function(){return this.courseElement.course;},
getContainer : function getContainer(aTopContainer){if(this.isPage) return this;var alternativeContainer=aTopContainer;if(!aTopContainer){aTopContainer=this.getPage();alternativeContainer=aTopContainer.template;}if(!aTopContainer) return null;var lParent=this;var lNewParent;while(true){lNewParent=lParent.parent;if(lNewParent==aTopContainer||lNewParent==alternativeContainer) return lParent;lParent=lNewParent;}},
getTarget : function getTarget(aKeyword){if(!aKeyword) return this;if(typeof aKeyword!="string") return null;var key=aKeyword.toUpperCase();if(key=="SELF"||key=="THIS")
return this;else if(key=="PARENT")
return this.parent;else if(key=="TOPPARENT")
return this.getContainer();else{return this.getPage().getChildById(aKeyword);}},
setHtml : function(aHtml){if(this.htmlElement=="textarea"||this.htmlElement=="input") this.elm.value=aHtml;else this.elm.innerHTML=aHtml;},
forward : function forward(aMethod){var p=this.parent;while(true){if(Ida.f.isFunction(p[aMethod])){var a=arguments;p[aMethod](a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);return true;}if(p.isPage) return false;p=p.parent;}return undefined;},
runAction : function DLayer_runAction(aAction,checkVis,force){if(!force&&((checkVis&&!this.isVisible())||!Ida.areUserEventsAllowedFor(this))||this.get("disabled"))
return false;if(this.hasAction(aAction)){return this.actions[aAction].run();}else if(this.parent)
return this.parent.runAction(aAction);else
return false;},
hasAction : function(aAction,type){var a=this.actions[aAction];return a?(type ? a.hasAction(type):true) : false;},
hasActions : function(){for(var i in this.actions)
return true;return false;},
getAnimation : function(anim){return this.animations[anim];},
hasAnimation : function(anim){return typeof this.animations[anim]=="object";},
hasAnimations : function(){for(var i in this.animations)
return true;return false;},
hasInteractionAnimations : function(){var type;for(var i in this.animations){type=this.animations[i].event;if(type=="click"||type=="mouseover"||type=="mouseout")
return true;}return false;},
startAnimation : function(id,isEvent){return this._doAnimCmd(id,!!isEvent,"start");},
stopAnimation : function(id,isEvent){return this._doAnimCmd(id,!!isEvent,"stop");},
pauseAnimation : function(id,isEvent){return this._doAnimCmd(id,!!isEvent,"pause");},
_doAnimCmd : function(id,isEvent,cmd){var prop=isEvent?"event":"animid";var defined=!(isEvent&&id.isInList("click","mouseover","mouseout"));for(var i in this.animations){if(this.animations[i][prop]==id){this.animations[i][cmd](true);defined=true;}}return defined?true:(this.parent ? this.parent._doAnimCmd(id,isEvent,cmd) : false);},
makeURI : function(path){return Ida.makeURI(path,this.getCourse());},
makeCSSURI : function(path){if(path.indexOf("url(")==0)
return path;else
return "url(\'" + this.makeURI(path) + "\')";},
toFront : function(update){Ida.DLayer.zIndex++;this.elm.style.zIndex=Ida.DLayer.zIndex;if(update!==false)
Ida.DLayer.updateElementsOnTop();},
toBack : function(){this.elm.style.zIndex=0;},
focus : function(){var foc;try{if(Ida.f.isFunction(this.elm.focus)){this.elm.focus();if(Ida.IE&&document.activeElement!=this.elm)
this.elm.focus();foc=this.elm;}}catch(e){}return foc;},
blur : function(){try{if(Ida.f.isFunction(this.elm.blur)) this.elm.blur();}catch(e){}},
show : function(){this.setA("visibility","visible");if(this.getOpacity()==0)
this.setOpacity(1);if(this.get("alwaysOnTop"))
this.toFront(false);},
hide : function(){this.setA("visibility","hidden");},
toggle : function(){if(this.get("visibility")=="hidden"||this.getOpacity()==0)
this.show();else
this.hide();},
isVisible : function(){return Ida.f.isVisible(this.elm);},
getOpacity : function(){return Ida.f.getOpacity(this.elm);},
setOpacity : function(val){return Ida.f.setOpacity(this.elm,val);},
setImage : function(img,on,prop){if(on&&!img) return;var elm=this.elm;if(elm.nodeName.toLowerCase()=="img"){if(on){if(prop)
this[prop]=elm.src;elm.src=this.makeURI(img);}else if(prop&&this[prop]!=undefined){elm.src=this[prop];this[prop]=null;}}else{if(on){if(prop)
this[prop]=elm.style.backgroundImage;elm.style.backgroundImage=this.makeCSSURI(img);}else if(prop&&this[prop]!=undefined){elm.style.backgroundImage=this[prop]||"";this[prop]=null;}}},
center : function(cont,save){if(!cont) cont=this.getPage();cont.arrangeObjects([this],"center","","",0,save);},
arrangeObjects : function(objList, align, orient, pos, dist, save, startPos)
{if(!(objList instanceof Array))
{throw new Ida.IdaError('ERR_INVALID_ARGUMENT', 'Ida.DLayer.arrangeObjects', 'objList', "!(objList instanceOf Array)");}if(typeof align!='string')
{throw new Ida.IdaError('ERR_INVALID_ARGUMENT', 'Ida.DLayer.arrangeObjects', 'align', "typeof align!='string'");}var top=(startPos&&startPos.top)||Ida.f.getStyle(this.elm,"top","number");var bottom=(startPos&&startPos.bottom)||top + this.elm.offsetHeight;var left=(startPos&&startPos.left)||Ida.f.getStyle(this.elm,"left","number");var right=(startPos&&startPos.right)||left + this.elm.offsetWidth;var isIn=pos!="out";var isVertical=!orient||orient=="vertical";var isHorizontal=orient=="horizontal";var isNone=orient=="none";var isCenter=align=="center";if(typeof dist!="number")
dist=0;var hasBottom=align.indexOf("bottom")>=0;var hasTop=align.indexOf("top")>=0;var hasLeft=align.indexOf("left")>=0;var hasRight=align.indexOf("right")>=0;var allElm=[];var allHeight=0;var allWidth=0;for(var i=0;i<objList.length;i++){allElm[i]=new Ida.DLayer.PosArrangeElm(objList[i]);if(isVertical)
allHeight +=allElm[i].h + dist;else if(isHorizontal)
allWidth +=allElm[i].w + dist;if(allWidth==0)
allWidth=allElm[i].w;if(allHeight==0)
allHeight=allElm[i].h;}if(isVertical||isHorizontal){var centerX=Math.round((left + right -(dist==-1?0:allWidth))/2);var centerY=Math.round((top + bottom -(dist==-1?0:allHeight))/2);}else{centerX=Math.round((left + right)/2);centerY=Math.round((top + bottom)/2);}var offsetX=0;var offsetY=0;var o;for(var i=0;i<allElm.length;i++){o=allElm[i];var newX=isNone?o.x:centerX;var newY=isNone?o.y:centerY;var newOffsetX=offsetX;var newOffsetY=offsetY;if((hasBottom&&isIn)||(hasTop&&!isIn))
newOffsetY *=-1;if((hasLeft&&!isIn)||(hasRight&&isIn))
newOffsetX *=-1;if(!isCenter){if(hasBottom)
newY=isIn?bottom - o.h:bottom;else if(hasTop)
newY=isIn?top:top - o.h;else if(isVertical)
newX=Math.round((left + right - o.w)/2)
if(hasLeft)
newX=isIn?left:left - o.w;else if(hasRight)
newX=isIn?right - o.w:right;}else{if(isVertical)
newX +=(o.w/2);if(isHorizontal)
newY +=(o.h/2);}if(hasLeft||hasRight)
newX +=newOffsetX;if(hasTop||hasBottom)
newY +=newOffsetY;if(isVertical){if(dist!=-1){offsetY +=o.h + dist;centerY +=o.h + dist;}else
newY=o.y;if(isCenter){newX -=(o.w/2);}}else if(isHorizontal){if(dist!=-1){offsetX +=o.w + dist;centerX +=o.w + dist;}else
newX=o.x;if(isCenter){newY -=(o.h/2);}}if(save){o.ref.set("left",newX + "px");o.ref.set("top",newY + "px");}else{o.ref.setA("left",newX + "px");o.ref.setA("top",newY + "px");}o.destroy();}},
destroy : function(){if(this.elm)
this.elm.dLayer=null;this.parent=null;this.parentElm=null;this.courseElement=null;this.stbElement=null;this.style=null;this.script=null;this.content=null;this.events=null;this.methods=null;for(var i in this.actions){this.actions[i].destroy();}for(var i in this){this[i]=null;}this.exists=false;},
removeAllAnimations : function()
{this.animations={};}};Ida.DLayer.prototype.unselect=Ida.DLayer.prototype.removeFromSelection;Ida.DLayer.PosArrangeElm=function(obj){this.w=obj.elm.offsetWidth||parseInt(obj.elm.style.width)||0;this.h=obj.elm.offsetHeight||parseInt(obj.elm.style.height)||0;this.x=Ida.f.getAbsoluteX(obj.elm);this.y=Ida.f.getAbsoluteY(obj.elm);this.ref=obj;this.elm=obj.elm;};Ida.DLayer.PosArrangeElm.prototype={destroy : function(){this.elm=null;this.ref=null;}};Ida.Accesskey=function(s){s=String(s);this.text=s;this.html=s.replace(/&(\S)/,"<u>$1</u>");var found=this.html.match(/<u>(.)<\/u>/);this.key=(found&&found[1])?found[1]:null;};

Ida.dependency={pageLoaded : false,
dynamicMenu : null,
objects : [],
doneCount : 0,
visitedCount : 0,
registerMenu : function(elm){this.dynamicMenu=elm;},
onPageLoaded : function(e){this.pageLoaded=true;if(!Ida.isReader()) return;var ce, ceStr, ceList, visited, must, done;for(var i=0;i<Ida.DLayer.allElements.length;i++){ceStr=Ida.DLayer.allElements[i].get("dep_courseElements");if(ceStr){this.objects[this.objects.length]=Ida.DLayer.allElements[i];must=Ida.DLayer.allElements[i].get("dep_mustBeExecuted");done=true;visited=true;ceList=ceStr.split(",");for(var x=0;x<ceList.length;x++){ce=new Ida.CourseTarget(ceList[x]).getCourseElement();if(!ce){visited=false;done=!must;}else if(!ce.isVisited()){visited=false;if(!ce.isDone()&&must)
done=false;}}if(visited){this.visitedCount++;this.on(Ida.DLayer.allElements[i]);}if(done)
this.doneCount++;else
Ida.test.register({mustBeExecuted:"yes",forceInteraction:true});}}this.loaded=true;},
onPageShown : function(){if(this.objects.length&&this.dynamicMenu)
this.dynamicMenu.init(this.objects);},
onPageUnload : function(){this.dynamicMenu=null;for(var i=0;i<this.objects.length;i++)
this.objects[i]=null;this.objects=[];this.pageLoaded=false;this.doneCount=0;this.visitedCount=0;},
Click : function(target){var ce=target.get("dep_courseElements");if(ce){if(target.get("dep_autoComeBack"))
Ida.navigation.goToPages(ce);else
Ida.navigation.goToPage(ce.split(",")[0]);}},
on : function(obj){var vis=obj.get("dep_visibility");var img=obj.get("dep_image");var origVis=obj.get("visibility");var dis=obj.get("dep_disabled");var origDis=obj.get("disabled");var showObj=obj.get("dep_showObject");var bw=obj.get("dep_borderWidth");var bc=obj.get("dep_borderColor");var bgc=obj.get("dep_backgroundColor");var c=obj.get("dep_color");var op=obj.get("dep_opacity");var orOp=obj.get("MozOpacity");if(bgc=="transparent"&&!obj.elm.style.backgroundImage)
obj.elm.style.backgroundImage="url('pic/pixel.gif')";if(bw) obj.elm.style.borderWidth=bw;if(bc) obj.elm.style.borderColor=bc;if(bgc) obj.elm.style.backgroundColor=bgc;if(c) obj.elm.style.color=c;if(vis!==""){vis=vis?"visible":"hidden";if(vis!=origVis){obj.setA("visibility",vis);}}if(dis!==""&&dis!=origDis)
obj.setA("disabled",dis);if(op!=orOp&&(orOp||op!=1))
Ida.f.setOpacity(obj.elm,op==1?0.999999:op);if(showObj){var elm=Ida.getObjectById(showObj);if(elm) elm.show();}if(img)
obj.setImage(img,true);}};Ida.Event.register(Ida.dependency);

Ida.dragNDrop={registeredObjects : [],
onAddExtension : function(e){},
mouseMove : function(x,y){var newTarget=this.getDropTargetAtPos(x, y);if(this.dropTarget!=newTarget){if(newTarget)
this.highlightDropTarget(newTarget);if(this.dropTarget)
this.unhighlightDropTarget(this.dropTarget);this.dropTarget=newTarget;}},
saveDragStartPosition : function(aElm){aElm.setA("dnd_startPosX", Ida.f.getStyle(aElm.elm,"left","number"));aElm.setA("dnd_startPosY", Ida.f.getStyle(aElm.elm,"top","number"));aElm.setA("dnd_startVisibility", Ida.f.getStyle(aElm.elm,"visibility"));},
onLeavePage : function(e){var len=this.registeredObjects.length;if(len==0) return;for(var i=0;i<len;i++)
this.registeredObjects[i]=null;this.registeredObjects=[];},
onPageLoaded : function(e)
{for(var i=0;i<Ida.DLayer.allElements.length;i++)
{var e=Ida.DLayer.allElements[i];if(e&&e.get&&e.get("dnd_droppable"))this.register(e);}},
register : function(dLayer){this.registeredObjects[this.registeredObjects.length]=dLayer;Ida.qObj.registerDnD(dLayer);},
unregister : function(dLayer){Ida.qObj.unregister(dLayer);Ida.test.unregister(dLayer);},
isCorrect : function isCorrect(aObj){var all=aObj.dnd_droppedObjects;if(typeof all=='undefined') all='';return(String(all&&all.split(",").sort().join(","))==String(aObj.get("dnd_correctObjects")).split(",").sort().join(","));},
WRONG : 0,
CORRECT : 1,
MISSING : 2,
getDragObjectState : function(obj){var id=String(obj.id);if(obj.dnd_dropTarget){var correctObj=String(obj.dnd_dropTarget.get("dnd_correctObjects"));return id.isInList(correctObj)?this.CORRECT:this.WRONG;}for(var i=0;i<this.registeredObjects.length;i++){correctObj=String(this.registeredObjects[i].get("dnd_correctObjects"));if(id.isInList(correctObj))
return this.MISSING;}return this.CORRECT;},
getResults : function(){var dndObj=Ida.getObjectListByProperty("dnd_isDragNDrop",true,true);var results={correct:0, wrong:0, missing:0, total:0};for(var i=0;i<dndObj.length;i++){var obj=dndObj[i];if(obj.get("dnd_draggable")){var state=this.getDragObjectState(obj);if(state==this.CORRECT)
results.correct++;if(state==this.WRONG)
results.wrong++;if(state==this.MISSING)
results.missing++;results.total++;}}return results;},
getWrongObjects : function(dLayer){var correct=dLayer.get("dnd_correctObjects");var dropped=dLayer.dnd_droppedObjects.split(",");var wrong=[];for(var i=0;i<dropped.length;i++){if(!String(dropped[i]).isInList(correct))
wrong[wrong.length]=dropped[i];}return wrong;},
getDropTargetAtPos : function(x,y){for(var i=0;i<this.registeredObjects.length;i++){if(Ida.f.isPosInObject(x,y,this.registeredObjects[i].elm))
return this.registeredObjects[i];}return null;},
highlightDropTarget : function(dLayer){if(!dLayer.get("dnd_highlight"))
return;var s=dLayer.elm.style;if(!dLayer.dndTmpBorder){dLayer.dndTmpBW=s.borderWidth;dLayer.dndTmpBS=s.borderStyle;dLayer.dndTmpBC=s.borderColor;}s.borderColor=dLayer.get("dnd_borderColor");if(s.borderWidth.replace(/[A-Za-z0%\s]/g,"")=="")
s.borderWidth="1px";if(s.borderStyle.replace(/none\s*/g,"")=="")
s.borderStyle="solid";},
unhighlightDropTarget : function(dLayer){if(dLayer.dndTmpBW&&dLayer.get("dnd_highlight")){var s=dLayer.elm.style;s.borderWidth=dLayer.dndTmpBW;s.borderStyle=dLayer.dndTmpBS;s.borderColor=dLayer.dndTmpBC;dLayer.dndTmpBW=null;dLayer.dndTmpBS=null;dLayer.dndTmpBC=null;}},
drop : function(drag,drop)
{Ida.dragNDrop.unhighlightDropTarget(drop);var d=drop.dnd_droppedObjects;if(!drop.get("dnd_multipleDrop"))
{if(drop.dnd_droppedObjects&&!String(drag.id).isInList(drop.dnd_droppedObjects))
Ida.dragNDrop.reset(drop.dnd_droppedObjects.split(","));}if(drag.dnd_dropTarget)
{drag.dnd_dropTarget.dnd_droppedObjects=String(drag.dnd_dropTarget.dnd_droppedObjects).removeListItem(String(drag.id));this.arrangeObjects(drag.dnd_dropTarget);}drop.dnd_droppedObjects=(drop.dnd_droppedObjects||"").setListItem(String(drag.id));drag.dnd_dropTarget=drop;var dropAlign=drop.get("dnd_dropAlign");if(dropAlign=="hidden")
{drag.setA("visibility","hidden");}else if(dropAlign!="free")
{var top=Ida.f.getStyle(drop.elm,"top","number");var bottom=top + drop.elm.offsetHeight;var left=Ida.f.getStyle(drop.elm,"left","number");var right=left + drop.elm.offsetWidth;if(dropAlign=="stretch")
{if(typeof drag.get("dnd_startWidth")=="undefined")
{drag.setA("dnd_startWidth", Ida.f.getStyle(drag.elm,"width","number"));drag.setA("dnd_startHeight", Ida.f.getStyle(drag.elm,"height","number"));}drag.setA("top",top + "px");drag.setA("left",left + "px");drag.setA("width",(right-left) + "px");drag.setA("height",(bottom-top) + "px");return;}this.arrangeObjects(drop);}var qObj=drop.questionObject;qObj.checkImmediateFeedback(drop);},
arrangeObjects : function(drop)
{var all=Ida.DLayer.getDLayerListByIDs(drop.dnd_droppedObjects);var dropAlign=drop.get("dnd_dropAlign");var orient=drop.get("dnd_dropOrientation");var pos=drop.get("dnd_dropPositioning");drop.arrangeObjects(all,dropAlign,orient,pos,1);},
reset : function(allObj){if(allObj instanceof Ida.DLayer)
allObj=[String(allObj.id)];else if(allObj instanceof Array==false)
return;var dragObj;var page=Ida.getPageObject();for(var i=0;i<allObj.length;i++){dragObj=page.getChildById(allObj[i]);if(!dragObj) continue;var posX=dragObj.get("dnd_startPosX");var posY=dragObj.get("dnd_startPosY");if((posX||posX===0)&&(posY||posY===0)){dragObj.setA("left",posX + "px");dragObj.setA("top",posY + "px");}var w=dragObj.get("dnd_startWidth");var h=dragObj.get("dnd_startHeight");if((w||w===0)&&(h||h===0)){dragObj.setA("width",w + "px");dragObj.setA("height",h + "px");}var vis=dragObj.get("dnd_startVisibility");dragObj.setA("visibility",vis);var drop=dragObj.dnd_dropTarget;if(drop){drop.dnd_droppedObjects=String(drop.dnd_droppedObjects).removeListItem(String(dragObj.id));this.arrangeObjects(drop);dragObj.dnd_dropTarget=null;}}},
resetWrongObjects : function(dLayer){var l=this.getWrongObjects(dLayer);if(l.length)
this.reset(l);}};Ida.Event.register(Ida.dragNDrop);

Ida.highlight={pageLoaded : false,
objectToHighlight : null,
registeredObjects : new Ida.Collection(),
activeObjects : new Ida.Collection(),
onAddExtension : function(e){var t=e.dLayer;var evl=t.get("hil_evaluate");t.mustBeExecuted=t.get("hil_mustBeExecuted");if(t.mustBeExecuted||evl)
this.register(t,evl);if(t.get("hil_highlighted")){if(this.pageLoaded) this.on(t);else this.objectToHighlight=t;}},
getHotSpotObject : function(t){var qObj=Ida.getObjectsByObjectName("HotSpot")[0];return qObj;},
register : function(t,evaluate){if(!this.registeredObjects.has(t)){if(evaluate){var qObj=this.getHotSpotObject(t);qObj.register(t);t.questionObject=qObj;}Ida.test.register(t);this.registeredObjects.add(t);}},
Click : function(obj){var elm, type;var defined=false;var t=obj.get("hil_type");if(t=="single"){for(var i=this.activeObjects.length-1;i>=0;i--){elm=this.activeObjects.item(i);type=elm.get("hil_type");if(elm===obj){defined=true;}else if(type=="single")
this.off(elm);}if(defined)
this.off(obj);else
this.on(obj);}else if(t=="multiple"){if(this.activeObjects.has(obj))
this.off(obj);else
this.on(obj);}},
MouseOver : function(obj){if(String(obj.get("hil_type"))=="single"){for(var i=this.activeObjects.length-1;i>=0;i--)
this.off(this.activeObjects.item(0));this.MouseOverObj=obj;}else if(this.activeObjects.has(obj))
return this.off(obj);return this.on(obj);},
MouseOut : function(obj){if(this.MouseOverObj){this.off(this.MouseOverObj);this.MouseOverObj=null;}},
onPageLoaded : function(e){this.pageLoaded=true;if(this.objectToHighlight)
this.on(this.objectToHighlight);},
onPageUnload : function(){this.activeObjects.removeAll();for(var i=0;i<this.registeredObjects.length;i++)
this.registeredObjects.item(i).questionObject=null;this.registeredObjects.removeAll();this.pageLoaded=false;this.objectToHighlight=null;},
on : function(obj){if(!this.activeObjects.has(obj)){var img=obj.get("hil_image");var bw=obj.get("hil_borderWidth");var bc=obj.get("hil_borderColor");var bgc=obj.get("hil_backgroundColor");var c=obj.get("hil_color");var op=obj.get("hil_opacity");var orOp=Ida.f.getOpacity(obj.elm);if(Ida.IE&&!img&&bgc=="transparent"&&!obj.elm.style.backgroundImage)
obj.elm.style.backgroundImage="url('pic/pixel.gif')";if(c){obj.hil_c=Ida.f.getStyle(obj.elm,"color");obj.elm.style.color=c;}if(bw){obj.hil_bw=Ida.f.getStyle(obj.elm,"borderWidth");obj.setA("borderWidth",bw);}if(bc){obj.hil_bc=Ida.f.getStyle(obj.elm,"borderColor");obj.elm.style.borderColor=bc;}if(bgc){obj.hil_bgc=Ida.f.getStyle(obj.elm,"backgroundColor");obj.elm.style.backgroundColor=bgc;}if(op!=orOp&&(orOp||op!=1)){obj.hil_op=orOp;Ida.f.setOpacity(obj.elm,op==1?0.999999:op);}if(img)
obj.setImage(img,true,"hil_img");this.showObjects(obj,true);var evl=obj.get("hil_evaluate");if(obj.mustBeExecuted&&!evl)
Ida.test.markAsComplete(obj);obj.setA("hil_highlighted",true);this.activeObjects.add(obj);obj.runAction("highlight");if(evl){var qObj=obj.questionObject;if(qObj&&!qObj.get("answerShown")&&qObj.get("immediateFeedback")&&
(!obj.get("hil_isCorrect")||qObj.isCorrect()))
qObj.ok();}}},
off : function(obj){if(this.activeObjects.has(obj)){var elm=obj.elm;if(obj.hil_img!=undefined)
obj.setImage(null,false,"hil_img");if(obj.hil_bw){obj.setA("borderWidth",obj.hil_bw);obj.hil_bw=null;}if(obj.hil_c){elm.style.color=obj.hil_c;obj.hil_c=null;}if(obj.hil_bc){elm.style.borderColor=obj.hil_bc;obj.hil_bc=null;}if(obj.hil_bgc){elm.style.backgroundColor=obj.hil_bgc;obj.hil_bgc=null;}if(!isNaN(obj.hil_op)){Ida.f.setOpacity(elm,obj.hil_op==1?0.999999:obj.hil_op);obj.hil_op=null;}this.showObjects(obj,false);obj.setA("hil_highlighted",false);this.activeObjects.remove(obj);}},
showObjects : function(obj,show){var objList=obj.get("hil_showObject");if(objList){objList=String(objList).split(",");var elm;for(var i=0;i<objList.length;i++){elm=Ida.getObjectById(objList[i]);if(elm) elm.setA("visibility",show?"visible":"hidden");}}}};Ida.Event.register(Ida.highlight);

Ida.dListener=
{addListener: function(aElm,aEvent,aFunction,aUseCapture)
{if(aElm.attachEvent)
{var res=aElm.attachEvent("on"+aEvent, aFunction);}else
{if(typeof aUseCapture=="undefined") aUseCapture=false;res=aElm.addEventListener(aEvent,aFunction,aUseCapture);}return res;}, removeListener: function(aElm,aEvent,aFunction,aUseCapture){if(aElm.detachEvent) return aElm.detachEvent("on"+aEvent,aFunction);else if(aElm.removeEventListener){if(typeof aUseCapture=="undefined") aUseCapture=false;aElm.removeEventListener(aEvent,aFunction,aUseCapture);return true;}return undefined;}, objectsToHideOnClick: []
, registerObjectForHideOnClick: function(obj,method,param,force)
{var hideObj={"obj":obj, "method":method, "param":param, "force":force===true};var id=this.objectsToHideOnClick.length;this.objectsToHideOnClick[id]=hideObj;return id;}, unregisterObjectForHideOnClick: function(id)
{if(!isNaN(id))
{if(this.objectsToHideOnClick[id])
this.objectsToHideOnClick[id]=null;}}};Ida.dragListener=
{dragObject: null
, dragContainer: null
, dragging: false
, dropTarget: null
, startX: 0
, startY: 0
, offsetX: 0
, offsetY: 0
, right: null
, bottom: null
, onPageUnload: function()
{this.dragObject=null;this.dragContainer=null;this.dropTarget=null;this.dragging=false;}, mouseClickHandler: function(e)
{if(!Ida.isReader()) return true;e=e||window.event;if(Ida.f.getMouseButton(e)!="left") return true;var lTargObj=e.target||e.srcElement;var dLayer=Ida.DLayer.getDLayer(lTargObj,true);var linkElm=Ida.f.isLink(lTargObj);if(linkElm){var linkObj=new Ida.LinkNode(linkElm);if(linkObj.isMyNode(linkElm)){linkObj.execute();if(e.preventDefault) e.preventDefault();else e.returnValue=false;return false;}else linkElm.target="_blank";}else{if(dLayer){dLayer.dispatchEvent(e);if(dLayer.exists){dLayer.startAnimation("click",true);if(Ida.animationController&&!dLayer.runAction("click",true)&&!dLayer.events[e.type])
Ida.animationController.runAnimationsByEvent("pageclick");}}}return undefined;}, mouseDblClickHandler: function(e){if(!Ida.isReader()) return true;e=e||window.event;if(Ida.f.getMouseButton(e)!="left") return true;var lTargObj=e.target||e.srcElement;var dLayer=Ida.DLayer.getDLayer(lTargObj);if(dLayer&&dLayer.exists)
dLayer.runAction("dblclick",true);return undefined;}, mouseDownHandler: function(e){if(!Ida.isReader()) return true;e=e||window.event;var lTargObj=e.target||e.srcElement;var DL=Ida.dragListener;if(lTargObj.getAttribute("draggable")){DL.dragDirect=true;DL.dragging=true;DL.dragdirection=lTargObj.getAttribute("dragdirection")||"";DL.allowHorizontalDrag=DL.dragdirection.indexOf("horizontal">-1)||!DL.dragdirection;DL.allowVerticalDrag=DL.dragdirection.indexOf("vertical">-1)||!DL.dragdirection;DL.isSplitter=lTargObj.getAttribute("splitter")=="true";if(DL.isSplitter){DL.previousElm=lTargObj.previousSibling
while(DL.previousElm&&DL.previousElm.nodeType!=Ida.ELEMENT_NODE)
DL.previousElm=DL.previousElm.previousSibling;DL.nextElm=lTargObj.nextSibling
while(DL.nextElm&&DL.nextElm.nodeType!=Ida.ELEMENT_NODE)
DL.nextElm=DL.nextElm.nextSibling;if(DL.previousElm)
DL.previousElmW=DL.previousElm.offsetWidth;if(DL.nextElm)
DL.nextElmW=DL.nextElm.offsetWidth;}DL.dragObject=lTargObj;DL.dragContainer=lTargObj;DL.startX=Ida.getMouseX(e);DL.startY=Ida.getMouseY(e);DL.offsetX=DL.startX -(Ida.f.getStyle(lTargObj,"left","number"));DL.offsetY=DL.startY -(Ida.f.getStyle(lTargObj,"top","number"));if(lTargObj.onDragStart) lTargObj.onDragStart();}else{DL.dragDirect=false;var lCurTarget=Ida.DLayer.getDLayer(lTargObj);var ret=true;var dObj=Ida.dListener.objectsToHideOnClick;if(dObj.length>0){var allHidden=true;for(var i=0;i<dObj.length;i++){if(dObj[i]&&typeof dObj[i].obj=="object"&&(dObj[i].force||
(dObj[i].obj!=lCurTarget&&
!dObj[i].obj.hasChild(lCurTarget)&&
!lTargObj.isMenu&&
!lTargObj.parentNode.isMenu))
){dObj[i].obj[dObj[i].method](dObj[i].param);dObj[i]=null;}else
allHidden=false;}if(allHidden)
DL.objectsToHideOnClick=[];}if(e.ctrlKey&&e.shiftKey){var startElm=lCurTarget;while(startElm){if(!confirm(startElm.getRefString())) return true;startElm=startElm.parent;}}if(Ida.mouse.getButton(e)=="right"){}else{if(lCurTarget)
lCurTarget.runAction("mousedown",true);var hil, dep;while(lCurTarget&&!lCurTarget.isPage){if(ret&&String(lCurTarget.get("dnd_draggable"))=="true"){var cont=lCurTarget.getTarget(lCurTarget.get("dnd_dragContainer"));DL.dragContainer=(cont&&cont.isDLayer)?cont:lCurTarget;DL.dragObject=lCurTarget;DL.startX=Ida.getMouseX(e);DL.startY=Ida.getMouseY(e);var curX=Ida.f.getStyle(cont.elm,"left","number");var curY=Ida.f.getStyle(cont.elm,"top","number");DL.offsetX=DL.startX -curX;DL.offsetY=DL.startY -curY;DL.allowHorizontalDrag=true;DL.allowVerticalDrag=true;if(typeof cont.get("dnd_startPosX")=="undefined")
Ida.dragNDrop.saveDragStartPosition(cont);DL.right=String(cont.style.right)?Ida.f.getStyle(cont.elm,"right","number"):null;DL.bottom=String(cont.style.bottom)?Ida.f.getStyle(cont.elm,"bottom","number"):null;DL.dragging=true;cont.toFront(false);Ida.dragNDrop.dropTarget=null;lCurTarget.dispatchEvent("DragStart");if(!lTargObj.nodeName.toLowerCase().isInList("input,textarea"))
ret=false;}if(Ida.highlight){hil=String(lCurTarget.get("hil_event"));if(hil=="click")
Ida.highlight.Click(lCurTarget);}if(Ida.dependency){dep=lCurTarget.get("dep_courseElements");if(dep)
Ida.dependency.Click(lCurTarget);}lCurTarget=lCurTarget.parent;}if(ret)
return true;else{if(e.preventDefault)
e.preventDefault();return false;}}}return undefined;}, mouseMoveHandler: function(e){if(!Ida.isReader()) return true;e=e||window.event;var DL=Ida.dragListener;var dCont=DL.dragContainer;if(DL.dragging&&dCont){var isIE=window.event&&document.attachEvent;var x=Ida.getMouseX(e);var y=Ida.getMouseY(e);try{var lObj, maxX, maxY;if(DL.dragDirect){lObj=dCont;var doc=Ida.getDocument();maxX=(doc.body.clientWidth||1000)-lObj.offsetWidth;maxY=(doc.body.clientHeight||700)-lObj.offsetHeight;}else{var lPage=dCont.getPage();lObj=dCont.elm;maxX=Ida.f.measureToNumber(lPage.get("width")) - lObj.offsetWidth;maxY=Ida.f.measureToNumber(lPage.get("height")) - lObj.offsetHeight;}minX=0;minY=0;if(DL.allowHorizontalDrag){if(DL.right!=null){var right=Math.max(minX,Math.min(maxX,DL.right +(DL.startX - x)));lObj.style.right=(right) + "px";}else{var left=Math.max(minX,Math.min(maxX,x - DL.offsetX));lObj.style.left=(left) + "px";}}if(DL.allowVerticalDrag){if(DL.bottom!=null){var bottom=Math.max(minY,Math.min(maxY,DL.bottom +(DL.startY - y)));lObj.style.bottom=(bottom) + "px";}else{var top=Math.max(minY,Math.min(maxY,y - DL.offsetY));lObj.style.top=top + "px";}}if(!DL.dragDirect){DL.dragObject.dispatchEvent("Drag");Ida.dragNDrop.mouseMove(x,y);}else if(DL.isSplitter&&DL.previousElm&&DL.nextElm){DL.previousElm.style.width=Math.max((DL.previousElmW +(x-DL.startX)),0) + "px";DL.nextElm.style.width=Math.max((DL.nextElmW -(x-DL.startX)),0) + "px";DL.nextElm.style.left=(left + lObj.offsetWidth) + "px";if(DL.dragObject.onDrag) DL.dragObject.onDrag();}if(e.preventDefault)
e.preventDefault();return false;}catch(err){Ida.handleError(err,"Ida.draglistener.MouseMoveHandler\n" + left +"-"+(DL.previousElmW +(x-DL.startX)) );}}return true;}, mouseUpHandler: function(e){if(!Ida.isReader()) return true;e=e||window.event;var DL=Ida.dragListener;lObj=DL.dragContainer;if(DL.dragging&&lObj){if(!DL.dragDirect){var dropTarget=Ida.dragNDrop.dropTarget;var isDnD=DL.dragObject.get("dnd_isDragNDrop");DL.dragObject.dispatchEvent("DragEnd");if(isDnD){try{if(dropTarget)
Ida.dragNDrop.drop(DL.dragContainer,dropTarget);else
Ida.dragNDrop.reset(DL.dragContainer);}catch(e){Ida.handleError(e);}}else{if(DL.right!=null)
lObj.setA("right",lObj.elm.style.right);else
lObj.setA("left",lObj.elm.style.left);if(DL.bottom!=null)
lObj.setA("bottom",lObj.elm.style.bottom);else
lObj.setA("top",lObj.elm.style.top);}}else if(DL.dragObject.onDragEnd) DL.dragObject.onDragEnd();DL.dragDirect=false;DL.dragging=false;DL.dragContainer=null;DL.dragObject=null;DL.dropTarget=null;DL.startX=0;DL.startY=0;DL.offsetX=0;DL.offsetY=0;DL.right=null;DL.bottom=null;}else{var lTargObj=e.target||e.srcElement;var dLayer=Ida.DLayer.getDLayer(lTargObj);if(dLayer){if(Ida.mouse.getButton(e)=="right")
dLayer.runAction("rightclick",true);else
dLayer.runAction("mouseup",true);}}return true;}, mouseOverHandler: function(e)
{if(!Ida.isReader()) return true;e=e||window.event;var lTargObj=e.target||e.srcElement;var dLayer=Ida.DLayer.getDLayer(lTargObj);if(dLayer&&!Ida.dragListener.dragDirect){if(Ida.dragListener.dragging){var d=Ida.dragListener.dragContainer;if(d!=dLayer&&!d.hasChild(dLayer)){dLayer.runAction("dragover",true);}}else{dLayer.runAction("mouseover",true);dLayer.stopAnimation("mouseout",true);dLayer.startAnimation("mouseover",true);var obj=dLayer;if(Ida.highlight){while(obj&&!obj.isPage){if(String(obj.get("hil_event"))=="mouseover")
Ida.highlight.MouseOver(obj);obj=obj.parent;}}}}return undefined;}, mouseOutHandler: function(e){if(!Ida.isReader()) return true;e=e||window.event;var lTargObj=e.target||e.srcElement;var dLayer=Ida.DLayer.getDLayer(lTargObj);if(dLayer&&!Ida.dragListener.dragDirect){if(Ida.dragListener.dragging){var d=Ida.dragListener.dragContainer;if(d!=dLayer&&!d.hasChild(dLayer))
dLayer.runAction("dragout",true);}else{dLayer.runAction("mouseout",true);dLayer.stopAnimation("mouseover",true);dLayer.startAnimation("mouseout",true);}if(Ida.highlight)
Ida.highlight.MouseOut(dLayer);}return undefined;}};Ida.Keyconstant=function(aKeyCode,aKeyName)
{this.code=aKeyCode;this.name=aKeyName;this.keyState="up";};Ida.Keyconstant.prototype.toString=function()
{return this.code;};Ida.Keyconstant.prototype.asString=function()
{return this.name.substring(3);};Ida.KEY={8 : "KeyBack", 65 : "KeyA", 103 : "KeyNumpad7",
9 : "KeyTab", 66 : "KeyB", 104 : "KeyNumpad8",
13 : "KeyEnter", 67 : "KeyC", 105 : "KeyNumpad9",
16 : "KeyShift", 68 : "KeyD", 106 : "KeyMultiply",
17 : "KeyControl", 69 : "KeyE", 107 : "KeyAdd",
18 : "KeyMenu", 70 : "KeyF", 109 : "KeySubtract",
19 : "KeyPause", 71 : "KeyG", 110 : "KeyDecimal",
20 : "KeyCapital", 72 : "KeyH", 111 : "KeyDivide",
27 : "KeyEscape", 73 : "KeyI", 112 : "KeyF1",
32 : "KeySpace", 74 : "KeyJ", 113 : "KeyF2",
33 : "KeyPrior", 75 : "KeyK", 114 : "KeyF3",
34 : "KeyNext", 76 : "KeyL", 115 : "KeyF4",
35 : "KeyEnd", 77 : "KeyM", 116 : "KeyF5",
36 : "KeyHome", 78 : "KeyN", 117 : "KeyF6",
37 : "KeyLeftArrow", 79 : "KeyO", 118 : "KeyF7",
38 : "KeyUpArrow", 80 : "KeyP", 119 : "KeyF8",
39 : "KeyRightArrow", 81 : "KeyQ", 120 : "KeyF9",
40 : "KeyDownArrow", 82 : "KeyR", 121 : "KeyF10",
42 : "KeyPrint", 83 : "KeyS", 122 : "KeyF11",
43 : "KeyExecute", 84 : "KeyT", 123 : "KeyF12",
44 : "KeyCopy", 85 : "KeyU", 144 : "KeyNumLock",
45 : "KeyInsert", 86 : "KeyV", 145 : "KeyScrollLock",
46 : "KeyDelete", 87 : "KeyW", 186 : "KeySemicolon",
48 : "Key0", 88 : "KeyX", 187 : "KeyEqual", // not used in german
49 : "Key1", 89 : "KeyY", 188 : "KeyComma",
50 : "Key2", 90 : "KeyZ", 190 : "KeyPoint",
51 : "Key3", 96 : "KeyNumpad0", 191 : "KeySlash", // #
52 : "Key4", 97 : "KeyNumpad1", 192 : "KeyBackQuote", // ï¿½
53 : "Key5", 98 : "KeyNumpad2", 219 : "KeyLeftBracket", // ï¿½
54 : "Key6", 99 : "KeyNumpad3", 220 : "KeyBackslash", // ^ï¿½
55 : "Key7", 100 : "KeyNumpad4", 221 : "KeyRightBracket", // ï¿½`
56 : "Key8", 101 : "KeyNumpad5", 222 : "KeyQuote", // ï¿½
57 : "Key9", 102 : "KeyNumpad6", 226 : "KeyAngleBrackets", //<>
59 : "KeyUUml",
61 : "KeyPlus" // +*~
};Ida.keyListener=
{blockKeyDown: false // Bool. Defines, if a keyDown event
, blockKeyPress: false // Bool. Blocks keypress event so no
, isOverwriteMode: true // Bool. Defines, if a letter will be
, keysets: []
, accesskeys:{}, onPageUnload: function()
{Ida.dragListener.onPageUnload();Ida.dListener.objectsToHideOnClick=[];this.accesskeys={};this.blockKeyDown=false;this.blockKeyPress=false;}, onPageShown: function(){if(document.all&&!document.activeElement)
document.body.focus();}, isNumber: function(charCode,allowNonInputChars){if(charCode>=48&&charCode<=57)
return true;return(allowNonInputChars)?!this.isInput(charCode):false;}, isLetter: function(charCode,allowNonInputChars){if(charCode<65){return allowNonInputChars?!this.isInput(charCode):false;}if(charCode>90&&charCode<97) return false;switch(charCode){case 138:case 140:case 145:case 149:case 150:case 151:case 154:
case 156:case 159:case 161:
return true;case 215: case 247:
return false;}if(charCode>122&&charCode<192) return false;return true;}, isInput: function(charCode){if(charCode>=16&&charCode<=20)
return false;if(charCode>=33&&charCode<=45)
return false;if(charCode==9||charCode==27)
return false;return true;}, registerKeyset: function(aKeySet){this.keysets[this.keysets.length]=aKeySet;}, unregisterKeyset: function(aKeySet)
{Array.removeElement(this.keysets,aKeySet);}, keyDownHandler: function(e)
{if(!e)
e=window.event;var code=window.event?Ida.keyListener.getFFKeyCode(e.keyCode):e.keyCode;var lKey=Ida.KEY[code];if(!lKey){if(code==3)
lKey="KeyPause";}var keyConst=Ida[lKey];if(keyConst)
keyConst.keyState="down";if(!Ida.isReader()||Ida.keyListener.blockKeyDown) return true;var ret=true;if(!e.target&&e.srcElement)
e.target=e.srcElement;Ida.keyListener.event=e;var sk=Ida.f.usedSystemKeys(e);if(lKey=="KeyInsert"&&!sk){Ida.keyListener.isOverwriteMode=!Ida.keyListener.isOverwriteMode;ret=false;}e.keyConstant=keyConst||new Ida.Keyconstant();e.keyDefined=false;if(keyConst){var aK=keyConst.asString();if(sk==Ida.SYSALT&&Ida.keyListener.accesskeys[aK])
Ida.keyListener.accesskeys[aK].dispatchEvent({type:"AccessKey"});}if(lKey=="KeyEnter")
Ida.DLayer.pushDefaultButton();var k=Ida.keyListener.keysets;if(k.length>0){for(var i=0;i<k.length;i++)
k[i].onKeyDown(e);for(i=0;i<k.length;i++)
k[i].onAfterKeyDown(e);}Ida.keyListener.keyDefined=e.keyDefined;if(Ida.IE&&e.keyDefined&&lKey=="KeyTab"&&!Ida.f.getNextFocusElement())
ret=false;Ida.keyListener.event=null;if(Ida.keyListener.cancelEvent)
ret=false;if(window.event){if(sk==10){if(lKey=="KeyR"){if(Ida.keyListener.keyDefined) return false;else{var retVal=confirm("Achtung!\nmit dieser Tastenkombination wird die Anwendung neu gestartet.\n\nSoll die Anwendung neu gestartet werden?");if(retVal)
window.location.reload();return false;}}}}if(sk==1&&lKey=="KeyF4"){var msg=Ida.course.getMessage("hintAltF4");if(msg)
alert(msg);}Ida.keyListener.isShortcut=false;if((sk==10&&lKey!="KeyControl"&&code>=65&&code<=87&&code!=86&&code!=67)||
(sk==1&&code>=33&&code<=40))
Ida.keyListener.isShortcut=true;if(ret&&window.event&&window.event.keyCode){lRetVal=Ida.keyListener.isShortcut||Ida.keyListener.isFKey(window.event.keyCode);if(lRetVal) window.event.keyCode=0;if(ret)
ret=!lRetVal;}return ret;}, keyUpHandler: function(e)
{if(!e)
e=window.event;Ida.keyListener.cancelEvent=false;var lKey=Ida.KEY[e.keyCode];if(e.keyCode=="3")
lKey="KeyPause";if(lKey&&Ida[lKey])
Ida[lKey].keyState="up";if(!Ida.isReader()) return true;if(Ida.keyListener.focusableObject)
{Ida.keyListener.focusableObject.focus();selectText(Ida.keyListener.focusableObject);Ida.keyListener.focusableObject=null;}if(e.shiftKey&&e.ctrlKey)
{if(e.altKey)
{switch(lKey)
{case "KeyI":
var f='evaluator.html';new Ida.Window(f,"evaluator").show(window);break;}}else
{switch(lKey)
{case "KeyPause":
var elm=Ida.course.selectedCourseElement;var p1=Ida.getLangString
(
elm.parent.elementType=='chapter'? 'pageXDetailedInfo_fragment_1a' : 'pageXDetailedInfo_fragment_1b'
, elm.parent.nr
, elm.parent.label
, elm.parent.idNr
);var p2=Ida.getLangString
(
elm.mustBeVisited ? 'pageXDetailedInfo_fragment_2a' : 'pageXDetailedInfo_fragment_2b'
);var myAlert=Ida.alert||self.alert;myAlert
(
Ida.getLangString
(
'pageXDetailedInfo'
, elm.nr
, elm.label
, elm.idNr
, p1
, p2
)
);break;case "KeyO":
Ida.navigation.showOverview();break;case "KeyG":
Ida.navigation.showGlossary();break;}}}if(Ida.keyListener.keyDefined)
{return false;}return(e&&e.keyCode==Ida.KeyF10)==false;}, keyPressHandler: function(e)
{if(!Ida.isReader()) return true;var lKey;e=e||window.event;if(Ida.keyListener.blockKeyPress)
return false;if(window.event) lKey=e.charCode;else lKey=e.keyCode;var sk=Ida.f.usedSystemKeys(e);var lChar=(e.charCode>0)?String.fromCharCode(e.charCode).toUpperCase():"";if(sk==10){if(lChar=="R"){return confirm("Achtung!\nmit dieser Tastenkombination wird die Anwendung neu gestartet.\n\nSoll die Anwendung neu gestartet werden?");}}if(e&&(Ida.keyListener.isFKey(lKey)||Ida.keyListener.isShortcut)){if(e.stopPropagation)
e.stopPropagation();return false;}if(Ida.keyListener.cancelEvent)
return false;return undefined;}, isFKey: function(key)
{return(key>=Ida.KeyF1.code&&key<=Ida.KeyF12.code);}, getFFKeyCode: function(code)
{if(code==186) return 59;if(code==187) return 61;if(code==189) return 109;return code;}};Ida.Event.register(Ida.keyListener);Ida.DLayer.onLoad=function(e)
{var doc=document;var dl=Ida.dListener;var dragl=Ida.dragListener;dl.addListener(doc,"click",dragl.mouseClickHandler,false);dl.addListener(doc,"dblclick",dragl.mouseDblClickHandler,false);dl.addListener(doc,"mousedown",dragl.mouseDownHandler,false);dl.addListener(doc,"mouseup",dragl.mouseUpHandler,false);dl.addListener(doc,"mouseover",dragl.mouseOverHandler,false);dl.addListener(doc,"mousemove",dragl.mouseMoveHandler,false);dl.addListener(doc,"mouseout",dragl.mouseOutHandler,false);var kl=Ida.keyListener;doc.onkeydown=kl.keyDownHandler;doc.onkeyup=kl.keyUpHandler;doc.onkeypress=kl.keyPressHandler;for(var i in Ida.KEY){if(Ida.KEY[i]){Ida[Ida.KEY[i]]=new Ida.Keyconstant(i,Ida.KEY[i]);}}};Ida.DLayer.prototype.addEventListener=function(aEvent,aFunction,useCapture)
{if(aEvent.isInList(Ida.DLayer.HTMLOBJECT_EVENTS)){Ida.dListener.addListener(this.elm,aEvent,aFunction,useCapture);}else this.events[aEvent]=aFunction;return true;};Ida.DLayer.prototype.removeEventListener=function(aEvent,aFunction,useCapture)
{if(aEvent.isInList("mouseup,mousedown,mouseover,mouseout,mousemove,click")){Ida.dListener.removeListener(this.elm,aEvent,aFunction,useCapture);}else if(this["on"+aEvent])
delete this["on"+aEvent];};Ida.DLayer.prototype.invokeEvent=function(aEvent,aArgs){var ret=true;if(this["on"+aEvent]) ret=this["on"+aEvent](aArgs);if(ret&&this.parent) this.parent.invokeEvent(aEvent,aArgs);};Ida.DLayer.prototype.registerAccesskey=function(key)
{key=String(key).toUpperCase();for(var i in Ida.keyListener.accesskeys)
{if(Ida.keyListener.accesskeys[i]==this&&i!=key)
this.unregisterAccesskey(i);}Ida.keyListener.accesskeys[key]=this;};Ida.DLayer.prototype.unregisterAccesskey=function(key)
{key=String(key).toUpperCase();if(Ida.keyListener.accesskeys[key]==this)
Ida.keyListener.accesskeys[key]=null;};window.onhelp=function(){return false;};

Ida.mouse={x : 0,
y : 0,
currentTarget : null,
getButton : function(aEventObj){if(typeof aEventObj.stopPropagation!="undefined"){switch(aEventObj.button){case 0: return "left";case 1: return "middle";case 2: return "right";}}else if(aEventObj.srcElement){switch(aEventObj.button){case 0: // No button is pressed.(This might be the case on click)
case 1: // Left button is pressed.
case 5: // Left and middle buttons both are pressed.
return "left";case 2: // Right button is pressed.
case 6: // Right and middle buttons are both pressed.
return "right";case 4: // Middle button is pressed.
return "middle";case 3: // Left and right buttons are both pressed.
case 7: // All three buttons are pressed.
return null;}}return "left";},
MouseMoveHandler : function(e){e=e||window.event;var m=Ida.mouse;m.x=Ida.getMouseX(e);m.y=Ida.getMouseY(e);var b=m.doc.body||{scrollLeft:0,scrollTop:0};m.clientX=e.clientX + b.scrollLeft;m.clientY=e.clientY + b.scrollTop;m.currentTarget=e.target||e.srcElement;return true;},
onLoad : function(){Ida.dListener.addListener(Ida.getDocument(),"mousemove",this.MouseMoveHandler,false);Ida.Event.unregister(this);this.doc=Ida.getDocument();}};Ida.Event.register(Ida.mouse);

Ida.tooltip={target : null // HTMLElement. Reference to the HTMLElement
, visible : false // Bool. True, if the tooltip is visible
, timerID : null // Timer. Reference to the timer started with
, doc : null // document. Reference to the target document
, delay : 400 // Int. The milliseconds to wait before the toolip will be shown
, show : function(aText, aDelay, aShowNow){if(typeof aText=="undefined"||aText==="")
return;if(!aShowNow){if(typeof aDelay!="number")
aDelay=this.delay||400;aText=aText.replace(/\n|\r/g," ");aText=aText.replace(/\'/g,"\\'");this.timerID=setTimeout("Ida.tooltip.show('" + aText + "',0,true)",aDelay);this.willBeShown=true;return;}if(this.timerID) this.timerID=null;var elm=this.getTooltip();if(!elm) return;var s=elm.style;s.visibility="hidden";elm.innerHTML=aText;s.display="block";s.width="auto";s.left="0px";s.top="0px";var oW=elm.offsetWidth;var oH=elm.offsetHeight;s.width=((oW/oH>10||oW>500)?Math.min(Math.round(oH*10),500):oW) + "px";oH=elm.offsetHeight;oW=elm.offsetWidth;var b=this.doc.body;var sL=b.scrollLeft;var sT=b.scrollTop;var wW=b.clientWidth;var wH=b.clientHeight;var posX=Ida.mouse.clientX+oW+5-sL<wW?Ida.mouse.clientX:wW-oW+sL-5;var posY=Ida.mouse.clientY+oH+25-sT<wH?Ida.mouse.clientY+20:Ida.mouse.clientY-oH-5;s.display="none";s.left=posX + "px";s.top=posY + "px";s.visibility="visible";this.visible=true;s.display="block";}, hide : function(){var elm=this.getTooltip();if(!elm) return;if(this.timerID){clearTimeout(this.timerID);this.timerID=null;}elm.style.display="none";this.visible=false;}, getTooltip : function(){var doc=this.target?Ida.getDocument(this.target):this.doc;if(!doc)
return null;var tt=doc.getElementById("IdaTooltip");if(!tt){var body=doc.body;if(body){tt=doc.createElement("div");tt.id="IdaTooltip";body.appendChild(tt);return tt;}}else
return tt;return null;}, MouseOverHandler : function(e){if(!Ida.isReader()) return false;var runtime=Ida.isRuntime();e=e||window.event;var target=e.target||e.srcElement;if(target.nodeType==1){while(target&&target.nodeType==Ida.ELEMENT_NODE){var tt=target.getAttribute("idatooltip");if(!runtime&&!tt)
tt=target.getAttribute("title");if(tt)
{this.target=target;if(Ida.tooltip.show)
{Ida.tooltip.show(tt);}else
{if(!Ida.isRuntime())
{Ida.reportError('tooltip.js#MouseOverHandler: this.show is not defined.\nthis: '+this);}}return true;}target=target.parentNode;}}return true;}, MouseOutHandler : function(e){if(!Ida.isReader()) return;var t=Ida.tooltip;if(t.timerID||t.visible){t.hide();t.target=null;}}, onLoad : function(){this.doc=Ida.getDocument();Ida.dListener.addListener(this.doc,"mouseover",this.MouseOverHandler,false);Ida.dListener.addListener(this.doc,"mouseout",this.MouseOutHandler,false);}, onPageUnload : function(){if(this.timerID||this.visible){this.hide();this.target=null;}}};Ida.Event.register(Ida.tooltip);

Ida.User=function(fName,lName,salutation,isMale,passwd,company)
{if(passwd==undefined) passwd=null;this.firstName=fName||"";this.lastName=lName||"";this.salutation=salutation||"";this.isMale=(isMale===true)||false;this.isFemale=(isMale===false)||false;this.password=String(passwd);this.company=company||"";};Ida.User.prototype={toString : function(){return "[object User]";},
getStringByPattern : function(aPattern){if(aPattern){aPattern=aPattern.replace(/FIRSTNAME/g,this.firstName);aPattern=aPattern.replace(/LASTNAME/g,this.lastName);aPattern=aPattern.replace(/SALUTATION/g,this.salutation);aPattern=aPattern.replace(/COMPANY/g,this.company);}return aPattern;},
getMWString : function(aMWObj){if(aMWObj instanceof MWNode==false){aMWObj=new Ida.MWNode(aMWObj);if(!aMWObj.isMyNode()) return "";}return this.isMale?aMWObj.valueMen:(this.isFemale ? aMWObj.valueWomen : "");}};

try
{Ida.Event.register(Ida);}catch(e)
{Ida.handleError(e);};Ida.isValidIframeExtension=function(ext)
{return true;};Ida.arguments=
{initialize : function(params)
{if(!params)
{if(params==undefined||params==null)
{if(!(params=self.location.search))
{return;}}else
{return;}}params=String(params);if(params.substr(0,1)=='?')
{params=params.substr(1);}var allP=params.split("&");for(var i=0;i<allP.length;i++)
{var curP=allP[i].split("=");if(curP[0]!='initialize'&&curP[0]!='toString'&&curP[0]!='valueOf')
{if(curP.length>1)
{Ida.arguments[curP[0]]=curP[1];}else
{Ida.arguments[curP[0]]=true;}}}}};Ida.replaceMWStrings=function(aString)
{return this._setIdaTextNodeContent(aString,"mw", function func(nodeString){return Ida.MWNode.getStringByNodeString(nodeString);});};Ida.replaceKeywordStrings=function(aString)
{return this._setIdaTextNodeContent(aString,"keyword",
function(nodeString){return Ida.KeywordNode.getStringByNodeString(nodeString);});};Ida.replaceGapStrings=function(aString)
{return this._setIdaTextNodeContent(aString,"gap",
function(nodeString){return Ida.GapNode.getStringByNodeString(nodeString);});};Ida.replaceVariableStrings=function(aString)
{return this._setIdaTextNodeContent(aString,"variable",
function(nodeString){return Ida.VariableNode.getStringByNodeString(nodeString);});};Ida._setIdaTextNodeContent=function(aContentString, aType, aFunc)
{if(!aContentString||!aType||!aFunc) return false;var reg=new RegExp("(<" + aType + "[^>]+>[^<]*</" + aType + ">)","g");var allElm=aContentString.match(reg);if(allElm){for(var i=0;i<allElm.length;i++){aContentString=aContentString.replace(allElm[i],aFunc(allElm[i]));}}return aContentString;};Ida.blockUserEvents=function(aTargetObj)
{if(!this.allowUserEvents) return;this.allowUserEvents=false;this.userEventsAllowedFor=aTargetObj;};Ida.releaseUserEvents=function()
{this.allowUserEvents=true;this.userEventsAllowedFor=null;};Ida.releaseUserEvents();Ida.areUserEventsAllowedFor=function(aObj)
{var lObjAllowed=this.userEventsAllowedFor;if(this.allowUserEvents||aObj==lObjAllowed) return true;if(!lObjAllowed) return false;var lParent=aObj.parent;while(lParent&&lParent.isDLayer){if(lParent==lObjAllowed) return true;lParent=lParent.parent;}return false;};Ida.getDocument=function(node)
{return self.document;};Ida.getWindow=function()
{return self;};Ida.isRuntime=function()
{return true;};Ida.isAuthor=function()
{return false;};Ida.isReader=function()
{return true;};Ida.isStoryboard=function()
{return false;};Ida.isEditor=function()
{return false;};Ida.isStandalone=function()
{return false;};Ida.isDevelopment=function()
{return false
};Ida.formatContent=function(aContent, aSourceElm, aFormat)
{if(!aContent||typeof aContent!="string")
{return aContent;}var canBeFormated=true;if(aSourceElm)
{var elmName=aSourceElm.nodeName.toLowerCase();if(elmName=="textarea"||elmName=="input")
{canBeFormated=false;}}if(!Ida.isRuntime())
{if(canBeFormated&&aFormat!="html"&&aFormat!="message")
{aContent=aContent.replace(/\n/g,"<br>");}}if(aContent.hasString("<mw "))
aContent=Ida.replaceMWStrings(aContent);if(aContent.hasString("<gap "))
aContent=Ida.replaceGapStrings(aContent);if(aContent.hasString("<keyword ")){aContent=Ida.replaceKeywordStrings(aContent);}if(aContent.hasString("<variable "))
{aContent=Ida.replaceVariableStrings(aContent);}if(Ida.getActiveCourse)
{var sysDir=Ida.getActiveCourse().systemDir;if(aContent.indexOf("<img ")>=0)
{aContent=aContent.replace(/(<img .*?src=["'])(pictures[\/\\].*?)(["'].*?>)/g,"$1" +sysDir+ "$2$3");}if(aContent.indexOf("url(")>=0)
{aContent=aContent.replace(/(<.*?url\(["']{0,1})(pictures[\/\\].*?)(["']{0,1}.*?>)/g,"$1" +sysDir+ "$2$3");}if(aContent.indexOf("<embed ")>=0)
{aContent=aContent.replace(/(<embed .*?src=["'])(media[\/\\].*?)(["'].*?>)/g,"$1" +sysDir+ "$2$3");}if(aContent.indexOf("<script ")>=0)
{aContent=aContent.replace(/(<script .*?src=["'])(documents[\/\\].*?)(["'].*?>)/g,"$1" +sysDir+ "$2$3");}if(aContent.indexOf("<iframe ")>=0)
{aContent=aContent.replace(/(<iframe .*?src=["'])(documents[\/\\].*?)(["'].*?>)/g,"$1" +sysDir+ "$2$3");}if(!canBeFormated)
{aContent=aContent.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/</g, '&gt;');}}return aContent;};Ida.keywords={};Ida.updateKeywords=function(cE){if(!cE)
cE=Ida.getCourseElement()||Ida.course;if(cE){var isCourse=cE.elementType=="course";var course=isCourse?cE:cE.course;if(!course) return;var mC=isCourse?cE:cE.getMainChapter();var book=isCourse?cE:cE.getBook();var pageCount=isCourse?cE.getChildCount(false,"page"):cE.parent.getChildCount(false,"page");var index=isCourse?"0":String(cE.getIndex()+1);var t=course.getContent("pageXofY");Ida.keywords["_IDA_PAGE_X_OF_Y"]=t?t.expandString(index,pageCount):"";Ida.keywords["_IDA_PAGE_NR"]=index;Ida.keywords["_IDA_PAGE_NAME"]=cE.label;Ida.keywords["_IDA_CHAPTER_NR"]=isCourse?"0":String(cE.parent.getIndex()||"");Ida.keywords["_IDA_CHAPTER_NAME"]=isCourse?cE.label:cE.parent.label;Ida.keywords["_IDA_MAINCHAPTER_NR"]=mC?(isCourse ? "0":String(mC.getIndex() + 1)) : "";Ida.keywords["_IDA_MAINCHAPTER_NAME"]=mC?mC.label:"";Ida.keywords["_IDA_BOOK_NAME"]=book?book.label:"";Ida.keywords["_IDA_COURSE_NAME"]=course.label;Ida.keywords["_IDA_COURSEELEMENT_NAME"]=cE.label;}};Ida.replaceKeywords=function(str){if(str.indexOf("_IDA_")>=0){return str.replace(/(_IDA_.*?)\b/g,function(found,key){return Ida.keywords[key]||key;});}return str;};Ida.onCourseElementSelected=function(e){Ida.updateKeywords(e.courseElement);};Ida.onLanguageChanged=function(e){Ida.updateKeywords();};Ida.getMouseX=function(e){return(this.idapage?(this.idapage.scrollLeft||0):0) + e.clientX;};Ida.getMouseY=function(e)
{return(this.idapage?(this.idapage.scrollTop||0):0) + e.clientY;};

Ida.variables={};Ida.getVariable=function(aName){return aName&&typeof this.variables[aName]!="undefined"?this.variables[aName]:"";};Ida.getVariableByPattern=function(pat)
{if(!pat)
return "";function getVar(s, name)
{return 'Ida.getVariable("' + String(name).toUpperCase().escape() + '")';}var regExp=/\b([0-9]*[a-z_]+[a-z_0-9]*)\b/gi;var retVal="";try{var newPat="";var pos0=0;var curChar="'";var pos1=pat.indexOf(curChar);if(pos1<0){curChar="\"";pos1=pat.indexOf(curChar);}var pos2=0;var counter=0;while(pos1>=0){if(pos1>0){newPat +=pat.substring(pos0,pos1).replace(regExp, getVar);}pos2=pat.indexOf(curChar,pos1+1);newPat +=pat.substring(pos1,pos2+1);curChar="'";pat=pat.substring(pos2+1);pos1=pat.indexOf(curChar);if(pos1<0){curChar="\"";pos1=pat.indexOf(curChar);}if(counter++==200){return "";}}if(pos2&&pat.length>pos2)
newPat +=pat.substring(pos2+1).replace(regExp, getVar);else if(pos2==0)
newPat +=pat.replace(regExp, getVar);retVal=eval(newPat);if(typeof retVal=="number"&&isNaN(retVal))
retVal="";}catch(e){}return typeof retVal=="undefined"?"":retVal;};Ida.setVariable=function(aName, aValue,noEvent){if(!aName)
return;if(this.variables[aName]!=aValue){var oldVal=this.variables[aName];var num=Number(aValue);this.variables[aName]=(isNaN(num)||aValue=="")?aValue:num;if(!noEvent){var e=new Ida.Event("VariableChanged",this);e.name=aName;e.oldValue=oldVal;e.value=this.variables[aName];e.dispatch();}}};Ida.setVariables=function(obj){for(var i in obj){if(this.variables[i]==undefined)
this.variables[i]=obj[i];}};Ida.hasVariable=function(aName){return typeof this.variables[aName]!="undefined";};

Ida.makeURI=function(path,course)
{if(!course) course=Ida.getActiveCourse();var wert=unescape(course.getFullURL(path));var pos=wert.lastIndexOf(":");var start=wert.substring(0,pos+1);var end=wert.substring(pos+1);return String(start)+(escape(String(end)));};Ida.getBook=function()
{if(confirm("Achtung: getBook ist deprecated. Bitte melden Sie das Problem an Birgin.\nFehlerhinweis anzeigen?"))
{try
{foo=bar;}catch(e)
{Ida.handleError(e);}}return Ida.course.books[Ida.course.file];};Ida.getActiveCourse=function()
{return Ida.course.books[Ida.course.activeCourse];};Ida.getCourseProperty=function(prop,course){if(!course) course=Ida.getActiveCourse();if(course)
{var val=course.getProperty(prop,"course");return val!=undefined?val:course.getProperty(prop);}return null;};Ida.setCourseProperty=function(prop,val,course){if(!course) course=Ida.getActiveCourse();if(course)
{course.setProperty(prop,val,"course");}};Ida.getCourseContent=function(prop,course){if(!course) course=Ida.getActiveCourse();var val=(course||undefined)&&((val=course.getContent(prop,"course")), val!=undefined?val:course.getContent(prop));return val;};Ida.setCourseContent=function(prop,val,course){if(!course) course=Ida.getActiveCourse();if(course)
{course.setContent(prop,val,"course");}};Ida.getPage=function()
{return Ida.getCourseElement();};Ida.getCourseElement=function()
{return Ida.course?Ida.course.selectedCourseElement:null;};Ida.getPageObject=function()
{var p=Ida.getPage();return p?p.dLayer:null;};Ida.getTemplateObject=function()
{return Ida.getPage().dLayer.template;};Ida.getObjectByName=function(aName)
{return Ida.getPageObject().getChildByName(aName)||Ida.getTemplateObject().getChildByName(aName);};Ida.getObjectById=function(aName)
{return Ida.getPageObject().getChildById(aName)||Ida.getTemplateObject().getChildById(aName);};Ida.getObjectsByObjectName=function(aName)
{return Ida.getPageObject().getChildrenByObjectName(aName).concat(Ida.getTemplateObject().getChildrenByObjectName(aName));};Ida.getObjectsByObjectType=function(aType)
{return Ida.getPageObject().getChildrenByObjectType(aType).concat(Ida.getTemplateObject().getChildrenByObjectType(aType));};Ida.getObjectListByProperty=function(prop,val,deep){var p=this.getPageObject();var objlist=p.getChildrenByProperty(prop,val,deep);return objlist.concat(p.template.getChildrenByProperty(prop,val,deep));};Ida.getQuestionObject=function()
{return Ida.getPageObject().getChildrenByObjectType("Questionobject")[0]||Ida.getTemplateObject().getChildrenByObjectType("Questionobject")[0];};Ida.login=function(fn, ln, sal, male, pwd, comp, autologin)
{if(this.loggedIn)
{Ida.navigation.goNextPage();return;}this.loggedIn=true;this.currentUser=new Ida.User(fn,ln,sal,male,pwd, comp);var c=this.course;var type=parseInt(c.getProperty('sessionType'));if(type)
{if(this.lms)
{type=5;}else if(type==5)
type=1;this.session=new Ida.Session(type,c,this.currentUser, c.getProperty('sessionURL'));this.session.autologin=!!autologin;this.session.load();}else if(!autologin)
{Ida.navigation.goNextPage();}};Ida.onBeforeCourseStarted=function(e)
{this.idapage=this.getDocument().getElementById("idapage");var p=this.arguments;if(p&&p.fn&&p.ln&&p.sal){this.login(p.fn,p.ln,p.sal,p.male=="true"||p.male===true,p.pw,p.cn,true);var c=Ida.course.childrenList;for(var i=0;i<c.length;i++){if(c[i].isLogin)
c[i].parent.removeChild(c[i]);}}};Ida.onunload=function()
{if(!Ida.unloaded)
{Ida.test.checkPageVisited();var c=Ida.course;var s=Ida.session;if(s&&s.type)
{if(c.isDone()&&String(c.getProperty("removeSessionOnComplete"))=="true")
{s.remove();}else
{var autoSave=String(c.getProperty("autoSaveLearningProgress"))=="true";var msg=c.getMessage("confirmSaveSession");if(autoSave||!msg||confirm(msg))
{s.save();}}}new Ida.Event("Unload",this).dispatch();}Ida.unloaded=true;};if(self.attachEvent)
{self.attachEvent("onbeforeunload",Ida.onunload);}else
{self.addEventListener("beforeunload",Ida.onunload,false);};Ida.onPageUnload=function()
{Ida.releaseUserEvents();};

Ida.Action=function(type,page,obj,message,method,params){if(arguments.length==1&&Ida.f.isNode(arguments[0]))
this.setPropertiesFromNode(arguments[0]);else{this.type=type||null;this.page=page||null;this.obj=obj||null;this.message=message||null;this.method=method||null;this.params=params||null;}this.executed=false;this.secondaryAction=null;this.actionList=null;};Ida.Action.prototype.toString=function(){return "[object Ida.Action]";};Ida.Action.prototype.toLocalString=function(){return Ida.ObjectText.getLabel(null, "IDA_ACTIONS", null, this.type)||this.type||"";};Ida.Action.prototype.clone=function(){return new Ida.Action(this.type,this.page,this.obj,this.message,this.method);};Ida.Action.prototype.createNode=function(aDoc){var elm=aDoc.createElement("action");elm.setAttribute("type",this.type);if(this.page&&this.uses("Page"))
elm.setAttribute("page",this.page);if(this.obj&&this.uses("Object"))
elm.setAttribute("obj",this.obj);if(this.message&&this.uses("Message"))
elm.setAttribute("message",this.message);if(this.method)
elm.setAttribute("method",this.method);if(this.params&&(this.uses("Params")||this.uses("Pagelist")))
elm.setAttribute("params",this.params);return elm;};Ida.Action.prototype.destroy=function(){delete this.actionList;};Ida.Action.prototype.setMessage=function(aMessage,aText){var dLayer=this.getDLayer();if(!dLayer) return;this.message=aMessage;dLayer.setMessage(aMessage,aText);};Ida.Action.prototype.getMessage=function(){if(!this.message) return;var dLayer=this.getDLayer();if(!dLayer) return;return dLayer.getMessage(this.message);};Ida.Action.prototype.getDLayer=function(){return(this.actionList)?this.actionList.dLayer:null;};Ida.Action.prototype.uses=function(what){if(!this.type||!Ida.Action.actions[this.type]) return false;return Ida.Action.actions[this.type]["uses"+what]||false;};Ida.Action.prototype.setPropertiesFromNode=function(aNode){this.method=aNode.getAttribute("method")||null;this.type=aNode.getAttribute("type")||null;this.page=aNode.getAttribute("page")||null;this.obj=aNode.getAttribute("obj")||null;this.message=aNode.getAttribute("message")||null;this.params=aNode.getAttribute("params")||null;};Ida.Action.prototype.run=function(aAction){if(typeof aAction=="undefined")
aAction=this.type;if(aAction&&Ida.Action.actions[aAction]){var retVal=Ida.Action.actions[aAction](this);retVal=(typeof retVal=="boolean")?retVal:true;this.setExecuted(retVal&&
((!this.secondaryAction&&!this.uses("Message"))||this.secondaryAction==aAction));return retVal;}else
return false;};Ida.Action.prototype.setExecuted=function(exec){if(!this.executed&&exec){this.executed=exec;if(this.actionList&&this.executed){var e=new Ida.Event("ActionExecuted",this,this.actionList);e.action=this;e.dispatch();}}};Ida.Action.prototype.onMsgBoxNotify=function(){if(this.secondaryAction){this.run(this.secondaryAction);this.secondaryAction=null;}else
this.setExecuted(true);};Ida.Action.getEvents=function(){return new Array("click",
"rightclick",
"dblclick",
"mouseover",
"mouseout",
"mousedown",
"mouseup",
"highlight");};Ida.Action.actions={};Ida.Action.toString=function(){return "[prototype Ida.Actions]";};Ida.Action.getActions=function(){var retArr=[];for(var i in this.actions){if(!this.actions[i].hidden)
retArr[retArr.length]=i;}return retArr;};Ida.Action.registerAction=function(aName,aFunction){if(!this.actions[aName]){this.actions[aName]=aFunction;}};Ida.Action.unregisterAction=function(aName){if(this.actions[aName]){delete this.actions[aName];}else
return null;};(function()
{var a=Ida.Action.actions;a.showMessage=function(act,secondaryAction){var message=act.getMessage();if(message){Ida.msgBox.notifyObject=act;Ida.msgBox("",message.replace(/\n/g,"<br>"));}else{secondaryAction=secondaryAction||act.secondaryAction;if(secondaryAction&&Ida.Action.actions[secondaryAction])
Ida.Action.actions[secondaryAction](act);}};a.showMessage.usesMessage=true;a.goNextPage=function(){return Ida.navigation.goNextPage();};a.goPreviousPage=function(){return Ida.navigation.goPreviousPage();};a.showGlossary=function(){return Ida.navigation.showGlossary();};a.showOverview=function(){return Ida.navigation.showOverview();};a.goMenu=function(){return Ida.navigation.goMenu();};a.goToPage=function(act){if(!act.page) return false;return Ida.navigation.goToPage(act.page);};a.goToPage.usesPage=true;a.goToPageAndComeBack=function(act){var pages=act.params||act.page;if(!pages) return false;return Ida.navigation.goToPages(pages);};a.goToPageAndComeBack.usesPagelist=true;a.openURL=function(act){if(!act.params) return false;return new Ida.LinkNode(act.params,null,true).execute();};a.openURL.usesParams=true;a.exit=function(){return Ida.navigation.exit();};a.showObject=function(act){Ida.Action._showHideObject(act,true);};a.showObject.usesObject=true;a.hideObject=function(act){Ida.Action._showHideObject(act,false);};a.hideObject.usesObject=true;a.toggleObject=function(act){Ida.Action._showHideObject(act);};a.toggleObject.usesObject=true;a.playMedia=function(act){var elm=Ida.getObjectById(act.obj);if(elm&&Ida.f.isFunction(elm.play))
elm.play();};a.playMedia.usesObject=true;a.stopMedia=function(act){var elm=Ida.getObjectById(act.obj);if(elm&&Ida.f.isFunction(elm.stop))
elm.stop();};a.stopMedia.usesObject=true;a.setFocus=function(act){var elm=Ida.getObjectById(act.obj);if(elm)
elm.focus();};a.setFocus.usesObject=true;Ida.Action._showHideObject=function(act,show){if(!act.obj) return;var elm=Ida.getObjectById(act.obj);if(!elm) return;if(typeof show!="boolean")
elm.toggle();else
elm[show?"show":"hide"]();};a.callMethod=function(act){act.getDLayer().callMethod(act.method,act.params);};a.callMethod.hidden=true;a.showMessageAndGoNextPage=function(act){act.secondaryAction="goNextPage";this.showMessage(act);};a.showMessageAndGoNextPage.usesMessage=true;a.showMessageAndGoToPage=function(act){act.secondaryAction="goToPage";this.showMessage(act);};a.showMessageAndGoToPage.usesPage=true;a.showMessageAndGoToPage.usesMessage=true;a.showObjectAndShowMessage=function(act){this.showObject(act);this.showMessage(act);};a.showObjectAndShowMessage.usesObject=true;a.showObjectAndShowMessage.usesMessage=true;a.hideObjectAndShowMessage=function(act){this.hideObject(act);this.showMessage(act);};a.hideObjectAndShowMessage.usesObject=true;a.hideObjectAndShowMessage.usesMessage=true;a.evaluateTest=function(act){if(Ida.test)
Ida.test.evaluateTest();};a.printPage=function(){Ida.navigation.print();};a.saveLearningProgress=function(){if(Ida.session)
Ida.session.save();};})();

Ida.ActionList=function(aActionListNode, aDLayer, register){this.actions=[];this.event=null;this.name=null;this.currentPos=0;this.mustBeExecuted="no";this.executed=false;this.dLayer=aDLayer||null;if(aActionListNode){this.setPropertiesFromNode(aActionListNode);if(typeof register=="undefined"||register===true)
this.register();}};Ida.ActionList.prototype.toString=function(){return "[object Ida.ActionList]";};Ida.ActionList.prototype.setPropertiesFromNode=function(aNode){this.name=aNode.getAttribute("name");this.event=aNode.getAttribute("event")||null;this.mustBeExecuted=aNode.getAttribute("mustBeExecuted")||"no";for(var i=0;i<aNode.childNodes.length;i++){if(aNode.childNodes[i].nodeType!=Ida.ELEMENT_NODE)
continue;if(aNode.childNodes[i].nodeName=="action"){this.addAction(new Ida.Action(aNode.childNodes[i]));}}};Ida.ActionList.prototype.addAction=function(aAction){if(!aAction) return;this.actions[this.actions.length]=aAction;aAction.actionList=this;};Ida.ActionList.prototype.insertActionAt=function(aAction,aPos){if(!aAction||!aPos) return;if(aPos>this.actions.length)
aPos=this.actions.length
Array.insertAt(this.actions,aPos,aAction);aAction.actionList=this;};Ida.ActionList.prototype.removeAction=function(aAction){for(var i=0;i<this.actions.length;i++){if(this.actions[i]==aAction){this.action[i].destroy();Array.removeAt(this.actions,i);return;}}};Ida.ActionList.prototype.removeActionAt=function(aPos){if(typeof aPos=="number"&&aPos>0&&aPos<this.actions.length){this.action[aPos].destroy();Array.removeAt(this.actions,aPos);}};Ida.ActionList.prototype.run=function(force){if(!Ida.isReader()&&!force)
return false;if(Ida.test)
Ida.test.markAsComplete(this);this.currentPos=0;return this.runNextAction();};Ida.ActionList.prototype.runNextAction=function(){var retVal;if(this.currentPos<this.actions.length){retVal=this.actions[this.currentPos].run();if(!retVal&&Ida.test)
Ida.test.markAsComplete(this,false);}else{this.executed=true;retVal=true;}return retVal;};Ida.ActionList.prototype.hasAction=function(type){return this.getActionByType(type)!=null;};Ida.ActionList.prototype.getActionByType=function(type){type=type.toLowerCase();for(var i=0;i<this.actions.length;i++){if(this.actions[i].type.toLowerCase().indexOf(type)>=0)
return this.actions[i];}return null;};Ida.ActionList.prototype.onActionExecuted=function(e){this.currentPos++;this.runNextAction();};Ida.ActionList.prototype.createNode=function(aDoc){var actionListElm=aDoc.createElement("actionlist");if(this.name)
actionListElm.setAttribute("name",this.name);if(this.event)
actionListElm.setAttribute("event",this.event);actionListElm.setAttribute("mustBeExecuted",this.mustBeExecuted||"no");for(var i=0;i<this.actions.length;i++){try{actionListElm.appendChild(this.actions[i].createNode(aDoc));}catch(e){}}return actionListElm;};Ida.ActionList.prototype.register=function(){if(Ida.test) Ida.test.register(this,this.mustBeExecuted);};Ida.ActionList.prototype.destroy=function(){if(Ida.test)
{Ida.test.unregister(this);}delete this.dLayer;for(var i in this.actions){this.actions[i].destroy();}delete this.actions;};Ida.ActionList.destroyActions=function(aObj){for(var i in aObj){if(aObj[i] instanceof Ida.ActionList)
aObj[i].destroy();}};Ida.ActionList.cloneActions=function(actions){var newAction={};for(var i in actions){newAction[i]=new Ida.ActionList();for(var prop in actions[i]){if(prop!="actions")
newAction[i][prop]=actions[i][prop];}for(var x in actions[i].actions){newAction[i].actions[x]=new actions[i].actions[x].constructor();for(var prop in actions[i].actions[x]){newAction[i].actions[x][prop]=actions[i].actions[x][prop];}if(newAction[i].actions[x].actionList)
newAction[i].actions[x].actionList=newAction[i];}}return newAction;};

Ida.DLayerExtension=function(funcName,aDLayer)
{if(!funcName||!aDLayer||!(Ida.DLayerExtension[funcName])||String(Ida.DLayerExtension[funcName].enabled)=="false")
{return null;}var eT=Ida.DLayerExtension[funcName].eventTarget;var ret=Ida.DLayerExtension[funcName].construct(aDLayer);if(ret&&eT)
{var e=new Ida.Event("AddExtension",this,eT);e.dLayer=aDLayer;e.dispatch();}return ret;};Ida.DLayerExtension.dynamicExtensions={};Ida.DLayerExtension.set=function(elm,prop,val,canBeDisabled){if(typeof elm[prop]=="undefined"){elm[prop]=val;elm[prop].enabled=true;}};Ida.DLayerExtension.register=function(extName, extTargets){for(var i=0;i<extTargets.length;i++){if(!this.dynamicExtensions[extTargets[i]])
this.dynamicExtensions[extTargets[i]]={};this.dynamicExtensions[extTargets[i]][extName]=true;}};Ida.DLayerExtension.setEnabled=function(extName,enabled){for(var i in this.dynamicExtensions){if(typeof this.dynamicExtensions[i][extName]=="boolean")
this.dynamicExtensions[i][extName]=enabled;}};Ida.DLayerExtension.extend=function(obj){var ext=this.dynamicExtensions[obj.objectType];if(ext){for(var i in ext){if(ext[i]){Ida.DLayerExtension(i,obj);}}}};

Ida.Window=function(aUrl,aName,aNotifyObj){this.name=aName||"IdaWindow";this.isOpen=false;this.url=aUrl||"";this.window=null;this.opener=Ida.Window.window;this.notifyObject=aNotifyObj||null;this.width=480;this.height=360;this.top=0;this.left=0;this.center="yes";this.hotkeys="no";this.toolbar="no";this.menubar="no";this.location="no";this.status="no";this.directories="no";this.resizable="yes";this.scrollbars="no";this.additionalProperties="";};Ida.Window.prototype.centerWindow=function(){if(this.width&&this.height){this.left=(screen.width - this.width) / 2;this.top=(screen.height - this.height) / 2;}};Ida.Window.prototype.getPropertyString=function(){if(this.center=="yes") this.centerWindow();var lRetStr=[];if(this.width) lRetStr[lRetStr.length]="width="+String(this.width);if(this.height) lRetStr[lRetStr.length]="height="+String(this.height);if(this.top) lRetStr[lRetStr.length]="top="+String(this.top);if(this.left) lRetStr[lRetStr.length]="left="+String(this.left);if(this.hotkeys) lRetStr[lRetStr.length]="hotkeys="+this.hotkeys;if(this.toolbar) lRetStr[lRetStr.length]="toolbar="+this.toolbar;if(this.menubar) lRetStr[lRetStr.length]="menubar="+this.menubar;if(this.location) lRetStr[lRetStr.length]="location="+this.location;if(this.status) lRetStr[lRetStr.length]="status="+this.status;if(this.directories) lRetStr[lRetStr.length]="directories="+this.directories;if(this.resizable) lRetStr[lRetStr.length]="resizable="+this.resizable;if(this.scrollbars) lRetStr[lRetStr.length]="scrollbars="+this.scrollbars;if(this.additionalProperties) lRetStr[lRetStr.length]=this.additionalProperties;return lRetStr.join(",");};Ida.Window.prototype.addProperty=function(aProp){if(this.additionalProperties)
this.additionalProperties +="," + aProp;else
this.additionalProperties=aProp;};Ida.Window.prototype.show=function()
{if(!this.isOpen||!this.window||this.window.closed)
{try
{var props=this.getPropertyString();this.window=this.opener.open(this.url, this.name, props);if(this.window)
{this.window.focus();this.isOpen=true;}}catch(e)
{Ida.handleError(e,'Ida.Window.show', 'URL: "'
+ this.url
+ '"\nname: '
+ this.name
+ '"\nproperties: "'
+ this.getPropertyString()
+ '"');}}else
{this.window.focus();}};Ida.Window.prototype.close=Ida.Window.prototype.hide=function(){if(this.window&&(this.isOpen||!this.window.closed))
this.window.close();};Ida.Window.prototype.onLoadComplete=function(){if(this.notifyObject&&typeof this.notifyObject.windowNotify=="function")
this.notifyObject.windowNotify("loadComplete");};Ida.Window.window=self;

Ida.Animation=function(elm,dur,loop)
{if(elm)
this.init(elm,dur,loop);};Ida.Animation.initialized=false;Ida.Animation.silentMode=false;Ida.Animation.timerDelay=50;Ida.Animation.init=function(win){if(this.animations){for(var i=0;i<this.animations.length;i++){if(this.animations[i].running)
this.animations[i].stop();this.animations[i].destroy();}}win=win||window;var doc=win.document;this.isIE=(typeof doc.body.style.filter!="undefined");this.isMoz=(typeof doc.body.style.MozOpacity!="undefined");this.clientWidth=win.innerWidth||doc.body.clientWidth;this.clientHeight=win.innerHeight||doc.body.clientHeight;this.initialized=true;this.win=win;this.doc=doc;this.animations=[];};Ida.Animation.animationEnd=function(anim){};Ida.Animation.animationStop=function(anim){};Ida.Animation.animationPause=function(anim){};Ida.Animation.animationStart=function(anim){};Ida.Animation.animationStarted=function(anim){};Ida.Animation.onTimerNotify=function(index,firstCall){var a=this.animations[index];if(a&&a.running)
a.next(firstCall);};Ida.Animation.create=function(obj,target){if(obj.type&&typeof Ida.Animation[obj.type]=="function"){var a=new Ida.Animation[obj.type](target);return this.overlay(a,obj);}return null;};Ida.Animation.overlay=function(a,obj){for(var i in obj){if(a[i]!=undefined)
a[i]=obj[i];}return a;};Ida.Animation.userProperties=["duration","startOpacity","endOpacity","loopCount",
"smooth","target","inout","direction","roundedCorners",
"useCurrent","byX","byY","path","startColor","endColor",
"delay","mode","forceAnimation"];Ida.Animation.changeAnimationType=function(anim,newType){var newAnim={};for(var i=0;i<this.userProperties.length;i++){if(typeof anim[this.userProperties[i]]!="undefined")
newAnim[this.userProperties[i]]=anim[this.userProperties[i]];}newAnim.type=newType;newAnim.event=anim.event;newAnim.index=anim.index;this.silentMode=true;var newAnim=this.create(newAnim,anim.target);this.animations[newAnim.index]=newAnim;this.silentMode=false;return newAnim;};Ida.Animation.removeAnimation=function(anim)
{var index=this.getAnimationIndex(anim);if(index>=0)
{Array.removeAt(this.animations,index);}anim.destroy();};Ida.Animation.getAnimationIndex=function(anim){for(var i=0;i<this.animations.length;i++){if(this.animations[i]==anim) return i;}return -1;};Ida.Animation.prototype={init : function(elm, duration, loopCount){this.animid=-1;this.index=-1;this.event="";this.type="";this.duration=duration||1000;this.delay=0;this.started=false;this.running=false;this.paused=false;this.finished=false;this.startTime=null;this.currentTime=null;this.endTime=null;this.percent=0;this.from=0.0;this.to=1.0;this.loopCount=typeof loopCount=="number"?loopCount:1;this.loopCounter=0;this.animStepCounter=0;this.inpos=false;this.target=elm?elm:null;this.timerID=null;this.smooth=true;this.forceAnimation=false;if(Ida.Animation.initialized&&!Ida.Animation.silentMode){this.index=Ida.Animation.animations.length;Ida.Animation.animations[this.index]=this;}},
getElm : function(elm){if(typeof elm=="object") return elm;if(typeof elm=="string") return Ida.Animation.doc.getElementById(elm);return elm;},
toString : function(){return "[object Animation]";},
start : function(fromStart,from,to){if(!this.target) return false;if(this.running)
this.stop();this.running=true;if(!this.inpos) this.initBeforeStart();if(!isNaN(from)) this.from=from;if(!isNaN(to)) this.to=to;this.onstart({"type":"start"});Ida.Animation.animationStart(this);this.started=true;this.timerID=setTimeout("Ida.Animation.onTimerNotify(" + this.index + ",true)",this.delay||0);return true;},
next : function(firstStep){if(firstStep){this.startTime=new Date().getTime();this.currentTime=this.startTime;this.endTime=this.startTime + this.duration;}var curTime=new Date().getTime();if(this.duration==0)
var step=firstStep?0:1;else{step=(curTime - this.startTime) /(this.endTime - this.startTime);if(step>1) step=1;}this.percent=step*100;this.currentTime=curTime;var pos=this.from +((this.to-this.from)*step);if(this.smooth)
pos=(-Math.cos(pos*Math.PI)/2) + 0.5;pos=Math.round(pos*1000)/1000;this.animate(pos);if(this.running&&pos!=this.to){this.timerID=setTimeout("Ida.Animation.onTimerNotify(" + this.index + ",false)",Ida.Animation.timerDelay);if(firstStep)
Ida.Animation.animationStarted(this);}else if(this.loopCount==0||++this.loopCounter<this.loopCount)
this.start(true);else
this.finish();},
initBeforeStart : function(){},
stop : function(){if(this.timerID){clearTimeout(this.timerID);this.timerID=null;}this.onstop({"type":"stop"});this.running=false;},
pause : function(){this.paused=true;this.onpause({"type":"pause"});},
finish : function(){this.animate(this.to);if(this.timerID){clearTimeout(this.timerID);this.timerID=null;}this.running=false;this.loopCounter=0;this.finished=true;this.onend({"type":"end"});Ida.Animation.animationEnd(this);},
onstart : function(){},
onend : function(){},
onstop : function(){},
onanimate : function(){},
onpause : function(){},
setOpacity : function(aVal){aVal=aVal<1?aVal:"";if(Ida.Animation.isIE)
this.target.style.filter=aVal===""?"":"Alpha(opacity=" + Math.floor(100*(aVal)) + ")";else if(Ida.Animation.isMoz)
this.target.style.MozOpacity=aVal;else
this.target.style.opacity=aVal;},
moveTo : function(x,y){this.target.style.left=Math.round(x) + "px";this.target.style.top=Math.round(y) + "px";},
moveBy : function(x,y){if(x) this.target.style.left=Math.round(this.target.offsetLeft + x) + "px";if(y) this.target.style.top=Math.round(this.target.offsetTop + y) + "px";},
sizeTo : function(newW,newH){if(newW>=0) this.target.style.width=Math.round(newW) + "px";if(newH>=0) this.target.style.height=Math.round(newH) + "px";},
clipTo : function(x,y,w,h){this.target.style.clip="rect("+y+" "+w+" "+h+" "+x+")";},
clipPercent : function(x,y,x2,y2){var w=this.target.offsetWidth;var h=this.target.offsetHeight;if(x+y+x2+y2)
this.clipTo(x>0&&w>0?Math.round(w*x/100):0,
y>0&&h>0?Math.round(h*y/100):0,
w-(x2>0&&w>0?Math.round(w*x2/100):0),
h-(y2>0&&h>0?Math.round(h*y2/100):0));else{this.target.style.clip="rect(auto auto auto auto)";if(!Ida.IE){var d=this.target.style.display;this.target.style.display="none";var oh=this.target.offsetHeight;this.target.style.display=d;}}},
destroy : function(){delete this.target;}};Ida.Animation.MoveBy=function(elm, dur, loop, x, y){this.init(elm,dur,loop);this.byX=x||0;this.byY=y||0;};Ida.Animation.MoveBy.prototype=new Ida.Animation();Ida.Animation.MoveBy.prototype.initBeforeStart=function(){this.startPosX=this.target.offsetLeft;this.startPosY=this.target.offsetTop;this.inpos=true;};Ida.Animation.MoveBy.prototype.animate=function(pos){if(this.byX) this.target.style.left=this.startPosX + this.byX*pos;if(this.byY) this.target.style.top=this.startPosY + this.byY*pos;};Ida.Animation.Move=function(elm, dur, loop, inout, dir){this.inout=inout||"in";this.direction=dir||"left";this.byX=null;this.byY=null;this.init(elm,dur,loop);};Ida.Animation.Move.prototype=new Ida.Animation.MoveBy();Ida.Animation.Move.prototype.initBeforeStart=function(){var elm=this.target;var tX=elm.offsetLeft;var tY=elm.offsetTop;var tW=elm.offsetWidth;var tH=elm.offsetHeight;var oX=Ida.f.getAbsoluteX(elm)-tX;var oY=Ida.f.getAbsoluteY(elm)-tY;var dir=this.direction;var sX=tX, sY=tY;if(dir.indexOf("left")>=0) sX=-tW-oX;else if(dir.indexOf("right")>=0) sX=Ida.Animation.clientWidth-oX;if(dir.indexOf("top")>=0) sY=-tH-oY;else if(dir.indexOf("bottom")>=0) sY=Ida.Animation.clientHeight-oY;var isIn=this.inout=="in";this.startPosX=isIn?sX:tX;this.startPosY=isIn?sY:tY;this.byX=isIn?tX-sX:sX-tX;this.byY=isIn?tY-sY:sY-tY;this.inpos=true;};Ida.Animation.Size=function(elm, dur, loop, inout, dir){this.inout=inout||"out";this.direction=dir||"center";this.init(elm,dur,loop);};Ida.Animation.Size.prototype=new Ida.Animation();Ida.Animation.Size.prototype.initBeforeStart=function(){var t=this.target;var tX=t.offsetLeft;var tY=t.offsetTop;var tW=t.offsetWidth;var tH=t.offsetHeight;var isCenter=this.direction=="center";var isCenterV=this.direction=="centerv";var isCenterH=this.direction=="centerh";this.fontSize=Ida.f.getStyle(this.target,"fontSize","number")||0;var dir=this.direction;var sW=0, sH=0;if(dir=="top"||dir=="bottom")
sW=tW;else if(dir=="right"||dir=="left")
sH=tH;this.changePosX=dir.indexOf("right")>=0||isCenter||isCenterH;this.changePosY=dir.indexOf("bottom")>=0||isCenter||isCenterV;var sX=tX, sY=tY;if(this.changePosX)
sX +=isCenter?tW/2:tW;if(this.changePosY)
sY +=isCenter?tH/2:tH;var isIn=this.inout=="in";this.fontSizeStart=isIn?0:this.fontSize;this.fontSizeEnd=isIn?this.fontSize:0;this.endPosX=isIn?tX:sX;this.endPosY=isIn?tY:sY;this.startWidth=isIn?sW:tW;this.startHeight=isIn?sH:tH;this.endWidth=isIn?tW:sW;this.endHeight=isIn?tH:sH;this.isCenter=isCenter;this.isCenterV=isCenterV;this.isCenterH=isCenterH;this.inpos=true;};Ida.Animation.Size.prototype.animate=function(step){var w=this.isCenterV?-1:this.startWidth +(this.endWidth-this.startWidth)*step;var h=this.isCenterH?-1:this.startHeight +(this.endHeight-this.startHeight)*step;if(this.changePosX||this.changePosY){var mult=this.direction.indexOf("center")==0?0.5:1;var posX=this.endPosX +(this.changePosX?(this.endWidth - w):0)*mult;var posY=this.endPosY +(this.changePosY?(this.endHeight - h):0)*mult;this.moveTo(posX,posY);}this.sizeTo(w,h);this.target.style.fontSize=this.fontSizeStart +(this.fontSizeEnd-this.fontSizeStart)*step;};Ida.Animation.Pull=function(elm, dur, loop, inout, dir){this.inout=inout||"out";this.direction=dir||"right";this.init(elm,dur,loop);};Ida.Animation.Pull.prototype=new Ida.Animation();Ida.Animation.Pull.prototype.initBeforeStart=function(){var dir=this.direction;this.clipX=dir.indexOf("right")>=0||dir=="center"||dir=="centerh";this.clipY=dir.indexOf("bottom")>=0||dir=="center"||dir=="centerv";this.clipW=dir.indexOf("left")>=0||dir=="center"||dir=="centerh";this.clipH=dir.indexOf("top")>=0||dir=="center"||dir=="centerv";this.clipHalv=dir.indexOf("center")==0;this.inpos=true;};Ida.Animation.Pull.prototype.animate=function(step){if(this.inout=="in")
step=1-step;step *=this.clipHalv?50:100;this.clipPercent(this.clipX?step:0,this.clipY?step:0,this.clipW?step:0,this.clipH?step:0)
};Ida.Animation.Path=function(elm, dur, loop, path, roundedCorners){this.init(elm,dur,loop);this.path=path||"";this.roundedCorners=roundedCorners==true;this.curve=null;};Ida.Animation.Path.prototype=new Ida.Animation();Ida.Animation.Path.prototype.initBeforeStart=function(){var p=this.path;if(p)
{switch(typeof p)
{case "string":
var np=p.split(";");for(var i=0;i<np.length;i++)
{np[i]=np[i].split(",");for(var x=0;x<np[i].length;x++)
{np[i][x]=parseInt(np[i][x])||0;}}break;case "object":
np=p;break;default:
throw new Ida.IdaError('ERR_INVALID_PROPERTY_VALUE', 'animation.js#Ida.Animation.Path.prototype.initBeforeStart', 'this.path');}this.curve=this.roundedCorners?new Ida.Animation.Curves.CatmullRom(np):new Ida.Animation.Curves.Linear(np);this.inpos=true;}else
{throw new Ida.IdaError('ERR_NOT_INITIALIZED', 'animation.js#Ida.Animation.Path.prototype.initBeforeStart', 'this.path');}};Ida.Animation.Path.prototype.animate=function(pos){var newPos=this.curve.getValue(pos);this.moveTo(newPos[0],newPos[1]);if(newPos.length==4)
this.sizeTo(newPos[2],newPos[3]);};Ida.Animation.Fade=function(elm, dur, loop, startO, endO, inout){this.useCurrent=true;this.init(elm,dur,loop);this.startOpacity=isNaN(startO)?0:startO;this.endOpacity=isNaN(endO)?1:endO;this.inout=inout||(this.startOpacity<this.endOpacity?"in":"out");};Ida.Animation.Fade.prototype=new Ida.Animation();Ida.Animation.Fade.prototype.initBeforeStart=function(){if(this.useCurrent||isNaN(this.startOpacity))
this.startOpacity=this.inout=="in"?0:this.getCurrent();if(this.useCurrent||isNaN(this.endOpacity))
this.endOpacity=this.inout=="in"?this.getCurrent():0;this.inpos=true;};Ida.Animation.Fade.prototype.getCurrent=function(){try{var t=this.target;var val;if(Ida.Animation.isIE){val=Ida.f.getStyle(this.target,"filter");if(val){val=Number(val.replace(/\D/g,""));if(val) val /=100;}else val=1;}else if(Ida.Animation.isMoz){val=Ida.f.getStyle(this.target,"MozOpacity");if(val==1)
this.setOpacity(val);}else
val=Ida.f.getStyle(this.target,"opacity");}catch(e){Ida.handleError(e);}return Math.round((val||0)*100)/100;};Ida.Animation.Fade.prototype.animate=function(pos){if(this.animStepCounter<=2&&Ida.Animation.isIE){var d=this.target.style.display;this.target.style.display="none";this.target.style.display=d;}this.setOpacity(this.startOpacity +((this.endOpacity-this.startOpacity)*pos));};Ida.Animation.Color=function(elm,dur,loop,startColor,endColor,mode){this.init(elm,dur,loop);this.startColor=startColor||"";this.endColor=endColor||"";this.mode=mode||"backgroundColor";};Ida.Animation.Color.prototype=new Ida.Animation();Ida.Animation.Color.prototype.initBeforeStart=function(){if(this.useCurrent||!this.startColor)
this.startColor=this.getCurrent();this.startColor=this.asRGBArray(this.startColor);this.endColor=this.asRGBArray(this.endColor||this.startColor);this.inpos=true;};Ida.Animation.Color.prototype.getCurrent=function(){return this.asRGBArray(Ida.f.getStyle(this.target,this.mode));};Ida.Animation.Color.prototype.asRGBArray=function(col){if(typeof col=="string"){if(col.indexOf("rgb(")==0){var colAry=col.substring(4,col.length-1).split(",");for(var i=0;i<colAry.length;i++)
colAry[i]=parseInt(colAry[i]);return colAry;}else if(col.indexOf("#")==0)
return [parseInt(col.substr(1,2),16),parseInt(col.substr(3,2),16),parseInt(col.substr(5,2),16)];}else if(col!=null&&typeof col=="object"&&col.length==3)
return col;return [0,0,0];};Ida.Animation.Color.prototype.asHEX=function(col){if(col instanceof Array)
return "#" + this.numberToHEX(col[0]) + this.numberToHEX(col[1]) + this.numberToHEX(col[2]);else if(typeof col=="string")
return col;};Ida.Animation.Color.prototype.numberToHEX=function(num){var hex=(num).toString(16);while(hex.length<2)
hex="0" + String(hex);return hex;};Ida.Animation.Color.prototype.animate=function(pos){this.target.style[this.mode]="rgb(" +
Math.round(this.startColor[0] +(this.endColor[0]-this.startColor[0])*pos) + "," +
Math.round(this.startColor[1] +(this.endColor[1]-this.startColor[1])*pos) + "," +
Math.round(this.startColor[2] +(this.endColor[2]-this.startColor[2])*pos) + ")";};Ida.Animation.Curves={};Ida.Animation.Curves.Linear=function(pnts){this.p=pnts;};Ida.Animation.Curves.Linear.prototype={getValue : function(step)
{if(step==0) return this.p[0];if(step==1) return this.p[this.p.length-1];var percent=step *(this.p.length-1);var node=Math.floor(percent);var progress=percent - node;var retVal=new Array(this.p[node].length);if(this.p[node + 1])
{for(var i=0;i<this.p[node].length;i++)
{retVal[i]=this.p[node][i] + progress*(this.p[node+1][i] - this.p[node][i]);}}return retVal;}};Ida.Animation.Curves.CatmullRom=function(pnts,c){if(!c) this.c=0.7;else this.c=c;this.p=pnts;};Ida.Animation.Curves.CatmullRom.prototype={getValue : function(step){var percent=step *(this.p.length-1);var node=Math.floor(percent);var progress=percent - node;var i0=node-1;if(i0<0) i0=0;var i=node;var i1=node+1;if(i1>=this.p.length) i1=this.p.length-1;var i2=node+2;if(i2>=this.p.length) i2=this.p.length-1;var u=progress;var u2=progress*progress;var u3=progress*progress*progress;var retVal=new Array(this.p[0].length);for(var k=0;k<this.p[0].length;k++){var x1=(-this.c * this.p[i0][k] ) +((2 - this.c) * this.p[i][k] ) +((this.c-2) * this.p[i1][k] ) +(this.c * this.p[i2][k] );var x2=(2 * this.c * this.p[i0][k] ) +((this.c-3) * this.p[i][k] ) +((3 - 2 * this.c) * this.p[i1][k] ) +(-this.c * this.p[i2][k] );var x3=(-this.c * this.p[i0][k] ) +(this.c * this.p[i1][k] );var x4=this.p[i][k];retVal[k]=x1*u3 + x2*u2 + x3*u + x4;}return retVal;}};

Ida.animationController={referenceEvents : "withprevious,afterprevious",
animateOnPageLoad : true,
onLoad : function(){Ida.Animation.animationEnd=function(anim){var ac=Ida.animationController;if(!ac._checkNext(anim,"afterprevious")&&ac.mode=="test"){setTimeout(function(){ac.stopTest(anim);}, ac.testResetDelay);}};Ida.Animation.animationStop=function(anim){};Ida.Animation.animationPause=function(anim){};Ida.Animation.animationStart=function(anim){};Ida.Animation.animationStarted=function(anim){Ida.animationController._checkNext(anim,"withprevious");var c=anim.target.className;if(c&&c.indexOf("tobeanimated")>=0)
Ida.f.removeClassName(anim.target,"tobeanimated");var dLayer=Ida.animationController.getDLayer(anim);if(dLayer&&dLayer.get("visibility")=="hidden")
dLayer.setA("visibility","inherit");};Ida.Animation.animationCreated=function(anim){};},
onLoadComplete : function(){Ida.Animation.init(Ida.getWindow()||window);},
_checkNext : function(anim,e){var a=this.getAnimations();return this.startAnimationByEvent(a[anim.index+1],e);},
getDLayer : function(anim){if(anim){if(anim.target.isDLayer) return anim.target;else if(anim.target.dLayer) return anim.target.dLayer;}return null;},
onPageUnload : function(){Ida.Animation.init(Ida.getWindow());this.mediaReady=true;},
onPageLoaded : function(e){this.started=false;var a=this.sortAnimations();if(a.length){var refAnim;for(var i=0;i<a.length;i++){if(a[i].target instanceof Ida.DLayer)
a[i].target=a[i].target.elm;if(a[i].event.isInList(this.referenceEvents))
refAnim=this.getReferencedAnimation(a[i],true,a);else
refAnim=a[i];a[i].impliedEvent=refAnim?refAnim.event:a[i].event;if(refAnim&&refAnim.event=="pageloaded"){a[i].target._animHasPageLoad=true;if(refAnim.forceAnimation)
a[i].forceAnimation=true;}}if(Ida.isReader()){var p=e.src.courseElement;this.animateOnPageLoad=p.isPageLoadSettingOK("playPageLoadAnimationsOnce");var eImpl, hasPL, isPL, isPC;for(i=0;i<a.length;i++){if(a[i].inout=="in"&&!a[i].target._animinpos){e=a[i].event;eImpl=a[i].impliedEvent;isPL=e=="pageloaded"||eImpl=="pageloaded";hasPL=isPL||!isNaN(a[i].target._animHasPageLoad);isPC=e=="pageclick"||eImpl=="pageclick";if(isPL||(isPC&&!hasPL)){a[i].initBeforeStart();Ida.f.addClassName(a[i].target,"tobeanimated");a[i].target._animinpos=true;}}else if(a[i].type=="Fade"&&a[i].inout=="out"&&a[i].startOpacity==1)
a[i].setOpacity(1);}}}},
mediaReady : true,
pageReady : false,
onPageShown : function(){this.pageReady=true;setTimeout("Ida.animationController.startPageLoaded()",100);},
onMediaReady : function(){if(!this.mediaReady){this.mediaReady=true;if(!this.started&&this.pageReady)
Ida.animationController.startPageLoaded();}},
startPageLoaded : function(){if(!this.started&&this.mediaReady){this.started=true;if(this.getAnimationList().length&&Ida.isReader())
this.runAnimationsByEvent("pageloaded");}},
getAnimationList : function(){var page=Ida.getPageObject();if(page){var animList=String(page.get("animationlist"));if(animList)
return this._cleanUp(animList.split(","),true);}return [];},
setAnimationList : function(list){var page=Ida.getPageObject();if(page){list=this._cleanUp(list);page.set("animationlist",list.join(","));return this.sortAnimations();}return [];},
_cleanUp : function(list,reset){var listObj={};var listTmp=[];var error=false;for(var i=0;i<list.length;i++){var id=list[i];if(!listObj[id]){listObj[id]=true;listTmp.push(id);}else
error=true;}if(error&&!Ida.isRuntime())
{Ida.error("msg.error.animation.duplicateAnimationId");if(reset)
this.setAnimationList(listTmp);}return listTmp;},
runAnimationsByEvent : function(e){var a=this.getAnimations();var isPageClick=e=="pageclick";for(var i=0;i<a.length;i++){if(a[i].event!=e) continue;if(isPageClick){if(!a[i].started)
return this.startAnimationByEvent(a[i],e);}else
this.startAnimationByEvent(a[i],e);}},
startAnimationByEvent : function(anim,e){try{if(anim&&anim.event==e){if(anim.impliedEvent=="pageloaded"&&!this.animateOnPageLoad){if(!anim.forceAnimation){anim.initBeforeStart();Ida.Animation.animationStarted(anim);anim.finish();return true;}}anim.start(true);return true;}return false;}catch(e)
{}},
sortAnimations : function(){var a=Ida.Animation.animations;var newAnims=[];if(a){var list=this.getAnimationList();var id;for(var i=0;i<list.length;i++){id=Number(list[i]);for(var x=0;x<a.length;x++){if(a[x].animid==id){a[x].index=newAnims.length;newAnims[newAnims.length]=a[x];x=a.length;}}}Ida.Animation.animations=newAnims;}return newAnims;},
getAnimations : function()
{return Ida.Animation.animations||[];},
getAnimation : function(id){var a=this.getAnimations();if(!isNaN(id))
id=Number(id);for(var i=0;i<a.length;i++){if(a[i].animid==id)
return a[i];}return null;},
getReferencedAnimation : function(a,getCaller,anims){if(!anims) anims=this.getAnimations();if(a.event.isInList(this.referenceEvents)&&(a.index))
return(getCaller&&anims[a.index-1].event.isInList(this.referenceEvents))?this.getReferencedAnimation(anims[a.index-1],true,anims):anims[a.index-1];return null;},
resetAnimation : function(anim,referencedToo){var d=this.getDLayer(anim);if(d){anim.inpos=false;var props=["width","height","left","top","color","backgroundColor","borderColor","MozOpacity"];for(var i=0;i<props.length;i++){if(d.hasProperty(props[i])){d.setA(props[i],d.get(props[i]));}}d.elm.style.clip="auto";}if(referencedToo&&anim.type.isInList(this.referenceEvents)){this.resetAnimation(this.getReferencedAnimation(anim,false));}}};Ida.Event.register(Ida.animationController);

Ida.Attribute=function(){};Ida.Attribute.prototype.toString=function(){return "[object Ida.Attribute]";};Ida.Attribute.prototype.getAttributeObject=function(aString){return Ida.Attribute.getAttributeObject(aString);};Ida.Attribute.prototype.setPropertiesFromString=function(aString){var obj=this.getAttributeObject(aString);for(var i in obj){if(typeof this[i]!="undefined")
this[i]=obj[i];}};Ida.Attribute.prototype.getAttributeString=function(aPropList){var retVal="";var prop;aPropList=aPropList.split(",");for(var i=0;i<aPropList.length;i++){prop=aPropList[i];if(typeof aObject[prop]!="undefined"){if(retVal)
retVal +=";";retVal +=prop + ":" + aObject[prop];}}return retVal;};Ida.Attribute.getAttributeObject=function(aString){var obj={};var props=aString.split(";");var prop, propString;for(var i=0;i<props.length;i++){propString=props[i].split(":");prop=propString[0].trim();if(prop!=""){obj[prop]=propString[1].trim();}}return obj;};Ida.Attribute.getAttributeString=function(aObject){var retVal="";for(var i in aObject){if(retVal)
retVal +=";";retVal +=i + ":" + aObject[i];}return retVal;};

Ida.Key=function(name,shift,ctrl,alt,action){this.name=name||"";this.shift=Ida.f.asType(shift,"boolean");this.ctrl=Ida.f.asType(ctrl,"boolean");this.alt=Ida.f.asType(alt,"boolean");this.keyset=null;this.action=action||"";this.executed=false;};Ida.Key.prototype=new Ida.Attribute();Ida.Key.prototype.toString=function(){return "[object Ida.Key]";};Ida.Key.prototype.isDone=function(){if(this.executed)
return true;var actObj=this.getActionObj();return actObj?(actObj.executed||actObj.mustBeExecuted=="no"):true;};Ida.Key.prototype.markAsComplete=function(){Ida.test.markAsComplete(this.getActionObj());};Ida.Key.prototype.setPropertiesFromString=function(aString){var obj=this.getAttributeObject(aString);this.name=obj.name;this.shift=Ida.f.asType(obj.shift,"boolean");this.ctrl=Ida.f.asType(obj.ctrl,"boolean");this.alt=Ida.f.asType(obj.alt,"boolean");this.action=obj.action||"";};Ida.Key.prototype.destroy=function(){delete this.keyset;};Ida.Key.prototype.getAttributeString=function(){var retString="name:" + this.name;if(this.shift) retString +=";shift:true";if(this.ctrl) retString +=";ctrl:true";if(this.alt) retString +=";alt:true";if(this.action) retString +=";action:" + this.action;return retString;};Ida.Key.prototype.getActionObj=function(){var obj=this.keyset.dLayer;return obj.actions[this.action];};Ida.Key.prototype.runAction=function(){var obj=this.keyset.dLayer;this.executed=true;if(!obj.runAction(this.action)&&obj.get("activateAnyKey")!=false){this.keyset.runDefaultAction();}Ida.test.checkNavigation();};

Ida.Keyset=function(aKeysetString, aDLayer){this.keys={};this.dLayer=aDLayer||null;this.activated=true;this.evaluate=false;if(typeof aKeysetString=="string")
this.setPropertiesFromString(aKeysetString);};Ida.Keyset.prototype=new Ida.Attribute();Ida.Keyset.prototype.destroy=function(){for(var i in this.keys){this.keys[i].destroy();delete this.keys[i];}this.keys=null;this.dLayer=null;};Ida.Keyset.prototype.toString=function(){return "[object Ida.Keyset]";};Ida.Keyset.prototype.setPropertiesFromString=function(aKeyString){var keyArray=aKeyString.split("#");var newKey;for(var i=0;i<keyArray.length;i++){newKey=new Ida.Key();newKey.setPropertiesFromString(keyArray[i]);if(newKey.name){this.addKey(newKey);}}};Ida.Keyset.prototype.getAttributeString=function(){var keysetArr=[];for(var i in this.keys){if(this.keys[i].name)
keysetArr[keysetArr.length]=this.keys[i].getAttributeString();}return keysetArr.join("#");};Ida.Keyset.prototype.addKey=function(aKeyObj){this.keys[aKeyObj.name]=aKeyObj;aKeyObj.keyset=this;};Ida.Keyset.prototype.removeKey=function(aKeyName){if(typeof this.keys[aKeyName]=="undefined")
return;this.keys[aKeyName].destroy();delete this.keys[aKeyName];};Ida.Keyset.prototype.getKey=function(aKeyName){return(aKeyName&&this.keys[aKeyName])?this.keys[aKeyName]:null;};Ida.Keyset.prototype.onKeyDown=function(e){if(!this.activated||!this.dLayer)
return;var name=e.keyConstant.name;var k=this.getKey(name);var ok=false;this.anyKey=null;if(k)
ok=(k.shift==e.shiftKey&&k.alt==e.altKey&&k.ctrl==e.ctrlKey);if((!k||!ok)&&
this.keys["ANYKEY"]&&
!name.isInList("KeyShift,KeyControl,KeyMenu")&&
this.dLayer.get("activateAnyKey")!=false){var t=e.target||e.srcElement;if(!t||!t.nodeName.toLowerCase().isInList("input,textarea"))
this.anyKey=this.keys["ANYKEY"];}if(ok){k.runAction();e.keyDefined=true;}};Ida.Keyset.prototype.onAfterKeyDown=function(e){if(!e.keyDefined&&e.keyCode!=16&&e.keyCode!=17){var k=this.anyKey;if(k){var ok=(!k.shift&&!k.alt&&!k.ctrl)||
(k.shift==e.shiftKey&&k.alt==e.altKey&&k.ctrl==e.ctrlKey);if(ok){this.anyKey.runAction();e.keyDefined=true;}}if(this.evaluate&&this.dLayer&&this.dLayer.ok&&!this.isDone()){this.dLayer.ok();}}};Ida.Keyset.prototype.isDone=function(checkAnyKey){checkAnyKey=(checkAnyKey===true);for(var i in this.keys){if((checkAnyKey||i!="ANYKEY")&&!this.keys[i].isDone())
return false;}return true;};Ida.Keyset.prototype.markAsComplete=function(){for(var i in this.keys)
this.keys[i].markAsComplete();};Ida.Keyset.prototype.runDefaultAction=function(){if(this.dLayer.hasAction("defaultAction")){this.dLayer.runAction("defaultAction");if(this.evaluate&&this.dLayer&&this.dLayer.ok){this.dLayer.ok();}}};

Ida.CourseElementR=function(type)
{this.id="";this.nr="";this.idNr=0;this.elementType=type||'';this.label="";this.parent=null;this.nextElement=null;this.previousElement=null;this.autoSetVisited=true;this.isRoot=false;this.canHaveChildren=false;this.course=null;this.visited=false;this.mustBeVisited=true;};Ida.CourseElementR.prototype=
{hasChildren : function()
{return this.children&&typeof this.children=='object'&&this.children.length?true:false;},
toString : function(){return "[object " + this.elementType.upperCaseCharAt(0) + "]";}, isVisual : function()
{return(this.course||false)&&this.course.isVisual();}, getBook : function()
{return this.isRoot?this.elementType=='book' ? this:null : this.parent.getBook();}, getTargetString : function(force)
{var c=Ida.course;var ob=!!force||c.books[(c.activeCourse||c.courseName)]!=this.course;return this.id +(ob?" book '" + this.course.courseName + "'":"");}, init : function(parent, aIdNr, aLabel)
{var me=this;this.parent=parent;this.course=parent.course||parent;this.isRoot=this.course===this.parent&&parent.books instanceof Array;this.idNr=aIdNr||this.course.getNewIDNr();this.id=this.elementType + "_id_" + this.idNr;this.label=aLabel||this.course.getElementLabel(this);parent.appendChild(me,true);if(!this.isRoot)
{var nr=this.getIndex(this.elementType) + 1;this.nr=this.parent.nr + nr +(this.canHaveChildren?'.':'');}}, getLabel : function getLabel()
{return this.label;}, setLabel : function setLabel(label)
{this.label=label||this.course.getElementLabel(this);}, refreshLabels :function()
{this.setLabel();if(this.children instanceof Array)
{for(var i=0;i<this.children.length;i++)
{this.children[i].refreshLabels();}}}, appendChild : function(child)
{if(this.canHaveChildren)
{try
{child.course=this.course;var i=this.children.push(child);if(i>1)
{var pc=this.children[i-2];pc.nextElement=child;child.previousElement=pc;}this.course.childrenList.push(child);if(Ida.isRuntime()&&Ida.course!=this.course)
{Ida.course.childrenList.push(child);}}catch(e)
{Ida.handleError(e,"Ida.CourseElementR.appendChild()");}}}, removeChild : function(child)
{var array=this.children;var pos=Array.indexOf(array,child);if(pos>=0)
{array.splice(pos, 1);if(pos&&array.length)
{if(pos<array.length)
{array[pos].previousElement=array[pos - 1];}array[pos - 1].nextElement=array[pos]||null;}else if(array.length)
{array[0].previousElement=null;}pos=this.course.getElementIndex(child);if(pos>=0)
Array.removeAt(this.course.childrenList,pos);}}, isVisited : function isVisited()
{if(!this.canHaveChildren)
{return this.visited;}else
{for(var i in this.children)
{if(!this.children[i].isVisited())
{return false;}}return true;}}, setVisited : function setVisited(val)
{if(!this.canHaveChildren)
{this.visited=!!val;}else
{for(var i=0;i<this.children.length;i++)
{this.children[i].setVisited(val);}}}, isDone : function isDone(ignoreElm)
{if(ignoreElm==this)
{return true;}if(!this.canHaveChildren)
{var ret=this.visited||!this.mustBeVisited;return ret;}else
{for(var i in this.children)
{if(!this.children[i].isDone(ignoreElm))
{return false;}}return true;}}, getProperty : function(propName)
{return this.dLayer&&this.dLayer.get(propName)||null;}, setProperty : function(propName, value)
{var dls=this.dLayer&&this.dLayer.set;if(dls)
{dls(propName, value);}}, canGoTo : function()
{if(this.isLogin&&Ida.loggedIn)
{return false;}else if(!this.dependsOn)
{return true;}else
{var elm=this.course.getCourseElementById(this.dependsOn);if(elm)
{var isDone=elm.isDone(this);if(!isDone&&elm==Ida.getPage()){return Ida.test.isCorrect();}var isVisi=elm.isVisited();}return isDone&&(isVisi||Ida.test.isCorrect())?true:false;}}, selectElement : function()
{if(typeof this.show=="function")
{this.show();}Ida.course.activeCourse=this.course.file;}, showElement : this.selectElement
, getIconType : function()
{return this.elementType||'undefined';}, findPageByType : function(type)
{var par=this;while(par&&!par.isRoot)
{var prev=par.previousElement;while(prev)
{if(prev.pageType==type)
{return prev;}prev=prev.previousElement;}par=par.parent;}return null;}, hasChild : function(elm,deep)
{if(deep===false)
{return elm.parent==this;}while(elm)
{if(elm.parent==this)
{return true;}elm=elm.parent;}return false;}, getIndentation : function()
{return(this.isRoot)?0:this.parent.getIndentation() + 1;},
getMaxScore : function(){var score=this.maxScore||0;if(this.canHaveChildren){for(var i=0;i<this.children.length;i++){score +=this.children[i].getMaxScore();}}return score;},
getIndex : function(type){var count=0;var c=this.parent.children;for(var i=0;i<c.length;i++)
{if(c[i]==this)
{return count;}if(!type||c[i].elementType==type) count++;}return undefined;},
getChildCount : function(includeSub,type){return this.getChildInfo(includeSub,type,null).total;},
getChildInfo : function(includeSub,type,ret){if(!ret||typeof ret!="object")
ret={total:0,visited:0,done:0};if(this.canHaveChildren){var c,t,v;for(var i=0;i<this.children.length;i++){c=this.children[i];t=c.elementType;if(!type||type==t){ret.total++;v=c.canHaveChildren?1:(c.visited ? 1:0);ret.visited +=v;ret.done +=v||(c.mustBeVisited?0:1);}if(includeSub)
this.children[i].getChildInfo(includeSub,type,ret);}}return ret;},
getMainChapter : function(){if(this.elementType=="page")
return this.parent.getMainChapter();if(this.elementType=="chapter"){if(this.parent.elementType=="book")
return this;else
return this.parent.getMainChapter();}return null;},
getChildrenList : function(_par,_list){if(!_list)
{_list=[];_par=this;}for(var i=0;i<_par.children.length;i++)
{_list.push(_par.children[i]);if(_par.children[i].hasChildren())
this.getChildrenList(_par.children[i],_list);}return _list;},
getFile : function()
{return this.course.pageDir + this.id+ ".js";},
getContentFile : function(lang){return this.course.contentDir + "content_id_" + this.idNr + "_"+Ida.language.currentLanguage+".js";},
getRoot : function(){return this.isRoot?this:this.parent.getRoot();},
getFirstPage : function(){if(!this.hasChildren()) return null;var elm;for(var i=0;i<this.children.length;i++){if(this.children[i].elementType=="page")
return this.children[i];else{elm=this.children[i].getFirstPage();if(elm)
return elm;}}return null;}};

Ida.ChapterR=function(parent, idNr, label)
{this.canHaveChildren=true;this.children=[];if(parent!==false)
{this.init(parent, idNr, label);}};Ida.ChapterR.prototype=new Ida.CourseElementR('chapter');

Ida.BookR=function(parent, idNr, label)
{this.elementType='book';this.children=[];this.init(parent, idNr, label);};Ida.BookR.prototype=new Ida.ChapterR(false);Ida.BookR.prototype.getIconType=function()
{if(Ida.isRuntime()&&Ida.course!=this.course)
{return this.elementType&&('external' + this.elementType)||'undefined';}else
{return this.elementType||'undefined';}};

Ida.PageR=function(parent, aIdNr, label, aPageType, mustBeVisited, testIsMandatory, dependsOn, maxScore)
{this.pageType=aPageType||"undefined";this.dependsOn=dependsOn||'';this.mustBeVisited=!!mustBeVisited;this.testIsMandatory=!!testIsMandatory;this.maxScore=maxScore||0;this.isLogin=aPageType=="login";this.maxPageElementID=0;this.dLayer=null;this.visited=false;this.testSuccessful=false;if(parent!==false)
{this.init(parent, aIdNr, label);}if(this.pageType=="menu"&&!this.course.mainMenu)
{this.course.mainMenu=this.getTargetString(true);}};Ida.PageR.prototype=new Ida.CourseElementR('page');Ida.PageR.prototype.getPageCountToHere=function(chapt){var count=this.getIndex("page")+1;var par=this.parent;while(par){if(par==chapt)
return count;var prev=par.previousElement;while(prev){count +=prev.canHaveChildren?prev.getChildCount(true,"page"):1;prev=prev.previousElement;}par=par.parent;}return count;};Ida.PageR.prototype.getIconType=function()
{return(this.elementType||'undefined')+(this.pageType||'undefined');};Ida.PageR.prototype.show=function()
{var op=Ida.course.selectedCourseElement;if(op&&op!=this)
{ev=new Ida.Event("LeavePage", this);ev.oldPage=op;ev.newPage=this;ev.dispatch();if(op.freeMemory)
{op.freeMemory();}}Ida.course.selectedCourseElement=this.course.selectedCourseElement=this;new Ida.Event("PageSelected",this).dispatch();this.loadPageFile();};Ida.PageR.prototype.freeMemory=function()
{Ida.DLayer.destroy();this.dLayer=null;};Ida.PageR.prototype.loadPageFile=function()
{var me=this;Ida.include(this.getFile(),function(){me.loadContentFile();});};Ida.PageR.prototype.loadContentFile=function()
{if(this.dynPage)
{var isSCE=Ida.course.selectedCourseElement===this;if(isSCE)
{this.variables=this.dynPage();}this.dynPage=null;if(isSCE)
{var me=this;Ida.include(this.getContentFile(),function(){me.loaded();});}}else
{Ida.handleError('ERR_LOADING_PAGE_FAILED', 'loadPageFile', this.id);}};Ida.PageR.prototype.loaded=function()
{if(this.dynContent)
{var isSCE=Ida.course.selectedCourseElement===this;if(isSCE)
{this.dynContent();}var ok=true;}this.dynContent=null;if(isSCE)
{if(this.dLayer)
{p=document.getElementById("idapage");while(p.firstChild)
{p.removeChild(p.firstChild);}if(!this.dLayer.template.get("width"))
{this.dLayer.template.style.width=this.course.width;}if(!this.dLayer.template.get("height"))
{this.dLayer.template.style.height=this.course.height;}this.dLayer.create();}if(!ok)
{Ida.handleError('ERR_LOADING_PAGE_FAILED', 'loadContentFile', this.id);}}};Ida.PageR.prototype.getPageIndex=function()
{var count=0;var c=this.parent.children;for(var i=0;i<c.length;i++)
{if(c[i]==this)
{return count;}if(c[i].elementType=="page")
{count++;}}return null;};Ida.PageR.prototype.overlayTemplate=function()
{var lName, lElm;var lOverlay=this.pageOverlay;for(var i in lOverlay.template)
{lCurElm=lOverlay.template[i];lElm=(i=="_SELF")?this.dLayer.template:this.dLayer.template.getChildById(i);if(lElm)
{for(var prop in lCurElm)
{lElm.set(prop,lCurElm[prop]);}}}if(this.templOverlay&&typeof this.templOverlay=="string")
{var lTemplOverlay=new Function(this.templOverlay);lTemplOverlay();}};Ida.PageR.prototype.isPageLoadSettingOK=function(prop)
{return !this.isVisited()||!this.getPageLoadSetting(prop);};Ida.PageR.prototype.getPageLoadSetting=function(prop)
{var val=this.dLayer.get(prop);if(typeof val=="undefined"||val==""){val=Ida.f.getFormatedProperty(this.course.getProperty(prop));}return val;};Ida.PageOverlay=function()
{this.page={};this.template={};};Ida.PageOverlay.prototype=
{set : function set(aContainer,aObjName,aProp,aContent)
{if(typeof this[aContainer][aObjName]=="undefined") this[aContainer][aObjName]=new Object();this[aContainer][aObjName][aProp]=aContent;}, get : function(aContainer,aObjName,aProp)
{return this[aContainer][aObjName][aProp]||"";}};Ida.PageContentR=function()
{this.page={};this.template={};};Ida.PageContentR.prototype=
{toString : function()
{return "[object Ida.PageContentR]";}, set : function set(aContainer,id,aProp,aContent)
{if(this[aContainer][id]===undefined)
{this[aContainer][id]={};}this[aContainer][id][aProp]=aContent;}, get : function get(aContainer,id,aProp)
{return this[aContainer][id]!==undefined?this[aContainer][id][aProp]||"":"";}};

Ida.SpecialPageR=function(parent, idNr, label, aPageType, mustBeVisited, testIsMandatory, dependsOn)
{this.pageType=aPageType||"undefined";this.dependsOn=dependsOn||'';this.mustBeVisited=!!mustBeVisited;this.testIsMandatory=!!testIsMandatory;this.elementType='specialpage';this.init(parent, idNr, label);};Ida.SpecialPageR.prototype=new Ida.PageR(false);

Ida.CourseR=function(fileName, label)
{this.books=[];this.special=[];this.pageDir=null;this.contentDir=null;this.mediaDir=null;this.documentDir=null;this.pictureDir=null;this.systemDir=null;this.templateSetDir=null;this.glossary=new Ida.Glossary(this);this.file=fileName||'';this.courseName=this.file;this.elementLabels=[];this.childrenList=[];this.label=label;this.elementType='course';this.loaded=false;};Ida.CourseR.prototype=
{idNr : 0
, appendChild : function(child)
{if(child&&typeof child=='object')
{switch(true)
{case child instanceof Ida.BookR:
this.books.push(child);this.childrenList.push(child);break;case child instanceof Ida.SpecialPageR:
this.special.push(child);break;}}}, isVisual : function()
{return false;}, isVisited : function()
{for(var i=0;i<this.books.length;++i)
{if(!this.books[i].isVisited())
{return false;}}return true;}, isDone : function isDone(ignoreElm)
{if(ignoreElm!=this)
{for(var i=0;i<this.children.length;++i)
{if(!this.children[i].isDone(ignoreElm))
{return false;}}}return true;},getPercentComplete : function()
{var t=0,d=0;for(var i=0;i<this.children.length;++i)
{var r=this.children[i].getChildInfo(true,"page");t +=r.total;d +=r.done;}return 100/t*d;}, getElementLabel : function(cElm)
{if(!cElm||typeof cElm!='object')
{throw new Ida.IdaError('ERR_MISSING_ARGUMENT', null ,'cElm');}return this.elementLabels[cElm.idNr||0]||'';}, getCurrentCourseElement : function()
{if(this.selectedCourseElement&&!this.selectedCourseElement.deleted)
{return this.selectedCourseElement;}else
{return this;}}, getFirstPage : function()
{if(!this.books[0])
{return null;}var lPos=0;while(lPos<this.childrenList.length)
{if(this.childrenList[lPos].elementType=="page")
{return this.childrenList[lPos];}lPos++;}return this.books[0];}, getLastPage : function()
{return this.getLastCourseElement("page");}, getLastChapter : function()
{return this.getLastCourseElement("chapter");}, getLastCourseElement : function(type)
{if(!this.books[0])
{return null;}var lPos=this.childrenList.length;if(!type)
{return this.childrenList[lPos-1];}while(--lPos>0)
{if(this.childrenList[lPos].elementType==type)
{return this.childrenList[lPos];}}return this.books[0];}, getNextPage : function()
{var e=this.getCurrentCourseElement();if(e&&e.dLayer)
{var nextElmID=e.dLayer.get("nextPage");if(nextElmID)
{if(nextElmID.indexOf(" book ")>0)
{return nextElmID;}var nextPage=this.getCourseElementById(nextElmID);}if(nextPage)
{if(nextPage.elementType=="page")
{return nextPage;}else
{nextPage=nextPage.getFirstPage();if(nextPage)
{return nextPage;}}}if(this.selectedCourseElement.nextElement&&this.selectedCourseElement.nextElement.elementType=="page")
{return this.selectedCourseElement.nextElement;}var lPos=this.getElementIndex(this.selectedCourseElement);while(++lPos<this.childrenList.length)
{if(this.childrenList[lPos].elementType=="page")
{return this.childrenList[lPos];}}}return this.getMenu()||this.books[0];}, getPreviousPage : function()
{var e=this.getCurrentCourseElement();if(e&&e.dLayer)
{var previousElmID=e.dLayer.get("previousPage");if(previousElmID)
{if(previousElmID.indexOf(" book ")>0)
{return nextElmID;}var previousPage=this.getCourseElementById(previousElmID);}if(previousPage&&previousPage.elementType=="page")
{return previousPage;}if(this.selectedCourseElement.previousElement&&this.selectedCourseElement.previousElement.elementType=="page")
{return this.selectedCourseElement.previousElement;}var lPos=this.getElementIndex(this.selectedCourseElement);while(--lPos>=0)
{if(this.childrenList[lPos].elementType=="page")
{return this.childrenList[lPos];}}}return this.books[0];}, getMenu : function()
{var elm=this.getCurrentCourseElement();var menu=null;if(elm)
{menu=elm.findPageByType("menu");}if(!menu)
{if(this.mainMenu)
{menu=this.mainMenu;}else if(this.books[0])
{menu=this.books[0].children[this.books[0].children.length-1].findPageByType("menu");}}return menu;}, findPageByType : function(){return null;}, setProperty : function(name, val, scope, overwrite)
{if(!scope) scope="script";if(scope!="course"&&this!=Ida.course)
{return Ida.course.setProperty(name,val,scope);}if(!this[scope]) this[scope]={};if(this[scope][name]==undefined||scope=="course"||overwrite)
{this[scope][name]=val;}}, getProperty : function(name, scope)
{if(!scope) scope="script";if(scope!="course"&&this!=Ida.course)
{return Ida.course.getProperty(name,scope);}var res=this[scope]&&this[scope][name];return res===undefined?null:res;}, setContent : function(name, val, type)
{if(!type) type="global";else if(type!="course"&&this!=Ida.course){return Ida.course.setContent(name,val,type);}if(!this.content) this.content={};if(!this.content[type]) this.content[type]={};if(this.content[type][name]==undefined||type=="course")
this.content[type][name]=val;}, getContent : function(name,type)
{if(!type) type="global";else if(type!="course"&&this!=Ida.course)
return Ida.course.getContent(name,type);var res=this.content&&this.content[type]&&this.content[type][name];return res===undefined?null:res;}, getMessage : function(name)
{return this.getContent(name, "msg");}, getElementIndex : function(elm)
{return Array.indexOf(this.childrenList,elm);}, getChildrenList : function()
{var list=[].concat(this.books);for(var i=0;i<this.books.length;i++)
{list=list.concat(this.books[i].getChildrenList());}return list;}, getCourseElementById : function(id)
{if(this.activeCourse)
{var c=this.books[this.activeCourse];}if(!c)
{c=this;}if(id=='course_id_0'||id==this.id)
{return c;}else
{function findChild(children)
{for(var i=0;children&&i<children.length;++i)
{if(children[i].id==id||children[i].idNr==id)
{return children[i];}else if(children[i].children)
{var res=findChild(children[i].children);if(res)
{return res;}}}return null;}return findChild(c.children);}}, getIndex : function(){return 0;}, getIconType : function()
{return this.elementType;}, loadVariables : function()
{var me=this;Ida.include(this.getVarFile(),function(){me.appendVariables();});}, appendVariables : function()
{if(this.dynVars)
{this.variables=this.dynVars();this.dynVars=null;for(var i in this.variables)
{if(Ida.variables[i]==undefined)
{Ida.variables[i]=this.variables[i];}}}}, getVarFile : function()
{return this.pageDir + "coursevariables.js";}, getFullURL : function(url){if(url&&url.indexOf("://")>-1)
return url;url=escape(url);if(url.indexOf("SET")==0)
{url=url.replace("SET\\","").replace("SET/","");url=this.templateSetDir + url;return url;}return Ida.f.isURL(url)?url:this.systemDir + url;}};

Ida.Glossary=function(course){this.entries={};};Ida.Glossary.prototype={toString : function(){return "[object Glossary]";},
get : function(aEntry)
{return this.entries[aEntry]||"";},
set : function(aEntry,aVal)
{this.entries[aEntry]=aVal;},
getEntryList : function()
{var list=new Array();for(var i in this.entries)
{list[list.length]=i;}return Array.alphaSort(list);},
hasEntries : function(){for(var i in this.entries)
return true;return false;}};

Ida.PropertyList=function(aNode, sepIdref)
{this.IdaProperties={};if(aNode)
{if(aNode.ownerDocument)
{var lNode, lTmp;this.propertyListName=aNode.nodeName;for(var i=0;i<aNode.childNodes.length;i++)
{lNode=aNode.childNodes[i];if(lNode.nodeName.toLowerCase().isInList("property,flag,content,event,method"))
{lTmp=new Ida.Property(lNode);if(sepIdref&&lTmp.idref)
{lTmp.name +='\n' + lTmp.idref;}this[lTmp.name]=lTmp;this.IdaProperties[lTmp.name]=lTmp;}}}else if(typeof(aNode)=="string") this.propertyListName=aNode;}};Ida.PropertyList.prototype.addProperty=function(aProperty, aNode, saveOldValue)
{if(!this[aProperty])
{var type=typeof(aNode);if(type=="string"||type=="undefined")
{aNode={defaultvalue : "",value:aNode};}this[aProperty]=new Ida.Property(aNode);this.IdaProperties[aProperty]=this[aProperty];}else
{if(aNode instanceof Ida.Property)
{for(var i in aNode.IdaPropertyValues)
{this[aProperty].set(aNode.IdaPropertyValues[i],i);}}else
{if(aNode.ownerDocument)
{aNode=new Ida.Property(aNode);}if(saveOldValue)
{var pdef=this[aProperty].get('defaultvalue');if(pdef!==undefined)
{this[aProperty].set(pdef, 'parentDefaultvalue');}}for(var i in aNode)
{this[aProperty].set(aNode[i],i);}}}if(!this[aProperty].name)
{this[aProperty].name=aProperty;}return this[aProperty];};Ida.PropertyList.prototype.addPropertyList=function(aNode){if(aNode.ownerDocument){aNode=new Ida.PropertyList(aNode);}if(aNode instanceof Ida.PropertyList){for(var i in aNode.IdaProperties)
this.addProperty(i,aNode.IdaProperties[i]);}if(!this.propertyListName&&aNode.propertyListName) this.propertyListName=aNode.propertyListName;};Ida.PropertyList.prototype.setProperty=function(aProperty,aValue){if(!this[aProperty]) this.addProperty(aProperty,aValue)
else{if(aValue instanceof Ida.Property){for(var i in aValue){this[aProperty].set(aValue[i],i);}}else this[aProperty].set(aValue);if(!this[aProperty].name) this[aProperty].name=aProperty;}};

Ida.templates=
{constructors:{}, globalExtensions: [] // Array[File]. List of additional extensions to include
, content:{}, createObject : function(objName)
{if(!this.getObjectConstructor)
{throw new Ida.IdaError('this!=Ida.templates')
}var f=this.getObjectConstructor(objName);if(f)
{var o=f();if(o)
{var c=this.getObjectContent(objName);this.addInstanceContent(o, c);}return o;}return alert('MISSING CONSTRUCTOR FOR: '+ objName);}, getObjectConstructor : function(objName)
{return(this.constructors[objName]||{}).construct||null;}, getObjectContent : function(objName)
{return(this.constructors[objName]||{}).content||null;}, addInstanceContent : function(instance, cont)
{if(!cont)
{return instance;}for(var i in cont)
{var elm=(i=="_SELF")?instance:instance.getChildById(i);if(elm)
{if(elm.objectType=="Choice")
{elm.children[1].content["text"]=cont[i]["text"];}else
{for(var x in cont[i])
{if(elm.content[x]!==undefined)
{elm.content[x]=cont[i][x];}}}}}return instance;}};

Ida.NavigationObject=function(name)
{this.name=name||null;this.enabled=true;};Ida.NavigationObject.prototype=
{setEnabled : function(aEnabled)
{this.enabled=aEnabled;var dLayer=this.getDLayer();if(dLayer&&dLayer.created&&dLayer.exists)
{dLayer.setA("disabled",!aEnabled);}},
getDLayer : function(){var allNav=Ida.navigation.getNavigationObjects();if(allNav.length){var nav, obj;var objName="Navigation" + this.name.toLowerCase().upperCaseCharAt(0);for(var i=0;i<allNav.length;i++){nav=allNav[i];if(!nav||!nav.children||nav.children.length==0) continue;obj=nav.getChildById(objName);if(obj) return obj;}}return null;}};Ida.navigation={returnPage : null,
_returnPage : null,
pageList : null,
pageListPos : 0,
onPageLoaded : function(e)
{for(var elm in this.navigationObjects)
{if(!this.navigationObjects[elm].enabled)
{this.navigationObjects[elm].setEnabled(false);}}var course=e.courseElement.course;if(!this.firstPage||this.firstPage.course!=course)
this.firstPage=course.getFirstPage();if(!this.lastPage||this.lastPage.course!=course)
this.lastPage=course.getLastPage();if(e.courseElement==this.firstPage&&!this.pageList&&!this.firstPage.getProperty("previousPage"))
{this.navigationObjects["previous"].setEnabled(false);}if(e.courseElement==this.lastPage&&!this.pageList&&!this.lastPage.getProperty("nextPage"))
{this.navigationObjects["next"].setEnabled(false);}},
onCourseChanged : function(){this.firstPage=null;this.lastPage=null;},
onPageUnload : function(){for(var elm in this.navigationObjects)
this.navigationObjects[elm].enabled=true;},
navigationObjects :{},
addObjects : function(){for(var i=0;i<arguments.length;i++){if(!this[arguments[i]]){this[arguments[i]]=new Ida.NavigationObject(arguments[i]);this.navigationObjects[arguments[i]]=this[arguments[i]];}}},
isNavigationObject : function(aObj){if(!aObj||!aObj.isDLayer) return false;while(aObj.parent){if(aObj.objectType=="Navigation") return true;aObj=aObj.parent;}return false;},
goNextPage : function(aTarget)
{if(!this.next.enabled)
{return false;}var isOK=new Ida.Event("GoNextPage",this).dispatch();if(isOK)
{var lNextPage=this.getExceptionalPage(1)||Ida.getActiveCourse().getNextPage();if(lNextPage)
{return this.goToPage(lNextPage);}}return false;},
goPreviousPage : function(aTarget)
{if(!this.previous.enabled)
{return false;}var isOK=new Ida.Event("GoPreviousPage",this).dispatch();if(isOK)
{var lPreviousElement=this.getExceptionalPage(-1)||Ida.getActiveCourse().getPreviousPage();if(lPreviousElement)
{return this.goToPage(lPreviousElement);}}return false;},
getExceptionalPage : function(dir)
{var page=null;if(this.pageList&&this.pageList.length)
{this.pageListPos +=dir;page=this.pageList[this.pageListPos];if(page==Ida.getPage().getTargetString())
{this.pageListPos +=dir;page=this.pageList[this.pageListPos];}if(!page)
{page=this.returnPage;this.returnPage=null;this.pageList=null;}}return page;},
goChapterStart : function()
{this.goToPage(Ida.getPage().parent.children[0]);},
goChapterEnd : function()
{var c=Ida.getPage().parent.children;this.goToPage(c[c.length-1]);},
exit : function(aTarget)
{if(!this.quit.enabled)
{return false;}var isOK=new Ida.Event("Exit",this).dispatch();if(isOK)
{top.close();}return true;},
goMenu : function(aTarget){if(!this.menu.enabled) return false;var isOK=new Ida.Event("GoMenu",this).dispatch();if(isOK){if(Ida.Scorm){var handleMenu=Ida.course.getProperty('lmsHandleMenu');if(handleMenu=="ignore")
return false;else if(handleMenu=="finish")
return this.exit();}var lMenu=Ida.course.getMenu();if(lMenu) return this.goToPage(lMenu);}return false;},
showOverview : function(inSidebar)
{if(this.overview.enabled)
{if(new Ida.Event("ShowOverview",this).dispatch())
{if(typeof inSidebar=="undefined")
{inSidebar=Ida.course.getProperty("showOverviewInSidebar")=="true";}var url=Ida.directory.getRelativeURL(Ida.directory.templateSetHtmlDir + "overview.html");url +="?sidebar=" + String(!!inSidebar);if(inSidebar)
{if(Ida.Sidebar.visible)
{Ida.Sidebar.hide();}else
{Ida.Sidebar.show(url,Ida.course.getContent("overviewTitle"));}}else
{var win=new Ida.Window();win.url=url;win.name="overview";win.scrollbars="yes";win.status="no";win.width=800;win.height=600;win.show();}return true;}else
{Ida.reportError('Ida.Event("ShowOverview") failed');}}return false;},
showGlossary : function(entry, inSidebar)
{if(this.glossary.enabled)
{if(new Ida.Event("ShowGlossary",this).dispatch())
{var url=Ida.directory.getRelativeURL(Ida.directory.templateSetHtmlDir + "glossary.html");if(inSidebar)
{return Ida.Sidebar.show(url,Ida.course.getContent("glossaryTitle"));}else
{var lGlossary=new Ida.Window();lGlossary.url=url;if(entry&&typeof entry!="object")
{lGlossary.url +="?" + escape(entry);}lGlossary.name="glossary";lGlossary.scrollbars="yes";lGlossary.status="no";lGlossary.width=620;lGlossary.height=460;lGlossary.show();return true;}}}return false;},
showHelp : function(aTarget){if(!this.help.enabled) return false;var isOK=new Ida.Event("ShowHelp",this).dispatch();if(isOK){var lHelp=new Ida.Window();lHelp.url=Ida.directory.getRelativeURL(Ida.directory.templateSetHtmlDir + "help.html");lHelp.name="help";lHelp.scrollbars="yes";lHelp.status="no";lHelp.width=800;lHelp.height=600;lHelp.show();return true;}return false;},
print : function(target){var pObj=Ida.getPageObject();if(target){var frame=Ida.getObjectById(target);if(frame&&frame.getWindow){var win=frame.getWindow();var state=frame.get("visibility");if(state=="hidden"){frame.elm.style.top="-100px";frame.elm.style.height="10px";frame.elm.style.visibility="visible";}win.focus();}}else
win=Ida.f.getWindow(pObj.elm);win.print();},
goTo : function(aTo){var ret;switch(aTo.toLowerCase()){case "next":
case "nextpage":
ret=this.goNextPage();break;case "previous":
case "previouspage":
ret=this.goPreviousPage();break;case "menu":
ret=this.goMenu();break;case "glossary":
ret=this.showGlossary();break;case "overview":
ret=this.showOverview();break;case "help":
ret=this.showHelp();break;case "usernote":
ret=this.showUserNote();break;default:
ret=false;}return ret;},
goToBook : function(book,page)
{this.open(book, page);return true;},
goToPage : function(aPage, book)
{var type=typeof aPage;if(!book&&type=="string")
{var pArr=aPage.split(/\s/);if(pArr[1]=="book")
{book=aPage.replace(/'|"|.* book /g,"");aPage=pArr[0];}}if(book&&book!=(Ida.course.activeCourse||Ida.course.courseName))
{return this.goToBook(book, aPage);}switch(true)
{case aPage instanceof Ida.CourseElementR:
var ce=aPage;break;case type=="string"||type=="number":
ce=Ida.course.getCourseElementById(aPage);break;}if(ce)
{var nextP=ce.canHaveChildren?ce.getFirstPage():ce;if(Ida.loggedIn&&nextP.isLogin)
{Ida.msgBox("",Ida.course.getMessage("hintPageLogin"));}else if(nextP&&Ida.getPage()!=nextP)
{if(nextP.canGoTo())
{nextP.selectElement();return true;}else
{Ida.msgBox("",Ida.course.getMessage("hintPageDependency"));}}}return false;},
goToPages : function(pages)
{this.pageList=pages.split(",");this.pageListPos=0;this.returnPage=Ida.getPage().getTargetString(true);this.goToPage(this.pageList[0]);},
getNavigationObjects : function(){var page=Ida.getPageObject();if(!page||!page.template) return [];var nav=page.template.getChildrenByObjectType("Navigation");if(nav.length==0)
nav=page.getChildrenByObjectType("Navigation");return nav;}, load : function(aFile,ref)
{this.open(aFile, null, true, ref);}, open : function(fileURL, pageId, loadOnly, ref)
{if(Ida.course)
{new Ida.Event("CourseUnload",this).dispatch();}if(!fileURL)
{var m=window.location.href.match(/\/([^\/]*)\/[^\/]*$/);if(m&&m[1])
{fileURL=m[1].replace(/_wbt$/,"");}}if(!Ida.course)
{Ida.course=new Ida.CourseR(fileURL);}var c=Ida.course.books[fileURL];if(!c)
{if(!Ida.course.lms)
{var path='../' + fileURL + '_wbt/';}else
{path=Ida.course.lms.books[fileURL]||'';}var pd=path + Ida.directory.pageDir;var firstNewChild=Ida.course.children.length;Ida.include
(
pd + 'idacourse_' + Ida.language.currentLanguage + '.js'
, function()
{c=Ida.course.books[fileURL];if(c)
{c.systemDir=path;c.pageDir=pd;c.contentDir=path + Ida.directory.getContentDir();c.mediaDir=path + Ida.directory.mediaDir;c.documentDir=path + Ida.directory.documentDir;c.pictureDir=path + Ida.directory.pictureDir;c.templateSetDir=path + Ida.directory.templateSetDir;var old=Ida.course.activeCourse;Ida.course.activeCourse=fileURL;Ida.include
(
pd + 'coursedata.js'
, function()
{Ida.include
(
pd + 'content_' + Ida.language.currentLanguage + '/coursedata_' + Ida.language.currentLanguage + '.js'
, function()
{Ida.include
(
pd + 'content_' + Ida.language.currentLanguage + '/glossary_' + Ida.language.currentLanguage + '.js'
, function()
{if(loadOnly==true)
{if(ref&&ref.onBookLoaded)
{ref.onBookLoaded(fileURL)
}}else
{Ida.include
(
c.getVarFile()
, function()
{c.appendVariables();if(ref&&ref.onBookLoaded)
{ref.onBookLoaded(fileURL)
}if(pageId)
{var page=Ida.course.getCourseElementById(pageId);}else
{if(!Ida.course.children[firstNewChild])
{firstNewChild=0;}page=Ida.course.children[firstNewChild].getFirstPage();}Ida.navigation.goToPage(page||Ida.course.selectedCourseElement);});}});});});}else
{throw new Ida.IdaError('ERR_COURSE_OBJECT_NOT_FOUND', 'Ida.navigation.open', fileURL, fileURL);}});}else
{new Ida.Event('LoadComplete',Ida).dispatch();if(!loadOnly)
{if(pageId)
{var old=Ida.course.activeCourse;Ida.course.activeCourse=fileURL;var page=Ida.course.getCourseElementById(pageId);}else
{Ida.course.activeCourse=fileURL;page=c.getFirstPage();}Ida.navigation.goToPage(page||Ida.course.selectedCourseElement);}}return fileURL;}};Ida.Event.register(Ida.navigation);Ida.navigation.addObjects("next","previous","menu","overview","glossary","help","quit","print");

Ida.qObj={register : function(dLayer){this._register(dLayer,"Questionobject");},
registerDnD : function(dLayer){this._register(dLayer,"DragNDropObject")
},
_register : function(dLayer,objName){var obj=this.getQuestionObject(objName);obj.register(dLayer);dLayer.questionObject=obj;},
getQuestionObject : function(objName){return Ida.getObjectsByObjectName(objName||"Questionobject")[0];},
getAllQuestionObjects : function(){return Ida.getObjectsByObjectType("Questionobject");},
checkUsage : function(){var obj=this.getAllQuestionObjects();var maxScore=0;for(var i=0;i<obj.length;i++){if(obj[i]){if(obj[i].getRegisteredObjects().length==0){obj[i].remove();continue;}maxScore +=obj[i].get("evl_maxScore")||0;}}var page=Ida.getPage();if(maxScore!=page.getMaxScore())
page.setMaxScore(maxScore);return obj;},
unregister : function(dLayer){var obj=dLayer.questionObject;if(obj&&obj.exists)
obj.unregister(dLayer);this.checkUsage();}};

Ida.test={};Ida.Event.register(Ida.test);Ida.test.registeredObjects=[];Ida.test.initialize=function(){for(var i=0;i<this.registeredObjects.length;i++){if(this.registeredObjects[i])
this.registeredObjects[i].destroy();}this.registeredObjects=[];this.navigationEnabled=true;this.questionobject=null;this.pageLoaded=false;};Ida.test.initialize();Ida.test.evaluateTest=function(param){if(this.questionobject&&typeof this.questionobject.ok!="undefined")
this.questionobject.ok(param);};Ida.test.onLeavePage=function(e){if(!Ida.isAuthor())
this.checkPageVisited(e.oldPage);this.initialize();};Ida.test.checkPageVisited=function(page){if(!page) page=Ida.getPage();var visited=page.isVisited();if(page.autoSetVisited&&!visited&&this.isCorrect()){page.setVisited(true);return true;}return visited;};Ida.test.onBeforePageShown=function(e){this.pageLoaded=true;if(this.registeredObjects.length>0)
this.checkNavigation();var page=Ida.getPage();};Ida.test.register=function(aObj){var obj=this.getTestObject(aObj);if(!obj){this.registeredObjects[this.registeredObjects.length]=new Ida.testObject(aObj);}if(this.pageLoaded)
this.checkNavigation();};Ida.test.unregister=function(aObj){var regObj=this.registeredObjects;for(var i=0;i<regObj.length;i++){if(regObj[i]&&regObj[i].objRef==aObj){this.registeredObjects[i].destroy();delete this.registeredObjects[i];return true;}}return false;};Ida.test.checkNavigation=function()
{var isCompl=this.isCorrect();if(!isCompl)
{var p=Ida.getPage();if(p&&p.isPageLoadSettingOK&&!p.isPageLoadSettingOK("forceInteractionsOnce"))
{var _complete=true;var regObj=this.registeredObjects;for(var i=0;i<regObj.length;i++)
{if(regObj[i]&&regObj[i].forceInteraction&&!regObj[i].complete)
{_complete=false;i=regObj.length;}}isCompl=_complete;}}if(!isCompl)
{this.disableNavigation();}else
{this.enableNavigation();}return this.navigationEnabled;};Ida.test.disableNavigation=function()
{this.navigationEnabled=false;Ida.navigation.next.setEnabled(false);};Ida.test.enableNavigation=function(){this.navigationEnabled=true;Ida.navigation.next.setEnabled(true);};Ida.test.markAsComplete=function(aObj,aIsCorrect,activate){var obj=this.getTestObject(aObj);if(!obj) return;obj.complete=(typeof aIsCorrect=="boolean")?aIsCorrect:true;if(activate!==false)
this.checkNavigation();};Ida.test.finalize=function(){this.enableNavigation();};Ida.test.isCorrect=function(){var regObj=this.registeredObjects;if(regObj.length==0) return true;var qObjComplete=false;var altDone=false;var alt=0;var r;var groupedAlt=new Ida.testAlternatives();for(var i=0;i<regObj.length;i++){r=regObj[i];if(!r) continue
if(r.must()=="yes"){if(!r.complete)
return false;}else if(r.must()=="yesOrAlternative"){alt++;if(r.objRef.isDLayer&&!r.objRef.isPage&&!r.objRef.parent.isPage){groupedAlt.register(r);}else if(r.complete){altDone=true;}}}return(altDone||alt==0||groupedAlt.isCorrect());};Ida.test.getNoneExecutedObjects=function(){};Ida.testAlternatives=function(){this.objects=[];this.groups=[];};Ida.testAlternatives.prototype.register=function(obj){Array.registerElement(this.objects,obj);Array.registerElement(this.groups,obj.objRef.parent);};Ida.testAlternatives.prototype.isCorrect=function(){for(var i=0;i<this.groups.length;i++){this.groups[i].alt=0;this.groups[i].correct=0;}var pos;for(i=0;i<this.objects.length;i++){var pos=Array.indexOf(this.groups,this.objects[i].objRef.parent);this.groups[pos].alt++;if(this.objects[i].complete)
this.groups[pos].correct++;}for(i=0;i<this.groups.length;i++){if(this.groups[i].alt==this.groups[i].correct)
return true;}return false;};Ida.test.getTestObject=function(aObj){var regObj=this.registeredObjects;for(var i=0;i<regObj.length;i++){if(regObj[i]&&regObj[i].objRef==aObj){return regObj[i];}}return null;};Ida.testObject=function(aObj)
{this.complete=false;this.objRef=aObj;this.forceInteraction=!!aObj.forceInteraction;};Ida.testObject.prototype.must=function(){return this.objRef.mustBeExecuted||"yes";};Ida.testObject.prototype.destroy=function(){delete this.objRef;};

Ida.Session=function(type,course,user,url)
{this.showError=false;this.type=type||1;this.course=course;this.user=user;if(url&&typeof url=="string")
{this.url=url +((url.charAt(url.length-1)!="/")?"/":"") + "core/idasave.php";}else
{this.url="core/idasave.php";}this.localPath=url||"";this.currentPage=null;this.language=null;this.pageLists={};this._loadedPageLists={};this.params={};this.autologin=false;};Ida.Session.prototype={setParameter : function(prop,val){this.params[prop]=val;},
getParameter : function(prop,defaultVal){var val=this.params[prop];if(typeof val=="undefined")
val=typeof defaultVal!="undefined"?defaultVal:null;return val;},
add : function(pl, obj)
{if(obj.isVisited())
{pl.push(obj.idNr);}else
{for(var i=0;obj.children&&i<obj.children.length;++i)
{this.add(pl, obj.children[i]);}}},
createPageLists : function()
{for(var i in Ida.course.books)
{var c=Ida.course.books[i];if(c instanceof(Ida.Course||Ida.CourseR))
{this.add((this.pageLists[i]=[]), Ida.course.books[i]);}}},
setVisited : function()
{if(!this.course||!this.pageLists)
{return;}for(var i in this.pageLists)
{var list=this.pageLists[i];var c=Ida.course.books[i];if(c)
{if(list[0]==0){for(var b=0;b<c.books.length;b++)
c.books[b].setVisited(true);}else{var aE=c.getChildrenList();var iL={};for(var x=0;x<aE.length;x++)
{iL[aE[x].idNr]=aE[x];}for(x=0;x<list.length;x++)
{var e=iL[list[x]];if(e)
{e.setVisited(true);}}}}}},
compress : function(list){if(!list.length) return '';function numSort(a, b){return a<b?-1:a==b ? 0 : 1;}list.sort(numSort);function append(result, start, end){if(start==end) result[result.length]=start;else result[result.length]=start+'-'+end;return result;}var result=[];var start=list[0];var end=list[0];for(var i=1;i<list.length;i++){if(list[i]-end==1){end++;}else{append(result, start, end);start=list[i];end=start;}}append(result, start, end);return result;},
decompress : function(list)
{return String(list).getNumberList();},
load : function(val)
{this.currentBook=this.course;if(!Ida.isRuntime()) return Ida.navigation.goNextPage();this.found=false;if(!val)
{var sT=this.type;var key=this.getKey();var isCBT=Ida.isStandalone();if(sT==5&&Ida.lms)
{val=Ida.lms.getLearningProgress(key);}else if(sT==1||sT==5&&!isCBT)
{val=Ida.f.getCookie(key);this.type=1;}else if(isCBT&&(sT==4||sT==1))
{val=IdaStandalone.getLearningProgress(key);}else if(this.url&&(sT==2||sT==3))
{key="c=" + escape(String(this.course.label)) + "&" + // the courseid
"fn=" + escape(String(this.user.firstName)) + "&" + // user's first name
"ln=" + escape(String(this.user.lastName)) + "&" + // user's last name
"pw=" + escape(String(this.user.password)) + "&" + // user's password
"path=" + escape(String(this.getApplicationPath())) + "&" +
"a=get" // action(set)
var doc=new Ida.Doc(this.url + "?" + key,true,true);var me=this;doc.onLoad=function()
{var txt=this.text.replace(/\\(['"])/g,"$1");me.checkLoadResult(txt);};doc.onError=function()
{(Ida.alert||self.alert)("Error getting learning progress from server. Learning progress cannot be loaded.\n" +
"Error: " + this.status + " " +(this.statusText||""));me.checkLoadResult();};doc.load();return true;}}this.checkLoadResult(val);return true;},
getApplicationPath : function(){var href=location.href.substring(0,location.href.length-location.search.length);var pos=href.lastIndexOf("/");if(pos>=0)
href=href.substring(0,pos+1);return href;},
checkLoadResult : function(val){if(val&&val!="undefined"){this.found=true;var props=Ida.f.stringToObject(val,"~",":");if(props["pl"]){this.currentPage=props["cp"];this.language=props["l"];var pageLists=props["pl"].split("[");var b, pl, pos, pos2, pl, book;for(var i=1;i<pageLists.length;i++){b=pageLists[i];pos=b.indexOf("bk(");pos2=b.indexOf(")");book=b.substring(pos+3,pos2);pos=b.indexOf("pl(");pos2=b.indexOf(")",pos);pl=b.substring(pos+3,pos2);if(!pl){if(this.showError){var msg="Beim laden des Lernstandes ist ein fehlender Eintrag in Buch '" + book +
"' gefunden wurden.\nDer Fehler wird nun korrigiert.\n\nBitte melden " +
"Sie diesen Fehler sofort Ihrem Schulungsteam zusammen mit dem Fehlertext.\n\nFehlertext:\n" +
"pageList: " + pageLists[i] + "\n" +
"loadedString: " + String(val).replace(/\[bk/g,"\n[bk");(Ida.alert||self.alert)(msg);}pl="1";}this.pageLists[book]=this.decompress(pl);this._loadedPageLists[book]=this.pageLists[book];}var e=new Ida.Event("SessionLoad",this);e.loadString=val;e.dispatch();}}this.loadBooks();},
onBookLoaded : function(){this.loadBooks();},
loadBooks : function(){var l=0;for(var i in this.pageLists){l++;if(!Ida.course.books[i]){Ida.navigation.load(i,this);return;}}if(l>0);this.setVisited();this.onLoad();},
onLoad : function()
{var cp=this.currentPage;if(this.currentBook!=this.course)
{Ida.navigation.load(this.currentBook.file);}var msg=this.course.getMessage("confirmLoadSession")||Ida.getLangString('CONFIRM_LOAD_SESSION');var idaP=Ida.getPage();if(this.found&&cp&&(!idaP||cp!=idaP.idNr)&&confirm(msg))
{Ida.navigation.goToPage(cp);}else if(!this.autologin)
{Ida.navigation.goNextPage();}},
save : function(){var type=this.type;var key=this.getKey();var e=new Ida.Event("SessionSave",this);e.saveString=this.getSaveString();e.additionalSaveStrings=[];e.add=function(str){this.additionalSaveStrings[this.additionalSaveStrings.length]=str;};e.dispatch();var add=e.additionalSaveStrings.length?("~" + e.additionalSaveStrings.join("~")):"";var saveString=e.saveString + add;var isCBT=Ida.isStandalone();if(type==1||(type==4&&isCBT))
{if(type==1&&!isCBT)
{Ida.f.setCookie(key,saveString);}if(type==4||isCBT)
{IdaStandalone.setLearningProgress(key,saveString);}}else if(type==5&&Ida.lms)
Ida.lms.setLearningProgress(this.user,saveString);else if(this.url&&(type==2||type==3))
{var addString="a=set" + "&" + // action(set)
"p=" + saveString + "&" + // the complete progress
"c=" + escape(String(this.course.label)) + "&" + // the courseid
"s=" +(this.course.isDone() ? "2":"1") + "&" + // the current state
"fn=" + escape(String(this.user.firstName)) + "&" + // user's first name
"ln=" + escape(String(this.user.lastName)) + "&" + // user's last name
"pw=" + escape(String(this.user.password)) + "&" + // user's password
"pc=" + this.course.getPercentComplete();var req=new Ida.Doc(this.url + "?" + addString,false,true);req.load();}},
getSaveString : function(){this.currentPage=this.course.getCurrentCourseElement().getTargetString(true);this.createPageLists();var list;var listStr="";for(var i in this.pageLists){list=this.compress(this.pageLists[i]);if(list==""&&this._loadedPageLists[i]){if(this.showError){var msg="Beim zusammenstellen des Lernstandes ist ein Fehler in Buch '" + i +
"' aufgetreten.\nDer Fehler wird nun korrigiert.\n\nBitte melden " +
"Sie diesen Fehler sofort Ihrem Schulungsteam zusammen mit dem Fehlertext.\n\nFehlertext:\n" +
"pageList: " + this.pageLists[i] + "\n" +
"loadedPageList: " + this._loadedPageLists[i];(Ida.alert||self.alert)(msg);}list=this._loadedPageLists[i];}listStr +="[bk(" + i + ")pl(" + list + ")]";}return "cp:"+this.currentPage+"~l:"+this.language+"~pl:"+listStr;},
remove : function(){if(this.type==1)
removeCookie(this.getKey());},
getKey : function(){var u=this.user;var fn=u.firstName?u.firstName.toLowerCase():"";var ln=u.lastName?u.lastName.toLowerCase():"";return fn + ln + u.password;},
encode : function(val){},
decode : function(val){}};

Ida.CourseTarget=function(target)
{this.target=this.book=this.page=null;if(target)
{this.setTarget(target);}};Ida.CourseTarget.prototype=
{setTarget : function(target)
{this.target=target;var pArr=String(target).split(/\s/);if(pArr[1]=="book")
{this.book=target.replace(/'|"|.* book /g,"");}this.page=pArr[0];}, getTarget : function()
{return this.page +(this.book?(" book '" + this.book + "'"):"");}, getCourseElement : function()
{if(!Ida.isRuntime()&&this.book) return null;return Ida.course.getCourseElementById(this.page,this.book);}};

Ida.DMenu=function(menustring,type,target,align,valign,dir){this.menustring=menustring||"";this.type=type||"menu";this.target=target||null;this.align=align||"left";this.valign=valign||"bottom";this.dir=dir||"down";this.minWidth=0;this.width=0;this.container=null;this.dropDownItems=[];this.regID=-1;this.hoverUpdate=true;this.itemClassName="";};Ida.DMenu.prototype={show : function(x,y){if(!this.container)
this.createDropDownItems();var elm=this.target.elm;var style=this.container.style;style.visibility="hidden";style.display="block";if(this.width)
style.width=this.width + "px";else if(this.type=="combobox"&&this.target){var wTarget=this.target.elm.offsetWidth;if(this.container.offsetWidth<wTarget){if(!this.minWidth)
this.minWidth=this.container.offsetWidth;style.width=wTarget + "px";}else if(this.container.offsetWidth>wTarget&&this.minWidth)
style.width=Math.max(this.minWidth,wTarget) + "px";}if(typeof x!="number"){if(this.align=="mouse") x=Ida.mouse.x;else if(this.align=="left") x=Ida.f.getAbsoluteX(elm);else x=Ida.f.getAbsoluteX(elm) + elm.offsetWidth - this.container.offsetWidth;}if(typeof y!="number")
{if(this.valign=="mouse")
{y=Ida.mouse.y;}else
{y=Ida.f.getAbsoluteY(elm);if(this.dir=="up")
{y -=this.container.offsetHeight;}if(this.valign=="bottom")
{y +=elm.offsetHeight;}}}this.x=x;this.y=y;this.target.dispatchEvent({type:"Popupshow",popup:this});style.left=this.x + "px";style.top=this.y + "px";style.display="none";style.display="block";style.visibility="visible";if(this.dropDownItems.length)
{var item;if(this.target)
{if((item=this.getItemByValue(this.target.getValue())))
{item.focus();}}else
{this.dropDownItems[0].focus();}}if(this.target)
{this.regID=Ida.dListener.registerObjectForHideOnClick(this.target,"setDropDownVisible",false);}else
{this.regID=Ida.dListener.registerObjectForHideOnClick(this,"hide");}Ida.keyListener.blockKeyDown=true;},
hide : function(){Ida.keyListener.blockKeyDown=false;if(!this.container) return;this.container.style.display="none";if(this.regID>-1)
Ida.dListener.unregisterObjectForHideOnClick(this.regID);this.regID=-1;},
createDropDownItems : function(items)
{if(this.container)
{t=this.target;this.destroy();this.target=t;}var doc=Ida.getDocument();var elm=doc.createElement("div");var clName="DMenu-" + this.type;elm.className=clName;elm.isMenu=true;(elm.wrappedJSObject||elm).DMenu=this;clName +="-item";clNameDisabled=clName + "-disabled";this.itemClassName=clName;if(items!=null&&items!=undefined)
{if(typeof items!='string')
{items=String(items);}this.menustring=items;}else
{if(this.menustring==null||this.menustring==undefined)
{this.menustring='';}else if(typeof this.menustring!='string')
{this.menustring=String(this.menustring);}}var entries=this.menustring.split("\n");var isDisabled=false;var fontSize=this.target?this.target.get("fontSize"):"";if(!fontSize)
fontSize="inherit";for(var i=0;i<entries.length;i++)
{var val=String(entries[i]);if(val.indexOf("-")==0)
{var item=doc.createElement("hr");item.className="DMenu-" + this.type + "-separator";}else
{item=doc.createElement("a");item=item.wrappedJSObject||item;item.style.fontSize=fontSize;item.href="javascript:void '" + String(this.target&&(this.target.name||this.target.id)||'').escapeUnicode() + '#' + i +"';";isDisabled=val.indexOf("!")==0;if(isDisabled)
{item.className=clName + " " + clNameDisabled;val=entries[i].substring(1);}else
{item.className=clName;item.onclick=this.clickMethod;}item.itemDisabled=isDisabled;item.innerHTML=val==""?"&nbsp;":val;item.val=val;item.highlight=this.highlightMethod;if(this.type=="menu")
{item.onmouseover=this.mouseOverMethod;}item.onfocus=this.focusMethod;item.onblur=this.blurMethod;item.onkeydown=this.keydownMethod;}item.itemNumber=i;this.dropDownItems[i]=item;elm.appendChild(item);}Ida.getPageObject().elm.appendChild(elm);this.container=elm;},
mouseOverMethod : function(e)
{this.focus();},
focusMethod : function()
{if(this.highlight)
{this.highlight(true);}else
{Ida.reportError(Ida.getLangString('ERR_NOT_INITIALIZED', 'this.highlight', 'dmenu.js#focusMethod', this.nodeName + ' ' + this));}},
blurMethod : function()
{if(this.highlight)
{this.highlight(false);}else
{Ida.reportError(Ida.getLangString('ERR_NOT_INITIALIZED', 'this.highlight', 'dmenu.js#blurMethod', this.nodeName + ' ' + this));}},
clickMethod : function(e)
{e=e||window.event;if(this.parentNode)
{if(this.parentNode.DMenu)
{this.parentNode.DMenu.selectItem(this.itemNumber);}else
{Ida.reportError(Ida.getLangString('ERR_NOT_INITIALIZED', 'this.parentNode.DMenu', 'dmenu.js#clickMethod', this.nodeName + ' ' + this, String(this.parentNode)));}}else
{Ida.reportError(Ida.getLangString('ERR_NOT_INITIALIZED', 'this.parentNode', 'dmenu.js#clickMethod', this.nodeName + ' ' + this));}if(e)
{if(e.stopPropagation)
{e.stopPropagation();}else
{e.cancelBubble=true;}if(e.preventDefault)
{e.preventDefault();}}return false;},
highlightMethod : function(on){var dMenu=this.parentNode.DMenu;var cn=dMenu.itemClassName+"-highlight";if(on)
Ida.f.addClassName(this,cn);else
Ida.f.removeClassName(this,cn);if(!this.itemDisabled&&dMenu.hoverUpdate)
dMenu.target.setValue(this.val);},
keydownMethod : function(e){e=e||window.event;var k=e.keyCode;var m=this.parentNode.DMenu;if(k==38){if(this.previousSibling)
this.previousSibling.focus();}if(k==40){if(this.nextSibling)
this.nextSibling.focus();}else if(k==27)
m.target.setDropDownVisible(false);else if(k==32||(k==13&&!Ida.IE))
m.selectItem(this.itemNumber);else
return true;if(e.stopPropagation)
e.stopPropagation();return false;},
destroy : function(contentOnly){Ida.keyListener.blockKeyDown=false;for(var i=0;i<this.dropDownItems.length;i++){if(this.container)
this.container.removeChild(this.dropDownItems[i]);this.dropDownItems[i]=null;}this.dropDownItems=[];if(this.container){this.container.DMenu=null;this.container.parentNode.removeChild(this.container);}this.container=null;this.target=null;},
getItemByValue : function(name,ignoreCase){ignoreCase=ignoreCase!==false;if(ignoreCase)
name=name.toLowerCase();var d=this.dropDownItems;for(var i=0;i<d.length;i++){if((ignoreCase ? d[i].val.toLowerCase() : d[i].val)==name)
return this.dropDownItems[i];}return null;},
selectItem : function(index){if(this.target)
{this.target.setDropDownVisible(false);var it=this.dropDownItems&&this.dropDownItems[index];if(it&&it.blur)
{it.blur();}var e=new Ida.Event("MenuItemSelect",this,this.target);e.selectedIndex=index;e.selectedValue=it&&it.val;e.dispatch();}else
{this.hide();}},
setVisible : function(visible){if(visible) this.show();else this.hide();}};

Ida.audio={isIE : document.all&&window.ActiveXObject&&true,
elm : null,
onPageUnload : function()
{this.stop();},
play : function(src,loop)
{if(!src)
{Ida.reportError('Ida.audio.play(src, loop): no src specified');return false;}if(this.isElm())
{this.stop();}var doc=Ida.getDocument();var e;if(this.isIE)
{Ida.animationController.mediaReady=false;e=doc.createElement("div");e.style.position="absolute";e.style.left="-20px";e.style.top="-20px";doc.body.appendChild(e);this.videoRef=new Ida.VideoObject(src,1,1,true,false,false,false);this.videoRef.create(e);this.elm=e;}else
{var i=src.lastIndexOf('.');var ext=(i>=0?src.substring(i+1):'').toLowerCase();var mimeType=ext=="wav"?"audio/x-wav":"audio/x-mpeg";e=doc.createElement("embed");e.style.position="absolute";e.style.left="-400px"
e.style.visibility="hidden";e.setAttribute("pluginspage","http://www.apple.com/quicktime/download/");e.setAttribute("type", mimeType);e.setAttribute("src",src);e.setAttribute("autostart",true);e.setAttribute("loop",loop);e.setAttribute("kioskmode",true);doc.body.insertBefore(e,doc.body.firstChild);this.elm=e;}return true;},
stop : function()
{if(this.isElm()){if(this.videoRef){this.videoRef.destroy();this.videoRef=null;}var e=this.elm.wrappedJSObject||this.elm;e.parentNode.removeChild(e);this.elm=null;}},
isElm : function(){return(this.elm&&this.elm.parentNode);}};Ida.Event.register(Ida.audio);

Ida.VideoPlayer=function(name, fileTypes, CLSID, pluginspage, codebase)
{this.name=name||null
this.fileTypes=fileTypes||null;this.CLSID=CLSID||null;this.pluginspage=pluginspage||null;this.codebase=codebase||null;};Ida.video={objects : [],
mediaPlayer : new Ida.VideoPlayer("MediaPlayer", "asf,aif,aifc,aiff,au,avi,mid,mpe,mpeg,mpg,mpv2,mp2,mp3,m1v,snd,wav,wm,wma,wmv,MPG", "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"),
quicktime : new Ida.VideoPlayer("Quicktime", "aif,aifc,aiff,au,flc,fli,m3u,mid,midi,mov,mp2,mp3,mpa,mpeg,mpg,qt,qti,qtif,vfw,wav", "CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "http://www.apple.com/quicktime/download/", "http://www.apple.com/qtactivex/qtplugin.cab"),
flash : new Ida.VideoPlayer("Flash", "flv")
};Ida.VideoObject=function(file,width,height,autostart,loop,controls,autoSize)
{this.index=Ida.video.objects.length;Ida.video.objects[this.index]=this;this.file=file||"";this.width=width||"100%";this.height=height||"100%";this.autostart=autostart!==false;this.autosize=autoSize!==false;this.loop=loop!==false;this.controls=controls!==false;this.player;this.elm=null;this.isIE=document.all&&window.ActiveXObject&&true;this.keepAspectRatio=true;};Ida.VideoObject.prototype={create : function(target){if(!target) return;var ext=Ida.f.getFileExtension(this.file).toLowerCase();var player,
q=Ida.video.quicktime,
m=Ida.video.mediaPlayer,
f=Ida.video.flash;if(this.isIE&&ext.isInList(m.fileTypes))
{player=m;}else if(ext.isInList(q.fileTypes))
{player=q;}else if(ext.isInList(f.fileTypes))
{player=f;}else
{player=m;}var doc=Ida.getDocument(target);var e;if(this.isIE&&player.name=="MediaPlayer")
{e=doc.createElement("object");target.appendChild(e);e.classid=player.CLSID;e.settings.autoStart=this.autostart;e.settings.playCount=this.loop?9999:1;e.autostart=this.autostart;if(this.width)
{e.width=this.width;}if(this.height)
{e.height=this.height;}if(this.file.indexOf("://")==-1)
{e.URL=Ida.f.getAbsoluteURL(this.file).replace(/%20/g," ");}else
{e.CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";e.URL=this.file;e.TYPE="application/x-oleobject";}e.uiMode=this.controls?"full":"none";e.AutoRewind=true;e.enabled=true;e.stretchToFit=this.keepAspectRatio;e.firstStop=true;this.elm=e;this.addPlayStateChangeEvent();e.controls.play();}else
{e=doc.createElement("embed");if(this.width)
{e.setAttribute("width",this.width);}if(this.height)
{e.setAttribute("height",this.height);}switch(player)
{case f:
var dir=Ida.directory.templatePictureDir;var file=dir + "flvplayer.swf?file="
+(Ida.isRuntime() ? Ida.f.getAbsoluteURL(this.file) : this.file)
+ "&showControls="
+ this.controls
+ "&autoStart="
+(this.autostart)
+ "&.swf";e.setAttribute("src",file);break;case m:
e.setAttribute("pluginspage", player.pluginspage);e.setAttribute("FileName",this.file);e.setAttribute("PlayCount",this.loop?"9999":"1");e.setAttribute("AutoStart",this.autostart);e.setAttribute("ShowControls",this.controls?"1":"0");e.setAttribute("type","application/x-mplayer2");e.setAttribute("DisplaySize", this.autosize);e.setAttribute("AutoSize",true);e.setAttribute("kioskmode",true);break;case q:
var i=this.file.lastIndexOf('.');var ext=(i>=0?this.file.substring(i+1):'').toLowerCase();switch(ext)
{case 'wav':
e.setAttribute("type", "audio/x-wav");break;case 'mov':
e.setAttribute("type", "video/quicktime");break;case 'mp3':
e.setAttribute("type", "audio/x-mpeg");break;case 'mp4':
e.setAttribute("type", "video/mp4");break;case 'm4a':
e.setAttribute("type", "audio/x-m4a");break;case 'm4p':
e.setAttribute("type", "audio/x-m4p");break;case 'm4v':
e.setAttribute("type", "video/x-m4v");break;case 'mpeg':
case 'mpg':
e.setAttribute("type", "video/mpeg");break;}e.setAttribute("src", this.file);e.setAttribute("autostart", this.autostart);e.setAttribute("controller", this.controls);e.setAttribute("loop",this.loop);e.setAttribute("scale",this.keepAspectRatio?"aspect":"tofit");e.setAttribute("kioskmode",true);}target.appendChild(e);}e.className="movie";this.elm=e;},
addPlayStateChangeEvent : function(){var index=this.index;Ida.animationController.mediaReady=false;this.elm.attachEvent("playStateChange",function(newState){var elm=Ida.video.objects[index];if(elm){var e=elm.elm;if(newState==3&&e.firstStop){e.firstStop=false;if(!e.autostart)
e.controls.stop();Ida.animationController.onMediaReady();}delete e;}delete elm;});},
destroy : function()
{if(this.elm)
{var badGuy=this.elm.controls!=undefined&&navigator.platform.substring(0,3).toLowerCase()=='win'&&navigator.userAgent.toLowerCase().indexOf('msie')>0;if(badGuy)
{var v=String(this.elm.versionInfo||'');try
{if(this.elm.controls.isAvailable('stop'))
{this.elm.controls.stop();}}catch(e)
{}badGuy=parseInt(v)==11;}if(!badGuy)
{delete Ida.video.objects[this.index];}delete this.index;this.elm.style.display="none";this.elm.parentNode.removeChild(this.elm);if(!badGuy)
{this.elm=null;}}}};

Ida.Node=function(aNode){this.type=null;this.suggestedType=null;this.node=null;this.removed=false;this.dlgRetObj=null;this.availTypes=Ida.Node.availTypes;if(aNode)
this.setNode(aNode);};Ida.Node.prototype.toString=function(){return "[object Ida.Node]";};Ida.Node.prototype.setNode=function(aNode){if(!aNode) return false;this.node=aNode;if(this.isDLayer(aNode)){this.type="dlayer";return true;}var nodeName=aNode.nodeName.toLowerCase();if(this.availTypes[nodeName]){this.suggestedType=this.availTypes[nodeName];if(this.isType(this.suggestedType)){this.type=this.suggestedType;}}else{return false;}return true;};Ida.Node.prototype.isType=function(aType,aNode){if(!aNode) aNode=this.node;if(!aNode||!aType) return false;var type=aNode.getAttribute("idatype");return(typeof type=="string")?(type.toLowerCase()==aType.toLowerCase()):false;};Ida.Node.prototype.isDLayer=function(aNode){if(!aNode) aNode=this.node;return(aNode.dLayer&&aNode.dLayer.isDLayer);};Ida.Node.prototype.isNode=function(aNode){return Ida.Node.isNode(aNode||this.node);};Ida.Node.prototype.isIdaNode=function(aNode){return Ida.Node.isIdaNode(aNode||this.node);};Ida.Node.availTypes={};Ida.Node.availTypes.span="span";Ida.Node.availTypes.img="picture";Ida.Node.register=function(aType, aNodeName){if(!aType||!aNodeName) return;this.availTypes[aNodeName]=aType;};Ida.Node.isNode=function(aNode){return(typeof aNode=="object"&&typeof aNode.nodeType=="number");};Ida.Node.isIdaNode=function(aNode){return Boolean(aNode&&
aNode.nodeName&&
this.availTypes[aNode.nodeName.toLowerCase()]
);};Ida.Node.getName=function(aNode){return this.availTypes[aNode.nodeName.toLowerCase()]||"";};

Ida.TextNode=function(){this.nameForNode=null;this.keepContent=false;};Ida.TextNode.prototype=new Ida.Node();Ida.TextNode.prototype.toString=function(){return "[object IdaTextNode]";};Ida.TextNode.prototype.isMyNode=function(aNode){if(!aNode)
aNode=this.node;return(aNode&&
aNode.nodeName&&
aNode.nodeName.toLowerCase()==this.nameForNode.toLowerCase());};Ida.TextNode.prototype.loadAttributes=function(){return;};Ida.TextNode.prototype.onBeforeCreate=function(){return;};Ida.TextNode.prototype.onAfterCreate=function(){return;};Ida.TextNode.prototype.onBeforeRemove=function(){return;};Ida.TextNode.prototype.onAfterRemove=function(){return;};Ida.TextNode.isIdaTextNode=function(aNode,checkParent){return this.getIdaTextNode(aNode,checkParent)!=null;};Ida.TextNode.getIdaTextNode=function(aNode,checkParent){if(!aNode) return null;var checkAgain=true;var isNode;while(checkAgain){isNode=Boolean(Ida.Node.isIdaNode(aNode)&&aNode.getAttribute("idaType"));if(isNode||!checkParent||!aNode.parentNode)
checkAgain=false;else
aNode=aNode.parentNode;}return isNode?aNode:null;};Ida.TextNode.getType=function(aNode){if(!aNode) return "";return aNode.getAttribute("idaType");};Ida.TextNode.getName=function(aNode){return Ida.Node.getName(aNode);};

Ida.GapNode=function(elm)
{this.nameForNode="gap";this.type="gap";this.dialogName="gapDlg";this.caseSensitive=false;this.answers="";this.trim=true;this.size=15;if(elm)
this.setGapNode(elm);};Ida.GapNode.prototype=new Ida.TextNode();Ida.Node.register("gap","gap");Ida.GapNode.prototype.setGapNode=function(aNode){if(aNode instanceof Ida.Node)
this.node=aNode.node;else if(this.isNode(aNode)&&this.isMyNode(aNode))
this.node=aNode;if(this.node)
this.loadAttributes();};Ida.GapNode.prototype.isMyNode=function(aNode){if(!aNode)
aNode=this.node;return(aNode&&
aNode.nodeName&&
aNode.nodeName.toLowerCase().isInList("input,gap"));};Ida.GapNode.prototype.loadAttributes=function(){if(!this.isMyNode()) return;this.answers=this.node.getAttribute("idaAnswers")||"";this.size=Number(this.node.getAttribute("idaSize"))||15;this.caseSensitive=this.node.getAttribute("idaCaseSensitive")=="true";this.trim=this.node.getAttribute("idaTrim")!=="false";};Ida.GapNode.prototype.isCorrect=function(){if(!this.node) return false;var userInput=Ida.f.convertTo(this.node.value,"string");var answer=Ida.f.convertTo(this.answers,"string");var caseSensitive=this.caseSensitive;var splitter=";";if(!caseSensitive){answer=answer.toLowerCase();userInput=userInput.toLowerCase();splitter=splitter.toLowerCase();}if(this.trim)
userInput=userInput.trim();var allAnswers=answer.split(splitter);var a;for(var i=0;i<allAnswers.length;i++){a=this.trim?allAnswers[i].trim():allAnswers[i];if(a==userInput)
return true;}return false;};Ida.GapNode.prototype.showCorrect=function(){if(!this.node) return;this.node.value=String(this.answers.split(";")[0]);};Ida.GapNode.prototype.mark=function(){if(!this.node) return;this.node.className=this.isCorrect()?"gap gapCorrect":"gap gapWrong";};Ida.GapNode.getNodeByNodeString=function(aNodeString){var gap=new Ida.GapNode();var cs=aNodeString.match(/idaCaseSensitive="(.*)?"/i);gap.caseSensitive=(cs&&cs[1])?Ida.f.convertTo(cs[1],"boolean"):false;var trim=aNodeString.match(/idaTrim="(.*)?"/i);gap.trim=(trim&&trim[1])?Ida.f.convertTo(trim[1],"boolean"):true;gap.answers=aNodeString.match(/idaAnswers="(.*)?"/i)[1]||"";gap.size=aNodeString.match(/idaSize="(.*)?"/i)[1]||15;return gap;};Ida.GapNode.getStringByNodeString=function(aNodeString){var style=aNodeString.match(/ style=["|']([^"|']*)/i);var gap=this.getNodeByNodeString(aNodeString);var newString='<input ' +((style&&style[1]) ? 'style="' + style[1] + '" ' : '') +
'class="gap" idaType="gap" type="text" size="' + gap.size +
'" idaAnswers="' + gap.answers + '" idaCaseSensitive="' +
(gap.caseSensitive) + '" idaTrim="' +(gap.trim) + '">';return newString;};

Ida.GlossaryNode=function(aTarget){this.target=aTarget;this.glossaryNode=null;this.focusNode=null;};Ida.GlossaryNode.toString=function(){return "[object Ida.GlossaryNode]";};Ida.GlossaryNode.prototype=new Ida.TextNode();Ida.Node.register("glossary","span");Ida.GlossaryNode.onLoad=function(){var doc=Ida.getDocument();Ida.dListener.addListener(doc,"mouseover",Ida.GlossaryNode.MouseOverHandler,false);Ida.dListener.addListener(doc,"click",Ida.GlossaryNode.ClickHandler,false);};Ida.GlossaryNode.MouseOverHandler=function(e){var t=Ida.GlossaryNode.getTargetByEvent(e);if(t){var desc=t.getAttribute("idaTarget");if(desc){Ida.tooltip.target=t;var maxChars=400;var text=String(Ida.course.glossary.get(desc));if(text.length>maxChars){var pos=text.indexOf(" ",maxChars-10);text=text.substring(0,pos>0?pos:maxChars-10) + " ...";}text="<span class='glossary-tooltip-head'>"+desc+"<\/span>"+
"<span class='glossary-tooltip-body'>"+text+"<\/span>";Ida.tooltip.show(text);}}return true;};Ida.GlossaryNode.ClickHandler=function(e){var t=Ida.GlossaryNode.getTargetByEvent(e);if(t){var desc=t.getAttribute("idaTarget");if(desc)
Ida.navigation.showGlossary(desc);}return true;};Ida.GlossaryNode.getTargetByEvent=function(e){if(Ida.isReader()){e=e||window.event;var target=e.target||e.srcElement;if(target.nodeType==1&&target.getAttribute("idaType")=="glossary")
return target;}return null;};Ida.Event.register(Ida.GlossaryNode);

Ida.Date=function(){this.dateObj=null;this.day=null;this.month=null;this.year=null;this.yearShort=null;this.hours=null;this.minutes=null;this.seconds=null;this.setCurrentDate();};Ida.Date.prototype={toString : function(){return "[object Ida.Date]";},
getISODate : function(mode,extended){var d=Ida.Date;if(!mode)
mode=d.DEFAULT;var Y=mode<d.H?this.year:null;var M=mode<d.H&&mode>d.Y?this.month:null;var D=mode<d.H&&mode>d.YM?this.day:null;var h=mode>d.YMD?this.hours:null;var m=mode>d.YMDH?this.minutes:null;var s=mode>d.YMDHM?this.seconds:null;return Ida.Date.getISODate(Y,M,D,h,m,s,extended!=false);},
getISODuration : function(mode){if(!mode)
mode=this.DEFAULT;var Y=mode<this.H?this.year:null;var M=mode<this.H&&mode>this.Y?this.month:null;var D=mode<this.H&&mode>this.YM?this.day:null;var h=mode>this.YMD?this.hours:null;var m=mode>this.YMDH?this.minutes:null;var s=mode>this.YMDHM?this.seconds:null;return Ida.Date.getISODuration(Y,M,D,h,m,s);},
setCurrentDate : function(){this.dateObj=new Date();this.update();},
setDate : function(year, month, day, h, m, s){if(!isNaN(day)&&day<=31)
this.dateObj.setDate(day);if(!isNaN(month)&&month<=12)
this.dateObj.setMonth(month-1);if(!isNaN(year))
this.dateObj.setFullYear(year);if(!isNaN(h)) this.dateObj.setHours(h);if(!isNaN(m)) this.dateObj.setMinutes(m);if(!isNaN(s)) this.dateObj.setSeconds(s);this.update();},
update : function(){var o=this.dateObj;this.day=o.getDate();this.month=o.getMonth()+1;this.year=o.getFullYear();if(this.year<-9||this.year>9)
this.shortYear=String(this.year).substring(String(this.year).length-2);else
this.shortYear="0" + String(this.year);this.hours=o.getHours();this.minutes=o.getMinutes();this.seconds=o.getSeconds();},
getStringByPattern : function(aPattern){return Ida.Date.strftime(aPattern,this.dateObj);}};Ida.Date.Y=1;Ida.Date.YM=2;Ida.Date.YMD=3;Ida.Date.YMDH=4;Ida.Date.YMDHM=5;Ida.Date.YMDHMS=6;Ida.Date.H=7;Ida.Date.HM=8;Ida.Date.HMS=9;Ida.Date.DEFAULT=6;Ida.Date.strftime=function(aPattern, aDate, aDateNames){if(typeof aDateNames!="object")
aDateNames=Ida.Date.getDateNames();var swn=aDateNames.shortDayNames,
lwn=aDateNames.longDayNames,
smn=aDateNames.shortMonthNames,
lmn=aDateNames.longMonthNames,
apf=["a.m.", "p.m."],
dmo=[0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],
dte=new Date(aDate),
fst=String(aPattern);var regEx=/[+-]\d+[SMHdmy]/g;var plusMinus=fst.match(regEx);if(plusMinus){var vorz, shrt, val;for(var i=0;i<plusMinus.length;i++){vorz=plusMinus[i].charAt(0)=="+"?1:-1;shrt=plusMinus[i].charAt(plusMinus[i].length-1);val=vorz * Number(plusMinus[i].substring(1,plusMinus[i].length-1));if(shrt=="S")
dte.setSeconds(dte.getSeconds() + val);else if(shrt=="M")
dte.setMinutes(dte.getMinutes() + val);else if(shrt=="H")
dte.setHours(dte.getHours() + val);else if(shrt=="d")
dte.setDate(dte.getDate() + val);else if(shrt=="m")
dte.setMonth(dte.getMonth() + val);else if(shrt.toLowerCase()=="y")
dte.setFullYear(dte.getFullYear() + val);}fst=fst.replace(regEx,"");};function digits(r, i){var rs=[/.*(..)/, /.*(...)/, /.*(....)/];return("000" + i).replace(rs[r-2], "$1");};function doy(d){var m=d.getMonth(), y=d.getFullYear();return dmo[m] + d.getDate() +(m>1&&y%4==0&&y%200!=0);};function h12(d){var h=dte.getHours();return h==0?12:h>12? h-12 : h;};function tzo(d){var o=d.getTimezoneOffset(),
p=o>0? "+" : "-",
a=Math.abs(o);return "GMT" + p + digits(2, Math.floor(a/60)) + digits(2, a%60);}return(
fst.replace(/%x/g, "%d. %B %Y")
.replace(/%X/g, "%H:%M:%S")
.replace(/%a/g, swn[dte.getDay()])
.replace(/%A/g, lwn[dte.getDay()])
.replace(/%b/g, smn[dte.getMonth()])
.replace(/%B/g, lmn[dte.getMonth()])
.replace(/%c/g, dte.toLocaleString())
.replace(/%d/g, digits(2, dte.getDate()))
.replace(/%H/g, digits(2, dte.getHours()))
.replace(/%I/g, digits(2, h12(dte)))
.replace(/%j/g, digits(3, doy(dte)))
.replace(/%m/g, digits(2, dte.getMonth()+1))
.replace(/%M/g, digits(2, dte.getMinutes()))
.replace(/%p/g, apf[dte.getHours()<13? 0 : 1])
.replace(/%S/g, digits(2, dte.getSeconds()))
.replace(/%[UW]/g, digits(2, dte.getWeek()))
.replace(/%w/g, dte.getDay())
.replace(/%y/g, digits(2, dte.getFullYear()))
.replace(/%Y/g, dte.getFullYear())
.replace(/%Z/g, tzo(dte))
.replace(/%%/g, "%")
);};Ida.Date.getISODuration=function(Y,M,D,h,m,s){var ret="P";if(Y) ret +=Y + "Y";if(M) ret +=M + "M";if(D) ret +=D + "D";if(h||m||s){ret +="T";h=parseInt(h)||0;m=parseInt(m)||0;s=parseInt(s)||0;var t=s + 60*m + 60*60*h;s=t%60;var tm=(t-s) / 60;m=tm % 60;h=(tm-m) / 60;if(h) ret +=h + "H";if(m) ret +=m + "M";if(s) ret +=s + "S";}return ret;};Ida.Date.getISODate=function(Y,M,D,h,m,s,extended){var dateArray=[], timeArray=[];if(Y){dateArray.push(Y)
if(M){dateArray.push(M);if(D)
dateArray.push(D);}}if(h||m||s){timeArray.push("T");if(!h) h="00";if(s&&!m) m="00";}if(h) timeArray.push(h);if(m) timeArray.push(m);if(s) timeArray.push(s);var extDateChar=extended?"-":"";var extTimeChar=extended?":" : "";var ret=dateArray.length?dateArray.join(extDateChar):"";if(timeArray.length)
ret +=timeArray.join(extTimeChar);return ret;};Ida.Date.getExtendedISODate=function(Y,M,D,h,m,s){return this.getISODate(Y,M,D,h,m,s,true);};Ida.Date.getDateNames=function(){if(Ida.course&&Ida.course.loaded)
{var days=Ida.course.getContent("longDayNames");var months=Ida.course.getContent("longMonthNames");}return new Ida.DateNames((days||"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag").split(",")
,(months||"Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember").split(","));};Date.prototype.getWeek=function(){var year=this.getFullYear();var date=new Date(this.valueOf());var w;date.setDate(date.getDate()+((date.getDay())?4-date.getDay():-3));w=Math.floor((date-new Date(date.getFullYear(),0,1))/604800000)+1;return(year!=date.getFullYear())?-w:w;};Ida.DateNames=function(LDayNames, LMonthNames, SDayNames, SMonthNames){this.longDayNames=LDayNames||new Array(7);this.longMonthNames=LMonthNames||new Array(12);this.shortDayNames=SDayNames||new Array(7);this.shortMonthNames=SMonthNames||new Array(12);if(LDayNames&&!SDayNames){for(var i=0;i<this.longDayNames.length;i++){this.shortDayNames[i]=this.longDayNames[i].substring(0,2);}}if(LMonthNames&&!SMonthNames){for(var i=0;i<this.longMonthNames.length;i++){this.shortMonthNames[i]=this.longMonthNames[i].substring(0,3);}}};

Ida.KeywordNode=function(aType,aPattern){this.nameForNode="keyword";this.type=typeof aType=="string"?aType||null:null;if(typeof aPattern=="string")
this.pattern=aPattern;else
this.pattern=this.getDefaultPattern(this.type);if(typeof aType=="object"&&
(this.isNode(aType)||aType instanceof Ida.Node)){this.setKeywordNode(aType);}this.dialogName="keywordDlg";};Ida.KeywordNode.prototype=new Ida.TextNode();Ida.Node.register("keyword","keyword");Ida.KeywordNode.prototype.setKeywordNode=function(aNode){if(aNode instanceof Ida.Node)
this.node=aNode.node;else if(this.isNode(aNode)&&this.isMyNode(aNode))
this.node=aNode;if(this.node)
this.loadAttributes();};Ida.KeywordNode.prototype.getDefaultPattern=function(aType){switch(aType||this.type){case "user": return "SALUTATION LASTNAME";case "date": return "%d.%m.%Y";}return "";};Ida.KeywordNode.prototype.getStringByPattern=function(aPattern,aType)
{if(!aPattern)
{aPattern=this.pattern;}switch(aType||this.type)
{case "user":
var cu=Ida.currentUser;return cu&&cu.getStringByPattern(aPattern)||'';case "date":
return new Ida.Date().getStringByPattern(aPattern);}return "";};Ida.KeywordNode.prototype.loadAttributes=function(){if(!this.isMyNode()) return;this.pattern=this.node.getAttribute("idaPattern");this.type=this.node.getAttribute("idaType");};Ida.KeywordNode.getNodeByNodeString=function(aNodeString){var check=aNodeString.match(/ idaType=["|']([^"|']*)/i);var type, pattern;if(check&&check[1])
type=check[1];check=aNodeString.match(/ idaPattern=["|']([^"|']*)/i);if(check&&check[1])
pattern=check[1];return new Ida.KeywordNode(type,pattern);};Ida.KeywordNode.getStringByNodeString=function(aNodeString){var style=aNodeString.match(/ style=["|']([^"|']*)/i);var newString="<span " +((style&&style[1]) ? "style=\"" + style[1] + "\" " : "") +
"class=\"keyword\">";var node=this.getNodeByNodeString(aNodeString);newString +=node.getStringByPattern();newString +="</span>";window.IDAKeyNodeString=aNodeString;return newString;};

Ida.LinkNode=function(aTarget, aToolTip, aOpenInNewWindow)
{this.target=null;this.targetType=null;this.openInNewWindow=(aOpenInNewWindow===true);this.targetWindow=null;this.tooltip=aToolTip||null;this.nameForNode="a";this.type="link";this.dialogName="linkDlg";this.keepContent=true;if(aTarget)
this.setTarget(aTarget);};Ida.LinkNode.prototype=new Ida.TextNode();Ida.Node.register("link","a");Ida.LinkNode.prototype.setTarget=function(aTarget){if(!aTarget) return;if(typeof aTarget=="string"){this.target=aTarget;}else if(aTarget instanceof Ida.Node){this.node=aTarget.node;this.loadAttributes();}else if(typeof aTarget=="object"&&aTarget.nodeType){if(this.isMyNode(aTarget)){this.node=aTarget;this.loadAttributes();}else
return;}else
return;if(!this.target)
return;if(!this.targetType)
this.findTargetType();};Ida.LinkNode.prototype.findTargetType=function(){if(!this.target) return;if(this.target.indexOf("page_id")==0)
this.targetType="page";else if(this.target.indexOf("chapter_id")==0)
this.targetType="chapter";else if(this.target.indexOf("book_id")==0)
this.targetType="book";else if(Ida.f.isURL(this.target))
this.targetType="url";else if(this.target.indexOf(".")>0)
this.targetType="file";};Ida.LinkNode.prototype.loadAttributes=function(){if(!this.isMyNode()) return;this.target=this.node.getAttribute("idaTarget");this.targetType=this.node.getAttribute("idaTargetType");this.targetWindow=this.node.getAttribute("idaTargetWindow");this.tooltip=this.node.getAttribute("title");this.openInNewWindow=this.node.getAttribute("idaOpenInNewWindow");};Ida.LinkNode.prototype.execute=function(){var linkTarget=this.target;if(!linkTarget)
{if(this.node&&this.node.href)
{linkTarget=this.node.href;}if(!linkTarget||linkTarget.search(/#$/)>-1)
{return false;}}if(this.targetType&&this.targetType.isInList("page,chapter,book"))
{Ida.navigation.goToPage(this.target);}else if(linkTarget.indexOf("mailto:")=="0")
{win=window.open(linkTarget,"foo","width=100,height=100,left=2000,top=2000,chrome,resizable");Ida.LinkNode.win=win;setTimeout("Ida.LinkNode.win.close()",0);return true;}else
{if(linkTarget.indexOf("www")=="0")
{linkTarget="http://" + linkTarget;}else if(this.targetType=="file")
{linkTarget=Ida.makeURI(linkTarget);}var win=new Ida.Window(linkTarget,this.targetWindow||"url");win.width=800;win.height=600;win.scrollbars="yes";if(this.targetType=="url")
{win.toolbar="yes";win.status="yes";win.location="yes";}win.show();}return true;};Ida.LinkNode.prototype.focusNode=null;Ida.LinkNode.prototype.linkNode=null;

Ida.MWNode=function(aValueMen, aValueWomen){this.nameForNode="mw";this.valueMen=(typeof aValueMen=="string")?aValueMen:null;this.valueWomen=(typeof aValueWomen=="string")?aValueWomen:null;this.type="mw";if(typeof aValueMen=="object"&&(this.isNode(aValueMen)||aValueMen instanceof Ida.Node)){this.setMWNode(aValueMen);}this.dialogName="mwDlg";};Ida.MWNode.prototype=new Ida.TextNode();Ida.Node.register("mw","mw");Ida.MWNode.prototype.setMWNode=function(aNode){if(aNode instanceof Ida.Node)
this.node=aNode.node;else if(this.isNode(aNode)&&this.isMyNode(aNode))
this.node=aNode;if(this.node)
this.loadAttributes();};Ida.MWNode.prototype.getStringByPattern=function(aPattern)
{var cu=Ida.currentUser;if(cu)
{if(cu.isMale)
{return this.valueMen||'';}else if(Ida.currentUser.isFemale)
{return this.valueWomen||'';}}return '';};Ida.MWNode.prototype.loadAttributes=function(){if(!this.isMyNode()) return;this.valueMen=this.node.getAttribute("idaValueMen");this.valueWomen=this.node.getAttribute("idaValueWomen");};Ida.MWNode.getNodeByNodeString=function(aNodeString){var vMen=aNodeString.match(/idaValueMen=["|']([^"|']*)/i)[1];var vWomen=aNodeString.match(/idaValueWomen=["|']([^"|']*)/i)[1];return new Ida.MWNode(vMen,vWomen);};Ida.MWNode.getStringByNodeString=function(aNodeString){var style=aNodeString.match(/ style=["|']([^"|']*)/i);var newString="<span " +((style&&style[1]) ? "style=\"" + style[1] + "\" " : "") +
"class=\"mw\">";newString +=this.getNodeByNodeString(aNodeString).getStringByPattern();newString +="</span>";return newString;};

Ida.VariableNode=function(aPattern, aDefault){this.dialogName="variablesDlg";this.nameForNode="variable";this.type="variable";this.pattern=typeof aPattern=="string"?aPattern||"":"";this.defaultValue=typeof aDefault=="string"?aDefault||"":"";if(typeof aPattern=="object"&&
(this.isNode(aPattern)||aPattern instanceof Ida.Node)){this.setVariableNode(aPattern);}};Ida.VariableNode.prototype=new Ida.TextNode();Ida.Node.register("variable","variable");Ida.VariableNode.prototype.toString=function(){return "[object VariableNode]";};Ida.VariableNode.prototype.setVariableNode=function(aNode){if(aNode instanceof Ida.Node)
this.node=aNode.node;else if(this.isNode(aNode)&&this.isMyNode(aNode))
this.node=aNode;if(this.node)
this.loadAttributes();};Ida.VariableNode.prototype.getValue=function(){var pat=this.pattern;if(!pat) return this.defaultValue;var retVal=Ida.getVariableByPattern(pat);return(typeof retVal!="undefined")?retVal:this.defaultValue;};Ida.VariableNode.prototype.loadAttributes=function(){if(!this.isMyNode()) return;this.pattern=this.node.getAttribute("idaPattern");this.defaultValue=this.node.getAttribute("idaDefaultValue");};Ida.VariableNode.getNodeByNodeString=function(aNodeString){var pattern=aNodeString.match(/idaPattern=["|']([^"|']*)/i)[1].replace(/&quot;/g,"\"");var defValue=aNodeString.match(/idaDefaultValue=["|']([^"|']*)/i)[1];return new Ida.VariableNode(pattern,defValue);};Ida.VariableNode.getStringByNodeString=function(aNodeString){var node=this.getNodeByNodeString(aNodeString);aNodeString=aNodeString.replace(/(<\/?)variable/gi,"$1span");return aNodeString.replace(/>[^<]*</g,">" + node.getValue() + "<");};

onhelp=function(){return false;};function isFKey(key){return(key>=112&&key<=123);};document.onkeydown=function(){var e=window.event;if(e){var isF=isFKey(e.keyCode);if(e.ctrlKey||isF){if(isF)
e.keyCode=0;return false;}}return true;};document.onkeypress=function(e){if(e&&e.preventDefault&&(e.ctrlKey||isFKey(e.keyCode))){e.preventDefault();return false;}return true;};document.oncontextmenu=function(){return false;};

Ida.Doc=function(url,async,relPath,timeout)
{this.url=url;this.async=async!=false;this.useRelativePath=relPath==true;this.requestObj=null;this.text=null;this.xml=null;this.timeout=timeout||15000;this.timerID=null;this.retryCount=0;this.status=0;this.statusText=null;this.id=Ida.Doc.loadedDocs.length;Ida.Doc.loadedDocs[this.id]=this;};Ida.Doc.loadedDocs=[];Ida.Doc.prototype={ERROR : 600,
NETWORK_NOT_AVAILABLE : 601,
PERMISSION_DENIED : 600,
getRequestObj : function(){var ret;if(window.ActiveXObject){try{ret=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{ret=new ActiveXObject('Microsoft.XMLHTTP');}catch(ex){ret=null;}}}else if(window.XMLHttpRequest){try{ret=new XMLHttpRequest();}catch(e){ret=null;};}return ret;},
load : function()
{if(!this.requestObj)
{this.requestObj=this.getRequestObj();}if(!this.requestObj)
{return false;}var me=this;var req=me.requestObj;if(this.async)
{req.onreadystatechange=function()
{me.clearTimer();if(req.readyState==4)
{me.loaded();}else
{me.startTimer();}};}try
{var url=this.url;if(this.useRelativePath&&url.indexOf(location.protocol + "//")>=0)
{url=url.replace(/https?:\/\//,"").replace(/[^\/]*(\/)/,"$1");}if(this.async)
{this.startTimer();}req.open(this.body?"POST":"GET",url,this.async);req.send(this.body||null);if(!this.async)
{this.loaded();}}catch(e){this.clearTimer();this.status=this.PERMISSION_DENIED;this.statusText=e;if(this.onError) this.onError(e);return false;}return true;},
clearTimer : function(){if(this.timerID){clearTimeout(this.timerID);this.timerID=null;}},
startTimer : function(){if(this.timeout)
this.timerID=setTimeout("var e=Ida.Doc.loadedDocs[" + this.id + "];if(e&&e.timedout) e.timedout()",this.timeout);},
loaded : function()
{this.text=null;this.xml=null;this.status=NaN;this.statusText=null;try
{this.text=this.requestObj.responseText;this.xml=this.requestObj.responseXML;this.status=this.requestObj.status;this.statusText=this.requestObj.statusText;}catch(e)
{if(e&&typeof e=='object')
{if(e.result)
{var R=self.Components&&self.Components.results;if(R&&e.result==R.NS_ERROR_NOT_AVAILABLE)
{this.status=this.NETWORK_NOT_AVAILABLE;this.statusText=Ida.getLangString('ERR_NETWORK_EXCEPTION', e);}}}if(this.statusText==null)
{this.statusText=String(e);Ida.reportError('doc.js#loaded caught exception: '+this.statusText);}}if(this.status==0||this.status==200)
{this.onLoad();}else
{if(this.status==NaN||(status<100&&status>699))
this.status=this.ERROR;this.onError();}},
abort : function(){if(this.requestObj){this.requestObj.abort();delete this.requestObj.onreadystatechange;this.requestObj=null;}},
timedout : function(){this.abort();this.status=504;this.statusText="Timeout";if(this.retryCount>0){this.retryCount--;this.load();}else
this.onTimeout();},
onLoad : function(){},
onError : function(){},
onTimeout : function(){}};

Ida.Timer=function(delay,notifyObj,loopCount){this.delay=delay||100;this.notifyObject=notifyObj||null;this.loopCount=(typeof loopCount=="number"?loopCount:1);this.counter=0;this.id=Ida.Timer.totalCount++;this.stopped=false;this.running=false;this.timerRef=null;Ida.Timer.allTimer[this.id]=this;};Ida.Timer.toString=function(){return "[object Ida.Timer]";};Ida.Timer.prototype.start=function(){this.running=true;var func="Ida.Timer.timerNotify(" + this.id + ")";this.timerRef=window.setTimeout(func,this.delay);};Ida.Timer.prototype.stop=function(pos){if(!this.stopped){window.clearTimeout(this.timerRef);this.stopped=true;}if(typeof pos!="number")
pos=Ida.Timer.getTimerPos(this.id);if(pos>-1)
Ida.Timer.allTimer[pos]=null;};Ida.Timer.totalCount=0;Ida.Timer.allTimer=[];Ida.Timer.timerNotify=function(id){var pos=this.getTimerPos(id);if(pos>-1){var timer=this.allTimer[pos];if(timer.notifyObject){var e=new Ida.Event("TimerNotify",this,timer.notifyObject);e.timer=timer;e.dispatch();}if(++timer.counter==timer.loopCount)
timer.stop(pos);else
timer.start();}};Ida.Timer.getTimerPos=function(id){for(var i=0;i<this.allTimer.length;i++){if(this.allTimer[i]&&this.allTimer[i].id==id)
return i;}return -1;};Ida.Timer.stop=function(){for(var i=this.allTimer.length;i>0;i--){if(this.allTimer[i-1])
this.allTimer[i-1].stop();}};Ida.Event.register(Ida.Timer);Ida.Timer.onLeavePage=function(){this.stop();this.allTimer=[];this.totalCount=0;};

function selectText(elm){elm.select();};function getSelectedText(elm){if(!elm&&document.commandDispatcher&&document.commandDispatcher.focusedElement){elm=document.commandDispatcher.focusedElement;}if(elm&&elm.setSelectionRange)
return elm.value.substring(elm.selectionStart, elm.selectionEnd);else if(document.selection)
return document.selection.createRange().text;return "";};function setSelectedTextRange(elm, selectionStart, selectionEnd){if(elm.setSelectionRange){elm.focus();elm.setSelectionRange(selectionStart, selectionEnd);}else if(elm.createTextRange){var range=elm.createTextRange();range.collapse(true);range.moveEnd('character', selectionEnd);range.moveStart('character', selectionStart);range.select();}};function setCaretToEnd(elm){setSelectedTextRange(elm, elm.value.length, elm.value.length);};function setCaretToStart(elm){setSelectedTextRange(elm, 0, 0);};function setCaretToPos(elm, pos){setSelectedTextRange(elm, pos, pos);};function getCaretPosition(elm){if(typeof elm.selectionStart!="undefined")
return elm.selectionStart;else if(document.selection)
return Math.abs(document.selection.createRange().moveStart("character",-1000000));return -1;};function selectString(elm, string){var match=new RegExp(string, "i").exec(elm.value);if(match){setSelectedTextRange(elm, match.index, match.index + match[0].length);}};function replaceSelectedText(elm, replaceString){var isInput=elm.nodeName.toLowerCase().isInList("input,textarea");if(isInput&&elm.setSelectionRange){var selectionStart=elm.selectionStart;var selectionEnd=elm.selectionEnd;elm.value=elm.value.substring(0, selectionStart) + replaceString + elm.value.substring(selectionEnd);if(selectionStart!=selectionEnd)
setSelectedTextRange(elm, selectionStart, selectionStart + replaceString.length);else // set caret
setCaretToPos(elm, selectionStart + replaceString.length);}else if(document.selection){var range=document.selection.createRange();if(range.parentElement()==elm){var isCollapsed=range.text=='';range.text=replaceString;if(!isCollapsed){range.moveStart('character', -replaceString.length);range.select();}}}}

Ida.msgBox=function(aTitle,aText,aBtn1,aBtn2,aBtn3)
{if(arguments.length==1){aTitle=String(aTitle);if(aTitle=="") return null;aText=aTitle;aTitle="";}else
aText=String(aText);var course=Ida.course;if(!aTitle)
{aTitle=course.getContent("message")||"";}aText=Ida.formatContent(aText.replace(/\r\n|\r|\n/g, " "));var w=Ida.getObjectById("_IDA_MSGBOX");if(!w)
{w=Ida.templates.createObject("MsgBox");if(w)
{Ida.getPageObject().addChild(w);w.id="_IDA_MSGBOX";}}Ida.blockUserEvents(w);Ida.msgBox.visible=true;if(w)
{w.showMsg(aTitle,aText,aBtn1||course.getContent("ok")||"OK" ,aBtn2,aBtn3);}return Ida.msgBox.id=Ida.f.getTime();};Ida.msgBox.toString=function(){return "[object Ida.msgBox]";};Ida.Event.register(Ida.msgBox);Ida.msgBox.notifyObject=null;Ida.msgBox.visible=false;Ida.msgBox.onMsgBoxNotify=function(e){Ida.releaseUserEvents();var ref=Ida.msgBox.notifyObject;Ida.msgBox.notifyObject=null;Ida.msgBox.visible=false;if(e&&ref){e.msgId=Ida.msgBox.id;e.setTarget(ref);e.dispatch();}};

Ida.Sidebar={visible : false,
url : "",
title : "",
initialized : false,
savedOverFlow : null,
show : function(url,title){if(this.visible&&this.url==url) return;this.init();this.frame.src=url;this.titlebar.innerHTML=title||"";this.title=title;if(this.visible) return;var w=this.idapage.offsetWidth;this.sidebar.style.display="block";this.splitter.style.display="block";var left=this.splitter.offsetLeft + this.splitter.offsetWidth;this.idapage.style.left=left + "px";this.idapage.style.width=(w-left) + "px";if(this.savedOverFlow==null)
{this.savedOverFlow=this.idapage.style.overflow;}this.idapage.style.overflow='auto';this.visible=true;},
hide : function(){this.init();this.sidebar.style.display="none";this.splitter.style.display="none";if(this.savedOverFlow!=null)
{this.idapage.style.overflow=this.savedOverFlow;}this.idapage.style.width="100%";this.idapage.style.left="0px";this.visible=false;},
onPageShown : function(){this.init();if(this.frame&&this.frame.contentWindow&&this.frame.contentWindow.update)
this.frame.contentWindow.update();},
init : function(force){if(this.initialized&&!force) return;var doc=Ida.getDocument();this.sidebar=doc.getElementById("sidebar");this.titlebar=doc.getElementById("sidebar-titlebar");this.frame=doc.getElementById("sidebar-frame");this.splitter=doc.getElementById("sidebar-splitter");this.idapage=doc.getElementById("idapage");this.overlay=doc.getElementById("sidebar-frame-overlay");var s=this.splitter;s.overlay=this.overlay;s.onDragStart=function(){s.overlay.style.display="block";};s.onDragEnd=function(){s.overlay.style.display="none";};this.initialized=true;}};Ida.Event.register(Ida.Sidebar);

Ida.evaluator={init : function()
{this.percent=0;this.totalScore=0;this.reachedScore=0;this.objects=[];this.tryCount=0;this.attempts=0;},
scoreObject : function(obj,score){var evObj=this.getEvaluatorObject(obj);if(evObj)
evObj.updateScore(score);else{var dummy=this.getEvaluatorObject(obj,true);if(dummy){if(dummy.maxScore<=score.maxScore)
Array.removeElement(this.objects,dummy);else
dummy.maxScore -=score.maxScore;}evObj=new Ida.EvaluatorObject(obj,score);this.objects[this.objects.length]=evObj;}return evObj;},
getResults : function(scope,grading){this.totalScore=0;this.reachedScore=0;this.tryCount=0;this.attempts=0;var inScope;if(scope){this.createDummyResults(scope);for(var i=0;i<this.objects.length;i++){if((inScope=(scope==this.objects[i].page||scope.hasChild(this.objects[i].page)))){this.reachedScore +=this.objects[i].getReachedScores(grading);this.tryCount +=this.objects[i].tryCount;this.attempts +=this.objects[i].attempts;}this.objects[i].inScope=inScope;}this.totalScore=scope.getMaxScore();}this.percent=this.totalScore?(this.reachedScore/this.totalScore)*100:0;return this;},
createDummyResults : function(scope)
{this.removeAllDummies();var childrenList=scope?scope.canHaveChildren ? scope.getChildrenList():[scope] : Ida.course.getChildrenList();for(var i=0;i<childrenList.length;i++)
{var score=childrenList[i].maxScore;if(score)
{var objScore=0;var objList=this.getObjectsForPage(childrenList[i]);for(var x=0;x<objList.length;x++)
{objScore +=objList[x].maxScore;}if(objScore<score)
{this.addDummy(childrenList[i],score - objScore);}}}},
getObjectsForPage : function(page){var objList=[];for(var x=0;x<this.objects.length;x++){if(this.objects[x].page==page){objList.push(this.objects[x]);}}return objList;},
addDummy : function(page,score){var dLayerDummy={id : "dummy", courseElement : page};var scoreDummy={tryCount : 0,
attempts : 1,
isCorrect : false,
correct : 0,
wrong : 0,
missing : 0,
total : 0,
maxScore : score,
scoreEach : false,
substractWrong : false
};this.objects.push(new Ida.EvaluatorObject(dLayerDummy,scoreDummy));},
removeAllDummies : function(){for(var i=this.objects.length-1;i>=0;i--){if(this.objects[i].id=="dummy")
Array.removeAt(this.objects,i);}},
reset : function(){try{Ida.evaluator.init();var evalObj=Ida.getObjectsByObjectName("eval_object");for(var i=0;i<evalObj.length;i++){if(evalObj[i]&&typeof evalObj[i].createResults=="function")
evalObj[i].createResults();}}catch(e){Ida.handleError(e);}},
getEvaluatorObject : function(obj,returnDummy){for(var i=0;i<this.objects.length;i++){if(this.objects[i].page==obj.courseElement){if((returnDummy&&this.objects[i].id=="dummy")||(this.objects[i].id==obj.id))
return this.objects[i];}}return null;},
onSessionLoad : function(e)
{if(e.loadString.indexOf("evl:")>-1)
{var evl=e.loadString.replace(/.*evl:([^&]*).*/,"$1");if(evl)
{var ary=evl.split(";");for(var i=0;i<ary.length;i++)
{if(ary[i])
{var evObj=new Ida.EvaluatorObject();evObj.setFromSaveString(ary[i]);this.objects.push(evObj);}}}}this.removeAllDummies();},
onSessionSave : function(e)
{this.createDummyResults();var a={};var o=this.objects;for(var i=0;i<o.length;i++)
{var p=o[i].page;if(p)
{var po=a[p.idNr];if(!po)
{a[p.idNr]=po={};}po[o[i].id]=o[i].getSaveString();}}var cl=Ida.course.childrenList;var s="evl:";var f=true;for(i=0;i<cl.length;i++)
{if((p=a[cl[i].idNr]))
{for(po in p)
{if(f)
{f=false;}else
{s +=';';}s +=p[po];}}}e.add(s);this.removeAllDummies();}};Ida.evaluator.init();Ida.Event.register(Ida.evaluator);Ida.EvaluatorObject=function(qObj,score){this.id=qObj?qObj.id:"";this.page=qObj?qObj.courseElement:null;this.score=0;if(score)
this.updateScore(score);this.inScope=false;};Ida.EvaluatorObject.prototype={toString : function(){return "[object EvaluatorObject]";},
updateScore : function(score){for(var i in score)
this[i]=score[i];},
getReachedScores : function(grading){var score=0;if(this.tryCount<=this.attempts){if(this.isCorrect){score=this.maxScore;}else if(this.scoreEach){if(this.substractWrong){var posCorC=this.correct + this.missing;if(posCorC==0) posCorC=1;score=(this.maxScore/posCorC)*this.correct;score -=(this.maxScore/this.total)*this.wrong;}else
score=(this.maxScore/this.total)*this.correct;}var tries=this.tryCount-1;if(tries&&score){if(grading=="half")
score /=Math.pow(2,tries);else if(grading=="percent")
score *=((this.attempts-this.tryCount+1)/this.attempts);}}this.score=Math.max(0,score);return this.score;},
getSaveString : function(){var str=this.page.idNr + "," +
this.id + "," +
this.maxScore + "," + // maxScore -{int}Maximum number of scores to get for this test.
(this.scoreEach?"1":"") + "," + // scoreEach -{boolean}Defines, if each object should be scored individually
(this.substractWrong?"1":"") + "," + // substractWrong -{boolean}Defines, if a wrong answer should lead to a lower result
(this.wrong?this.wrong:"") + "," + // wrong -{int}Number of wrong answers(only defined when scoreEach=true)
(this.missing?this.missing:"") + "," + // missing -{int}Number of missing answers(only defined when scoreEach=true)
(this.correct?this.correct:"") + "," + // correct -{int}Number of correct answers(always 1 when scoreEach=false)
this.tryCount + "," + // tryCount -{int}actual needed tries
this.attempts;return str.replace(/,,,,,,/g,"?").replace(/,,,,,/g,"/").replace(/,,,,/g,"*").replace(/,,,/g,"-").replace(/,,/g,"!");},
setFromSaveString : function(str){str=str.replace(/\?/g,",,,,,,").replace(/\//g,",,,,,").replace(/\*/g,",,,,").replace(/\-/g,",,,").replace(/\!/g,",,");var a=str.split(",");this.page=Ida.course.getCourseElementById("page_id_"+a[0]);this.id=a[1];this.maxScore=Number(a[2]);this.scoreEach=a[3]=="1";this.substractWrong=a[4]=="1";this.wrong=Number(a[5]);this.missing=Number(a[6]);this.correct=Number(a[7]);this.tryCount=Number(a[8]);this.attempts=Number(a[9]);this.total=this.missing + this.correct + this.wrong;this.isCorrect=this.scoreEach?this.missing+this.wrong==0:this.correct>0;}};if(Ida.Action)
{Ida.Action.registerAction("resetEvaluation",Ida.evaluator.reset);}

Ida.settings = Ida.settings || {};
Ida.language.register("Deutsch", "de");

