diff --git a/src/main/webapp/static/js/functions.js b/src/main/webapp/static/js/functions.js index 37886d5936085d2be2496ff48cf0fecbab04bf6b..4f0c72a854e3b7768a75bd61cf6bc9bc13f9a31a 100644 --- a/src/main/webapp/static/js/functions.js +++ b/src/main/webapp/static/js/functions.js @@ -1457,15 +1457,21 @@ function o_XHREvent(targetUrl, dirtyCheck, push) { dataType: 'json', success: function(data, textStatus, jqXHR) { try { - o_ainvoke(data); + if(push) { - var businessPath = data['businessPath']; - var documentTitle = data['documentTitle']; - var historyPointId = data['historyPointId']; - if(businessPath) { - o_pushState(historyPointId, documentTitle, businessPath); + try { + var businessPath = data['businessPath']; + var documentTitle = data['documentTitle']; + var historyPointId = data['historyPointId']; + if(businessPath) { + // catch separately - nothing must fail here! + o_pushState(historyPointId, documentTitle, businessPath); + } + } catch(e) { + if(window.console) console.log(e); } } + o_ainvoke(data); } catch(e) { if(window.console) console.log(e); } finally { diff --git a/src/main/webapp/static/js/jquery/qti/jquery.qti.min.js b/src/main/webapp/static/js/jquery/qti/jquery.qti.min.js index 4dd7274bd7065bdf829cc11a7a9656747a3b7cb2..395bab097a4ee9e377700b84bb7bbeb5cca55195 100644 --- a/src/main/webapp/static/js/jquery/qti/jquery.qti.min.js +++ b/src/main/webapp/static/js/jquery/qti/jquery.qti.min.js @@ -1 +1 @@ -(function(a){a.fn.associateInteraction=function(b){var c=a.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,opened:false,unrestricted:false},b);try{if(typeof c.responseValue!="undefined"&&c.responseValue.length>0){drawAssociations(this,c)}if(c.opened){associate(this,c)}}catch(d){if(window.console){console.log(d)}}return this};drawAssociations=function(b,f){var j=b.attr("id");var m=f.responseValue.split(",");var k=jQuery("#"+j+"_panel .association");for(var g=0;g<m.length;g++){var e=m[g].split(" ");var h=jQuery(k.get(g));if(h.size()==0){var l=newAssociationBox(j,f);h=jQuery("#"+l)}var d=jQuery("#"+j+"_items div[data-qti-id='"+e[0]+"']");if(needToBeAvailable(d,j)){d=jQuery(d).clone()}var c=jQuery("#"+j+"_items div[data-qti-id='"+e[1]+"']");if(needToBeAvailable(c,j)){c=jQuery(c).clone()}jQuery(d).addClass("oo-choosed");jQuery(c).addClass("oo-choosed");jQuery(h.find(".association_box.left")).addClass("oo-filled").append(d);jQuery(h.find(".association_box.right")).addClass("oo-filled").append(c)}recalculate(j,f);if(f.unrestricted&&f.opened){addNewAssociationBoxAndEvents(j,f)}};associate=function(f,d){var b=f.attr("id");var c=jQuery("#"+b+" .o_associate_item");initializeGapEvents(c,b,d);var e=jQuery("#"+b+"_panel .association_box");initializeAssociationBoxEvents(e,b,d)};initializeGapEvents=function(c,b,d){c.on("click",function(h,g){var f=jQuery(this);if(!f.hasClass("oo-choosed")&&!f.hasClass("oo-selected")){f.addClass("oo-selected")}}).draggable({containment:"#"+b,scroll:false,revert:"invalid",stop:function(e,f){jQuery(this).css({left:"0px",top:"0px"});jQuery(f.helper).removeClass("oo-drag")},helper:function(){var f=jQuery(this);var g=f.parent(".association_box").size()>0;if(!g&&needToBeAvailable(this,b)){f.removeClass("oo-selected");var e=f.clone();jQuery(e).attr("id","n"+guid()).data("qti-cloned","true").addClass("oo-drag");return e}f.addClass("oo-drag");return f}}).on("click",{formId:d.formDispatchFieldId},setFlexiFormDirtyByListener)};needToBeAvailable=function(g,c){var f=jQuery(g);var e=f.data("qti-match-max");var b=f.data("qti-id");var d=jQuery("#"+c+"_panel div[data-qti-id='"+b+"']").size();return(e==0||d+1<e)};initializeAssociationBoxEvents=function(c,b,d){c.on("click",function(h,f){var g=jQuery(this);var i=jQuery(".o_associate_item",this).size();if(i==1){jQuery(".o_associate_item",this).each(function(e,j){removeGap(j,g,b)})}else{jQuery("#"+b+"_items .o_associate_item.oo-selected").each(function(e,k){var j=jQuery(k);if(needToBeAvailable(k,b)){j.removeClass("oo-selected");moveGap(j.clone(),g,b)}else{moveGap(j,g,b)}})}recalculate(b,d);setFlexiFormDirty(d.formDispatchFieldId,false)}).droppable({drop:function(g,h){var f=jQuery(this);var i=jQuery(".o_associate_item",this).size();if(i>0){jQuery(".o_associate_item",this).each(function(j,k){removeGap(k,f,b)})}var e;if(h.helper!=null&&jQuery(h.helper).data("qti-cloned")=="true"){var e=jQuery(h.draggable);e.removeClass("oo-selected").removeClass("oo-drag");e=e.clone();initializeGapEvents(e,b,d);moveGap(e,f,b)}else{var e=jQuery(h.draggable);e.removeClass("oo-selected").removeClass("oo-drag");moveGap(e,f,b)}recalculate(b,d);setFlexiFormDirty(d.formDispatchFieldId,false)}}).on("click",{formId:d.formDispatchFieldId},setFlexiFormDirtyByListener)};moveGap=function(d,c,b){d.removeClass("oo-selected").css({left:"0px",top:"0px"}).addClass("oo-choosed").appendTo(c);c.addClass("oo-filled")};removeGap=function(g,f,c){f.removeClass("oo-filled");var e=jQuery(g);e.removeClass("oo-choosed");var b=e.data("qti-id");var d=jQuery("#"+c+"_items div[data-qti-id='"+b+"']").size();if(d==0){e.appendTo(jQuery("#"+c+"_items"))}else{e.remove()}};guid=function(){function b(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return b()+b()+b()+b()+b()+b()+b()};recalculate=function(b,d){var c=jQuery("#"+b+"_panel");c.find("input[type='hidden']").remove();jQuery("#"+b+"_panel .association").each(function(e,j){var g=jQuery(j).find(".o_associate_item");if(g.length==2){var h=jQuery(g.get(0)).data("qti-id");var f=jQuery(g.get(1)).data("qti-id");var i=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+d.responseIdentifier).attr("value",h+" "+f);c.prepend(i)}else{if(g.length==0&&d.unrestricted){j.remove()}else{jQuery(j).find(".association_box").each(function(m,l){var k=jQuery(l).find(".o_associate_item").size();if(k==0&&jQuery(l).hasClass("oo-filled")){jQuery(l).removeClass("oo-filled")}})}}});addNewAssociationBoxAndEvents(b,d)};addNewAssociationBoxAndEvents=function(b,e){if(!e.unrestricted||!e.opened){return}var c=jQuery("#"+b+"_panel");var d=true;jQuery("#"+b+"_panel .association").each(function(h,j){var i=jQuery(j).find(".o_associate_item");if(i.length!=2){d=false}});if(d){var g=newAssociationBox(b,e);var f=jQuery("#"+g+" .association_box");initializeAssociationBoxEvents(f,b,e)}};newAssociationBox=function(b,c){var d=guid();var e='<div id="'+d+'" class="association" style="">\n <div class="association_box left" style="width: 100px; height:50px; float:left;"></div>\n <div class="association_box right" style="width: 100px; height:50px; float:right;"></div>\n <div style="clear:both; "></div>\n</div>\n';jQuery("#"+b+"_panel").append(e);jQuery("#"+b+"_panel").append('<div style="clear:both; "></div>\n');return d}}(jQuery));(function(f){f.fn.gapMatchInteraction=function(h){var j=f.extend({responseIdentifier:null,formDispatchFieldId:null,gapChoiceData:{},gapData:{},opened:false,gapChoiceMap:{},gapMap:{},matched:{}},h);for(var i in j.gapChoiceData){var k=jQuery("#qtiworks_id_"+j.responseIdentifier+"_"+i);j.gapChoiceMap[i]={matchMax:j.gapChoiceData[i],matchCount:0,query:k,text:k.text()}}for(var i in j.gapData){var k=jQuery("#qtiworks_id_"+j.responseIdentifier+"_"+i);j.gapMap[i]={required:j.gapData[i],matched:false,matchedGapChoice:null,query:k,label:k.text()}}try{d(this,j)}catch(l){if(window.console){console.log(l)}}return this};function b(j,k,n){var m=k.value;var i=m.split(" ");var h=j.gapChoiceMap[i[0]];var l=j.gapMap[i[1]];n(j,k,m,h,l)}function d(i,h){if(h.opened){e(h.responseIdentifier).on("click",function(){a(h,this);setFlexiFormDirty(h.formDispatchFieldId)})}c(h);g(h)}function e(h){return jQuery("input[name=qtiworks_response_"+h+"]")}function c(j){j.matchCount=0;for(var i in j.gapChoiceMap){j.gapChoiceMap[i].matchCount=0}for(var i in j.gapMap){j.gapMap[i].matched=false;j.gapMap[i].matchedGapChoice=null}e(j.responseIdentifier).each(function(l,m){b(j,this,function(o,p,r,n,q){if(p.checked){n.matchCount++;q.matched=true;q.matchedGapChoice=n;o.matched[r]=true}})});for(var i in j.gapMap){var k=j.gapMap[i];var h;if(k.matched){h=k.matchedGapChoice.text}else{h=k.label}k.query.text(h)}}function g(h){e(h.responseIdentifier).each(function(){b(h,this,function(j,k,m,i,l){if(!j.opened){k.disabled=true}else{if(k.checked){k.disabled=false}else{if(l.matched||(i.matchMax!=0&&i.matchCount>=i.matchMax)){k.disabled=true}else{k.disabled=false}}}})})}function a(h,i){b(h,i,function(k,l,n,j,m){if(l.checked){if(m.matched||(j.matchMax!=0&&j.matchMax<=j.matchCount)){l.checked=false}else{j.matchCount++;m.matched=true;m.matchedGapChoice=j}m.query.text(j.text)}else{j.matchCount--;m.matched=false;m.matchedGapChoice=null;m.query.text(m.label)}g(k)})}}(jQuery));(function(d){d.fn.graphicAssociateInteraction=function(g){var h=d.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxAssociations:1,opened:false},g);try{if(!(typeof h.responseValue==="undefined")&&h.responseValue.length>0){e(this,h.responseValue,h.responseIdentifier)}if(h.opened){c(this,h.maxAssociations,h.responseIdentifier)}}catch(j){if(window.console){console.log(j)}}return this};function c(k,j,h){var g=k.attr("id");jQuery("#"+g+"_container area").on("click",function(t){var l=8;var q=jQuery("#"+g+"_container").data("openolat")||{};if(q.listOfPairs==undefined){q.currentSpot="";q.listOfPairs=[];jQuery("#"+g+"_container").data("openolat",q)}var w=jQuery(this).data("qti-id");if(q.currentSpot==""||q.currentSpot==w){q.currentSpot=w}else{var A=[q.currentSpot,w];q.listOfPairs.push(A);q.currentSpot=""}var m=document.getElementById(g+"_canvas");var u=m.getContext("2d");u.clearRect(0,0,jQuery(m).width(),jQuery(m).height());var B=jQuery("#"+g+"_container");B.find("input[type='hidden']").remove();var z=[];if(q.currentSpot!=""){b(u,"ac_"+h+"_"+q.currentSpot);z.push(q.currentSpot)}for(var p=q.listOfPairs.length;p-->0;){var o=q.listOfPairs[p];for(var n=o.length;n-->0;){if(0>z.indexOf(o[n])){b(u,"ac_"+h+"_"+o[n]);z.push(o[n])}}var s=jQuery("#ac_"+h+"_"+o[1]);var v=jQuery("#ac_"+h+"_"+o[0]);var C=f(s);var y=f(v);u.beginPath();u.moveTo(C[0],C[1]);u.lineTo(y[0],y[1]);u.lineWidth=3;u.stroke();var x=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+h).attr("value",v.data("qti-id")+" "+s.data("qti-id"));B.prepend(x)}})}function e(g,v,t){var o=g.attr("id");var x=jQuery("#"+o+"_container");var k=document.getElementById(o+"_canvas");var q=k.getContext("2d");q.clearRect(0,0,jQuery(k).width(),jQuery(k).height());var w=[];var h=v.split(",");for(var n=h.length;n-->0;){var m=h[n].split(" ");for(var l=m.length;l-->0;){if(0>w.indexOf(m[l])){b(q,"ac_"+t+"_"+m[l]);w.push(m[l])}}if(m.length==2){var p=jQuery("#ac_"+t+"_"+m[1]);var r=jQuery("#ac_"+t+"_"+m[0]);var y=f(p);var u=f(r);q.beginPath();q.moveTo(y[0],y[1]);q.lineTo(u[0],u[1]);q.lineWidth=3;q.stroke();var s=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+t).attr("value",r.data("qti-id")+" "+p.data("qti-id"));x.prepend(s)}}}function b(h,g){jQuery("#"+g).each(function(k,m){var l=jQuery(m);var n=f(l);var j=l.attr("shape");a(h,j,n,0,0)})}function a(j,g,k,h,l){h=h||0;l=l||0;j.beginPath();if(g=="rect"){j.rect(k[0]+h,k[1]+l,k[2]-k[0],k[3]-k[1])}else{if(g=="poly"){j.moveTo(k[0]+h,k[1]+l);for(i=2;i<k.length;i+=2){j.lineTo(k[i]+h,k[i+1]+l)}}else{if(g=="circ"||g=="circle"){j.arc(k[0]+h,k[1]+l,k[2]-2,0,Math.PI*2,false)}}}j.closePath();j.lineWidth=4;j.strokeStyle="#003300";j.stroke();j.fillStyle="green";j.fill()}function f(g){var h=g.attr("coords").split(",");for(i=h.length;i-->0;){h[i]=parseFloat(h[i])}return h}}(jQuery));(function(f){f.fn.graphicGapInteraction=function(j){var k=f.extend({maphilight:null,responseIdentifier:null,formDispatchFieldId:null,responseValue:null,opened:false},j);try{if(!(typeof k.responseValue==="undefined")&&k.responseValue.length>0){b(this,k)}if(k.opened){c(this,k)}}catch(l){if(window.console){console.log(l)}}return this};function b(j,m){var q=j.attr("id");var v=jQuery("#"+q);var l=m.responseValue.split(",");for(var n=l.length;n-->0;){var k=l[n].split(" ");var p=jQuery("#ac_"+m.responseIdentifier+"_"+k[0]);var o=jQuery("#ac_"+m.responseIdentifier+"_"+k[1]);var r,u;if(p.hasClass("gap_item")){r=p;u=o}else{r=o;u=p}var s=g(u);r.css("position","absolute");r.css("left",s[0]+"px");r.css("top",s[1]+"px");r.addClass("oo-choosed");var t=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+m.responseIdentifier).attr("value",r.data("qti-id")+" "+u.data("qti-id"));v.prepend(t)}}function c(l,k){var j=l.attr("id");jQuery(".gap_item").on("click",function(q,p){var o=jQuery(this);if(o.hasClass("oo-choosed")){var n=o.data("drop-timestamp");if(!(typeof n==="undefined")&&n!=null){if((Date.now()-n)<1500){o.data("drop-timestamp",null);return}}o.removeClass("oo-choosed");var m=o.data("qti-id");jQuery("#"+j).find("input[type='hidden']").each(function(r,s){var t=jQuery(s).val();if(t.indexOf(m+" ")==0){jQuery(s).remove()}});o.css({position:"relative",left:"0px",top:"0px"})}else{o.addClass("oo-selected")}}).draggable({containment:"#"+j,scroll:false,revert:"invalid",stop:function(m,n){if(!jQuery(this).hasClass("oo-choosed")){jQuery(this).css({position:"relative",left:"0px",top:"0px"})}}}).mousemove(function(m,s){var u=jQuery(this);if(u.hasClass("ui-draggable-dragging")){var q=jQuery("#"+j+"_img");var p=q.offset();var o=u.offset();var n=o.left+(u.width()/2)-p.left;var t=o.top+(u.height()/2)-p.top;var r=h(n,t,j);if("invalid"!=r){jQuery("#"+j+" area").each(function(v,x){var w=jQuery(x);var y=w.attr("id");if(r==y){w.mouseover()}else{w.mouseout()}});jQuery("#"+r).mouseover()}else{jQuery("#"+j+" area").each(function(v,w){jQuery(w).mouseout()})}}});jQuery("#"+j).droppable({drop:function(m,t){var r=jQuery("#"+j+"_img");var p=r.offset();var u=jQuery(t.draggable);var o=u.offset();var n=o.left+(u.width()/2)-p.left;var w=o.top+(u.height()/2)-p.top;var s=h(n,w,j);if("invalid"!=s){var z=jQuery("#"+s);var v=g(z);var x=z.data("qti-id");var q=u.data("qti-id");u.css("position","absolute");u.css("left",v[0]+"px");u.css("top",v[1]+"px");u.css("border","none");u.removeClass("oo-selected");u.addClass("oo-choosed");var y=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+k.responseIdentifier).attr("value",q+" "+x);jQuery(this).prepend(y);jQuery(z).mouseout();u.data("drop-timestamp",Date.now())}}});jQuery("#"+j+" area").on("click",function(o,n){var m=jQuery(this);jQuery(".gap_item.oo-selected").each(function(q,s){var r=jQuery(s);var t=g(m);var w=m.data("qti-id");var v=r.data("qti-id");r.css("position","absolute");r.css("left",t[0]+"px");r.css("top",t[1]+"px");r.css("border","none");r.removeClass("oo-selected");r.addClass("oo-choosed");var p=jQuery("#"+j);var u=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+k.responseIdentifier).attr("value",v+" "+w);p.prepend(u)})})}function h(l,k,j){var m="invalid";jQuery("#"+j+" area").each(function(r,o){var v=jQuery(o);var u=v.attr("id");var t=v.attr("coords");var s=v.attr("shape");var w=g(v);if("circle"==s){if(a(l,k,w[0],w[1],w[2])){m=u}}else{if("rect"==s){if(d(l,k,w[0],w[1],w[2],w[3])){m=u}}else{if("poly"==s){var n={};n.x=[];n.y=[];var q=w.length/2;var p=0;for(ix=0;ix<q;ix++){n.x[ix]=w[p];n.y[ix]=w[p+1];p+=2}for(i=0;i<n.length;i++){if(e(n.x.length,n.x,n.y,l,k)){m=n.id;break}}}}}});return m}function a(k,o,m,l,j){var n=Math.pow(k-m,2)+Math.pow(o-l,2);return Math.pow(j,2)>=n}function d(j,o,n,l,k,m){if((n<=j)&&(j<=k)&&(l<=o)&&(o<=m)){return true}else{return false}}function e(l,p,o,k,r){var n,m,q=false;for(n=0,m=l-1;n<l;m=n++){if(((o[n]>r)!=(o[m]>r))&&(k<(p[m]-p[n])*(r-o[n])/(o[m]-o[n])+p[n])){q=!q}}return q}function g(j){var k=j.attr("coords").split(",");for(i=k.length;i-->0;){k[i]=parseFloat(k[i])}return k}}(jQuery));(function(c){c.fn.graphicOrderInteraction=function(d){var f=c.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxChoices:1,opened:false},d);try{if(!(typeof f.responseValue==="undefined")&&f.responseValue.length>0){b(this,f)}if(f.opened){a(this,f)}}catch(g){if(window.console){console.log(g)}}return this};function b(d,h){var m=d.attr("id");var r=jQuery("#"+m+"_container");var e=document.getElementById(m+"_canvas");var o=e.getContext("2d");o.clearRect(0,0,jQuery(e).width(),jQuery(e).height());var n=h.responseValue.split(",");for(var k=n.length;k-->0;){if(n[k].length==0){continue}var q=jQuery("#ac_"+h.responseIdentifier+"_"+n[k]);var f=q.data("qti-id");var l=q.attr("coords").split(",");var j=l[0];var g=l[1];o.font="16px Arial";o.fillText(""+(k+1),j,g);var p=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+h.responseIdentifier).attr("value",f);r.prepend(p)}}function a(f,e){var d=f.attr("id");jQuery("#"+d+"_container area").on("click",function(v){var h=8;var x=jQuery(this).attr("id");var l=jQuery(this).data("qti-id");var u=jQuery(this).attr("coords").split(",");var o=u[0];var n=u[1];var t=jQuery("#"+d+"_container").data("openolat")||{};if(t.listOfPoints==undefined){t.listOfPoints=[];jQuery("#"+d+"_container").data("openolat",t)}var s=false;var m=[];for(var q=t.listOfPoints.length;q-->0;){var j=t.listOfPoints[q];var g=((j.x-o)*(j.x-o))+((j.y-n)*(j.y-n));if(h*h>g){s=true}else{m.push(j)}}if(s){t.listOfPoints=m}else{if(t.listOfPoints.length>=e.maxChoices){return false}else{t.listOfPoints.push({x:o,y:n,areaId:x,spotQtiId:l})}}var k=document.getElementById(d+"_canvas");var w=k.getContext("2d");w.clearRect(0,0,jQuery(k).width(),jQuery(k).height());var z=jQuery("#"+d+"_container");z.find("input[type='hidden']").remove();for(var q=t.listOfPoints.length;q-->0;){var j=t.listOfPoints[q];w.font="16px Arial";w.fillText(""+(q+1),j.x,j.y);var y=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+e.responseIdentifier).attr("value",j.spotQtiId);z.prepend(y)}})}}(jQuery));(function(c){c.fn.hotspotInteraction=function(f){var g=c.extend({responseIdentifier:null,formDispatchFieldId:null,maxChoices:1,responseValue:null,opened:false},f);try{if(!(typeof g.responseValue==="undefined")&&g.responseValue.length>0){a(this,g)}if(g.opened){e(this,g)}}catch(h){if(window.console){console.log(h)}}return this};function a(n,k){var f=n.attr("id");var g=jQuery("#"+f);var j=k.responseValue.split(",");for(i=j.length;i-->0;){var h=jQuery("#ac_"+k.responseIdentifier+"_"+j[i]);var l=h.data("maphilight")||{};l.selectedOn=true;b(l);h.data("maphilight",l).trigger("alwaysOn.maphilight");var m=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+k.responseIdentifier).attr("value",h.data("qti-id"));g.append(m)}}function e(h,g){var f=h.attr("id");jQuery("#"+f+" map area").each(function(j,k){jQuery(k).on("click",function(){d(this,f,g.responseIdentifier,g.maxChoices)})})}function d(l,j,n,k){var m=jQuery(l);var h=m.data("maphilight")||{};if((typeof h.selectedOn==="undefined")||!h.selectedOn){var f=k;if(f>0){var g=0;jQuery("area","map[name='"+j+"_map']").each(function(p,r){var q=jQuery(r).data("maphilight")||{};if(q.selectedOn){g++}});if(g>=f){return false}}}if(typeof h.selectedOn==="undefined"){h.selectedOn=true}else{h.selectedOn=!h.selectedOn}b(h);m.data("maphilight",h).trigger("alwaysOn.maphilight");var o=jQuery("#"+j);o.find("input[type='hidden']").remove();jQuery("area","map[name='"+j+"_map']").each(function(p,r){var s=jQuery(r);var q=s.data("maphilight")||{};if(q.selectedOn){var t=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+n).attr("value",s.data("qti-id"));o.append(t)}})}function b(f){if(f.selectedOn){f.fillColor="0000ff";f.fillOpacity=0.5;f.strokeColor="0000ff";f.strokeOpacity=1;f.shadow=true;f.shadowX=0;f.shadowY=0;f.shadowRadius=7;f.shadowColor="000000";f.shadowOpacity=0.8;f.shadowPosition="outside"}else{f.fillColor="bbbbbb";f.fillOpacity=0.5;f.strokeColor="666666";f.strokeOpacity=0.8;f.shadow=false}}}(jQuery));(function(f){f.fn.matchInteraction=function(h){var j=f.extend({responseIdentifier:null,formDispatchFieldId:null,maxAssociations:1,leftData:{},rightData:{},leftMap:{},rightMap:{},matched:[]},h);for(var i in j.leftData){j.leftMap[i]={matchMax:j.leftData[i],matchCount:0}}for(var i in j.rightData){j.rightMap[i]={matchMax:j.rightData[i],matchCount:0}}try{d(this,j)}catch(k){if(window.console){console.log(k)}}return this};function d(i,h){e(h.responseIdentifier).on("click",function(){a(h,this)});c(h);g(h)}function e(h){return jQuery("input[name=qtiworks_response_"+h+"]")}function b(j,l,n){var m=l.value;var h=m.split(" ");var k=j.leftMap[h[0]];var i=j.rightMap[h[1]];n(l,m,k,i)}function c(i){i.matchCount=0;i.matched={};for(var h in i.leftMap){i.leftMap[h].matchCount=0}for(var h in i.rightMap){i.rightMap[h].matchCount=0}e(i.responseIdentifier).each(function(){b(i,this,function(l,m,k,j){if(l.checked){i.matchCount++;k.matchCount++;j.matchCount++;i.matched[m]=true}})})}function g(h){e(h.responseIdentifier).each(function(){b(h,this,function(k,l,j,i){if(k.checked){k.disabled=false}else{if((h.maxAssociations!=0&&h.matchCount>=h.maxAssociations)||(j.matchMax!=0&&j.matchCount>=j.matchMax)||(i.matchMax!=0&&i.matchCount>=i.matchMax)){k.disabled=true}else{k.disabled=false}}})})}function a(h,i){b(h,i,function(m,n,l,k){if(m.checked){var j=false;if(l.matchMax!=0&&l.matchMax<=l.matchCount){m.checked=false}else{l.matchCount++;h.matchCount++;j=true}if(k.matchMax!=0&&k.matchMax<=k.matchCount){m.checked=false}else{k.matchCount++;if(!j){h.matchCount++}}}else{h.matchCount--;l.matchCount--;k.matchCount--}g(h)})}}(jQuery));(function(c){c.fn.orderInteraction=function(d){var f=c.extend({responseIdentifier:null,formDispatchFieldId:null,initialSourceOrder:null,initialTargetOrder:null,responseValue:null,minChoices:null,maxChoices:null},d);try{a(this,f)}catch(g){if(window.console){console.log(g)}}return this};function a(k,f){var j=jQuery("#qtiworks_response_"+f.responseIdentifier);var d=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.target");var g=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.source ul");var i=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.target ul");var e=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.hiddenInputContainer");var h="#qtiworks_response_"+f.responseIdentifier+" ul";g.sortable({connectWith:h,stop:function(){b(f);setFlexiFormDirty(f.formDispatchFieldId)}});g.disableSelection();i.sortable({connectWith:h,stop:function(){b(f);setFlexiFormDirty(f.formDispatchFieldId)}});i.disableSelection()}function b(f){var g=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.source ul");var h=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.target ul");var e=h.children("li").size();if(f.minChoices!=null&&f.maxChoices!=null){if(e<f.minChoices||e>f.maxChoices){if(f.minChoices!=f.maxChoices){alert("You must select and order between "+f.minChoices+" and "+f.maxChoices+" items")}else{alert("You must select and order exactly "+f.minChoices+" item"+(minChoices>1?"s":""))}targetBox.toggleClass("highlight",true);return false}else{targetBox.toggleClass("highlight",false)}}var d=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.hiddenInputContainer");d.empty();h.children("li").each(function(j){var i=this.id.substring("qtiworks_response_".length);var k=jQuery('<input type="hidden">');k.attr("name","qtiworks_response_"+f.responseIdentifier);k.attr("value",i);d.append(k)})}}(jQuery));(function(b){b.fn.positionObjectStage=function(f){var g=b.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxChoices:1,opened:false},f);try{var d=this.attr("id");jQuery("#"+d+" .items_container .o_item.o_"+g.responseIdentifier).each(function(e,i){jQuery(i).attr("id","object-item-"+e)});if(!(typeof g.responseValue==="undefined")&&g.responseValue.length>0){c(this,g)}if(g.opened){a(this,g)}}catch(h){if(window.console){console.log(h)}}return this};function c(d,f){var k=d.attr("id");var r=jQuery("#"+k);var j=f.responseValue.split(":");var l=jQuery("#"+k+" .items_container .o_item.o_"+f.responseIdentifier);for(var h=j.length;h-->0;){var n=j[h].split(" ");var g=n[0];var e=n[1];var q=jQuery(l.get(h));q.css("position","absolute");q.css("top",e+"px");q.css("left",g+"px");var m=q.attr("id");var o="in-"+m+"-"+f.responseIdentifier;var p=jQuery('<input type="hidden"/>').attr("id",o).attr("name","qtiworks_response_"+f.responseIdentifier).attr("value",g+" "+e);r.prepend(p)}}function a(g,f){var d=g.attr("id");var e=jQuery("#"+d);jQuery("#"+d+" .items_container .o_item.o_"+f.responseIdentifier).draggable({containment:"#"+d,scroll:false,stop:function(h,p){var i=jQuery("#"+d+"_img");var k=jQuery(i).offset().top-jQuery(window).scrollTop();var n=jQuery(i).offset().left-jQuery(window).scrollLeft();var m=jQuery(this).offset().top-jQuery(window).scrollTop();var q=jQuery(this).offset().left-jQuery(window).scrollLeft();var l=Math.round((q-n));var j=Math.round((m-k));var o=jQuery(this).attr("id");var r="in-"+o+"-"+f.responseIdentifier;var s=e.find("#"+r);if(s.length==0){var t=jQuery('<input type="hidden"/>').attr("id",r).attr("name","qtiworks_response_"+f.responseIdentifier).attr("value",l+" "+j);e.prepend(t)}else{s.val(l+" "+j)}setFlexiFormDirty(f.formDispatchFieldId)}})}}(jQuery));(function(a){a.fn.qtiAutosave=function(b){var c=a.extend({responseUniqueId:null,formName:null,dispIdField:null,dispId:null,eventIdField:null},b);var f=this.attr("id");var e=jQuery.periodic({period:60000,decay:1,max_period:Number.MAX_VALUE},function(){try{var j=jQuery("#"+f).data("auto-save-periodic");if(jQuery("#"+f).length>0&&(typeof e.dateNowMarker==="undefined"||j==e.dateNowMarker)){var g=new Object();g.dispatchuri=c.dispId;g.dispatchevent="2";g.cid="tmpResponse";g.tmpResponse="qtiworks_presented_"+c.responseUniqueId;g["qtiworks_presented_"+c.responseUniqueId]="1";g["qtiworks_response_"+c.responseUniqueId]=jQuery("#oo_"+c.responseUniqueId).val();var i=jQuery("#"+c.formName).attr("action");jQuery.ajax(i,{type:"POST",data:g,cache:false,dataType:"json",success:function(q,r,o){var m=new Date();var k=m.getHours();var n=m.getMinutes();var l=k+":"+(n<10?"0":"")+n;var p=jQuery("#"+f).parent().get(0);jQuery("div.o_qti_essay_last_save",p).css("display","block");jQuery("span.o_qti_essay_last_save-time",p).html(l)}})}else{e.cancel()}}catch(h){if(window.console){console.log(h)}}});var d=Date.now();e.dateNowMarker=d;jQuery("#"+f).data("auto-save-periodic",d);return this}}(jQuery));(function(e){e.fn.qtiTimer=function(h){var j=e.extend({startTime:null,availableTime:null,formName:null,dispIdField:null,dispId:null,eventIdField:null},h);if(!(typeof window.qti21TestTimer==="undefined")){window.qti21TestTimer.cancel()}var m=this.attr("id");var i=Date.now()-j.startTime;var l=i+j.availableTime;var g=l-Date.now();a(m,j.availableTime,g);var k=jQuery.periodic({period:1000,decay:1,max_period:g+1000},function(){g=l-Date.now();if(g>=0){a(m,j.availableTime,g)}else{k.cancel();f(j)}});window.qti21TestTimer=k;return this};function f(g){jQuery(".o_sel_assessment_item_submit").prop("disabled","true");jQuery(".o_qti_times_up").css("display","inline");c();if(jQuery("#o_qti_run").length>0){o_ffXHREvent(g.formName,g.dispIdField,g.dispId,g.eventIdField,"2",false,false,false,"cid","timesUp")}}function a(k,j,g){var i=b(j);jQuery("#"+k+" .o_qti_timer_duration").html(i);if(g<0){g=0}var h=b(g);jQuery("#"+k+" .o_qti_timer").html(h);if(g<1*60*1000){d(k,"o_panic")}else{if(g<5*60*1000){d(k,"o_5_minutes")}else{if(g<10*60*1000){d(k,"o_10_minutes")}}}}function d(i,h){var g=jQuery("#"+i);if(!g.hasClass(h)){c();g.removeClass("o_10_minutes").removeClass("o_5_minutes").removeClass("o_panic");g.addClass(h);jQuery(".o_qti_times_message."+h).css("display","inline")}}function c(){jQuery(".o_qti_times_message.o_10_minutes").css("display","none");jQuery(".o_qti_times_message.o_5_minutes").css("display","none");jQuery(".o_qti_times_message.o_panic").css("display","none")}function b(i){var j=Math.floor(i/1000);var h=Math.floor(j/60);j=j-(h*60);var g=Math.floor(h/60);h=h-(g*60);return(g<10?"0":"")+g+(h<10?":0":":")+h+(j<10?":0":":")+j}}(jQuery));(function(a){a.fn.selectPointInteraction=function(d){var f=a.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxChoices:1,opened:false},d);try{if(!(typeof f.responseValue==="undefined")&&f.responseValue.length>0){b(this,f)}if(f.opened){c(this,f)}}catch(g){if(window.console){console.log(g)}}return this};function b(d,h){var e=8;var j=d.attr("id");var q=jQuery("#"+j);var n=h.responseValue.split(":");var g=document.getElementById(j+"_canvas");var k=g.getContext("2d");k.clearRect(0,0,jQuery(g).width(),jQuery(g).height());for(i=n.length;i-->0;){if(n[i].length==0){continue}var f=n[i].split(" ");var m=f[0];var l=f[1];k.beginPath();k.arc(m,l,e,0,Math.PI*2,false);k.stroke();k.closePath();var o=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+h.responseIdentifier).attr("value",m+" "+l);q.append(o)}}function c(f,e){var d=f.attr("id");jQuery("#"+d+"_canvas").on("click",function(u,z){var h=8;var q=jQuery(this).offset().top-jQuery(window).scrollTop();var w=jQuery(this).offset().left-jQuery(window).scrollLeft();var n=Math.round((u.clientX-w));var m=Math.round((u.clientY-q));var s=jQuery("#"+d).data("openolat")||{};if(s.listOfPoints==undefined){s.listOfPoints=[];jQuery("#"+d).data("openolat",s)}var o=false;var l=[];for(i=s.listOfPoints.length;i-->0;){var j=s.listOfPoints[i];var g=((j.x-n)*(j.x-n))+((j.y-m)*(j.y-m));if(Math.pow(h,2)>g){o=true}else{l.push(j)}}if(o){s.listOfPoints=l}else{if(s.listOfPoints.length>=e.maxChoices){return false}else{s.listOfPoints.push({x:n,y:m})}}var k=document.getElementById(d+"_canvas");var v=k.getContext("2d");v.clearRect(0,0,jQuery(k).width(),jQuery(k).height());var y=jQuery("#"+d);y.find("input[type='hidden']").remove();for(i=s.listOfPoints.length;i-->0;){var j=s.listOfPoints[i];v.beginPath();v.arc(j.x,j.y,h,0,Math.PI*2,false);v.stroke();v.closePath();var x=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+e.responseIdentifier).attr("value",j.x+" "+j.y);y.append(x)}setFlexiFormDirty(e.formDispatchFieldId)})}}(jQuery));(function(b){b.fn.sliderInteraction=function(c){var d=b.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,min:1,max:1,step:1,orientation:null,isReversed:false,isDiscrete:false,opened:false,initialValue:null},c);try{a(this,d)}catch(f){if(window.console){console.log(f)}}return this};function a(g,d){var e=jQuery("#qtiworks_id_slider_"+d.responseIdentifier);var f=jQuery('input[name="qtiworks_response_'+d.responseIdentifier+'"]');var c=f.get(0).value||d.min;e.slider({value:c,step:d.step,disabled:!d.opened,orientation:d.orientation,min:d.isReversed?-d.max:d.min,max:d.isReversed?-d.min:d.max,slide:function(h,j){var i=d.isReversed?-j.value:j.value;var l=jQuery("#qtiworks_id_slidervalue_"+d.responseIdentifier);var k=jQuery('input[name="qtiworks_response_'+d.responseIdentifier+'"]');k.get(0).value=i;l.text(i);e.slider("value",d.isReversed?-i:i);setFlexiFormDirty(d.formDispatchFieldId)}})}}(jQuery)); \ No newline at end of file +(function(a){a.fn.associateInteraction=function(b){var c=a.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,opened:false,unrestricted:false},b);try{if(typeof c.responseValue!="undefined"&&c.responseValue.length>0){drawAssociations(this,c)}if(c.opened){associate(this,c)}}catch(d){if(window.console){console.log(d)}}return this};drawAssociations=function(b,f){var j=b.attr("id");var m=f.responseValue.split(",");var k=jQuery("#"+j+"_panel .association");for(var g=0;g<m.length;g++){var e=m[g].split(" ");var h=jQuery(k.get(g));if(h.size()==0){var l=newAssociationBox(j,f);h=jQuery("#"+l)}var d=jQuery("#"+j+"_items div[data-qti-id='"+e[0]+"']");if(needToBeAvailable(d,j)){d=jQuery(d).clone()}var c=jQuery("#"+j+"_items div[data-qti-id='"+e[1]+"']");if(needToBeAvailable(c,j)){c=jQuery(c).clone()}jQuery(d).addClass("oo-choosed");jQuery(c).addClass("oo-choosed");jQuery(h.find(".association_box.left")).addClass("oo-filled").append(d);jQuery(h.find(".association_box.right")).addClass("oo-filled").append(c)}recalculate(j,f);if(f.unrestricted&&f.opened){addNewAssociationBoxAndEvents(j,f)}};associate=function(f,d){var b=f.attr("id");var c=jQuery("#"+b+" .o_associate_item");initializeGapEvents(c,b,d);var e=jQuery("#"+b+"_panel .association_box");initializeAssociationBoxEvents(e,b,d)};initializeGapEvents=function(c,b,d){c.on("click",function(h,g){var f=jQuery(this);if(!f.hasClass("oo-choosed")&&!f.hasClass("oo-selected")){f.addClass("oo-selected")}}).draggable({containment:"#"+b,scroll:false,revert:"invalid",stop:function(e,f){jQuery(this).css({left:"0px",top:"0px"});jQuery(f.helper).removeClass("oo-drag")},helper:function(){var f=jQuery(this);var g=f.parent(".association_box").size()>0;if(!g&&needToBeAvailable(this,b)){f.removeClass("oo-selected");var e=f.clone();jQuery(e).attr("id","n"+guid()).data("qti-cloned","true").addClass("oo-drag");return e}f.addClass("oo-drag");return f}}).on("click",{formId:d.formDispatchFieldId},setFlexiFormDirtyByListener)};needToBeAvailable=function(g,c){var f=jQuery(g);var e=f.data("qti-match-max");var b=f.data("qti-id");var d=jQuery("#"+c+"_panel div[data-qti-id='"+b+"']").size();return(e==0||d+1<e)};initializeAssociationBoxEvents=function(c,b,d){c.on("click",function(h,f){var g=jQuery(this);var i=jQuery(".o_associate_item",this).size();if(i==1){jQuery(".o_associate_item",this).each(function(e,j){removeGap(j,g,b)})}else{jQuery("#"+b+"_items .o_associate_item.oo-selected").each(function(e,k){var j=jQuery(k);if(needToBeAvailable(k,b)){j.removeClass("oo-selected");moveGap(j.clone(),g,b)}else{moveGap(j,g,b)}})}recalculate(b,d);setFlexiFormDirty(d.formDispatchFieldId,false)}).droppable({drop:function(g,h){var f=jQuery(this);var i=jQuery(".o_associate_item",this).size();if(i>0){jQuery(".o_associate_item",this).each(function(j,k){removeGap(k,f,b)})}var e;if(h.helper!=null&&jQuery(h.helper).data("qti-cloned")=="true"){var e=jQuery(h.draggable);e.removeClass("oo-selected").removeClass("oo-drag");e=e.clone();initializeGapEvents(e,b,d);moveGap(e,f,b)}else{var e=jQuery(h.draggable);e.removeClass("oo-selected").removeClass("oo-drag");moveGap(e,f,b)}recalculate(b,d);setFlexiFormDirty(d.formDispatchFieldId,false)}}).on("click",{formId:d.formDispatchFieldId},setFlexiFormDirtyByListener)};moveGap=function(d,c,b){d.removeClass("oo-selected").css({left:"0px",top:"0px"}).addClass("oo-choosed").appendTo(c);c.addClass("oo-filled")};removeGap=function(g,f,c){f.removeClass("oo-filled");var e=jQuery(g);e.removeClass("oo-choosed");var b=e.data("qti-id");var d=jQuery("#"+c+"_items div[data-qti-id='"+b+"']").size();if(d==0){e.appendTo(jQuery("#"+c+"_items"))}else{e.remove()}};guid=function(){function b(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return b()+b()+b()+b()+b()+b()+b()};recalculate=function(b,d){var c=jQuery("#"+b+"_panel");c.find("input[type='hidden']").remove();jQuery("#"+b+"_panel .association").each(function(e,j){var g=jQuery(j).find(".o_associate_item");if(g.length==2){var h=jQuery(g.get(0)).data("qti-id");var f=jQuery(g.get(1)).data("qti-id");var i=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+d.responseIdentifier).attr("value",h+" "+f);c.prepend(i)}else{if(g.length==0&&d.unrestricted){j.remove()}else{jQuery(j).find(".association_box").each(function(m,l){var k=jQuery(l).find(".o_associate_item").size();if(k==0&&jQuery(l).hasClass("oo-filled")){jQuery(l).removeClass("oo-filled")}})}}});addNewAssociationBoxAndEvents(b,d)};addNewAssociationBoxAndEvents=function(b,e){if(!e.unrestricted||!e.opened){return}var c=jQuery("#"+b+"_panel");var d=true;jQuery("#"+b+"_panel .association").each(function(h,j){var i=jQuery(j).find(".o_associate_item");if(i.length!=2){d=false}});if(d){var g=newAssociationBox(b,e);var f=jQuery("#"+g+" .association_box");initializeAssociationBoxEvents(f,b,e)}};newAssociationBox=function(b,c){var d=guid();var e='<div id="'+d+'" class="association" style="">\n <div class="association_box left" style="width: 100px; height:50px; float:left;"></div>\n <div class="association_box right" style="width: 100px; height:50px; float:right;"></div>\n <div style="clear:both; "></div>\n</div>\n';jQuery("#"+b+"_panel").append(e);jQuery("#"+b+"_panel").append('<div style="clear:both; "></div>\n');return d}}(jQuery));(function(f){f.fn.gapMatchInteraction=function(h){var j=f.extend({responseIdentifier:null,formDispatchFieldId:null,gapChoiceData:{},gapData:{},opened:false,gapChoiceMap:{},gapMap:{},matched:{}},h);for(var i in j.gapChoiceData){var k=jQuery("#qtiworks_id_"+j.responseIdentifier+"_"+i);j.gapChoiceMap[i]={matchMax:j.gapChoiceData[i],matchCount:0,query:k,text:k.text()}}for(var i in j.gapData){var k=jQuery("#qtiworks_id_"+j.responseIdentifier+"_"+i);j.gapMap[i]={required:j.gapData[i],matched:false,matchedGapChoice:null,query:k,label:k.text()}}try{d(this,j)}catch(l){if(window.console){console.log(l)}}return this};function b(j,k,n){var m=k.value;var i=m.split(" ");var h=j.gapChoiceMap[i[0]];var l=j.gapMap[i[1]];n(j,k,m,h,l)}function d(i,h){if(h.opened){e(h.responseIdentifier).on("click",function(){a(h,this);setFlexiFormDirty(h.formDispatchFieldId)})}c(h);g(h)}function e(h){return jQuery("input[name=qtiworks_response_"+h+"]")}function c(j){j.matchCount=0;for(var i in j.gapChoiceMap){j.gapChoiceMap[i].matchCount=0}for(var i in j.gapMap){j.gapMap[i].matched=false;j.gapMap[i].matchedGapChoice=null}e(j.responseIdentifier).each(function(l,m){b(j,this,function(o,p,r,n,q){if(p.checked){n.matchCount++;q.matched=true;q.matchedGapChoice=n;o.matched[r]=true}})});for(var i in j.gapMap){var k=j.gapMap[i];var h;if(k.matched){h=k.matchedGapChoice.text}else{h=k.label}k.query.text(h)}}function g(h){e(h.responseIdentifier).each(function(){b(h,this,function(j,k,m,i,l){if(!j.opened){k.disabled=true}else{if(k.checked){k.disabled=false}else{if(l.matched||(i.matchMax!=0&&i.matchCount>=i.matchMax)){k.disabled=true}else{k.disabled=false}}}})})}function a(h,i){b(h,i,function(k,l,n,j,m){if(l.checked){if(m.matched||(j.matchMax!=0&&j.matchMax<=j.matchCount)){l.checked=false}else{j.matchCount++;m.matched=true;m.matchedGapChoice=j}m.query.text(j.text)}else{j.matchCount--;m.matched=false;m.matchedGapChoice=null;m.query.text(m.label)}g(k)})}}(jQuery));(function(d){d.fn.graphicAssociateInteraction=function(g){var h=d.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxAssociations:1,opened:false},g);try{if(!(typeof h.responseValue==="undefined")&&h.responseValue.length>0){e(this,h.responseValue,h.responseIdentifier)}if(h.opened){c(this,h.maxAssociations,h.responseIdentifier)}}catch(j){if(window.console){console.log(j)}}return this};function c(k,j,h){var g=k.attr("id");jQuery("#"+g+"_container area").on("click",function(t){var l=8;var q=jQuery("#"+g+"_container").data("openolat")||{};if(q.listOfPairs==undefined){q.currentSpot="";q.listOfPairs=[];jQuery("#"+g+"_container").data("openolat",q)}var w=jQuery(this).data("qti-id");if(q.currentSpot==""||q.currentSpot==w){q.currentSpot=w}else{var A=[q.currentSpot,w];q.listOfPairs.push(A);q.currentSpot=""}var m=document.getElementById(g+"_canvas");var u=m.getContext("2d");u.clearRect(0,0,jQuery(m).width(),jQuery(m).height());var B=jQuery("#"+g+"_container");B.find("input[type='hidden']").remove();var z=[];if(q.currentSpot!=""){b(u,"ac_"+h+"_"+q.currentSpot);z.push(q.currentSpot)}for(var p=q.listOfPairs.length;p-->0;){var o=q.listOfPairs[p];for(var n=o.length;n-->0;){if(0>z.indexOf(o[n])){b(u,"ac_"+h+"_"+o[n]);z.push(o[n])}}var s=jQuery("#ac_"+h+"_"+o[1]);var v=jQuery("#ac_"+h+"_"+o[0]);var C=f(s);var y=f(v);u.beginPath();u.moveTo(C[0],C[1]);u.lineTo(y[0],y[1]);u.lineWidth=3;u.stroke();var x=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+h).attr("value",v.data("qti-id")+" "+s.data("qti-id"));B.prepend(x)}})}function e(g,v,t){var o=g.attr("id");var x=jQuery("#"+o+"_container");var k=document.getElementById(o+"_canvas");var q=k.getContext("2d");q.clearRect(0,0,jQuery(k).width(),jQuery(k).height());var w=[];var h=v.split(",");for(var n=h.length;n-->0;){var m=h[n].split(" ");for(var l=m.length;l-->0;){if(0>w.indexOf(m[l])){b(q,"ac_"+t+"_"+m[l]);w.push(m[l])}}if(m.length==2){var p=jQuery("#ac_"+t+"_"+m[1]);var r=jQuery("#ac_"+t+"_"+m[0]);var y=f(p);var u=f(r);q.beginPath();q.moveTo(y[0],y[1]);q.lineTo(u[0],u[1]);q.lineWidth=3;q.stroke();var s=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+t).attr("value",r.data("qti-id")+" "+p.data("qti-id"));x.prepend(s)}}}function b(h,g){jQuery("#"+g).each(function(k,m){var l=jQuery(m);var n=f(l);var j=l.attr("shape");a(h,j,n,0,0)})}function a(j,g,k,h,l){h=h||0;l=l||0;j.beginPath();if(g=="rect"){j.rect(k[0]+h,k[1]+l,k[2]-k[0],k[3]-k[1])}else{if(g=="poly"){j.moveTo(k[0]+h,k[1]+l);for(i=2;i<k.length;i+=2){j.lineTo(k[i]+h,k[i+1]+l)}}else{if(g=="circ"||g=="circle"){j.arc(k[0]+h,k[1]+l,k[2]-2,0,Math.PI*2,false)}}}j.closePath();j.lineWidth=4;j.strokeStyle="#003300";j.stroke();j.fillStyle="green";j.fill()}function f(g){var h=g.attr("coords").split(",");for(i=h.length;i-->0;){h[i]=parseFloat(h[i])}return h}}(jQuery));(function(f){f.fn.graphicGapInteraction=function(j){var k=f.extend({maphilight:null,responseIdentifier:null,formDispatchFieldId:null,responseValue:null,opened:false},j);try{if(!(typeof k.responseValue==="undefined")&&k.responseValue.length>0){b(this,k)}if(k.opened){c(this,k)}}catch(l){if(window.console){console.log(l)}}return this};function b(j,m){var q=j.attr("id");var v=jQuery("#"+q);var l=m.responseValue.split(",");for(var n=l.length;n-->0;){var k=l[n].split(" ");var p=jQuery("#ac_"+m.responseIdentifier+"_"+k[0]);var o=jQuery("#ac_"+m.responseIdentifier+"_"+k[1]);var r,u;if(p.hasClass("gap_item")){r=p;u=o}else{r=o;u=p}var s=g(u);r.css("position","absolute");r.css("left",s[0]+"px");r.css("top",s[1]+"px");r.addClass("oo-choosed");var t=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+m.responseIdentifier).attr("value",r.data("qti-id")+" "+u.data("qti-id"));v.prepend(t)}}function c(l,k){var j=l.attr("id");jQuery(".gap_item").on("click",function(q,p){var o=jQuery(this);if(o.hasClass("oo-choosed")){var n=o.data("drop-timestamp");if(!(typeof n==="undefined")&&n!=null){if((Date.now()-n)<1500){o.data("drop-timestamp",null);return}}o.removeClass("oo-choosed");var m=o.data("qti-id");jQuery("#"+j).find("input[type='hidden']").each(function(r,s){var t=jQuery(s).val();if(t.indexOf(m+" ")==0){jQuery(s).remove()}});o.css({position:"relative",left:"0px",top:"0px"})}else{o.addClass("oo-selected")}}).draggable({containment:"#"+j,scroll:false,revert:"invalid",stop:function(m,n){if(!jQuery(this).hasClass("oo-choosed")){jQuery(this).css({position:"relative",left:"0px",top:"0px"})}}}).mousemove(function(m,s){var u=jQuery(this);if(u.hasClass("ui-draggable-dragging")){var q=jQuery("#"+j+"_img");var p=q.offset();var o=u.offset();var n=o.left+(u.width()/2)-p.left;var t=o.top+(u.height()/2)-p.top;var r=h(n,t,j);if("invalid"!=r){jQuery("#"+j+" area").each(function(v,x){var w=jQuery(x);var y=w.attr("id");if(r==y){w.mouseover()}else{w.mouseout()}});jQuery("#"+r).mouseover()}else{jQuery("#"+j+" area").each(function(v,w){jQuery(w).mouseout()})}}});jQuery("#"+j).droppable({drop:function(m,t){var r=jQuery("#"+j+"_img");var p=r.offset();var u=jQuery(t.draggable);var o=u.offset();var n=o.left+(u.width()/2)-p.left;var w=o.top+(u.height()/2)-p.top;var s=h(n,w,j);if("invalid"!=s){var z=jQuery("#"+s);var v=g(z);var x=z.data("qti-id");var q=u.data("qti-id");u.css("position","absolute");u.css("left",v[0]+"px");u.css("top",v[1]+"px");u.css("border","none");u.removeClass("oo-selected");u.addClass("oo-choosed");var y=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+k.responseIdentifier).attr("value",q+" "+x);jQuery(this).prepend(y);jQuery(z).mouseout();u.data("drop-timestamp",Date.now())}}});jQuery("#"+j+" area").on("click",function(o,n){var m=jQuery(this);jQuery(".gap_item.oo-selected").each(function(q,s){var r=jQuery(s);var t=g(m);var w=m.data("qti-id");var v=r.data("qti-id");r.css("position","absolute");r.css("left",t[0]+"px");r.css("top",t[1]+"px");r.css("border","none");r.removeClass("oo-selected");r.addClass("oo-choosed");var p=jQuery("#"+j);var u=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+k.responseIdentifier).attr("value",v+" "+w);p.prepend(u)})})}function h(l,k,j){var m="invalid";jQuery("#"+j+" area").each(function(r,o){var v=jQuery(o);var u=v.attr("id");var t=v.attr("coords");var s=v.attr("shape");var w=g(v);if("circle"==s){if(a(l,k,w[0],w[1],w[2])){m=u}}else{if("rect"==s){if(d(l,k,w[0],w[1],w[2],w[3])){m=u}}else{if("poly"==s){var n={};n.x=[];n.y=[];var q=w.length/2;var p=0;for(ix=0;ix<q;ix++){n.x[ix]=w[p];n.y[ix]=w[p+1];p+=2}for(i=0;i<n.length;i++){if(e(n.x.length,n.x,n.y,l,k)){m=n.id;break}}}}}});return m}function a(k,o,m,l,j){var n=Math.pow(k-m,2)+Math.pow(o-l,2);return Math.pow(j,2)>=n}function d(j,o,n,l,k,m){if((n<=j)&&(j<=k)&&(l<=o)&&(o<=m)){return true}else{return false}}function e(l,p,o,k,r){var n,m,q=false;for(n=0,m=l-1;n<l;m=n++){if(((o[n]>r)!=(o[m]>r))&&(k<(p[m]-p[n])*(r-o[n])/(o[m]-o[n])+p[n])){q=!q}}return q}function g(j){var k=j.attr("coords").split(",");for(i=k.length;i-->0;){k[i]=parseFloat(k[i])}return k}}(jQuery));(function(c){c.fn.graphicOrderInteraction=function(d){var f=c.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxChoices:1,opened:false},d);try{if(!(typeof f.responseValue==="undefined")&&f.responseValue.length>0){b(this,f)}if(f.opened){a(this,f)}}catch(g){if(window.console){console.log(g)}}return this};function b(d,h){var m=d.attr("id");var r=jQuery("#"+m+"_container");var e=document.getElementById(m+"_canvas");var o=e.getContext("2d");o.clearRect(0,0,jQuery(e).width(),jQuery(e).height());var n=h.responseValue.split(",");for(var k=n.length;k-->0;){if(n[k].length==0){continue}var q=jQuery("#ac_"+h.responseIdentifier+"_"+n[k]);var f=q.data("qti-id");var l=q.attr("coords").split(",");var j=l[0];var g=l[1];o.font="16px Arial";o.fillText(""+(k+1),j,g);var p=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+h.responseIdentifier).attr("value",f);r.prepend(p)}}function a(f,e){var d=f.attr("id");jQuery("#"+d+"_container area").on("click",function(v){var h=8;var x=jQuery(this).attr("id");var l=jQuery(this).data("qti-id");var u=jQuery(this).attr("coords").split(",");var o=u[0];var n=u[1];var t=jQuery("#"+d+"_container").data("openolat")||{};if(t.listOfPoints==undefined){t.listOfPoints=[];jQuery("#"+d+"_container").data("openolat",t)}var s=false;var m=[];for(var q=t.listOfPoints.length;q-->0;){var j=t.listOfPoints[q];var g=((j.x-o)*(j.x-o))+((j.y-n)*(j.y-n));if(h*h>g){s=true}else{m.push(j)}}if(s){t.listOfPoints=m}else{if(t.listOfPoints.length>=e.maxChoices){return false}else{t.listOfPoints.push({x:o,y:n,areaId:x,spotQtiId:l})}}var k=document.getElementById(d+"_canvas");var w=k.getContext("2d");w.clearRect(0,0,jQuery(k).width(),jQuery(k).height());var z=jQuery("#"+d+"_container");z.find("input[type='hidden']").remove();for(var q=t.listOfPoints.length;q-->0;){var j=t.listOfPoints[q];w.font="16px Arial";w.fillText(""+(q+1),j.x,j.y);var y=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+e.responseIdentifier).attr("value",j.spotQtiId);z.prepend(y)}})}}(jQuery));(function(c){c.fn.hotspotInteraction=function(f){var g=c.extend({responseIdentifier:null,formDispatchFieldId:null,maxChoices:1,singleChoice:false,responseValue:null,opened:false,maphilightSettings:{}},f);try{if(!(typeof g.responseValue==="undefined")&&g.responseValue.length>0){a(this,g)}if(g.opened){e(this,g)}}catch(h){if(window.console){console.log(h)}}return this};function a(n,k){var f=n.attr("id");var g=jQuery("#"+f);var j=k.responseValue.split(",");for(i=j.length;i-->0;){var h=jQuery("#ac_"+k.responseIdentifier+"_"+j[i]);var l=h.data("maphilight")||{};l.selectedOn=true;b(l,k.maphilightSettings);h.data("maphilight",l).trigger("alwaysOn.maphilight");var m=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+k.responseIdentifier).attr("value",h.data("qti-id"));g.append(m)}}function e(h,g){var f=h.attr("id");jQuery("#"+f+" map area").each(function(j,k){jQuery(k).on("click",function(){d(this,f,g.responseIdentifier,g.maxChoices,g.singleChoice,g.maphilightSettings)})})}function d(l,j,o,k,q,m){var n=jQuery(l);var h=n.data("maphilight")||{};if((typeof h.selectedOn==="undefined")||!h.selectedOn){if(q){jQuery("area","map[name='"+j+"_map']").each(function(r,t){var s=jQuery(t).data("maphilight")||{};if(s.selectedOn){s.selectedOn=false;b(s,m);jQuery(t).data("maphilight",s).trigger("alwaysOn.maphilight")}})}var f=k;if(f>0){var g=0;jQuery("area","map[name='"+j+"_map']").each(function(r,t){var s=jQuery(t).data("maphilight")||{};if(s.selectedOn){g++}});if(g>=f){return false}}}if(typeof h.selectedOn==="undefined"){h.selectedOn=true}else{h.selectedOn=!h.selectedOn}b(h,m);n.data("maphilight",h).trigger("alwaysOn.maphilight");var p=jQuery("#"+j);p.find("input[type='hidden']").remove();jQuery("area","map[name='"+j+"_map']").each(function(r,t){var u=jQuery(t);var s=u.data("maphilight")||{};if(s.selectedOn){var v=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+o).attr("value",u.data("qti-id"));p.append(v)}})}function b(g,f){if(g.selectedOn){g.fillColor=f.selectedFillColor;g.fillOpacity=f.selectedFillOpacity;g.strokeColor=f.selectedStrokeColor;g.strokeOpacity=f.selectedStrokeOpacity;g.shadow=f.selectedShadow;g.shadowX=0;g.shadowY=0;g.shadowRadius=7;g.shadowColor="000000";g.shadowOpacity=0.8;g.shadowPosition="outside"}else{g.fillColor=f.fillColor;g.fillOpacity=f.fillOpacity;g.strokeColor=f.strokeColor;g.strokeOpacity=f.strokeOpacity;g.shadow=false}}}(jQuery));(function(f){f.fn.matchInteraction=function(h){var j=f.extend({responseIdentifier:null,formDispatchFieldId:null,maxAssociations:1,leftData:{},rightData:{},leftMap:{},rightMap:{},matched:[]},h);for(var i in j.leftData){j.leftMap[i]={matchMax:j.leftData[i],matchCount:0}}for(var i in j.rightData){j.rightMap[i]={matchMax:j.rightData[i],matchCount:0}}try{d(this,j)}catch(k){if(window.console){console.log(k)}}return this};function d(i,h){e(h.responseIdentifier).on("click",function(){a(h,this)});c(h);g(h)}function e(h){return jQuery("input[name=qtiworks_response_"+h+"]")}function b(j,l,n){var m=l.value;var h=m.split(" ");var k=j.leftMap[h[0]];var i=j.rightMap[h[1]];n(l,m,k,i)}function c(i){i.matchCount=0;i.matched={};for(var h in i.leftMap){i.leftMap[h].matchCount=0}for(var h in i.rightMap){i.rightMap[h].matchCount=0}e(i.responseIdentifier).each(function(){b(i,this,function(l,m,k,j){if(l.checked){i.matchCount++;k.matchCount++;j.matchCount++;i.matched[m]=true}})})}function g(h){e(h.responseIdentifier).each(function(){b(h,this,function(k,l,j,i){if(k.checked){k.disabled=false}else{if((h.maxAssociations!=0&&h.matchCount>=h.maxAssociations)||(j.matchMax!=0&&j.matchCount>=j.matchMax)||(i.matchMax!=0&&i.matchCount>=i.matchMax)){k.disabled=true}else{k.disabled=false}}})})}function a(h,i){b(h,i,function(m,n,l,k){if(m.checked){var j=false;if(l.matchMax!=0&&l.matchMax<=l.matchCount){m.checked=false}else{l.matchCount++;h.matchCount++;j=true}if(k.matchMax!=0&&k.matchMax<=k.matchCount){m.checked=false}else{k.matchCount++;if(!j){h.matchCount++}}}else{h.matchCount--;l.matchCount--;k.matchCount--}g(h)})}}(jQuery));(function(c){c.fn.orderInteraction=function(d){var f=c.extend({responseIdentifier:null,formDispatchFieldId:null,initialSourceOrder:null,initialTargetOrder:null,responseValue:null,minChoices:null,maxChoices:null},d);try{a(this,f)}catch(g){if(window.console){console.log(g)}}return this};function a(k,f){var j=jQuery("#qtiworks_response_"+f.responseIdentifier);var d=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.target");var g=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.source ul");var i=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.target ul");var e=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.hiddenInputContainer");var h="#qtiworks_response_"+f.responseIdentifier+" ul";g.sortable({connectWith:h,stop:function(){b(f);setFlexiFormDirty(f.formDispatchFieldId)}});g.disableSelection();i.sortable({connectWith:h,stop:function(){b(f);setFlexiFormDirty(f.formDispatchFieldId)}});i.disableSelection()}function b(f){var g=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.source ul");var h=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.target ul");var e=h.children("li").size();if(f.minChoices!=null&&f.maxChoices!=null){if(e<f.minChoices||e>f.maxChoices){if(f.minChoices!=f.maxChoices){alert("You must select and order between "+f.minChoices+" and "+f.maxChoices+" items")}else{alert("You must select and order exactly "+f.minChoices+" item"+(minChoices>1?"s":""))}targetBox.toggleClass("highlight",true);return false}else{targetBox.toggleClass("highlight",false)}}var d=jQuery("#qtiworks_response_"+f.responseIdentifier+" div.hiddenInputContainer");d.empty();h.children("li").each(function(j){var i=this.id.substring("qtiworks_response_".length);var k=jQuery('<input type="hidden">');k.attr("name","qtiworks_response_"+f.responseIdentifier);k.attr("value",i);d.append(k)})}}(jQuery));(function(b){b.fn.positionObjectStage=function(f){var g=b.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxChoices:1,opened:false},f);try{var d=this.attr("id");jQuery("#"+d+" .items_container .o_item.o_"+g.responseIdentifier).each(function(e,i){jQuery(i).attr("id","object-item-"+e)});if(!(typeof g.responseValue==="undefined")&&g.responseValue.length>0){c(this,g)}if(g.opened){a(this,g)}}catch(h){if(window.console){console.log(h)}}return this};function c(d,f){var k=d.attr("id");var r=jQuery("#"+k);var j=f.responseValue.split(":");var l=jQuery("#"+k+" .items_container .o_item.o_"+f.responseIdentifier);for(var h=j.length;h-->0;){var n=j[h].split(" ");var g=n[0];var e=n[1];var q=jQuery(l.get(h));q.css("position","absolute");q.css("top",e+"px");q.css("left",g+"px");var m=q.attr("id");var o="in-"+m+"-"+f.responseIdentifier;var p=jQuery('<input type="hidden"/>').attr("id",o).attr("name","qtiworks_response_"+f.responseIdentifier).attr("value",g+" "+e);r.prepend(p)}}function a(g,f){var d=g.attr("id");var e=jQuery("#"+d);jQuery("#"+d+" .items_container .o_item.o_"+f.responseIdentifier).draggable({containment:"#"+d,scroll:false,stop:function(h,p){var i=jQuery("#"+d+"_img");var k=jQuery(i).offset().top-jQuery(window).scrollTop();var n=jQuery(i).offset().left-jQuery(window).scrollLeft();var m=jQuery(this).offset().top-jQuery(window).scrollTop();var q=jQuery(this).offset().left-jQuery(window).scrollLeft();var l=Math.round((q-n));var j=Math.round((m-k));var o=jQuery(this).attr("id");var r="in-"+o+"-"+f.responseIdentifier;var s=e.find("#"+r);if(s.length==0){var t=jQuery('<input type="hidden"/>').attr("id",r).attr("name","qtiworks_response_"+f.responseIdentifier).attr("value",l+" "+j);e.prepend(t)}else{s.val(l+" "+j)}setFlexiFormDirty(f.formDispatchFieldId)}})}}(jQuery));(function(a){a.fn.qtiAutosave=function(b){var c=a.extend({responseUniqueId:null,formName:null,dispIdField:null,dispId:null,eventIdField:null},b);var f=this.attr("id");var e=jQuery.periodic({period:60000,decay:1,max_period:Number.MAX_VALUE},function(){try{var j=jQuery("#"+f).data("auto-save-periodic");if(jQuery("#"+f).length>0&&(typeof e.dateNowMarker==="undefined"||j==e.dateNowMarker)){var g=new Object();g.dispatchuri=c.dispId;g.dispatchevent="2";g.cid="tmpResponse";g.tmpResponse="qtiworks_presented_"+c.responseUniqueId;g["qtiworks_presented_"+c.responseUniqueId]="1";g["qtiworks_response_"+c.responseUniqueId]=jQuery("#oo_"+c.responseUniqueId).val();var i=jQuery("#"+c.formName).attr("action");jQuery.ajax(i,{type:"POST",data:g,cache:false,dataType:"json",success:function(q,r,o){var m=new Date();var k=m.getHours();var n=m.getMinutes();var l=k+":"+(n<10?"0":"")+n;var p=jQuery("#"+f).parent().get(0);jQuery("div.o_qti_essay_last_save",p).css("display","block");jQuery("span.o_qti_essay_last_save-time",p).html(l)}})}else{e.cancel()}}catch(h){if(window.console){console.log(h)}}});var d=Date.now();e.dateNowMarker=d;jQuery("#"+f).data("auto-save-periodic",d);return this}}(jQuery));(function(e){e.fn.qtiTimer=function(h){var j=e.extend({startTime:null,availableTime:null,formName:null,dispIdField:null,dispId:null,eventIdField:null},h);if(!(typeof window.qti21TestTimer==="undefined")){window.qti21TestTimer.cancel()}var m=this.attr("id");var i=Date.now()-j.startTime;var l=i+j.availableTime;var g=l-Date.now();a(m,j.availableTime,g);var k=jQuery.periodic({period:1000,decay:1,max_period:g+1000},function(){g=l-Date.now();if(g>=0){a(m,j.availableTime,g)}else{k.cancel();f(j)}});window.qti21TestTimer=k;return this};function f(g){jQuery(".o_sel_assessment_item_submit").prop("disabled","true");jQuery(".o_qti_times_up").css("display","inline");c();if(jQuery("#o_qti_run").length>0){o_ffXHREvent(g.formName,g.dispIdField,g.dispId,g.eventIdField,"2",false,false,false,"cid","timesUp")}}function a(k,j,g){var i=b(j);jQuery("#"+k+" .o_qti_timer_duration").html(i);if(g<0){g=0}var h=b(g);jQuery("#"+k+" .o_qti_timer").html(h);if(g<1*60*1000){d(k,"o_panic")}else{if(g<5*60*1000){d(k,"o_5_minutes")}else{if(g<10*60*1000){d(k,"o_10_minutes")}}}}function d(i,h){var g=jQuery("#"+i);if(!g.hasClass(h)){c();g.removeClass("o_10_minutes").removeClass("o_5_minutes").removeClass("o_panic");g.addClass(h);jQuery(".o_qti_times_message."+h).css("display","inline")}}function c(){jQuery(".o_qti_times_message.o_10_minutes").css("display","none");jQuery(".o_qti_times_message.o_5_minutes").css("display","none");jQuery(".o_qti_times_message.o_panic").css("display","none")}function b(i){var j=Math.floor(i/1000);var h=Math.floor(j/60);j=j-(h*60);var g=Math.floor(h/60);h=h-(g*60);return(g<10?"0":"")+g+(h<10?":0":":")+h+(j<10?":0":":")+j}}(jQuery));(function(a){a.fn.selectPointInteraction=function(d){var f=a.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,maxChoices:1,opened:false},d);try{if(!(typeof f.responseValue==="undefined")&&f.responseValue.length>0){b(this,f)}if(f.opened){c(this,f)}}catch(g){if(window.console){console.log(g)}}return this};function b(d,h){var e=8;var j=d.attr("id");var q=jQuery("#"+j);var n=h.responseValue.split(":");var g=document.getElementById(j+"_canvas");var k=g.getContext("2d");k.clearRect(0,0,jQuery(g).width(),jQuery(g).height());for(i=n.length;i-->0;){if(n[i].length==0){continue}var f=n[i].split(" ");var m=f[0];var l=f[1];k.beginPath();k.arc(m,l,e,0,Math.PI*2,false);k.stroke();k.closePath();var o=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+h.responseIdentifier).attr("value",m+" "+l);q.append(o)}}function c(f,e){var d=f.attr("id");jQuery("#"+d+"_canvas").on("click",function(u,z){var h=8;var q=jQuery(this).offset().top-jQuery(window).scrollTop();var w=jQuery(this).offset().left-jQuery(window).scrollLeft();var n=Math.round((u.clientX-w));var m=Math.round((u.clientY-q));var s=jQuery("#"+d).data("openolat")||{};if(s.listOfPoints==undefined){s.listOfPoints=[];jQuery("#"+d).data("openolat",s)}var o=false;var l=[];for(i=s.listOfPoints.length;i-->0;){var j=s.listOfPoints[i];var g=((j.x-n)*(j.x-n))+((j.y-m)*(j.y-m));if(Math.pow(h,2)>g){o=true}else{l.push(j)}}if(o){s.listOfPoints=l}else{if(s.listOfPoints.length>=e.maxChoices){return false}else{s.listOfPoints.push({x:n,y:m})}}var k=document.getElementById(d+"_canvas");var v=k.getContext("2d");v.clearRect(0,0,jQuery(k).width(),jQuery(k).height());var y=jQuery("#"+d);y.find("input[type='hidden']").remove();for(i=s.listOfPoints.length;i-->0;){var j=s.listOfPoints[i];v.beginPath();v.arc(j.x,j.y,h,0,Math.PI*2,false);v.stroke();v.closePath();var x=jQuery('<input type="hidden"/>').attr("name","qtiworks_response_"+e.responseIdentifier).attr("value",j.x+" "+j.y);y.append(x)}setFlexiFormDirty(e.formDispatchFieldId)})}}(jQuery));(function(b){b.fn.sliderInteraction=function(c){var d=b.extend({responseIdentifier:null,formDispatchFieldId:null,responseValue:null,min:1,max:1,step:1,orientation:null,isReversed:false,isDiscrete:false,opened:false,initialValue:null},c);try{a(this,d)}catch(f){if(window.console){console.log(f)}}return this};function a(g,d){var e=jQuery("#qtiworks_id_slider_"+d.responseIdentifier);var f=jQuery('input[name="qtiworks_response_'+d.responseIdentifier+'"]');var c=f.get(0).value||d.min;e.slider({value:c,step:d.step,disabled:!d.opened,orientation:d.orientation,min:d.isReversed?-d.max:d.min,max:d.isReversed?-d.min:d.max,slide:function(h,j){var i=d.isReversed?-j.value:j.value;var l=jQuery("#qtiworks_id_slidervalue_"+d.responseIdentifier);var k=jQuery('input[name="qtiworks_response_'+d.responseIdentifier+'"]');k.get(0).value=i;l.text(i);e.slider("value",d.isReversed?-i:i);setFlexiFormDirty(d.formDispatchFieldId)}})}}(jQuery)); \ No newline at end of file diff --git a/src/main/webapp/static/js/js.plugins.min.js b/src/main/webapp/static/js/js.plugins.min.js index c579ab10a6e0fb8f0d00b5c1bbd4844b8a50ca15..ccc494770c2aceb18a525ecbcd1e318579d6eba7 100644 --- a/src/main/webapp/static/js/js.plugins.min.js +++ b/src/main/webapp/static/js/js.plugins.min.js @@ -5,7 +5,7 @@ * Dual licensed under the MIT or GPL Version 2 licenses. * */ -jQuery.periodic=function(l,h){if(jQuery.isFunction(l)){h=l;l={}}var c=jQuery.extend({},jQuery.periodic.defaults,{ajax_complete:j,increment:g,reset:f,cancel:i},l);c.cur_period=c.period;c.tid=false;var e="";b();return c;function b(){i();c.tid=setTimeout(function(){h.call(c);g();if(c.tid){b()}},c.cur_period)}function j(n,m){if(m==="success"&&e!==n.responseText){e=n.responseText;f()}}function g(){c.cur_period*=c.decay;if(c.cur_period<c.period){f()}else{if(c.cur_period>c.max_period){c.cur_period=c.max_period;if(c.on_max!==undefined){c.on_max.call(c)}}}}function f(){c.cur_period=c.period;b()}function i(){clearTimeout(c.tid);c.tid=null}function k(){}function a(){}function d(){}};jQuery.periodic.defaults={period:4000,max_period:1800000,decay:1.5,on_max:undefined};var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();(function(b){b.fn.ooLog=function(f,d,e){var c=null;b(this).each(function(){c=b(this).data("_ooLog");if(c==undefined){c=new a();b(this).data("_ooLog",c)}});if(f==undefined){return c}else{if(typeof f==="string"){if(c){c.log(f,d,e)}}}};function a(){return this}a.prototype={isDebugEnabled:function(){return o_info.JSTracingLogDebugEnabled},log:function(e,c,d){if(!this.isDebugEnabled()){return}jQuery.post(o_info.JSTracingUri,{level:e,logMsg:c,jsFile:d})}}})(jQuery);(function(b){b.fn.ooTranslator=function(){var d=null;b(document).each(function(){d=b(document).data("_ooTranslator");if(d==undefined){d=new a();b(document).data("_ooTranslator",d)}});return d};function a(){return this}a.prototype={mapperUrl:null,translators:null,initialize:function(d){this.mapperUrl=d;this.translators=new Object()},getTranslator:function(d,f){if(this.translators[d]==null){this.translators[d]=new Object()}if(this.translators[d][f]==null){var e=this.mapperUrl+"/"+d+"/"+f+"/translations.js";jQuery.ajax(e,{async:false,dataType:"json",success:function(g,i,h){jQuery(document).ooTranslator()._createTranslator(g,d,f)}})}return this.translators[d][f]},_createTranslator:function(e,d,f){this.translators[d][f]=new c().initialize(e,d,f)}};function c(){return this}c.prototype={localizationData:null,bundle:null,locale:null,initialize:function(f,d,e){this.bundle=e;this.locale=d;this.localizationData=f;return this},translate:function(d){if(this.localizationData[d]){return this.localizationData[d]}else{return this.bundle+":"+d}}}})(jQuery);+function(b){var a=function(){this.addExtraElements();this.state={busy:false,brandW:0,sitesW:0,sitesDirty:false,sites:{collapsed:this.isSitesCollapsed(),extended:this.isSitesExtended},tabsW:0,tabsDirty:false,tabs:{collapsed:this.isTabsCollapsed(),extended:this.isTabsExtended()},toolsW:0,toolsDirty:false,tools:{collapsed:this.isToolsCollapsed(),extended:this.isToolsExtended()},offCanvasWidth:0,moreW:0};var c=b("#o_offcanvas_right").css("width");if(c){this.state.offCanvasWidth=parseInt(c.replace(/[^\d.]/g,""));this.initListners();this.calculateWidth();this.optimize()}};a.prototype.initListners=function(){b(window).resize(b.proxy(this.onResizeCallback,this));b(document).on("oo.nav.sites.modified",b.proxy(function(){this.state.sitesDirty=true},this));b(document).on("oo.nav.tabs.modified",b.proxy(function(){this.state.tabsDirty=true},this));b(document).on("oo.nav.tools.modified",b.proxy(function(){this.state.toolsDirty=true},this));b(document).on("oo.dom.replacement.after",b.proxy(this.onDOMreplacementCallback,this));b(window).on("orientationchange",b.proxy(this.hideRight,this));b("#o_navbar_right-toggle").on("click",b.proxy(this.toggleRight,this));b("#o_offcanvas_right .o_offcanvas_close").on("click",b.proxy(this.hideRight,this));b("#o_navbar_more").on("shown.bs.dropdown",this.onDropdownShown);b("#o_navbar_more").on("hidden.bs.dropdown",this.onDropdownHidden)};a.prototype.onResizeCallback=function(){if(!this.state.busy){this.state.busy=true;this.calculateWidth();this.optimize();this.state.busy=false}};a.prototype.onDOMreplacementCallback=function(){if(!this.state.busy&&(this.state.sitesDirty||this.state.tabsDirty||this.state.toolsDirty)){this.state.busy=true;this.cleanupMoreDropdown();this.calculateWidth();this.optimize();this.state.sitesDirty=false;this.state.tabsDirty=false;this.state.toolsDirty=false;this.state.busy=false}};a.prototype.onDropdownShown=function(c){var f=b("#o_navbar_more .dropdown-menu");if(f.length){var d=f.offset().left;if(d<0){f.removeClass("dropdown-menu-right")}}};a.prototype.onDropdownHidden=function(c){var d=b("#o_navbar_more .dropdown-menu");d.addClass("dropdown-menu-right")};a.prototype.calculateWidth=function(){var c=b("#o_navbar_container .o_navbar-collapse");this.state.navbarW=c.innerWidth();this.state.brandW=b(".o_navbar-brand").outerWidth(true);this.state.sitesW=this.getSites().outerWidth(true);this.state.tabsW=this.getTabs().outerWidth(true);this.state.toolsW=this.getTools().outerWidth(false);this.state.moreW=b("#o_navbar_more:visible").outerWidth(true)};a.prototype.getOverflow=function(c){var d=this.state.navbarW;d-=this.state.sitesW;d-=this.state.tabsW;d-=this.state.toolsW;d-=this.state.brandW;d-=this.state.moreW;d-=25;return -d};a.prototype.optimize=function(h){var c=this.getOverflow();var k=this.getSites();var l=this.getTabs();var g=this.getTools();var n=this.getMoreDropdown();var f=this.getOffcanvasRight();this.updateState();while(c>0&&(!this.state.tabs.collapsed||!this.state.sites.collapsed||!this.state.tools.collapsed)){if(!this.state.tabs.collapsed){this.collapse(l,n,"li","o_dropdown_tab")}else{if(!this.state.sites.collapsed){this.collapse(k,n,"li","o_dropdown_site")}else{if(!this.state.tools.collapsed){this.collapse(g,f,".o_navbar_tool:not(#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu)","o_tool_right")}}}this.calculateWidth();c=this.getOverflow();this.updateState()}while(c<0&&(!this.state.tabs.extended||!this.state.sites.extended||!this.state.tools.extended)){if(!this.state.tools.extended){var m=this.extend(f,g.children("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").first(),".o_tool_right","o_tool_right",true);if(!m){break}}if(!this.state.sites.extended){var j=this.extend(n,k,"li","o_dropdown_site");if(!j){break}}else{if(!this.state.tabs.extended){var d=this.extend(n,l,"li","o_dropdown_tab");if(!d){break}}}this.calculateWidth();c=this.getOverflow();this.updateState()}if(this.state.sites.extended&&this.state.tabs.extended){var i=b("#o_navbar_more");i.css("display","none")}this.checkToolsOrder()};a.prototype.updateState=function(){this.state.sites.collapsed=this.isSitesCollapsed();this.state.sites.extended=this.isSitesExtended();this.state.tabs.collapsed=this.isTabsCollapsed();this.state.tabs.extended=this.isTabsExtended();this.state.tools.collapsed=this.isToolsCollapsed();this.state.tools.extended=this.isToolsExtended()};a.prototype.collapse=function(g,d,c,f){var e=g.find(c);if(e.length){e=e.last()}if(e.length){f&&e.addClass(f);if(d){e.prependTo(d)}}this.updateDropdownToggle(g)};a.prototype.extend=function(g,d,c,i,f){var e=g.find(c);if(e.length){e=e.first()}var j=false;if(e.length){if(d&&d.length){if(f){d.before(e)}else{e.appendTo(d)}this.updateDropdownToggle(g);this.calculateWidth();var h=this.getOverflow();if(h>0){e.prependTo(g)}else{i&&e.removeClass(i);j=true}}}this.updateDropdownToggle(g);return j};a.prototype.updateDropdownToggle=function(c){var d=c.parents(".o_dropdown_toggle");if(!d.length){return}if(c.children().length){d.css("display","block")}else{d.css("display","none")}};a.prototype.addExtraElements=function(){var d=b("#o_navbar_container .o_navbar-collapse");var c=b("#o_navbar_more");if(c.length==0){c=b('<ul id="o_navbar_more" class="nav o_navbar-nav o_dropdown_toggle"><li><a class="dropdown-toggle" data-toggle="dropdown" href="#"">'+o_info.i18n_topnav_more+' <b class="caret"></b></a><ul class="dropdown-menu dropdown-menu-right"></ul></li></ul>');c.appendTo(d)}this.getSites().append('<li class="divider o_dropdown_site"></li>');b("#o_navbar_help .o_icon, #o_navbar_print .o_icon").addClass("o_icon-fw")};a.prototype.cleanupMoreDropdown=function(){if(!this.state.sitesDirty){var f=this.getSites();var d=this.getMoreDropdown().children(".o_dropdown_site");d.appendTo(f)}else{this.getSites().append('<li class="divider o_dropdown_site"></li>')}if(!this.state.tabsDirty){var e=this.getTabs();var c=this.getMoreDropdown().children(".o_dropdown_tab");c.prependTo(e)}this.getMoreDropdown().empty()};a.prototype.checkToolsOrder=function(){var f=this.getTools();var e=f.find("#o_navbar_help");var d=f.find("#o_navbar_print");var c=f.find("#o_navbar_imclient");if(c&&d){c.after(d)}if(c&&e){c.after(e)}};a.prototype.showRight=function(){if(!this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;var d=this;var c=b("#o_offcanvas_right");c.show().transition({x:-d.state.offCanvasWidth},function(){b("body").addClass("o_offcanvas_right_visible");var e=b.proxy(d.hideRightOnClick,d);setTimeout(function(){b("html").on("click",e);d.offcanvasTransitioning=false},10)})}};a.prototype.hideRightOnClick=function(c){if("INPUT"!=c.target.nodeName){this.hideRight()}};a.prototype.hideRight=function(){if(this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;b("html").off("click",b.proxy(this.hideRight,this));var d=this;var c=b("#o_offcanvas_right");c.transition({x:d.state.offCanvasWidth},function(){c.hide();b("body").removeClass("o_offcanvas_right_visible");d.offcanvasTransitioning=false})}};a.prototype.toggleRight=function(){if(this.isOffcanvasVisible()){this.hideRight()}else{this.showRight()}};a.prototype.isOffcanvasVisible=function(){return b("#o_offcanvas_right:visible").length};a.prototype.getSites=function(){return b("#o_navbar_container .o_navbar_sites")};a.prototype.getTabs=function(){return b("#o_navbar_container .o_navbar_tabs")};a.prototype.getTools=function(){return b("#o_navbar_container #o_navbar_tools_permanent")};a.prototype.getMoreDropdown=function(){return b("#o_navbar_more .dropdown-menu")};a.prototype.getOffcanvasRight=function(){return b("#o_offcanvas_right_container .o_navbar-right")};a.prototype.isSitesCollapsed=function(){return !this.getSites().children("li").not(".divider").length};a.prototype.isSitesExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_site").not(".divider").length};a.prototype.isTabsCollapsed=function(){return !this.getTabs().children("li").length};a.prototype.isTabsExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_tab").length};a.prototype.isToolsCollapsed=function(){return !this.getTools().children(".o_navbar_tool").not("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").length};a.prototype.isToolsExtended=function(){return !this.getOffcanvasRight().children(".o_tool_right").length};b(document).ready(function(){var d=b("#o_navbar_wrapper");if(d){var c=new a();window.OPOL.navbar=c}})}(jQuery);+function(b){b.fn.ooBgCarrousel=function(){return new a()};var a=function(){};a.prototype.initCarrousel=function(g){this.settings=b.extend({query:null,images:[],shuffle:false,shuffleFirst:false,durationshow:5000,durationout:500,durationin:500,easeout:"ease",easein:"ease"},g);this.pos=null;if(this.settings.query==null||this.settings.images.length==0){return}this.initialImage=this.settings.images[0];if(this.settings.shuffle){var f=this.settings.images;for(var d,c,e=f.length;e;d=parseInt(Math.random()*e),c=f[--e],f[e]=f[d],f[d]=c){}}if(this.settings.shuffleFirst){this._replaceImage()}this.rotate()};a.prototype.rotate=function(){setTimeout(b.proxy(this._hideCurrent,this),this.settings.durationshow)};a.prototype._hideCurrent=function(){var c=b(this.settings.query);if(c&&c.size()>0){c.transition({opacity:0,duration:this.settings.durationout,easing:this.settings.easeout},b.proxy(this._showNext,this))}};a.prototype._replaceImage=function(d){if(!d){d=b(this.settings.query)}if(d&&d.size()>0){this.newImg="";this.oldImg="";if(this.pos==null){this.pos=1;this.oldImg=this.initialImage}else{this.oldImg=this.settings.images[this.pos];this.pos++;if(this.settings.images.length==this.pos){this.pos=0}}this.newImg=this.settings.images[this.pos];var c=d.css("background-image");if(c.indexOf(this.oldImg)==-1){d.transition({opacity:1,duration:0});return}var e=c.replace(this.oldImg,this.newImg);d.css("background-image",e)}};a.prototype._showNext=function(){var c=b(this.settings.query);this._replaceImage(c);c.transition({opacity:1,duration:this.settings.durationin,easing:this.settings.easein},b.proxy(this.rotate,this))}}(jQuery);!function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=i(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function r(e){var n,r=this;if(null!=e)t.call(r),r.each(function(t,n){var r;(r=tinymce.get(n.id))&&r.setContent(e)});else if(r.length>0&&(n=tinymce.get(r[0].id)))return n.getContent()}function i(e){var t=null;return e&&e.id&&a.tinymce&&(t=tinymce.get(e.id)),t}function o(e){return!!(e&&e.length&&a.tinymce&&e.is(":tinymce"))}var s={};e.each(["text","html","val"],function(t,a){var l=s[a]=e.fn[a],c="text"===a;e.fn[a]=function(t){var a=this;if(!o(a))return l.apply(a,arguments);if(t!==n)return r.call(a.filter(":tinymce"),t),l.apply(a.not(":tinymce"),arguments),a;var s="",u=arguments;return(c?a:a.eq(0)).each(function(t,n){var r=i(n);s+=r?c?r.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):r.getContent({save:!0}):l.apply(e(n),u)}),s}}),e.each(["append","prepend"],function(t,r){var a=s[r]=e.fn[r],l="prepend"===r;e.fn[r]=function(e){var t=this;return o(t)?e!==n?("string"==typeof e&&t.filter(":tinymce").each(function(t,n){var r=i(n);r&&r.setContent(l?e+r.getContent():r.getContent()+e)}),a.apply(t.not(":tinymce"),arguments),t):void 0:a.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,r){var i=s[r]=e.fn[r];e.fn[r]=function(){return t.call(this,r),i.apply(this,arguments)}}),s.attr=e.fn.attr,e.fn.attr=function(t,a){var l=this,c=arguments;if(!t||"value"!==t||!o(l))return a!==n?s.attr.apply(l,c):s.attr.apply(l,c);if(a!==n)return r.call(l.filter(":tinymce"),a),s.attr.apply(l.not(":tinymce"),c),l;var u=l[0],d=i(u);return d?d.getContent({save:!0}):s.attr.apply(e(u),c)}}var n,r,i,o=[],a=window;e.fn.tinymce=function(n){function s(){var r=[],o=0;i||(t(),i=!0),d.each(function(e,t){var i,a=t.id,s=n.oninit;a||(t.id=a=tinymce.DOM.uniqueId()),tinymce.get(a)||(i=new tinymce.Editor(a,n,tinymce.EditorManager),r.push(i),i.on("init",function(){var e,t=s;d.css("visibility",""),s&&++o==r.length&&("string"==typeof t&&(e=t.indexOf(".")===-1?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,r))}))}),e.each(r,function(e,t){t.render()})}var l,c,u,d=this,f="";if(!d.length)return d;if(!n)return window.tinymce?tinymce.get(d[0].id):null;if(d.css("visibility","hidden"),a.tinymce||r||!(l=n.script_url))1===r?o.push(s):s();else{r=1,c=l.substring(0,l.lastIndexOf("/")),l.indexOf(".min")!=-1&&(f=".min"),a.tinymce=a.tinyMCEPreInit||{base:c,suffix:f},l.indexOf("gzip")!=-1&&(u=n.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(f)+"&themes="+escape(n.theme||"modern")+"&plugins="+escape(n.plugins||"")+"&languages="+(u||""),a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+u+".js"),t("themes/"+n.theme+"/theme"+f+".js"),t("themes/"+n.theme+"/langs/"+u+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+f+".js"),t("plugins/"+n+"/langs/"+u+".js"))})},end:function(){}}));var p=document.createElement("script");p.type="text/javascript",p.onload=p.onreadystatechange=function(t){t=t||window.event,2===r||"load"!=t.type&&!/complete|loaded/.test(p.readyState)||(tinymce.dom.Event.domLoaded=1,r=2,n.script_loaded&&n.script_loaded(),s(),e.each(o,function(e,t){t()}))},p.src=l,document.body.appendChild(p)}return d},e.extend(e.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in window&&(t=tinymce.get(e.id),t&&t.editorManager===tinymce))}})}(jQuery);OPOL={};var o2c=0;var o3c=new Array();o_info.guibusy=false;o_info.linkbusy=false;o_info.scrolling=false;o_info.debug=true;var BLoader={_ajaxLoadedJS:new Array(),_isAlreadyLoadedJS:function(b){var a=true;jQuery("head script[src]").each(function(d,c){if(jQuery(c).attr("src").indexOf(b)!=-1){a=false}});if(jQuery.inArray(b,this._ajaxLoadedJS)!=-1){a=false}return !a},loadJS:function(b,c,a){if(!this._isAlreadyLoadedJS(b)){if(o_info.debug){o_log("BLoader::loadJS: loading ajax::"+a+" url::"+b)}if(a){jQuery.ajax(b,{async:false,dataType:"script",cache:true,success:function(d,f,e){}});this._ajaxLoadedJS.push(b)}else{jQuery.getScript(b)}if(o_info.debug){o_log("BLoader::loadJS: loading DONE url::"+b)}}else{if(o_info.debug){o_log("BLoader::loadJS: already loaded url::"+b)}}},executeGlobalJS:function(jsString,contextDesc){try{if(window.execScript){window.execScript(jsString)}else{window.eval(jsString)}}catch(e){if(window.console){console.log(contextDesc,"cannot execute js",jsString)}if(o_info.debug){o_logerr("BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString))}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString),"functions.js::BLoader::executeGlobalJS::"+contextDesc)}if(window.location.href.indexOf("o_winrndo")!=-1){window.location.reload()}else{window.location.href=window.location.href+(window.location.href.indexOf("?")!=-1?"&":"?")+"o_winrndo=1"}}},loadCSS:function(b,p,r){var s=window.document;try{if(s.createStyleSheet){var m=s.styleSheets;var d=0;var q=0;for(i=0;i<m.length;i++){var n=m[i];var g=n.href;if(g==b){d++;if(n.disabled){n.disabled=false;return}else{if(o_info.debug){o_logwarn("BLoader::loadCSS: style: "+b+" already in document and not disabled! (duplicate add)")}return}}if(n.id=="o_theme_css"){q=i}}if(d>1&&o_info.debug){o_logwarn("BLoader::loadCSS: apply styles: num of stylesheets found was not 0 or 1:"+d)}if(r){q=m.length}var f=s.createStyleSheet(b,q)}else{var c=jQuery("#"+p);if(c&&c.size()>0){if(o_info.debug){o_logwarn("BLoader::loadCSS: stylesheet already found in doc when trying to add:"+b+", with id "+p)}return}else{var a=jQuery('<link id="'+p+'" rel="stylesheet" type="text/css" href="'+b+'">');if(r){a.insertBefore(jQuery("#o_fontSize_css"))}else{a.insertBefore(jQuery("#o_theme_css"))}}}}catch(o){if(window.console){console.log(o)}if(o_info.debug){o_logerr("BLoader::loadCSS: Error when loading CSS from URL::"+b)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::loadCSS: Error when loading CSS from URL::"+b,"functions.js::BLoader::loadCSS")}}},unLoadCSS:function(a,n){var o=window.document;try{if(o.createStyleSheet){var f=o.styleSheets;var d=0;var p=a;var b=window.location.href.substring(0,window.location.href.indexOf("/",8));if(a.indexOf(b)==0){p=a.substring(b.length)}for(i=0;i<f.length;i++){var g=f[i].href;if(g==a||g==p){d++;if(!f[i].disabled){f[i].disabled=true}else{if(o_info.debug){o_logwarn("stylesheet: when removing: matching url, but already disabled! url:"+g)}}}}if(d!=1&&o_info.debug){o_logwarn("stylesheet: when removeing: num of stylesheets found was not 1:"+d)}}else{var c=jQuery("#"+n);if(c){c.href="";c.remove();c=null;return}else{if(o_info.debug){o_logwarn("no link with id found to remove, id:"+n+", url "+a)}}}}catch(m){if(o_info.debug){o_logerr("BLoader::unLoadCSS: Error when unloading CSS from URL::"+a)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::unLoadCSS: Error when unloading CSS from URL::"+a,"functions.js::BLoader::loadCSS")}}}};var BFormatter={formatLatexFormulas:function(b){try{if(typeof MathJax==="undefined"){o_mathjax()}else{if(MathJax&&MathJax.isReady){jQuery(function(){MathJax.Hub.Queue(function(){if(jQuery("#"+b+" .MathJax").length==0){MathJax.Hub.Typeset(b)}})})}else{setTimeout(function(){BFormatter.formatLatexFormulas(b)},100)}}}catch(a){if(window.console){console.log("error in BFormatter.formatLatexFormulas: ",a)}}},alignTableColumns:function(a){try{var b=new Array();jQuery(a).each(function(){for(j=0;j<jQuery(this)[0].rows[0].cells.length;j++){var d=jQuery(this)[0].rows[0].cells[j];if(!b[j]||b[j]<d.clientWidth){b[j]=d.clientWidth}}});jQuery(a).each(function(){for(j=0;j<jQuery(this)[0].rows[0].cells.length;j++){jQuery(this)[0].rows[0].cells[j].style.width=b[j]+"px"}})}catch(c){if(window.console){console.log("error in BFormatter.alignTableColumns: ",c)}}}};function o_init(){try{o_getMainWin().o_afterserver();if(window.location.href&&window.location.href!=null&&window.location.href.indexOf("%3A")<0){var a=window.location.href;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}}}catch(b){if(o_info.debug){o_log("error in o_init: "+showerror(b))}}}function o_initEmPxFactor(){o_info.emPxFactor=jQuery("#o_width_1em").width();if(o_info.emPxFactor==0||o_info.emPxFactor=="undefined"){o_info.emPxFactor=12;if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Could not read with of element b_width_1em, set o_info.emPxFactor to 12","functions.js")}}}function o_getMainWin(){try{if(window.OPOL){return window}else{if(window.opener&&window.opener.OPOL){return window.opener}}}catch(a){if(o_info.debug){o_logerr('Exception while getting main window. rror::"'+showerror(a))}if(window.console){console.log('Exception while getting main window. rror::"'+showerror(a),"functions.js");console.log(a)}}throw"Can not find main OpenOLAT window"}function o_beforeserver(){o_info.linkbusy=true;showAjaxBusy();if(window.suppressOlatOnUnloadOnce){window.suppressOlatOnUnloadOnce=false}else{if(window.olatonunload){olatonunload()}}}function o_afterserver(){o2c=0;o_info.linkbusy=false;removeAjaxBusy()}function o2cl(){try{if(o_info.linkbusy){return false}else{var b=(o2c==0||confirm(o_info.dirty_form));if(b){o_beforeserver()}return b}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_dirtyCheckOnly(){try{if(o_info.linkbusy){return false}else{return(o2c==0||confirm(o_info.dirty_form))}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_noDirtyCheck(){if(o_info.linkbusy){return false}else{o_beforeserver();return true}}function o3cl(d){if(o_info.linkbusy){return false}else{var b=o3c1.indexOf(d)>-1;var a=(b&&o3c1.length>1)||o3c1.length>0;var c=(!a||confirm(o_info.dirty_form));if(c){o_beforeserver()}return c}}function o_onc(a){var b=a.responseText;BLoader.executeGlobalJS("o_info.last_o_onc="+b+";","o_onc");o_ainvoke(o_info.last_o_onc,false)}function o_allowNextClick(){o_info.linkbusy=false;removeAjaxBusy()}function removeBusyAfterDownload(c,b,a){o2c=0;o_afterserver()}Array.prototype.search=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(this[b].constructor==Array){if(this[b].search(c,d)){return true;break}}else{if(d){if(this[b].indexOf(c)!=-1){return true;break}}else{if(this[b]==c){return true;break}}}}return false};if(!Function.prototype.curry){Function.prototype.curry=function(){if(arguments.length<1){return this}var a=this;var b=Array.prototype.slice.call(arguments);return function(){return a.apply(this,b.concat(Array.prototype.slice.call(arguments)))}}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){if(this==null){throw new TypeError()}var d=Object(this);var a=d.length>>>0;if(a===0){return -1}var e=0;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}else{if(e!=0&&e!=Infinity&&e!=-Infinity){e=(e>0||-1)*Math.floor(Math.abs(e))}}}if(e>=a){return -1}var b=e>=0?e:Math.max(a-Math.abs(e),0);for(;b<a;b++){if(b in d&&d[b]===c){return b}}return -1}}var b_onDomReplacementFinished_callbacks=new Array();function b_AddOnDomReplacementFinishedCallback(a){var b=jQuery(document).ooLog().isDebugEnabled();if(b){jQuery(document).ooLog("debug","callback stack size: "+b_onDomReplacementFinished_callbacks.length,"functions.js ADD")}if(b&&b_onDomReplacementFinished_callbacks.toSource){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js ADD")}b_onDomReplacementFinished_callbacks.push(a);if(b){jQuery(document).ooLog("debug","push to callback stack, func: "+a,"functions.js ADD")}}var b_changedDomEl=new Array();function b_AddOnDomReplacementFinishedUniqueCallback(a){if(a.constructor==Array){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","add: its an ARRAY! ","functions.js ADD")}if(b_onDomReplacementFinished_callbacks.search(a[0])){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","push to callback stack, already there!!: "+a[0],"functions.js ADD")}return}}b_AddOnDomReplacementFinishedCallback(a)}var o_debug_trid=0;function o_ainvoke(N){if(N==undefined){return}o_info.inainvoke=true;var I=N.cmdcnt;if(I>0){jQuery(document).trigger("oo.dom.replacement.before");b_changedDomEl=new Array();if(o_info.debug){o_debug_trid++}var y=N.cmds;for(var T=0;T<I;T++){var J=y[T];var A=J.cmd;var R=J.cda;var U=J.w;var c=this.window;var K;if(c){switch(A){case 1:var M=R.e;BLoader.executeGlobalJS(M,"o_ainvoker::jsexec");if(o_info.debug){o_log("c1: execute jscode: "+M)}case 2:var u=R.cc;var F=R.cps;for(var Q=0;Q<u;Q++){var m=F[Q];var h=m.cid;var P=m.cidvis;var H=m.cw;var x=m.hfrag;var O=m.jsol;var g=m.hdr;if(o_info.debug){o_log("c2: redraw: "+m.cname+" ("+h+") "+m.hfragsize+" bytes, listener(s): "+m.clisteners)}var W=g+"\n\n"+x;var C="";var S=false;var E="o_c"+h;var B=jQuery("#"+E);if(B==null||B.length==0){E="o_fi"+h;B=jQuery("#"+E);S=true}if(B!=null){var w=jQuery("div.o_richtext_mce textarea",B);for(var L=0;L<w.length;L++){try{var a=jQuery(w.get(L)).attr("id");if(typeof top.tinymce!=undefined){top.tinymce.remove("#"+a)}}catch(Z){if(window.console){console.log(Z)}}}if(P){B.css("display","")}else{B.css("display","none")}if(S||!H){B.replaceWith(W)}else{try{B.empty().html(W);if(W.length>0&&B.get(0).innerHTML==""){B.get(0).innerHTML=W}}catch(Z){if(window.console){console.log(Z)}if(window.console){console.log("Fragment",W)}}b_changedDomEl.push(E)}B=null;if(C!=""){C.each(function(e){BLoader.executeGlobalJS(e,"o_ainvoker::inscripts")})}if(O!=""){BLoader.executeGlobalJS(O,"o_ainvoker::jsol")}}}break;case 3:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 5:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 6:c.o2c=0;c.o_afterserver();break;case 7:var o=c.document.location;var z=o.protocol+"//"+o.hostname;if(o.port!=""){z+=":"+o.port}var v=R.cssrm;for(Q=0;Q<v.length;Q++){var D=v[Q];var G=D.id;var f=z+D.url;BLoader.unLoadCSS(f,G);if(o_info.debug){o_log("c7: rm css: id:"+G+" ,url:'"+f+"'")}}var V=R.cssadd;for(k=0;k<V.length;k++){var D=V[k];var G=D.id;var f=z+D.url;var n=D.pt;BLoader.loadCSS(f,G,n);if(o_info.debug){o_log("c7: add css: id:"+G+" ,url:'"+f+"'")}}var p=R.jsadd;for(l=0;l<p.length;l++){var D=p[l];var Y=D.before;if(jQuery.type(Y)==="string"){BLoader.executeGlobalJS(Y,"o_ainvoker::preJsAdd")}var f=D.url;var q=D.enc;if(jQuery.type(f)==="string"){BLoader.loadJS(f,q,true)}if(o_info.debug){o_log("c7: add js: "+f)}}break;default:if(o_info.debug){o_log("?: unknown command "+A)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), ?: unknown command "+A,"functions.js")}break}}else{if(o_info.debug){o_log("could not find window??")}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), could not find window??","functions.js")}}}var b=b_onDomReplacementFinished_callbacks.length;if(b_onDomReplacementFinished_callbacks.toSource&&jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js")}for(mycounter=0;b>mycounter;mycounter++){if(mycounter>50){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stopped executing DOM replacement callback functions - to many functions::"+b_onDomReplacementFinished_callbacks.length,"functions.js")}break}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize before shift: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}var s=b_onDomReplacementFinished_callbacks.shift();if(typeof s.length==="number"){if(s[0]=="glosshighlighter"){var d=s[1];if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","arr fct: "+d,"functions.js")}s=d}}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Executing DOM replacement callback function #"+mycounter+" with timeout funct::"+s,"functions.js")}s();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize after timeout: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}}jQuery(document).trigger("oo.dom.replacement.after")}o_info.inainvoke=false}function clearAfterAjaxIframeCall(){if(o_info.linkbusy){o_afterserver()}}function showAjaxBusy(){setTimeout(function(){if(o_info.linkbusy){try{if(jQuery("#o_ajax_busy_backdrop").length==0){jQuery("#o_body").addClass("o_ajax_busy");jQuery("#o_ajax_busy").modal({show:true,backdrop:"static",keyboard:"false"});jQuery("#o_ajax_busy").after('<div id="o_ajax_busy_backdrop" class="modal-backdrop in"></div>');jQuery("#o_ajax_busy>.modal-backdrop").remove();jQuery("#o_ajax_busy_backdrop").css({"z-index":1200})}}catch(a){if(window.console){console.log(a)}}}},700)}function removeAjaxBusy(){try{jQuery("#o_body").removeClass("o_ajax_busy");jQuery("#o_ajax_busy_backdrop").remove();jQuery("#o_ajax_busy").modal("hide")}catch(a){if(window.console){console.log(a)}}}function setFormDirty(c){o2c=1;var a=document.getElementById(c);if(a!=null){var b=a.olat_fosm_0;if(b==null){b=a.olat_fosm}if(b){b.className="btn o_button_dirty"}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in setFormDirty, myForm was null for formId="+c,"functions.js")}}}function contextHelpWindow(a){helpWindow=window.open(a,"HelpWindow","height=760, width=940, left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no");helpWindow.focus()}function o_openPopUp(b,d,c,a,f){attributes="height="+a+", width="+c+", resizable=yes, scrollbars=yes, left=100, top=100, ";if(f){attributes+="location=yes, menubar=yes, status=yes, toolbar=yes"}else{attributes+="location=no, menubar=no, status=no, toolbar=no"}var h;try{h=window.open(b,d,attributes)}catch(g){h=window.open(b,"OpenOLAT",attributes)}h.focus();if(o_info.linkbusy){o_afterserver()}}function b_handleFileUploadFormChange(e,b,d){var f=e.value;slashPos=f.lastIndexOf("/");if(slashPos!=-1){f=f.substring(slashPos+1)}slashPos=f.lastIndexOf("\\");if(slashPos!=-1){f=f.substring(slashPos+1)}b.value=f;if(d){d.className="o_button_dirty"}var c=e.form.elements;for(i=0;i<c.length;i++){var a=c[i];if(a.name==b.name&&i+1<c.length){c[i+1].focus()}}}function gotonode(a){try{if(typeof o_activateCourseNode!="undefined"){o_activateCourseNode(a)}else{if(opener&&typeof opener.o_activateCourseNode!="undefined"){opener.o_activateCourseNode(a)}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode(), could not find main window","functions.js")}}}}catch(b){alert("Goto node error:"+b);if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode()::"+b.message,"functions.js")}}}function o_viewportHeight(){var a=jQuery(document).height();if(a>0){return a}else{return 600}}OPOL.getMainColumnsMaxHeight=function(){var m=0,f=0,a=0,c=0,h=0,b,g=jQuery("#o_main_left_content"),e=jQuery("#o_main_right_content"),d=jQuery("#o_main_center_content");if(g!="undefined"&&g!=null){m=g.outerHeight(true)}if(e!="undefined"&&e!=null){f=e.outerHeight(true)}if(d!="undefined"&&d!=null){a=d.outerHeight(true)}c=(m>f?m:f);c=(c>a?c:a);if(c>0){return c}b=jQuery("#o_main");if(b!="undefined"&&b!=null){h=b.height()}if(b>0){return b}return o_viewportHeight()};OPOL.adjustHeight=function(){try{var a=0;col1=jQuery("#o_main_left_content").outerHeight(true);col2=jQuery("#o_main_right_content").outerHeight(true);col3=jQuery("#o_main_center_content").outerHeight(true);a=Math.max(col1,col2,col3);if(col1!=null){jQuery("#o_main_left").css({"min-height":a+"px"})}if(col2!=null){jQuery("#o_main_right").css({"min-height":a+"px"})}if(col3!=null){jQuery("#o_main_center").css({"min-height":a+"px"})}}catch(b){if(window.console){console.log(b)}}};jQuery(window).resize(function(){clearTimeout(o_info.resizeId);o_info.resizeId=setTimeout(function(){jQuery(document).trigger("oo.window.resize.after")},500)});jQuery(document).on("oo.window.resize.after",OPOL.adjustHeight);jQuery(document).on("oo.dom.replacement.after",OPOL.adjustHeight);jQuery().ready(OPOL.adjustHeight);function o_scrollToElement(a){try{o_info.scrolling=true;jQuery("html, body").animate({scrollTop:jQuery(a).offset().top},333,function(d,c){o_info.scrolling=false})}catch(b){}}function o_popover(c,b,a){if(typeof(a)==="undefined"){a="bottom"}jQuery("#"+c).popover({placement:a,html:true,trigger:"click",container:"body",content:function(){return jQuery("#"+b).clone().html()}}).on("shown.bs.popover",function(){var d=function(f){jQuery("#"+c).popover("hide");jQuery("body").unbind("click",d)};setTimeout(function(){jQuery("body").on("click",d)},5)})}function o_popoverWithTitle(d,c,b,a){if(typeof(a)==="undefined"){a="bottom"}return jQuery("#"+d).popover({placement:a,html:true,title:b,trigger:"click",container:"body",content:function(){return jQuery("#"+c).clone().html()}}).on("shown.bs.popover",function(){var e=function(f){jQuery("#"+d).popover("destroy");jQuery("body").unbind("click",e)};setTimeout(function(){jQuery("body").on("click",e)},5)})}function o_shareLinkPopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:c}).on("shown.bs.popover",function(){var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)});a.attr("title",a.attr("data-original-title"))}function o_QRCodePopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:'<div id="'+d+'_pop" class="o_qrcode"></div>'}).on("shown.bs.popover",function(){o_info.qr=o_QRCode(d+"_pop",(jQuery.isFunction(c)?c():c));var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)}).on("hidden.bs.popover",function(){try{o_info.qr.clear();delete o_info.qr}catch(f){}});a.attr("title",a.attr("data-original-title"))}function o_QRCode(c,b){try{BLoader.loadJS(o_info.o_baseURI+"/js/jquery/qrcodejs/qrcode.min.js","utf8",true);return new QRCode(document.getElementById(c),b)}catch(a){return null}}function b_resizeIframeToMainMaxHeight(f){var d=jQuery("#"+f);if(d!="undefined"&&d!=null){var c=OPOL.getMainColumnsMaxHeight()-110;var b=o_viewportHeight()-100;b=b-d.offset().top;var e=jQuery("#b_footer");if(e!="undefined"&&e!=null){b=b-e.outerHeight(true)}var a=(b>c?b:c);d.height(a)}}var o_debu_oldcn,o_debu_oldtt;function o_debu_show(b,a){if(o_debu_oldcn){o_debu_hide(o_debu_oldcn,o_debu_oldtt)}jQuery(b).addClass("o_dev_m");jQuery(a).show();o_debu_oldtt=a;o_debu_oldcn=b}function o_debu_hide(b,a){jQuery(a).hide();jQuery(b).removeClass("o_dev_m")}function o_dbg_mark(a){var b=jQuery("#"+a);if(b){b.css("background-color","#FCFCB8");b.css("border","3px solid #00F")}}function o_dbg_unmark(a){var b=jQuery("#"+a);if(b){b.css("border","");b.css("background-color","")}}function o_clearConsole(){o_log_all="";o_log(null)}var o_log_all="";function o_log(b){if(b){o_log_all="\n"+o_debug_trid+"> "+b+o_log_all;o_log_all=o_log_all.substr(0,4000)}var a=jQuery("#o_debug_cons");if(a){if(o_log_all.length==4000){o_log_all=o_log_all+"\n... (stripped: to long)... "}a.value=o_log_all}if(!jQuery.type(window.console)==="undefined"){window.console.log(b)}}function o_logerr(a){o_log("ERROR:"+a)}function o_logwarn(a){o_log("WARN:"+a)}function showerror(c){var a="";for(var b in c){a+=b+": "+c[b]+"\n"}return"error detail:\n"+a}function o_ffEvent(f,e,d,n,o){var g,h,b,a;g=document.getElementById(e);h=g.value;g.value=d;b=document.getElementById(n);a=b.value;b.value=o;var c=jQuery("#"+f);var m=c.attr("enctype");if(m&&m.indexOf("multipart")==0){o_XHRSubmitMultipart(f)}else{if(document.forms[f].onsubmit()){document.forms[f].submit()}}g.value=h;b.value=a}function o_IQEvent(a){if(document.forms[a].onsubmit()){document.forms[a].submit()}}function o_TableMultiActionEvent(a,c){var b=jQuery("#o_mai_"+a);b.val(c);if(document.forms[a].onsubmit()){document.forms[a].submit()}b.val("")}function o_XHRSubmit(h){if(o_info.linkbusy){return false}o_beforeserver();var o=true;var a=jQuery("#"+h);var n=a.attr("enctype");if(n&&n.indexOf("multipart")==0){var g="openolat-submit-"+(""+Math.random()).substr(2);var d=o_createIFrame(g);document.body.appendChild(d);a.attr("target",d.name);return true}else{var f=a.serializeArray();if(arguments.length>1){var m=arguments.length;for(var e=1;e<m;e=e+2){if(m>e+1){var c=new Object();c.name=arguments[e];c.value=arguments[e+1];f[f.length]=c}}}var b=a.attr("action");jQuery.ajax(b,{type:"POST",data:f,cache:false,dataType:"json",success:function(s,v,r){try{o_ainvoke(s);if(o){var p=s.businessPath;var q=s.documentTitle;var u=s.historyPointId;if(p){o_pushState(u,q,p)}}}catch(t){if(window.console){console.log(t)}}finally{o_afterserver()}},error:o_onXHRError});return false}}function o_XHRSubmitMultipart(a){var c=jQuery("#"+a);var d="openolat-submit-"+(""+Math.random()).substr(2);var b=o_createIFrame(d);document.body.appendChild(b);c.attr("target",b.name);c.submit();c.attr("target","")}function o_createIFrame(b){var a=jQuery('<iframe name="'+b+'" id="'+b+'" src="about:blank" style="position: absolute; top: -9999px; left: -9999px;"></iframe>');return a[0]}function o_removeIframe(a){jQuery("#"+a).remove()}function o_showFormDirtyDialog(a){o_scrollToElement("#o_top");jQuery("#o_form_dirty_message").modal("show");jQuery("#o_form_dirty_message .o_form_dirty_ignore").on("click",function(){jQuery("#o_form_dirty_message").modal("hide");jQuery("#o_form_dirty_message .o_form_dirty_ignore").off();a()});return false}function o_ffXHREvent(h,e,s,g,p,t,f,m){if(t&&o2c==1){var d=Array.prototype.slice.call(arguments);d[5]=false;var u=function(){o_ffXHREvent.apply(window,d)};return o_showFormDirtyDialog(u)}else{if(!o2cl_noDirtyCheck()){return false}}o_beforeserver();var v=new Object();if(m){var b=jQuery("#"+h);var q=b.serializeArray();var o=q.length;for(var r=0;r<o;r++){var n=q[r];if(n.name!="dispatchuri"&&n.name!="dispatchevent"){v[n.name]=n.value}}}v.dispatchuri=s;v.dispatchevent=p;if(arguments.length>8){var a=arguments.length;for(var r=8;r<a;r=r+2){if(a>r+1){v[arguments[r]]=arguments[r+1]}}}var c=jQuery("#"+h).attr("action");jQuery.ajax(c,{type:"POST",data:v,cache:false,dataType:"json",success:function(z,C,y){try{o_ainvoke(z);if(f){var w=z.businessPath;var x=z.documentTitle;var B=z.historyPointId;if(w){o_pushState(B,x,w)}}}catch(A){if(window.console){console.log(A)}}finally{o_afterserver()}},error:o_onXHRError})}function o_ffXHRNFEvent(f,e,a,h,m){var c=new Object();c.dispatchuri=a;c.dispatchevent=m;if(arguments.length>5){var g=arguments.length;for(var d=5;d<g;d=d+2){if(g>d+1){c[arguments[d]]=arguments[d+1]}}}var b=jQuery("#"+f).attr("action");jQuery.ajax(b,{type:"POST",data:c,cache:false,dataType:"json",success:function(o,p,n){}})}function o_XHREvent(h,f,c){if(f&&o2c==1){var b=Array.prototype.slice.call(arguments);b[1]=false;var a=function(){o_XHREvent.apply(window,b)};return o_showFormDirtyDialog(a)}else{if(!o2cl_noDirtyCheck()){return false}}o_beforeserver();var e=new Object();if(arguments.length>3){var g=arguments.length;for(var d=3;d<g;d=d+2){if(g>d+1){e[arguments[d]]=arguments[d+1]}}}jQuery.ajax(h,{type:"POST",data:e,cache:false,dataType:"json",success:function(p,s,o){try{o_ainvoke(p);if(c){var m=p.businessPath;var n=p.documentTitle;var r=p.historyPointId;if(m){o_pushState(r,n,m)}}}catch(q){if(window.console){console.log(q)}}finally{o_afterserver()}},error:o_onXHRError});return false}function o_XHRNFEvent(d){var b=new Object();if(arguments.length>1){var c=arguments.length;for(var a=1;a<c;a=a+2){if(c>a+1){b[arguments[a]]=arguments[a+1]}}}jQuery.ajax(d,{type:"POST",data:b,cache:false,dataType:"json",success:function(f,g,e){},error:o_onXHRError})}function o_onXHRError(a,d,b){o_afterserver();if(401==a.status){var c=o_info.oo_noresponse.replace("reload.html",window.document.location.href);showMessageBox("error",o_info.oo_noresponse_title,c,undefined)}else{if(window.console){console.log("Error status 2",d,b,a.responseText);console.log(a)}}}function o_pushState(d,f,a){try{var b=new Object();b.businessPath=a;b.historyPointId=d;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}if(window.history&&!(typeof window.history==="undefined")&&window.history.pushState){window.history.pushState(b,f,a)}else{window.location.hash=d}}catch(c){if(window.console){console.log(c,a)}}}function o_toggleMark(a){var b=jQuery("i",a).attr("class");if(b.indexOf("o_icon_bookmark_add")>=0){jQuery("i",a).removeClass("o_icon_bookmark_add").addClass("o_icon_bookmark")}else{jQuery("i",a).removeClass("o_icon_bookmark").addClass("o_icon_bookmark_add")}}function o_normalizeFilename(b){b=b.replace(/\s/g,"_");var f=["/",",",":","(",")"];for(var c=f.length;c-->0;){b=b.split(f[c]).join("_")}var a=["\u00C4","\u00D6","\u00DC","\u00E4","\u00F6","\u00E6","\u00FC","\u00DF","\u00F8","\u2205"],d=["Ae","Oe","Ue","ae","oe","ae","ue","ss","o","o"];for(var c=a.length;c-->0;){b=b.split(a[c]).join(d[c])}try{b=b.normalize("NFKD");b=b.replace("/p{InCombiningDiacriticalMarks}+/g","");b=b.replace("/W+/g","")}catch(g){if(window.console){console.log(g)}}return b}function setFlexiFormDirtyByListener(a){setFlexiFormDirty(a.data.formId,a.data.hideMessage)}function setFlexiFormDirty(b,c){var a=o3c.indexOf(b)>-1;if(!a){o3c.push(b)}jQuery("#"+b).each(function(){var d=jQuery(this).data("FlexiSubmit");if(d!=null){jQuery("#"+d).addClass("btn o_button_dirty");o2c=(c?0:1)}})}function o_ffRegisterSubmit(b,a){jQuery("#"+b).data("FlexiSubmit",a)}function dismissInfoBox(a){javascript:jQuery("#"+a).remove();return true}function showInfoBox(g,d){var c=Math.floor(Math.random()*65536).toString(16);var f='<div id="'+c+'" class="o_alert_info"><div class="alert alert-info clearfix o_sel_info_message"><a class="o_alert_close o_sel_info_close" href="javascript:;" onclick="dismissInfoBox(\''+c+'\')"><i class="o_icon o_icon_close"> </i></a><h3><i class="o_icon o_icon_info"> </i> '+g+"</h3><p>"+d+"</p></div></div>";var a=jQuery("#o_messages").prepend(f);var e=(d.length>150)?8000:((d.length>70)?6000:4000);var b=function(){jQuery("#"+c).transition({top:"-100%"},333,function(){jQuery("#"+c).remove()})};o_info.scrolling=true;jQuery("#"+c).show().transition({top:0},333);jQuery("#"+c).click(function(h){b()});o_scrollToElement("#o_top");g=null;d=null;a=null;setTimeout(function(){try{b()}catch(h){}},e)}function showMessageBox(b,f,d,a){if(b=="info"){showInfoBox(f,d);return null}else{var c='<div id="myFunctionalModal" class="modal fade" role="dialog"><div class="modal-dialog"><div class="modal-content">';c+='<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';c+='<h4 class="modal-title">'+f+"</h4></div>";c+='<div class="modal-body alert ';if("warn"==b){c+="alert-warning"}else{if("error"==b){c+="alert-danger"}else{c+="alert-info"}}c+='"><p>'+d+"</p></div></div></div></div>";jQuery("#myFunctionalModal").remove();jQuery("body").append(c);var e=jQuery("#myFunctionalModal").modal("show").on("hidden.bs.modal",function(g){jQuery("#myFunctionalModal").remove()});o_scrollToElement("#o_top");return e}}function o_table_toggleCheck(d,c){var a=document.forms[d].elements.tb_ms;len=a.length;if(typeof(len)=="undefined"){a.checked=c}else{var b;for(b=0;b<len;b++){a[b].checked=c}}}function onTreeStartDrag(a,b){jQuery(a.target).addClass("o_dnd_proxy")}function onTreeStopDrag(a,b){jQuery(a.target).removeClass("o_dnd_proxy")}function onTreeDrop(g,h){var a=jQuery(h.draggable[0]);var f=jQuery(this);f.css({position:"",width:""});var c=f.droppable("option","endUrl");if(c.lastIndexOf("/")==(c.length-1)){c=c.substring(0,c.length-1)}var e=a.attr("id");var b=e.substring(2,e.length);c+="%3Atnidle%3A"+b;var d=f.attr("id");if(d.indexOf("ds")==0){c+="%3Asne%3Ayes"}else{if(d.indexOf("dt")==0){c+="%3Asne%3Aend"}}jQuery(".ui-droppable").each(function(m,n){jQuery(n).droppable("disable")});o_XHREvent(c+"/",false,false)}function treeAcceptDrop(a){return true}function treeAcceptDrop_notWithChildren(a){var c=false;var b=jQuery(a);var e=b.attr("id");if(e!=undefined&&(e.indexOf("dd")==0||e.indexOf("ds")==0||e.indexOf("dt")==0||e.indexOf("da")==0||e.indexOf("row")==0)){var g=jQuery(this);var m=g.attr("id");var d=e.substring(2,e.length);var f=m.substring(2,m.length);if(d!=f){var h=jQuery("#dd"+d).parents("li");if(h.length>0&&jQuery(h.get(0)).find("#dd"+f).length==0){c=true}}}return c}function treeAcceptDrop_portfolio(b){var d=false;var c=jQuery(b);var f=c.attr("id");if(treeNode_isDragNode(f)){var h=jQuery(this);var o=h.attr("id");var e=f.substring(2,f.length);var g=o.substring(2,o.length);var n=f.indexOf("ds")==0||f.indexOf("dt")==0;if(e!=g){var m=treeNode_portfolioType(c);var a=treeNode_portfolioType(h);if(m=="artefact"){if(a=="page"||a=="struct"||a=="artefact"){d=true}}else{if(m=="struct"){if(a=="page"||a=="struct"){d=true}}else{if(m=="page"){if(a=="map"||a=="page"){d=true}}}}}}return d}function treeNode_portfolioType(e){var c=jQuery(e.get(0));var d=treeNode_portfolioTypes(c);if(d==null){var a=c.parent("a");if(a.length>0){d=treeNode_portfolioTypes(jQuery(a.get(0)))}else{if(c.attr("id").indexOf("ds")==0){var b=c.prev("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}else{if(c.attr("id").indexOf("dt")==0){var b=c.next("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}}}}return d}function treeNode_portfolioTypes(a){if(a.find===undefined){return null}else{if(a.find(".o_ep_icon_struct").length>0||a.hasClass("o_ep_icon_struct")){return"struct"}else{if(a.find(".o_ep_icon_page").length>0||a.hasClass("o_ep_icon_page")){return"page"}else{if(a.find(".o_ep_icon_map").length>0||a.hasClass("o_ep_icon_map")){return"map"}else{if(a.find(".o_ep_artefact").length>0||a.hasClass("o_ep_artefact")){return"artefact"}}}}}return null}function treeNode_isDragNode(a){if(a!=undefined&&(a.indexOf("dd")==0||a.indexOf("ds")==0||a.indexOf("dt")==0||a.indexOf("da")==0||a.indexOf("row")==0)){return true}return false}function o_choice_toggleCheck(c,b){var d=document.forms[c].elements;len=d.length;if(typeof(len)=="undefined"){d.checked=b}else{var a;for(a=0;a<len;a++){if(d[a].type=="checkbox"&&d[a].getAttribute("class")=="o_checkbox"){d[a].checked=b}}}}function b_briefcase_isChecked(c,e){var b;var a=document.getElementById(c);var d=0;for(b=0;a.elements[b];b++){if(a.elements[b].type=="checkbox"&&a.elements[b].name=="paths"&&a.elements[b].checked){d++}}if(d<1){alert(e);return false}return true}function b_briefcase_toggleCheck(d,c){var a=document.getElementById(d);len=a.elements.length;var b;for(b=0;b<len;b++){if(a.elements[b].name=="paths"){a.elements[b].checked=c}}}function o_doPrint(){var d=jQuery("div.o_iframedisplay iframe");if(d.length>0){try{var a=d[0];frames[a.name].focus();frames[a.name].print();return}catch(c){for(i=0;frames.length>i;i++){a=frames[i];if(a.name=="oaa0"){continue}var b=document.getElementsByName(a.name)[0];if(b&&b.getAttribute("class")=="ext-shim"){continue}if(a.name!=""){try{frames[a.name].focus();frames[a.name].print()}catch(c){window.print()}return}}window.print()}}else{window.print()}}function b_attach_i18n_inline_editing(){jQuery("span.o_translation_i18nitem").hover(function(){jQuery(this.firstChild).show();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Entered i18nitem::"+this.firstChild,"functions.js:b_attach_i18n_inline_editing()")}},function(){jQuery("a.o_translation_i18nitem_launcher").hide();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Leaving i18nitem::"+this,"functions.js:b_attach_i18n_inline_editing()")}});jQuery("a.o_translation_i18nitem_launcher").hover(function(){var a=jQuery(this).parent("span.o_translation_i18nitem");a.effect("highlight")});b_AddOnDomReplacementFinishedCallback(b_attach_i18n_inline_editing)}function b_hideExtMessageBox(){}var BDebugger={_lastDOMCount:0,_lastObjCount:0,_knownGlobalOLATObjects:["o_afterserver","o_onc","o_getMainWin","o_ainvoke","o_info","o_beforeserver","o_ffEvent","o_openPopUp","o_debu_show","o_logwarn","o_dbg_unmark","o_ffRegisterSubmit","o_clearConsole","o_init","o_log","o_allowNextClick","o_dbg_mark","o_debu_hide","o_logerr","o_debu_oldcn","o_debu_oldtt","o_debug_trid","o_log_all"],_countDOMElements:function(){return document.getElementsByTagName("*").length},_countGlobalObjects:function(){var a=0;for(prop in window){a++}return a},logDOMCount:function(){var b=BDebugger;var a=b._countDOMElements();var c=a-b._lastDOMCount;console.log((c>0?"+":"")+c+" \t"+a+" \tDOM element count after DOM replacement");b._lastDOMCount=a;a=null},logGlobalObjCount:function(){var b=BDebugger;var a=b._countGlobalObjects();var c=a-b._lastObjCount;console.log((c>0?"+":"")+c+" \t"+a+" \tGlobal object count after DOM replacement");b._lastObjCount=a;a=null},logGlobalOLATObjects:function(){var b=BDebugger;var a=new Array();for(prop in window){if(prop.indexOf("o_")==0&&b._knownGlobalOLATObjects.indexOf(prop)==-1){a.push(prop)}}if(a.length>0){console.log(a.length+" global OLAT objects found:");a.each(function(c){console.log("\t"+typeof window[c]+" \t"+c)})}}};/*! +jQuery.periodic=function(l,h){if(jQuery.isFunction(l)){h=l;l={}}var c=jQuery.extend({},jQuery.periodic.defaults,{ajax_complete:j,increment:g,reset:f,cancel:i},l);c.cur_period=c.period;c.tid=false;var e="";b();return c;function b(){i();c.tid=setTimeout(function(){h.call(c);g();if(c.tid){b()}},c.cur_period)}function j(n,m){if(m==="success"&&e!==n.responseText){e=n.responseText;f()}}function g(){c.cur_period*=c.decay;if(c.cur_period<c.period){f()}else{if(c.cur_period>c.max_period){c.cur_period=c.max_period;if(c.on_max!==undefined){c.on_max.call(c)}}}}function f(){c.cur_period=c.period;b()}function i(){clearTimeout(c.tid);c.tid=null}function k(){}function a(){}function d(){}};jQuery.periodic.defaults={period:4000,max_period:1800000,decay:1.5,on_max:undefined};var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();(function(b){b.fn.ooLog=function(f,d,e){var c=null;b(this).each(function(){c=b(this).data("_ooLog");if(c==undefined){c=new a();b(this).data("_ooLog",c)}});if(f==undefined){return c}else{if(typeof f==="string"){if(c){c.log(f,d,e)}}}};function a(){return this}a.prototype={isDebugEnabled:function(){return o_info.JSTracingLogDebugEnabled},log:function(e,c,d){if(!this.isDebugEnabled()){return}jQuery.post(o_info.JSTracingUri,{level:e,logMsg:c,jsFile:d})}}})(jQuery);(function(b){b.fn.ooTranslator=function(){var d=null;b(document).each(function(){d=b(document).data("_ooTranslator");if(d==undefined){d=new a();b(document).data("_ooTranslator",d)}});return d};function a(){return this}a.prototype={mapperUrl:null,translators:null,initialize:function(d){this.mapperUrl=d;this.translators=new Object()},getTranslator:function(d,f){if(this.translators[d]==null){this.translators[d]=new Object()}if(this.translators[d][f]==null){var e=this.mapperUrl+"/"+d+"/"+f+"/translations.js";jQuery.ajax(e,{async:false,dataType:"json",success:function(g,i,h){jQuery(document).ooTranslator()._createTranslator(g,d,f)}})}return this.translators[d][f]},_createTranslator:function(e,d,f){this.translators[d][f]=new c().initialize(e,d,f)}};function c(){return this}c.prototype={localizationData:null,bundle:null,locale:null,initialize:function(f,d,e){this.bundle=e;this.locale=d;this.localizationData=f;return this},translate:function(d){if(this.localizationData[d]){return this.localizationData[d]}else{return this.bundle+":"+d}}}})(jQuery);+function(b){var a=function(){this.addExtraElements();this.state={busy:false,brandW:0,sitesW:0,sitesDirty:false,sites:{collapsed:this.isSitesCollapsed(),extended:this.isSitesExtended},tabsW:0,tabsDirty:false,tabs:{collapsed:this.isTabsCollapsed(),extended:this.isTabsExtended()},toolsW:0,toolsDirty:false,tools:{collapsed:this.isToolsCollapsed(),extended:this.isToolsExtended()},offCanvasWidth:0,moreW:0};var c=b("#o_offcanvas_right").css("width");if(c){this.state.offCanvasWidth=parseInt(c.replace(/[^\d.]/g,""));this.initListners();this.calculateWidth();this.optimize()}};a.prototype.initListners=function(){b(window).resize(b.proxy(this.onResizeCallback,this));b(document).on("oo.nav.sites.modified",b.proxy(function(){this.state.sitesDirty=true},this));b(document).on("oo.nav.tabs.modified",b.proxy(function(){this.state.tabsDirty=true},this));b(document).on("oo.nav.tools.modified",b.proxy(function(){this.state.toolsDirty=true},this));b(document).on("oo.dom.replacement.after",b.proxy(this.onDOMreplacementCallback,this));b(window).on("orientationchange",b.proxy(this.hideRight,this));b("#o_navbar_right-toggle").on("click",b.proxy(this.toggleRight,this));b("#o_offcanvas_right .o_offcanvas_close").on("click",b.proxy(this.hideRight,this));b("#o_navbar_more").on("shown.bs.dropdown",this.onDropdownShown);b("#o_navbar_more").on("hidden.bs.dropdown",this.onDropdownHidden)};a.prototype.onResizeCallback=function(){if(!this.state.busy){this.state.busy=true;this.calculateWidth();this.optimize();this.state.busy=false}};a.prototype.onDOMreplacementCallback=function(){if(!this.state.busy&&(this.state.sitesDirty||this.state.tabsDirty||this.state.toolsDirty)){this.state.busy=true;this.cleanupMoreDropdown();this.calculateWidth();this.optimize();this.state.sitesDirty=false;this.state.tabsDirty=false;this.state.toolsDirty=false;this.state.busy=false}};a.prototype.onDropdownShown=function(c){var f=b("#o_navbar_more .dropdown-menu");if(f.length){var d=f.offset().left;if(d<0){f.removeClass("dropdown-menu-right")}}};a.prototype.onDropdownHidden=function(c){var d=b("#o_navbar_more .dropdown-menu");d.addClass("dropdown-menu-right")};a.prototype.calculateWidth=function(){var c=b("#o_navbar_container .o_navbar-collapse");this.state.navbarW=c.innerWidth();this.state.brandW=b(".o_navbar-brand").outerWidth(true);this.state.sitesW=this.getSites().outerWidth(true);this.state.tabsW=this.getTabs().outerWidth(true);this.state.toolsW=this.getTools().outerWidth(false);this.state.moreW=b("#o_navbar_more:visible").outerWidth(true)};a.prototype.getOverflow=function(c){var d=this.state.navbarW;d-=this.state.sitesW;d-=this.state.tabsW;d-=this.state.toolsW;d-=this.state.brandW;d-=this.state.moreW;d-=25;return -d};a.prototype.optimize=function(h){var c=this.getOverflow();var k=this.getSites();var l=this.getTabs();var g=this.getTools();var n=this.getMoreDropdown();var f=this.getOffcanvasRight();this.updateState();while(c>0&&(!this.state.tabs.collapsed||!this.state.sites.collapsed||!this.state.tools.collapsed)){if(!this.state.tabs.collapsed){this.collapse(l,n,"li","o_dropdown_tab")}else{if(!this.state.sites.collapsed){this.collapse(k,n,"li","o_dropdown_site")}else{if(!this.state.tools.collapsed){this.collapse(g,f,".o_navbar_tool:not(#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu)","o_tool_right")}}}this.calculateWidth();c=this.getOverflow();this.updateState()}while(c<0&&(!this.state.tabs.extended||!this.state.sites.extended||!this.state.tools.extended)){if(!this.state.tools.extended){var m=this.extend(f,g.children("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").first(),".o_tool_right","o_tool_right",true);if(!m){break}}if(!this.state.sites.extended){var j=this.extend(n,k,"li","o_dropdown_site");if(!j){break}}else{if(!this.state.tabs.extended){var d=this.extend(n,l,"li","o_dropdown_tab");if(!d){break}}}this.calculateWidth();c=this.getOverflow();this.updateState()}if(this.state.sites.extended&&this.state.tabs.extended){var i=b("#o_navbar_more");i.css("display","none")}this.checkToolsOrder()};a.prototype.updateState=function(){this.state.sites.collapsed=this.isSitesCollapsed();this.state.sites.extended=this.isSitesExtended();this.state.tabs.collapsed=this.isTabsCollapsed();this.state.tabs.extended=this.isTabsExtended();this.state.tools.collapsed=this.isToolsCollapsed();this.state.tools.extended=this.isToolsExtended()};a.prototype.collapse=function(g,d,c,f){var e=g.find(c);if(e.length){e=e.last()}if(e.length){f&&e.addClass(f);if(d){e.prependTo(d)}}this.updateDropdownToggle(g)};a.prototype.extend=function(g,d,c,i,f){var e=g.find(c);if(e.length){e=e.first()}var j=false;if(e.length){if(d&&d.length){if(f){d.before(e)}else{e.appendTo(d)}this.updateDropdownToggle(g);this.calculateWidth();var h=this.getOverflow();if(h>0){e.prependTo(g)}else{i&&e.removeClass(i);j=true}}}this.updateDropdownToggle(g);return j};a.prototype.updateDropdownToggle=function(c){var d=c.parents(".o_dropdown_toggle");if(!d.length){return}if(c.children().length){d.css("display","block")}else{d.css("display","none")}};a.prototype.addExtraElements=function(){var d=b("#o_navbar_container .o_navbar-collapse");var c=b("#o_navbar_more");if(c.length==0){c=b('<ul id="o_navbar_more" class="nav o_navbar-nav o_dropdown_toggle"><li><a class="dropdown-toggle" data-toggle="dropdown" href="#"">'+o_info.i18n_topnav_more+' <b class="caret"></b></a><ul class="dropdown-menu dropdown-menu-right"></ul></li></ul>');c.appendTo(d)}this.getSites().append('<li class="divider o_dropdown_site"></li>');b("#o_navbar_help .o_icon, #o_navbar_print .o_icon").addClass("o_icon-fw")};a.prototype.cleanupMoreDropdown=function(){if(!this.state.sitesDirty){var f=this.getSites();var d=this.getMoreDropdown().children(".o_dropdown_site");d.appendTo(f)}else{this.getSites().append('<li class="divider o_dropdown_site"></li>')}if(!this.state.tabsDirty){var e=this.getTabs();var c=this.getMoreDropdown().children(".o_dropdown_tab");c.prependTo(e)}this.getMoreDropdown().empty()};a.prototype.checkToolsOrder=function(){var f=this.getTools();var e=f.find("#o_navbar_help");var d=f.find("#o_navbar_print");var c=f.find("#o_navbar_imclient");if(c&&d){c.after(d)}if(c&&e){c.after(e)}};a.prototype.showRight=function(){if(!this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;var d=this;var c=b("#o_offcanvas_right");c.show().transition({x:-d.state.offCanvasWidth},function(){b("body").addClass("o_offcanvas_right_visible");var e=b.proxy(d.hideRightOnClick,d);setTimeout(function(){b("html").on("click",e);d.offcanvasTransitioning=false},10)})}};a.prototype.hideRightOnClick=function(c){if("INPUT"!=c.target.nodeName){this.hideRight()}};a.prototype.hideRight=function(){if(this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;b("html").off("click",b.proxy(this.hideRight,this));var d=this;var c=b("#o_offcanvas_right");c.transition({x:d.state.offCanvasWidth},function(){c.hide();b("body").removeClass("o_offcanvas_right_visible");d.offcanvasTransitioning=false})}};a.prototype.toggleRight=function(){if(this.isOffcanvasVisible()){this.hideRight()}else{this.showRight()}};a.prototype.isOffcanvasVisible=function(){return b("#o_offcanvas_right:visible").length};a.prototype.getSites=function(){return b("#o_navbar_container .o_navbar_sites")};a.prototype.getTabs=function(){return b("#o_navbar_container .o_navbar_tabs")};a.prototype.getTools=function(){return b("#o_navbar_container #o_navbar_tools_permanent")};a.prototype.getMoreDropdown=function(){return b("#o_navbar_more .dropdown-menu")};a.prototype.getOffcanvasRight=function(){return b("#o_offcanvas_right_container .o_navbar-right")};a.prototype.isSitesCollapsed=function(){return !this.getSites().children("li").not(".divider").length};a.prototype.isSitesExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_site").not(".divider").length};a.prototype.isTabsCollapsed=function(){return !this.getTabs().children("li").length};a.prototype.isTabsExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_tab").length};a.prototype.isToolsCollapsed=function(){return !this.getTools().children(".o_navbar_tool").not("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").length};a.prototype.isToolsExtended=function(){return !this.getOffcanvasRight().children(".o_tool_right").length};b(document).ready(function(){var d=b("#o_navbar_wrapper");if(d){var c=new a();window.OPOL.navbar=c}})}(jQuery);+function(b){b.fn.ooBgCarrousel=function(){return new a()};var a=function(){};a.prototype.initCarrousel=function(g){this.settings=b.extend({query:null,images:[],shuffle:false,shuffleFirst:false,durationshow:5000,durationout:500,durationin:500,easeout:"ease",easein:"ease"},g);this.pos=null;if(this.settings.query==null||this.settings.images.length==0){return}this.initialImage=this.settings.images[0];if(this.settings.shuffle){var f=this.settings.images;for(var d,c,e=f.length;e;d=parseInt(Math.random()*e),c=f[--e],f[e]=f[d],f[d]=c){}}if(this.settings.shuffleFirst){this._replaceImage()}this.rotate()};a.prototype.rotate=function(){setTimeout(b.proxy(this._hideCurrent,this),this.settings.durationshow)};a.prototype._hideCurrent=function(){var c=b(this.settings.query);if(c&&c.size()>0){c.transition({opacity:0,duration:this.settings.durationout,easing:this.settings.easeout},b.proxy(this._showNext,this))}};a.prototype._replaceImage=function(d){if(!d){d=b(this.settings.query)}if(d&&d.size()>0){this.newImg="";this.oldImg="";if(this.pos==null){this.pos=1;this.oldImg=this.initialImage}else{this.oldImg=this.settings.images[this.pos];this.pos++;if(this.settings.images.length==this.pos){this.pos=0}}this.newImg=this.settings.images[this.pos];var c=d.css("background-image");if(c.indexOf(this.oldImg)==-1){d.transition({opacity:1,duration:0});return}var e=c.replace(this.oldImg,this.newImg);d.css("background-image",e)}};a.prototype._showNext=function(){var c=b(this.settings.query);this._replaceImage(c);c.transition({opacity:1,duration:this.settings.durationin,easing:this.settings.easein},b.proxy(this.rotate,this))}}(jQuery);!function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=i(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function r(e){var n,r=this;if(null!=e)t.call(r),r.each(function(t,n){var r;(r=tinymce.get(n.id))&&r.setContent(e)});else if(r.length>0&&(n=tinymce.get(r[0].id)))return n.getContent()}function i(e){var t=null;return e&&e.id&&a.tinymce&&(t=tinymce.get(e.id)),t}function o(e){return!!(e&&e.length&&a.tinymce&&e.is(":tinymce"))}var s={};e.each(["text","html","val"],function(t,a){var l=s[a]=e.fn[a],c="text"===a;e.fn[a]=function(t){var a=this;if(!o(a))return l.apply(a,arguments);if(t!==n)return r.call(a.filter(":tinymce"),t),l.apply(a.not(":tinymce"),arguments),a;var s="",u=arguments;return(c?a:a.eq(0)).each(function(t,n){var r=i(n);s+=r?c?r.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):r.getContent({save:!0}):l.apply(e(n),u)}),s}}),e.each(["append","prepend"],function(t,r){var a=s[r]=e.fn[r],l="prepend"===r;e.fn[r]=function(e){var t=this;return o(t)?e!==n?("string"==typeof e&&t.filter(":tinymce").each(function(t,n){var r=i(n);r&&r.setContent(l?e+r.getContent():r.getContent()+e)}),a.apply(t.not(":tinymce"),arguments),t):void 0:a.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,r){var i=s[r]=e.fn[r];e.fn[r]=function(){return t.call(this,r),i.apply(this,arguments)}}),s.attr=e.fn.attr,e.fn.attr=function(t,a){var l=this,c=arguments;if(!t||"value"!==t||!o(l))return a!==n?s.attr.apply(l,c):s.attr.apply(l,c);if(a!==n)return r.call(l.filter(":tinymce"),a),s.attr.apply(l.not(":tinymce"),c),l;var u=l[0],d=i(u);return d?d.getContent({save:!0}):s.attr.apply(e(u),c)}}var n,r,i,o=[],a=window;e.fn.tinymce=function(n){function s(){var r=[],o=0;i||(t(),i=!0),d.each(function(e,t){var i,a=t.id,s=n.oninit;a||(t.id=a=tinymce.DOM.uniqueId()),tinymce.get(a)||(i=new tinymce.Editor(a,n,tinymce.EditorManager),r.push(i),i.on("init",function(){var e,t=s;d.css("visibility",""),s&&++o==r.length&&("string"==typeof t&&(e=t.indexOf(".")===-1?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,r))}))}),e.each(r,function(e,t){t.render()})}var l,c,u,d=this,f="";if(!d.length)return d;if(!n)return window.tinymce?tinymce.get(d[0].id):null;if(d.css("visibility","hidden"),a.tinymce||r||!(l=n.script_url))1===r?o.push(s):s();else{r=1,c=l.substring(0,l.lastIndexOf("/")),l.indexOf(".min")!=-1&&(f=".min"),a.tinymce=a.tinyMCEPreInit||{base:c,suffix:f},l.indexOf("gzip")!=-1&&(u=n.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(f)+"&themes="+escape(n.theme||"modern")+"&plugins="+escape(n.plugins||"")+"&languages="+(u||""),a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+u+".js"),t("themes/"+n.theme+"/theme"+f+".js"),t("themes/"+n.theme+"/langs/"+u+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+f+".js"),t("plugins/"+n+"/langs/"+u+".js"))})},end:function(){}}));var p=document.createElement("script");p.type="text/javascript",p.onload=p.onreadystatechange=function(t){t=t||window.event,2===r||"load"!=t.type&&!/complete|loaded/.test(p.readyState)||(tinymce.dom.Event.domLoaded=1,r=2,n.script_loaded&&n.script_loaded(),s(),e.each(o,function(e,t){t()}))},p.src=l,document.body.appendChild(p)}return d},e.extend(e.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in window&&(t=tinymce.get(e.id),t&&t.editorManager===tinymce))}})}(jQuery);OPOL={};var o2c=0;var o3c=new Array();o_info.guibusy=false;o_info.linkbusy=false;o_info.scrolling=false;o_info.debug=true;var BLoader={_ajaxLoadedJS:new Array(),_isAlreadyLoadedJS:function(b){var a=true;jQuery("head script[src]").each(function(d,c){if(jQuery(c).attr("src").indexOf(b)!=-1){a=false}});if(jQuery.inArray(b,this._ajaxLoadedJS)!=-1){a=false}return !a},loadJS:function(b,c,a){if(!this._isAlreadyLoadedJS(b)){if(o_info.debug){o_log("BLoader::loadJS: loading ajax::"+a+" url::"+b)}if(a){jQuery.ajax(b,{async:false,dataType:"script",cache:true,success:function(d,f,e){}});this._ajaxLoadedJS.push(b)}else{jQuery.getScript(b)}if(o_info.debug){o_log("BLoader::loadJS: loading DONE url::"+b)}}else{if(o_info.debug){o_log("BLoader::loadJS: already loaded url::"+b)}}},executeGlobalJS:function(jsString,contextDesc){try{if(window.execScript){window.execScript(jsString)}else{window.eval(jsString)}}catch(e){if(window.console){console.log(contextDesc,"cannot execute js",jsString)}if(o_info.debug){o_logerr("BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString))}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString),"functions.js::BLoader::executeGlobalJS::"+contextDesc)}if(window.location.href.indexOf("o_winrndo")!=-1){window.location.reload()}else{window.location.href=window.location.href+(window.location.href.indexOf("?")!=-1?"&":"?")+"o_winrndo=1"}}},loadCSS:function(b,p,r){var s=window.document;try{if(s.createStyleSheet){var m=s.styleSheets;var d=0;var q=0;for(i=0;i<m.length;i++){var n=m[i];var g=n.href;if(g==b){d++;if(n.disabled){n.disabled=false;return}else{if(o_info.debug){o_logwarn("BLoader::loadCSS: style: "+b+" already in document and not disabled! (duplicate add)")}return}}if(n.id=="o_theme_css"){q=i}}if(d>1&&o_info.debug){o_logwarn("BLoader::loadCSS: apply styles: num of stylesheets found was not 0 or 1:"+d)}if(r){q=m.length}var f=s.createStyleSheet(b,q)}else{var c=jQuery("#"+p);if(c&&c.size()>0){if(o_info.debug){o_logwarn("BLoader::loadCSS: stylesheet already found in doc when trying to add:"+b+", with id "+p)}return}else{var a=jQuery('<link id="'+p+'" rel="stylesheet" type="text/css" href="'+b+'">');if(r){a.insertBefore(jQuery("#o_fontSize_css"))}else{a.insertBefore(jQuery("#o_theme_css"))}}}}catch(o){if(window.console){console.log(o)}if(o_info.debug){o_logerr("BLoader::loadCSS: Error when loading CSS from URL::"+b)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::loadCSS: Error when loading CSS from URL::"+b,"functions.js::BLoader::loadCSS")}}},unLoadCSS:function(a,n){var o=window.document;try{if(o.createStyleSheet){var f=o.styleSheets;var d=0;var p=a;var b=window.location.href.substring(0,window.location.href.indexOf("/",8));if(a.indexOf(b)==0){p=a.substring(b.length)}for(i=0;i<f.length;i++){var g=f[i].href;if(g==a||g==p){d++;if(!f[i].disabled){f[i].disabled=true}else{if(o_info.debug){o_logwarn("stylesheet: when removing: matching url, but already disabled! url:"+g)}}}}if(d!=1&&o_info.debug){o_logwarn("stylesheet: when removeing: num of stylesheets found was not 1:"+d)}}else{var c=jQuery("#"+n);if(c){c.href="";c.remove();c=null;return}else{if(o_info.debug){o_logwarn("no link with id found to remove, id:"+n+", url "+a)}}}}catch(m){if(o_info.debug){o_logerr("BLoader::unLoadCSS: Error when unloading CSS from URL::"+a)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::unLoadCSS: Error when unloading CSS from URL::"+a,"functions.js::BLoader::loadCSS")}}}};var BFormatter={formatLatexFormulas:function(b){try{if(typeof MathJax==="undefined"){o_mathjax()}else{if(MathJax&&MathJax.isReady){jQuery(function(){MathJax.Hub.Queue(function(){if(jQuery("#"+b+" .MathJax").length==0){MathJax.Hub.Typeset(b)}})})}else{setTimeout(function(){BFormatter.formatLatexFormulas(b)},100)}}}catch(a){if(window.console){console.log("error in BFormatter.formatLatexFormulas: ",a)}}},alignTableColumns:function(a){try{var b=new Array();jQuery(a).each(function(){for(j=0;j<jQuery(this)[0].rows[0].cells.length;j++){var d=jQuery(this)[0].rows[0].cells[j];if(!b[j]||b[j]<d.clientWidth){b[j]=d.clientWidth}}});jQuery(a).each(function(){for(j=0;j<jQuery(this)[0].rows[0].cells.length;j++){jQuery(this)[0].rows[0].cells[j].style.width=b[j]+"px"}})}catch(c){if(window.console){console.log("error in BFormatter.alignTableColumns: ",c)}}}};function o_init(){try{o_getMainWin().o_afterserver();if(window.location.href&&window.location.href!=null&&window.location.href.indexOf("%3A")<0){var a=window.location.href;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}}}catch(b){if(o_info.debug){o_log("error in o_init: "+showerror(b))}}}function o_initEmPxFactor(){o_info.emPxFactor=jQuery("#o_width_1em").width();if(o_info.emPxFactor==0||o_info.emPxFactor=="undefined"){o_info.emPxFactor=12;if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Could not read with of element b_width_1em, set o_info.emPxFactor to 12","functions.js")}}}function o_getMainWin(){try{if(window.OPOL){return window}else{if(window.opener&&window.opener.OPOL){return window.opener}}}catch(a){if(o_info.debug){o_logerr('Exception while getting main window. rror::"'+showerror(a))}if(window.console){console.log('Exception while getting main window. rror::"'+showerror(a),"functions.js");console.log(a)}}throw"Can not find main OpenOLAT window"}function o_beforeserver(){o_info.linkbusy=true;showAjaxBusy();if(window.suppressOlatOnUnloadOnce){window.suppressOlatOnUnloadOnce=false}else{if(window.olatonunload){olatonunload()}}}function o_afterserver(){o2c=0;o_info.linkbusy=false;removeAjaxBusy()}function o2cl(){try{if(o_info.linkbusy){return false}else{var b=(o2c==0||confirm(o_info.dirty_form));if(b){o_beforeserver()}return b}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_dirtyCheckOnly(){try{if(o_info.linkbusy){return false}else{return(o2c==0||confirm(o_info.dirty_form))}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_noDirtyCheck(){if(o_info.linkbusy){return false}else{o_beforeserver();return true}}function o3cl(d){if(o_info.linkbusy){return false}else{var b=o3c1.indexOf(d)>-1;var a=(b&&o3c1.length>1)||o3c1.length>0;var c=(!a||confirm(o_info.dirty_form));if(c){o_beforeserver()}return c}}function o_onc(a){var b=a.responseText;BLoader.executeGlobalJS("o_info.last_o_onc="+b+";","o_onc");o_ainvoke(o_info.last_o_onc,false)}function o_allowNextClick(){o_info.linkbusy=false;removeAjaxBusy()}function removeBusyAfterDownload(c,b,a){o2c=0;o_afterserver()}Array.prototype.search=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(this[b].constructor==Array){if(this[b].search(c,d)){return true;break}}else{if(d){if(this[b].indexOf(c)!=-1){return true;break}}else{if(this[b]==c){return true;break}}}}return false};if(!Function.prototype.curry){Function.prototype.curry=function(){if(arguments.length<1){return this}var a=this;var b=Array.prototype.slice.call(arguments);return function(){return a.apply(this,b.concat(Array.prototype.slice.call(arguments)))}}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){if(this==null){throw new TypeError()}var d=Object(this);var a=d.length>>>0;if(a===0){return -1}var e=0;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}else{if(e!=0&&e!=Infinity&&e!=-Infinity){e=(e>0||-1)*Math.floor(Math.abs(e))}}}if(e>=a){return -1}var b=e>=0?e:Math.max(a-Math.abs(e),0);for(;b<a;b++){if(b in d&&d[b]===c){return b}}return -1}}var b_onDomReplacementFinished_callbacks=new Array();function b_AddOnDomReplacementFinishedCallback(a){var b=jQuery(document).ooLog().isDebugEnabled();if(b){jQuery(document).ooLog("debug","callback stack size: "+b_onDomReplacementFinished_callbacks.length,"functions.js ADD")}if(b&&b_onDomReplacementFinished_callbacks.toSource){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js ADD")}b_onDomReplacementFinished_callbacks.push(a);if(b){jQuery(document).ooLog("debug","push to callback stack, func: "+a,"functions.js ADD")}}var b_changedDomEl=new Array();function b_AddOnDomReplacementFinishedUniqueCallback(a){if(a.constructor==Array){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","add: its an ARRAY! ","functions.js ADD")}if(b_onDomReplacementFinished_callbacks.search(a[0])){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","push to callback stack, already there!!: "+a[0],"functions.js ADD")}return}}b_AddOnDomReplacementFinishedCallback(a)}var o_debug_trid=0;function o_ainvoke(N){if(N==undefined){return}o_info.inainvoke=true;var I=N.cmdcnt;if(I>0){jQuery(document).trigger("oo.dom.replacement.before");b_changedDomEl=new Array();if(o_info.debug){o_debug_trid++}var y=N.cmds;for(var T=0;T<I;T++){var J=y[T];var A=J.cmd;var R=J.cda;var U=J.w;var c=this.window;var K;if(c){switch(A){case 1:var M=R.e;BLoader.executeGlobalJS(M,"o_ainvoker::jsexec");if(o_info.debug){o_log("c1: execute jscode: "+M)}case 2:var u=R.cc;var F=R.cps;for(var Q=0;Q<u;Q++){var m=F[Q];var h=m.cid;var P=m.cidvis;var H=m.cw;var x=m.hfrag;var O=m.jsol;var g=m.hdr;if(o_info.debug){o_log("c2: redraw: "+m.cname+" ("+h+") "+m.hfragsize+" bytes, listener(s): "+m.clisteners)}var W=g+"\n\n"+x;var C="";var S=false;var E="o_c"+h;var B=jQuery("#"+E);if(B==null||B.length==0){E="o_fi"+h;B=jQuery("#"+E);S=true}if(B!=null){var w=jQuery("div.o_richtext_mce textarea",B);for(var L=0;L<w.length;L++){try{var a=jQuery(w.get(L)).attr("id");if(typeof top.tinymce!=undefined){top.tinymce.remove("#"+a)}}catch(Z){if(window.console){console.log(Z)}}}if(P){B.css("display","")}else{B.css("display","none")}if(S||!H){B.replaceWith(W)}else{try{B.empty().html(W);if(W.length>0&&B.get(0).innerHTML==""){B.get(0).innerHTML=W}}catch(Z){if(window.console){console.log(Z)}if(window.console){console.log("Fragment",W)}}b_changedDomEl.push(E)}B=null;if(C!=""){C.each(function(e){BLoader.executeGlobalJS(e,"o_ainvoker::inscripts")})}if(O!=""){BLoader.executeGlobalJS(O,"o_ainvoker::jsol")}}}break;case 3:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 5:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 6:c.o2c=0;c.o_afterserver();break;case 7:var o=c.document.location;var z=o.protocol+"//"+o.hostname;if(o.port!=""){z+=":"+o.port}var v=R.cssrm;for(Q=0;Q<v.length;Q++){var D=v[Q];var G=D.id;var f=z+D.url;BLoader.unLoadCSS(f,G);if(o_info.debug){o_log("c7: rm css: id:"+G+" ,url:'"+f+"'")}}var V=R.cssadd;for(k=0;k<V.length;k++){var D=V[k];var G=D.id;var f=z+D.url;var n=D.pt;BLoader.loadCSS(f,G,n);if(o_info.debug){o_log("c7: add css: id:"+G+" ,url:'"+f+"'")}}var p=R.jsadd;for(l=0;l<p.length;l++){var D=p[l];var Y=D.before;if(jQuery.type(Y)==="string"){BLoader.executeGlobalJS(Y,"o_ainvoker::preJsAdd")}var f=D.url;var q=D.enc;if(jQuery.type(f)==="string"){BLoader.loadJS(f,q,true)}if(o_info.debug){o_log("c7: add js: "+f)}}break;default:if(o_info.debug){o_log("?: unknown command "+A)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), ?: unknown command "+A,"functions.js")}break}}else{if(o_info.debug){o_log("could not find window??")}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), could not find window??","functions.js")}}}var b=b_onDomReplacementFinished_callbacks.length;if(b_onDomReplacementFinished_callbacks.toSource&&jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js")}for(mycounter=0;b>mycounter;mycounter++){if(mycounter>50){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stopped executing DOM replacement callback functions - to many functions::"+b_onDomReplacementFinished_callbacks.length,"functions.js")}break}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize before shift: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}var s=b_onDomReplacementFinished_callbacks.shift();if(typeof s.length==="number"){if(s[0]=="glosshighlighter"){var d=s[1];if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","arr fct: "+d,"functions.js")}s=d}}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Executing DOM replacement callback function #"+mycounter+" with timeout funct::"+s,"functions.js")}s();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize after timeout: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}}jQuery(document).trigger("oo.dom.replacement.after")}o_info.inainvoke=false}function clearAfterAjaxIframeCall(){if(o_info.linkbusy){o_afterserver()}}function showAjaxBusy(){setTimeout(function(){if(o_info.linkbusy){try{if(jQuery("#o_ajax_busy_backdrop").length==0){jQuery("#o_body").addClass("o_ajax_busy");jQuery("#o_ajax_busy").modal({show:true,backdrop:"static",keyboard:"false"});jQuery("#o_ajax_busy").after('<div id="o_ajax_busy_backdrop" class="modal-backdrop in"></div>');jQuery("#o_ajax_busy>.modal-backdrop").remove();jQuery("#o_ajax_busy_backdrop").css({"z-index":1200})}}catch(a){if(window.console){console.log(a)}}}},700)}function removeAjaxBusy(){try{jQuery("#o_body").removeClass("o_ajax_busy");jQuery("#o_ajax_busy_backdrop").remove();jQuery("#o_ajax_busy").modal("hide")}catch(a){if(window.console){console.log(a)}}}function setFormDirty(c){o2c=1;var a=document.getElementById(c);if(a!=null){var b=a.olat_fosm_0;if(b==null){b=a.olat_fosm}if(b){b.className="btn o_button_dirty"}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in setFormDirty, myForm was null for formId="+c,"functions.js")}}}function contextHelpWindow(a){helpWindow=window.open(a,"HelpWindow","height=760, width=940, left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no");helpWindow.focus()}function o_openPopUp(b,d,c,a,f){attributes="height="+a+", width="+c+", resizable=yes, scrollbars=yes, left=100, top=100, ";if(f){attributes+="location=yes, menubar=yes, status=yes, toolbar=yes"}else{attributes+="location=no, menubar=no, status=no, toolbar=no"}var h;try{h=window.open(b,d,attributes)}catch(g){h=window.open(b,"OpenOLAT",attributes)}h.focus();if(o_info.linkbusy){o_afterserver()}}function b_handleFileUploadFormChange(e,b,d){var f=e.value;slashPos=f.lastIndexOf("/");if(slashPos!=-1){f=f.substring(slashPos+1)}slashPos=f.lastIndexOf("\\");if(slashPos!=-1){f=f.substring(slashPos+1)}b.value=f;if(d){d.className="o_button_dirty"}var c=e.form.elements;for(i=0;i<c.length;i++){var a=c[i];if(a.name==b.name&&i+1<c.length){c[i+1].focus()}}}function gotonode(a){try{if(typeof o_activateCourseNode!="undefined"){o_activateCourseNode(a)}else{if(opener&&typeof opener.o_activateCourseNode!="undefined"){opener.o_activateCourseNode(a)}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode(), could not find main window","functions.js")}}}}catch(b){alert("Goto node error:"+b);if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode()::"+b.message,"functions.js")}}}function o_viewportHeight(){var a=jQuery(document).height();if(a>0){return a}else{return 600}}OPOL.getMainColumnsMaxHeight=function(){var m=0,f=0,a=0,c=0,h=0,b,g=jQuery("#o_main_left_content"),e=jQuery("#o_main_right_content"),d=jQuery("#o_main_center_content");if(g!="undefined"&&g!=null){m=g.outerHeight(true)}if(e!="undefined"&&e!=null){f=e.outerHeight(true)}if(d!="undefined"&&d!=null){a=d.outerHeight(true)}c=(m>f?m:f);c=(c>a?c:a);if(c>0){return c}b=jQuery("#o_main");if(b!="undefined"&&b!=null){h=b.height()}if(b>0){return b}return o_viewportHeight()};OPOL.adjustHeight=function(){try{var a=0;col1=jQuery("#o_main_left_content").outerHeight(true);col2=jQuery("#o_main_right_content").outerHeight(true);col3=jQuery("#o_main_center_content").outerHeight(true);a=Math.max(col1,col2,col3);if(col1!=null){jQuery("#o_main_left").css({"min-height":a+"px"})}if(col2!=null){jQuery("#o_main_right").css({"min-height":a+"px"})}if(col3!=null){jQuery("#o_main_center").css({"min-height":a+"px"})}}catch(b){if(window.console){console.log(b)}}};jQuery(window).resize(function(){clearTimeout(o_info.resizeId);o_info.resizeId=setTimeout(function(){jQuery(document).trigger("oo.window.resize.after")},500)});jQuery(document).on("oo.window.resize.after",OPOL.adjustHeight);jQuery(document).on("oo.dom.replacement.after",OPOL.adjustHeight);jQuery().ready(OPOL.adjustHeight);function o_scrollToElement(a){try{o_info.scrolling=true;jQuery("html, body").animate({scrollTop:jQuery(a).offset().top},333,function(d,c){o_info.scrolling=false})}catch(b){}}function o_popover(c,b,a){if(typeof(a)==="undefined"){a="bottom"}jQuery("#"+c).popover({placement:a,html:true,trigger:"click",container:"body",content:function(){return jQuery("#"+b).clone().html()}}).on("shown.bs.popover",function(){var d=function(f){jQuery("#"+c).popover("hide");jQuery("body").unbind("click",d)};setTimeout(function(){jQuery("body").on("click",d)},5)})}function o_popoverWithTitle(d,c,b,a){if(typeof(a)==="undefined"){a="bottom"}return jQuery("#"+d).popover({placement:a,html:true,title:b,trigger:"click",container:"body",content:function(){return jQuery("#"+c).clone().html()}}).on("shown.bs.popover",function(){var e=function(f){jQuery("#"+d).popover("destroy");jQuery("body").unbind("click",e)};setTimeout(function(){jQuery("body").on("click",e)},5)})}function o_shareLinkPopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:c}).on("shown.bs.popover",function(){var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)});a.attr("title",a.attr("data-original-title"))}function o_QRCodePopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:'<div id="'+d+'_pop" class="o_qrcode"></div>'}).on("shown.bs.popover",function(){o_info.qr=o_QRCode(d+"_pop",(jQuery.isFunction(c)?c():c));var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)}).on("hidden.bs.popover",function(){try{o_info.qr.clear();delete o_info.qr}catch(f){}});a.attr("title",a.attr("data-original-title"))}function o_QRCode(c,b){try{BLoader.loadJS(o_info.o_baseURI+"/js/jquery/qrcodejs/qrcode.min.js","utf8",true);return new QRCode(document.getElementById(c),b)}catch(a){return null}}function b_resizeIframeToMainMaxHeight(f){var d=jQuery("#"+f);if(d!="undefined"&&d!=null){var c=OPOL.getMainColumnsMaxHeight()-110;var b=o_viewportHeight()-100;b=b-d.offset().top;var e=jQuery("#b_footer");if(e!="undefined"&&e!=null){b=b-e.outerHeight(true)}var a=(b>c?b:c);d.height(a)}}var o_debu_oldcn,o_debu_oldtt;function o_debu_show(b,a){if(o_debu_oldcn){o_debu_hide(o_debu_oldcn,o_debu_oldtt)}jQuery(b).addClass("o_dev_m");jQuery(a).show();o_debu_oldtt=a;o_debu_oldcn=b}function o_debu_hide(b,a){jQuery(a).hide();jQuery(b).removeClass("o_dev_m")}function o_dbg_mark(a){var b=jQuery("#"+a);if(b){b.css("background-color","#FCFCB8");b.css("border","3px solid #00F")}}function o_dbg_unmark(a){var b=jQuery("#"+a);if(b){b.css("border","");b.css("background-color","")}}function o_clearConsole(){o_log_all="";o_log(null)}var o_log_all="";function o_log(b){if(b){o_log_all="\n"+o_debug_trid+"> "+b+o_log_all;o_log_all=o_log_all.substr(0,4000)}var a=jQuery("#o_debug_cons");if(a){if(o_log_all.length==4000){o_log_all=o_log_all+"\n... (stripped: to long)... "}a.value=o_log_all}if(!jQuery.type(window.console)==="undefined"){window.console.log(b)}}function o_logerr(a){o_log("ERROR:"+a)}function o_logwarn(a){o_log("WARN:"+a)}function showerror(c){var a="";for(var b in c){a+=b+": "+c[b]+"\n"}return"error detail:\n"+a}function o_ffEvent(f,e,d,n,o){var g,h,b,a;g=document.getElementById(e);h=g.value;g.value=d;b=document.getElementById(n);a=b.value;b.value=o;var c=jQuery("#"+f);var m=c.attr("enctype");if(m&&m.indexOf("multipart")==0){o_XHRSubmitMultipart(f)}else{if(document.forms[f].onsubmit()){document.forms[f].submit()}}g.value=h;b.value=a}function o_IQEvent(a){if(document.forms[a].onsubmit()){document.forms[a].submit()}}function o_TableMultiActionEvent(a,c){var b=jQuery("#o_mai_"+a);b.val(c);if(document.forms[a].onsubmit()){document.forms[a].submit()}b.val("")}function o_XHRSubmit(h){if(o_info.linkbusy){return false}o_beforeserver();var o=true;var a=jQuery("#"+h);var n=a.attr("enctype");if(n&&n.indexOf("multipart")==0){var g="openolat-submit-"+(""+Math.random()).substr(2);var d=o_createIFrame(g);document.body.appendChild(d);a.attr("target",d.name);return true}else{var f=a.serializeArray();if(arguments.length>1){var m=arguments.length;for(var e=1;e<m;e=e+2){if(m>e+1){var c=new Object();c.name=arguments[e];c.value=arguments[e+1];f[f.length]=c}}}var b=a.attr("action");jQuery.ajax(b,{type:"POST",data:f,cache:false,dataType:"json",success:function(s,v,r){try{o_ainvoke(s);if(o){var p=s.businessPath;var q=s.documentTitle;var u=s.historyPointId;if(p){o_pushState(u,q,p)}}}catch(t){if(window.console){console.log(t)}}finally{o_afterserver()}},error:o_onXHRError});return false}}function o_XHRSubmitMultipart(a){var c=jQuery("#"+a);var d="openolat-submit-"+(""+Math.random()).substr(2);var b=o_createIFrame(d);document.body.appendChild(b);c.attr("target",b.name);c.submit();c.attr("target","")}function o_createIFrame(b){var a=jQuery('<iframe name="'+b+'" id="'+b+'" src="about:blank" style="position: absolute; top: -9999px; left: -9999px;"></iframe>');return a[0]}function o_removeIframe(a){jQuery("#"+a).remove()}function o_showFormDirtyDialog(a){o_scrollToElement("#o_top");jQuery("#o_form_dirty_message").modal("show");jQuery("#o_form_dirty_message .o_form_dirty_ignore").on("click",function(){jQuery("#o_form_dirty_message").modal("hide");jQuery("#o_form_dirty_message .o_form_dirty_ignore").off();a()});return false}function o_ffXHREvent(h,e,s,g,p,t,f,m){if(t&&o2c==1){var d=Array.prototype.slice.call(arguments);d[5]=false;var u=function(){o_ffXHREvent.apply(window,d)};return o_showFormDirtyDialog(u)}else{if(!o2cl_noDirtyCheck()){return false}}o_beforeserver();var v=new Object();if(m){var b=jQuery("#"+h);var q=b.serializeArray();var o=q.length;for(var r=0;r<o;r++){var n=q[r];if(n.name!="dispatchuri"&&n.name!="dispatchevent"){v[n.name]=n.value}}}v.dispatchuri=s;v.dispatchevent=p;if(arguments.length>8){var a=arguments.length;for(var r=8;r<a;r=r+2){if(a>r+1){v[arguments[r]]=arguments[r+1]}}}var c=jQuery("#"+h).attr("action");jQuery.ajax(c,{type:"POST",data:v,cache:false,dataType:"json",success:function(z,C,y){try{o_ainvoke(z);if(f){var w=z.businessPath;var x=z.documentTitle;var B=z.historyPointId;if(w){o_pushState(B,x,w)}}}catch(A){if(window.console){console.log(A)}}finally{o_afterserver()}},error:o_onXHRError})}function o_ffXHRNFEvent(f,e,a,h,m){var c=new Object();c.dispatchuri=a;c.dispatchevent=m;if(arguments.length>5){var g=arguments.length;for(var d=5;d<g;d=d+2){if(g>d+1){c[arguments[d]]=arguments[d+1]}}}var b=jQuery("#"+f).attr("action");jQuery.ajax(b,{type:"POST",data:c,cache:false,dataType:"json",success:function(o,p,n){}})}function o_XHREvent(h,f,c){if(f&&o2c==1){var b=Array.prototype.slice.call(arguments);b[1]=false;var a=function(){o_XHREvent.apply(window,b)};return o_showFormDirtyDialog(a)}else{if(!o2cl_noDirtyCheck()){return false}}o_beforeserver();var e=new Object();if(arguments.length>3){var g=arguments.length;for(var d=3;d<g;d=d+2){if(g>d+1){e[arguments[d]]=arguments[d+1]}}}jQuery.ajax(h,{type:"POST",data:e,cache:false,dataType:"json",success:function(p,s,o){try{if(c){try{var m=p.businessPath;var n=p.documentTitle;var r=p.historyPointId;if(m){o_pushState(r,n,m)}}catch(q){if(window.console){console.log(q)}}}o_ainvoke(p)}catch(q){if(window.console){console.log(q)}}finally{o_afterserver()}},error:o_onXHRError});return false}function o_XHRNFEvent(d){var b=new Object();if(arguments.length>1){var c=arguments.length;for(var a=1;a<c;a=a+2){if(c>a+1){b[arguments[a]]=arguments[a+1]}}}jQuery.ajax(d,{type:"POST",data:b,cache:false,dataType:"json",success:function(f,g,e){},error:o_onXHRError})}function o_onXHRError(a,d,b){o_afterserver();if(401==a.status){var c=o_info.oo_noresponse.replace("reload.html",window.document.location.href);showMessageBox("error",o_info.oo_noresponse_title,c,undefined)}else{if(window.console){console.log("Error status 2",d,b,a.responseText);console.log(a)}}}function o_pushState(d,f,a){try{var b=new Object();b.businessPath=a;b.historyPointId=d;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}if(window.history&&!(typeof window.history==="undefined")&&window.history.pushState){window.history.pushState(b,f,a)}else{window.location.hash=d}}catch(c){if(window.console){console.log(c,a)}}}function o_toggleMark(a){var b=jQuery("i",a).attr("class");if(b.indexOf("o_icon_bookmark_add")>=0){jQuery("i",a).removeClass("o_icon_bookmark_add").addClass("o_icon_bookmark")}else{jQuery("i",a).removeClass("o_icon_bookmark").addClass("o_icon_bookmark_add")}}function o_normalizeFilename(b){b=b.replace(/\s/g,"_");var f=["/",",",":","(",")"];for(var c=f.length;c-->0;){b=b.split(f[c]).join("_")}var a=["\u00C4","\u00D6","\u00DC","\u00E4","\u00F6","\u00E6","\u00FC","\u00DF","\u00F8","\u2205"],d=["Ae","Oe","Ue","ae","oe","ae","ue","ss","o","o"];for(var c=a.length;c-->0;){b=b.split(a[c]).join(d[c])}try{b=b.normalize("NFKD");b=b.replace("/p{InCombiningDiacriticalMarks}+/g","");b=b.replace("/W+/g","")}catch(g){if(window.console){console.log(g)}}return b}function setFlexiFormDirtyByListener(a){setFlexiFormDirty(a.data.formId,a.data.hideMessage)}function setFlexiFormDirty(b,c){var a=o3c.indexOf(b)>-1;if(!a){o3c.push(b)}jQuery("#"+b).each(function(){var d=jQuery(this).data("FlexiSubmit");if(d!=null){jQuery("#"+d).addClass("btn o_button_dirty");o2c=(c?0:1)}})}function o_ffRegisterSubmit(b,a){jQuery("#"+b).data("FlexiSubmit",a)}function dismissInfoBox(a){javascript:jQuery("#"+a).remove();return true}function showInfoBox(g,d){var c=Math.floor(Math.random()*65536).toString(16);var f='<div id="'+c+'" class="o_alert_info"><div class="alert alert-info clearfix o_sel_info_message"><a class="o_alert_close o_sel_info_close" href="javascript:;" onclick="dismissInfoBox(\''+c+'\')"><i class="o_icon o_icon_close"> </i></a><h3><i class="o_icon o_icon_info"> </i> '+g+"</h3><p>"+d+"</p></div></div>";var a=jQuery("#o_messages").prepend(f);var e=(d.length>150)?8000:((d.length>70)?6000:4000);var b=function(){jQuery("#"+c).transition({top:"-100%"},333,function(){jQuery("#"+c).remove()})};o_info.scrolling=true;jQuery("#"+c).show().transition({top:0},333);jQuery("#"+c).click(function(h){b()});o_scrollToElement("#o_top");g=null;d=null;a=null;setTimeout(function(){try{b()}catch(h){}},e)}function showMessageBox(b,f,d,a){if(b=="info"){showInfoBox(f,d);return null}else{var c='<div id="myFunctionalModal" class="modal fade" role="dialog"><div class="modal-dialog"><div class="modal-content">';c+='<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';c+='<h4 class="modal-title">'+f+"</h4></div>";c+='<div class="modal-body alert ';if("warn"==b){c+="alert-warning"}else{if("error"==b){c+="alert-danger"}else{c+="alert-info"}}c+='"><p>'+d+"</p></div></div></div></div>";jQuery("#myFunctionalModal").remove();jQuery("body").append(c);var e=jQuery("#myFunctionalModal").modal("show").on("hidden.bs.modal",function(g){jQuery("#myFunctionalModal").remove()});o_scrollToElement("#o_top");return e}}function o_table_toggleCheck(d,c){var a=document.forms[d].elements.tb_ms;len=a.length;if(typeof(len)=="undefined"){a.checked=c}else{var b;for(b=0;b<len;b++){a[b].checked=c}}}function onTreeStartDrag(a,b){jQuery(a.target).addClass("o_dnd_proxy")}function onTreeStopDrag(a,b){jQuery(a.target).removeClass("o_dnd_proxy")}function onTreeDrop(g,h){var a=jQuery(h.draggable[0]);var f=jQuery(this);f.css({position:"",width:""});var c=f.droppable("option","endUrl");if(c.lastIndexOf("/")==(c.length-1)){c=c.substring(0,c.length-1)}var e=a.attr("id");var b=e.substring(2,e.length);c+="%3Atnidle%3A"+b;var d=f.attr("id");if(d.indexOf("ds")==0){c+="%3Asne%3Ayes"}else{if(d.indexOf("dt")==0){c+="%3Asne%3Aend"}}jQuery(".ui-droppable").each(function(m,n){jQuery(n).droppable("disable")});o_XHREvent(c+"/",false,false)}function treeAcceptDrop(a){return true}function treeAcceptDrop_notWithChildren(a){var c=false;var b=jQuery(a);var e=b.attr("id");if(e!=undefined&&(e.indexOf("dd")==0||e.indexOf("ds")==0||e.indexOf("dt")==0||e.indexOf("da")==0||e.indexOf("row")==0)){var g=jQuery(this);var m=g.attr("id");var d=e.substring(2,e.length);var f=m.substring(2,m.length);if(d!=f){var h=jQuery("#dd"+d).parents("li");if(h.length>0&&jQuery(h.get(0)).find("#dd"+f).length==0){c=true}}}return c}function treeAcceptDrop_portfolio(b){var d=false;var c=jQuery(b);var f=c.attr("id");if(treeNode_isDragNode(f)){var h=jQuery(this);var o=h.attr("id");var e=f.substring(2,f.length);var g=o.substring(2,o.length);var n=f.indexOf("ds")==0||f.indexOf("dt")==0;if(e!=g){var m=treeNode_portfolioType(c);var a=treeNode_portfolioType(h);if(m=="artefact"){if(a=="page"||a=="struct"||a=="artefact"){d=true}}else{if(m=="struct"){if(a=="page"||a=="struct"){d=true}}else{if(m=="page"){if(a=="map"||a=="page"){d=true}}}}}}return d}function treeNode_portfolioType(e){var c=jQuery(e.get(0));var d=treeNode_portfolioTypes(c);if(d==null){var a=c.parent("a");if(a.length>0){d=treeNode_portfolioTypes(jQuery(a.get(0)))}else{if(c.attr("id").indexOf("ds")==0){var b=c.prev("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}else{if(c.attr("id").indexOf("dt")==0){var b=c.next("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}}}}return d}function treeNode_portfolioTypes(a){if(a.find===undefined){return null}else{if(a.find(".o_ep_icon_struct").length>0||a.hasClass("o_ep_icon_struct")){return"struct"}else{if(a.find(".o_ep_icon_page").length>0||a.hasClass("o_ep_icon_page")){return"page"}else{if(a.find(".o_ep_icon_map").length>0||a.hasClass("o_ep_icon_map")){return"map"}else{if(a.find(".o_ep_artefact").length>0||a.hasClass("o_ep_artefact")){return"artefact"}}}}}return null}function treeNode_isDragNode(a){if(a!=undefined&&(a.indexOf("dd")==0||a.indexOf("ds")==0||a.indexOf("dt")==0||a.indexOf("da")==0||a.indexOf("row")==0)){return true}return false}function o_choice_toggleCheck(c,b){var d=document.forms[c].elements;len=d.length;if(typeof(len)=="undefined"){d.checked=b}else{var a;for(a=0;a<len;a++){if(d[a].type=="checkbox"&&d[a].getAttribute("class")=="o_checkbox"){d[a].checked=b}}}}function b_briefcase_isChecked(c,e){var b;var a=document.getElementById(c);var d=0;for(b=0;a.elements[b];b++){if(a.elements[b].type=="checkbox"&&a.elements[b].name=="paths"&&a.elements[b].checked){d++}}if(d<1){alert(e);return false}return true}function b_briefcase_toggleCheck(d,c){var a=document.getElementById(d);len=a.elements.length;var b;for(b=0;b<len;b++){if(a.elements[b].name=="paths"){a.elements[b].checked=c}}}function o_doPrint(){var d=jQuery("div.o_iframedisplay iframe");if(d.length>0){try{var a=d[0];frames[a.name].focus();frames[a.name].print();return}catch(c){for(i=0;frames.length>i;i++){a=frames[i];if(a.name=="oaa0"){continue}var b=document.getElementsByName(a.name)[0];if(b&&b.getAttribute("class")=="ext-shim"){continue}if(a.name!=""){try{frames[a.name].focus();frames[a.name].print()}catch(c){window.print()}return}}window.print()}}else{window.print()}}function b_attach_i18n_inline_editing(){jQuery("span.o_translation_i18nitem").hover(function(){jQuery(this.firstChild).show();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Entered i18nitem::"+this.firstChild,"functions.js:b_attach_i18n_inline_editing()")}},function(){jQuery("a.o_translation_i18nitem_launcher").hide();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Leaving i18nitem::"+this,"functions.js:b_attach_i18n_inline_editing()")}});jQuery("a.o_translation_i18nitem_launcher").hover(function(){var a=jQuery(this).parent("span.o_translation_i18nitem");a.effect("highlight")});b_AddOnDomReplacementFinishedCallback(b_attach_i18n_inline_editing)}function b_hideExtMessageBox(){}var BDebugger={_lastDOMCount:0,_lastObjCount:0,_knownGlobalOLATObjects:["o_afterserver","o_onc","o_getMainWin","o_ainvoke","o_info","o_beforeserver","o_ffEvent","o_openPopUp","o_debu_show","o_logwarn","o_dbg_unmark","o_ffRegisterSubmit","o_clearConsole","o_init","o_log","o_allowNextClick","o_dbg_mark","o_debu_hide","o_logerr","o_debu_oldcn","o_debu_oldtt","o_debug_trid","o_log_all"],_countDOMElements:function(){return document.getElementsByTagName("*").length},_countGlobalObjects:function(){var a=0;for(prop in window){a++}return a},logDOMCount:function(){var b=BDebugger;var a=b._countDOMElements();var c=a-b._lastDOMCount;console.log((c>0?"+":"")+c+" \t"+a+" \tDOM element count after DOM replacement");b._lastDOMCount=a;a=null},logGlobalObjCount:function(){var b=BDebugger;var a=b._countGlobalObjects();var c=a-b._lastObjCount;console.log((c>0?"+":"")+c+" \t"+a+" \tGlobal object count after DOM replacement");b._lastObjCount=a;a=null},logGlobalOLATObjects:function(){var b=BDebugger;var a=new Array();for(prop in window){if(prop.indexOf("o_")==0&&b._knownGlobalOLATObjects.indexOf(prop)==-1){a.push(prop)}}if(a.length>0){console.log(a.length+" global OLAT objects found:");a.each(function(c){console.log("\t"+typeof window[c]+" \t"+c)})}}};/*! * jQuery Transit - CSS3 transitions and transformations * (c) 2011-2014 Rico Sta. Cruz * MIT Licensed.