Ida.templates.constructors["Button"]={construct : function()
{var t=Ida.templates.createObject("textobject");t.defaultProperty="text";t.authorCreateable="true";t.objectType="Button";t.objectName="Button";t.content.normalGraphic="";t.content.hoverGraphic="";t.content.focusGraphic="";t.content.pushedGraphic="";t.content.disabledGraphic="";t.script.action="";t.script.canHaveFocus=false;t.script.behaviour="none";t.script.defaultButton=false;t.script.disabled=false;t.script.focusColor="";t.script.focusBackgroundColor="";t.script.focusBorderColor="";t.script.focusBorderWidth="";t.script.hoverColor="";t.script.hoverBackgroundColor="";t.script.hoverBorderColor="";t.script.hoverBorderWidth="";t.script.pushedColor="";t.script.pushedBackgroundColor="";t.script.pushedBorderColor="";t.script.pushedBorderWidth="";t.script.disabledColor="";t.script.disabledBackgroundColor="";t.script.disabledBorderColor="";t.script.disabledBorderWidth="";t.style.width="100px";t.style.height="25px";t.style.borderWidth="1px";t.style.borderColor="#C0C0C0";t.style.backgroundColor="#C0C0C0";t.style.backgroundImage="";t.style.textAlign="center";t.style.cursor="default";t.focus=function(){if(this.elm.firstChild&&this.elm.firstChild.focus)
this.elm.firstChild.focus();};t.blur=function(){if(this.elm.firstChild&&this.elm.firstChild.blur)
this.elm.firstChild.blur();};t.createBtn=function(){var def=this.get("defaultButton");Ida.DLayer.setDefaultButton(this,def);var text=this.get("text");if(text=="")
return;var accObj=new Ida.Accesskey(text);var btn="";var elm=this.elm;if(this.get("display")!="inline"){var style=" style=\"font-weight:" + Ida.f.getStyle(elm,"fontWeight") + ";";style +=" font-family:" + Ida.f.getStyle(elm,"fontFamily") + ";";style +=" font-size:" + Ida.f.getStyle(elm,"fontSize") + ";";style +=" cursor:" + Ida.f.getStyle(elm,"cursor") + ";";style +=" color:" + Ida.f.getStyle(elm,"color") + "\" ";if(this.get("canHaveFocus")){btn="<button";btn +=style + "onfocus='this.parentNode.dLayer.setFocus(true)'" +
" onblur='this.parentNode.dLayer.setFocus(false)'>" +
accObj.html + "</button>";}else if(accObj.html){btn="<table" + style + " class='btncontent'><tr>" +
"<td style='text-align:" + this.get("textAlign") +
";cursor:" + this.get("cursor") + "'>" + accObj.html +
"</td></tr></table>";}}else
btn=accObj.html;if(accObj.key)
this.registerAccesskey(accObj.key);this.elm.innerHTML=btn;};t.setHover=function(on){this.setStyle("hover",on);};t.setFocus=function(on){this.focused=on;this.setStyle("focus",on);};t.setPushed=function(on){this.setStyle("pushed",on);};t.setStyle=function(style,on){var dis=style=="disabled";if(this.get("disabled")&&!dis) return;var elm=this;function getStyle(val){var valOn=style + val.upperCaseCharAt(0);var valOff=(offStyle=="normal")?val:offStyle + val.upperCaseCharAt(0);return elm.get(on?valOn:valOff)||elm.get(on?valOff:val)||(on?elm.get(val):"");}if(!this.elm)
{Ida.reportError('button.xml - setStyle method: this.elm is not defined!');return;}var s=this.elm.style;var offStyle=((style=="pushed") ? "hover" :(this.focused ? "focus" : "normal"))
var graphic=this.get((on?style:offStyle)+"Graphic");if(graphic)
this.setGraphic(graphic);var behav=this.get("behaviour");s.borderWidth=getStyle("borderWidth");if(behav=="hoverbutton"||behav=="pushbutton"){if(style=="pushed")
s.borderStyle=on?"inset":"outset";else if(style=="hover"&&behav=="hoverbutton")
s.borderStyle=on?"outset":"none";}s.backgroundColor=getStyle("backgroundColor");s.borderColor=getStyle("borderColor");var color=getStyle("color");if(s.color!=color){s.color=color;var t=this.elm.getElementsByTagName("table")[0];if(t) t.style.color=color;}delete elm;delete s;delete t;};t.setGraphic=function(graphic){this.elm.style.backgroundImage=graphic?this.makeCSSURI(graphic):"url('templates/pic/pixel.gif')";};t.events.mouseover=function(event){this.setHover(true);};t.events.mouseout=function(event){this.setHover(false);};t.events.mousedown=function(event){this.setPushed(true);};t.events.mouseup=function(event){this.setPushed(false);};t.events.PropertyChanged=function(event){var p=event.property;if(p=="disabled"){this.setStyle("disabled",event.value);}else if(p=="normalGraphic")
this.setGraphic(event.value);else if(p=="behaviour"){this.setPushed(false);this.setHover(false);}else if(p.isInList("canHaveFocus,textAlign,fontSize,fontWeight,fontFamily,color,cursor,defaultButton"))
this.createBtn();};t.events.ContentSet=function(event){if(event.name=="text")
this.createBtn();};t.events.Create=function(event){this.setPushed(false);this.setHover(false);if(this.get("disabled"))
this.setStyle("disabled",true);};t.events.AccessKey=function(event){this.runAction("click",true);};return t;}};Ida.templates.constructors["Checkbox"]={construct : function()
{var t=Ida.templates.createObject("textobject");t.defaultProperty="text";t.authorCreateable="true";t.objectType="Checkbox";t.objectName="Checkbox";t.script.type="multiple";t.script.disabled=false;t.script.checked=false;t.script.answer=false;t.script.focusBackgroundColor="";t.script.mustBeAnswered="yes";t.script.markColorCorrect="#E6FFEB";t.script.markColorWrong="#FFE6E6";t.script.languageDependent=false;t.style.cursor="default";t.style.width="100px";t.style.height="25px";t.toggle=function(){if(this.get("disabled")) return;var type=this.get("type");var checked=this.get("checked");if(type=="single"&&checked) return;this.setA("checked",!checked);};t.highlight=function(high,color){if(this.get("disabled"))
{return;}if(!color)
{color=this.get(high?"focusBackgroundColor":"backgroundColor");}if(color)
{this.elm.style.backgroundColor=color;}Ida.f.toggleClassName(this.labelElm,"highlight",high);};t._getImage=function(){return this.makeURI("SET/../pic/" +(this.get("type")=="multiple" ? "checkbox_" : "radio_") +
(this.get("checked")?"on":"off") + ".gif");};t.createChildren=function(){var e=this.elm;while(e.firstChild) e.removeChild(e.firstChild);var doc=this.doc;var me=doc.createElement("a");me.href="#";var multi=this.get("type")=="multiple";me.className="checkb";var checkbImg=doc.createElement("img");checkbImg.src=this._getImage();me.appendChild(checkbImg);label=doc.createElement("span");label.className="checkb-lbl";var accObj=new Ida.Accesskey(this.get("text"));label.innerHTML=accObj.html;if(accObj.key) this.registerAccesskey(accObj.key);e.appendChild(me);e.appendChild(label);var fun=
{keypress : function(e)
{e=e||window.event;var k=e.keyCode||e.charCode;if(k==32) me.parentNode.dLayer.toggle();return k!=13;}, click : function()
{me.parentNode.dLayer.toggle();return false;}, blur : function()
{me.parentNode.dLayer.highlight(false);}, focus : function()
{me.parentNode.dLayer.highlight(true);}};if(Ida.IE)
{me.onkeypress=fun.keypress;me.onclick=fun.click;me.onblur=fun.blur;me.onfocus=fun.focus;}else
{Ida.dListener.addListener(me,"keypress",fun.keypress);Ida.dListener.addListener(me,"click",fun.click);Ida.dListener.addListener(me,"blur",fun.blur);Ida.dListener.addListener(me,"focus",fun.focus);}this.inputElm=me;this.checkbImgElm=checkbImg;this.labelElm=label;};t.focus=function(){this.inputElm.focus();return this.inputElm;};t.isCorrect=function(){return this.get("checked")==this.get("answer");};t.showCorrect=function(){this.setA("checked",this.get("answer"));};t.mark=function(){this.highlight(true,this.get(this.isCorrect()?"markColorCorrect":"markColorWrong"));};t.register=function(){Ida.qObj.register(this);Ida.test.register(this);};t.unregister=function(){Ida.qObj.unregister(this);Ida.test.unregister(this);};t.events.ContentSet=function(event){if(event.name=="text")
this.createChildren();};t.events.PropertyChanged=function(event){if(event.property=="type"){this.createChildren();}else if(event.property=="checked"){this.checkbImgElm.src=this._getImage();if(event.value&&this.get("type")=="single"){var allRadiobuttons=this.parent.getChildrenByObjectType(this.objectType,false);if(allRadiobuttons.length>0){for(var i=0;i<allRadiobuttons.length;i++){if(allRadiobuttons[i]!=this&&allRadiobuttons[i].get("type")=="single")
allRadiobuttons[i].setA("checked",false);}}}Ida.test.markAsComplete(this,this.isCorrect(),false);}else if(event.property=="mustBeAnswered"){this.mustBeExecuted=event.value;Ida.test.checkNavigation();}};t.events.Ready=function(event){this.createChildren();this.register();this.mustBeExecuted=this.get("mustBeAnswered");Ida.test.markAsComplete(this,this.isCorrect(),false);};t.events.click=function(event){var t=event.target||event.srcElement;if(t.nodeName.toLowerCase()!="input"){this.inputElm.focus();this.toggle();}};t.events.AccessKey=function(event){this.focus();this.toggle();};return t;}};Ida.templates.constructors["Choice"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.authorCreateable="true";t.objectType="Choice";t.objectName="Choice";t.script.isCorrect=false;t.script.type="multiple";t.script.nocheck=false;t.script.disabled=false;t.style.display="block";t.style.width="100%";t.style.margin="0px 0px 10px 0px";t.style.position="relative";t.children=[];var t_0=Ida.templates.createObject("GraphicalCheckbox");t.children.push(t_0);t_0.parent=t;t_0.style.position="relative";t_0.style.cursor="pointer";t_0.style.cssFloat="left";t_0.style.display="block";t_0.style.margin="0px 0px 10px 0px";var t_1=Ida.templates.createObject("Field");t.children.push(t_1);t_1.parent=t;t_1.script.hideWhenEmpty=true;t_1.script.hideContainer="PARENT";t_1.style.padding=0;t_1.style.margin="0 0 0 20px";t_1.style.borderWidth=0;t_1.style.position="relative";t_1.style.backgroundColor="transparent";t_1.style.cursor="pointer";t_1.style.overflow="hidden";t_1.events.click=function(event){var t=this.parent.children[0];if(!t.get("disabled"))
t.toggle();};t.getText=function(){return this.children[1].get("text");};t.setText=function(aText){this.children[1].set("text",aText);};t.isChecked=function(){return this.children[0].get("checked");};t.setChecked=function(aChecked){this.children[0].setA("checked",aChecked);};t.showCorrect=function(){if(!this.isCorrect())
this.setChecked(this.get("isCorrect"));};t.isCorrect=function(){if(this.get("display")=="none"||this.get("visibility")=="hidden")
return true;else
return this.get("isCorrect")==this.isChecked();};t.events.PropertyChanged=function(event){if(event.property=="type")
this.children[0].setA("type",event.value);if(event.property=="disabled")
this.children[0].setA("disabled",event.value);};t.events.PageLoaded=function(event){if(this.get("type")!="multiple")
this.children[0].setA("type","single");if(Ida.IE){var elm=this.children[1].elm;elm.style.width="100%";elm.style.paddingLeft="20px";elm.style.marginLeft="0px";}};return t;}};Ida.templates.constructors["Combobox"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.htmlElement="select";t.htmlElement="select";t.defaultProperty="dropDownItems";t.authorCreateable="true";t.objectType="Combobox";t.objectName="Combobox";t.script.canHaveFocus=true;t.script.saveFieldValueAs="";t.script.focused=false;t.script.disabled=false;t.script.mustBeAnswered="yes";t.script.markColorCorrect="#E6FFEB";t.script.markColorWrong="#FFE6E6";t.script.focusBackgroundColor="";t.script.languageDependent=false;t.content.caption="";t.content.defaultText="";t.content.dropDownItems="";t.content.predefinedAnswers="";t.content.predefinedAnswersSeparator=";";t.style.width="100px";t.style.height="20px";t.style.fontFamily="";t.style.fontSize="";t.style.fontWeight="";t.style.fontStyle="";t.style.backgroundColor="#ffffff";t.style.color="";t.style.borderWidth="";t.style.borderStyle="";t.setValue=function(label){if(label=="")
this.elm.selectedIndex=0;else
this.elm.value=label;};t.getValue=function(){return this.elm.value;};t.saveVariable=function(){var varName=this.get("saveFieldValueAs");if(varName)
Ida.setVariable(varName,this.getValue());};t.createDropDownItems=function(){var entries=this.get("dropDownItems");if(entries==null||entries==undefined)
{return;}else if(typeof entries!='string')
{entries=String(entries);}while(this.elm.firstChild) this.elm.removeChild(this.elm.firstChild);entries=entries.split("\n");var doc=this.doc;for(var i=0;i<entries.length;i++)
{var elm=doc.createElement("option");elm.value=entries[i];elm.innerHTML=entries[i];this.elm.appendChild(elm);}};t.isCorrect=function(){if(this.get("mustBeAnswered")=="no")
return true;var answer=Ida.f.convertTo(this.get("predefinedAnswers"),"string");var userInput=String(this.getValue());var splitter=this.get("predefinedAnswersSeparator");answer=answer.toLowerCase();userInput=userInput.toLowerCase();splitter=splitter.toLowerCase();answer=answer.replace(new RegExp(splitter,"g"),"\n");var allAnswers=answer.split("\n");for(var i=0;i<allAnswers.length;i++){if(String(allAnswers[i])==userInput)
return true;}return false;};t.showCorrect=function(){var answer=this.get("predefinedAnswers");if(typeof answer.split!="undefined")
answer=answer.split(this.get("predefinedAnswersSeparator"))[0];this.setValue(answer);};t.mark=function(){var lColor;if(this.isCorrect()) lColor=this.get("markColorCorrect");else lColor=this.get("markColorWrong");this.setA("backgroundColor",lColor);};t.highlight=function(high){var bg=this.get(high?"focusBackgroundColor":"backgroundColor");if(bg) this.elm.style.backgroundColor=bg;};t.register=function(){Ida.qObj.register(this);Ida.test.register(this);};t.unregister=function(){Ida.qObj.unregister(this);Ida.test.unregister(this);};t.ok=function(){Ida.test.markAsComplete(this,this.isCorrect(),false);};t.events.PropertyChanged=function(event){var p=event.property;if(p=="dropDownItems")
this.createDropDownItems();else if(p=="defaultText")
this.setValue(event.value);else if(p=="mustBeAnswered"){this.mustBeExecuted=event.value;Ida.test.checkNavigation();}else if(p=="disabled")
this.elm.disabled=event.value;};t.events.Ready=function(event){this.elm.setAttribute("size","1");this.createDropDownItems();this.setValue(this.get("defaultText"));var lPage=this.getPage();this.register(lPage);this.mustBeExecuted=this.get("mustBeAnswered");};t.events.focus=function(event){this.setA("focused",true);this.highlight(true);};t.events.blur=function(event){this.setA("focused",false);this.highlight(false);this.saveVariable();this.ok();};return t;}};Ida.templates.constructors["Field"]={construct : function()
{var t=Ida.templates.createObject("textobject");t.defaultProperty="text";t.authorCreateable="true";t.objectType="Field";t.objectName="Field";t.style.backgroundColor="#FFFFFF";t.style.textDecoration="none";t.style.padding="0px 3px 0px 3px";t.style.lineHeight="";t.script.textusage="text";t.isCorrect=function(){if(!this.gaps) return;for(var i=0;i<this.gaps.length;i++){if(!this.gaps[i].isCorrect())
return false;}return true;};t.showCorrect=function(){if(!this.gaps) return;for(var i=0;i<this.gaps.length;i++)
this.gaps[i].showCorrect();};t.mark=function(){if(!this.gaps) return;for(var i=0;i<this.gaps.length;i++)
this.gaps[i].mark();};t.register=function(){var inputs=this.elm.getElementsByTagName("input");this.gaps=[];for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute("idaType")=="gap")
this.gaps[this.gaps.length]=new Ida.GapNode(inputs[i]);}Ida.qObj.register(this);Ida.test.register(this);Ida.test.markAsComplete(this,this.isCorrect(),false);};t.unregister=function(){Ida.qObj.unregister(this);this.gaps=null;Ida.test.unregister(this);};t.events.ContentSet=function(event){if(event.name=="text"){if(event.value&&event.value.indexOf("gap")>0&&
event.value.search(/\<((gap\s)|(input\s))[^>]*idatype\=[\"|\']gap[\"|\']/i)>=0){this.register();this.hasGaps=true;}else if(this.hasGaps){this.unregister();this.hasGaps=false;}if(this.get("hideWhenEmpty")){var lTarget=this.get("hideContainer");if(lTarget){lTarget=this.getTarget(lTarget);if(lTarget)
lTarget.setA("display",event.value?"block":"none");}}}};return t;}};Ida.templates.constructors["FlashMovie"]={construct : function()
{var t=Ida.templates.createObject("mediaobject");t.defaultProperty="src";t.actionSetter="none";t.authorCreateable="true";t.objectType="FlashMovie";t.objectName="FlashMovie";t.setSource=function(val){if(this.elm.firstChild){val=this.makeURI(val);this.elm.firstChild.setAttribute("src",val);}};t.play=function(){this.createMediaObject();if(this.get("visibility")=="hidden")
this.setA("visibility","visible");};t.stop=function(){while(this.elm.firstChild)
this.elm.removeChild(this.elm.firstChild);};t.createMediaObject=function(){var doc=this.doc;var elm;elm=doc.createElement("embed");elm.setAttribute("src",this.makeURI(this.get("src")));elm.setAttribute("width","100%");elm.setAttribute("height","100%");elm.className="flash-movie";while(this.elm.firstChild)
this.elm.removeChild(this.elm.firstChild);this.elm.appendChild(elm);};t.events.Create=function(event){if(this.get("visibility")!="hidden")
this.createMediaObject();};t.events.ContentSet=function(event){if(event.name=="src"&&event.value)
this.setSource(event.value);};t.events.PropertyChanged=function(event){if(event.property=="src"&&Ida.isAuthor())
{Ida.cmd('flashSetOriginalDimensions', this);}};return t;}};Ida.templates.constructors["Freetext"]={construct : function()
{var t=Ida.templates.createObject("Inputfield");t.htmlElement="textarea";t.htmlElement="textarea";t.objectType="Freetext";t.objectName="Freetext";t.content.requiredWords="";t.content.forbiddenWords="";t.script.languageDependent=true;t.script.solutionObject="";t.script.multiline=true;t.isCorrect=function(){if(this.get("mustBeAnswered")=="no")
return true;var userInput=String(this.getValue());var charCount=userInput.length||0;var min=this.get("minLength");if(min&&charCount<min)
return false;var max=this.get("maxLength");if(max>0&&charCount>max)
return false;var required=Ida.f.convertTo(this.get("requiredWords"),"string");var forbidden=Ida.f.convertTo(this.get("forbiddenWords"),"string");var caseSensitive=this.get("caseSensitive");var splitter=this.get("predefinedAnswersSeparator");if(!caseSensitive){forbidden=forbidden.toLowerCase();required=required.toLowerCase();userInput=userInput.toLowerCase();splitter=splitter.toLowerCase();}if(forbidden){var allForbidden=forbidden.split(splitter);for(var i=0;i<allForbidden.length;i++){if(userInput.indexOf(allForbidden[i])>=0)
return false;}}if(required){var allRequired=required.split(splitter);for(var i=0;i<allRequired.length;i++){if(userInput.indexOf(allRequired[i])==-1)
return false;}}return true;};t.showCorrect=function(){var obj=this.get("solutionObject");obj=Ida.getObjectById(obj);if(obj)
obj.show();};t.mark=function(){};return t;}};Ida.templates.constructors["GraphicalCheckbox"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.htmlElement="img";t.htmlElement="img";t.objectType="GraphicalCheckbox";t.objectName="GraphicalCheckbox";t.script.type="multiple";t.script.disabled=false;t.script.checked=false;t.script.checkedGraphic="";t.script.uncheckedGraphic="";t.script.disabledCheckedGraphic="";t.script.disabledUncheckedGraphic="";t.style.borderWidth=0;t.style.width="";t.style.height="";t.getGraphic=function(aGraphic){if(!aGraphic)
aGraphic=this.get("checked")?"checked":"unchecked";var file=this.get(aGraphic + "Graphic");if(!file){file="SET/pic/";file +=(this.get("type")=="multiple")?"checkbox":"radio";file +="_" + aGraphic + ".gif";}return this.makeURI(file);};t.toggle=function(){var type=this.get("type");var checked=this.get("checked");if(type=="single"&&checked) return;this.setA("checked",!checked);};t.events.PropertyChanged=function(event){if(event.property=="type"){this.elm.src=this.getGraphic();}else if(event.property=="checked"){this.elm.src=event.value?this.getGraphic("checked"):this.getGraphic("unchecked");if(event.value&&this.get("type")=="single"){var parent=(this.parent.objectType.toLowerCase()=="choice")?this.parent.parent:this.parent;var allRadiobuttons=parent.getChildrenByObjectType(this.objectType);if(allRadiobuttons.length>0){for(var i=0;i<allRadiobuttons.length;i++){if(allRadiobuttons[i]!=this&&allRadiobuttons[i].get("type")=="single")
allRadiobuttons[i].setA("checked",false);}}}}};t.events.Create=function(event){this.elm.src=this.getGraphic("unchecked");};t.events.PageLoaded=function(event){this.elm.src=this.getGraphic("unchecked");};t.events.click=function(event){if(!this.get("disabled"))
this.toggle();};return t;}};Ida.templates.constructors["graphicalobject"]={construct : function()
{var t=Ida.templates.createObject("idaobject");t.canAnimate="true";t.objectType="graphicalobject";t.objectName="graphicalobject";t.content.title="";t.script.extensions="";t.script.alwaysOnTop=false;t.style.backgroundColor="transparent";t.style.backgroundPosition="50% 50%";t.style.backgroundRepeat="no-repeat";t.style.borderWidth="0px";t.style.borderStyle="solid";t.style.borderColor="";t.style.bottom="";t.style.right="";t.style.display="";t.style.zIndex=0;t.style.visibility="inherit";t.style.cssFloat="";t.style.cursor="auto";t.style.margin=0;t.style.MozOpacity="";t.style.overflow="hidden";return t;}};Ida.templates.constructors["Group"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.objectType="Group";t.objectName="Group";t.style.borderWidth=0;t.style.overflow="visible";t.children=[];return t;}};Ida.templates.constructors["idaobject"]={construct : function()
{var t=new Ida.DLayer();t.htmlElement="div";t.htmlElement="div";t.canAnimate="false";t.objectType="idaobject";t.objectName="idaobject";t.script.name="";t.script.languageDependent=true;t.script.lockedPosition=false;t.style.position="absolute";t.style.top="";t.style.left="";t.style.width="";t.style.height="";return t;}};Ida.templates.constructors["Idapage"]={construct : function()
{var t=Ida.templates.createObject("pageobject");t.objectType="Idapage";t.objectName="Idapage";t.content.label="";t.script.animationlist="";t.script.template="";t.script.nextPage="";t.script.previousPage="";t.script.pageMustBeVisited=true;t.script.focusedObject="";return t;}};Ida.templates.constructors["Idapagetemplate"]={construct : function()
{var t=Ida.templates.createObject("pageobject");t.objectType="Idapagetemplate";t.objectName="Idapagetemplate";t.script.pagetype="undefined";t.script.isTemplate=true;return t;}};Ida.templates.constructors["IFrame"]={construct : function()
{var t=Ida.templates.createObject("mediaobject");t.defaultProperty="src";t.actionSetter="none";t.authorCreateable="true";t.objectType="IFrame";t.objectName="IFrame";t.script.scrolling="auto";t.style.borderWidth="1px";t.style.borderStyle="solid";t.style.borderColor="#888888";t.paint=function(){while(this.elm.firstChild)
this.elm.removeChild(this.elm.firstChild);var src=this.get("src");var isURL=Ida.f.isURL(src);if(src&&!isURL)
src=this.makeURI(src);var ext=src?Ida.f.getFileExtension(src):"";this.elm.setAttribute("extension", ext);if(src&&(isURL||Ida.isValidIframeExtension(ext)))
{this.elm.innerHTML="<iframe frameborder='0' class='iframe' src='" + src +
"' scrolling='" + this.get("scrolling") +
"' onload='this.parentNode.dLayer.dispatchEvent({type:\"FrameLoad\"})'>" +
"</iframe><div class='iframe-mover'></div>";}};t.getWindow=function(){return this.elm.getElementsByTagName("iframe")[0].contentWindow;};t.events.PropertyChanged=function(event){if(event.property.isInList("scrolling,src")||(event.property=="visibility"&&event.value!="hidden"))
this.paint();};t.events.Create=function(event){if(this.get("visibility")!="hidden")
this.paint();};t.events.FrameLoad=function(event){};return t;}};Ida.templates.constructors["Inputfield"]={construct : function()
{var t=Ida.templates.createObject("Simpleinputfield");t.htmlElement="input";t.htmlElement="input";t.defaultProperty="predefinedAnswers";t.authorCreateable="true";t.objectType="Inputfield";t.objectName="Inputfield";t.content.predefinedAnswers="";t.content.alternativeAnswer="";t.content.predefinedAnswersSeparator=";";t.script.disabled=false;t.script.mustBeAnswered="yes";t.script.caseSensitive=false;t.script.minLength=0;t.script.maxLength=0;t.script.markColorCorrect="#E6FFEB";t.script.markColorWrong="#FFE6E6";t.script.focusBackgroundColor="";t.script.focusBorderColor="";t.script.focusBorderWidth="";t.isCorrect=function(){var answer=Ida.f.convertTo(this.get("predefinedAnswers"),"string");var userInput=String(this.getValue());if(answer){var caseSensitive=this.get("caseSensitive");var splitter=this.get("predefinedAnswersSeparator");if(!caseSensitive){answer=answer.toLowerCase();userInput=userInput.toLowerCase();splitter=splitter.toLowerCase();}var doTrim=this.get("trimAnswer");if(doTrim)
userInput=String(userInput).trim();var allAnswers=answer.split(splitter);var a;for(var i=0;i<allAnswers.length;i++){a=doTrim?String(allAnswers[i]).trim():allAnswers[i];if(a==userInput)
return true;}return false;}else{var charCount=userInput.length||0;var min=this.get("minLength");if(min&&charCount<min)
return false;var max=this.get("maxLength");if(max>0&&charCount>max)
return false;return true;}return false;};t.showCorrect=function(){var answer=this.get("predefinedAnswers");if(typeof answer.split!="undefined")
answer=answer.split(this.get("predefinedAnswersSeparator"))[0];if(!answer){var c=this.get("minLength");if(c>0){answer=String(this.get("alternativeAnswer"));if(!answer)
answer=multiplyString("a",c);else if(answer.length<c)
answer=multiplyString(answer,c).substring(0,c);}}this.setValue(answer);};t.mark=function(){var lColor;if(this.isCorrect()) lColor=this.get("markColorCorrect");else lColor=this.get("markColorWrong");this.setA("backgroundColor",lColor);};t.register=function(){Ida.qObj.register(this);Ida.test.register(this);Ida.test.markAsComplete(this,this.isCorrect(),false);};t.unregister=function(){Ida.qObj.unregister(this);Ida.test.unregister(this);};t.ok=function(){Ida.test.markAsComplete(this,this.isCorrect(),false);};t.highlight=function(high){var bg=this.get(high?"focusBackgroundColor":"backgroundColor");var bd=this.get(high?"focusBorderColor":"borderColor");var bw=this.get(high?"focusBorderWidth":"borderWidth");if(bg) this.elm.style.backgroundColor=bg;if(bd) this.elm.style.borderColor=bd;if(bw) this.elm.style.borderWidth=bw;};t.events.Create=function(event){this.mustBeExecuted=this.get("mustBeAnswered");if(document.all&&document.attachEvent){var lWidth=Ida.f.measureToNumber(this.get("width"));if(lWidth>0)
this.setA("width",(lWidth -(this.elm.offsetWidth - lWidth)) + "px");var lHeight=Ida.f.measureToNumber(this.get("height"));if(lHeight>0)
this.setA("height",(lHeight -(this.elm.offsetHeight - lHeight)) + "px");}};t.events.PropertyChanged=function(event){var p=event.property;if(p=="mustBeAnswered"){this.mustBeExecuted=event.value;Ida.test.checkNavigation();}else if(p=="password"&&this.htmlElement=="input")
this.elm.type=event.value?"password":"text";else if(p=="disabled"){this.elm.readOnly=event.value;Ida.f.toggleClassName(this.elm,"disabled",event.value);}};t.events.Ready=function(event){this.register();if(this.get("showSavedValue")){var varName=this.get("saveFieldValueAs");if(varName){var val=Ida.getVariable(varName);this.setA("text",val===null?"":String(val));}}};t.events.focus=function(event){this.setA("focused",true);this.highlight(true);selectText(this.elm);};t.events.blur=function(event){this.setA("focused",false);this.saveVariable();this.highlight(false);this.ok();};t.events.keypress=function(event){var lKey=event.keyCode;if((Ida.KEY[lKey]=="KeyEnter"||lKey==10)&&!this.get("multiline")){if(event.preventDefault)
event.preventDefault();return false;}return true;};return t;}};Ida.templates.constructors["Interaction"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.defaultProperty="action";t.authorCreateable="true";t.objectType="Interaction";t.objectName="Interaction";t.script.action="";t.style.cursor="pointer";t.style.backgroundColor="transparent";t.style.borderWidth="0px";t.style.width="100px";t.style.height="25px";return t;}};Ida.templates.constructors["InteractiveTable"]={construct : function()
{var t=Ida.templates.createObject("Table");t.defaultProperty="text";t.authorCreateable="true";t.objectType="InteractiveTable";t.objectName="InteractiveTable";t.Focus=function(){};t.Blur=function(){};t.Keydown=function(){};return t;}};Ida.templates.constructors["Keyaction"]={construct : function()
{var t=Ida.templates.createObject("idaobject");t.defaultProperty="actionKeys";t.actionSetter="actionKeys";t.authorCreateable="true";t.objectType="Keyaction";t.objectName="Keyaction";t.script.keysetActivated=true;t.script.actionKeys="";t.script.defaultAction="";t.script.evaluate=false;t.style.display="none";t.ok=function(){var qObj=this.questionObject;if(qObj)
qObj.ok();};t.updateKeyset=function(){var keys=this.get("actionKeys");var keyset=this.getKeyset();keyset.activated=keys?this.get("keysetActivated"):false;if(keys)
keyset.setPropertiesFromString(keys);if(this.get("evaluate"))
this.registerQuestion();keyset.evaluate=this.get("evaluate");};t.getKeyset=function(){return this._Keyset;};t.isCorrect=function(){return this.getKeyset().isDone();};t.markAsComplete=function(){Ida.test.markAsComplete(this);this.getKeyset().markAsComplete();};t.registerQuestion=function(){Ida.qObj.register(this);};t.unregisterQuestion=function(){Ida.qObj.unregister(this);};t.setKeyset=function(keyset){if(this._Keyset)
this.unregister();this._Keyset=keyset;this.register();};t.register=function(){Ida.keyListener.registerKeyset(this.getKeyset());};t.unregister=function(){Ida.keyListener.unregisterKeyset(this.getKeyset());this.getKeyset().destroy();};t.events.PropertyChanged=function(event){if(event.property=="keysetActivated")
this.getKeyset().activated=event.value;else if(event.property=="disabled")
this.getKeyset().activated=!event.value;else if(event.property=="actionKeys")
this.updateKeyset();if(event.property=="evaluate"){if(event.value) this.registerQuestion();else this.unregisterQuestion();}};t.events.Create=function(event){this.setKeyset(new Ida.Keyset(null,this));};t.events.Ready=function(event){this.updateKeyset();};t.events.PageUnload=function(event){this.unregister();};return t;}};Ida.templates.constructors["mediaobject"]={construct : function()
{var t=Ida.templates.createObject("idaobject");t.canAnimate="true";t.objectType="mediaobject";t.objectName="mediaobject";t.content.src="";t.style.width="320px";t.style.height="240px";t.style.borderWidth="";t.style.borderStyle="";t.style.borderColor="";t.style.visibility="inherit";return t;}};Ida.templates.constructors["Menu"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.objectType="Menu";t.objectName="Menu";t.script.menuitemDistance="15px";t.script.checkSymbol="SET/pic/menuitem_checksymbol.gif";t.script.menuitemSymbol="SET/pic/menuitem_symbol.gif";t.script.linear=false;t.script.createMenu="";t.script.actionOnAllVisited="";t.script.showStbReferenceLabel=true;t.script.mainMenu=true;t.content.messageLinear="";t.style.fontFamily="";t.style.fontSize="";t.style.fontWeight="";t.style.fontStyle="";t.style.color="";t.style.overflow="visible";t.isMenuitemEnabled=function(item){if(!this.get("linear")) return true;var all=this.getChildrenByObjectType("Menuitem");for(var i=0;i<all.length;i++){if(all[i]==item) return true;if(!all[i].isDone()) return false;}return false;};t.events.PageLoaded=function(event){var distance=this.get("menuitemDistance");distance=distance + " 0px " + distance + " 0px";var curItem;var items=this.getChildrenByObjectType("Menuitem");var allDone=true;var done;var checkSymbol=this.get("checkSymbol");if(checkSymbol)
checkSymbol=this.makeURI(checkSymbol);for(var i=0;i<items.length;i++){curItem=items[i];curItem.setA("margin",distance);done=curItem.isDone();if(allDone&&curItem.get("text")&&!done) allDone=false;if(done&&checkSymbol)
curItem.setCheckSymbol(checkSymbol)
}if(allDone&&Ida.isReader()&&this.hasAction("actionOnAllVisited"))
this.runAction("actionOnAllVisited");var c=this.courseElement;if(c&&!c.course.mainMenu&&this.get("mainMenu"))
{c.course.mainMenu=c.getTargetString(true);}};t.events.PropertyChanged=function(event){if(event.property=="menuitemSymbol"){var items=this.getChildrenByObjectType("Menuitem");for(var i=0;i<items.length;i++)
items[i].setMenuitemSymbol(event.value);}};return t;}};Ida.templates.constructors["Menuitem"]={construct : function()
{var t=Ida.templates.createObject("textobject");t.objectType="Menuitem";t.objectName="Menuitem";t.script.targetPage="";t.script.hideWhenEmpty=true;t.content.menuItemDescription="";t.style.position="relative";t.style.cursor="pointer";t.style.padding="0px 3px 0px 22px";t.style.backgroundPosition="0 3px";t.style.backgroundRepeat="no-repeat";t.style.whiteSpace="normal";t.style.lineHeight="20px";t.style.overflow="visible";t.getTargetCourseElement=function(){var t=this.get("targetPage");return t?new Ida.CourseTarget(t).getCourseElement():null;};t.isDone=function(){var target=this.getTargetCourseElement();return target?target.isDone():false;};t.isEnabled=function(item){return this.parent.isMenuitemEnabled(this);};t.setMenuitemSymbol=function(img){if(!this.get("text"))
return;if(!img)
img=this.parent.get("menuitemSymbol")
this.elm.style.backgroundImage=img?this.makeCSSURI(img):"none";this.elm.style.padding=img?"0px 3px 0px 22px":"0px 3px 0px 0px";};t.setCheckSymbol=function(img){var doc=this.doc;var cElm=doc.createElement("img");cElm.src=img;cElm.style.position="absolute";cElm.style.right="-20px";cElm.style.top="-4px";this.elm.appendChild(cElm);};t.events.click=function(event){if(this.isEnabled()){var target=this.get("targetPage");if(target)
Ida.navigation.goToPage(target);}else{var msg=this.parent.get("messageLinear");if(msg)
Ida.msgBox("",msg);}};t.events.ContentSet=function(event){if(event.name=="text"){if(event.value)
this.setMenuitemSymbol(this.parent.get("menuitemSymbol"));if(this.get("hideWhenEmpty")){var lTarget=this.get("hideContainer");if(lTarget){lTarget=this.getTarget(lTarget);if(lTarget)
lTarget.setA("display",event.value?"block":"none");}}}};return t;}};Ida.templates.constructors["Movie"]={construct : function()
{var t=Ida.templates.createObject("mediaobject");t.defaultProperty="src";t.actionSetter="none";t.authorCreateable="true";t.objectType="Movie";t.objectName="Movie";t.script.autostart=true;t.script.loop=false;t.script.showControls=false;t.getSource=function(){var src=this.get("src");return src?this.makeURI(src):null;};t.createMediaObject=function(start){if(Ida.isReader()){this.deleteVideoObject();while(this.elm.firstChild) this.elm.removeChild(this.elm.firstChild);if(typeof start=="undefined")
start=this.get("autostart");this.videoObject=new Ida.VideoObject(this.getSource(),0,0,start,this.get("loop"),this.get("showControls"));this.videoObject.create(this.elm);}};t.play=function(){this.createMediaObject(true);};t.stop=function(){this.createMediaObject(false);};t.deleteVideoObject=function(){if(this.videoObject)
this.videoObject.destroy();this.videoObject=null;};t.events.PropertyChanged=function(event){if(event.property.isInList("autostart,showControls,src,loop"))
this.createMediaObject();else if(event.property=="visibility"){if(event.value)
this.createMediaObject();else
this.deleteVideoObject();}};t.events.PageShown=function(event){if(this.isVisible())
this.createMediaObject();};t.events.PageUnload=function(event){this.deleteVideoObject();};return t;}};Ida.templates.constructors["Navigation"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.objectType="Navigation";t.objectName="Navigation";t.style.overflow="visible";t.children=[];return t;}};Ida.templates.constructors["pageobject"]={construct : function()
{var t=Ida.templates.createObject("idaobject");t.objectType="pageobject";t.objectName="pageobject";t.script.isPage=true;t.script.dependsOn="";t.style.backgroundColor="transparent";t.style.top="0px";t.style.left="0px";t.children=[];return t;}};Ida.templates.constructors["Picture"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.htmlElement="img";t.htmlElement="img";t.defaultProperty="src";t.authorCreateable="true";t.objectType="Picture";t.objectName="Picture";t.content.src="";t.script.languageDependent=false;t.script.adjustSize=true;t.style.width="";t.style.height="";t.setOriginalSize=function(fromListener){var e=this.elm;if(typeof e.naturalWidth!="undefined"){this.set("width","");e.style.width=e.naturalWidth + "px";if(this.get("width")!=e.naturalWidth + "px")
this.set("width",e.naturalWidth + "px");this.set("height","");e.style.height=e.naturalHeight + "px";if(this.get("height")!=e.naturalHeight + "px")
this.set("height",e.naturalHeight + "px");if(this.selected&&typeof Ida.selection!="undefined")
Ida.selection.update(this);e.style.display="none";e.style.display="block";}};t.correctSize=function(){if(Ida.IE){var borderVals=Ida.f.cssShortHandArray(this.get("borderWidth"));var sum=0;for(var i=0;i<=3;i++){borderVals[i]=parseInt(borderVals[i]);sum +=borderVals[i];}var wp=(borderVals[1] + borderVals[3]);var hp=(borderVals[0] + borderVals[2]);var w=this.get("width");var h=this.get("height");if(w){if(String(w).search("%", 0)!=-1 )
this.elm.style.width=w;else
this.elm.style.width=(parseInt(w) - wp)+ "px";}if(h){if(String(h).search("%", 0)!=-1)
this.elm.style.height=h;else
this.elm.style.height=(parseInt(h) - hp) + "px";}}};t.events.PropertyChanged=function(event){if(event.property=="src"&&(!this.isOnTemplate||this.getPage().complete))
this._checkForResize=true;if(event.property=="borderWidth")
this.correctSize();};t.events.LoadImage=function(event){dLayer=(this.isDLayer)?this:this.dLayer;if(!dLayer.get('imageBroken'))
{if(!Ida.isRuntime()){if(dLayer._checkForResize&&dLayer.get("adjustSize"))
dLayer.setOriginalSize();dLayer._checkForResize=false;}if(dLayer.elm.naturalWidth&&!dLayer.get("width")){dLayer.setA("width",dLayer.elm.naturalWidth + "px");}if(dLayer.elm.naturalHeight&&!dLayer.get("height")){dLayer.setA("height",dLayer.elm.naturalHeight + "px");}}else{dLayer.setA('imageBroken',false);}};t.events.Create=function(event){if(Ida.IE)
{this.correctSize();}else
{this._checkForResize=false;var me=this;if(!Ida.isRuntime()){this.elm.addEventListener("error",function(){var dl=(me.isDLayer&&me||me.dLayer);if(dl)
{dl.setA('imageBroken', true);this.src='chrome://ida/skin/pic/pixel.gif';this.style.background='url(chrome://ida/skin/icons16/brokenImage.gif) top left no-repeat';}else
{Ida.reportError('no dLayer in Picture object. Could not set broken image for "'+this.src+'".',1,'picture.xml#Picture;Event;Create');}},false);}this.elm.addEventListener("load",function(){if(!me.exists){delete me;return;}if(me.dispatchEvent){me.dispatchEvent({type:"LoadImage"});}else{Ida.error('picture.xml: me has no method dispatchEvent.\ntypeof me: '+(typeof me));}delete me;},false);}};t.events.ObjectCreated=function(event){this._checkForResize=true;};return t;}};Ida.templates.constructors["Questionobject"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.actionSetter="none";t.objectType="Questionobject";t.objectName="Questionobject";t.content.answerCorrect1="";t.content.answerCorrect2="";t.content.answerCorrect3="";t.content.answerWrong1="";t.content.answerWrong2="";t.content.answerWrong3="";t.script.actionCorrect="";t.script.actionAfterAttempts="";t.script.attempts=3;t.script.markWhenWrong="after2answer";t.script.showCorrectAnswer=false;t.script.showOK=false;t.script.showNextWhenWrong=false;t.script.confirmOn="Enter";t.script.userDeletable=false;t.script.autoFocus=true;t.script.autoNext=true;t.script.showStbReferenceLabel=true;t.script.tryCount=0;t.script.alwaysOnTop=true;t.script.answerShown=false;t.style.visibility="visible";t.style.overflow="visible";t.style.color="";t.style.lineHeight="";t.children=[];var t_0=Ida.templates.createObject("QObjBtn");t.children.push(t_0);t_0.parent=t;t_0.objectName="QObjBtn";var t_1=Ida.templates.createObject("Keyaction");t.children.push(t_1);t_1.parent=t;t_1.id="tKeyaction0";t_1.script.actionKeys="name:KeyEnter;action:ok";t_1.actions.ok=new Ida.ActionList();t_1.actions.ok.name="ok";t_1.actions.ok.mustBeExecuted="no";t_1.actions.ok.dLayer=t_1;t_1.actions.ok.addAction(new Ida.Action("callMethod",null,null,null,"okByEnter"));t.getRegisteredObjects=function(){if(!this.registeredObjects)
this.registeredObjects=[];return this.registeredObjects;};t.okByEnter=function(){if(this.get("confirmOn").hasString("Enter"))
this.ok();};t.ok=function(){if(this._allreadyCorrect)
{return true;}var lAttempts=this.get("attempts");var tryCount=Number(this.get("tryCount"))+1;var noMoreTries=lAttempts!="infinite"&&tryCount>Number(lAttempts);if(noMoreTries)
{return this.next();}this.setA("tryCount",tryCount);Ida.msgBox.notifyObject=this;var regObj=this.getRegisteredObjects();try
{for(var i=0;i<regObj.length;i++)
{if(typeof regObj[i].isCorrect=="function")
{var b=regObj[i].isCorrect();if(typeof b=="boolean")
{Ida.test.markAsComplete(regObj[i],b);}}}}catch(e)
{}var correctState=this.getCorrectState();var correct=this._isCorrect()||(correctState=="correct");this.onOK({"tryCount":tryCount,"attempts":lAttempts,"isCorrect":correct});if(!correct)
{var lMarkWhenWrong=this.get("markWhenWrong");if(lMarkWhenWrong!="never")
{lMarkNr=Number(lMarkWhenWrong.charAt(5));if(lMarkNr<=tryCount)
{this.mark(regObj);}}var lMessage=this._getMessage("answerWrong",tryCount);var lastTry=false;if(lAttempts=="infinite"&&this.get("showCorrectAnswer"))
{this.showAnswerButton();}else if(tryCount>=Number(lAttempts))
{if(this.get("showCorrectAnswer"))
{this.showAnswerButton();}this.lastTryDone(lMessage);lastTry=true;}if(lMessage&&!noMoreTries)
{if(lastTry)
{this.lastWrongID=Ida.msgBox("",lMessage);}else
{Ida.msgBox("",lMessage);}}return false;}else
{if(this.markedAsWrong)
{this.mark(regObj);}this._allreadyCorrect=true;this.getChildrenByObjectName("ColoredButton")[0].setA("display","none");if(Ida.f.isFunction(this.answeredCorrect))
{this.answeredCorrect();}this.markAsComplete();lMessage=this._getMessage("answerCorrect",tryCount);if(lMessage&&!noMoreTries)
{this.correctID=Ida.msgBox("",lMessage);}else if(!noMoreTries&&this.hasAction("actionCorrect"))
{this.runAction("actionCorrect",false,true);}else
{this.next();}}return true;};t.onOK=function(){};t.mark=function(regObj){if(Ida.f.isFunction(this.markWrong)) this.markWrong();else{for(var i=0;i<regObj.length;i++){if(Ida.f.isFunction(regObj[i].mark))
regObj[i].mark();}}this.markedAsWrong=true;};t.markAsComplete=function(){Ida.test.markAsComplete(this);var regObj=this.getRegisteredObjects();for(var i=0;i<regObj.length;i++){if(typeof regObj[i].markAsComplete=="function")
regObj[i].markAsComplete()
else
Ida.test.markAsComplete(regObj[i]);}Ida.test.checkNavigation();};t.register=function(aObj){var regObj=this.getRegisteredObjects();for(var i=0;i<regObj.length;i++){if(regObj[i]==aObj)
return;}regObj[regObj.length]=aObj;};t.isCorrect=function(){var regObj=this.getRegisteredObjects();for(var i=0;i<regObj.length;i++){if(!regObj[i].isCorrect())
return false;}return true;};t._isCorrect=function(){return Ida.test.isCorrect();};t.showAnswerButton=function(){this.getChildrenByObjectName("ColoredButton")[1].setA("display","block");};t.lastTryDone=function(wrongMsg){this.getChildrenByObjectName("ColoredButton")[0].setA("display","none");if(!wrongMsg&&!this.get("showCorrectAnswer"))
{this.next();}else
{var regObj=this.getRegisteredObjects();for(var i=0;i<regObj.length;i++)
{regObj[i].setA("disabled",true);}if(this.hasAction("actionAfterAttempts"))
{if(this.get("showNextWhenWrong"))
this.getChildrenByObjectName("ColoredButton")[2].setA("display","block");else
this.runAction("actionAfterAttempts",false,true);}else
{this.markAsComplete();}}};t.getCorrectState=function(){var regObj=this.getRegisteredObjects();for(var i=0;i<regObj.length;i++){if(!regObj[i].isCorrect())
return "wrong";}return "correct";};t.unregister=function(aObj){regObj=this.getRegisteredObjects();Array.removeElement(regObj,aObj);if(regObj.length==0){this.remove();}};t._getMessage=function(aMessage, aNumber){var g=this.courseElement&&this.courseElement.course.getProperty('useGlobalFeedback')=='true';for(var i=aNumber;i>0;i--)
{if(g)
{var lMsg=this.courseElement.course.getMessage('global_'+aMessage + String(i));}else
{lMsg=this.get(aMessage + String(i));}if(lMsg) return lMsg;}return null;};t.showAnswer=function(){this.setA("answerShown",true);var regObj=this.getRegisteredObjects();for(var i=0;i<regObj.length;i++)
{if(Ida.f.isFunction(regObj[i].showCorrect))
{regObj[i].showCorrect();}}};t.next=function(){if(this.hasAction("actionAfterAttempts","nextPage"))
{this.markAsComplete();}var answerShown=this.get("answerShown");if(answerShown&&this.hasAction("actionCorrect"))
{this.runAction("actionCorrect",false,true);Ida.test.enableNavigation();}else if(!answerShown&&this.hasAction("actionAfterAttempts"))
{this.runAction("actionAfterAttempts",false,true);}else
{this.markAsComplete();if(this.get("autoNext"))
{Ida.navigation.goNextPage();}}};t.events.PropertyChanged=function(event){if(event.property=="confirmOn")
Ida.test.checkNavigation();else if(event.property=="showOK"){var btn=this.getChildrenByObjectName("QObjBtn")[0];btn.setA("showOK",event.value);}};t.events.MsgBoxNotify=function(event){if(event.msgId==this.correctID)
{this.runAction("actionCorrect",false,true);}else if(event.msgId==this.lastWrongID&&!this.get("showCorrectAnswer")&&!this.get("showNextWhenWrong"))
{this.next();}else if(!this.isWidget)
{var regObj=this.getRegisteredObjects();var select=this.get("tryCount")<this.get("attempts");var focObj;for(var i=0;i<regObj.length;i++){if(Ida.f.isFunction(regObj[i].isCorrect)&&Ida.f.isFunction(regObj[i].focus)&&!regObj[i].isCorrect()){focObj=regObj[i].focus();if(focObj&&select&&focObj.type=="text"&&Ida.f.isFunction(focObj.select))
focObj.select();return;}}}};t.events.GoNextPage=function(event){if(!Ida.navigation.calledByNavObject)
return true;if(this.get("confirmOn").hasString("Next")){var lOldPage=Ida.getPageObject()?Ida.getPageObject().toString():null;var isOk=this.ok();if(!isOk){return false;}return(lOldPage==(Ida.getPageObject()?Ida.getPageObject().toString():null));}};t.events.BeforeCreate=function(event){this._allreadyCorrect=false;this.setA("tryCount",0);Ida.test.questionobject=this;};t.events.Ready=function(event){if(typeof this.initialize!="undefined") this.initialize();var btn=this.getChildrenByObjectName("QObjBtn")[0];btn.setA("showOK",this.get("showOK"));if(this.courseElement&&this.courseElement.course.getProperty('suppressFeedback')=='true')
{this.setA("attempts",1);this.setA("showCorrectAnswer",false);this.courseElement.course.setProperty('useGlobalFeedback','true');}};t.events.PageShown=function(event){if(Ida.isAuthor()||!this.get("autoFocus")||
Ida.getPageObject().get("focusedObject"))
return;var regObj=this.getRegisteredObjects();if(!regObj) return;for(var i=0;i<regObj.length;i++){if(Ida.f.isFunction(regObj[i].focus)&&regObj[i].isVisible()){regObj[i].focus();return;}}};return t;}};Ida.templates.constructors["Rectangle"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.authorCreateable="true";t.objectType="Rectangle";t.objectName="Rectangle";t.style.width="100px";t.style.height="75px";t.style.borderWidth="1px";t.style.borderColor="#000000";return t;}};Ida.templates.constructors["Simpleinputfield"]={construct : function()
{var t=Ida.templates.createObject("textobject");t.htmlElement="input";t.htmlElement="input";t.objectType="Simpleinputfield";t.objectName="Simpleinputfield";t.content.text="";t.script.languageDependent=false;t.script.saveFieldValueAs="";t.script.showSavedValue=true;t.script.multiline=false;t.script.trimAnswer=true;t.script.password=false;t.script.focused=false;t.style.height="20px";t.style.width="50px";t.style.backgroundColor="#FFFFFF";t.style.borderStyle="inset";t.style.borderWidth="1px";t.style.cursor="text";t.style.padding="0px 3px 0px 3px";t.getValue=function(){return String(this.elm.value);};t.setValue=function(val){this.elm.value=String(val);};t.ok=function(byEnter){this.forward("ok",byEnter);};t.saveVariable=function(){var varName=this.get("saveFieldValueAs");if(varName)
Ida.setVariable(varName,this.getValue());};t.events.focus=function(event){this.setA("focused",true);selectText(this.elm);};t.events.blur=function(event){this.setA("focused",false);this.saveVariable();};t.events.BeforeCreate=function(event){this.htmlElement=this.get("multiline")?"textarea":"input";if(this.get("password"))
this.attributes.type="password";};t.events.PageUnload=function(event){if(this.get("focused"))
this.saveVariable();this.elm.blur();};t.events.Ready=function(event){if(this.get("showSavedValue")){var varName=this.get("saveFieldValueAs");if(varName){var val=Ida.getVariable(varName);this.setA("text",val===null?"":String(val));}}};t.events.PropertyChanged=function(event){if(event.property=="password"){this.created=false;var t=this.elm;this.create(true);this.elm.parentNode.replaceChild(this.elm,t);}else if(event.property=="disabled")
this.elm.disabled=event.value;};return t;}};Ida.templates.constructors["Sound"]={construct : function()
{var t=Ida.templates.createObject("idaobject");t.defaultProperty="src";t.actionSetter="none";t.authorCreateable="true";t.objectType="Sound";t.objectName="Sound";t.content.src="";t.script.autostart=true;t.script.forceAutostart=false;t.script.loop=false;t.script.textReference="";t.style.display="none";t.style.visibility="hidden";t.play=function(){var src=this.get("src");if(src)
Ida.audio.play(this.makeURI(src),this.get("loop"));};t.stop=function(){Ida.audio.stop();};t.events.Ready=function(event){this.playOK=this.get("forceAutostart")||this.courseElement&&this.courseElement.isPageLoadSettingOK("playPageLoadSoundOnce")||false;};t.events.PageShown=function(event){if(this.playOK&&Ida.isReader()&&this.get("autostart"))
this.play();};return t;}};Ida.templates.constructors["Table"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.defaultProperty="text";t.authorCreateable="true";t.objectType="Table";t.objectName="Table";t.content.text="";t.script.gridColor="#000000";t.script.allowRowColSizing=true;t.script.sizingBehaviour="auto";t.script.flexibleColumn="right";t.style.fontFamily="";t.style.fontSize="";t.style.fontWeight="";t.style.fontStyle="";t.style.color="";t.style.borderWidth="1px";t.style.width="200px";t.style.height="150px";t.style.overflow="auto";t.style.padding=0;t.getTable=function(){return this.elm.getElementsByTagName("table")[0];};t.createTable=function(rows,cols){if(!isNaN(rows)&&!isNaN(cols)){var colsStr="";var w=Ida.f.measureToNumber(this.get("width"));var h=Ida.f.measureToNumber(this.get("height"));var colCount=Number(cols);var flexRight=this.get("flexibleColumn")=="right";for(var x=0;x<colCount;x++){colsStr +=((flexRight&&x<colCount-1)||(!flexRight&&x>0)) ?
"<col style=\"width:" + Math.round(w/colCount) + "px\">" : "<col>";}var table="<tbody>";var rowCount=Number(rows);for(var i=0;i<rowCount;i++){table +="<tr>";for(x=0;x<colCount;x++)
table +="<td><br></td>";table +="</tr>";}table="<table border='1' bordercolor='" + this.get("gridColor") +
"' frame='void' rules='all' idaalign='left' " +
"idavalign='middle' cellpadding='2' cellspacing='0' style='table-layout:fixed;'>" +
colsStr + table + "</tbody></table>";this.set("text",table);}};t.update=function(){this.set("text",this.elm.innerHTML);};t.reset=function(){this.elm.innerHTML=this.get("text");};t.isCorrect=function(){if(!this.gaps) return;for(var i=0;i<this.gaps.length;i++){if(!this.gaps[i].isCorrect())
return false;}return true;};t.showCorrect=function(){if(!this.gaps) return;for(var i=0;i<this.gaps.length;i++)
this.gaps[i].showCorrect();};t.mark=function(){if(!this.gaps) return;for(var i=0;i<this.gaps.length;i++)
this.gaps[i].mark();};t.register=function(){var inputs=this.elm.getElementsByTagName("input");this.gaps=[];for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute("idaType")=="gap")
this.gaps[this.gaps.length]=new Ida.GapNode(inputs[i]);}Ida.qObj.register(this);Ida.test.register(this);Ida.test.markAsComplete(this,this.isCorrect(),false);};t.unregister=function(){Ida.qObj.unregister(this);this.gaps=null;Ida.test.unregister(this);};t.setFlexColumn=function(pos){var t=this.getTable();if(t){var cols=t.getElementsByTagName("col");if(pos=="left"){cols[cols.length-1].style.width=cols[0].style.width;cols[0].removeAttribute("style");}else{cols[0].style.width=cols[cols.length-1].style.width;cols[cols.length-1].removeAttribute("style");}}};t.adjustRowHeight=function(){var changed=false;var tb=this.getTable();if(tb){var tr=tb.rows;var h;for(var i=0;i<tr.length;i++){h=parseInt(tr[i].style.height);if(h&&tr[i].offsetHeight!=h){tr[i].style.height=tr[i].offsetHeight+"px";changed=true;}}if(changed)
this.update();}return changed;};t.handlePropChanges=function(e){var t=this.getTable();if(t){if(e.property=="gridColor"){t.setAttribute("bordercolor",e.value);}else if(e.property=="flexibleColumn")
this.setFlexColumn(e.value);else
return;this.update();}};t.events.PropertyChanged=function(event){this.handlePropChanges(event);};t.events.ContentSet=function(event){if(event.name=="text"){if(Ida.IE){var t=this.getTable();if(t){var styles=["color","fontSize","fontWeight","fontStyle"];for(var i=0;i<styles.length;i++){var val=this.elm.style[styles[i]];if(val==="")
val=Ida.f.getStyle(this.elm,styles[i]);t.style[styles[i]]=val;}}}if(event.value&&event.value.indexOf("gap")>0&&
event.value.search(/\<((gap\s)|(input\s))[^>]*idatype\=[\"|\']gap[\"|\']/i)>=0){this.register();this.hasGaps=true;}else if(this.hasGaps){this.unregister();this.hasGaps=false;}}};return t;}};Ida.templates.constructors["textobject"]={construct : function()
{var t=Ida.templates.createObject("graphicalobject");t.objectType="textobject";t.objectName="textobject";t.content.text="";t.script.disabled=false;t.script.hideWhenEmpty=false;t.script.hideContainer="SELF";t.script.showFieldVariable="";t.style.fontFamily="";t.style.fontSize="";t.style.fontWeight="";t.style.fontStyle="";t.style.color="";t.style.textTransform="";t.style.textAlign="";t.style.whiteSpace="";t.style.padding=0;t.hasVariable=function(varName){if(this.content["text"]&&String(this.get("text")).match(new RegExp("<variable.*idapattern=.*\\b" + varName + "\\b.*>"))!=null)
return true;return false;};t.updateFieldVariable=function(){var varName=this.get("showFieldVariable");if(varName){var val=Ida.getVariable(varName);val=val===null?"":String(val);if(val===""&&this.htmlElement=="div"){var h=this.get("height");if(h!==0&&(!h||h=="auto"))
val="&nbsp;";}this.setA("text",val);}};t.events.ContentSet=function(event){if(event.name=="text"&&this.get("hideWhenEmpty")){var lTarget=this.get("hideContainer");if(lTarget){lTarget=this.getTarget(lTarget);if(lTarget)
lTarget.setA("display",event.value?"block":"none");}}};t.events.PropertyChanged=function(event){if(event.property=="disabled"){if(this.elm)
this.elm.style.color=(event.value===true)?"GrayText":this.get("color");}else if(event.property=="showFieldVariable"){if(event.value) this.updateFieldVariable();else this.setA("text","");}if(event.property=="textusage")
Ida.f.toggleClassName(this.elm,"speakertext",event.value=="speaker");};t.events.PageLoaded=function(event){this.updateFieldVariable();};t.events.VariableChanged=function(event){if(this.get("showFieldVariable")==event.name)
this.updateFieldVariable();else if(this.hasVariable(event.name)){var allElm=this.elm.getElementsByTagName("span");var regex=new RegExp("\\b" + event.name + "\\b");var pat;for(var i=0;i<allElm.length;i++){pat=allElm[i].getAttribute("idapattern");if(pat&&pat.match(regex))
allElm[i].innerHTML=Ida.getVariableByPattern(pat);}}};return t;}};Ida.templates.constructors["Timer"]={construct : function()
{var t=Ida.templates.createObject("idaobject");t.defaultProperty="action";t.actionSetter="action";t.authorCreateable="true";t.objectType="Timer";t.objectName="Timer";t.script.timerdelay=30;t.script.loopCount=1;t.script.action="";t.style.display="none";t.events.PageShown=function(event){if(Ida.isAuthor()) return;var delay=this.get("timerdelay");var loop=Number(this.get("loopCount"));new Ida.Timer(delay*1000,this,loop).start();};t.events.TimerNotify=function(event){if(this.exists)
this.runAction("action");};return t;}};
Ida.include.fileIsLoaded = true;
