var buildNumber=38;var buildDate="20150903 15:12";(function(a,b){function c(a){var b=na[a]={},c,d,a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}function d(a,c,d){if(d===b&&1===a.nodeType)if(d="data-"+c.replace(Ta,"-$1").toLowerCase(),d=a.getAttribute(d),"string"===typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:i.isNumeric(d)?parseFloat(d):Ua.test(d)?i.parseJSON(d):d}catch(e){}i.data(a,c,d)}else d=b;return d}function e(a){for(var b in a)if(!("data"===b&&i.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function f(a,
b,c){var d=b+"defer",e=b+"queue",f=b+"mark",g=i._data(a,d);g&&("queue"===c||!i._data(a,e))&&("mark"===c||!i._data(a,f))&&setTimeout(function(){!i._data(a,e)&&!i._data(a,f)&&(i.removeData(a,d,!0),g.fire())},0)}function g(){return!1}function h(){return!0}function j(a,b,c){b=b||0;if(i.isFunction(b))return i.grep(a,function(a,d){return!!b.call(a,d,a)===c});if(b.nodeType)return i.grep(a,function(a){return a===b===c});if("string"===typeof b){var d=i.grep(a,function(a){return 1===a.nodeType});if(Va.test(b))return i.filter(b,
d,!c);b=i.filter(b,d)}return i.grep(a,function(a){return 0<=i.inArray(a,b)===c})}function l(a){var b=oa.split("|"),a=a.createDocumentFragment();if(a.createElement)for(;b.length;)a.createElement(b.pop());return a}function m(a,b){if(1===b.nodeType&&i.hasData(a)){var c,d,e;d=i._data(a);var f=i._data(b,d),g=d.events;if(g)for(c in delete f.handle,f.events={},g)for(d=0,e=g[c].length;d<e;d++)i.event.add(b,c+(g[c][d].namespace?".":"")+g[c][d].namespace,g[c][d],g[c][d].data);if(f.data)f.data=i.extend({},f.data)}}
function k(a,b){var c;if(1===b.nodeType){b.clearAttributes&&b.clearAttributes();b.mergeAttributes&&b.mergeAttributes(a);c=b.nodeName.toLowerCase();if("object"===c)b.outerHTML=a.outerHTML;else if("input"===c&&("checkbox"===a.type||"radio"===a.type)){if(a.checked)b.defaultChecked=b.checked=a.checked;if(b.value!==a.value)b.value=a.value}else if("option"===c)b.selected=a.defaultSelected;else if("input"===c||"textarea"===c)b.defaultValue=a.defaultValue;b.removeAttribute(i.expando)}}function n(a){return"undefined"!==
typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!==typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function p(a){if("checkbox"===a.type||"radio"===a.type)a.defaultChecked=a.checked}function r(a){var b=(a.nodeName||"").toLowerCase();"input"===b?p(a):"script"!==b&&"undefined"!==typeof a.getElementsByTagName&&i.grep(a.getElementsByTagName("input"),p)}function o(a,b){b.src?i.ajax({url:b.src,async:!1,dataType:"script"}):i.globalEval((b.text||b.textContent||b.innerHTML||"").replace(Wa,
"/*$0*/"));b.parentNode&&b.parentNode.removeChild(b)}function t(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?Xa:Ya,f=0,g=e.length;if(0<d){if("border"!==c)for(;f<g;f++)c||(d-=parseFloat(i.css(a,"padding"+e[f]))||0),d="margin"===c?d+(parseFloat(i.css(a,c+e[f]))||0):d-(parseFloat(i.css(a,"border"+e[f]+"Width"))||0);return d+"px"}d=I(a,b,b);if(0>d||null==d)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;f<g;f++)d+=parseFloat(i.css(a,"padding"+e[f]))||0,"padding"!==c&&(d+=parseFloat(i.css(a,
"border"+e[f]+"Width"))||0),"margin"===c&&(d+=parseFloat(i.css(a,c+e[f]))||0);return d+"px"}function v(a){return function(b,c){var s;"string"!==typeof b&&(c=b,b="*");if(i.isFunction(c))for(var d=b.toLowerCase().split(pa),e=0,f=d.length,g,h;e<f;e++)g=d[e],(h=/^\+/.test(g))&&(g=g.substr(1)||"*"),s=a[g]=a[g]||[],g=s,g[h?"unshift":"push"](c)}}function w(a,c,d,e,f,g){f=f||c.dataTypes[0];g=g||{};g[f]=!0;for(var f=a[f],h=0,i=f?f.length:0,j=a===ba,k;h<i&&(j||!k);h++)k=f[h](c,d,e),"string"===typeof k&&(!j||
g[k]?k=b:(c.dataTypes.unshift(k),k=w(a,c,d,e,k,g)));if((j||!k)&&!g["*"])k=w(a,c,d,e,"*",g);return k}function A(a,c){var d,e,f=i.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&i.extend(!0,a,e)}function B(a,b,c,d){if(i.isArray(b))i.each(b,function(b,e){c||Za.test(a)?d(a,e):B(a+"["+("object"===typeof e||i.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&null!=b&&"object"===typeof b)for(var e in b)B(a+"["+e+"]",b[e],c,d);else d(a,b)}function C(){try{return new a.XMLHttpRequest}catch(b){}}
function ca(){setTimeout($a,0);return W=i.now()}function $a(){W=b}function N(a,b){var c={};i.each(qa.concat.apply([],qa.slice(0,b)),function(){c[this]=a});return c}function ra(a){if(!da[a]){var b=q.body,c=i("<"+a+">").appendTo(b),d=c.css("display");c.remove();if("none"===d||""===d){if(!F)F=q.createElement("iframe"),F.frameBorder=F.width=F.height=0;b.appendChild(F);if(!J||!F.createElement)J=(F.contentWindow||F.contentDocument).document,J.write(("CSS1Compat"===q.compatMode?"<!doctype html>":"")+"<html><body>"),
J.close();c=J.createElement(a);J.body.appendChild(c);d=i.css(c,"display");b.removeChild(F)}da[a]=d}return da[a]}function ea(a){return i.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var q=a.document,ab=a.navigator,bb=a.location,i=function(){function c(){if(!d.isReady){try{q.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,
l=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m=/^[\],:{}\s]*$/,n=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,o=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,v=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,C=/-([a-z]|[0-9])/ig,A=/^-ms-/,u=function(a,b){return(b+"").toUpperCase()},B=ab.userAgent,X,U,cb=Object.prototype.toString,ga=Object.prototype.hasOwnProperty,ha=Array.prototype.push,V=Array.prototype.slice,
sa=String.prototype.trim,ta=Array.prototype.indexOf,ua={};d.fn=d.prototype={constructor:d,init:function(a,c,e){var f;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!c&&q.body)return this.context=q,this[0]=q.body,this.selector=a,this.length=1,this;if("string"===typeof a){if((f="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&3<=a.length?[null,a,null]:h.exec(a))&&(f[1]||!c)){if(f[1])return e=(c=c instanceof d?c[0]:c)?c.ownerDocument||c:q,(a=l.exec(a))?
d.isPlainObject(c)?(a=[q.createElement(a[1])],d.fn.attr.call(a,c,!0)):a=[e.createElement(a[1])]:(a=d.buildFragment([f[1]],[e]),a=(a.cacheable?d.clone(a.fragment):a.fragment).childNodes),d.merge(this,a);if((c=q.getElementById(f[2]))&&c.parentNode){if(c.id!==f[2])return e.find(a);this.length=1;this[0]=c}this.context=q;this.selector=a;return this}return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a)}if(d.isFunction(a))return e.ready(a);if(a.selector!==b)this.selector=a.selector,this.context=
a.context;return d.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return V.call(this,0)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?ha.apply(e,a):d.merge(e,a);e.prevObject=this;e.context=this.context;if("find"===b)e.selector=this.selector+(this.selector?" ":"")+c;else if(b)e.selector=this.selector+"."+b+"("+c+")";return e},each:function(a,
b){return d.each(this,a,b)},ready:function(a){d.bindReady();X.add(a);return this},eq:function(a){a=+a;return-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(V.apply(this,arguments),"slice",V.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:ha,sort:[].sort,splice:[].splice};
d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a,c,e,f,g,s=arguments[0]||{},h=1,i=arguments.length,L=!1;"boolean"===typeof s&&(L=s,s=arguments[1]||{},h=2);"object"!==typeof s&&!d.isFunction(s)&&(s={});i===h&&(s=this,--h);for(;h<i;h++)if(null!=(a=arguments[h]))for(c in a)e=s[c],f=a[c],s!==f&&(L&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,e=e&&d.isArray(e)?e:[]):e=e&&d.isPlainObject(e)?e:{},s[c]=d.extend(L,e,f)):f!==b&&(s[c]=f));return s};d.extend({noConflict:function(b){if(a.$===
d)a.$=f;if(b&&a.jQuery===d)a.jQuery=e;return d},isReady:!1,readyWait:1,holdReady:function(a){a?d.readyWait++:d.ready(!0)},ready:function(a){if(!0===a&&!--d.readyWait||!0!==a&&!d.isReady){if(!q.body)return setTimeout(d.ready,1);d.isReady=!0;!0!==a&&0<--d.readyWait||(X.fireWith(q,[d]),d.fn.trigger&&d(q).trigger("ready").off("ready"))}},bindReady:function(){if(!X){X=d.Callbacks("once memory");if("complete"===q.readyState)return setTimeout(d.ready,1);if(q.addEventListener)q.addEventListener("DOMContentLoaded",
U,!1),a.addEventListener("load",d.ready,!1);else if(q.attachEvent){q.attachEvent("onreadystatechange",U);a.attachEvent("onload",d.ready);var b=!1;try{b=null==a.frameElement}catch(e){}q.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return"function"===d.type(a)},isArray:Array.isArray||function(a){return"array"===d.type(a)},isWindow:function(a){return a&&"object"===typeof a&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==
a?""+a:ua[cb.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==d.type(a)||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!ga.call(a,"constructor")&&!ga.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}for(var e in a);return e===b||ga.call(a,e)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw Error(a);},parseJSON:function(b){if("string"!==typeof b||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);
if(m.test(b.replace(n,"@").replace(p,"]").replace(o,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(c){var e,f;try{a.DOMParser?(f=new DOMParser,e=f.parseFromString(c,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(c))}catch(g){e=b}(!e||!e.documentElement||e.getElementsByTagName("parsererror").length)&&d.error("Invalid XML: "+c);return e},noop:function(){},globalEval:function(b){b&&i.test(b)&&(a.execScript||function(b){a.eval.call(a,
b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(C,u)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,s=a.length,h=s===b||d.isFunction(a);if(e)if(h)for(f in a){if(!1===c.apply(a[f],e))break}else for(;g<s&&!(!1===c.apply(a[g++],e)););else if(h)for(f in a){if(!1===c.call(a[f],f,a[f]))break}else for(;g<s&&!(!1===c.call(a[g],g,a[g++])););return a},trim:sa?function(a){return null==a?"":sa.call(a)}:function(a){return null==
a?"":a.toString().replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var e=d.type(a);null==a.length||"string"===e||"function"===e||"regexp"===e||d.isWindow(a)?ha.call(c,a):d.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(ta)return ta.call(b,a,c);d=b.length;for(c=c?0>c?Math.max(0,d+c):c:0;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if("number"===typeof c.length)for(var f=c.length;e<f;e++)a[d++]=c[e];else for(;c[e]!==b;)a[d++]=
c[e++];a.length=d;return a},grep:function(a,b,c){for(var d=[],e,c=!!c,f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,e){var f,g,s=[],h=0,i=a.length;if(a instanceof d||i!==b&&"number"===typeof i&&(0<i&&a[0]&&a[i-1]||0===i||d.isArray(a)))for(;h<i;h++)f=c(a[h],h,e),null!=f&&(s[s.length]=f);else for(g in a)f=c(a[g],g,e),null!=f&&(s[s.length]=f);return s.concat.apply([],s)},guid:1,proxy:function(a,c){if("string"===typeof c)var e=a[c],c=a,a=e;if(!d.isFunction(a))return b;
var f=V.call(arguments,2),e=function(){return a.apply(c,f.concat(V.call(arguments)))};e.guid=a.guid=a.guid||e.guid||d.guid++;return e},access:function(a,c,e,f,g,s){var h=a.length;if("object"===typeof c){for(var i in c)d.access(a,i,c[i],f,g,e);return a}if(e!==b){f=!s&&f&&d.isFunction(e);for(i=0;i<h;i++)g(a[i],c,f?e.call(a[i],i,g(a[i],c)):e,s);return a}return h?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();a=r.exec(a)||t.exec(a)||v.exec(a)||0>a.indexOf("compatible")&&
w.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this);a.superclass=this;a.fn=a.prototype=this();a.fn.constructor=a;a.sub=this.sub;a.fn.init=function(c,e){e&&e instanceof d&&!(e instanceof a)&&(e=a(e));return d.fn.init.call(this,c,e,b)};a.fn.init.prototype=a.fn;var b=a(q);return a},browser:{}});d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){ua["[object "+b+"]"]=b.toLowerCase()});
B=d.uaMatch(B);if(B.browser)d.browser[B.browser]=!0,d.browser.version=B.version;if(d.browser.webkit)d.browser.safari=!0;i.test("\u00a0")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/);g=d(q);q.addEventListener?U=function(){q.removeEventListener("DOMContentLoaded",U,!1);d.ready()}:q.attachEvent&&(U=function(){"complete"===q.readyState&&(q.detachEvent("onreadystatechange",U),d.ready())});return d}(),na={};i.Callbacks=function(a){var a=a?na[a]||c(a):{},d=[],e=[],f,g,h,j,k,l=function(b){var c,e,f,g;for(c=0,e=b.length;c<
e;c++)f=b[c],g=i.type(f),"array"===g?l(f):"function"===g&&(!a.unique||!n.has(f))&&d.push(f)},m=function(b,c){c=c||[];f=!a.memory||[b,c];g=!0;k=h||0;h=0;for(j=d.length;d&&k<j;k++)if(!1===d[k].apply(b,c)&&a.stopOnFalse){f=!0;break}g=!1;d&&(a.once?!0===f?n.disable():d=[]:e&&e.length&&(f=e.shift(),n.fireWith(f[0],f[1])))},n={add:function(){if(d){var a=d.length;l(arguments);g?j=d.length:f&&!0!==f&&(h=a,m(f[0],f[1]))}return this},remove:function(){if(d)for(var b=arguments,c=0,e=b.length;c<e;c++)for(var f=
0;f<d.length&&!(b[c]===d[f]&&(g&&f<=j&&(j--,f<=k&&k--),d.splice(f--,1),a.unique));f++);return this},has:function(a){if(d)for(var b=0,c=d.length;b<c;b++)if(a===d[b])return!0;return!1},empty:function(){d=[];return this},disable:function(){d=e=f=b;return this},disabled:function(){return!d},lock:function(){e=b;(!f||!0===f)&&n.disable();return this},locked:function(){return!e},fireWith:function(b,c){e&&(g?a.once||e.push([b,c]):(!a.once||!f)&&m(b,c));return this},fire:function(){n.fireWith(this,arguments);
return this},fired:function(){return!!f}};return n};var ia=[].slice;i.extend({Deferred:function(a){var b=i.Callbacks("once memory"),c=i.Callbacks("once memory"),d=i.Callbacks("memory"),e="pending",f={resolve:b,reject:c,notify:d},g={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){h.done(a).fail(b).progress(c);return this},always:function(){h.done.apply(h,arguments).fail.apply(h,arguments);return this},pipe:function(a,b,c){return i.Deferred(function(d){i.each({done:[a,
"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],f;if(i.isFunction(c))h[a](function(){if((f=c.apply(this,arguments))&&i.isFunction(f.promise))f.promise().then(d.resolve,d.reject,d.notify);else d[e+"With"](this===h?d:this,[f])});else h[a](d[e])})}).promise()},promise:function(a){if(null==a)a=g;else for(var b in g)a[b]=g[b];return a}},h=g.promise({}),j;for(j in f)h[j]=f[j].fire,h[j+"With"]=f[j].fireWith;h.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e=
"rejected"},b.disable,d.lock);a&&a.call(h,h);return h},when:function(a){function b(a){return function(b){d[a]=1<arguments.length?ia.call(arguments,0):b;--h||j.resolveWith(j,d)}}function c(a){return function(b){g[a]=1<arguments.length?ia.call(arguments,0):b;j.notifyWith(k,g)}}var d=ia.call(arguments,0),e=0,f=d.length,g=Array(f),h=f,j=1>=f&&a&&i.isFunction(a.promise)?a:i.Deferred(),k=j.promise();if(1<f){for(;e<f;e++)d[e]&&d[e].promise&&i.isFunction(d[e].promise)?d[e].promise().then(b(e),j.reject,c(e)):
--h;h||j.resolveWith(j,d)}else j!==a&&j.resolveWith(j,f?[a]:[]);return k}});i.support=function(){var b,c,d,e,f,g,h,j,k=q.createElement("div");k.setAttribute("className","t");k.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";c=k.getElementsByTagName("*");d=k.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=q.createElement("select");f=e.appendChild(q.createElement("option"));c=k.getElementsByTagName("input")[0];b={leadingWhitespace:3===
k.firstChild.nodeType,tbody:!k.getElementsByTagName("tbody").length,htmlSerialize:!!k.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===c.value,optSelected:f.selected,getSetAttribute:"t"!==k.className,enctype:!!q.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==q.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,
focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0};c.checked=!0;b.noCloneChecked=c.cloneNode(!0).checked;e.disabled=!0;b.optDisabled=!f.disabled;try{delete k.test}catch(l){b.deleteExpando=!1}!k.addEventListener&&k.attachEvent&&k.fireEvent&&(k.attachEvent("onclick",function(){b.noCloneEvent=!1}),k.cloneNode(!0).fireEvent("onclick"));c=q.createElement("input");c.value="t";c.setAttribute("type","radio");b.radioValue="t"===c.value;
c.setAttribute("checked","checked");k.appendChild(c);d=q.createDocumentFragment();d.appendChild(k.lastChild);b.checkClone=d.cloneNode(!0).cloneNode(!0).lastChild.checked;b.appendChecked=c.checked;d.removeChild(c);d.appendChild(k);k.innerHTML="";if(a.getComputedStyle)c=q.createElement("div"),c.style.width="0",c.style.marginRight="0",k.style.width="2px",k.appendChild(c),b.reliableMarginRight=0===(parseInt((a.getComputedStyle(c,null)||{marginRight:0}).marginRight,10)||0);if(k.attachEvent)for(h in{submit:1,
change:1,focusin:1})c="on"+h,j=c in k,j||(k.setAttribute(c,"return;"),j="function"===typeof k[c]),b[h+"Bubbles"]=j;d.removeChild(k);d=e=f=c=k=c=null;i(function(){var a,c,d,e,f=q.getElementsByTagName("body")[0];if(f){a=q.createElement("div");a.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";f.insertBefore(a,f.firstChild);k=q.createElement("div");a.appendChild(k);k.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
g=k.getElementsByTagName("td");j=0===g[0].offsetHeight;g[0].style.display="";g[1].style.display="none";b.reliableHiddenOffsets=j&&0===g[0].offsetHeight;k.innerHTML="";k.style.width=k.style.paddingLeft="1px";i.boxModel=b.boxModel=2===k.offsetWidth;if("undefined"!==typeof k.style.zoom)k.style.display="inline",k.style.zoom=1,b.inlineBlockNeedsLayout=2===k.offsetWidth,k.style.display="",k.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=2!==k.offsetWidth;k.style.cssText="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;visibility:hidden;border:0;";
k.innerHTML="<div style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;'><div></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";c=k.firstChild;d=c.firstChild;e={doesNotAddBorder:5!==d.offsetTop,doesAddBorderForTableAndCells:5===c.nextSibling.firstChild.firstChild.offsetTop};d.style.position="fixed";d.style.top="20px";e.fixedPosition=
20===d.offsetTop||15===d.offsetTop;d.style.position=d.style.top="";c.style.overflow="hidden";c.style.position="relative";e.subtractsBorderForOverflowNotVisible=-5===d.offsetTop;e.doesNotIncludeMarginInBodyOffset=1!==f.offsetTop;f.removeChild(a);k=null;i.extend(b,e)}});return b}();var Ua=/^(?:\{.*\}|\[.*\])$/,Ta=/([A-Z])/g;i.extend({cache:{},uuid:0,expando:"jQuery"+(i.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=
a.nodeType?i.cache[a[i.expando]]:a[i.expando];return!!a&&!e(a)},data:function(a,c,d,e){if(i.acceptData(a)){var f;f=i.expando;var g="string"===typeof c,h=a.nodeType,j=h?i.cache:a,k=h?a[f]:a[f]&&f,l="events"===c;if(k&&j[k]&&(l||e||j[k].data)||!(g&&d===b)){k||(h?a[f]=k=++i.uuid:k=f);if(!j[k]&&(j[k]={},!h))j[k].toJSON=i.noop;if("object"===typeof c||"function"===typeof c)e?j[k]=i.extend(j[k],c):j[k].data=i.extend(j[k].data,c);f=a=j[k];if(!e){if(!a.data)a.data={};a=a.data}d!==b&&(a[i.camelCase(c)]=d);if(l&&
!a[c])return f.events;g?(d=a[c],null==d&&(d=a[i.camelCase(c)])):d=a;return d}}},removeData:function(a,b,c){if(i.acceptData(a)){var d,f,g,h=i.expando,k=a.nodeType,j=k?i.cache:a,l=k?a[h]:h;if(j[l]){if(b&&(d=c?j[l]:j[l].data)){i.isArray(b)||(b in d?b=[b]:(b=i.camelCase(b),b=b in d?[b]:b.split(" ")));for(f=0,g=b.length;f<g;f++)delete d[b[f]];if(!(c?e:i.isEmptyObject)(d))return}if(!c&&(delete j[l].data,!e(j[l])))return;i.support.deleteExpando||!j.setInterval?delete j[l]:j[l]=null;k&&(i.support.deleteExpando?
delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}}},_data:function(a,b,c){return i.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=i.noData[a.nodeName.toLowerCase()];if(b)return!(!0===b||a.getAttribute("classid")!==b)}return!0}});i.fn.extend({data:function(a,c){var e,f,g,h=null;if("undefined"===typeof a){if(this.length&&(h=i.data(this[0]),1===this[0].nodeType&&!i._data(this[0],"parsedAttrs"))){f=this[0].attributes;for(var j=0,k=f.length;j<k;j++)g=f[j].name,0===g.indexOf("data-")&&
(g=i.camelCase(g.substring(5)),d(this[0],g,h[g]));i._data(this[0],"parsedAttrs",!0)}return h}if("object"===typeof a)return this.each(function(){i.data(this,a)});e=a.split(".");e[1]=e[1]?"."+e[1]:"";return c===b?(h=this.triggerHandler("getData"+e[1]+"!",[e[0]]),h===b&&this.length&&(h=i.data(this[0],a),h=d(this[0],a,h)),h===b&&e[1]?this.data(e[0]):h):this.each(function(){var b=i(this),d=[e[0],c];b.triggerHandler("setData"+e[1]+"!",d);i.data(this,a,c);b.triggerHandler("changeData"+e[1]+"!",d)})},removeData:function(a){return this.each(function(){i.removeData(this,
a)})}});i.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",i._data(a,b,(i._data(a,b)||0)+1))},_unmark:function(a,b,c){!0!==a&&(c=b,b=a,a=!1);if(b){var c=c||"fx",d=c+"mark";(a=a?0:(i._data(b,d)||1)-1)?i._data(b,d,a):(i.removeData(b,d,!0),f(b,c,"mark"))}},queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=i._data(a,b),c&&(!d||i.isArray(c)?d=i._data(a,b,i.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){var b=b||"fx",c=i.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift());d&&
("fx"===b&&c.unshift("inprogress"),i._data(a,b+".run",e),d.call(a,function(){i.dequeue(a,b)},e));c.length||(i.removeData(a,b+"queue "+b+".run",!0),f(a,b,"queue"))}});i.fn.extend({queue:function(a,c){"string"!==typeof a&&(c=a,a="fx");return c===b?i.queue(this[0],a):this.each(function(){var b=i.queue(this,a,c);"fx"===a&&"inprogress"!==b[0]&&i.dequeue(this,a)})},dequeue:function(a){return this.each(function(){i.dequeue(this,a)})},delay:function(a,b){a=i.fx?i.fx.speeds[a]||a:a;return this.queue(b||"fx",
function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a){function c(){--g||d.resolveWith(e,[e])}"string"!==typeof a&&(a=b);for(var a=a||"fx",d=i.Deferred(),e=this,f=e.length,g=1,h=a+"defer",j=a+"queue",a=a+"mark",k;f--;)if(k=i.data(e[f],h,b,!0)||(i.data(e[f],j,b,!0)||i.data(e[f],a,b,!0))&&i.data(e[f],h,i.Callbacks("once memory"),!0))g++,k.add(c);c();return d.promise()}});var va=/[\n\t\r]/g,Y=/\s+/,db=/\r/g,
eb=/^(?:button|input)$/i,fb=/^(?:button|input|object|select|textarea)$/i,gb=/^a(?:rea)?$/i,wa=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,xa=i.support.getSetAttribute,H,ya,za;i.fn.extend({attr:function(a,b){return i.access(this,a,b,!0,i.attr)},removeAttr:function(a){return this.each(function(){i.removeAttr(this,a)})},prop:function(a,b){return i.access(this,a,b,!0,i.prop)},removeProp:function(a){a=i.propFix[a]||a;return this.each(function(){try{this[a]=
b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(i.isFunction(a))return this.each(function(b){i(this).addClass(a.call(this,b,this.className))});if(a&&"string"===typeof a){b=a.split(Y);for(c=0,d=this.length;c<d;c++)if(e=this[c],1===e.nodeType)if(!e.className&&1===b.length)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=i.trim(f)}}return this},removeClass:function(a){var c,d,e,f,g,h,j;if(i.isFunction(a))return this.each(function(b){i(this).removeClass(a.call(this,
b,this.className))});if(a&&"string"===typeof a||a===b){c=(a||"").split(Y);for(d=0,e=this.length;d<e;d++)if(f=this[d],1===f.nodeType&&f.className)if(a){g=(" "+f.className+" ").replace(va," ");for(h=0,j=c.length;h<j;h++)g=g.replace(" "+c[h]+" "," ");f.className=i.trim(g)}else f.className=""}return this},toggleClass:function(a,b){var c=typeof a,d="boolean"===typeof b;return i.isFunction(a)?this.each(function(c){i(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===
c)for(var e,f=0,g=i(this),h=b,j=a.split(Y);e=j[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else if("undefined"===c||"boolean"===c)this.className&&i._data(this,"__className__",this.className),this.className=this.className||!1===a?"":i._data(this,"__className__")||""})},hasClass:function(a){for(var a=" "+a+" ",b=0,c=this.length;b<c;b++)if(1===this[b].nodeType&&-1<(" "+this[b].className+" ").replace(va," ").indexOf(a))return!0;return!1},val:function(a){var c,d,e,f=this[0];if(arguments.length)return e=
i.isFunction(a),this.each(function(d){var f=i(this);if(1===this.nodeType&&(d=e?a.call(this,d,f.val()):a,null==d?d="":"number"===typeof d?d+="":i.isArray(d)&&(d=i.map(d,function(a){return null==a?"":a+""})),c=i.valHooks[this.nodeName.toLowerCase()]||i.valHooks[this.type],!c||!("set"in c)||c.set(this,d,"value")===b))this.value=d});if(f){if((c=i.valHooks[f.nodeName.toLowerCase()]||i.valHooks[f.type])&&"get"in c&&(d=c.get(f,"value"))!==b)return d;d=f.value;return"string"===typeof d?d.replace(db,""):null==
d?"":d}}});i.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d=a.selectedIndex,e=[],f=a.options,g="select-one"===a.type;if(0>d)return null;a=g?d:0;for(c=g?d+1:f.length;a<c;a++)if(b=f[a],b.selected&&(i.support.optDisabled?!b.disabled:null===b.getAttribute("disabled"))&&(!b.parentNode.disabled||!i.nodeName(b.parentNode,"optgroup"))){b=i(b).val();if(g)return b;e.push(b)}return g&&!e.length&&f.length?i(f[d]).val():
e},set:function(a,b){var c=i.makeArray(b);i(a).find("option").each(function(){this.selected=0<=i.inArray(i(this).val(),c)});if(!c.length)a.selectedIndex=-1;return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var f,g,h=a.nodeType;if(a&&!(3===h||8===h||2===h)){if(e&&c in i.attrFn)return i(a)[c](d);if("undefined"===typeof a.getAttribute)return i.prop(a,c,d);if(e=1!==h||!i.isXMLDoc(a))c=c.toLowerCase(),g=i.attrHooks[c]||(wa.test(c)?ya:H);if(d!==
b)if(null===d)i.removeAttr(a,c);else{if(g&&"set"in g&&e&&(f=g.set(a,d,c))!==b)return f;a.setAttribute(c,""+d);return d}else{if(g&&"get"in g&&e&&null!==(f=g.get(a,c)))return f;f=a.getAttribute(c);return null===f?b:f}}},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&1===a.nodeType){d=b.toLowerCase().split(Y);for(f=d.length;g<f;g++)if(e=d[g])c=i.propFix[e]||e,i.attr(a,e,""),a.removeAttribute(xa?e:c),wa.test(e)&&c in a&&(a[c]=!1)}},attrHooks:{type:{set:function(a,b){if(eb.test(a.nodeName)&&a.parentNode)i.error("type property can't be changed");
else if(!i.support.radioValue&&"radio"===b&&i.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b);if(c)a.value=c;return b}}},value:{get:function(a,b){return H&&i.nodeName(a,"button")?H.get(a,b):b in a?a.value:null},set:function(a,b,c){if(H&&i.nodeName(a,"button"))return H.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",
frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g=a.nodeType;if(a&&!(3===g||8===g||2===g)){if(1!==g||!i.isXMLDoc(a))c=i.propFix[c]||c,f=i.propHooks[c];return d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):fb.test(a.nodeName)||gb.test(a.nodeName)&&a.href?0:b}}}});i.attrHooks.tabindex=i.propHooks.tabIndex;
ya={get:function(a,c){var d,e=i.prop(a,c);return!0===e||"boolean"!==typeof e&&(d=a.getAttributeNode(c))&&!1!==d.nodeValue?c.toLowerCase():b},set:function(a,b,c){!1===b?i.removeAttr(a,c):(b=i.propFix[c]||c,b in a&&(a[b]=!0),a.setAttribute(c,c.toLowerCase()));return c}};if(!xa)za={name:!0,id:!0},H=i.valHooks.button={get:function(a,c){var d;return(d=a.getAttributeNode(c))&&(za[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);d||(d=q.createAttribute(c),a.setAttributeNode(d));
return d.nodeValue=b+""}},i.attrHooks.tabindex.set=H.set,i.each(["width","height"],function(a,b){i.attrHooks[b]=i.extend(i.attrHooks[b],{set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}})}),i.attrHooks.contenteditable={get:H.get,set:function(a,b,c){""===b&&(b="false");H.set(a,b,c)}};i.support.hrefNormalized||i.each(["href","src","width","height"],function(a,c){i.attrHooks[c]=i.extend(i.attrHooks[c],{get:function(a){a=a.getAttribute(c,2);return null===a?b:a}})});if(!i.support.style)i.attrHooks.style=
{get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}};if(!i.support.optSelected)i.propHooks.selected=i.extend(i.propHooks.selected,{get:function(){return null}});if(!i.support.enctype)i.propFix.enctype="encoding";i.support.checkOn||i.each(["radio","checkbox"],function(){i.valHooks[this]={get:function(a){return null===a.getAttribute("value")?"on":a.value}}});i.each(["radio","checkbox"],function(){i.valHooks[this]=i.extend(i.valHooks[this],{set:function(a,
b){if(i.isArray(b))return a.checked=0<=i.inArray(i(a).val(),b)}})});var ja=/^(?:textarea|input|select)$/i,Aa=/^([^\.]*)?(?:\.(.+))?$/,hb=/\bhover(\.\S+)?\b/,ib=/^key/,jb=/^(?:mouse|contextmenu)|click/,Ba=/^(?:focusinfocus|focusoutblur)$/,kb=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,lb=function(a){if(a=kb.exec(a))a[1]=(a[1]||"").toLowerCase(),a[3]=a[3]&&RegExp("(?:^|\\s)"+a[3]+"(?:\\s|$)");return a},Ca=function(a){return i.event.special.hover?a:a.replace(hb,"mouseenter$1 mouseleave$1")};i.event={add:function(a,
c,d,e,f){var g,h,j,k,l,n,m,p,o;if(!(3===a.nodeType||8===a.nodeType||!c||!d||!(g=i._data(a)))){if(d.handler)m=d,d=m.handler;if(!d.guid)d.guid=i.guid++;j=g.events;if(!j)g.events=j={};h=g.handle;if(!h)g.handle=h=function(a){return"undefined"!==typeof i&&(!a||i.event.triggered!==a.type)?i.event.dispatch.apply(h.elem,arguments):b},h.elem=a;c=i.trim(Ca(c)).split(" ");for(g=0;g<c.length;g++){k=Aa.exec(c[g])||[];l=k[1];n=(k[2]||"").split(".").sort();o=i.event.special[l]||{};l=(f?o.delegateType:o.bindType)||
l;o=i.event.special[l]||{};k=i.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,quick:lb(f),namespace:n.join(".")},m);p=j[l];if(!p&&(p=j[l]=[],p.delegateCount=0,!o.setup||!1===o.setup.call(a,e,n,h)))a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h);if(o.add&&(o.add.call(a,k),!k.handler.guid))k.handler.guid=d.guid;f?p.splice(p.delegateCount++,0,k):p.push(k);i.event.global[l]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var f=i.hasData(a)&&
i._data(a),g,h,j,k,l,n,m,p,o,r;if(f&&(m=f.events)){b=i.trim(Ca(b||"")).split(" ");for(g=0;g<b.length;g++)if(h=Aa.exec(b[g])||[],j=k=h[1],h=h[2],j){p=i.event.special[j]||{};j=(d?p.delegateType:p.bindType)||j;o=m[j]||[];l=o.length;h=h?RegExp("(^|\\.)"+h.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<o.length;n++)if(r=o[n],(e||k===r.origType)&&(!c||c.guid===r.guid)&&(!h||h.test(r.namespace))&&(!d||d===r.selector||"**"===d&&r.selector))o.splice(n--,1),r.selector&&o.delegateCount--,
p.remove&&p.remove.call(a,r);0===o.length&&l!==o.length&&((!p.teardown||!1===p.teardown.call(a,h))&&i.removeEvent(a,j,f.handle),delete m[j])}else for(j in m)i.event.remove(a,j+b[g],c,d,!0);if(i.isEmptyObject(m)){if(b=f.handle)b.elem=null;i.removeData(a,["events","handle"],!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,f){if(!e||!(3===e.nodeType||8===e.nodeType)){var g=c.type||c,h=[],j,k,l,n,m;if(!Ba.test(g+i.event.triggered)&&(0<=g.indexOf("!")&&(g=g.slice(0,-1),j=
!0),0<=g.indexOf(".")&&(h=g.split("."),g=h.shift(),h.sort()),e&&!i.event.customEvent[g]||i.event.global[g]))if(c="object"===typeof c?c[i.expando]?c:new i.Event(g,c):new i.Event(g),c.type=g,c.isTrigger=!0,c.exclusive=j,c.namespace=h.join("."),c.namespace_re=c.namespace?RegExp("(^|\\.)"+h.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,j=0>g.indexOf(":")?"on"+g:"",e){c.result=b;if(!c.target)c.target=e;d=null!=d?i.makeArray(d):[];d.unshift(c);l=i.event.special[g]||{};if(!(l.trigger&&!1===l.trigger.apply(e,d))){m=
[[e,l.bindType||g]];if(!f&&!l.noBubble&&!i.isWindow(e)){n=l.delegateType||g;h=Ba.test(n+g)?e:e.parentNode;for(k=null;h;h=h.parentNode)m.push([h,n]),k=h;k&&k===e.ownerDocument&&m.push([k.defaultView||k.parentWindow||a,n])}for(k=0;k<m.length&&!c.isPropagationStopped();k++)h=m[k][0],c.type=m[k][1],(n=(i._data(h,"events")||{})[c.type]&&i._data(h,"handle"))&&n.apply(h,d),(n=j&&h[j])&&i.acceptData(h)&&!1===n.apply(h,d)&&c.preventDefault();c.type=g;if(!f&&!c.isDefaultPrevented()&&(!l._default||!1===l._default.apply(e.ownerDocument,
d))&&!("click"===g&&i.nodeName(e,"a"))&&i.acceptData(e))if(j&&e[g]&&("focus"!==g&&"blur"!==g||0!==c.target.offsetWidth)&&!i.isWindow(e))(k=e[j])&&(e[j]=null),i.event.triggered=g,e[g](),i.event.triggered=b,k&&(e[j]=k);return c.result}}else for(k in e=i.cache,e)e[k].events&&e[k].events[g]&&i.event.trigger(c,d,e[k].handle.elem,!0)}},dispatch:function(c){var c=i.event.fix(c||a.event),d=(i._data(this,"events")||{})[c.type]||[],e=d.delegateCount,f=[].slice.call(arguments,0),g=!c.exclusive&&!c.namespace,
h=[],j,k,l,n,m,p,o;f[0]=c;c.delegateTarget=this;if(e&&!c.target.disabled&&!(c.button&&"click"===c.type)){l=i(this);l.context=this.ownerDocument||this;for(k=c.target;k!=this;k=k.parentNode||this){m={};p=[];l[0]=k;for(j=0;j<e;j++){n=d[j];o=n.selector;if(m[o]===b){var r=m,t=o,q;if(n.quick){q=n.quick;var v=k.attributes||{};q=(!q[1]||k.nodeName.toLowerCase()===q[1])&&(!q[2]||(v.id||{}).value===q[2])&&(!q[3]||q[3].test((v["class"]||{}).value))}else q=l.is(o);r[t]=q}m[o]&&p.push(n)}p.length&&h.push({elem:k,
matches:p})}}d.length>e&&h.push({elem:this,matches:d.slice(e)});for(j=0;j<h.length&&!c.isPropagationStopped();j++){e=h[j];c.currentTarget=e.elem;for(d=0;d<e.matches.length&&!c.isImmediatePropagationStopped();d++)if(n=e.matches[d],g||!c.namespace&&!n.namespace||c.namespace_re&&c.namespace_re.test(n.namespace))if(c.data=n.data,c.handleObj=n,n=((i.event.special[n.origType]||{}).handle||n.handler).apply(e.elem,f),n!==b)c.result=n,!1===n&&(c.preventDefault(),c.stopPropagation())}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){if(null==a.which)a.which=null!=b.charCode?b.charCode:b.keyCode;return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,e,f=c.button,g=c.fromElement;if(null==a.pageX&&null!=c.clientX)d=a.target.ownerDocument||q,e=d.documentElement,d=d.body,a.pageX=c.clientX+(e&&e.scrollLeft||d&&d.scrollLeft||0)-(e&&e.clientLeft||
d&&d.clientLeft||0),a.pageY=c.clientY+(e&&e.scrollTop||d&&d.scrollTop||0)-(e&&e.clientTop||d&&d.clientTop||0);if(!a.relatedTarget&&g)a.relatedTarget=g===a.target?c.toElement:g;if(!a.which&&f!==b)a.which=f&1?1:f&2?3:f&4?2:0;return a}},fix:function(a){if(a[i.expando])return a;var c,d,e=a,f=i.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props,a=i.Event(e);for(c=g.length;c;)d=g[--c],a[d]=e[d];if(!a.target)a.target=e.srcElement||q;if(3===a.target.nodeType)a.target=a.target.parentNode;
if(a.metaKey===b)a.metaKey=a.ctrlKey;return f.filter?f.filter(a,e):a},special:{ready:{setup:i.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){if(i.isWindow(this))this.onbeforeunload=c},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}},simulate:function(a,b,c,d){a=i.extend(new i.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?i.event.trigger(a,null,b):i.event.dispatch.call(b,a);a.isDefaultPrevented()&&
c.preventDefault()}};i.event.handle=i.event.dispatch;i.removeEvent=q.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};i.Event=function(a,b){if(!(this instanceof i.Event))return new i.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||!1===a.returnValue||a.getPreventDefault&&a.getPreventDefault()?h:g):this.type=a;b&&i.extend(this,b);this.timeStamp=a&&
a.timeStamp||i.now();this[i.expando]=!0};i.Event.prototype={preventDefault:function(){this.isDefaultPrevented=h;var a=this.originalEvent;if(a)a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=h;var a=this.originalEvent;if(a)a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=h;this.stopPropagation()},isDefaultPrevented:g,isPropagationStopped:g,isImmediatePropagationStopped:g};
i.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){i.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=a.relatedTarget,d=a.handleObj,e;if(!c||c!==this&&!i.contains(this,c))a.type=d.origType,e=d.handler.apply(this,arguments),a.type=b;return e}}});if(!i.support.submitBubbles)i.event.special.submit={setup:function(){if(i.nodeName(this,"form"))return!1;i.event.add(this,"click._submit keypress._submit",function(a){a=a.target;if((a=i.nodeName(a,"input")||i.nodeName(a,
"button")?a.form:b)&&!a._submit_attached)i.event.add(a,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&i.event.simulate("submit",this.parentNode,a,!0)}),a._submit_attached=!0})},teardown:function(){if(i.nodeName(this,"form"))return!1;i.event.remove(this,"._submit")}};if(!i.support.changeBubbles)i.event.special.change={setup:function(){if(ja.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)i.event.add(this,"propertychange._change",function(a){if("checked"===a.originalEvent.propertyName)this._just_changed=
!0}),i.event.add(this,"click._change",function(a){if(this._just_changed&&!a.isTrigger)this._just_changed=!1,i.event.simulate("change",this,a,!0)});return!1}i.event.add(this,"beforeactivate._change",function(a){a=a.target;if(ja.test(a.nodeName)&&!a._change_attached)i.event.add(a,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&i.event.simulate("change",this.parentNode,a,!0)}),a._change_attached=!0})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||
"radio"!==b.type&&"checkbox"!==b.type)return a.handleObj.handler.apply(this,arguments)},teardown:function(){i.event.remove(this,"._change");return ja.test(this.nodeName)}};i.support.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){i.event.simulate(b,a.target,i.event.fix(a),!0)};i.event.special[b]={setup:function(){0===c++&&q.addEventListener(a,d,!0)},teardown:function(){0===--c&&q.removeEventListener(a,d,!0)}}});i.fn.extend({on:function(a,c,d,e,f){var h,
j;if("object"===typeof a){"string"!==typeof c&&(d=c,c=b);for(j in a)this.on(j,c,d,a[j],f);return this}null==d&&null==e?(e=c,d=c=b):null==e&&("string"===typeof c?(e=d,d=b):(e=d,d=c,c=b));if(!1===e)e=g;else if(!e)return this;if(1===f)h=e,e=function(a){i().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=i.guid++);return this.each(function(){i.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=
a.handleObj;i(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if("object"===typeof a){for(e in a)this.off(e,c,a[e]);return this}if(!1===c||"function"===typeof c)d=c,c=b;!1===d&&(d=g);return this.each(function(){i.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){i(this.context).on(a,this.selector,b,c);return this},die:function(a,b){i(this.context).off(a,
this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1==arguments.length?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){i.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return i.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||i.guid++,d=0,e=function(c){var e=(i._data(this,"lastToggle"+a.guid)||0)%d;i._data(this,"lastToggle"+a.guid,e+1);c.preventDefault();
return b[e].apply(this,arguments)||!1};for(e.guid=c;d<b.length;)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){i.fn[b]=function(a,c){null==c&&(c=a,a=null);return 0<arguments.length?this.on(b,null,a,c):this.trigger(b)};
i.attrFn&&(i.attrFn[b]=!0);if(ib.test(b))i.event.fixHooks[b]=i.event.keyHooks;if(jb.test(b))i.event.fixHooks[b]=i.event.mouseHooks});(function(){function a(b,c,d,f,g,h){for(var g=0,i=f.length;g<i;g++){var j=f[g];if(j){for(var k=!1,j=j[b];j;){if(j[e]===d){k=f[j.sizset];break}if(1===j.nodeType&&!h)j[e]=d,j.sizset=g;if(j.nodeName.toLowerCase()===c){k=j;break}j=j[b]}f[g]=k}}}function c(a,b,d,f,g,h){for(var g=0,i=f.length;g<i;g++){var j=f[g];if(j){for(var k=!1,j=j[a];j;){if(j[e]===d){k=f[j.sizset];break}if(1===
j.nodeType){if(!h)j[e]=d,j.sizset=g;if("string"!==typeof b){if(j===b){k=!0;break}}else if(0<m.filter(b,[j]).length){k=j;break}}j=j[a]}f[g]=k}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),f=0,g=Object.prototype.toString,h=!1,j=!0,k=/\\/g,l=/\r\n/g,n=/\W/;[0,0].sort(function(){j=!1;return 0});var m=function(a,b,c,e){var c=c||[],f=b=b||q;if(1!==b.nodeType&&9!==
b.nodeType)return[];if(!a||"string"!==typeof a)return c;var h,i,j,k,s,l=!0,n=m.isXML(b),z=[],M=a;do if(d.exec(""),h=d.exec(M))if(M=h[3],z.push(h[1]),h[2]){k=h[3];break}while(h);if(1<z.length&&r.exec(a))if(2===z.length&&o.relative[z[0]])i=B(z[0]+z[1],b,e);else for(i=o.relative[z[0]]?[b]:m(z.shift(),b);z.length;)a=z.shift(),o.relative[a]&&(a+=z.shift()),i=B(a,i,e);else if(!e&&1<z.length&&9===b.nodeType&&!n&&o.match.ID.test(z[0])&&!o.match.ID.test(z[z.length-1])&&(h=m.find(z.shift(),b,n),b=h.expr?m.filter(h.expr,
h.set)[0]:h.set[0]),b){h=e?{expr:z.pop(),set:w(e)}:m.find(z.pop(),1===z.length&&("~"===z[0]||"+"===z[0])&&b.parentNode?b.parentNode:b,n);i=h.expr?m.filter(h.expr,h.set):h.set;for(0<z.length?j=w(i):l=!1;z.length;)h=s=z.pop(),o.relative[s]?h=z.pop():s="",null==h&&(h=b),o.relative[s](j,h,n)}else j=[];j||(j=i);j||m.error(s||a);if("[object Array]"===g.call(j))if(l)if(b&&1===b.nodeType)for(a=0;null!=j[a];a++)j[a]&&(!0===j[a]||1===j[a].nodeType&&m.contains(b,j[a]))&&c.push(i[a]);else for(a=0;null!=j[a];a++)j[a]&&
1===j[a].nodeType&&c.push(i[a]);else c.push.apply(c,j);else w(j,c);k&&(m(k,f,c,e),m.uniqueSort(c));return c};m.uniqueSort=function(a){if(A&&(h=j,a.sort(A),h))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};m.matches=function(a,b){return m(a,null,null,b)};m.matchesSelector=function(a,b){return 0<m(b,null,null,[a]).length};m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++)if(h=o.order[e],g=o.leftMatch[h].exec(a))if(i=g[1],g.splice(1,1),"\\"!==
i.substr(i.length-1)&&(g[1]=(g[1]||"").replace(k,""),d=o.find[h](g,b,c),null!=d)){a=a.replace(o.match[h],"");break}d||(d="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};m.filter=function(a,c,d,e){for(var f,g,h,i,j,k,s,l,n=a,z=[],M=c,L=c&&c[0]&&m.isXML(c[0]);a&&c.length;){for(h in o.filter)if(null!=(f=o.leftMatch[h].exec(a))&&f[2])if(k=o.filter[h],j=f[1],g=!1,f.splice(1,1),"\\"!==j.substr(j.length-1)){M===z&&(z=[]);if(o.preFilter[h])if(f=o.preFilter[h](f,
M,d,z,e,L)){if(!0===f)continue}else g=i=!0;if(f)for(s=0;null!=(j=M[s]);s++)j&&(i=k(j,f,s,M),l=e^i,d&&null!=i?l?g=!0:M[s]=!1:l&&(z.push(j),g=!0));if(i!==b){d||(M=z);a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===n)if(null==g)m.error(a);else break;n=a}return M};m.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var p=m.getText=function(a){var b,c;b=a.nodeType;var d="";if(b)if(1===b||9===b){if("string"===typeof a.textContent)return a.textContent;if("string"===typeof a.innerText)return a.innerText.replace(l,
"");for(a=a.firstChild;a;a=a.nextSibling)d+=p(a)}else{if(3===b||4===b)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(d+=p(c));return d},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"===typeof b,d=c&&!n.test(b),c=c&&!d;d&&(b=b.toLowerCase());for(var d=0,e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&1!==f.nodeType;);
a[d]=c||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}c&&m.filter(b,a,!0)},">":function(a,b){var c,d="string"===typeof b,e=0,f=a.length;if(d&&!n.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e])c=c.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<f;e++)(c=a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(b,d,e){var g,h=f++,i=c;"string"===typeof d&&!n.test(d)&&(g=d=d.toLowerCase(),i=a);i("parentNode",d,h,b,g,e)},"~":function(b,d,e){var g,h=f++,i=c;"string"===
typeof d&&!n.test(d)&&(g=d=d.toLowerCase(),i=a);i("previousSibling",d,h,b,g,e)}},find:{ID:function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return 0===c.length?null:c}},TAG:function(a,b){if("undefined"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},
preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(k,"")+" ";if(f)return a;for(var f=0,g;null!=(g=b[f]);f++)g&&(e^(g.className&&0<=(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?c||d.push(g):c&&(b[f]=!1));return!1},ID:function(a){return a[1].replace(k,"")},TAG:function(a){return a[1].replace(k,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||m.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||
!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=f++;return a},ATTR:function(a,b,c,d,e,f){b=a[1]=a[1].replace(k,"");!f&&o.attrMap[b]&&(a[1]=o.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(k,"");"~="===a[2]&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,f){if("not"===a[1])if(1<(d.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=m(a[3],null,null,b);else return a=m.filter(a[3],b,c,1^f),c||e.push.apply(e,a),!1;else if(o.match.POS.test(a[0])||o.match.CHILD.test(a[0]))return!0;
return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){return!0===a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&
"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},image:function(a){return"input"===a.nodeName.toLowerCase()&&
"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===
b%2},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return 0<=(a.textContent||a.innerText||p([a])||"").indexOf(b[3]);if("not"===e){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,d,f,g,h,i;c=b[1];i=a;switch(c){case "only":case "first":for(;i=i.previousSibling;)if(1===
i.nodeType)return!1;if("first"===c)return!0;i=a;case "last":for(;i=i.nextSibling;)if(1===i.nodeType)return!1;return!0;case "nth":c=b[2];d=b[3];if(1===c&&0===d)return!0;f=b[0];if((g=a.parentNode)&&(g[e]!==f||!a.nodeIndex)){h=0;for(i=g.firstChild;i;i=i.nextSibling)if(1===i.nodeType)i.nodeIndex=++h;g[e]=f}i=a.nodeIndex-d;return 0===c?0===i:0===i%c&&0<=i/c}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===
b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var c=b[1],c=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),d=c+"",e=b[2],f=b[4];return null==c?"!="===e:!e&&m.attr?null!=c:"="===e?d===f:"*="===e?0<=d.indexOf(f):"~="===e?0<=(" "+d+" ").indexOf(f):!f?d&&!1!==c:"!="===e?d!==f:"^="===e?0===d.indexOf(f):"$="===e?d.substr(d.length-f.length)===f:"|="===e?d===f||d.substr(0,f.length+1)===f+"-":!1},POS:function(a,
b,c,d){var e=o.setFilters[b[2]];if(e)return e(a,c,b,d)}}},r=o.match.POS,t=function(a,b){return"\\"+(b-0+1)},v;for(v in o.match)o.match[v]=RegExp(o.match[v].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[v]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[v].source.replace(/\\(\d+)/g,t));var w=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(q.documentElement.childNodes,0)}catch(C){w=function(a,b){var c=0,d=b||[];if("[object Array]"===
g.call(a))Array.prototype.push.apply(d,a);else if("number"===typeof a.length)for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var A,u;q.documentElement.compareDocumentPosition?A=function(a,b){return a===b?(h=!0,0):!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1}:(A=function(a,b){if(a===b)return h=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[];c=a.parentNode;
d=b.parentNode;var g=c;if(c===d)return u(a,b);if(c){if(!d)return 1}else return-1;for(;g;)e.unshift(g),g=g.parentNode;for(g=d;g;)f.unshift(g),g=g.parentNode;c=e.length;d=f.length;for(g=0;g<c&&g<d;g++)if(e[g]!==f[g])return u(e[g],f[g]);return g===c?u(a,f[g],-1):u(e[g],b,1)},u=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});(function(){var a=q.createElement("div"),c="script"+(new Date).getTime(),d=q.documentElement;a.innerHTML="<a name='"+c+"'/>";
d.insertBefore(a,d.firstChild);if(q.getElementById(c))o.find.ID=function(a,c,d){if("undefined"!==typeof c.getElementById&&!d)return(c=c.getElementById(a[1]))?c.id===a[1]||"undefined"!==typeof c.getAttributeNode&&c.getAttributeNode("id").nodeValue===a[1]?[c]:b:[]},o.filter.ID=function(a,b){var c="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b};d.removeChild(a);d=a=null})();(function(){var a=q.createElement("div");a.appendChild(q.createComment(""));
if(0<a.getElementsByTagName("*").length)o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c};a.innerHTML="<a href='#'></a>";if(a.firstChild&&"undefined"!==typeof a.firstChild.getAttribute&&"#"!==a.firstChild.getAttribute("href"))o.attrHandle.href=function(a){return a.getAttribute("href",2)};a=null})();q.querySelectorAll&&function(){var a=m,b=q.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!(b.querySelectorAll&&
0===b.querySelectorAll(".TEST").length)){m=function(b,c,d,e){c=c||q;if(!e&&!m.isXML(c)){var f=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(f&&(1===c.nodeType||9===c.nodeType)){if(f[1])return w(c.getElementsByTagName(b),d);if(f[2]&&o.find.CLASS&&c.getElementsByClassName)return w(c.getElementsByClassName(f[2]),d)}if(9===c.nodeType){if("body"===b&&c.body)return w([c.body],d);if(f&&f[3]){var g=c.getElementById(f[3]);if(g&&g.parentNode){if(g.id===f[3])return w([g],d)}else return w([],d)}try{return w(c.querySelectorAll(b),
d)}catch(h){}}else if(1===c.nodeType&&"object"!==c.nodeName.toLowerCase()){var f=c,i=(g=c.getAttribute("id"))||"__sizzle__",j=c.parentNode,k=/^\s*[+~]/.test(b);g?i=i.replace(/'/g,"\\$&"):c.setAttribute("id",i);if(k&&j)c=c.parentNode;try{if(!k||j)return w(c.querySelectorAll("[id='"+i+"'] "+b),d)}catch(s){}finally{g||f.removeAttribute("id")}}}return a(b,c,d,e)};for(var c in a)m[c]=a[c];b=null}}();(function(){var a=q.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||
a.msMatchesSelector;if(b){var c=!b.call(q.createElement("div"),"div"),d=!1;try{b.call(q.documentElement,"[test!='']:sizzle")}catch(e){d=!0}m.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(d||!o.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&11!==a.document.nodeType)return f}}catch(g){}return 0<m(e,null,null,[a]).length}}})();(function(){var a=q.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";
if(a.getElementsByClassName&&0!==a.getElementsByClassName("e").length&&(a.lastChild.className="e",1!==a.getElementsByClassName("e").length))o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if("undefined"!==typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},a=null})();m.contains=q.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:q.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};
m.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var B=function(a,b,c){for(var d,e=[],f="",b=b.nodeType?[b]:b;d=o.match.PSEUDO.exec(a);)f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;d=0;for(var g=b.length;d<g;d++)m(a,b[d],e,c);return m.filter(f,e)};m.attr=i.attr;m.selectors.attrMap={};i.find=m;i.expr=m.selectors;i.expr[":"]=i.expr.filters;i.unique=m.uniqueSort;i.text=m.getText;i.isXMLDoc=m.isXML;i.contains=m.contains})();var mb=/Until$/,
nb=/^(?:parents|prevUntil|prevAll)/,ob=/,/,Va=/^.[^:#\[\.,]*$/,pb=Array.prototype.slice,Da=i.expr.match.POS,qb={children:!0,contents:!0,next:!0,prev:!0};i.fn.extend({find:function(a){var b=this,c,d;if("string"!==typeof a)return i(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(i.contains(b[c],this))return!0});var e=this.pushStack("","find",a),f,g,h;for(c=0,d=this.length;c<d;c++)if(f=e.length,i.find(a,this[c],e),0<c)for(g=f;g<e.length;g++)for(h=0;h<f;h++)if(e[h]===e[g]){e.splice(g--,1);break}return e},
has:function(a){var b=i(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(i.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(j(this,a,!1),"not",a)},filter:function(a){return this.pushStack(j(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"===typeof a?Da.test(a)?0<=i(a,this.context).index(this[0]):0<i.filter(a,this).length:0<this.filter(a).length)},closest:function(a,b){var c=[],d,e,f=this[0];if(i.isArray(a)){for(e=1;f&&f.ownerDocument&&f!==b;){for(d=
0;d<a.length;d++)i(f).is(a[d])&&c.push({selector:a[d],elem:f,level:e});f=f.parentNode;e++}return c}var g=Da.test(a)||"string"!==typeof a?i(a,b||this.context):0;for(d=0,e=this.length;d<e;d++)for(f=this[d];f;)if(g?-1<g.index(f):i.find.matchesSelector(f,a)){c.push(f);break}else if(f=f.parentNode,!f||!f.ownerDocument||f===b||11===f.nodeType)break;c=1<c.length?i.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return!a?this[0]&&this[0].parentNode?this.prevAll().length:-1:"string"===
typeof a?i.inArray(this[0],i(a)):i.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c="string"===typeof a?i(a,b):i.makeArray(a&&a.nodeType?[a]:a),d=i.merge(this.get(),c);return this.pushStack(!c[0]||!c[0].parentNode||11===c[0].parentNode.nodeType||!d[0]||!d[0].parentNode||11===d[0].parentNode.nodeType?d:i.unique(d))},andSelf:function(){return this.add(this.prevObject)}});i.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return i.dir(a,"parentNode")},
parentsUntil:function(a,b,c){return i.dir(a,"parentNode",c)},next:function(a){return i.nth(a,2,"nextSibling")},prev:function(a){return i.nth(a,2,"previousSibling")},nextAll:function(a){return i.dir(a,"nextSibling")},prevAll:function(a){return i.dir(a,"previousSibling")},nextUntil:function(a,b,c){return i.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return i.dir(a,"previousSibling",c)},siblings:function(a){return i.sibling(a.parentNode.firstChild,a)},children:function(a){return i.sibling(a.firstChild)},
contents:function(a){return i.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:i.makeArray(a.childNodes)}},function(a,b){i.fn[a]=function(c,d){var e=i.map(this,b,c);mb.test(a)||(d=c);d&&"string"===typeof d&&(e=i.filter(d,e));e=1<this.length&&!qb[a]?i.unique(e):e;if((1<this.length||ob.test(d))&&nb.test(a))e=e.reverse();return this.pushStack(e,a,pb.call(arguments).join(","))}});i.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return 1===b.length?i.find.matchesSelector(b[0],a)?[b[0]]:
[]:i.find.matches(a,b)},dir:function(a,c,d){for(var e=[],a=a[c];a&&9!==a.nodeType&&(d===b||1!==a.nodeType||!i(a).is(d));)1===a.nodeType&&e.push(a),a=a[c];return e},nth:function(a,b,c){for(var b=b||1,d=0;a&&!(1===a.nodeType&&++d===b);a=a[c]);return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var oa="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
rb=/ jQuery\d+="(?:\d+|null)"/g,ka=/^\s+/,Ea=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Fa=/<([\w:]+)/,sb=/<tbody/i,tb=/<|&#?\w+;/,ub=/<(?:script|style)/i,vb=/<(?:script|object|embed|option|style)/i,Ga=RegExp("<(?:"+oa+")","i"),Ha=/checked\s*(?:[^=]|=\s*.checked.)/i,wb=/\/(java|ecma)script/i,Wa=/^\s*<!(?:\[CDATA\[|\-\-)/,D={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>",
"</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ia=l(q);D.optgroup=D.option;D.tbody=D.tfoot=D.colgroup=D.caption=D.thead;D.th=D.td;if(!i.support.htmlSerialize)D._default=[1,"div<div>","</div>"];i.fn.extend({text:function(a){return i.isFunction(a)?this.each(function(b){var c=i(this);c.text(a.call(this,b,c.text()))}):"object"!==typeof a&&a!==b?this.empty().append((this[0]&&
this[0].ownerDocument||q).createTextNode(a)):i.text(this)},wrapAll:function(a){if(i.isFunction(a))return this.each(function(b){i(this).wrapAll(a.call(this,b))});if(this[0]){var b=i(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return i.isFunction(a)?this.each(function(b){i(this).wrapInner(a.call(this,b))}):this.each(function(){var b=
i(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=i.isFunction(a);return this.each(function(c){i(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.insertBefore(a,
this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=i.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,
i.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;null!=(d=this[c]);c++)if(!a||i.filter(a,[d]).length)!b&&1===d.nodeType&&(i.cleanData(d.getElementsByTagName("*")),i.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;null!=(b=this[a]);a++)for(1===b.nodeType&&i.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a,b){a=null==a?!1:a;b=null==b?a:b;return this.map(function(){return i.clone(this,
a,b)})},html:function(a){if(a===b)return this[0]&&1===this[0].nodeType?this[0].innerHTML.replace(rb,""):null;if("string"===typeof a&&!ub.test(a)&&(i.support.leadingWhitespace||!ka.test(a))&&!D[(Fa.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ea,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)if(1===this[c].nodeType)i.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a}catch(e){this.empty().append(a)}}else i.isFunction(a)?this.each(function(b){var c=i(this);c.html(a.call(this,b,
c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(i.isFunction(a))return this.each(function(b){var c=i(this),d=c.html();c.replaceWith(a.call(this,b,d))});"string"!==typeof a&&(a=i(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;i(this).remove();b?i(b).before(a):i(c).append(a)})}return this.length?this.pushStack(i(i.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,
c,d){var e,f,g,h=a[0],j=[];if(!i.support.checkClone&&3===arguments.length&&"string"===typeof h&&Ha.test(h))return this.each(function(){i(this).domManip(a,c,d,!0)});if(i.isFunction(h))return this.each(function(e){var f=i(this);a[0]=h.call(this,e,c?f.html():b);f.domManip(a,c,d)});if(this[0]){e=h&&h.parentNode;e=i.support.parentNode&&e&&11===e.nodeType&&e.childNodes.length===this.length?{fragment:e}:i.buildFragment(a,this,j);g=e.fragment;if(f=1===g.childNodes.length?g=g.firstChild:g.firstChild){c=c&&
i.nodeName(f,"tr");f=0;for(var k=this.length,m=k-1;f<k;f++)d.call(c?i.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):this[f]:this[f],e.cacheable||1<k&&f<m?i.clone(g,!0,!0):g)}j.length&&i.each(j,o)}return this}});i.buildFragment=function(a,b,c){var d,e,f,g,h=a[0];b&&b[0]&&(g=b[0].ownerDocument||b[0]);g.createDocumentFragment||(g=q);if(1===a.length&&"string"===typeof h&&512>h.length&&g===q&&"<"===h.charAt(0)&&!vb.test(h)&&
(i.support.checkClone||!Ha.test(h))&&(i.support.html5Clone||!Ga.test(h)))e=!0,(f=i.fragments[h])&&1!==f&&(d=f);d||(d=g.createDocumentFragment(),i.clean(a,g,d,c));e&&(i.fragments[h]=f?d:1);return{fragment:d,cacheable:e}};i.fragments={};i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){i.fn[a]=function(c){var d=[],c=i(c),e=1===this.length&&this[0].parentNode;if(e&&11===e.nodeType&&1===e.childNodes.length&&1===c.length)return c[b](this[0]),
this;for(var e=0,f=c.length;e<f;e++){var g=(0<e?this.clone(!0):this).get();i(c[e])[b](g);d=d.concat(g)}return this.pushStack(d,a,c.selector)}});i.extend({clone:function(a,b,c){var d,e,f;i.support.html5Clone||!Ga.test("<"+a.nodeName)?d=a.cloneNode(!0):(d=q.createElement("div"),Ia.appendChild(d),d.innerHTML=a.outerHTML,d=d.firstChild);var g=d;if((!i.support.noCloneEvent||!i.support.noCloneChecked)&&(1===a.nodeType||11===a.nodeType)&&!i.isXMLDoc(a)){k(a,g);d=n(a);e=n(g);for(f=0;d[f];++f)e[f]&&k(d[f],
e[f])}if(b&&(m(a,g),c)){d=n(a);e=n(g);for(f=0;d[f];++f)m(d[f],e[f])}return g},clean:function(a,b,c,d){b=b||q;"undefined"===typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||q);for(var e=[],f,g=0,h;null!=(h=a[g]);g++)if("number"===typeof h&&(h+=""),h){if("string"===typeof h)if(tb.test(h)){h=h.replace(Ea,"<$1></$2>");f=(Fa.exec(h)||["",""])[1].toLowerCase();var j=D[f]||D._default,k=j[0],m=b.createElement("div");b===q?Ia.appendChild(m):l(b).appendChild(m);for(m.innerHTML=j[1]+h+j[2];k--;)m=
m.lastChild;if(!i.support.tbody){k=sb.test(h);j="table"===f&&!k?m.firstChild&&m.firstChild.childNodes:"<table>"===j[1]&&!k?m.childNodes:[];for(f=j.length-1;0<=f;--f)i.nodeName(j[f],"tbody")&&!j[f].childNodes.length&&j[f].parentNode.removeChild(j[f])}!i.support.leadingWhitespace&&ka.test(h)&&m.insertBefore(b.createTextNode(ka.exec(h)[0]),m.firstChild);h=m.childNodes}else h=b.createTextNode(h);var n;if(!i.support.appendChecked)if(h[0]&&"number"===typeof(n=h.length))for(f=0;f<n;f++)r(h[f]);else r(h);
h.nodeType?e.push(h):e=i.merge(e,h)}if(c){a=function(a){return!a.type||wb.test(a.type)};for(g=0;e[g];g++)d&&i.nodeName(e[g],"script")&&(!e[g].type||"text/javascript"===e[g].type.toLowerCase())?d.push(e[g].parentNode?e[g].parentNode.removeChild(e[g]):e[g]):(1===e[g].nodeType&&(b=i.grep(e[g].getElementsByTagName("script"),a),e.splice.apply(e,[g+1,0].concat(b))),c.appendChild(e[g]))}return e},cleanData:function(a){for(var b,c,d=i.cache,e=i.event.special,f=i.support.deleteExpando,g=0,h;null!=(h=a[g]);g++)if(!h.nodeName||
!i.noData[h.nodeName.toLowerCase()])if(c=h[i.expando]){if((b=d[c])&&b.events){for(var j in b.events)e[j]?i.event.remove(h,j):i.removeEvent(h,j,b.handle);if(b.handle)b.handle.elem=null}f?delete h[i.expando]:h.removeAttribute&&h.removeAttribute(i.expando);delete d[c]}}});var la=/alpha\([^)]*\)/i,xb=/opacity=([^)]*)/,yb=/([A-Z]|^ms)/g,Ja=/^-?\d+(?:px)?$/i,zb=/^-?\d/,Ab=/^([\-+])=([\-+.\de]+)/,Bb={position:"absolute",visibility:"hidden",display:"block"},Xa=["Left","Right"],Ya=["Top","Bottom"],I,Ka,La;
i.fn.css=function(a,c){return 2===arguments.length&&c===b?this:i.access(this,a,c,!0,function(a,c,d){return d!==b?i.style(a,c,d):i.css(a,c)})};i.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=I(a,"opacity","opacity");return""===c?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":i.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&!(3===a.nodeType||8===a.nodeType||
!a.style)){var f,g=i.camelCase(c),h=a.style,j=i.cssHooks[g],c=i.cssProps[g]||g;if(d!==b){e=typeof d;if("string"===e&&(f=Ab.exec(d)))d=+(f[1]+1)*+f[2]+parseFloat(i.css(a,c)),e="number";if(!(null==d||"number"===e&&isNaN(d)))if("number"===e&&!i.cssNumber[g]&&(d+="px"),!j||!("set"in j)||(d=j.set(a,d))!==b)try{h[c]=d}catch(k){}}else return j&&"get"in j&&(f=j.get(a,!1,e))!==b?f:h[c]}},css:function(a,c,d){var e,f,c=i.camelCase(c);f=i.cssHooks[c];c=i.cssProps[c]||c;"cssFloat"===c&&(c="float");if(f&&"get"in
f&&(e=f.get(a,!0,d))!==b)return e;if(I)return I(a,c)},swap:function(a,b,c){var d={},e;for(e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}});i.curCSS=i.css;i.each(["height","width"],function(a,b){i.cssHooks[b]={get:function(a,c,d){var e;if(c){if(0!==a.offsetWidth)return t(a,b,d);i.swap(a,Bb,function(){e=t(a,b,d)});return e}},set:function(a,b){if(Ja.test(b)){if(b=parseFloat(b),0<=b)return b+"px"}else return b}}});if(!i.support.opacity)i.cssHooks.opacity={get:function(a,
b){return xb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=i.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(1<=b&&""===i.trim(f.replace(la,""))&&(c.removeAttribute("filter"),d&&!d.filter))return;c.filter=la.test(f)?f.replace(la,e):f+" "+e}};i(function(){if(!i.support.reliableMarginRight)i.cssHooks.marginRight={get:function(a,b){var c;i.swap(a,{display:"inline-block"},
function(){c=b?I(a,"margin-right","marginRight"):a.style.marginRight});return c}}});q.defaultView&&q.defaultView.getComputedStyle&&(Ka=function(a,b){var c,d,e,b=b.replace(yb,"-$1").toLowerCase();if((d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null)))c=e.getPropertyValue(b),""===c&&!i.contains(a.ownerDocument.documentElement,a)&&(c=i.style(a,b));return c});q.documentElement.currentStyle&&(La=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;if(null===e&&f&&(c=f[b]))e=
c;if(!Ja.test(e)&&zb.test(e)){c=f.left;if(d=a.runtimeStyle&&a.runtimeStyle.left)a.runtimeStyle.left=a.currentStyle.left;f.left="fontSize"===b?"1em":e||0;e=f.pixelLeft+"px";f.left=c;if(d)a.runtimeStyle.left=d}return""===e?"auto":e});I=Ka||La;if(i.expr&&i.expr.filters)i.expr.filters.hidden=function(a){var b=a.offsetHeight;return 0===a.offsetWidth&&0===b||!i.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||i.css(a,"display"))},i.expr.filters.visible=function(a){return!i.expr.filters.hidden(a)};
var Cb=/%20/g,Za=/\[\]$/,Ma=/\r?\n/g,Db=/#.*$/,Eb=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Fb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Na=/\?/,Ib=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Jb=/^(?:select|textarea)/i,pa=/\s+/,Kb=/([?&])_=[^&]*/,Oa=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Pa=i.fn.load,ba={},Qa={},O,K,Ra=["*/"]+["*"];try{O=bb.href}catch(Qb){O=q.createElement("a"),O.href=
"",O=O.href}K=Oa.exec(O.toLowerCase())||[];i.fn.extend({load:function(a,c,d){if("string"!==typeof a&&Pa)return Pa.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(0<=e)var f=a.slice(e,a.length),a=a.slice(0,e);e="GET";c&&(i.isFunction(c)?(d=c,c=b):"object"===typeof c&&(c=i.param(c,i.ajaxSettings.traditional),e="POST"));var g=this;i.ajax({url:a,type:e,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText;a.isResolved()&&(a.done(function(a){c=a}),g.html(f?i("<div>").append(c.replace(Ib,
"")).find(f):c));d&&g.each(d,[c,b,a])}});return this},serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?i.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Jb.test(this.nodeName)||Fb.test(this.type))}).map(function(a,b){var c=i(this).val();return null==c?null:i.isArray(c)?i.map(c,function(a){return{name:b.name,value:a.replace(Ma,"\r\n")}}):{name:b.name,value:c.replace(Ma,
"\r\n")}}).get()}});i.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){i.fn[b]=function(a){return this.on(b,a)}});i.each(["get","post"],function(a,c){i[c]=function(a,d,e,f){i.isFunction(d)&&(f=f||e,e=d,d=b);return i.ajax({type:c,url:a,data:d,success:e,dataType:f})}});i.extend({getScript:function(a,c){return i.get(a,b,c,"script")},getJSON:function(a,b,c){return i.get(a,b,c,"json")},ajaxSetup:function(a,b){b?A(a,i.ajaxSettings):(b=a,a=i.ajaxSettings);A(a,
b);return a},ajaxSettings:{url:O,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(K[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ra},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":i.parseJSON,
"text xml":i.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:v(ba),ajaxTransport:v(Qa),ajax:function(a,c){function d(a,c,l,n){if(2!==v){v=2;t&&clearTimeout(t);r=b;p=n||"";u.readyState=0<a?4:0;var s,o,z,n=c;if(l){var L=e,q=u,w=L.contents,C=L.dataTypes,B=L.responseFields,G,E,P,D;for(E in B)E in l&&(q[B[E]]=l[E]);for(;"*"===C[0];)C.shift(),G===b&&(G=L.mimeType||q.getResponseHeader("content-type"));if(G)for(E in w)if(w[E]&&w[E].test(G)){C.unshift(E);break}if(C[0]in l)P=C[0];else{for(E in l){if(!C[0]||
L.converters[E+" "+C[0]]){P=E;break}D||(D=E)}P=P||D}P?(P!==C[0]&&C.unshift(P),l=l[P]):l=void 0}else l=b;if(200<=a&&300>a||304===a){if(e.ifModified){if(G=u.getResponseHeader("Last-Modified"))i.lastModified[m]=G;if(G=u.getResponseHeader("Etag"))i.etag[m]=G}if(304===a)n="notmodified",s=!0;else try{G=e;G.dataFilter&&(l=G.dataFilter(l,G.dataType));var fa=G.dataTypes;E={};var F,H,O=fa.length,K,Q=fa[0],I,N,R,T,J;for(F=1;F<O;F++){if(1===F)for(H in G.converters)"string"===typeof H&&(E[H.toLowerCase()]=G.converters[H]);
I=Q;Q=fa[F];if("*"===Q)Q=I;else if("*"!==I&&I!==Q){N=I+" "+Q;R=E[N]||E["* "+Q];if(!R)for(T in J=b,E)if(K=T.split(" "),K[0]===I||"*"===K[0])if(J=E[K[1]+" "+Q]){T=E[T];!0===T?R=J:!0===J&&(R=T);break}!R&&!J&&i.error("No conversion from "+N.replace(" "," to "));!0!==R&&(l=R?R(l):J(T(l)))}}o=l;n="success";s=!0}catch(S){n="parsererror",z=S}}else if(z=n,!n||a)n="error",0>a&&(a=0);u.status=a;u.statusText=""+(c||n);s?h.resolveWith(f,[o,n,u]):h.rejectWith(f,[u,n,z]);u.statusCode(k);k=b;A&&g.trigger("ajax"+
(s?"Success":"Error"),[u,e,s?o:z]);j.fireWith(f,[u,n]);A&&(g.trigger("ajaxComplete",[u,e]),--i.active||i.event.trigger("ajaxStop"))}}"object"===typeof a&&(c=a,a=b);var c=c||{},e=i.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof i)?i(f):i.event,h=i.Deferred(),j=i.Callbacks("once memory"),k=e.statusCode||{},m,l={},n={},p,o,r,t,q,v=0,A,C,u={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase(),a=n[c]=n[c]||a;l[a]=b}return this},getAllResponseHeaders:function(){return 2===
v?p:null},getResponseHeader:function(a){var c;if(2===v){if(!o)for(o={};c=Eb.exec(p);)o[c[1].toLowerCase()]=c[2];c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){if(!v)e.mimeType=a;return this},abort:function(a){a=a||"abort";r&&r.abort(a);d(0,a);return this}};h.promise(u);u.success=u.done;u.error=u.fail;u.complete=j.add;u.statusCode=function(a){if(a){var b;if(2>v)for(b in a)k[b]=[k[b],a[b]];else b=a[u.status],u.then(b,b)}return this};e.url=((a||e.url)+"").replace(Db,"").replace(Hb,
K[1]+"//");e.dataTypes=i.trim(e.dataType||"*").toLowerCase().split(pa);if(null==e.crossDomain)q=Oa.exec(e.url.toLowerCase()),e.crossDomain=!(!q||!(q[1]!=K[1]||q[2]!=K[2]||(q[3]||("http:"===q[1]?80:443))!=(K[3]||("http:"===K[1]?80:443))));if(e.data&&e.processData&&"string"!==typeof e.data)e.data=i.param(e.data,e.traditional);w(ba,e,c,u);if(2===v)return!1;A=e.global;e.type=e.type.toUpperCase();e.hasContent=!Gb.test(e.type);A&&0===i.active++&&i.event.trigger("ajaxStart");if(!e.hasContent&&(e.data&&(e.url+=
(Na.test(e.url)?"&":"?")+e.data,delete e.data),m=e.url,!1===e.cache)){q=i.now();var B=e.url.replace(Kb,"$1_="+q);e.url=B+(B===e.url?(Na.test(e.url)?"&":"?")+"_="+q:"")}(e.data&&e.hasContent&&!1!==e.contentType||c.contentType)&&u.setRequestHeader("Content-Type",e.contentType);e.ifModified&&(m=m||e.url,i.lastModified[m]&&u.setRequestHeader("If-Modified-Since",i.lastModified[m]),i.etag[m]&&u.setRequestHeader("If-None-Match",i.etag[m]));u.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?
e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", "+Ra+"; q=0.01":""):e.accepts["*"]);for(C in e.headers)u.setRequestHeader(C,e.headers[C]);if(e.beforeSend&&(!1===e.beforeSend.call(f,u,e)||2===v))return u.abort(),!1;for(C in{success:1,error:1,complete:1})u[C](e[C]);if(r=w(Qa,e,c,u)){u.readyState=1;A&&g.trigger("ajaxSend",[u,e]);e.async&&0<e.timeout&&(t=setTimeout(function(){u.abort("timeout")},e.timeout));try{v=1,r.send(l,d)}catch(D){if(2>v)d(-1,D);else throw D;}}else d(-1,"No Transport");return u},
param:function(a,c){var d=[],e=function(a,b){b=i.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b)c=i.ajaxSettings.traditional;if(i.isArray(a)||a.jquery&&!i.isPlainObject(a))i.each(a,function(){e(this.name,this.value)});else for(var f in a)B(f,a[f],c,e);return d.join("&").replace(Cb,"+")}});i.extend({active:0,lastModified:{},etag:{}});var Lb=i.now(),Z=/(\=)\?(&|$)|\?\?/i;i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return i.expando+"_"+Lb++}});i.ajaxPrefilter("json jsonp",
function(b,c,d){c="application/x-www-form-urlencoded"===b.contentType&&"string"===typeof b.data;if("jsonp"===b.dataTypes[0]||!1!==b.jsonp&&(Z.test(b.url)||c&&Z.test(b.data))){var e,f=b.jsonpCallback=i.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,g=a[f],h=b.url,j=b.data,k="$1"+f+"$2";!1!==b.jsonp&&(h=h.replace(Z,k),b.url===h&&(c&&(j=j.replace(Z,k)),b.data===j&&(h+=(/\?/.test(h)?"&":"?")+b.jsonp+"="+f)));b.url=h;b.data=j;a[f]=function(a){e=[a]};d.always(function(){a[f]=g;if(e&&i.isFunction(g))a[f](e[0])});
b.converters["script json"]=function(){e||i.error(f+" was not called");return e[0]};b.dataTypes[0]="json";return"script"}});i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){i.globalEval(a);return a}}});i.ajaxPrefilter("script",function(a){if(a.cache===b)a.cache=!1;if(a.crossDomain)a.type="GET",a.global=!1});i.ajaxTransport("script",function(a){if(a.crossDomain){var c,
d=q.head||q.getElementsByTagName("head")[0]||q.documentElement;return{send:function(e,f){c=q.createElement("script");c.async="async";if(a.scriptCharset)c.charset=a.scriptCharset;c.src=a.url;c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success")};d.insertBefore(c,d.firstChild)},abort:function(){if(c)c.onload(0,1)}}}});var ma=a.ActiveXObject?function(){for(var a in S)S[a](0,
1)}:!1,Mb=0,S;i.ajaxSettings.xhr=a.ActiveXObject?function(){var b;if(!(b=!this.isLocal&&C()))a:{try{b=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(c){}b=void 0}return b}:C;(function(a){i.extend(i.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})})(i.ajaxSettings.xhr());i.support.ajax&&i.ajaxTransport(function(c){if(!c.crossDomain||i.support.cors){var d;return{send:function(e,f){var g=c.xhr(),h,j;c.username?g.open(c.type,c.url,c.async,c.username,c.password):g.open(c.type,c.url,c.async);
if(c.xhrFields)for(j in c.xhrFields)g[j]=c.xhrFields[j];c.mimeType&&g.overrideMimeType&&g.overrideMimeType(c.mimeType);!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)g.setRequestHeader(j,e[j])}catch(k){}g.send(c.hasContent&&c.data||null);d=function(a,e){var j,k,m,l,n;try{if(d&&(e||4===g.readyState)){d=b;if(h)g.onreadystatechange=i.noop,ma&&delete S[h];if(e)4!==g.readyState&&g.abort();else{j=g.status;m=g.getAllResponseHeaders();l={};if((n=g.responseXML)&&
n.documentElement)l.xml=n;l.text=g.responseText;try{k=g.statusText}catch(p){k=""}!j&&c.isLocal&&!c.crossDomain?j=l.text?200:404:1223===j&&(j=204)}}}catch(o){e||f(-1,o)}l&&f(j,k,l,m)};!c.async||4===g.readyState?d():(h=++Mb,ma&&(S||(S={},i(a).unload(ma)),S[h]=d),g.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var da={},F,J,Nb=/^(?:toggle|show|hide)$/,Ob=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,aa,qa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight",
"paddingLeft","paddingRight"],["opacity"]],W;i.fn.extend({show:function(a,b,c){if(a||0===a)return this.animate(N("show",3),a,b,c);for(var c=0,d=this.length;c<d;c++)if(a=this[c],a.style){b=a.style.display;if(!i._data(a,"olddisplay")&&"none"===b)b=a.style.display="";""===b&&"none"===i.css(a,"display")&&i._data(a,"olddisplay",ra(a.nodeName))}for(c=0;c<d;c++)if(a=this[c],a.style&&(b=a.style.display,""===b||"none"===b))a.style.display=i._data(a,"olddisplay")||"";return this},hide:function(a,b,c){if(a||
0===a)return this.animate(N("hide",3),a,b,c);for(var c=0,d=this.length;c<d;c++)a=this[c],a.style&&(b=i.css(a,"display"),"none"!==b&&!i._data(a,"olddisplay")&&i._data(a,"olddisplay",b));for(c=0;c<d;c++)if(this[c].style)this[c].style.display="none";return this},_toggle:i.fn.toggle,toggle:function(a,b,c){var d="boolean"===typeof a;i.isFunction(a)&&i.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:i(this).is(":hidden");i(this)[b?"show":"hide"]()}):this.animate(N("toggle",
3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function e(){var s;!1===f.queue&&i._mark(this);var b=i.extend({},f),c=1===this.nodeType,d=c&&i(this).is(":hidden"),g,h,j,k,m;b.animatedProperties={};for(j in a){g=i.camelCase(j);j!==g&&(a[g]=a[j],delete a[j]);h=a[g];i.isArray(h)?(b.animatedProperties[g]=h[1],s=a[g]=h[0],h=s):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||
"swing";if("hide"===h&&d||"show"===h&&!d)return b.complete.call(this);if(c&&("height"===g||"width"===g))if(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===i.css(this,"display")&&"none"===i.css(this,"float"))!i.support.inlineBlockNeedsLayout||"inline"===ra(this.nodeName)?this.style.display="inline-block":this.style.zoom=1}if(null!=b.overflow)this.style.overflow="hidden";for(j in a)if(c=new i.fx(this,b,j),h=a[j],Nb.test(h))if(g=i._data(this,"toggle"+j)||("toggle"===
h?d?"show":"hide":0))i._data(this,"toggle"+j,"show"===g?"hide":"show"),c[g]();else c[h]();else g=Ob.exec(h),k=c.cur(),g?(h=parseFloat(g[2]),m=g[3]||(i.cssNumber[j]?"":"px"),"px"!==m&&(i.style(this,j,(h||1)+m),k*=(h||1)/c.cur(),i.style(this,j,k+m)),g[1]&&(h=("-="===g[1]?-1:1)*h+k),c.custom(k,h,m)):c.custom(k,h,"");return!0}var f=i.speed(b,c,d);if(i.isEmptyObject(a))return this.each(f.complete,[!1]);a=i.extend({},a);return!1===f.queue?this.each(e):this.queue(f.queue,e)},stop:function(a,c,d){"string"!==
typeof a&&(d=c,c=a,a=b);c&&!1!==a&&this.queue(a||"fx",[]);return this.each(function(){var b,c=!1,e=i.timers,f=i._data(this);d||i._unmark(!0,this);if(null==a)for(b in f){if(f[b]&&f[b].stop&&b.indexOf(".run")===b.length-4){var g=f[b];i.removeData(this,b,!0);g.stop(d)}}else if(f[b=a+".run"]&&f[b].stop)f=f[b],i.removeData(this,b,!0),f.stop(d);for(b=e.length;b--;)if(e[b].elem===this&&(null==a||e[b].queue===a)){if(d)e[b](!0);else e[b].saveState();c=!0;e.splice(b,1)}(!d||!c)&&i.dequeue(this,a)})}});i.each({slideDown:N("show",
1),slideUp:N("hide",1),slideToggle:N("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){i.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}});i.extend({speed:function(a,b,c){var d=a&&"object"===typeof a?i.extend({},a):{complete:c||!c&&b||i.isFunction(a)&&a,duration:a,easing:c&&b||b&&!i.isFunction(b)&&b};d.duration=i.fx.off?0:"number"===typeof d.duration?d.duration:d.duration in i.fx.speeds?i.fx.speeds[d.duration]:i.fx.speeds._default;if(null==
d.queue||!0===d.queue)d.queue="fx";d.old=d.complete;d.complete=function(a){i.isFunction(d.old)&&d.old.call(this);d.queue?i.dequeue(this,d.queue):!1!==a&&i._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;b.orig=b.orig||{}}});i.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(i.fx.step[this.prop]||
i.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];var a,b=i.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||"auto"===b?0:b:a},custom:function(a,c,d){function e(a){return f.step(a)}var f=this,g=i.fx;this.startTime=W||ca();this.end=c;this.now=this.start=a;this.pos=this.state=0;this.unit=d||this.unit||(i.cssNumber[this.prop]?"":"px");e.queue=this.options.queue;e.elem=this.elem;e.saveState=
function(){f.options.hide&&i._data(f.elem,"fxshow"+f.prop)===b&&i._data(f.elem,"fxshow"+f.prop,f.start)};e()&&i.timers.push(e)&&!aa&&(aa=setInterval(g.tick,g.interval))},show:function(){var a=i._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||i.style(this.elem,this.prop);this.options.show=!0;a!==b?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur());i(this.elem).show()},hide:function(){this.options.orig[this.prop]=i._data(this.elem,"fxshow"+
this.prop)||i.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(a){var b,c=W||ca(),d=!0,e=this.elem,f=this.options;if(a||c>=f.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();f.animatedProperties[this.prop]=!0;for(b in f.animatedProperties)!0!==f.animatedProperties[b]&&(d=!1);if(d){null!=f.overflow&&!i.support.shrinkWrapBlocks&&i.each(["","X","Y"],function(a,b){e.style["overflow"+b]=f.overflow[a]});f.hide&&i(e).hide();if(f.hide||
f.show)for(b in f.animatedProperties)i.style(e,b,f.orig[b]),i.removeData(e,"fxshow"+b,!0),i.removeData(e,"toggle"+b,!0);if(a=f.complete)f.complete=!1,a.call(e)}return!1}Infinity==f.duration?this.now=c:(a=c-this.startTime,this.state=a/f.duration,this.pos=i.easing[f.animatedProperties[this.prop]](this.state,a,0,1,f.duration),this.now=this.start+(this.end-this.start)*this.pos);this.update();return!0}};i.extend(i.fx,{tick:function(){for(var a,b=i.timers,c=0;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,
1);b.length||i.fx.stop()},interval:13,stop:function(){clearInterval(aa);aa=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){i.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&null!=a.elem.style[a.prop]?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}});i.each(["width","height"],function(a,b){i.fx.step[b]=function(a){i.style(a.elem,b,Math.max(0,a.now)+a.unit)}});if(i.expr&&i.expr.filters)i.expr.filters.animated=function(a){return i.grep(i.timers,function(b){return a===
b.elem}).length};var Pb=/^t(?:able|d|h)$/i,Sa=/^(?:body|html)$/i;i.fn.offset="getBoundingClientRect"in q.documentElement?function(a){var b=this[0],c;if(a)return this.each(function(b){i.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return i.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,f=e.documentElement;if(!c||!i.contains(f,b))return c?{top:c.top,left:c.left}:{top:0,left:0};b=e.body;e=ea(e);return{top:c.top+(e.pageYOffset||
i.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:c.left+(e.pageXOffset||i.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(b){i.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return i.offset.bodyOffset(b);var c,d=b.offsetParent,e=b.ownerDocument,f=e.documentElement,g=e.body;c=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;
for(var h=b.offsetTop,j=b.offsetLeft;(b=b.parentNode)&&b!==g&&b!==f&&!(i.support.fixedPosition&&"fixed"===c.position);){c=e?e.getComputedStyle(b,null):b.currentStyle;h-=b.scrollTop;j-=b.scrollLeft;if(b===d){h+=b.offsetTop;j+=b.offsetLeft;if(i.support.doesNotAddBorder&&(!i.support.doesAddBorderForTableAndCells||!Pb.test(b.nodeName)))h+=parseFloat(c.borderTopWidth)||0,j+=parseFloat(c.borderLeftWidth)||0;d=b.offsetParent}i.support.subtractsBorderForOverflowNotVisible&&"visible"!==c.overflow&&(h+=parseFloat(c.borderTopWidth)||
0,j+=parseFloat(c.borderLeftWidth)||0)}if("relative"===c.position||"static"===c.position)h+=g.offsetTop,j+=g.offsetLeft;i.support.fixedPosition&&"fixed"===c.position&&(h+=Math.max(f.scrollTop,g.scrollTop),j+=Math.max(f.scrollLeft,g.scrollLeft));return{top:h,left:j}};i.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;i.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(i.css(a,"marginTop"))||0,c+=parseFloat(i.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,
b,c){var d=i.css(a,"position");if("static"===d)a.style.position="relative";var e=i(a),f=e.offset(),g=i.css(a,"top"),h=i.css(a,"left"),j={},k={};("absolute"===d||"fixed"===d)&&-1<i.inArray("auto",[g,h])?(k=e.position(),d=k.top,h=k.left):(d=parseFloat(g)||0,h=parseFloat(h)||0);i.isFunction(b)&&(b=b.call(a,c,f));if(null!=b.top)j.top=b.top-f.top+d;if(null!=b.left)j.left=b.left-f.left+h;"using"in b?b.using.call(a,j):e.css(j)}};i.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),
c=this.offset(),d=Sa.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(i.css(a,"marginTop"))||0;c.left-=parseFloat(i.css(a,"marginLeft"))||0;d.top+=parseFloat(i.css(b[0],"borderTopWidth"))||0;d.left+=parseFloat(i.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||q.body;a&&!Sa.test(a.nodeName)&&"static"===i.css(a,"position");)a=a.offsetParent;return a})}});i.each(["Left","Top"],function(a,
c){var d="scroll"+c;i.fn[d]=function(c){var e,f;if(c===b){e=this[0];return!e?null:(f=ea(e))?"pageXOffset"in f?f[a?"pageYOffset":"pageXOffset"]:i.support.boxModel&&f.document.documentElement[d]||f.document.body[d]:e[d]}return this.each(function(){(f=ea(this))?f.scrollTo(!a?c:i(f).scrollLeft(),a?c:i(f).scrollTop()):this[d]=c})}});i.each(["Height","Width"],function(a,c){var d=c.toLowerCase();i.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(i.css(a,d,"padding")):this[d]():null};i.fn["outer"+
c]=function(a){var b=this[0];return b?b.style?parseFloat(i.css(b,d,a?"margin":"border")):this[d]():null};i.fn[d]=function(a){var e=this[0];if(!e)return null==a?null:this;if(i.isFunction(a))return this.each(function(b){var c=i(this);c[d](a.call(this,b,c[d]()))});if(i.isWindow(e)){var f=e.document.documentElement["client"+c],g=e.document.body;return"CSS1Compat"===e.document.compatMode&&f||g&&g["client"+c]||f}if(9===e.nodeType)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+
c],e.body["offset"+c],e.documentElement["offset"+c]);return a===b?(e=i.css(e,d),f=parseFloat(e),i.isNumeric(f)?f:e):this.css(d,"string"===typeof a?a:a+"px")}});a.jQuery=a.$=i;"function"===typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return i})})(window);var trace={box:null,useTextArea:!0,suppress:!0,zeroTime:new Date,filter:null};
trace.log=function(a,b){if(!trace.suppress){if(!trace.box)box=trace.useTextArea?document.createElement("TEXTAREA"):document.createElement("DIV"),box.id="tracebox",box.style.position="absolute",box.style.width="200px",box.style.height="100px",box.style.left="100%",box.style.top="100%",box.style.overflow="scroll",box.style.margin="-120px 0 0 -220px",document.body.appendChild(box),trace.box=box;if(b||trace.logShouldClear)trace.box.innerHTML="",trace.box.value="";trace.useTextArea?trace.box.value=trace.box.value+
a+"\r\n":trace.box.innerHTML=trace.box.innerHTML+a+"<br/>";trace.logShouldClear=!1}};trace.logMulti=function(){if(!trace.suppress){for(var a="",b=!0,c=0;c<trace.logMulti.arguments.length;c++)b||(a+=", "),a+=trace.logMulti.arguments[c],b=!1;trace.log(a)}};trace.getTicks=function(){return new Date-trace.zeroTime};
trace.noteCanvasCommand=function(a){if(player.dumpCanvas){"_"!=a.substr(0,1)&&(a="context."+a);for(var a=a+"(",b=!0,c=1;c<window.trace.noteCanvasCommand.arguments.length;c++)b||(a+=", "),a+=window.trace.noteCanvasCommand.arguments[c],b=!1;player.canvasCommandLog.push(a+");")}};trace.dumpCanvasCommandLog=function(){if(player.dumpCanvas){for(var a="",b=player.canvasCommandLog.shift();b;)a+=b+"\r\n",b=player.canvasCommandLog.shift();console.log(a)}};trace.dumpArray=function(a){for(var b=0;b<a.length;b++)console.log(a[b])};
if(window.console){window.console.suppress=!0;window.console.logMulti=function(){if(!window.console.suppress){for(var a=new Date-trace.zeroTime+": ",b=!0,c=0;c<window.console.logMulti.arguments.length;c++)b||(a+=", "),a+=window.console.logMulti.arguments[c],b=!1;console.filter&&-1==a.indexOf(console.filter)||(window.console.log(a),window.console.logRemote&&window.console.logRemote(a),window.EventLogger&&window.EventLogger.logNote(a))}};window.console.alertMulti=function(){if(!window.console.suppress){var a=
Array.prototype.slice.call(arguments);alert(a.join(", "))}};if(-1<navigator.userAgent.indexOf("Chrome/")&&-1==location.search.indexOf("logging="))window.console.logMulti=function(){for(var a=new Date-trace.zeroTime+": ",b=!0,c=0;c<window.console.logMulti.arguments.length;c++)b||(a+=", "),a+=window.console.logMulti.arguments[c],b=!1;if(!console.filter||-1!=a.indexOf(console.filter))window.console.log(new Date-trace.zeroTime,window.console.logMulti.arguments),window.console.logRemote&&window.console.logRemote(a);
window.EventLogger&&window.EventLogger.logNote(a)};if(-1<location.search.indexOf("remote=1"))window.console.sockets=[],window.console.socketIndex=0,window.console.logRemote=function(a){a="/Log?message="+encodeURIComponent(a)+"&rand="+Math.random();$.ajax({url:a})}}
var ppDebug={m_arrDebug:[],WriteQueue:function(){for(var a=0;a<this.m_arrDebug.length;a++)this.debug_trace(this.m_arrDebug[a]);this.m_arrDebug=[]},Clear:function(){},debug_trace:function(){},debug_error:function(a){console.log("ERROR",a)}},g_nStartTime=new Date;function Elapsed(){return(new Date).getTime()-g_nStartTime}function ParseXML(){}window.trace=trace;window.EventLogger={logging:!1,currentContainer:null,containerStack:[],logItems:[],startDate:new Date,logBeginEvent:function(a,b){if(EventLogger.logging&&(!console.filter||b&&b.id==console.filter)){var c=new EventLogItem(a,b);EventLogger.currentContainer?(EventLogger.currentContainer.logItems.push(c),EventLogger.containerStack.push(EventLogger.currentContainer)):EventLogger.logItems.push(c);EventLogger.currentContainer=c}},logEndEvent:function(a){if(EventLogger.logging&&(!console.filter||a&&a.id==
console.filter))EventLogger.currentContainer=EventLogger.containerStack.pop()},logBeginAction:function(a,b){if(EventLogger.logging&&(!console.filter||b&&b.id==console.filter)){var c=new ActionLogItem(a,b);EventLogger.currentContainer?(EventLogger.currentContainer.logItems.push(c),EventLogger.containerStack.push(EventLogger.currentContainer)):EventLogger.logItems.push(c);EventLogger.currentContainer=c}},logEndAction:function(a){if(EventLogger.logging&&(!console.filter||a&&a.id==console.filter))EventLogger.currentContainer=
EventLogger.containerStack.pop()},logBeginActionGroup:function(a,b){if(EventLogger.logging&&(!console.filter||b&&b.id==console.filter)){var c=new ActionGroupLogItem(a,b);EventLogger.currentContainer?(EventLogger.currentContainer.logItems.push(c),EventLogger.containerStack.push(EventLogger.currentContainer)):EventLogger.logItems.push(c);EventLogger.currentContainer=c}},logEndActionGroup:function(){if(EventLogger.logging)EventLogger.currentContainer=EventLogger.containerStack.pop()},logNote:function(a){EventLogger.logging&&
!(console.filter&&-1==a.indexOf(console.filter))&&(EventLogger.currentContainer?EventLogger.currentContainer.logItems.push(a):EventLogger.logItems.push(a))}};function EventLogItem(a,b){this.timestamp=new Date-EventLogger.startDate;this.event=a;this.itemID=b?b.id:a.item?"~"+a.item.id:null;this.type=a.type;this.trigger=a.trigger;this.time=a.time;this.depth=EventLogger.containerStack.length;this.logItems=[]}EventLogItem.prototype.toString=function(){return timestamp+" "+event.trigger||event.type};
function ActionLogItem(a,b){this.timestamp=new Date-EventLogger.startDate;this.action=a;this.itemID=b?b.id:a.item?"~"+a.item.id:null;this.type=a.type;this.xml=(new XMLSerializer).serializeToString(a.xml);this.logItems=[]}ActionLogItem.prototype.toString=function(){return timestamp+" "+event.trigger||event.type};function ActionGroupLogItem(a,b){this.timestamp=new Date-EventLogger.startDate;this.groupID=a;this.itemID=b?b.id:null;this.logItems=[]};$.each("touchstart touchmove touchend orientationchange tap taphold swipe swipeleft swiperight swipeup swipedown scrollstart scrollstop".split(" "),function(a,b){$.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)};$.attrFn[b]=!0});var supportTouch=-1<navigator.userAgent.indexOf("iP"),scrollEvent="touchmove scroll",touchStartEvent=supportTouch?"touchstart":"mousedown",touchStopEvent=supportTouch?"touchend":"mouseup",touchMoveEvent=supportTouch?"touchmove":"mousemove";
$.event.special.scrollstart={enabled:!0,setup:function(){function a(a,d){c=d;var g=a.type;a.type=c?"scrollstart":"scrollstop";$.event.handle.call(b,a);a.type=g}var b=this,c,d;$(b).bind(scrollEvent,function(b){$.event.special.scrollstart.enabled&&(c||a(b,!0),clearTimeout(d),d=setTimeout(function(){a(b,!1)},50))})}};
$.event.special.tap={setup:function(){var a=this,b=$(a);b.bind(touchStartEvent,function(c){function d(){c.pageX=c.pageX||c.originalEvent.touches[0].pageX;c.pageY=c.pageY||c.originalEvent.touches[0].pageY;if(10<Math.abs(g[0]-c.pageX)||10<Math.abs(g[1]-c.pageY))e=!0}if(!(c.which&&1!==c.which)){c.pageX=c.pageX||c.originalEvent.touches[0].pageX;c.pageY=c.pageY||c.originalEvent.touches[0].pageY;var e=!1,f=!0,g=[c.pageX,c.pageY],h,j;j=setTimeout(function(){if(f&&!e)h=c.type,c.type="taphold",$.event.handle.call(a,
c),c.type=h},750);b.one(touchMoveEvent,d).one(touchStopEvent,function(c){b.unbind(touchMoveEvent,d);clearTimeout(j);f=!1;if(10<Math.abs(g[0]-c.pageX)||10<Math.abs(g[1]-c.pageY))e=!0;if(!e)h=c.type,c.type="tap",$.event.handle.call(a,c),c.type=h})}})}};
$.event.special.swipe={setup:function(){var a=$(this);a.bind(touchStartEvent,function(b){function c(a){if(e){var b=a.originalEvent.touches?a.originalEvent.touches[0]:a;f={time:(new Date).getTime(),coords:[b.pageX,b.pageY]};10<Math.abs(e.coords[0]-f.coords[0])&&a.preventDefault()}}var d=b.originalEvent.touches?b.originalEvent.touches[0]:b,e={time:(new Date).getTime(),coords:[d.pageX,d.pageY],origin:$(b.target)},f;a.bind(touchMoveEvent,c).one(touchStopEvent,function(){a.unbind(touchMoveEvent,c);e&&
f&&(1E3>f.time-e.time&&30<Math.abs(e.coords[0]-f.coords[0])&&75>Math.abs(e.coords[1]-f.coords[1])?e.origin.trigger("swipe").trigger(e.coords[0]>f.coords[0]?"swipeleft":"swiperight"):1E3>f.time-e.time&&30<Math.abs(e.coords[1]-f.coords[1])&&75>Math.abs(e.coords[0]-f.coords[0])&&e.origin.trigger("swipe").trigger(e.coords[1]>f.coords[1]?"swipeup":"swipedown"));e=f=void 0})})}};
(function(a){function b(){var a=d();a!==e&&(e=a,c.trigger("orientationchange"))}var c=a(window),d,e;a.event.special.orientationchange={setup:function(){if(a.support.orientation)return!1;e=d();c.bind("resize",b)},teardown:function(){if(a.support.orientation)return!1;c.unbind("resize",b)},add:function(a){var b=a.handler;a.handler=function(a){a.orientation=d();return b.apply(this,arguments)}}};d=function(){var a=document.documentElement;return a&&1.1>a.clientWidth/a.clientHeight?"portrait":"landscape"}})(jQuery);
$.each({scrollstop:"scrollstart",taphold:"tap",swipeup:"swipe",swipedown:"swipe",swipeleft:"swipe",swiperight:"swipe"},function(a,b){$.event.special[a]={setup:function(){$(this).bind(b,$.noop)}}});(function(){function a(a,b){var m;this.element="object"==typeof a?a:document.getElementById(a);this.wrapper=this.element.parentNode;this.element.style.webkitTransitionProperty="-webkit-transform";this.element.style.webkitTransitionTimingFunction="cubic-bezier(0,0,0.25,1)";this.element.style.webkitTransitionDuration="0";this.element.style.webkitTransform=j+"0,0"+l;this.options={bounce:c,momentum:c,checkDOMChanges:!0,topOnDOMChanges:!1,hScrollbar:c,vScrollbar:c,fadeScrollbar:d||!e,shrinkScrollbar:d||
!e,desktopCompatibility:!1,overflow:"auto",snap:!1,bounceLock:!1,directionLock:!0,scrollbarColor:"rgba(150,150,150,0.5)",onScrollEnd:function(){}};if("object"==typeof b)for(m in b)this.options[m]=b[m];if(this.options.desktopCompatibility)this.options.overflow="hidden";this.onScrollEnd=this.options.onScrollEnd;delete this.options.onScrollEnd;this.wrapper.style.overflow=this.options.overflow;this.refresh();window.addEventListener("onorientationchange"in window?"orientationchange":"resize",this,!1);
if(e||this.options.desktopCompatibility)this.element.addEventListener(f,this,!1),this.element.addEventListener(g,this,!1),this.element.addEventListener(h,this,!1);this.options.checkDOMChanges&&this.element.addEventListener("DOMSubtreeModified",this,!1)}function b(a,b,c,d,e){var f=document;this.dir=a;this.fade=c;this.shrink=d;this.uid=++m;this.bar=f.createElement("div");this.bar.style.cssText="position:absolute;top:0;left:0;-webkit-transition-timing-function:cubic-bezier(0,0,0.25,1);pointer-events:none;-webkit-transition-duration:0;-webkit-transition-delay:0;-webkit-transition-property:-webkit-transform;z-index:10;background:"+
e+";-webkit-transform:"+j+"0,0"+l+";"+("horizontal"==a?"-webkit-border-radius:3px 2px;min-width:6px;min-height:5px":"-webkit-border-radius:2px 3px;min-width:5px;min-height:6px");this.wrapper=f.createElement("div");this.wrapper.style.cssText="-webkit-mask:-webkit-canvas(scrollbar"+this.uid+this.dir+");position:absolute;z-index:10;pointer-events:none;overflow:hidden;opacity:0;-webkit-transition-duration:"+(c?"300ms":"0")+";-webkit-transition-delay:0;-webkit-transition-property:opacity;"+("horizontal"==
this.dir?"bottom:2px;left:2px;right:7px;height:5px":"top:2px;right:2px;bottom:7px;width:5px;");this.wrapper.appendChild(this.bar);b.appendChild(this.wrapper)}a.prototype={x:0,y:0,enabled:!0,handleEvent:function(a){switch(a.type){case f:this.touchStart(a);break;case g:this.touchMove(a);break;case h:this.touchEnd(a);break;case "webkitTransitionEnd":this.transitionEnd();break;case "orientationchange":case "resize":this.refresh();break;case "DOMSubtreeModified":this.onDOMModified(a)}},onDOMModified:function(a){var b=
this;a.target.parentNode==b.element&&(setTimeout(function(){b.refresh()},0),b.options.topOnDOMChanges&&(0!=b.x||0!=b.y)&&b.scrollTo(0,0,"0"))},refresh:function(){var a=this.x,c=this.y;this.scrollWidth=this.wrapper.clientWidth;this.scrollHeight=this.wrapper.clientHeight;this.scrollerWidth=this.element.offsetWidth;this.scrollerHeight=this.element.offsetHeight;this.maxScrollX=this.scrollWidth-this.scrollerWidth;this.maxScrollY=this.scrollHeight-this.scrollerHeight;this.directionY=this.directionX=0;if(this.scrollX)if(0<=
this.maxScrollX)a=0;else if(this.x<this.maxScrollX)a=this.maxScrollX;if(this.scrollY)if(0<=this.maxScrollY)c=0;else if(this.y<this.maxScrollY)c=this.maxScrollY;if(this.options.snap)this.maxPageX=-Math.floor(this.maxScrollX/this.scrollWidth),this.maxPageY=-Math.floor(this.maxScrollY/this.scrollHeight),c=this.snap(a,c),a=c.x,c=c.y;if(a!=this.x||c!=this.y)this.setTransitionTime("0"),this.setPosition(a,c,!0);this.scrollX=this.scrollerWidth>this.scrollWidth;this.scrollY=!this.options.bounceLock&&!this.scrollX||
this.scrollerHeight>this.scrollHeight;if(this.options.hScrollbar&&this.scrollX)this.scrollBarX=this.scrollBarX||new b("horizontal",this.wrapper,this.options.fadeScrollbar,this.options.shrinkScrollbar,this.options.scrollbarColor),this.scrollBarX.init(this.scrollWidth,this.scrollerWidth);else if(this.scrollBarX)this.scrollBarX=this.scrollBarX.remove();if(this.options.vScrollbar&&this.scrollY&&this.scrollerHeight>this.scrollHeight)this.scrollBarY=this.scrollBarY||new b("vertical",this.wrapper,this.options.fadeScrollbar,
this.options.shrinkScrollbar,this.options.scrollbarColor),this.scrollBarY.init(this.scrollHeight,this.scrollerHeight);else if(this.scrollBarY)this.scrollBarY=this.scrollBarY.remove()},setPosition:function(a,b,c){this.x=a;this.y=b;this.element.style.webkitTransform=j+this.x+"px,"+this.y+"px"+l;c||(this.scrollBarX&&this.scrollBarX.setPosition(this.x),this.scrollBarY&&this.scrollBarY.setPosition(this.y))},setTransitionTime:function(a){a=a||"0";this.element.style.webkitTransitionDuration=a;if(this.scrollBarX)this.scrollBarX.bar.style.webkitTransitionDuration=
a,this.scrollBarX.wrapper.style.webkitTransitionDuration=c&&this.options.fadeScrollbar?"300ms":"0";if(this.scrollBarY)this.scrollBarY.bar.style.webkitTransitionDuration=a,this.scrollBarY.wrapper.style.webkitTransitionDuration=c&&this.options.fadeScrollbar?"300ms":"0"},touchStart:function(a){var b;if(this.enabled){a.preventDefault();a.stopPropagation();this.scrolling=!0;this.moved=!1;this.distY=this.distX=0;this.setTransitionTime("0");if(this.options.momentum||this.options.snap)if(b=new WebKitCSSMatrix(window.getComputedStyle(this.element).webkitTransform),
b.e!=this.x||b.f!=this.y)document.removeEventListener("webkitTransitionEnd",this,!1),this.setPosition(b.e,b.f),this.moved=!0;this.touchStartX=e?a.changedTouches[0].pageX:a.pageX;this.scrollStartX=this.x;this.touchStartY=e?a.changedTouches[0].pageY:a.pageY;this.scrollStartY=this.y;this.scrollStartTime=a.timeStamp;this.directionY=this.directionX=0}},touchMove:function(a){if(this.scrolling){var b=e?a.changedTouches[0].pageX:a.pageX,c=e?a.changedTouches[0].pageY:a.pageY,d=this.scrollX?b-this.touchStartX:
0,f=this.scrollY?c-this.touchStartY:0,g=this.x+d,h=this.y+f;a.stopPropagation();this.touchStartX=b;this.touchStartY=c;if(0<=g||g<this.maxScrollX)g=this.options.bounce?Math.round(this.x+d/3):0<=g||0<=this.maxScrollX?0:this.maxScrollX;if(0<=h||h<this.maxScrollY)h=this.options.bounce?Math.round(this.y+f/3):0<=h||0<=this.maxScrollY?0:this.maxScrollY;if(5<this.distX+this.distY){if(this.options.directionLock)if(this.distX-3>this.distY)h=this.y,f=0;else if(this.distY-3>this.distX)g=this.x,d=0;this.setPosition(g,
h);this.moved=!0;this.directionX=0<d?-1:1;this.directionY=0<f?-1:1}else this.distX+=Math.abs(d),this.distY+=Math.abs(f)}},touchEnd:function(a){if(this.scrolling){var b=a.timeStamp-this.scrollStartTime,c=e?a.changedTouches[0]:a,d,f;d=0;f=this.x;var g=this.y;this.scrolling=!1;a.preventDefault();if(this.moved)if(!this.options.snap&&250<b)this.resetPosition();else{this.options.momentum&&(a=!0===this.scrollX?this.momentum(this.x-this.scrollStartX,b,this.options.bounce?-this.x+this.scrollWidth/5:-this.x,
this.options.bounce?this.x+this.scrollerWidth-this.scrollWidth+this.scrollWidth/5:this.x+this.scrollerWidth-this.scrollWidth):{dist:0,time:0},c=!0===this.scrollY?this.momentum(this.y-this.scrollStartY,b,this.options.bounce?-this.y+this.scrollHeight/5:-this.y,this.options.bounce?(0>this.maxScrollY?this.y+this.scrollerHeight-this.scrollHeight:0)+this.scrollHeight/5:this.y+this.scrollerHeight-this.scrollHeight):{dist:0,time:0},d=Math.max(Math.max(a.time,c.time),1),f=this.x+a.dist,g=this.y+c.dist);if(this.options.snap)a=
this.snap(f,g),f=a.x,g=a.y,d=Math.max(a.time,d);this.scrollTo(f,g,d+"ms")}else if(this.resetPosition(),e){for(d=c.target;1!=d.nodeType;)d=d.parentNode;a.preventDefault();f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,a.view,1,c.screenX,c.screenY,c.clientX,c.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,0,null);f._fake=!0;d.dispatchEvent(f)}}},transitionEnd:function(){document.removeEventListener("webkitTransitionEnd",this,!1);this.resetPosition()},resetPosition:function(){var a=
this,b=a.x,c=a.y;if(0<=a.x)b=0;else if(a.x<a.maxScrollX)b=a.maxScrollX;if(0<=a.y||0<a.maxScrollY)c=0;else if(a.y<a.maxScrollY)c=a.maxScrollY;b!=a.x||c!=a.y?a.scrollTo(b,c):(a.moved&&(a.onScrollEnd(),setTimeout(function(){a.moved=!1},0)),a.scrollBarX&&a.scrollBarX.hide(),a.scrollBarY&&a.scrollBarY.hide())},snap:function(a,b){var c,a=0<this.directionX?Math.floor(a/this.scrollWidth):0>this.directionX?Math.ceil(a/this.scrollWidth):Math.round(a/this.scrollWidth);this.pageX=-a;a*=this.scrollWidth;if(0<
a)a=this.pageX=0;else if(a<this.maxScrollX)this.pageX=this.maxPageX,a=this.maxScrollX;b=0<this.directionY?Math.floor(b/this.scrollHeight):0>this.directionY?Math.ceil(b/this.scrollHeight):Math.round(b/this.scrollHeight);this.pageY=-b;b*=this.scrollHeight;if(0<b)b=this.pageY=0;else if(b<this.maxScrollY)this.pageY=this.maxPageY,b=this.maxScrollY;c=Math.round(Math.max(500*(Math.abs(this.x-a)/this.scrollWidth),500*(Math.abs(this.y-b)/this.scrollHeight)));return{x:a,y:b,time:c}},scrollTo:function(a,b,c){this.x==
a&&this.y==b?this.resetPosition():(this.moved=!0,this.setTransitionTime(c||"350ms"),this.setPosition(a,b),"0"===c||"0s"==c||"0ms"==c?this.resetPosition():document.addEventListener("webkitTransitionEnd",this,!1))},scrollToPage:function(a,b,c){if(!this.options.snap)this.pageX=-Math.round(this.x/this.scrollWidth),this.pageY=-Math.round(this.y/this.scrollHeight);"next"==a?a=++this.pageX:"prev"==a&&(a=--this.pageX);"next"==b?b=++this.pageY:"prev"==b&&(b=--this.pageY);a=-a*this.scrollWidth;b=-b*this.scrollHeight;
b=this.snap(a,b);a=b.x;b=b.y;this.scrollTo(a,b,c||"500ms")},scrollToElement:function(a,b){if(a="object"==typeof a?a:this.element.querySelector(a)){var c=this.scrollX?-a.offsetLeft:0,d=this.scrollY?-a.offsetTop:0;if(0<=c)c=0;else if(c<this.maxScrollX)c=this.maxScrollX;if(0<=d)d=0;else if(d<this.maxScrollY)d=this.maxScrollY;this.scrollTo(c,d,b)}},momentum:function(a,b,c,d){var b=1E3*(Math.abs(a)/b),e=b*b/2.5/1E3,f=0;0<a&&e>c?(b=b*c/e/2.5,e=c):0>a&&e>d&&(b=b*d/e/2.5,e=d);f=b/1.2;return{dist:Math.round(e*
(0>a?-1:1)),time:Math.round(f)}},destroy:function(a){window.removeEventListener("onorientationchange"in window?"orientationchange":"resize",this,!1);this.element.removeEventListener(f,this,!1);this.element.removeEventListener(g,this,!1);this.element.removeEventListener(h,this,!1);document.removeEventListener("webkitTransitionEnd",this,!1);this.options.checkDOMChanges&&this.element.removeEventListener("DOMSubtreeModified",this,!1);if(this.scrollBarX)this.scrollBarX=this.scrollBarX.remove();if(this.scrollBarY)this.scrollBarY=
this.scrollBarY.remove();a&&this.wrapper.parentNode.removeChild(this.wrapper);return null}};b.prototype={init:function(a,b){var c=document,d=Math.PI;if("horizontal"==this.dir){if(this.maxSize!=this.wrapper.offsetWidth)this.maxSize=this.wrapper.offsetWidth,c=c.getCSSCanvasContext("2d","scrollbar"+this.uid+this.dir,this.maxSize,5),c.fillStyle="rgb(0,0,0)",c.beginPath(),c.arc(2.5,2.5,2.5,d/2,-d/2,!1),c.lineTo(this.maxSize-2.5,0),c.arc(this.maxSize-2.5,2.5,2.5,-d/2,d/2,!1),c.closePath(),c.fill()}else if(this.maxSize!=
this.wrapper.offsetHeight)this.maxSize=this.wrapper.offsetHeight,c=c.getCSSCanvasContext("2d","scrollbar"+this.uid+this.dir,5,this.maxSize),c.fillStyle="rgb(0,0,0)",c.beginPath(),c.arc(2.5,2.5,2.5,d,0,!1),c.lineTo(5,this.maxSize-2.5),c.arc(2.5,this.maxSize-2.5,2.5,0,d,!1),c.closePath(),c.fill();this.size=Math.max(Math.round(this.maxSize*this.maxSize/b),6);this.maxScroll=this.maxSize-this.size;this.toWrapperProp=this.maxScroll/(a-b);this.bar.style["horizontal"==this.dir?"width":"height"]=this.size+
"px"},setPosition:function(a){"1"!=this.wrapper.style.opacity&&this.show();a=Math.round(this.toWrapperProp*a);0>a?(a=this.shrink?a+3*a:0,7>this.size+a&&(a=-this.size+6)):a>this.maxScroll&&(a=this.shrink?a+3*(a-this.maxScroll):this.maxScroll,7>this.size+this.maxScroll-a&&(a=this.size+this.maxScroll-6));a="horizontal"==this.dir?j+a+"px,0"+l:j+"0,"+a+"px"+l;this.bar.style.webkitTransform=a},show:function(){if(c)this.wrapper.style.webkitTransitionDelay="0";this.wrapper.style.opacity="1"},hide:function(){if(c)this.wrapper.style.webkitTransitionDelay=
"350ms";this.wrapper.style.opacity="0"},remove:function(){this.wrapper.parentNode.removeChild(this.wrapper);return null}};var c="WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix,d=/iphone|ipad/gi.test(navigator.appVersion),e="ontouchstart"in window,f=e?"touchstart":"mousedown",g=e?"touchmove":"mousemove",h=e?"touchend":"mouseup",j="translate"+(c?"3d(":"("),l=c?",0)":")",m=0;window.iScroll=a})();var util={};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1};util.format=function(a){var b=util.format.arguments[1],c=1;if("object"==typeof b){for(key in b)a=a.replace("{"+key+"}",b[key]);return a}!b||!b.splice?b=util.format.arguments:c=0;for(var d=c;d<b.length;d++)a=a.replace("{"+(d-c)+"}",b[d]);return a};util.min=function(a,b){return a>b?b:a};util.max=function(a,b){return a<b?b:a};
util.count=function(a){var b=0;for(key in a)b++;return b};util.hasMutualKey=function(a,b){var c=!1;$.each(a,function(a){$.each(b,function(b){c=c||a==b})});return c};util.asyncEach=function(a,b,c,d){d||(d=0);var e=[],f=0;$.each(a,function(a,b){var c={index:a,item:b,next:null};if(0<e.length)e[e.length-1].next=c;e.push(c);f++});var g=function(a){b(a.index,a.item);f--;a.next&&setTimeout(function(){g(a.next)},d)},h=function(){0==f&&c?c():setTimeout(function(){h()},10)};0<e.length&&g(e[0]);h()};
util.popArrayElement=function(a,b){if(!a.indexOf)return null;var c=a.indexOf(b);return-1<c?a.splice(c,1)[0]:null};util.xmlToString=function(a){return(new XMLSerializer).serializeToString(a)};
jQuery.cookie=function(a,b,c){if(1<arguments.length&&"[object Object]"!==""+b){c=jQuery.extend({},c);if(null===b||void 0===b)c.expires=-1;if("number"===typeof c.expires){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=""+b;return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};e=c.raw?function(a){return a}:decodeURIComponent;
return(d=RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)").exec(document.cookie))?e(d[1]):null};
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){for(var b="",c,d,e,f,g,h,j=0,a=Base64._utf8_encode(a);j<a.length;)c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=a.charCodeAt(j++),f=c>>2,c=(c&3)<<4|d>>4,g=(d&15)<<2|e>>6,h=e&63,isNaN(d)?g=h=64:isNaN(e)&&(h=64),b=b+this._keyStr.charAt(f)+this._keyStr.charAt(c)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return b},decode:function(a){for(var b="",c,d,e,f,g,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<
a.length;)c=this._keyStr.indexOf(a.charAt(h++)),d=this._keyStr.indexOf(a.charAt(h++)),f=this._keyStr.indexOf(a.charAt(h++)),g=this._keyStr.indexOf(a.charAt(h++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!=f&&(b+=String.fromCharCode(d)),64!=g&&(b+=String.fromCharCode(e));return b=Base64._utf8_decode(b)},_utf8_encode:function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+=String.fromCharCode(d>>
6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};function TaskQueue(){this.tasks=[];this.timeout=50;this.tick()}TaskQueue.prototype.add=function(a){this.tasks.push(a)};TaskQueue.prototype.tick=function(a){(a=this.tasks.shift())&&a();var b=this;setTimeout(function(){b.tick()},b.timeout)};function MatrixTransform(){this.reset()}MatrixTransform.fromValues=function(a,b,c,d,e,f){var g=new MatrixTransform;g.m[0]=a;g.m[1]=b;g.m[2]=c;g.m[3]=d;g.m[4]=e;g.m[5]=f;for(var h in g.m)if(isNaN(g.m[h]))throw"bad matrix value at "+h;return g};MatrixTransform.PI_OVER_180=Math.PI/180;MatrixTransform.prototype.reset=function(){this.m=[1,0,0,1,0,0]};MatrixTransform.prototype.copy=function(a){a=new MatrixTransform;a.m=[this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5]];return a};
MatrixTransform.prototype.multiply=function(a){var b=this.m[1]*a.m[0]+this.m[3]*a.m[1],c=this.m[0]*a.m[2]+this.m[2]*a.m[3],d=this.m[1]*a.m[2]+this.m[3]*a.m[3],e=this.m[0]*a.m[4]+this.m[2]*a.m[5]+this.m[4],f=this.m[1]*a.m[4]+this.m[3]*a.m[5]+this.m[5];this.m[0]=this.m[0]*a.m[0]+this.m[2]*a.m[1];this.m[1]=b;this.m[2]=c;this.m[3]=d;this.m[4]=e;this.m[5]=f};
MatrixTransform.prototype.concat=function(a){var b=this.m[1]*a.m[0]+this.m[3]*a.m[1],c=this.m[0]*a.m[2]+this.m[2]*a.m[3],d=this.m[1]*a.m[2]+this.m[3]*a.m[3],e=this.m[0]*a.m[4]+this.m[2]*a.m[5]+this.m[4],f=this.m[1]*a.m[4]+this.m[3]*a.m[5]+this.m[5];this.m[0]=this.m[0]*a.m[0]+this.m[2]*a.m[1];this.m[1]=b;this.m[2]=c;this.m[3]=d;this.m[4]=e;this.m[5]=f};
MatrixTransform.prototype.invert=function(){var a=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),b=-this.m[1]*a,c=-this.m[2]*a,d=this.m[0]*a,e=a*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),f=a*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);this.m[0]=this.m[3]*a;this.m[1]=b;this.m[2]=c;this.m[3]=d;this.m[4]=e;this.m[5]=f};MatrixTransform.prototype.rotateDegrees=function(a){this.rotate(a*MatrixTransform.PI_OVER_180)};
MatrixTransform.prototype.rotate=function(a){var b=Math.cos(a),a=Math.sin(a),c=this.m[1]*b+this.m[3]*a,d=this.m[0]*-a+this.m[2]*b,e=this.m[1]*-a+this.m[3]*b;this.m[0]=this.m[0]*b+this.m[2]*a;this.m[1]=c;this.m[2]=d;this.m[3]=e};MatrixTransform.prototype.getRotation=function(){return Math.asin(this.m[2])};MatrixTransform.prototype.getScale=function(){var a=Math.sqrt(this.m[0]*this.m[0]+this.m[2]*this.m[2]),b=Math.sqrt(this.m[1]*this.m[1]+this.m[3]*this.m[3]);return new Point(a,b)};
MatrixTransform.prototype.translate=function(a,b){this.m[4]+=this.m[0]*a+this.m[2]*b;this.m[5]+=this.m[1]*a+this.m[3]*b};MatrixTransform.prototype.scale=function(a,b){this.m[0]*=a;this.m[1]*=a;this.m[2]*=b;this.m[3]*=b};MatrixTransform.prototype.transformPoint=function(a,b){var c=a,d=b,a=c*this.m[0]+d*this.m[2]+this.m[4],b=c*this.m[1]+d*this.m[3]+this.m[5];return{x:a,y:b}};MatrixTransform.prototype.unTransformPoint=function(a,b){var c=this.copy();c.invert();return c.transformPoint(a,b)};
MatrixTransform.prototype.applyContext=function(a){a.setTransform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};MatrixTransform.prototype.toCSSTransform=function(){return"matrix("+this.val(0)+","+this.val(1)+","+this.val(2)+","+this.val(3)+","+this.val(4)+","+this.val(5)+")"};MatrixTransform.prototype.val=function(a){return Math.round(100*this.m[a])/100};
MatrixTransform.prototype.getRotation=function(){var a=this.transformPoint(0,0),b=this.transformPoint(1,0);return Math.atan2(b.y-a.y,b.x-a.x)};var Element=function(){this.ref=this.container=null;this.events=[];this.actionGroups={};this.variables={};this.states={};this.parent=null;this.children={};this.eventsInitialized=this.isDisabled=!1;this.log=[];this.absoluteId=""};Element.prototype.objectType="Element";Element.prototype.innerType="Element";Element.PixelSrc="data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";Element.BlackPixelSrc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NkYGD4DwABCQEBtxmN7wAAAABJRU5ErkJggg==";
Element.prototype.childItems=function(){var a=[];$.each(this.children,function(b,c){"Item"==c.objectType&&a.push(c)});return a};Element.prototype.findDescendantById=function(a){var b=null,c;for(c in this.children){var d=this.children[c];!b&&d.id==a&&(b=d);!b&&d.findDescendantById&&(b=d.findDescendantById(a))}return b};
Element.prototype.hasDescendantByType=function(a){var b=!1,c;for(c in this.children){var d=this.children[c];!b&&d.innerType.toLowerCase()==a.toLowerCase()&&(b=!0);!b&&d.hasDescendantByType&&(b=d.hasDescendantByType(a))}return b};Element.prototype.getDescendantsByType=function(a){var b=[],c;for(c in this.children){var d=this.children[c];"Storyline"==this.innerType&&"Slide"==d.innerType||(d.innerType.toLowerCase()==a.toLowerCase()&&b.push(d),d.getDescendantsByType&&(b=b.concat(d.getDescendantsByType(a))))}return b};
Element.prototype.isAncestor=function(a){for(var b=this.parent;b;){if(a==b)return!0;b=b.parent}return!1};Element.prototype.findAncestorOfType=function(a){for(var b=this;b;){if(b.innerType==a)return b;b=b.parent}return null};Element.prototype.eachAncestor=function(a){for(var b=this.parent;b;)a(b),b=b.parent};
Element.prototype.getFullObjref=function(a){var b=this.absoluteId;if(0>=this.absoluteId.length)b=this.parent&&this.parent.id&&this.parent.getFullObjref?this.absoluteId=this.parent.getFullObjref()+"."+this.id:this.id;a&&(b="_player."+b);return b};Element.prototype.getFullVariableRef=function(a){a=this.parseObjref(a);return"_player."+a.target.getFullObjref()+"."+a.variable};
Element.prototype.restoreVariableResumeData=function(a){if(""==a)return"";for(var b=$(this.xml).children("variables").children("[resume='true'][type='boolean']"),c=$(this.xml).children("variables").children("[resume='true'][type!='boolean']"),a=new bwChunk(a),d=0;!a.EOF();)for(var e=a.NextUBase10(1),f=1;d<=b.length&&64>f;){var g=e&f;d<b.length?this.variables[$(b[d]).attr("name")]=g?"true":"false":this.extractNextSpecialBool&&this.extractNextSpecialBool(g);d++;f*=2}for(var h,b=0;b<=c.length;b++)if(b<
c.length){h=h?h.NextChunk():a.NextChunk();d=$(c[b]);e=this.variableTypes[d.attr("name")];f=h.Data();switch(e){case "number":f=h.NextBase10();break;case "string":f="^"==f?this.variableDefaults[d.attr("name")]:bwChunk.DecodeString(f)}this.variables[d.attr("name")]=f}else this.extractNextSpecialVar&&(h=h?h.NextChunk():a.NextChunk(),this.extractNextSpecialVar(h.Data()));return h?h.Remainder():a.Remainder()};Element.variableElements="expandinglabel,imagehotspot,droplist,dragitem,droparea,sequencectrl,textinput,webobject".split(",");
Element.prototype.hasVariables=function(){return 0<$(this.xml).children("variables").children("[resume='true']").length||0<=Element.variableElements.indexOf(this.innerType)};
Element.prototype.getVariableResumeData=function(){var a=this,b="",c="",d=1,e=0,f=!1,g={},h=function(h,l){if(!g[h]&&a.variableResumes[h])switch(a.variableTypes[h]){case "bool":case "boolean":l&&"false"!=l&&(e+=d);d*=2;f=!0;32<d&&(d=1,c+=bwChunk.UBase10toN(e),f=!1,e=0);break;case "string":strTemp=l==a.variableDefaults[h]?"^":bwChunk.EncodeString(l);b+=bwChunk.CreateChunk(strTemp);break;case "number":b+=bwChunk.CreateChunk(bwChunk.Base10toN(parseInt(l)))}};$.each(this.variables,h);this.getExtraResumeVars&&
$.each(this.getExtraResumeVars(),h);f&&(c+=bwChunk.UBase10toN(e));b=bwChunk.CreateChunk(c)+b;return bwChunk.CreateChunk(b)};
Element.prototype.toData=function(a){var b=this,c={},d={};$.each(this.variables,function(a,f){if(f!=b.variableDefaults[a]&&!d[a]){if(!c.variables)c.variables={};c.variables[a]=f}});$.each(this.children,function(b,d){if(d.toData){var g=d.toData(a);if(!jQuery.isEmptyObject(g)){if(!c.children)c.children={};c.children[b]=g}}});if(this.shuffled)c.shuffled=!0;if(void 0!=this.shuffleX)c.shuffleX=this.shuffleX,c.shuffleY=this.shuffleY;if(this.visible)c.visible=!0;return c};
Element.prototype.updateFromData=function(a,b){var c=this;c.reset(b);a.variables&&$.each(a.variables,function(a,b){c.variables[a]!=b&&(c.variables[a]=b)});a.children&&$.each(a.children,function(a,e){var f=c.children[a];f&&f.updateFromData(e,b)});if(!b){if(a.shuffled){this.shuffled=!0;if(this.shuffleGroup)this.shuffleGroup.shuffled=!0;if(void 0!=a.shuffleX)this.shuffleX=a.shuffleX,this.shuffleY=a.shuffleY,this.x=this.shuffleX,this.y=this.shuffleY;if(void 0!=a.x){if(!isNaN(parseInt(a.x)))this.x=parseInt(a.x);
if(!isNaN(parseInt(a.y)))this.y=parseInt(a.y)}}c.slide&&c.slide==player.currentSlide()&&c.ref&&(a.visible?this.quickShow?this.quickShow():(this.show(),this.setVisible(!0)):"ShuffleGroup"!=this.innerType&&(this.quickHide?this.quickHide():this.hide()))}};
Element.prototype.reset=function(a){var b=this;a||($.each(this.variables,function(a,d){"Slide"==b.innerType&&"Visited"==a||(void 0!=b.variableDefaults[a]&&b.variableDefaults[a]!=d?b.variables[a]=b.variableDefaults[a]:void 0==b.variableDefaults[a]&&delete b.variables[a])}),b.setEnabled(("false"==(b.variableDefaults._disabled||"false")).toString()),"Slide"!=this.innerType&&this.setVisible(!1))};
Element.prototype.setElementProperty=function(a,b,c){this[a]=b;if(c&&this.children)for(var d in this.children){var e=this.children[d];e.setElementProperty&&e.setElementProperty(a,b,c)}};
Element.prototype.constructElement=function(){this.events=[];this.actionGroups={};this.variables={};this.variableDefaults={};this.variableResumes={};this.variableTypes={};this.content={};this.states={};this.colors={};this.animations={};this.resources=[];this.eventSubscribers=[];this.hotContexts=[];this.matrix=new MatrixTransform;this.isRotated=!1;this.parent=null;this.children={};this.variableDefaults._default="true";this.variables.ObjectState="_default";this.variableDefaults.ObjectState="_default";
this.variables.OnStage="false";this.variableDefaults.OnStage="false";this.originalHeight=this.originalWidth=this.originalZ=this.originalY=this.originalX=this.rotation=this.yoffset=this.xoffset=this.rotateypos=this.rotatexpos=this.dragY=this.dragX=this.y=this.x=0;this.animated=!1;this.stateCount=0;this.visible=!1};Element.prototype.emptyElement=function(){if("Slide"!=this.innerType)this.constructElement(),this.xml=null};
Element.prototype.loadEventsFromXML=function(a){if(!this.eventsInitialized){this.eventsInitialized=!0;var b=this;this.events=[];$(a).children("events").children().each(function(a,d){var e=new StoryEvent(b);e.loadFromXML(d);b.events.push(e)})}};
Element.prototype.loadElementInfoFromXML=function(a){var b=this;this.loadEventsFromXML(a);this.actionGroups={};$(a).children("actiongroups").children().each(function(a,d){var e=$(d).attr("id"),f=$(d).children("actions").children(),f=$.makeArray(f);b.actionGroups[e]=f});$(a).children("variables").children().each(function(a,d){b.variables[$(d).attr("name")]=$(d).attr("value");b.variableDefaults[$(d).attr("name")]=$(d).attr("value");b.variableTypes[$(d).attr("name")]=$(d).attr("type");b.variableResumes[$(d).attr("name")]=
"true"==$(d).attr("resume")});$.each($(a).children("colors").children("color"),function(a,d){var e=$(d).attr("name"),f=new Background(b.ref);f.loadFromXML($(d),"fill");b.colors[e]=f});this.lmsid=$(a).attr("lmsid");b.variables.Id=$(a).attr("id");b.variableDefaults.Id=$(a).attr("id");b.resume="true"==$(a).attr("resume")};
Element.prototype.loadAnimationsFromXML=function(a){var b=this;b.animations={};$(a).children("animations").children("animation").each(function(a,d){var e=new Animation;e.loadFromXML(d,b);b.pushAnimation(e);b.hasAnimations=!0})};Element.prototype.hasEvent=function(a,b){if(!this.events)return null;for(var c=0;c<this.events.length;c++){var d=this.events[c];if(d.trigger==a)return d}c=null;!c&&b&&this.parent&&this.parent.hasEvent&&(c=c||this.parent.hasEvent(a,b));return c};Element.constructors={};
Element.registerTagNames=function(a,b){$.each(b,function(b,d){Element.constructors[d]=a})};Element.prototype.allResourcesLoaded=function(){var a=!0;$.each(this.resources,function(b,c){a=a&&c.loaded});return a};Element.prototype.loadResources=function(){$.each(this.resources,function(a,b){b.load(player.deferredLoadingIndex++)})};Element.prototype.unloadResources=function(){$.each(this.resources,function(a,b){b.unload()})};
Element.prototype.loadChildrenFromXML=function(a,b,c,d){for(var a=$(a).children("objects").children(),e=0;e<a.length;e++){var f=a[e],g;"objgroup"==f.tagName?g=new ItemGroup(this.ref,b,c):"expandinglabel"==f.tagName?g=new ExpandingLabel(this.ref,b,c):"sequencectrl"==f.tagName?g=new SequenceCtrl(this.ref,b,c):"shufflegroup"==f.tagName?g=new ShuffleGroup(this.ref,b,c):"scrollarea"==f.tagName?g=new ScrollArea(this.ref,b,c):"stategroup"==f.tagName?g=new StateGroup(this.ref,b,c):"slideframe"==f.tagName?
g=new SlideFrame(this.ref,b,c):"dragitem"==f.tagName?g=new DragItem(this.ref,b,c):"droparea"==f.tagName?g=new DropArea(this.ref,this.slide,c):"droplist"==f.tagName?g=new DropList(this.ref,b,c):"textinput"==f.tagName?g=new TextInput(this.ref,b,c):"button"==f.tagName?g=new Button(this.ref,b,c):"image"==f.tagName?g=new ImageItem(this.ref,b,c):"webobject"==f.tagName?g=new WebObject(this.ref,b,c):"annotation"==f.tagName?g=new Annotation(this.ref,b,c):"vectorshape"==f.tagName?g=(g=$(f).attr("id"))&&0==
g.indexOf("hotspot_")&&g.indexOf("_marker")==g.length-7?new HotspotMarker(this.ref,b,c):ImageItem.extractAnimatedGif(f)?new ImageItem(this.ref,b,c):new VectorShape(this.ref,b,c):"swf"==f.tagName?(g=$(f).attr("id"),g=0==g.indexOf("hotspot")?new HotspotMarker(this.ref,b,c):new SWFItem(this.ref,b,c)):g="video"==f.tagName?new Video:new StageItem(this.ref,b,c);if(!g)break;if(g.isMedia)g.mediaParent=this;g.parent=this;g.originalParent=this;g.offsetParent=this;g.loadFromXML(f,b,c);this.children[$(f).attr("id")]=
g;d&&d(g)}};Element.prototype.handleEventDeep=function(a,b,c,d){this.handleEvent(a,b,c,!1,!0,d);this.deepEach(function(e,f){f.handleEvent(a,b,c,!1,!0,d)})};Element.prototype.handleEvent=function(a,b,c,d,e,f,g){var h=this,j=!0;$.each(this.events,function(d,e){if(e.trigger==a&&(!e.filter||e.filter(b))&&(!c||c(h,b,e)))j=j&&e.triggerEvent(h,f,g)});j&&this.group&&!e&&(j=j&&this.group.handleEvent(a,b,c,d,e,f,g));return j};
Element.prototype.runActionGroup=function(a,b){var c=this.parseObjref(a),d=c.target,a=c.variable,e=d.actionGroups[a],f=!0;EventLogger.logBeginActionGroup(a,this);if(c.processChildren)for(var g in this.children){var h=this.children[g];(d=h.actionGroups[a])&&d.forEach(function(a){f&&(f=h.runAction(a,b))})}else if(e)for(g=0;g<e.length;g++)f&&(f=d.runAction(e[g],b));EventLogger.logEndActionGroup(this);return f};
Element.prototype.runAction=function(a,b){b||(b=new EventInfo("StoryEvent",-1,null,!0));var c=!0,d=this,e=$(a).attr("id"),f=$(a).get(0).tagName.toLowerCase();player.logActivity&&this.log.push([f,trace.getTicks()]);switch(f){case "adjustvar":case "show":case "hide":case "show_slidelayer":case "hide_slidelayer":case "hideallslidelayers":case "media_play":case "media_pause":case "media_toggle":case "set_volume":var g=new TimelineAction(d);g.loadFromXML(a);g[f](b,!1);break;case "exe_animation":d[f](a,
b);break;case "exe_actiongroup":c=this.runActionGroup(e,b);break;case "if_action":g=d.evaluateCondition($(a).children("condition").first())?"then_actions":"else_actions";g=$(a).children(g).children();for(f=0;f<g.length;f++)c&&(c=d.runAction(g[f],b));break;case "set_enabled":var f=$(a).children("objref").attr("value"),g=$(a).children("enabled").attr("value"),h=d.parseObjref(f).target;h.setEnabled(g);break;case "set_review":f=$(a).children("objref").attr("value");g="true"==$(a).children("enabled").attr("value");
h=d.parseObjref(f).target;if(0==h.id.indexOf("hotspot"))h.isDisabled=!0,h.parent.isDisabled=!0,h.ref.parent().find(".item.swf").show();h.setVariable("ReviewMode",!0);h.isDragItem&&"matching"==h.style&&h.updatePosition();h.set_review&&h.set_review(g);break;case "setdrawreview":f=$(a).attr("drawid");g="true"==$(a).attr("review");h=d.parseObjref(f).target;h.setVariable("ReviewMode",g);h.m_bReviewMode=g;break;case "setobjstate":(h=d.parseObjrefFromXML(a).target)||(h=d);g=$(a).children("stateref").attr("value");
h.setStates(g,"true");break;case "setfocus":d.input&&d.input.get&&d.input.get(0)&&d.input.get(0).focus();break;case "trigger_next_slide":player.currentSlide().handleEvent("onnextslide",null,null,!1,!1,!0);break;case "trigger_prev_slide":player.currentSlide().handleEvent("onprevslide");break;case "trigger_submit_slide":player.currentSlide().handleEvent("onsubmitslide");break;case "trigger_submitall_slide":Interaction.partialEvaluateSlide(player.currentSlide());player.currentSlide().handleEvent("onsubmitallslide");
break;case "trigger_slide_finish":player.currentSlide().handleEvent("onfinishslide");break;case "history_prev":c=player.showPreviousSlide();break;case "history_prev_scene":c=player.showPreviousSlide(function(a){return a.sceneIndex!=player.currentSlide().sceneIndex});break;case "history_prev_group":c=player.showPreviousSlide(function(a){return a.historygroupid!=player.currentSlide().historygroupid});break;case "reset_player":e=$(a).attr("startslideid");f=d.parseObjref(e).target;story.reset();SlideDraw.resetDraws();
SlideDraw.populateDraws();player.listSlidesViewed={};player.listSlidesViewedComplete={};$.each(story.allSlides,function(a,b){b.resetSlide(!0,!0)});for(var j in story.quizzes)g=story.quizzes[j],g.reset();e&&f&&d.performGoToPlay("_frame",f,!0);break;case "resume_player":Video.iOSPrepare&&Video.iOSPrepare();Audio.iOSPrepare&&Audio.iOSPrepare();Frame.requestFullScreen&&Frame.requestFullScreen()&&setTimeout(function(){player.frame.initOrientation()},100);if("true"==$(a).attr("resume")){g=player.resumeData;
if(player.overrideResumeData)resumedata=player.overrideResumeData;try{player.useCompactResume?story.updateFromCompactData(g):story.updateFromData(JSON.parse(g)),player.hasAdvanced=!0}catch(l){console.error("could not restore from resumeData",l),story.reset(),$.each(story.allSlides,function(a,b){b.resetSlide(!0,!0)}),$.each(story.children,function(a,b){"Scene"==b.innerType&&b.cleanDraws()})}}else story.clearLocalStorage(),SlideDraw.populateDraws();j=story.parseObjref(story.resumeWindow).target;j.close();
$(".slide:not(.framed)").hide();player.showSlideID(story.startingslide,!0,function(){player.hasShownFirstSlide=!1;if(story.startingWindowInfo){story.startingWindowInfo.slide.loadContentFromXML();var a=0,b=function(){10<a++||player.currentSlide()&&player.currentSlide().transitionedIn&&story.startingWindowInfo.slide.fullyLoaded?story.startingWindowInfo.win.showSlide(story.startingWindowInfo.slide):setTimeout(b,100)};b()}});break;case "notifylinkselected":g=$(a).attr("id");f=story.children[g];if(!f)f=
story.parseObjref(g).target;f&&f.notifySelected(g);break;case "gotoplay":f=$(a).children("objref").attr("value");c=$(a).children("objref").attr("type");g=$(a).attr("window");f=d.parseObjref(f,c).target;c=d.performGoToPlay(g,f);break;case "closewndgotoslide":f=$(a).children("objref").attr("value");c=$(a).attr("closewindowid");e=$(a).attr("slidewindowid");f=d.parseObjref(f).target;j=player.currentWindow;if("_current"!=c&&"_frame"!=c)j=story.parseObjref(g).target;if(j&&(j.slide.saveIfNecessary(),j.close(),
j==player.currentWindow))player.currentWindow=null;c=d.performGoToPlay(e,f);break;case "playnextdrawslide":if("SlideDraw"==d.parent.innerType)player.currentDraw=d.parent,d.parent.sniffDrawIndex(d);else if(d.slide&&"SlideDraw"==d.slide.parent.innerType)player.currentDraw=d.slide.parent,d.slide.parent.sniffDrawIndex(d);player.currentDraw&&player.currentDraw.playnextdrawslide();break;case "nextunsubmittedslide":g=d.parseObjrefFromXML(a).target;(g=g.findNextSlide(Quiz.SEARCH_UNSUBMITTED))&&(c=d.performGoToPlay("_current",
g));break;case "nextunansweredslide":g=d.parseObjrefFromXML(a).target;(g=g.findNextSlide(Quiz.SEARCH_UNANSWERED))&&(c=d.performGoToPlay("_current",g));break;case "nextviewedslide":g=$(a).children("quizref").attr("value");f=$(a).children("completed_slide_ref").attr("value");g=d.parseObjref(g).target;f=d.parseObjref(f).target;(g=g.findNextSlide(Quiz.SEARCH_VIEWED,f))&&(g==player.currentSlide()?f&&(c=d.performGoToPlay("_current",f)):c=d.performGoToPlay("_current",g));break;case "close_window":e=$(a).attr("id");
"_current"==e?player.currentWindow&&player.currentWindow.close():(j=story.parseObjref(e).target,j.close());break;case "close_player":window.manuallyClosing=!0;player.lmsManager.handleClosePlayer()||setTimeout(function(){player.isCrossDomainFrame?(window.open("","_self",""),window.close()):(top.window.open("","_self",""),top.window.close())},10);break;case "eval_interaction":e=$(a).attr("id");d.parseObjref(e).target.evaluate();break;case "eval_all_unanswered":g=this.parseObjrefFromXML(a).target;Interaction.eval_all_unanswered(g,
a);break;case "setquizcomplete":this.setquizcomplete?this.setquizcomplete(a):Interaction.setquizcomplete(a);break;case "object_action":f=$(a).attr("command");g=this.parseObjrefFromXML(a).target;if("function"==typeof g[f])return g[f](this.xml),!0;break;case "showtimer":e=$(a).attr("id");g=d.parseObjref(e).target;g.show();break;case "hidetimer":e=$(a).attr("id");g=d.parseObjref(e).target;g.hide();break;case "starttimer":e=$(a).attr("id");g=d.parseObjref(e).target;g.start();break;case "pausetimer":e=
$(a).attr("id");g=d.parseObjref(e).target;g.pause();break;case "resetquiz":g=d.parseObjrefFromXML(a).target;g.reset();g.attemptCount++;$.each(g.sliderefs,function(a,b){var c=d.parseObjref(b).target;delete player.listSlidesViewed[c.getFullObjref()];delete player.listSlidesViewedComplete[c.getFullObjref()];c.compactResumeData=null;c.resumeData=null;c.resetSlide(!0,!0)});player.currentSlide().reset(!0);break;case "exe_javascript":g=$(a).attr("id");try{window.ExecuteScript(g)}catch(m){console.log("Error in user.js",
g,m)}break;case "emailto":g=$(a).attr("address");location.href="mailto:"+g;break;case "enable_frame_control":g=$(a).attr("name");f="true"==$(a).attr("enable");player.frame.setControlEnabled(g,f);break;case "enable_window_control":g=$(a).attr("name");f="true"==$(a).attr("enable");"_frame"!=this.variables.WindowId&&this.slide&&"_frame"!=this.slide.variables.WindowId?player.frame.setWindowControlEnabled(g,f):player.frame.setControlEnabled(g,f);break;case "set_window_control_visible":g=$(a).attr("name");
f="true"==$(a).attr("visible");"_frame"!=this.variables.WindowId&&this.slide&&"_frame"!=this.slide.variables.WindowId?player.frame.setWindowControlVisible(g,f):player.frame.setControlVisible(g,f);break;case "setactivetimeline":if(player.useActiveTimeline)(h=d.parseObjrefFromXML(a).target)&&h.timeline?player.timelineManager.setActiveTimeline(h.timeline):console.error("could not resolve target - setactivetimeline");break;case "seek_timeline":h=d.parseObjrefFromXML(a).target;g=parseInt($(a).attr("position"));
h&&h.timeline&&h.timeline.seekTimeline(g);break;case "resume_timeline":(h=d.parseObjrefFromXML(a).target)&&h.timeline&&h.timeline.playTimeline();break;case "pause_timeline":case "pause_animations":(h=d.parseObjrefFromXML(a).target)&&h.timeline&&h.timeline.pauseTimeline();break;case "resetdepth":f=$(a).find("value").attr("value");h=d.parseObjref(f).target;h.setZIndex(this.originalZ);break;case "updatescrollpos":var f=$(a).find("scrollref ").attr("value"),h=d.parseObjref(f).target,g=$(a).find("pos").attr("type"),
k=this.extractVariable($(a).find("pos").attr("value"),g);if(!h.scrollKeeper)h.scrollKeeper=$("<div class='scrollkeeper'></div>"),h.ref.append(h.scrollKeeper);var n=5,p=function(){if(h&&h.scrollKeeper&&h.ref&&(h.scrollKeeper.css("top",k),h.ref.get(0).scrollTop=k,clearTimeout(player.retrySetScrollTimeout),h.ref.get(0).scrollTop!=k&&0<n--))player.retrySetScrollTimeout=setTimeout(p,100)};p();break;case "notify_preview":break;case "updatescrollheight":break;case "cancel_event":TimelineAction.actparams.cancelled=
!0;break;case "save_resume_data":this.saveIfNecessary&&this.saveIfNecessary();story.saveToLocalStorage();break;case "debug_trace":$(a).attr("message");break;default:if(d[f])d[f](a);else if(g=new TimelineAction(d),j=new StoryEvent(d),g.loadFromXML(a,j),g[f])g[f](j,!1);else console.error("unknown action",f,d.id,d.innerType,d)}return c};Element.prototype.setVisible=function(a){this.visible=a};
Element.prototype.setEnabled=function(a){this.isDisabled="false"==a;if("textinput"==this.type){if(this.input&&this.input.get&&this.input.get(0))this.input.get(0).disabled=this.isDisabled;this.render()}else if("droplist"==this.type&&this.select&&this.select.get&&this.select.get(0))this.select.get(0).disabled=this.isDisabled;this.ref&&(this.isDisabled?this.ref.addClass("disabled"):this.ref.removeClass("disabled"))};
Element.prototype.getProperty=function(a){var b="";if("function"===typeof this[a])b=this[a]();else switch(a){case "AbsoluteId":b=this.getFullObjref();break;case "XPos":b=this.x;break;case "YPos":b=this.y;break;case "RawXPos":b=this.x;break;case "RawYPos":b=this.y;break;case "InitXPos":b=this.originalX;break;case "InitYPos":b=this.originalY;break;case "Rotation":b=this.rotation;break;case "ScaleX":b=this.xscale;break;case "ScaleY":b=this.yscale;break;case "width":b=this.width;break;case "height":b=
this.height;break;case "Position":"ScrollArea"==this.innerType&&this.ref&&(b=this.getScrollPosition());break;case "TimelineComplete":b=this.timeline&&this.timeline.getIsTimelineComplete()}return b};Element.prototype.GetProperty=function(a){return this.extractVariable(a)};Element.prototype.GetVariable=function(a){return this.extractVariable(a)};
Element.prototype.extractVariable=function(a,b){b=b||"var";switch(b){case "var":case "variable":case "property":var c=this.parseObjref(a),d=c.target.variables[c.variable];void 0==d&&(d=c.target.getProperty(c.variable));"property"==b&&story.properties[a]&&(d=story.properties[a]);return d;case "number":return parseFloat(a);case "boolean":return a;case "actparam":return TimelineAction.actparams[a];default:return a}};
Element.prototype.setVariable=function(a,b){var c=this.parseObjref(a);c.target.variables[c.variable]!=b&&(c.target.variables[c.variable]=b,c.target.handleVarChanged(c.variable,"onvarchanged"))};
Element.prototype.registerVariableEventSubscriber=function(a,b,c){for(var d in this.eventSubscribers){var e=this.eventSubscribers[d];if(e.item==a&&e.varname==b)return}a={item:a,varname:b,check:Math.random(),priority:c};for(b=0;b<this.eventSubscribers.length;b++)if(this.eventSubscribers[b].priority<a.priority){this.eventSubscribers.splice(b,0,a);return}this.eventSubscribers.push(a)};
Element.prototype.handleVarChanged=function(a,b){b=b||"onvarchanged";this.eventSubscribers.forEach(function(c){c.varname==a&&(c.item.handleEvent(b,c.varname,null,!1,!0),c.item.HandleBoundVarChanged&&c.item.HandleBoundVarChanged(null,!0,null,"handleVarChanged"))})};
Element.prototype.setProperty=function(a,b,c){var d=this.parseObjref(a),a=d.target.variables[d.variable]!=b;d.target.variables[d.variable]=b;a&&!c&&!this.group&&setTimeout(function(){d.target.handleVarChanged(d.variable,"onpropchanged")},0)};Element.prototype.getParentGlobalRotation=function(){for(var a=0,b=this.offsetParent,c=0;b&&b.rotation&&10>c++;)a+=b.rotation,b=b.offsetParent;return a};Element.prototype.getGlobalRotation=function(){return this.getParentGlobalRotation()+this.rotation};
Element.prototype.parseObjrefFromXML=function(a){var b=$(a).find("objref").attr("value"),a=$(a).find("objref").attr("type");return this.parseObjref(b,a)};
Element.prototype.parseObjref=function(a,b){var c=this,d=a,e=!1,f=!0,g=!1;if(!a)return{target:null,variable:null,success:!1,isVariableRef:!1};for(var h=d.split("."),j=0;j<h.length;j++){var l=h[j];switch(l){case "":break;case "_this":break;case "_children":e=!0;break;case "_parent":if(c.parent)for(c=c.parent;"ShuffleGroup"==c.innerType;)c=c.parent;break;case "_player":c=story;break;default:var m=j==h.length-1,k=c.children[l];!k&&c.children[""]&&(k=c.children[""].children[l]);k?c=k:m&&(d=l,g=!0,"undefined"===
typeof c.variables[l]&&"function"!==typeof c[l]&&(f=!1))}}return"var"==b?this.parseObjref(c.variables[d]):{target:c,variable:d,processChildren:e,success:f,isVariableRef:g}};Element.prototype.setStates=function(a){this.render&&this.render(a,!1,null,"setStates");this.setProperty("ObjectState",a);this.executeStateActions&&this.executeStateActions(a)};
Element.prototype.store_resume_data=function(a){var b=$(a).attr("objref"),a=$(a).attr("varref"),c=this.parseObjref(b).target;c&&c.GetResumeData?(b=c.GetResumeData(!0),c.setVariable(a,bwChunk.CreateChunk(b))):console.warn("Unable to resolve reference: "+b)};Element.prototype.restore_resume_state=function(a){var b=$(a).attr("objref"),c=$(a).attr("varref");$(a).attr("limited");a=this.parseObjref(b).target;if(c=a.extractVariable(c))a.reset(),a.restoreFromResumeData(c)};
Element.prototype.evaluateCondition=function(a,b){var c=this,d=function(){if(b){if(b.lmsCorrectResponses[0]&&b.lmsCorrectResponses[0].lmstext)return b.lmsCorrectResponses[0].lmstext;b.lmsCorrectResponses[0]={lmstext:""}}return""},e=function(a){if(b){var c=d();c&&(c+=" ");b.lmsCorrectResponses[0]={lmstext:c+a}}};switch($(a).get(0).tagName.toLowerCase()){case "condition":return c.evaluateCondition($(a).children().first(),b);case "and":var f=!0;$(a).children().each(function(a,g){d()&&e("and");f=b?c.evaluateCondition(g,
b)&&f:f&&c.evaluateCondition(g)});return f;case "or":return f=!1,$(a).children().each(function(a,g){d()&&e("or");f=b?c.evaluateCondition(g,b)||f:f||c.evaluateCondition(g)}),f;case "nand":return f=!0,$(a).children().each(function(a,g){d()&&e("and");f=b?c.evaluateCondition(g,b)&&f:f&&c.evaluateCondition(g)}),!f;case "nor":return f=!1,$(a).children().each(function(a,g){d()&&e("nor");f=b?c.evaluateCondition(g,b)||f:f||c.evaluateCondition(g)}),!f;case "compare":var g=$(a),h=g.attr("operator"),j=!0,l=g.attr("valuea"),
l=c.extractVariable(l,g.attr("typea")),m=g.attr("valueb"),g=c.extractVariable(m,g.attr("typeb"));!isNaN(l)&&!isNaN(g)&&""!==l&&""!==g&&(l=parseFloat(l),g=parseFloat(g));var m=l==g,k="equals";switch(h){case "eq":k="equal to";break;case "iceq":m=l.toLowerCase()==g.toLowerCase();k="equal to";break;case "noteq":m=!m;k="not equal to";break;case "icneq":m=l.toLowerCase()!=g.toLowerCase();k="not equal to";break;case "gt":m=l>g;k="greater than";break;case "gte":m=l>=g;k="greater than or equal to";break;case "lt":m=
l<g;k="less than";break;case "lte":m=l<=g;k="less than or equal to";break;default:j=!1}e("Correct Response is "+k+" "+g);return!j?!1:m;case "hittestpoint":h=this.parseObjref($(a).children("objref").attr("value")).target;j=parseInt(this.extractVariable($(a).children("xpos").attr("value"),$(a).children("xpos").attr("type")));l=parseInt(this.extractVariable($(a).children("ypos").attr("value"),$(a).children("ypos").attr("type")));if(!h)return!1;h.slide&&h.slide.matrix.transformPoint(j,l);return h.isPointActive(j,
l);case "hasslidetext":var h=this.parseObjref(this.extractVariable($(a).children("slideref").attr("value"),$(a).children("slideref").attr("type"))).target,n=this.extractVariable($(a).children("searchref").attr("value"),$(a).children("searchref").attr("type")),n=n.toLowerCase(),p=!1;h.xml.find("[alttext]").each(function(a,b){p=p||-1<$(b).attr("alttext").toLowerCase().indexOf(n)});return p;case "containstext":return h=this.extractVariable($(a).children("targetref").attr("value"),$(a).children("targetref").attr("type")),
n=this.extractVariable($(a).children("searchref").attr("value"),$(a).children("searchref").attr("type")),$(a).attr("casesensitive")&&(h=h.toLowerCase(),n=n.toLowerCase()),p=-1<h.toLowerCase().indexOf(n);case "varexists":return h=this.parseObjref($(a).attr("value")),n=h.target.variables[h.variable],void 0!=n;case "isdescendant":return j=this.extractVariable($(a).attr("targeta"),$(a).attr("typea")),h=this.extractVariable($(a).attr("targetb"),$(a).attr("typeb")),j=this.parseObjref(j).target,h=this.parseObjref(h).target,
j.isAncestor(h);default:return!1}};Element.prototype.get_mouse_position=function(a){if(!this.isDisabled&&!this.parent.isDisabled){var b=swipe.getSlideCoords(this.slide),b=this.slide.matrix.unTransformPoint(b.x,b.y);this.setVariable($(a).children("xvar").attr("value"),b.x);this.setVariable($(a).children("yvar").attr("value"),b.y)}};
Element.prototype.moveto=function(a){var b=this.parseObjref($(a).children("objref").attr("value")).target,c=parseInt(this.extractVariable($(a).children("xpos").attr("value"),$(a).children("xpos").attr("type"))),d=parseInt(this.extractVariable($(a).children("ypos").attr("value"),$(a).children("ypos").attr("type")));if("true"==$(a).attr("addoffsetx"))var e=parseInt(this.extractVariable($(a).children("xoffset").attr("value"),$(a).children("xoffset").attr("type"))),c=c+e;"true"==$(a).attr("addoffsety")&&
(a=parseInt(this.extractVariable($(a).children("yoffset").attr("value"),$(a).children("yoffset").attr("type"))),d+=a);b.actionControlled=!0;b.ref.css("left",c+b.xoffset);b.ref.css("top",d+b.yoffset);b.x=c;b.y=d;b.updateMatrixComplete(!0)};Element.prototype.bringtofront=function(a){var b=this;if(a)b=this.parseObjref($(a).children("value").attr("value")).target;if(b.depth<b.slide.topZ)b.depth=++b.slide.topZ,b.setZIndex(b.depth)};
Element.prototype.open_webobject=function(a){if(this.webobject)this.webobject.remove(),this.webobject=null;var b=this.parent;"Slide"==this.innerType&&(b=this);this.webobject=$("<iframe class='item webobject'></iframe>");this.webobject.attr("src",$(a).attr("url"));this.webobject.attr("width",$(a).attr("width"));this.webobject.attr("height",$(a).attr("height"));this.webobject.css("left",$(a).attr("xpos")+"px");this.webobject.css("top",$(a).attr("ypos")+"px");this.webobject.css("z-index",this.depth);
b.ref.append(this.webobject);this.webobject.show()};Element.prototype.destroyWebobjects=function(){if(this.webobject)this.webobject.remove(),this.webobject=null};
Element.prototype.open_url=function(a){var b=$(a).attr("url"),c=$(a).attr("window"),d=$(a).attr("windowsize")||"custom";$(a).attr("usedefaultcontrols");var e="true"==$(a).attr("status")?1:0,f="true"==$(a).attr("toolbar")?1:0,g="true"==$(a).attr("location")?1:0,h="true"==$(a).attr("menubar")?1:0,j="true"==$(a).attr("scrollbars")?1:0,l="true"==$(a).attr("resizable")?1:0,m=parseInt($(a).attr("width")),k=parseInt($(a).attr("height"));"open_video"==a.tagName&&(b=player.basepath+window.globals.strContentFolder+
"/"+b);a="location="+g+",menubar="+h+",resizable="+l+",status="+e+",scrollbars="+j+",toolbar="+f;switch(d){case "fullscreen":a+=",width="+(screen.width-33)+",height="+(screen.height-150);break;case "custom":d=Math.floor(window.screenLeft+window.outerWidth/2-m/2),e=Math.floor(window.screenTop+window.outerHeight/2-k/2),a=a+(",width="+m+",height="+k)+(",left="+d+",top="+e)}var n=this;if(!this.openingWindow)this.openingWindow=!0,setTimeout(function(){n.openingWindow=!1},500),story.popWindow=window.open(b,
c,a),story.popWindow&&story.popWindow.focus&&story.popWindow.focus(),this.openingWindow=!1};Element.prototype.open_video=Element.prototype.open_url;Element.prototype.exe_animation=function(a,b){var c=this.parseObjrefFromXML(a).target,d=$(a).attr("id"),e="true"==$(a).children("reverse").attr("value"),f=c.animations[d];EventLogger.logNote("exe_animation:"+d+", "+c.id);f.start(c,e,b)};
Element.prototype.slideY=function(){for(var a=0,b=this;b&&!isNaN(b.y);)a+=parseInt(b.y),!isNaN(b.yoffset)&&b!=this&&(a+=b.yoffset),"ScrollArea"==b.innerType&&b.ref&&b.ref.get(0)&&b.ref.get(0).scrollTop&&(a-=parseInt(b.ref.get(0).scrollTop)),b=b.parent;return parseInt(a)};
Element.prototype.slideX=function(){for(var a=0,b=this;b&&!isNaN(b.x);)a+=parseInt(b.x),!isNaN(b.xoffset)&&b!=this&&(a+=b.xoffset),"ScrollArea"==b.innerType&&b.ref&&b.ref.get(0)&&b.ref.get(0).scrollLeft&&(a-=parseInt(b.ref.get(0).scrollLeft)),b=b.parent;return parseInt(a)};
Element.prototype.testOver=function(a,b){var c=this.matrix.unTransformPoint(a,b);c.x+=this.xoffset;c.y+=this.yoffset;c=0<=c.x&&c.x<=this.width&&0<=c.y&&c.y<=this.height;return this.nearestScrollAreaAncestor&&this.nearestScrollAreaAncestor.hasScrollBars()&&this.nearestScrollAreaAncestor.matrix.unTransformPoint(a,b).x+18>this.nearestScrollAreaAncestor.width?!1:c};
Element.prototype.deepEach=function(a,b,c){isNaN(c)&&(c=0);for(var d in this.children){var e=this.children[d];if(e&&(!b||b(e)))a(d,e,c),e.deepEach&&e.deepEach(a,b,c+1)}};Element.prototype.deepEachReverse=function(a){var b=[];this.deepEach(function(a,c,d){b[d]||(b[d]=[]);b[d].push(c)});for(var c=b.length-1;0<=c;c--)for(var d=0;d<b[c].length;d++){var e=b[c][d];a(e.id,e,c)}};
Element.prototype.deepEachTrace=function(a){var b=new Date,c=0,d=function(a,b,d){console.logMulti("deepEach",d,a,b);c++};a?this.deepEachReverse(d):this.deepEach(d);console.logMulti("deepEach",c,new Date-b)};Element.prototype.getAbsoluteMatrix=function(){for(var a=this.matrix.copy(),b=this.offsetParent,c=0;b&&b.matrix&&10>c++;)a.multiply(b.matrix),b=b.offsetParent;return a};
Element.prototype.updateMatrixComplete=function(a){this.offsetParent&&this.offsetParent.updateMatrixComplete&&this.offsetParent.updateMatrix&&this.offsetParent.updateMatrixComplete(!1);this.updateMatrix();a&&this.deepEach(function(a,c){c.matrix&&(c.isStageItem||"Slide"==c.innerType)&&c.updateMatrix()})};
Element.prototype.updateMatrix=function(){this.matrix.reset();"ScrollArea"==this.innerType&&this.ref&&0!=this.ref.get(0).scrollTop&&this.matrix.translate(0,-this.ref.get(0).scrollTop);if("sequencectrl"==this.innerType&&this.ref&&this.ref.get(0)){var a=this.ref.get(0);a.hasOwnProperty("scrollTop")&&this.matrix.translate(0,-a.scrollTop)}"expandinglabel"==this.innerType&&this.matrix.translate(0,this.m_nContentYOffset);this.offsetParent&&!this.offsetParent.dragX&&!this.offsetParent.dragY&&(this.slide?
this.matrix.translate(this.dragX*this.slide.scale||0,this.dragY*this.slide.scale||0):this.matrix.translate(this.dragX||0,this.dragY||0));this.offsetParent&&this.offsetParent.matrix&&this.matrix.multiply(this.offsetParent.matrix.copy());this.centerpoint={x:this.rotatexpos-this.xoffset,y:this.rotateypos-this.yoffset};this.matrix.translate(this.x+this.xoffset+this.centerpoint.x,this.y+this.yoffset+this.centerpoint.y);this.matrix.rotateDegrees(this.rotation);this.matrix.translate(-this.centerpoint.x,
-this.centerpoint.y);void 0!=this.scale&&this.matrix.scale(this.scale,this.scale);this.isRotated=this.parent&&this.parent.isRotated||0!=this.rotation};
Element.prototype.applySize=function(a){this.x=Math.round(this.x);this.y=Math.round(this.y);this.xoffset=Math.round(this.xoffset);this.yoffset=Math.round(this.yoffset);this.updateMatrix();if(player.showMatrixDebug){if(!player.testCanvas)player.testCanvas=$("<canvas id='test' width='1000' height='1000' style='position:absolute;z-index:200;left:0px;top:0px;'></canvas>"),$("#slideframe").append(player.testCanvas),player.testContext=player.testCanvas.get(0).getContext("2d"),player.testContext.fillStyle=
"rgba(255,255,0,0.5)",player.testContext.fillStyle="rgba(0,0,0,0.5)",player.testContext.strokeStyle="rgba(0,255,0,0.5)";player.testContext.save();this.matrix.applyContext(player.testContext);player.testContext.strokeStyle="rgba(0,255,0,0.5)";player.testContext.strokeRect(0,0,this.width,this.height);this.getAABB();player.testContext.restore()}a.css("left",this.x+this.xoffset+"px");a.css("top",this.y+this.yoffset+"px");"vectorshape"==this.innerType&&this.rectShape?(a.css("width",this.rectShape.GetWidth()+
"px"),a.css("height",this.rectShape.GetHeight()+"px")):"Video"!=this.innerType&&(a.css("width",this.width+"px"),a.css("height",this.height+"px"));"Layer"!=this.innerType&&"ExpandingLabel"!=this.innerType&&0<this.depth&&a.css("z-index",this.depth);var b="",c="";0!=this.rotation&&(b+=" rotate("+this.rotation+"deg)",c+=" rotate("+this.rotation+"deg)");void 0!=this.scale&&(b+=" scale("+this.scale+","+this.scale+") ",c+=" scale("+this.scale+","+this.scale+") ");if(""!=b)a.css("-webkit-transform-origin",
this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-webkit-transform",b),a.css("-moz-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-moz-transform",b),a.css("-o-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-o-transform",b),a.css("-ms-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-ms-transform",c),this.canSimplify=!1};
Element.prototype.performGoToPlay=function(a,b,c){var d=!0;DragItem.cancelDrag();bwDragPathItem.cancelDrag();$(document.body).removeClass("pointercursor");"Scene"==b.innerType&&(b=b.getFirstSlide());if("SlideDraw"==b.innerType){var e=b,b=e.getFirstSlide();e.parent.compactResumeData=e.parent.getResumeData()}var f=player.currentWindow;if(f&&f.isPrompt&&"_current"==a)player.currentWindow.close(),f=player.currentWindow;if("Slide"==b.innerType)e=!0,"_current"!=a&&(b.variables.WindowId=a),"_current"!=a&&
"_frame"!=a?(TimelineAction.actparams._ActTargetWindow=a,player.pausedListFromWindow=player.timelineManager.pauseAllTimelines(player.pausedListFromWindow),c=story.parseObjref(a).target,e=c==f,c.showSlide(b),d=!1):"_current"==a&&null!=f?(TimelineAction.actparams._ActTargetWindow=f.getFullObjref(!0),player.pausedListFromWindow=player.timelineManager.pauseAllTimelines(player.pausedListFromWindow),f.showSlide(b),d=!1):(a=player.currentSlide()==b,e=null==f,TimelineAction.actparams._ActTargetWindow="_frame",
player.currentWindow=null,player.windowZoomModifier=1,a?(b=player.currentSlide().resume,player.currentSlide().replaySlide(c||!b)):player.showSlideIndex(b.slideIndex,null,!0,function(){player.zoomParams=null})),e&&(d=!1);return d};Element.prototype.pushAnimation=function(a){this.animations&&(this.animations[a.id]=a)};Element.prototype.stopCurrentAnimations=function(a,b){if(this.animations)for(var c in this.animations)c!=b&&this.animations[c].finish(a)};
Element.prototype.resetCurrentAnimations=function(a){if(this.animations)for(var b in this.animations)b!=a&&this.animations[b].reset()};var Storyline=function(a){this.container=a;this.scenes=[];this.allSlides=[];this.slideLookup={};this.media=[];this.m_listViewedActionLinks=[];this.startingslide=null;this.quizzes={};this.timers={};this.pathlibs={};this.properties={};this.currentSceneIndex=0;this.constructElement()};Storyline.prototype=new Element;Storyline.prototype.objectType="Storyline";Storyline.prototype.innerType="Storyline";
Storyline.prototype.saveToLocalStorage=function(){if(player.hasAdvanced)if(player.useCompactResume){var a=story.toResumeData();try{localStorageAlias[story.resumeID]=a}catch(b){}player.automation.notifyResumeUpdated(a)}else a=JSON.stringify(story.toData(!0)),localStorageAlias[story.resumeID]=a};Storyline.prototype.clearLocalStorage=function(){localStorageAlias.removeItem(story.resumeID)};
Storyline.prototype.toResumeData=function(){var a=this,b="";if(0==player.history.length&&null==player.currentWindowSlide&&!player.hasAdvanced)return"";var c="",d=0;$.each(this.allSlides,function(a,b){b.variables.Visited&&b.trackviews&&(c+=bwChunk.UBase10toN(b.slideIndexForResume,2),d++)});1==d&&(c="");var b=b+bwChunk.CreateChunk(c),e="",f=Window.getWindowResumeData(0,story.allSlides[player.slideIndex],player.history),e=e+bwChunk.CreateChunk(f),g=0;$.each(this.children,function(a,b){if("Window"==b.innerType&&
(g++,b.visible)){var c=Window.getWindowResumeData(g,player.currentWindowSlide,b.history);e+=bwChunk.CreateChunk(c)}});b+=bwChunk.CreateChunk(e);story.hasVariables()&&(b+=story.getVariableResumeData());var h="";$.each(this.children,function(a,b){if("Scene"==b.innerType){var c=bwChunk.EMPTY_CHUNK;if(b.compactResumeData)c=b.compactResumeData;h+=c}});var b=b+h,j="";$.each(this.quizzes,function(a,b){j+=bwChunk.CreateChunk(b.GetResumeData())});var b=b+j,l="";$.each(this.timers,function(a,b){l+=bwChunk.CreateChunk(b.GetResumeData())});
var b=b+l,m="";$.each(this.m_listViewedActionLinks,function(b,c){m+=bwChunk.UBase10toN(a.m_listViewedActionLinks[c],2)});b+=bwChunk.CreateChunk(m);f=bwChunk.UBase10toN(b.length);return b=bwChunk.CreateChunk(f)+b};
Storyline.prototype.updateFromCompactData=function(a){var a=new bwChunk(a),b=a.Remainder(),c=bwChunk.UBaseNto10(a.Data());if(b.length!=c)return!1;a=a.NextChunk();c=a.NextChunk();b=new bwChunk(c.Data());c=c.NextChunk();story.restoreVariableResumeData(c.Data());c.Remainder();for(var c=c.NextChunk(),d=0,e=story.getDescendantsByType("Scene");!c.isNothing&&d<e.length;){var f=e[d];f&&(c.IsEmpty()?f.populateDraws():f.restoreFromResumeData(c.Data()));c=c.NextChunk();d++}Interaction.updateScore("from restoreFromResumeChunk");
var g=c;$.each(this.quizzes,function(a,b){var c=g;b.SetResumeData(c.Data());g=c.NextChunk()});$.each(this.timers,function(a,b){var c=g;b.SetResumeData(c.Data());g=c.NextChunk()});for(c=g.Data;0<c.length;){var h=bwChunk.UBaseNto10(c.substr(0,2)),j="";$.each(story.actionLinkIndices,function(a,b){b==h&&(j=a)});this.m_listViewedActionLinks[j]=h;c=c.substr(2)}for(;!b.IsEmpty();){var c=new bwChunk(b.Data()),l=bwChunk.UBaseNto10(c.Data()),m;if(0==l){c=Window.parseResumeChunk(b);if(c.slide)this.startingslide=
c.slide.getFullObjref();player.history=c.history}else{m=null;var k=1;$.each(this.children,function(a,b){"Window"==b.innerType&&(k==l&&(m=b),k++)});if(m&&(c=Window.parseResumeChunk(b),c.slide))c.win=m,this.startingWindowInfo=c}b=b.NextChunk()}for(SlideDraw.populateDraws();!a.EOF();){var n=a.NextUBase10(2),p=null;$.each(story.allSlides,function(a,b){b.slideIndexForResume==n&&(p=b)});if(p)player.restoreViewedState(p),player.frame.slideList.markVisited(p.getFullObjref(!0)),p.variables.Visited=!0}$.each(story.allSlides,
function(a,b){b.compactResumeData&&$.each(b.interactions,function(a,b){b.updateSlideList()})});player.frame.updateMenuData(null,Interaction.slideStatus);Interaction.updateScore(null,"Storyline.prototype.updateFromCompactData");return!0};
Storyline.prototype.toData=function(a){var b=this,c={slideID:player.currentSlide().id,history:player.history};$.each(this.variables,function(a,e){if(e!=b.variableDefaults[a]){if(!c.variables)c.variables={};c.variables[a]=e}});$.each(this.children,function(b,e){if("Slide"!=e.innerType&&e.toData){var f=e.toData(a);if(!jQuery.isEmptyObject(f)){if(!c.children)c.children={};c.children[b]=f}}});return c};Storyline.prototype.updateBaseFromData=Element.prototype.updateFromData;
Storyline.prototype.updateFromData=function(a){try{this.updateBaseFromData(a);if(a.slideID)this.startingslide=a.slideID;if(a.history)player.history=a.history}catch(b){}};
Storyline.prototype.loadFromXML=function(a){var b=this;b.xml=$(a).children();this.scenes=[];this.allSlides=[];this.slideLookup={};this.media=[];this.currentSceneIndex=0;this.children={};this.resumeID=$(a).children().children("resume").attr("id");this.resumeWindow=$(a).children().children("resume").attr("window");this.resumeSlideID=$(a).children().children("resume").attr("slideid");this.resumeLMS="true"==$(a).children().children("resume").attr("lmsresume");this.resumeFlash="true"==$(a).children().children("resume").attr("flashresume");
this.resumePrompt="true"==$(a).children().children("resume").attr("prompt");this.frameWidth=parseInt($(a).children().children("display").attr("width"));this.frameHeight=parseInt($(a).children().children("display").attr("height"));-1<location.search.indexOf("&menu=1")&&(this.frameWidth+=200);$(a).find("display").children("windows").children("window").each(function(a,c){var f=new Window;f.loadFromXML(c,b);f.createRef();b.children[f.id]=f});b.slidemap=[];$(a).children().children("slidemap").children("slideref").each(function(a,
c){var f={};f.id=$(c).attr("id");b.slidemap.push(f)});$(a).children().children("pathlibs").children("pathlib").each(function(a,c){var f=new PathLib;f.loadFromXML(c,b);b.pathlibs[f.id]=f});b.entrypoint=$(a).find("bwContent").attr("entrypoint");b.startingslide=$(a).find("bwContent").attr("entrypoint");b.lessonduration=parseInt($(a).find("bwContent").attr("lessonduration"));var c=$(a).find("scene");b.pendingSceneCount=c.length;c.each(function(c,e){if(1==c)story.startingSlideIndex=story.allSlides.length;
var f=new Scene;f.id=$(e).attr("id");f.lmsid=$(e).attr("lmsid");f.startingslide=$(e).attr("startingslide");f.sceneIndex=c;f.parent=b;f.xml=e;f.loadElementInfoFromXML(e);b.pendingSceneCount=0;$(e).children("slides").children("slide").each(function(a,c){var d=new Slide(b.container);d.loadFromXML($(c));d.parent=f;d.sceneIndex=f.sceneIndex;d.sceneSlideIndex=a;f.slides.push(d);f.children[$(c).attr("id")]=d;b.allSlides.push(d);b.slideLookup[$(c).attr("id")]=d;b.children[d.id]=d;d.slideIndex=b.allSlides.length-
1;d.slideIndexForResume=d.slideIndex+1});$(a).children().children("timers").children("timer").each(function(a,c){var d=new Timer;d.loadFromXML(c,b);b.children[d.id]=d;b.timers[d.id]=d});f.slideDraws=[];var g=0;$(e).children("slidedraws").children("slidedraw").each(function(a,b){var c=new SlideDraw;c.loadFromXML(b);c.parent=f;c.sceneDrawIndex=g;f.children[c.id]=c;f.slideDraws.push(c);g++});f.title="Scene "+c;b.children[f.id]=f});this.loadElementInfoFromXML($(a).children());$(a).children().children("quizzes").children().each(function(a,
c){var f=new Quiz;f.loadFromXML(c,b);b.quizzes[f.id]=f;b.children[f.id]=f});b.scoring=new Scoring;b.scoring.loadFromXML($(a).children().children("scoring"));SlideDraw.NextSlideIndex=this.allSlides.length+1;$(a).children().children("slidebank").each(function(a,c){var f=new SlideBank;f.loadFromXML(c,b);b.children[f.id]=f});b.lastNonDrawSlideIndex=story.allSlides.length;c=b.getStartingSlide();story.startingSlideIndex=c.slideIndex;player.width=c.width;player.height=c.height;player.aspectRatio=c.aspectRatio;
if("SlideDraw"==c.innerType)c=c.getFirstSpecifiedSlide(),player.width=c.width,player.height=c.height,player.aspectRatio=c.aspectRatio;this.actionLinkIndices={};$(a).children().children("actionlinks").children("actionlink").each(function(a,c){var f=new ActionLink;f.loadFromXML(c,b);b.children[f.id]=f;b.actionLinkIndices[f.id]=a});$(a).children().children("slidemap").children("slideref").each(function(a,c){var f=$(c).attr("id"),g=b.parseObjref(f).target,h=!1;$(c).children("assets").children("asset").each(function(a,
c){var d=$(c).attr("url");$(c).attr("mobileurl");var e=$(c).attr("htmlurl"),d=player.basepath+(e?e:d),e="image";switch(d.split(".").pop()){case "swf":d=d.replace(".swf",".png");e="swfImage";break;case "flv":case "mov":case "mp4":case "avi":e="video";Video.createSingleVideoRef();break;case "mp3":e="audio"}switch(e){case "image":e=new Resource(b,d,function(){});if("Slide"==g.innerType)g.pushResource(e),e.src=d;h=!0;break;case "video":e=Video.getStoreReference(g,d);if(!player.firstVideoAssetSrc)player.firstVideoAssetSrc=
e;if(!g.firstVideoAssetSrc)g.firstVideoAssetSrc=e;h=!0;player.isMobile&&Video.addToRefStore(e,d)}});if(!h)g.ready=!0});story.globalAudio={};$(a).children().children("globalaudiolib").children("audio").each(function(a,b){var c=new Audio;c.loadFromXML(b);c.createRef();story.globalAudio[c.id]=c});player.loadingSlide=null};
Storyline.prototype.getStartingSlide=function(a){var b=this.parseObjref(this.startingslide).target;switch(b.innerType){case "Scene":b=this.parseObjref(b.startingslide).target}"SlideDraw"==b.innerType&&a&&(b=b.getFirstSlide());return b};Storyline.prototype.addSlide=function(){};Storyline.prototype.getSlideByID=function(a){for(var b=0;b<story.allSlides.length;b++)if(story.allSlides[b].id==a)return story.allSlides[b];return null};var Window=function(){this.xml="";this.constructElement();this.selected=!1;this.zoomModifier=1;this.history=[]};Window.prototype=new Element;Window.prototype.objectType="Window";Window.prototype.innerType="Window";Window.getWindowResumeData=function(a,b,c){var a=""+bwChunk.CreateChunk(bwChunk.UBase10toN(a)),a=a+Slide.getResumeReference(b),d="";$.each(c,function(a,b){d+=Slide.getResumeReference(story.allSlides[b])});d+=Slide.getResumeReference(b);return a+=bwChunk.CreateChunk(d)};
Window.parseResumeChunk=function(a){var b={},c=new bwChunk(a.Data());a.Skip(c.ChunkData().length);c=Slide.getFromResumeChunk(a);b.slide=c;for(var d=[],a=new bwChunk(a.NextString());!a.EOF();)c=Slide.getFromResumeChunk(a),d.push(c.slideIndex);d.pop();b.history=d;return b};Window.closeAll=function(){$.each(story.children,function(a,b){"Window"==b.innerType&&b.close()})};
Window.prototype.loadFromXML=function(a,b){this.parent=b;this.children={};this.id=$(a).attr("id");this.linkid=$(a).attr("linkid");this.width=parseInt($(a).attr("width"))-2;this.height=parseInt($(a).attr("height"))-2;this.alignto=$(a).attr("alignto");this.align=$(a).attr("align");this.valign=$(a).attr("valign");-1<this.linkid.indexOf("StoryPopup")?(this.width-=6,this.height-=6,this.isPrompt=!1):this.isPrompt=!0;this.originalWidth=this.width;this.originalHeight=this.height;this.hasControls=-1<this.linkid.indexOf("Controls")};
Window.prototype.createRef=function(){if(this.ref)this.ref.remove(),this.ref=null;this.ref=$("<div class='window'><h1>Title</h1><hr><div class='windowContent'></div></div>");this.ref.addClass(this.id);this.contentRef=this.ref.children("div").first();this.titleRef=this.ref.children("h1").first();this.isPrompt&&this.ref.addClass("prompt");this.applySize();this.onBody=!1;$("#slidecontainer").append(this.ref);this.ref.hide();return!0};
Window.prototype.applySize=function(){if(1!=player.frameScale&&!this.isPrompt)this.width=this.originalWidth*player.frameScale,this.height=this.originalHeight*player.frameScale;this.ref.css("width",this.width);this.ref.css("height",this.height);this.ref.css("margin","auto");switch(this.align){case "center":this.ref.css("left","50%");this.ref.css("margin-left",-this.width/2);break;default:console.log("unknown window align",this.align)}switch(this.valign){case "center":this.ref.css("top","50%");this.ref.css("margin-top",
-this.height/2);break;default:console.log("unknown window valign",this.valign)}};
Window.prototype.prepareLightbox=function(){var a=$(".frameInterstitial");0==a.length&&(a=$("<div class='frameInterstitial'></div>"),$(".framewrap").prepend(a));$(document.body).append($(".window.prompt"));if(!this.lightboxPrepared){this.onBody=!0;$(document.body).append(this.ref);this.ref.addClass("lightbox");this.applySize();this.contentRef.css("width",this.width);this.contentRef.css("height",this.height);this.closeIcon=$("<div class='closeicon'><span>x</span></div>");this.closeIcon.css("left",
(0.85*player.width-10)*player.frameScale+"px");this.ref.append(this.closeIcon);var b=this;this.closeIcon.click(function(){b==player.currentWindow&&b.close()});this.lightboxPrepared=!0}};
Window.prototype.prepareControls=function(a){if(!(0<this.ref.find(".contentpane>#controls").length)){this.controls&&this.controls.remove();this.controls=$(".contentpane>#controls").clone(!1);this.controls.css("left","0px");this.ref.append(this.controls);this.progressBar=new ProgressBar(null,this.controls.find("#progressbar"),!0);this.progressBar.onDragUpdate=player.progressBar.onDragUpdate;this.progressBar.zoomModifier=this.zoomModifier;var b=this.controls.find(".submit-slide").parent();b.removeClass("pressed");
b.bind("click",function(){$(this).hasClass("disabled")||$(this).hasClass("locked")||0<$(".modalfence:visible").length||story.handleEvent("onobjectevent","submit_pressed",null,!1,!1,!0)});b=this.controls.find(".label.next").parent();b.removeClass("pressed");b.bind("click",function(){!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","next_pressed",null,!1,!1,!0)});b=this.controls.find(".label.prev").parent();b.removeClass("pressed");b.bind("click",function(){!$(this).hasClass("disabled")&&
!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","prev_pressed",null,!1,!1,!0)});this.controls.find(".finish-slide").parent().bind("click",function(){!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","finish_pressed",null,!1,!1,!0)});this.controls.find(".play").bind("click",function(){player.timelineManager.playActiveTimeline()});this.controls.find(".pause").bind("click",function(){player.timelineManager.pauseActiveTimeline()});this.volumeSlider=
new VolumeSlider(this.controls.find("#control-volume"));this.volumeSlider.onDragUpdate=function(a){$("audio,video").each(function(b,e){e.volume=Math.min(a*player.clipVolume,1)});Audio.setMasterVolume&&Audio.setMasterVolume(a);VolumeSlider.updateVolumeIcon(a)};this.resize(a)}};
Window.prototype.closeLightbox=function(){this.history=[];if(!player.stackedWindow)$(".blocker").hide(),$(".interstitial").hide(),$(".frameInterstitial").hide(),$(".frameInterstitial").removeClass("dark"),$(".interstitial").removeClass("black"),player.showingInterstitial=!1,$("#slidecontainer").append($(".window.prompt"));if(player.currentWindowSlide)player.currentWindowSlide.saveIfNecessary(),player.currentWindowSlide.resetSlide(),player.currentWindowSlide.hide(),player.currentWindowSlide.unloadContent(),
player.currentWindow=null,player.currentWindowSlide=null,player.currentSlide().handleEvent("ontransitionin",null,null,!1,!0)};
Window.prototype.renderBackground=function(){var a={canvas:this.background.get(0),m_nXOffset:0,m_nYOffset:0,m_nWidth:this.width+100,m_nHeight:this.height};ppArt.DrawVector(a,"ZB1$v$vPCZy$f2L$_XA100jfZQA1$3N10OaXIA1ag70FCDY$v00LCYv0000PC_$3w2wPC_$9wn3PC_$9wn3PC_$9wn3PC_$9wn3e20PC_$9wn3PC_$PyDYg40PC_$PyDYPC_$VyYvLCYv_y00FCDY_y00e20FCDY_y009wn3_y00g409wn3_y003w2w_y00$v00VyYv$v00PyDYe20$v00PyDY$v009wn3g40$v009wn300003w2w3w2w$v009wn3$v003t3w00px000000E0505010100w00N10$$$$E0aEg70FC$v$v$vLCt1$v$vPC$v3wx_PC$v9w$vPC$v9w$vPC$v9w$vPC$v9w$ve20PC$v9w$vPC$vPy$vg40PC$vPy$vPC$vVyt1LCt1Zy$vFC$vZy$ve20FC$vZy$v9w$vZy$vg409w$vZy$v3wx_Zy$v$v$vVyt1$v$vPy$ve20$v$vPy$v$v$v9w$vg40$v$v9w$v$v$v3wx_3wx_$v$v9w$v$v$v3E",null,
player.fontlib,null)};Window.prototype.appendSlide=function(a){a.loadContentFromXML();this.slide=a;this.contentRef.empty();this.contentRef.append(a.ref);this.titleRef.html(a.title)};
Window.prototype.resize=function(a){this.contentRef.css("width",this.width);this.contentRef.css("height",this.height);this.applySize();this.closeIcon&&this.closeIcon.css("left",(0.85*player.width-10)*player.frameScale+"px");if((a=a||this.slide)&&this.controls)this.controls.css("left","0px"),this.controls.css("width",a.width-10/player.frameScale),this.controls.css("margin-top",Math.ceil(-33*player.frameScale)+"px"),this.ref.append(this.controls),this.controls.css("-webkit-transform-origin","top left"),
this.controls.css("transform-origin","top left"),this.controls.css("-webkit-transform","translate3d(0px,0px,0px) scale("+0.85*player.frameScale+")"),this.controls.css("transform","translate3d(0px,0px,0px) scale("+0.85*player.frameScale+")"),this.slide&&this.slide.fitToContainer()};
Window.prototype.close=function(){this.slide&&(this.slide.timeline&&this.slide.timeline.pauseTimeline(),this.slide.ref&&this.slide.ref.remove());this.slide=null;this.closeLightbox();this.ref.hide();player.currentWindow=player.stackedWindow;player.currentWindowSlide=player.stackedWindowSlide;player.stackedWindow=null;player.stackedWindowSlide=null;this.setVisible(!1);player.windowZoomModifier=1;player.zoomParams=null;player.timelineManager.retoreAllPausedTimelines(player.pausedListFromWindow);player.pausedListFromWindow=
[];story.saveToLocalStorage()};
Window.prototype.showSlide=function(a,b){var c=this,d=TimelineAction.actparams.cancelled;TimelineAction.actparams._ActTargetSlideId=a.getFullObjref(!0);TimelineAction.actparams._ActTargetWindow=a.variables.WindowId;TimelineAction.actparams._ActTargetSlideNavIndex=a.navindex;TimelineAction.actparams.cancelled=!1;player.currentSlide().handleEvent("onbeforeslidejump",null,null,!1,!0);if(TimelineAction.actparams.cancelled)TimelineAction.actparams.cancelled=d;else{TimelineAction.actparams.cancelled=d;
if(player.currentWindow&&player.currentWindow!=c)player.stackedWindow=player.currentWindow,player.stackedWindowSlide=player.currentWindowSlide;if(-1<c.linkid.indexOf("StoryPopup"))c.isLightbox=!0,c.prepareLightbox();-1<c.linkid.indexOf("Controls")&&c.prepareControls(a);if(-1<c.linkid.indexOf("StoryWindow")){if(!Window.blocker)Window.blocker=$("<div class='blocker'></div>"),$(".contentpane").append(Window.blocker);Window.blocker.show()}a.loadContentFromXML();a.window=this;a.blockAndLoad(function(){player.currentSlide().saveIfNecessary();
player.currentWindowSlide&&(player.currentWindowSlide.saveIfNecessary(),player.currentWindowSlide.resetSlide());player.currentSlide().pause();var d=player.currentWindowSlide;player.currentWindow=c;player.currentWindowSlide=a;c.slide=a;d&&d!=player.stackedWindowSlide&&(d.reduce(),player.hideInactiveSlides(),d.unloadContent());c.ref.show();a.createRef();a.resetSlide(!1,!0);c.appendSlide(a);a.ref.show();a.setVisible(!0);player.timelineManager.addTimeline(a.timeline);a.variables.WindowId=c.id;a.variableDefaults.WindowId=
c.id;player.updateViewCount(a);a.timeline.resetTimeline();a.handleEvent("onbeforeslidein",null,null,!1,!0);if(!b&&player.currentWindow&&player.currentWindowSlide){if(!c.history)c.history=[];c.history.push(player.currentWindowSlide.slideIndex)}c.setVisible(!0);if(c.isLightbox)d=$(".frameInterstitial"),d.addClass("dark"),d.show(),player.showingInterstitial=!0;a.handleEvent("ontransitionin",null,null,!1,!0);a.handleEvent("ontransitionincomplete",null,null,!1,!0);a.handleEvent("onslidestart");a.deepEach(function(a,
b){b.handleEvent&&b.handleEvent("onslidestart",null,null,!1,!0)});a.transitionedIn=!1;player.transitionLightboxSlides=!0;player.transitionLightboxSlides?a.startTransition(null,!0,function(){a.play(!1,!1,!0)}):a.play(!1,!1,!0);if(player.hasShownFirstSlide)player.hasAdvanced=!0;player.hasShownFirstSlide=!0;story.saveToLocalStorage();a.fitToContainer();player.windowZoomModifier=c.zoomModifier;player.automation.notifySlideTransitionIn(a.getFullObjref(),0);player.automation.notifySlideStarted(a.getFullObjref())})}};var ResumePrompt=function(){this.xml="";this.constructElement();this.selected=!1};ResumePrompt.prototype=new Window;ResumePrompt.prototype.objectType="ResumePrompt";ResumePrompt.prototype.innerType="ResumePrompt";
ResumePrompt.prototype.createRef=function(){if(this.ref)return!1;var a=this,b=$("<div class='window dialog'><h1>Resume</h1><p>Would you like to resume where you left off?</p><div class='choose'><span class='button yes'>Yes</span><span class='button no'>No</span></div></div>");this.contentRef=b.children("p").first();this.titleRef=b.children("h1").first();this.suppressRef=$("<div></div>");$(document.body).append(b);this.ref=b;var c=b.find(".yes"),d=b.find(".no");b.find(".button").bind("mousedown touchstart",
function(){$(this).addClass("pressed")});b.find(".button").bind("mouseup touchend mouseout",function(){$(this).removeClass("pressed")});c.bind("click",function(){a.slide.children.btn0.handleEvent("onrelease",null,null,!1,!1,!0);$(".interstitial").removeClass("resume");$(".interstitial").hide();$(".frameInterstitial").hide();player.showingInterstitial=!1});d.bind("click",function(){a.slide.children.btn1.handleEvent("onrelease",null,null,!1,!1,!0);$(".interstitial").removeClass("resume");$(".interstitial").hide();
$(".frameInterstitial").hide();player.showingInterstitial=!1});this.ref.hide();return!0};ResumePrompt.prototype.appendSlide=function(a){this.slide&&this.slide.ref.remove();this.slide=a;this.suppressRef.append(a.ref);this.titleRef.html($(a.title).text());setTimeout(function(){a.ref.find(".item_ResumePromptSlide_Text").text();$(".interstitial").removeClass("black");$(".interstitial").addClass("resume");$(".interstitial").show();player.showingInterstitial=!0},1)};var Scene=function(){this.slides=[];this.slideDraws=[];this.constructElement()};Scene.prototype=new Element;Scene.prototype.objectType="Scene";Scene.prototype.innerType="Scene";
Scene.prototype.restoreFromResumeData=function(a){this.hasVariables()&&(a=new bwChunk(a),this.restoreVariableResumeData(a.Data()),a=a.Remainder());var b=new bwChunk(a),c=this.getDescendantsByType("Slide"),d=[];$.each(c,function(a,b){(b.resume||0<b.interactionCount)&&d.push(b)});for(var e=c=0;!b.isNothing;){if(c>=d.length){var f=this.slideDraws[e];f&&f.restoreFromResumeData(b.Data());e++}else f=d[c],f.compactResumeData=b.ChunkData(),f.restoreFromResumeData(b.ChunkData(),!0);b=b.NextChunk();c++}this.compactResumeData=
bwChunk.CreateChunk(a)};Scene.prototype.getResumeData=function(){var a="";this.hasVariables()&&(a+=this.getVariableResumeData());var b="";$.each(this.children,function(a,c){"SlideDraw"!=c.innerType&&(c.compactResumeData?b+=c.compactResumeData:c.resume&&(b+=bwChunk.EMPTY_CHUNK))});var c="";$.each(this.children,function(a,b){if("SlideDraw"==b.innerType){if(!b.compactResumeData)b.compactResumeData=b.getResumeData();c+=b.compactResumeData||"0"}});b+=c;return bwChunk.CreateChunk(a+b)};
Scene.prototype.getFirstSlide=function(){for(var a=0;a<story.allSlides.length;a++)if(story.allSlides[a].parent.id==this.id)return story.allSlides[a];return this};Scene.prototype.cleanDraws=function(){$.each(this.slideDraws,function(a,b){b.draw=[]})};
Scene.prototype.populateDraws=function(){var a={},b=!1;$.each(this.slideDraws,function(c,d){0==d.draw.length&&(b=b||d.shuffle,d.createDraw(),a[d.getFullObjref(!0)]=d.populateDraw())});SlideDraw.addNavData(a);if(b)this.compactResumeData=this.getResumeData();return a};Scene.prototype.resetDraws=function(){$.each(this.slideDraws,function(a,b){b.resetDraw()})};var Timer=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.content={fontsize:18,font:"Arial"};this.constructElement();this.events=[];this.active=!0;this.startPosition=0;this.startTime=null;this.currentPosition=0;this.running=!1};Timer.prototype=new Element;Timer.prototype.innerType="Timer";Timer.prototype.objectType="Timer";Timer.prototype.toBaseData=Element.prototype.toData;
Timer.prototype.toData=function(a){a=this.toBaseData(a);if(0!=this.currentPosition)a.currentPosition=this.currentPosition;if(this.running)a.running=!0;if(this.visible)a.visible=!0;return a};Timer.prototype.updateBaseFromData=Element.prototype.updateFromData;Timer.prototype.updateFromData=function(a){this.updateBaseFromData(a);if(a.currentPosition)this.currentPosition=a.currentPosition;a.visible&&this.show();a.running&&this.start();if(a.variables&&a.variables.DropTargetId)this.dropArea=this.parent.children[a.variables.DropTargetId]};
Timer.prototype.GetResumeData=function(){var a="",a=this.running?"1":"0";return a+=bwChunk.Base10toN(this.currentPosition)};Timer.prototype.SetResumeData=function(a){var b="1"==a.substr(0,1),a=a.substr(1);this.currentPosition=bwChunk.BaseNto10(a);b?this.start():this.pause()};Timer.prototype.loadFromXML=function(a){this.loadElementInfoFromXML(a);this.id=$(a).attr("id");this.duration=parseInt($(a).attr("duration"))};
Timer.prototype.show=function(){this.setVisible(!0);this.createRef();this.render();this.ref.show()};Timer.prototype.hide=function(){this.setVisible(!1);this.ref.hide()};Timer.prototype.start=function(){var a=this;if(!(this.currentPosition>=this.duration)&&(this.startPosition=this.currentPosition,this.startTime=new Date,this.render(),!this.interval))this.interval=setInterval(function(){a.tick()},100)};Timer.prototype.pause=function(){if(this.interval)clearInterval(this.interval),this.interval=null};
Timer.prototype.tick=function(){this.currentPosition=this.startPosition+(new Date-this.startTime);if(this.currentPosition>this.duration)this.currentPosition=this.duration,this.pause(),this.handleEvent("timercomplete");this.updateText();this.render()};
Timer.prototype.createRef=function(){if(this.ref)return!1;this.ref=$("<div class='timercaption'></div><canvas class='timer' width='20' height='20'></canvas>");this.captionRef=$(this.ref.get(0));this.canvasRef=$(this.ref.get(1));player.isMobileFrame?$(document.body).append(this.ref):$(".framewrap").append(this.ref);this.context=this.canvasRef.get(0).getContext("2d");return!0};
Timer.FormatMS=function(a){var b=Math.floor(a/1E3%60),c=Math.floor(a/1E3/60%60),a=Math.floor(a/1E3/60/60);return 0<a?a+":"+(c+100+"").substr(1)+":"+(b+100+"").substr(1):(c+100+"").substr(1)+":"+(b+100+"").substr(1)};Timer.Format=function(a,b,c,d){switch(c){case "remaining":return Timer.FormatMS(b-a);case "totalelapsed":return d?Timer.FormatMS(b)+" / "+Timer.FormatMS(a):Timer.FormatMS(a)+" / "+Timer.FormatMS(b);case "elapsed":return Timer.FormatMS(a)}return""};
Timer.prototype.updateText=function(){this.captionRef.html(Timer.Format(this.currentPosition,this.duration,player.frame.options.time_format))};
Timer.prototype.render=function(){if(this.context){this.context.clearRect(0,0,20,20);this.context.strokeStyle="#cfcfcf";this.context.fillStyle="#fff";this.context.lineWidth=1;if(!player.isMobileFrame)this.context.strokeStyle=player.frame.colorGroups.timer.stroke.toColorString();this.context.beginPath();this.context.arc(10,10,9.5,0,2*Math.PI,!1);this.context.fill();this.context.stroke();this.context.lineWidth=1;var a=this.context.createLinearGradient(0,0,0,20);a.addColorStop(0,"#039EF4");a.addColorStop(1,
"#0147E6");var b=this.context.createLinearGradient(0,0,0,20);b.addColorStop(0,"#FDE145");b.addColorStop(1,"#E4B202");player.isMobileFrame||(a=player.frame.colorGroups.timer.duration.toCanvasGradient(this.context,20),b=player.frame.colorGroups.timer.elapsed.toCanvasGradient(this.context,20));var c=-Math.PI/2,d=c-2*this.currentPosition/this.duration*Math.PI;this.context.beginPath();this.context.fillStyle=a;this.context.moveTo(10,10);this.context.arc(10,10,8,d,c,!0);this.context.fill();this.context.beginPath();
this.context.fillStyle=b;this.context.moveTo(10,10);this.context.arc(10,10,8,c,d,!0);this.context.closePath();this.context.fill()}};function TimelineManager(){this.TICK_DURATION=33;this.TICK_THRESHOLD=25;this._tickOverrided=player.automation.getTickOverrided();this._startTime=this.getTickTime();this._currentTime=0;this._performanceStartTime=this._startTime;this._performanceTime=0;this._activeTimeline=null;this._runningTimelines=[];this._animations=[];this._deferQueue=[];this._activeTab=!0;this.startTick();this.debugCount=0}
TimelineManager.prototype.startTick=function(){var a=this;window.addEventListener("blur",function(){a.onBlur()});window.addEventListener("focus",function(){a.onFocus()});this.requestAnimationFrame(function(){a.tick()})};TimelineManager.prototype.onBlur=function(){this._activeTab=!1};TimelineManager.prototype.onFocus=function(){if(!this._activeTab)this._activeTab=!0};TimelineManager.prototype.getTickTime=function(){return new Date};
TimelineManager.prototype.tick=function(){player.frameCount++;this.requestAnimationFrame(function(){a.tick()});var a=this,b=this.getTickTime(),c=b-this._startTime;this._performanceTime=b-this._performanceStartTime;if(!(c-this._currentTime<this.TICK_THRESHOLD)||this._tickOverrided)if(player.blocked)this._startTime=b-this._currentTime;else{if(c-this._currentTime>4*this.TICK_DURATION&&!this._tickOverrided)c=this._currentTime+this.TICK_DURATION,this._startTime=b-c;this._currentTime=c;this.performMaintenance();
for(b=0;b<this._animations.length;b++)this._animations[b].step();c=this._runningTimelines.slice(0);for(b=0;b<c.length;b++)c[b].tick()}};TimelineManager.prototype.defer=function(a){this._deferQueue.push(a)};TimelineManager.prototype.processDeferQueue=function(){for(;0<this._deferQueue.length;){var a=this._deferQueue.shift();"function"===typeof a&&a.call(this)}};
TimelineManager.prototype.performMaintenance=function(){DragItem.currentItem&&DragItem.currentEvent&&DragItem.currentItem.updateDragDelayed();player.deferredMoveEvent&&player.handleDeferredMove();this.processDeferQueue();player.frame.tickPresentationTimer();player.updateControlTime()};TimelineManager.prototype.addTimeline=function(a){a instanceof Timeline?0>this._runningTimelines.indexOf(a)&&this._runningTimelines.push(a):console.error("Not a Timeline Object")};
TimelineManager.prototype.removeTimeline=function(a){a=this._runningTimelines.indexOf(a);0<=a&&this._runningTimelines.splice(a,1)};TimelineManager.prototype.setActiveTimeline=function(a){0>this._runningTimelines.indexOf(a)&&this.addTimeline(a);this._activeTimeline=a};TimelineManager.prototype.getActiveTimelineSlide=function(){var a=null;if(null!=this._activeTimeline&&(a=this._activeTimeline._timelineOwner)&&a.slide)a=a.slide;return a};
TimelineManager.prototype.getActiveTimelineOwner=function(){var a=null;if(null!=this._activeTimeline)a=this._activeTimeline._timelineOwner;return a};TimelineManager.prototype.getIsActiveTimelinePlaying=function(){return this._activeTimeline?this._activeTimeline.getIsPlaying():!1};TimelineManager.prototype.getIsAnyTimelinePlaying=function(){for(var a=0;a<this._runningTimelines.length;a++)if(this._runningTimelines[a]._playing)return!0;return!1};
TimelineManager.prototype.getIsActiveTimelineComplete=function(){return this._activeTimeline?this._activeTimeline.getIsTimelineComplete():!1};TimelineManager.prototype.getActiveTimelineDuration=function(){return this._activeTimeline?this._activeTimeline.duration:1};TimelineManager.prototype.getActiveTimelineCurrentTime=function(){return this._activeTimeline?this._activeTimeline.getCurrentTime():0};
TimelineManager.prototype.pauseAllTimelines=function(a){for(var a=a||[],b=0;b<this._runningTimelines.length;b++){var c=this._runningTimelines[b];c._playing&&(a.push(c),c.pauseTimeline())}player.updateControls();return a};TimelineManager.prototype.retoreAllPausedTimelines=function(a){if(a&&0!=a.length){for(var b=0;b<this._runningTimelines.length;b++){var c=this._runningTimelines[b];-1<a.indexOf(c)&&c.playTimeline()}player.updateControls()}};
TimelineManager.prototype.playAllTimelines=function(){for(var a=0;a<this._runningTimelines.length;a++)this._runningTimelines[a].playTimeline();player.updateControls()};TimelineManager.prototype.pauseActiveTimeline=function(){this._activeTimeline&&this._activeTimeline.pauseTimeline()};TimelineManager.prototype.playActiveTimeline=function(){this._activeTimeline&&this._activeTimeline.playTimeline()};TimelineManager.prototype.seekActiveTimeline=function(a){this._activeTimeline&&this._activeTimeline.seekTimeline(a)};
TimelineManager.prototype.replayActiveTimeline=function(){this._activeTimeline&&this._activeTimeline.replayTimeline(position)};TimelineManager.prototype.addAnimation=function(a){0>this._animations.indexOf(a)&&this._animations.push(a);a.step()};TimelineManager.prototype.removeAnimation=function(a){a=this._animations.indexOf(a);0<=a&&this._animations.splice(a,1)};TimelineManager.prototype.getCurrentTime=function(){return this._currentTime};
TimelineManager.prototype.requestAnimationFrame=window.requestAnimationFrame?function(a){window.requestAnimationFrame(a)}:window.webkitRequestAnimationFrame?function(a){window.webkitRequestAnimationFrame(a)}:window.mozRequestAnimationFrame?function(a){window.mozRequestAnimationFrame(a)}:window.oRequestAnimationFrame?function(a){window.oRequestAnimationFrame(a)}:window.msRequestAnimationFrame?function(a){window.msRequestAnimationFrame(a)}:function(a){window.setTimeout(a,this.TICK_DURATION)};function AutomationInterface(){this.enabled=-1<location.search.indexOf("&automation=");this.tickOverrided=-1<location.search.indexOf("&overrideclock=");this.currentTime=0;this.initInterface()}
AutomationInterface.prototype.initInterface=function(){if(this.enabled){var a=this;player.UpdateAutomationTime=function(b){a.updateTimeAndTick(b)};player.TriggerNextSlide=function(){story.handleEvent("onobjectevent","next_pressed",null,!1,!1,!0)};player.GetTargetDuration=function(b){return a.getTargetDuration(b)};if(this.tickOverrided)TimelineManager.prototype.requestAnimationFrame=function(){},TimelineManager.prototype.getTickTime=function(){return player.automation.getTickTime()}}};
AutomationInterface.prototype.getIsEnabled=function(){return this.enabled};AutomationInterface.prototype.getTickOverrided=function(){return this.tickOverrided&&this.enabled};AutomationInterface.prototype.getTickTime=function(){return this.currentTime};AutomationInterface.prototype.notifyAutomationReady=function(){this.enabled&&AutomationReady&&"function"===typeof AutomationReady&&AutomationReady()};
AutomationInterface.prototype.notifySlideTransitionIn=function(a,b){this.enabled&&OnSlideTransition&&"function"===typeof OnSlideTransition&&OnSlideTransition(a,b)};AutomationInterface.prototype.notifySlideStarted=function(a){this.enabled&&OnSlideStarted&&"function"===typeof OnSlideStarted&&OnSlideStarted(a)};AutomationInterface.prototype.notifyResumeUpdated=function(a){this.enabled&&ResumeUpdated&&"function"===typeof ResumeUpdated&&ResumeUpdated(a)};
AutomationInterface.prototype.updateTimeAndTick=function(a){if(this.enabled&&this.tickOverrided)this.currentTime=a,player.timelineManager.tick()};AutomationInterface.prototype.getTargetDuration=function(a){return(a=story.parseObjref(a).target)&&a.timeline?a.timeline.duration:0};var EventInfo=function(a,b,c,d){this.type=a;this.time=b;this.timeline=c;this.isUserInitiated=d};var Timeline=function(a,b){this._index=Timeline.NextIndex++;this._startTime=0;this._playing=!1;this._currentIndex=this._actionPausedTime=this._resumeTime=this._pausedTime=0;this._loaded=this._timelineComplete=!1;this._timelineEvents=[];this._timelineAnimations=[];this._actionAnimations=[];this._timelineOwner=a;this.duration=1;b&&this.loadFromXML(b)};Timeline.NextIndex=0;
Timeline.prototype.loadFromXML=function(a){if(!this._loaded){this._timelineEvents=[];var b=this;$(a).children("timeline").each(function(a,d){b.duration=parseInt($(d).attr("duration"));$(d).find("event").each(function(a,c){b._timelineEvents.push(new TimelineEvent(b,b._timelineOwner,c))})});this._loaded=!0}};
Timeline.prototype.tick=function(){if(this._playing){for(var a=this.getCurrentTime(),b=this._currentIndex,c=this._currentIndex;b<this._timelineEvents.length&&this._timelineEvents[b].eventInfo.time<=a;)this._timelineEvents[b].triggerEvent(),b++;if(c==this._currentIndex)this._currentIndex=b;for(b=this._timelineAnimations.length-1;0<=b;b--)this._timelineAnimations[b].step();if(a>=this.duration)this.triggerTimelineComplete();else if(this._timelineComplete)this._timelineComplete=!1,this.getIsActiveTimeline()&&
player.updateControls()}for(b=this._actionAnimations.length-1;0<=b;b--)this._actionAnimations[b].paused||this._actionAnimations[b].step()};Timeline.prototype.triggerTimelineComplete=function(){if(!this._timelineComplete)this._timelineComplete=!0,this.getIsActiveTimeline()&&player.updateControls(),this._timelineOwner.triggerTimelineComplete()};Timeline.prototype.getIsTimelineComplete=function(){return this._timelineComplete};Timeline.prototype.setResumeTime=function(a){this._resumeTime=a};
Timeline.prototype.initDisplay=function(){this._playing=!1;this._pausedTime=this._resumeTime;this._resumeTime=0;this.seekTimeline(this._pausedTime)};Timeline.prototype.getIsActiveTimeline=function(){return player.timelineManager._activeTimeline==this};Timeline.prototype.getIsPlaying=function(){return this._playing};Timeline.prototype.getCurrentTime=function(a){return a?player.timelineManager.getCurrentTime():this._playing?player.timelineManager.getCurrentTime()-this._startTime:currentTime=this._pausedTime};
Timeline.prototype.resetTimeline=function(){this._playing=!1;this._currentIndex=0;this._timelineAnimations=[]};Timeline.prototype.pauseTimeline=function(){if(this._playing){this._playing=!1;this._actionPauseTime=this._pausedTime=player.timelineManager.getCurrentTime()-this._startTime;for(var a=0;a<this._actionAnimations.length;a++)this._actionAnimations[a].suspendActionAnimation();this._timelineOwner.notifyTimelinePaused()}this.getIsActiveTimeline()&&player.updateControls()};
Timeline.prototype.playTimeline=function(){if(!this._playing)this._playing=!0,this._startTime=player.timelineManager.getCurrentTime()-this._pausedTime,this._timelineOwner.notifyTimelinePlayed();for(var a=0;a<this._actionAnimations.length;a++)this._actionAnimations[a].resumeActionAnimation();this.getIsActiveTimeline()&&player.updateControls()};
Timeline.prototype.seekTimeline=function(a){for(0>a&&(a=0);0<this._currentIndex;)this._currentIndex--,this._timelineEvents[this._currentIndex].revert(a<=this._timelineEvents[this._currentIndex].eventInfo.time);this._startTime=player.timelineManager.getCurrentTime()-a;for(this._pausedTime=a;this._currentIndex<this._timelineEvents.length&&this._timelineEvents[this._currentIndex].eventInfo.time<=a;)this._timelineEvents[this._currentIndex].triggerEvent(!0),this._currentIndex++;for(a=this._timelineAnimations.length-
1;0<=a;a--)this._timelineAnimations[a].step()};Timeline.prototype.replayTimeline=function(){};Timeline.prototype.addAnimation=function(a){a.userInitiated?0>this._actionAnimations.indexOf(a)&&this._actionAnimations.push(a):0>this._timelineAnimations.indexOf(a)&&this._timelineAnimations.push(a);a.step()};
Timeline.prototype.removeAnimation=function(a){a.userInitiated?(a=this._actionAnimations.indexOf(a),0<=a&&this._actionAnimations.splice(a,1)):(a=this._timelineAnimations.indexOf(a),0<=a&&this._timelineAnimations.splice(a,1))};
Timeline.prototype.destroyRef=function(){player.timelineManager.removeTimeline(this);for(var a=0;a<this._timelineEvents.length;a++)this._timelineEvents[a].destroy();for(a=0;a<this._timelineAnimations.length;a++)this._timelineAnimations[a].destroy();this._timelineEvents=[];this._timelineAnimations=[];this._loaded=!1};var Slide=function(a){this.container=a||$(document.body);this.ref=null;this.title="Untitled Slide";this.slideBank=this.quiz=this.transition=null;this.layers={};this.clips=[];this.resources=[];this.interactions={};this.responses={};this.navLinks=[];this.layerStack=[];this.framedSlides={};this.renderBgLoadStack=[];this.resetLists();this.loadedChunkXML=this.backgroundReady=this.ready=!1;this.zeroTime=this.slideIndex=0;this.duration=5E3;this.active=!0;this.width=720;this.height=540;this.fitScale=this.scale=
1;this.topZ=5;this.timeline=new Timeline(this);this.constructElement();this.variables.Visited=!1;this.audioInitialized=this.fullyLoaded=this.variableDefaults.Visited=!1};Slide.prototype=new Element;Slide.prototype.objectType="Slide";Slide.prototype.innerType="Slide";
Slide.getResumeReference=function(a){var b;null==a?b=9:(b=""+(a.slideBank?"1":"0"),a.slideBank?(b+=bwChunk.CreateChunk(bwChunk.UBase10toN(a.drawSlideIndex)),b+=bwChunk.CreateChunk(bwChunk.UBase10toN(a.sceneIndex)),b+=bwChunk.CreateChunk(bwChunk.UBase10toN(a.drawIndex))):(b+=bwChunk.CreateChunk(bwChunk.UBase10toN(a.sceneSlideIndex)),b+=bwChunk.CreateChunk(bwChunk.UBase10toN(a.sceneIndex))));return b};
Slide.getFromResumeChunk=function(a){if("1"==a.NextString(1))var b=a.NextChunkedUBase10(),c=a.NextChunkedUBase10(),a=a.NextChunkedUBase10(),c=story.getDescendantsByType("Scene")[c],b=c.getDescendantsByType("SlideDraw")[a].orderedChildren[b];else b=a.NextChunkedUBase10(),c=a.NextChunkedUBase10(),c=story.getDescendantsByType("Scene")[c],b=c.slides[b];return b};
Slide.prototype.getNavPack=function(){return{slideid:this.getFullObjref(!0),transcriptid:this.getFullObjref(!1),title:this.title,slidelock:this.slidelock,simplenavigation:this.hasSimpleNavigation,showinmenu:this.showinmenu}};
Slide.prototype.restoreFromResumeData=function(a,b){!this.fullyLoaded&&!b&&(this.loadContentFromXML(b),b=!0);var c=new bwChunk(a),c=new bwChunk(c.Data()),d=new bwChunk(c.Data());$.each(this.interactions,function(a,b){b.restoreFromResumeChunk(d);d=d.NextChunk()});if(!b){var e=[];this.deepEach(function(a,b){b.resume&&"ShuffleGroup"!=b.innerType&&e.push(b)},function(a){return"Layer"==a.innerType?!1:!0});c=c.NextChunk();this.timeline.setResumeTime(bwChunk.BaseNto10(c.Data(),c.Length()));for(var c=c.NextChunk(),
f=new bwChunk(c.Data()),g=0;!f.isNothing;){var h=e[g];h&&h.restoreFromResumeData(f.ChunkData());f=f.NextChunk();g++}var j=[];$.each(this.children,function(a,b){"Layer"==b.innerType&&j.push(b)});g=c.NextChunk();h=new bwChunk(g.Data());for(c=0;!h.isNothing;)f=j[c],f.restoreFromResumeData(h.Data()),h=h.NextChunk(),c++,f.reset(),f.hide();g=g.NextChunk();for(h=new bwChunk(g.Data());!h.isNothing;)c=h.NextUBase10(),f=j[c],f.slide==player.currentSlide()?f.show():(f.setVisible(!0),f.setOnStage(!0)),h=h.NextChunk();
var c=g.NextChunk(),l=c.Data();this.clips.forEach(function(a){if("audio"==a.innerType){var b=new bwChunk(l);a.SetResumeData(b.Data());l=b.Remainder()}});this.restoreVariableResumeData(c.NextChunk().Data())}};
Slide.prototype.getResumeData=function(){var a="";if(this.variables.Visited)if(this.resume){var b="",c="",d="",e="",a="";this.deepEach(function(a,c){c.resume&&"ShuffleGroup"!=c.innerType&&(b+=bwChunk.CreateChunk(c.GetResumeData()))},function(a){return"Layer"==a.innerType?!1:!0});this.clips.forEach(function(a){"audio"==a.innerType&&(e+=bwChunk.CreateChunk(a.GetResumeData()))});var a=this.buildInteractionResumeData(),a=bwChunk.CreateChunk(a),f=bwChunk.Base10toN(this.timeline.getCurrentTime()),a=a+bwChunk.CreateChunk(f),
a=a+bwChunk.CreateChunk(b),g=[];$.each(this.children,function(a,b){"Layer"==b.innerType&&(b.visible&&g.push(b),b.resume&&(c+=bwChunk.CreateChunk(b.getResumeData())))});a+=bwChunk.CreateChunk(c);$.each(g,function(a,b){var c=b.getItemIndex();d+=bwChunk.CreateChunk(bwChunk.Base10toN(c))});a+=bwChunk.CreateChunk(d);a+=bwChunk.CreateChunk(e);this.hasVariables()&&(a+=this.getVariableResumeData());a=bwChunk.CreateChunk(a)}else 0<this.interactionCount&&(a=this.buildInteractionResumeData(),a=bwChunk.CreateChunk(a));
return a};Slide.prototype.buildInteractionResumeData=function(){var a="";$.each(this.interactions,function(b,c){a+=bwChunk.CreateChunk(c.GetResumeData())});return a};Slide.prototype.rebuildInteractionData=function(){var a="";this.compactResumeData&&(a=new bwChunk(this.compactResumeData),a=(new bwChunk(a.Data())).Remainder());var b="",c="";$.each(this.interactions,function(a,b){c+=bwChunk.CreateChunk(b.GetResumeData())});b+=bwChunk.CreateChunk(c);this.compactResumeData=bwChunk.CreateChunk(b+a)};
Slide.prototype.toBaseData=Element.prototype.toData;Slide.prototype.toData=function(a){if(a&&this.resumeData){if(this.variables.Visited){if(!this.resumeData.variables)this.resumeData.variables={};this.resumeData.variables.Visited=!0}return this.resumeData}var b=this.toBaseData(a);$.each(this.interactions,function(a,d){var e=d.toData();if(!jQuery.isEmptyObject(e)){if(!b.interactions)b.interactions={};b.interactions[a]=e}});return b};Slide.prototype.updateBaseFromData=Element.prototype.updateFromData;
Slide.prototype.updateFromData=function(a){this.updateBaseFromData(a);this.variables.Visited&&player.frame.slideList.markVisited(this.getFullObjref(!0));if(!this.resumeData)this.resumeData=a};
Slide.prototype.loadFromXML=function(a){var b=this;this.width=parseInt($(a).attr("width"));this.height=parseInt($(a).attr("height"));this.aspectRatio=this.width/this.height;this.id=$(a).attr("id");this.title=$(a).attr("title");this.html5url=$(a).attr("html5url");this.dataurl=$(a).attr("dataurl");this.trackviews="true"==$(a).attr("trackviews");this.resume="true"==$(a).attr("resume");this.enableseek="true"==$(a).attr("enableseek");this.enablereplay="true"==$(a).attr("enablereplay");this.slidelock="true"==
$(a).attr("slidelock");this.showmenuresulticon="true"==$(a).attr("showmenuresulticon");this.starttime=parseInt($(a).attr("starttime"));this.elapsedtimemode=$(a).attr("elapsedtimemode");this.navindex=parseInt($(a).attr("navindex"));this.viewgroupid=$(a).attr("viewgroupid");this.historygroupid=$(a).attr("historygroupid");if(!this.viewgroupid)this.viewgroupid=this.id;if(!this.historygroupid)this.historygroupid=this.id;this.globalaudioid=$(a).attr("globalaudioid");this.showanimationid=$(a).attr("showanimationid");
this.xml=a;if(this.loadedChunkXML=null==this.html5url)this.loadAudioFromXML(),this.loadBackgroundFromXML(),this.loadElementInfoFromXML(a);b.interactionCount=0;$(a).children("interactions").children("interaction").each(function(a,d){var e=new Interaction;e.loadFromXML(d,b);b.interactions[e.id]=e;b.children[e.id]=e;b.interactionCount++});this.transition=new Transition(this);player.preload&&this.loadContentFromXML();b.variables.WindowId="_frame";b.variableDefaults.WindowId="_frame"};
Slide.prototype.loadAudioFromXML=function(){var a=this;if(!this.audioInitialized)this.audioInitialized=!0,$(this.xml).children("audiolib").children("audio").each(function(b,c){var d=new Audio;d.loadFromXML(c,a,a.slide,a.layer);d.createRef();a.children[d.id]=d})};
Slide.prototype.loadBackgroundFromXML=function(){var a=this,b=$(a.xml).children("background"),c=$(a.xml).children("slidewindowbg"),d=b.length+c.length;if(0==d)a.backgroundReady=!0;else{var e=function(b,c,e){var j=new Background(c);j.loadFromXML(b);b=new StageItem;if(j.src)b.content={src:j.src},b.resource=new Resource(b,j.src,function(){a.slideBgImage=this.poolImage;if(0>=--d)a.backgroundReady=!0;e&&e()}),b.resource.testIndex=b.resources.length,a.pushResource(b.resource);else if(0>=--d)a.backgroundReady=
!0;c&&j.apply(c);return j};b.each(function(b,c){a.background=e(c,a.ref,function(){for(var b=0;b<a.renderBgLoadStack.length;b++)a.renderBgLoadStack[b].renderOnUpdate();a.renderBgLoadStack=[]})});c.each(function(b,c){a.windowBackground=e(c,null)})}};
Slide.prototype.blockAndLoad=function(a){var b=this;this.loadCallbackStack?this.loadCallbackStack.push(a):this.loadCallbackStack=[a];var c=function(){player.shouldShowLoadingSpinner=!1;for(player.hideLoadingSpinner();b.loadCallbackStack.length;)b.loadCallbackStack.pop()();player.actionQueuePaused=!1};player.actionQueuePaused=!0;if(b.ready&&b.backgroundReady&&b.loadedChunkXML)c();else{clearTimeout(b.readyWaitTimeout);b.readyWaitTimeout=null;var d=function(){b.ready&&b.backgroundReady&&b.loadedChunkXML?
c():b.readyWaitTimeout=setTimeout(d,100)};b.forceIntegrateXML=!0;player.slideLoadQueue&&0!=b.slideIndex&&player.slideLoadQueue.promote(b.slideIndex);player.shouldShowLoadingSpinner=!0;player.loadingSpinnerTimeout=setTimeout(function(){player.shouldShowLoadingSpinner&&(player.showLoadingSpinner(),b.restorePlayerControls())},1E3);d()}};Slide.prototype.restorePlayerControls=function(){};
Slide.prototype.loadContentFromXML=function(a){var b=this;if(this.loadedChunkXML){if(!this.fullyLoaded){this.fullyLoaded=!0;var c=b.xml;this.presenterref=$(c).children("presenterref").attr("id");this.presenterVideoUrl=$(c).children("presenterref").children("videodata").attr("url");this.presenterVideoWidth=parseInt($(c).children("presenterref").children("videodata").attr("width"));this.presenterVideoHeight=parseInt($(c).children("presenterref").children("videodata").attr("height"));a||this.loadAudioFromXML();
this.loadChildrenFromXML(c,b,null,null);this.timeline.loadFromXML(c);this.loadEventsFromXML(c);$(c).children("slidelayers").children("slidelayer").each(function(a,c){var f=new Layer(b.ref,b);f.loadFromXML(c);b.layers[f.id]=f;b.children[$(c).attr("id")]=f});this.resetSlide()}}else if(!this.loadingChunkXML)this.loadingChunkXML=!0,this.loadChunkXML(!0)};
Slide.prototype.integrateChunkXML=function(a,b){var c=this;!c.forceIntegrateXML&&(Audio.currentlyDecoding||Slide.currentlyIntegrating)?setTimeout(function(){c.integrateChunkXML(a,b)},100):(Slide.currentlyIntegrating=!0,$(a).children("slide").children().each(function(a,b){"slidewindowbg"!=b.tagName&&$(c.xml).append($(b))}),this.loadedChunkXML=!0,b&&(this.loadAudioFromXML(),this.loadElementInfoFromXML(c.xml),this.loadContentFromXML(),this.loadBackgroundFromXML(),this.loadAnimationsFromXML(c.xml),this.transition.loadFromXML(c.xml,
c),this.detectSimpleNavigation(),player.loadResourcesForSlide(c)),Slide.currentlyIntegrating=!1)};
Slide.prototype.loadChunkXML=function(a){var b=this;window.SlideXMLData=function(c,d){if("string"==typeof d){d=d.replace(/[\u000a\u000b\u000c\u000d\u0085\u2028\u2029]/g,"");d=d.replace(/&#x[0-8bcef];/ig,"");-1<location.search.indexOf("dumpxml=1")&&console.log(d);var g;window.ActiveXObject?(g=new ActiveXObject("Microsoft.XMLDOM"),g.loadXML(d)):g=(new DOMParser).parseFromString(d,"text/xml");d=g}b.id!=c?story.getSlideByID(c).integrateChunkXML(d,a):b.integrateChunkXML(d,a)};if(player.loadFromScript){var c=
document.getElementsByTagName("head")[0],d=document.createElement("script");d.type="text/javascript";d.src=player.basepath+b.html5url;c.appendChild(d)}else $.ajax({url:player.basepath+b.dataurl.replace(".swf",".xml"),dataType:"xml",success:function(c){b.integrateChunkXML(c,a)},error:function(){return!1}})};
Slide.prototype.detectSimpleNavigation=function(){var a=this;this.hasSimpleNavigation=!0;var b=$(this.xml).children("actiongroups").children('actiongroup[id="ActGrpOnNextButtonClick"]');if(0==b.length)this.hasSimpleNavigation=!1;b.each(function(b,d){var e=$(d).children("actions").children(),f=$(d).children("actions").children("gotoplay");if(1!=e.length||1!=f.length)a.hasSimpleNavigation=!1});b=function(b){b=$(a.xml).children("events").children(b);return 1==b.children().length&&1==b.children("exe_actiongroup").length};
a.hasSimpleNavigation=a.hasSimpleNavigation&&b("onnextslide")&&b("onprevslide")};Slide.prototype.canUnloadContent=function(){$(this.xml).find("hittestpoint");return 0==$(this.xml).find("hittestpoint").length};
Slide.prototype.unloadContent=function(){if(this.fullyLoaded&&!player.preload){this.fullyLoaded=!1;this.timeline.resetTimeline();var a=this,b=0,c=0;$.each(this.layers,function(a,b){b.emptyLayer()});var d=[];this.deepEach(function(a,b){"Slide"==b.innerType&&b.unloadContent();d.push(b)},function(a){return"audio"!=a.innerType&&"Interaction"!=a.innerType});$.each(d,function(a,c){c.emptyElement();b++});var e={};$.each(this.children,function(a,b){"audio"!=b.innerType&&"Interaction"!=b.innerType&&(e[a]=
b)});$.each(e,function(b){delete a.children[b];c++});$(this.ref).find(".webobject").each(function(a,b){b.src="";$(b).remove()});this.timeline&&this.timeline.destroyRef()}};Slide.prototype.pushResource=function(a){for(var b=0;b<this.resources.length;b++)if(this.resources[b].src==a.src)return;this.resources.push(a)};Slide.runningIndex=0;
Slide.prototype.createRef=function(a){if(!this.ref)this.container=a||$("#slidecontainer"),this.ref="follow"==player.swipeMode?$('<div class="slide transitionable swipable"></div>'):$('<div class="slide transitionable"></div>'),this.ref.css("display","none"),this.ref.attr("runningindex",Slide.runningIndex++),this.background&&this.background.apply(this.ref),this.ref.get(0).id="slide_"+this.id,this.ref.get(0).item=this,this.fitToContainer(),$.each(this.children,function(a,c){c.createRef&&c.createRef()}),
this.populateLists(),this.container.append(this.ref),this.ref.css("width",this.width+"px"),this.ref.css("height",this.height+"px"),player.reorient(!0)};
Slide.prototype.fitToContainer=function(){var a=player.frame.availableSlideWidth,b=player.frame.availableSlideHeight;if(player.currentWindow&&player.currentWindowSlide==this)a=player.currentWindow.width,b=player.currentWindow.height,!player.currentWindow.isPrompt&&player.currentWindow.hasControls&&(b=player.currentWindow.height-40*player.frameScale);else if(player.currentFramedSlide==this||this.offsetParent&&"SlideFrame"==this.offsetParent.innerType)a=this.offsetParent.width,b=this.offsetParent.height;
this.scale=1;if((this.width>a||this.height>b)&&(!this.offsetParent||"SlideFrame"!=this.offsetParent.innerType||this.offsetParent.scalecontents)){var c=a/this.width,d=b/this.height;this.scale=Math.min(c,d)}else if(this.width<a||this.height<b)c=a/this.width,d=b/this.height,this.scale=Math.min(c,d);if(player.currentWindowSlide==this)player.currentWindow.zoomModifier=1;if(0.02>Math.abs(this.scale-1))this.scale=1;if(player.forceSlideScale)this.scale=player.forceSlideScale;this.y=this.x=0;if(this.width*
this.scale<a)this.x=parseInt((a-this.width*this.scale)/2);if(this.height*this.scale<b)this.y=parseInt((b-this.height*this.scale)/2);this.fitScale=this.scale;this.applySize(this.ref);this.updateMatrixComplete(!0)};Slide.prototype.reduce=function(){$.each(this.children,function(a,b){b.reduce&&b.reduce()});if(this.canvas)this.canvas.width=1,this.canvas.height=1};
Slide.prototype.destroyRef=function(){this.timeline.pauseTimeline();if(player.currentFramedSlide==this)player.currentFramedSlide=null;for(var a in this.children){var b=this.children[a];b.destroyRef&&(b.destroyRef(),delete this.children[a])}this.audioInitialized=!1;if(this.ref)this.ref.remove(),this.ref=null;this.presenter=null;this.clips=[];this.eventSubscribers=[];this.layers={};this.resources=[];this.layerStack=[];this.timeline.destroyRef();this.eventsInitialized=!1;this.events=[];this.resetLists()};
Slide.prototype.findClip=function(a){var b=$.grep(this.clips,function(b){return b.id==a});return 0<b.length?b[0]:null};
Slide.prototype.addToLayerStack=function(a){var b=this.layerStack.indexOf(a);0<this.layerStack.length&&b==this.layerStack.length-1||(0<=b&&this.layerStack.splice(b,1),this.layerStack.push(a),1<this.layerStack.length?(this.layerStack[this.layerStack.length-2].restoreBaseObjects(),this.layerStack[this.layerStack.length-2].handleEvent("endtopmostlayer")):this.handleEvent("endtopmostlayer"));a.pauseparent&&this.timeline.pauseTimeline();a.hideBaseObjects();a.handleEvent("ontopmostlayer")};
Slide.prototype.removeFromLayerStack=function(a){var b=this.layerStack.indexOf(a);if(0<=b){var c=b==this.layerStack.length-1;this.layerStack.splice(b,1);c&&(a.restoreBaseObjects(),a.handleEvent("endtopmostlayer"),0<this.layerStack.length?(a=this.layerStack[this.layerStack.length-1],a.hideBaseObjects(),a.handleEvent("ontopmostlayer")):this.handleEvent("ontopmostlayer"))}a=!0;for(b=0;b<this.layerStack.length;b++)if(this.layerStack[b].pauseparent){a=!1;break}a&&this.timeline.playTimeline()};
Slide.prototype.topMostLayer=function(){return 0<this.layerStack.length?this.layerStack[this.layerStack.length-1]:this};
Slide.prototype.saveIfNecessary=function(){$.each(this.interactions,function(a,b){if(!b.variables.Status||"incomplete"==b.variables.Status||"unanswered"==b.variables.Status)b.evaluate(!0,!0,!0),b.variables.Status||(b.variables.Status="unanswered")});if(this.resume||0<this.interactionCount)player.useCompactResume?this.compactResumeData=this.getResumeData():this.resumeData=this.toData(),this.parent.compactResumeData=this.parent.getResumeData()};
Slide.prototype.populateLists=function(){var a=this;a.resetLists();a.deepEach(function(b,c){c.isDragItem&&a.dragItems.push(c);if(c.isDropArea||c.announceDragOver)a.dragDropAndOver.push(c),c.isDropArea&&a.dropAreas.push(c);"ExpandingLabel"==c.innerType&&a.expandingLabels.push(c)},function(a){return"Slide"!=a.innerType})};Slide.prototype.resetLists=function(){this.dragItems=[];this.dropAreas=[];this.dragDropAndOver=[];this.expandingLabels=[]};
Slide.prototype.replaySlide=function(a){if(!this.resume||a)this.resetSlide(!0,a),this.timeline.pauseTimeline(),this.timeline.seekTimeline(0),this.timeline.playTimeline(),this.handleTransitionIn()};
Slide.prototype.resetSlide=function(a,b){this.currentOver=!1;this.resume&&!a?(this.reset(),player.useCompactResume&&this.compactResumeData?this.restoreFromResumeData(this.compactResumeData):this.resumeData&&this.updateFromData(this.resumeData)):(this.deepEach(function(b,d){d.quickHide&&d.quickHide();d.reset(a)},function(c){return"Layer"==c.innerType&&c.resume?a:"Interaction"==c.innerType?b:!0}),this.compactResumeData="",this.reset(a),this.transitionedIn=!1)};Slide.prototype.resetElement=Element.prototype.reset;
Slide.prototype.reset=function(a){this.resetElement(a);this.deepEach(function(a,c){"Interaction"!=c.innerType&&c.reset()})};Slide.prototype.resetInteractions=function(){this.resume||$.each(this.interactions,function(a,b){b.reset()})};Slide.prototype.getTimeline=function(){return player.timelineManager};
Slide.prototype.show=function(a,b,c){this.variables.WindowId="_frame";var d=this;this.createRef(this.container);this.resetSlide(!1,!0);player.modalLayer=null;this.setVisible(!0);$.each(d.layers,function(a,b){b.visible||b.hide()});$(".slide").removeClass("out");$(".slide.in").addClass("out");$(".slide").removeClass("in");d.ref.addClass("in");$(".slide:not(.in,.out,.framed)").css("display","none");d.ref.css("display","block");d.handleEvent("onbeforeslidein",null,null,!1,!0);this.timeline.initDisplay();
player.timelineManager.addTimeline(this.timeline);this.startTransition(b,!1,function(b){$(".slide.out").css("display","none");$(".slide.over").removeClass("over");d.handleEvent("ontransitionincomplete",null,null,!1,!0);a&&(d.timeline.playTimeline(),d.handleEvent("onslidestart"),c&&c(b),player.automation.notifySlideStarted(d.getFullObjref()))});if("SlideDraw"==d.parent.innerType)player.currentDraw=d.parent,d.parent.sniffDrawIndex(d);this.transitionedIn=!1;player.zoomParams=null;d.transcript?d.transcript.show():
player.frame.transcriptPanel&&player.frame.transcriptPanel.showTitleOnly(d.title);d.windowBackground?d.windowBackground.apply($("#slidecontainer")):$("#slidecontainer").css("background","transparent")};
Slide.prototype.startTransition=function(a,b,c){var a=this.transition,d=this;if(a.wipe){if(player.previousSlide&&player.previousSlide.ref&&player.previousSlide.ref.hasClass("out"))d=player.previousSlide,d.ref.addClass("over");else{c();return}Transition.applyCss({"-webkit-transform":"translate3d(0px,0px,0px) scale(1) rotate(0deg)",opacity:1,"-webkit-transition-duration":"0s"},this.ref)}this.handleEvent("ontransitionin",null,null,!1,!0);player.automation.notifySlideTransitionIn(this.getFullObjref(),
a?a.duration:0);if(a&&0<a.duration&&d){var e=a.convertToAnimation(d,!0);e.item=d;b?this.rotateypos=this.rotatexpos=0:(this.rotatexpos=this.width/2,this.rotateypos=this.height/2);if(e.pushdirection&&(e.pushItem=player.previousSlide,e.pushOffset={x:0,y:0},e.pushItem))switch(e.pushdirection){case "up":e.pushOffset.x=0;e.pushOffset.y=-e.pushItem.height;break;case "down":e.pushOffset.x=0;e.pushOffset.y=e.item.height;break;case "left":e.pushOffset.x=-e.pushItem.width;e.pushOffset.y=0;break;case "right":e.pushOffset.x=
e.item.width,e.pushOffset.y=0}e.start(d,a.reverse,new EventInfo("",-1,player.timelineManager,!0),c)}else c()};Slide.prototype.hide=function(){this.handleTransitionOut();this.setVisible(!1);this.ref&&this.destroyRef()};Slide.prototype.play=function(){this.timeline.playTimeline()};Slide.prototype.pause=function(a,b,c){this.pauseClips(a,b,c)};Slide.prototype.triggerTimelineComplete=function(){this.handleEvent("ontimelinecomplete");this.checkAllOpenTimelinesComplete()};
Slide.prototype.checkAllOpenTimelinesComplete=function(){var a=this.timeline.getIsTimelineComplete(),b;for(b in this.layers){var c=this.layers[b];if(c.visible&&!c.timeline.getIsTimelineComplete()){a=!1;break}}a&&this.handleEvent("onallopentimelinescomplete")};
Slide.prototype.handleTransitionIn=function(){if(!this.transitionedIn&&this.visible&&(this.transitionedIn=!0,this.handleEvent("onbeforeslidein",null,null,!1,!0),this.handleEvent("ontransitionin",null,null,!1,!0),this.handleEvent("ontransitionincomplete",null,null,!1,!0),this.handleEvent("onslidestart"),this.deepEach(function(a,c){c.handleEvent&&c.handleEvent("onslidestart",null,null,!1,!0)},function(a){return"Layer"!=a.innerType}),player.automation.notifySlideTransitionIn(this.getFullObjref(),0),
player.automation.notifySlideStarted(this.getFullObjref()),!player.currentWindow||!(player.currentWindowSlide==this&&player.currentWindow.isPrompt))){var a=this.globalaudioid&&story.globalAudio[this.globalaudioid];if(a){if(this.globalaudioid!=player.currentGlobalAudioID)player.currentGlobalAudioID&&story.globalAudio[player.currentGlobalAudioID].pauseClip(),player.currentGlobalAudioID=this.globalaudioid,a.setCurrentTime(0),a.playClip()}else if(player.currentGlobalAudioID)story.globalAudio[player.currentGlobalAudioID].pauseClip(),
player.currentGlobalAudioID=null}};Slide.prototype.handleTransitionOut=function(){if(this.transitionedIn)this.transitionedIn=!1,this.handleEvent("ontransitionout",null,null,!1,!0),this.handleEvent("ontransitionoutcomplete",null,null,!1,!0)};Slide.prototype.getQuiz=function(){var a=null;null!=this.quiz?a=this.quiz:null!=this.slideBank&&(a=this.slideBank.getQuiz());return a};
Slide.prototype.addchoiceresponse=function(a){var b=this.children[$(a).attr("interactionid")],a=$(a).attr("value"),c=this.extractVariable(a)||"true",d=b.parseObjref(a).target,e=!1;"Choice"!=d.innerType&&$.each(b.choices,function(a,b){if(!e&&b.lmstext.toLowerCase()==c.toLowerCase())d=b,d.matchedCase=e=b.lmstext==c});b.m_bAnswered=!0;"Choice"==d.innerType?(b.responses[a]=d,b.lmsResponses.push(new ResponseData(!1,d.id,"",d.lmstext,"")),d.selected=!0):(b.variables.Value=c,a=b.parseObjref(c).target,"Choice"==
a.innerType?(a.selected=!0,b.lmsResponses.push(new ResponseData(!1,a.id,"",a.lmstext,""))):b.lmsResponses.push(new ResponseData(!1,c,"",c,"")))};
Slide.prototype.addpairresponse=function(a){var b=this.children[$(a).attr("interactionid")],c=this.extractVariable($(a).attr("valuea"),$(a).attr("typea")),d=this.extractVariable($(a).attr("valueb"),$(a).attr("typeb"));if(c&&d)switch(a=b.parseObjref(c).target,d=b.parseObjref(d).target,a.addPair&&d.addPair&&(a.addPair(d),d.addPair(a)),b.interactionType){case "matching":case "sequence":case "likert":b.lmsResponses.push(new ResponseData(!0,d.id,a.id,d.lmstext,a.lmstext))}else b.parseObjref($(a).attr("valueb"));
b.m_bAnswered=!0};Slide.prototype.show_slidelayer=function(a){var b=this.parseObjrefFromXML(a).target,c=new Transition(b);c.loadFromXML(a);b.show(null,c)};Slide.prototype.set_frame_layout=function(a){player.currentSlide()==this||player.currentFramedSlide==this&&null==player.currentWindowSlide?player.frame.set_frame_layout(a):this.offsetParent&&this.offsetParent.slide&&"_frame"!=this.offsetParent.slide.variables.WindowId?this.set_window_control_layout(a):this.deferredFrameLayoutXML=a};
Slide.prototype.set_window_control_layout=function(a){player.frame.set_window_control_layout(a)};Slide.prototype.isPointActive=function(){return!1};Slide.prototype.isPointObscured=function(){return!1};
Slide.prototype.simplify=function(a){var b=this.childItems(),c=$('<canvas class="simplebackground"></canvas>');c.attr("width",player.width);c.attr("height",player.height);var d=c.get(0).getContext("2d");this.ref.prepend($(c));var e=0,f=0,g=!1,h=!0;$.each(b,function(a,b){if(player.renderVectorShapes&&player.renderVectorsAsSVG&&b.content.path)b.canSimplify=!1;if(player.renderVectorShapes&&(b.hasImagelib||b.hasTextlib))b.canSimplify=!1;b.canSimplify&&h&&!b.group?f++:(h=!1,b.canSimplify=!1)});var j=function(b,
c,d,h){g=!0;var j=function(){e++;if(e==f)m(),$(t).unbind("load"),t.src=Element.PixelSrc,a&&a()},t=new Image;$(t).bind("load",function(){j()});$(t).bind("error",function(){j()});player.renderVectorShapes&&!player.renderVectorsAsSVG&&h&&h.content.path&&!h.hasImagelib&&!h.hasTextlib?e++:t.src=b;l.push({img:t,x:c,y:d,item:h})},l=[],m=function(){$.each(l,function(a,b){if(player.renderVectorShapes&&!player.renderVectorsAsSVG&&b.item&&b.item.content.path&&!b.item.hasImagelib&&!b.item.hasTextlib){var e={canvas:c.get(0),
m_nXOffset:b.x,m_nYOffset:b.y,m_nWidth:b.item.width,m_nHeight:b.item.height};ppArt.DrawVector(e,b.item.content.path);b.item.ref.addClass("vector")}else d.drawImage(b.img,b.x,b.y)})};this.background&&this.background.src&&(f++,j(this.background.src,0,0),this.ref.css("background","transparent"));$.each(b,function(a,b){if(b.canSimplify)j(b.content.src,b.x,b.y,b),b.ref.addClass("simplified"),b.simplified=!0,b.ref.attr("src",Element.PixelSrc),b.ref.css("background","transparent"),b.hasEvents||b.ref.remove(),
g=!0});a&&!g&&a()};Slide.prototype.pauseClips=function(a,b){$.each(this.clips,function(c,d){(b||!a||!d.layered)&&d.timelinePaused()})};Slide.prototype.notifyTimelinePlayed=function(){for(var a=0;a<this.clips.length;a++)this.clips[a].timelinePlayed();this.presenter&&this.presenter.tick(this.timeline)};Slide.prototype.notifyTimelinePaused=function(){for(var a=0;a<this.clips.length;a++)this.clips[a].timelinePaused();this.presenter&&this.presenter.tick(this.timeline)};
Slide.prototype.isSubmitted=function(){var a=!0;$.each(this.interactions,function(b,c){a=a&&(c.skipEnabled||c.variables.Status&&"incomplete"!=c.variables.Status&&void 0!=c.variables.Points)});return a};Slide.prototype.isAnswered=function(){var a=!0;$.each(this.interactions,function(b,c){a=a&&(c.m_bAnswered||c.skipEnabled)});return a};Slide.prototype.Viewed=function(){return this.variables.Visited?"true":"false"};
Element.prototype.forceRepaint=function(a){if((!a||player.isMobile)&&this.ref&&"block"==this.ref.css("display"))a=this.ref.get(0),this.ref.hide(),player.uselessOffsetHeight=a.offsetHeight,this.ref.show()};var StageItem=function(a){this.container=a;this.ref=null;this.constructElement();this.dirty=!0;this.hiddenByLayer=this.destroyed=this.actionMoved=this.actionControlled=!1;this.content={}};StageItem.prototype=new Element;StageItem.prototype.objectType="Item";StageItem.prototype.innerType="Item";var Item=StageItem;StageItem.prototype.isStageItem=!0;StageItem.prototype.resetElement=Element.prototype.reset;
StageItem.prototype.reset=function(a){if(this.ref)this.stopCurrentAnimations(!0),this.setVisible(!1),this.setOnStage(!1,!0),this.runningTransition=null,this.pendingShow=this.pendingHide=!1,this.ref.hide(),player.removeFromShowQueue(this),this.x=this.originalX,this.y=this.originalY,this.yscale=this.xscale=100,this.scale=1,this.rotation=this.originalRotation||0,this.depth=this.originalZ||this.depth,this.applySize(this.ref);this.resetElement(a)};
StageItem.prototype.getItemIndex=function(){var a=this,b=0,c=-1;if(this.itemIndex)return this.itemIndex;(this.layer||this.slide).deepEach(function(d,e){e.isStageItem&&"ShuffleGroup"!=e.innerType&&(e==a&&(c=b),b++)},function(a){return"Layer"==a.innerType?!1:!0});return this.itemIndex=c};
StageItem.prototype.getItemByResumeIndex=function(a){var b=0,c=null;(this.layer||this.slide).deepEach(function(d,e){e.isStageItem&&"ShuffleGroup"!=e.innerType&&(b==a&&(c=e),b++)},function(a){return"Layer"==a.innerType?!1:!0});return c};StageItem.prototype.getItemByTypeStyle=function(a,b){var c=null;(this.layer||this.slide).deepEach(function(d,e){e.innerType==a&&e.style==b&&(c=e)},function(a){return"Layer"==a.innerType?!1:!0});return c};
StageItem.FlagProperties={FLAG_STATE:1,FLAG_VARIABLE:2,FLAG_ONSTAGE:4,FLAG_DRAG_DROP:8,FLAG_USE_ANIMATION_FLAG:16,FLAG_DEPTH:32,FLAG_SHUFFLED:64,FLAG_ACTION_MOVED:128,FLAG_ACTION_CONTROLLED:256,FLAG_DISABLED:512,FLAG_REVIEW:1024,FLAG_MOUSE_OVER:2048,FLAG_HIDDEN_BY_LAYER:4096,FLAG_DRAG_PATH:8192};StageItem.FlagTween={FLAG_TWEEN_POSITION:1,FLAG_TWEEN_SCALE:2,FLAG_TWEEN_ROTATION:4,FLAG_TWEEN_ALPHA:8,FLAG_TWEEN_COLOR_TRANSFORMS:16,FLAG_TWEEN_COLOR_MATRIXES:32};
StageItem.prototype.debugResumeData=function(a){var b=StageItem.FlagProperties,c=new bwChunk(a),d=c.NextUBase10(3);console.warn(".");console.warn("Id: "+this.getFullObjref()+" : "+this.innerType+" : "+a);console.warn("\t\tFlags: "+d);console.warn("\t\tState: "+(d&b.FLAG_STATE));console.warn("\t\tVariable: "+(d&b.FLAG_VARIABLE));console.warn("\t\tOnStage: "+(d&b.FLAG_ONSTAGE));console.warn("\t\tDragDrop: "+(d&b.FLAG_DRAG_DROP));console.warn("\t\tAnimations Flag: "+(d&b.FLAG_USE_ANIMATION_FLAG));console.warn("\t\tShuffled: "+
(d&b.FLAG_SHUFFLED));console.warn("\t\tMoved: "+(d&b.FLAG_ACTION_MOVED));console.warn("\t\tActionControlled: "+(d&b.FLAG_ACTION_CONTROLLED));console.warn("\t\tDisabled: "+(d&b.FLAG_DISABLED));console.warn("\t\tReview: "+(d&b.FLAG_REVIEW));console.warn("\t\tMouseOver: "+(d&b.FLAG_MOUSE_OVER));console.warn("\t\tHiddenByLayer: "+(d&b.FLAG_HIDDEN_BY_LAYER));d&b.FLAG_STATE&&(a=c.NextUBase10(2),console.warn("\tState Index: "+a));if(d&b.FLAG_DRAG_DROP){var a=c.NextUBase10(2),e=c.NextUBase10(1);console.warn("\tDropAreaItemIndex: "+
a);console.warn("\tdropAreaSlotIndex: "+e)}d&b.FLAG_DEPTH&&(a=c.NextUBase10(2),console.warn("\tDepth: "+a));d&b.FLAG_SHUFFLED&&(a=c.NextBase10(2),e=c.NextBase10(2),console.warn("\tShuffle Poisition: "+a+", "+e));a=c.Remainder();d&b.FLAG_VARIABLE?this.parseVariableData(c.NextString()):a=c.NextString();d&b.FLAG_USE_ANIMATION_FLAG&&this.SetAnimationResumeData(a)};
StageItem.prototype.debugVariableData=function(a){console.warn("\tVariableData: "+a);if(""==a)return"";for(var b=$(this.xml).children("variables").children("[resume='true'][type='boolean']"),c=$(this.xml).children("variables").children("[resume='true'][type!='boolean']"),a=new bwChunk(a),d=0;!a.EOF();)for(var e=a.NextUBase10(1),f=1;f<=e;){if(e&f)if(d<b.length){var g=$(b[d]);console.warn("\t\t"+g.attr("name")+" = true")}else this.extractNextSpecialBool&&console.warn("\t\textractNextSpecialBool");d++;
f*=2}for(var h,b=0;b<=c.length;b++)if(b<c.length){h=h?h.NextChunk():a.NextChunk();d=$(c[b]);e=this.variableTypes[d.attr("name")];f=h.Data();switch(e){case "number":f=h.NextBase10();break;case "string":f="^"==f?this.variableDefaults[d.attr("name")]:bwChunk.DecodeString(f)}console.warn("\t\t"+d.attr("name")+" = "+f);this.variables[d.attr("name")]=f}else this.extractNextSpecialVar&&(h=h?h.NextChunk():a.NextChunk(),console.warn("\t\tExtract Special Vars: "+h.Data()),this.extractNextSpecialVar(h.Data()));
return h?h.Remainder():a.Remainder()};
StageItem.prototype.restoreFromResumeData=function(a){var b=StageItem.FlagProperties,a=new bwChunk(a),c=a.NextUBase10(3);if(c&b.FLAG_STATE){var d=a.NextUBase10(2),e="";$.each(this.states,function(a,b){b.index==d&&(e=a)});!e&&this.actionstateindices&&$.each(this.actionstateindices,function(a,b){b==d&&(e=a)});e&&(this.variables.ObjectState=e)}var f=!1;if(c&b.FLAG_HIDDEN_BY_LAYER)(this.hiddenByLayer=!0)&&"ShuffleGroup"!=this.innerType&&(f=!0);c&b.FLAG_ONSTAGE?this.quickShow?this.quickShow():(this.show(),
this.setVisible(!0)):"ShuffleGroup"!=this.innerType&&(this.quickHide?this.quickHide():this.hide());f&&(this.quickHide?this.quickHide():this.hide());if(c&b.FLAG_DRAG_DROP){f=a.NextUBase10(2);a.NextUBase10(1);if("wordbank"==this.style)this.parent=this.slide;(f=this.getItemByResumeIndex(f))&&f.isDropArea&&this.dock(f,!0)}if(c&b.FLAG_DEPTH)f=a.NextUBase10(2),this.ref?this.setZIndex(f):this.depth=f;if(c&b.FLAG_SHUFFLED){this.shuffled=!0;if(this.shuffleGroup)this.shuffleGroup.shuffled=!0;var f=a.NextBase10(2),
g=a.NextBase10(2);a.NextBase10(2);this.shuffleX=f;this.shuffleY=g}if(c&b.FLAG_DISABLED)this.isDisabled=!0;f=a.Remainder();f=c&b.FLAG_VARIABLE?this.restoreVariableResumeData(a.NextString()):a.NextString();c&b.FLAG_USE_ANIMATION_FLAG&&(f=this.SetAnimationResumeData(f));this.SetDragPathResumeData&&c&b.FLAG_DRAG_PATH&&(f=this.SetDragPathResumeData(f));if(c&b.FLAG_SHUFFLED&&!this.resumePositioned)this.x=this.shuffleX,this.y=this.shuffleY;if(c&b.FLAG_MOUSE_OVER)this.isMouseOver=!1,this.handleEvent("onrollout",
null,null,!1,!1,!1)};
StageItem.prototype.SetAnimationResumeData=function(a){var b=StageItem.FlagTween,a=new bwChunk(a),c=a.Data();if(""!=c){var d=bwChunk.UBaseNto10(c.charAt(0)),c=c.substr(1);this.resumePositioned=!1;if(d&b.FLAG_TWEEN_POSITION){this.resumePositioned=!0;this.x=bwChunk.BaseNto10(c.substr(0,2));this.y=bwChunk.BaseNto10(c.substr(2,2));var e=bwChunk.UBaseNto10(c.substr(4,2));switch(e){case 4094:break;case 4095:this.parent=this.slide;break;default:this.originalParent=this.parent,this.parent=this.getItemByResumeIndex(e)}c=
c.substr(6)}if(d&b.FLAG_TWEEN_SCALE)this.scaleX=bwChunk.BaseNto10(c.substr(0,2))/100,this.scaleY=bwChunk.BaseNto10(c.substr(2,2))/100,c=c.substr(4);if(d&b.FLAG_TWEEN_ROTATION)this.rotation=bwChunk.BaseNto10(c.substr(0,2)),c=c.substr(2);if(d&b.FLAG_TWEEN_ALPHA)this.alpha=bwChunk.UBaseNto10(c.substr(0,2))/100,c.substr(2)}return a.Remainder()};
StageItem.prototype.GetResumeData=function(a){var b=StageItem.FlagProperties,c="",d="";if(this.resume||a){var e=this.hasVariables(),a=this.originalZ&&this.depth!=this.originalZ,f=0,g=this.x,h=this.y,g=this.shuffled&&(g!=this.shuffleX||h!=this.shuffleY)||!this.shuffled&&!isNaN(this.originalX)&&(g!=this.originalX||h!=this.originalY);if(this.variables.ObjectState!=bwUtils.DEFAULT_STATE){var j=(h=this.states[this.variables.ObjectState])?h.index:0;!h&&this.actionstates&&this.actionstateindices&&(h=this.actionstates[this.variables.ObjectState],
j=this.actionstateindices[this.variables.ObjectState]||0);0<=j&&(f+=b.FLAG_STATE,d+=bwChunk.UBase10toN(h.index,2))}e&&(f+=b.FLAG_VARIABLE);this.visible&&(f+=b.FLAG_ONSTAGE);this.hiddenByLayer&&(f+=b.FLAG_HIDDEN_BY_LAYER);this.dropArea&&(h=this.dropArea.getItemIndex(),j=this.dropArea.getDragItemIndex(this),-1<j&&(f+=b.FLAG_DRAG_DROP,d+=bwChunk.UBase10toN(h,2),d+=bwChunk.UBase10toN(j,1)));a&&(f+=b.FLAG_DEPTH,d+=bwChunk.Base10toN(this.depth,2));this.shuffled&&(f+=b.FLAG_SHUFFLED,d+=bwChunk.Base10toN(this.shuffleX,
2),d+=bwChunk.Base10toN(this.shuffleY,2),d+=bwChunk.Base10toN(0,2));this.actionMoved&&(f+=b.FLAG_ACTION_MOVED);this.actionControlled&&(f+=b.FLAG_ACTION_CONTROLLED);this.isDisabled&&(f+=b.FLAG_DISABLED);this.isMouseOver&&(f+=b.FLAG_MOUSE_OVER)}g&&(f+=b.FLAG_USE_ANIMATION_FLAG);this.GetDragPathResumeData&&(f+=b.FLAG_DRAG_PATH);c+=bwChunk.UBase10toN(f,3);e&&(b=(new bwChunk(this.getVariableResumeData())).Data(),d+=b);g&&(d+=this.GetAnimationResumeData());this.GetDragPathResumeData&&(d+=this.GetDragPathResumeData());
return c+d};
StageItem.prototype.GetAnimationResumeData=function(){var a=0,b="",c=this.x,d=this.y;if(this.shuffled&&(c!=this.shuffleX||d!=this.shuffleX)||!this.shuffled&&!isNaN(this.originalX)&&(c!=this.originalX||d!=this.originalY))a+=StageItem.FlagTween.FLAG_TWEEN_POSITION,b+=bwChunk.Base10toN(c,2),b+=bwChunk.Base10toN(d,2),c=4094,this.originalParent&&this.parent!=this.originalParent&&(c="wordbank"==this.style?4094:"Slide"==this.parent.innerType?4095:this.parent.getItemIndex()),b+=bwChunk.UBase10toN(c,2);0<
a&&(b=bwChunk.UBase10toN(a,1)+b);return b=bwChunk.CreateChunk(b)};StageItem.prototype.getExtraResumeVars=function(){return{}};
StageItem.prototype.loadFromXML=function(a,b,c){this.slide=b;this.layer=c;this.children={};this.links={};this.jcanvas=null;this.innerType=this.type=a.tagName.toLowerCase();this.id="undefined"===typeof $(a).attr("id")?$(a).attr("name"):$(a).attr("id");this.xml=a;this.loadElementInfoFromXML(a);$(a).find("html5data");this.scrolling="true"==$(a).attr("scrolling");this.shufflelock="true"==$(a).attr("shufflelock");this.usehandcursor="true"==$(a).attr("usehandcursor");this.hasEvents=0!=$(a).find("events").length;
this.content.src=Element.PixelSrc;this.loadContentFromXML(a);this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);this.bitMask=new BitMask(!0,this.width,this.height);this.bitMask.itemID=this.id;if(this.shapemaskid=$(a).attr("shapemaskid"))if(a=this.parseObjref(this.shapemaskid).target,"vectorshape"==a.innerType)a.isShapeMask=!0;if(0<$(this.xml).children("dragdrop").length){if("true"==$(this.xml).children("dragdrop").first().attr("dragenabled")&&this.convertToDragItem(this.xml),"true"==$(this.xml).children("dragdrop").first().attr("dropenabled")&&
this.convertToDropArea(this.xml),"true"==$(this.xml).children("dragdrop").first().attr("dragoverenabled"))this.announceDragOver=!0,this.setupDragOver(this.xml)}else 0<$(this.xml).children("dragpath").length&&this.convertToDragPathItem(this.xml)};StageItem.prototype.setupDragOver=function(){this.announceDragOver=!0;this.parseDragGroupsFromXML=DragItem.prototype.parseDragGroupsFromXML;this.parseDragGroupsFromXML(this.xml)};
StageItem.prototype.loadContentFromXML=function(a){var b=$(a).find("html5data");this.scrolling="true"==$(a).attr("scrolling");this.hasEvents=0!=$(a).find("events").length;switch(this.type){case "audio":this.canSimplify=!1;this.content.src=player.basepath+""+$(a).attr("url");this.content.duration=parseInt($(a).attr("duration"));slide&&slide.clips&&slide.clips.push&&slide.clips.push(this);if(layer&&layer.clips&&layer.clips.push)layer.clips.push(this),this.layered=!0;break;case "droparea":case "dragitem":case "vectorshape":case "scrollarea":case "state":case "droplist":case "button":case "expandinglabel":case "link":("droparea"==
this.type||"dragitem"==this.type)&&$(0<$(this.xml).children("dragdrop").length)&&$($(this.xml).children("dragdrop")[0]).remove();this.content.src=Element.PixelSrc;if(0<$(a).children("textlib").length){this.textlib=$(a).children("textlib");if(!story.textlibs)story.textlibs={};if((b=this.textlib.children("textdata").attr("linkid"))&&0==this.textlib.find("path").length&&0==this.textlib.find("pr").length&&story.textlibs[b])this.textlib=story.textlibs[b];if(b&&(1==this.textlib.find("path").length||1==
this.textlib.find("pr").length)&&!story.textlibs[b])story.textlibs[b]=this.textlib}else if(0<$(a).children("data").length)this.textlib=$(a).children("data");0<$(a).children("imagelib").length&&this.loadImageDataFromXML(a);var b=$(a).children("data").children("vectordata").children("path"),c=$(a).children("data").children("vectordata").children("pr");if(1==b.length||1==c.length){var d=$(a).children("data").children("vectordata");if(null!=$(d).attr("top"))this.originalRectShape=this.rectShape=new ppRect(parseInt($(d).attr("left")),
parseInt($(d).attr("top")),parseInt($(d).attr("right")),parseInt($(d).attr("bottom")));this.content.path=1==c.length?PathLib.getPathFromXML(c):b.text()}this.type="image";break;case "item":this.content.src=Element.PixelSrc;this.textlib=$(a);this.forceDivPattern=!0;this.type="image";break;case "textfield":this.content.src=Element.PixelSrc;if(0<b.length)this.content.src=player.basepath+"mobile/"+b.attr("url");this.textlib=$(a).children("data");break;case "image":this.content.src=$(a).find("imagedata").attr("url");
this.content.src=this.content.src?player.basepath+"mobile/"+this.content.src.replace(globals.strContentFolder+"/","").replace(".swf",".png"):"";if(0<b.length)this.content.src=player.basepath+"mobile/"+b.attr("url");break;case "textinput":this.canSimplify=!1,this.content.src=Element.PixelSrc}this.textlib&&this.content.src==Element.PixelSrc&&this.updateTextTemplate();this.loadMaskFromXML(a)};
StageItem.prototype.updateTextTemplate=function(a){if(!this.textlib)return!1;var b=null;a&&(b=this.textlib.children("textdata[id='"+a+"']"));b||(b=this.textlib.children("textdata").first());if(!b)return!1;a=b.children("vartext").first().text();a||(a=b.attr("lmstext"))&&(a="<span>"+a+"</span>");if(a)this.textTemplate=a=a.replace(/size='(.*?)(pt|)'/ig,"style='font-size:$1pt'"),this.textTemplateHeight=Math.abs(parseInt(b.attr("height"))),this.textTemplateWidth=Math.abs(parseInt(b.attr("width"))),this.textTemplateLeft=
parseInt(b.attr("xpos")),this.textTemplateTop=parseInt(b.attr("ypos"));return!0};StageItem.prototype.loadMaskFromXML=function(a){a=$(a).children("mask");if(0<a.length){var b=a.children("vectordata");this.vectorMask={xpos:parseInt(a.attr("xpos")),ypos:parseInt(a.attr("ypos")),left:parseInt(b.attr("left")),top:parseInt(b.attr("top")),right:parseInt(b.attr("right")),bottom:parseInt(b.attr("bottom")),path:PathLib.getPathFromXML(b.children("pr"))}}};
StageItem.prototype.loadMaskFromMaskShapeXML=function(){if(this.shapemaskid){var a=this.parseObjref(this.shapemaskid).target;a.isShapeMask=!0;var b=$(a.xml).children("data");if(0<b.length)b=b.children("vectordata"),this.vectorMask={xpos:parseInt($(a.xml).attr("xpos")),ypos:parseInt($(a.xml).attr("ypos")),left:parseInt(b.attr("left")),top:parseInt(b.attr("top")),right:parseInt(b.attr("right")),bottom:parseInt(b.attr("bottom")),path:PathLib.getPathFromXML(b.children("pr"))}}};
StageItem.prototype.loadImageDataFromXML=function(a){var b=this;b.imagelib=new ppImageLib;$(a).children("imagelib").children("imagedata").each(function(a,d){var e=b.imagelib.AddImage($(d).attr("id"),$(d).attr("url"),$(d).attr("type"),null,$(d).attr("width"),$(d).attr("height"),$(d).attr("mobiledx"),$(d).attr("mobiledy"),$(d).attr("maskref")),f=$(d).attr("altimage"),g=$(d).attr("url"),f=player.basepath+(f?f:g);if(-1<f.indexOf(".swf"))f=Element.PixelSrc;b.content.src=f;g=b.createResource(b.slide,f,
function(){b.blocked&&b.ref&&b.render(b.lastRenderedState,!0,null,"resource callback")});g.imgLibID=$(d).attr("id");g.src=f;if(!g.poolImage)g.poolImage=document.createElement("img"),g.poolImage.className="loader";e.imgNode=g.poolImage;e.Width=$(d).attr("width");e.Height=$(d).attr("height")})};
StageItem.prototype.loadSizeFromXML=function(a){var b=$(a).children("data").children("html5data"),c=$(a).children("data").children("vectordata");this.hasImagelib=0<$(a).find("imagelib").length;this.hasTextlib=0<$(a).find("textlib").length;if("audio"!=this.type)0<b.length?(this.xpos=parseInt($(a).attr("xpos")),this.ypos=parseInt($(a).attr("ypos")),this.xoffset=parseInt($(a).attr("xoffset"))||0,this.yoffset=parseInt($(a).attr("yoffset"))||0,this.x=this.xpos,this.y=this.ypos,this.width=parseInt(b.attr("width")),
this.height=parseInt(b.attr("height"))):("video"==this.type?(this.xpos=parseInt($(a).attr("xpos")),this.ypos=parseInt($(a).attr("ypos")),this.x=parseInt($(a).attr("xpos")),this.y=parseInt($(a).attr("ypos"))):(this.xpos=parseInt($(a).attr("xpos")),this.ypos=parseInt($(a).attr("ypos")),this.yoffset=this.xoffset=0,this.x=this.xpos,this.y=this.ypos),this.width=parseInt($(a).attr("width")),this.height=parseInt($(a).attr("height")));if(0<c.length){b=parseInt($(c).attr("right"))-parseInt($(c).attr("left"));
c=parseInt($(c).attr("bottom"))-parseInt($(c).attr("top"));if(b>this.width)this.width=b;if(c>this.height)this.height=c}this.originalX=this.x;this.originalY=this.y;this.rotatexpos=Math.round($(a).attr("rotatexpos"))||0;this.rotateypos=Math.round($(a).attr("rotateypos"))||0;this.originalRotation=this.rotation=parseInt($(a).attr("rotation"))||0;this.xscale=parseInt($(a).attr("xscale"))||1;this.yscale=parseInt($(a).attr("yscale"))||1;this.depth=parseInt($(a).attr("depth"))||1;if(0==this.depth)this.depth=
1;this.originalZ=this.depth;if(this.depth>this.slide.topZ)this.slide.topZ=this.depth};StageItem.prototype.createResource=function(a,b,c){b=new Resource(this,b,function(){c&&c()});if(!a.resources)a=a.slide;a.pushResource(b);this.resources.push(b);return b};
StageItem.prototype.createRef=function(){if(this.destroyed)return!1;if(!this.parent.ref)return this.parent.createRef(),!1;this.container=this.parent.ref;if(this.ref)return this.render(null,!1,null,"StageItem createRef"),!1;this.ref=$('<div class="item"></div>');this.ref.addClass(this.type);this.ref.addClass(this.innerType.toLowerCase());this.ref.addClass("item_"+this.id);this.ref.get(0).id=this.getFullObjref();player.showItemInfo&&this.ref.append($('<div class="itemid">'+this.id+"</div>"));this.applySize(this.ref);
"dragitem"==this.innerType&&this.setZIndex(this.depth);this.container.append(this.ref);"video"!=this.type&&"audio"!=this.type&&this.bindEvents();for(var a in this.children){var b=this.children[a];b.createRef&&b.createRef()}this.initDrag&&(this.initDrag(),this.convertRefToDragItem());("DropArea"==this.innerType||this.isDropArea)&&this.ref.addClass("droparea");this.announceDragOver&&this.ref.addClass("dragover");this.applyMaskRectangle();this.setVisible(!1);this.nearestScrollAreaAncestor=this.findAncestorOfType("ScrollArea");
return!0};StageItem.prototype.setInteractive=function(){this.ref.addClass("interactive");this.parent.setInteractive&&this.parent.setInteractive()};StageItem.prototype.setZIndex=function(a,b){if(!("Layer"==this.innerType||"ExpandingLabel"==this.innerType)){for(var c in this.children){var d=this.children[c];if(d.depth>a)a=d.depth}this.ref.css("z-index",a);this.depth=a;b&&this.parent&&this.parent.setZIndex&&this.parent.setZIndex(a)}};
StageItem.prototype.bindEvents=function(){var a=this,b=function(b){if(a.isDisabled||swipe.moved)return!1;var c=(b.pageX-a.ref.offset().left+a.xoffset)/player.currentZoom(),f=(b.pageY-a.ref.offset().top+a.yoffset)/player.currentZoom();a.ref.offset();a.ref.offset();swipe.parseEventCoords(b);b=swipe.getSlideCoords(a.slide);return c<a.width&&f<a.height&&a.isPointActive(b.x,b.y)&&!a.isPointObscured(b.x,b.y)?!0:!1},c=!1;a.bindStoryEvent("click touchstart","ondoubleclick",function(a){if(b(a)){if(c)return!0;
c=!0;setTimeout(function(){c=!1},400)}return!1});a.bindStoryEvent("mousedown","onrightrelease",function(a){return 3==a.which});a.shouldBindEvent("onpress")||a.shouldBindEvent("onrelease")};StageItem.prototype.unBindEvents=function(){};StageItem.prototype.reduce=function(){$.each(this.children,function(a,b){b.reduce&&b.reduce()});if(this.canvas)this.canvas.width=1,this.canvas.height=1};
StageItem.prototype.destroyRef=function(){this.destroyed=!0;$.each(this.children,function(a,b){b.destroyRef&&b.destroyRef()});if(this.xml)this.xml=null;this.unloadResources();this.destroyComponent("ref");this.destroyComponent("contentRef");this.destroyComponent("jcanvas");this.destroyComponent("canvas");this.destroyComponent("border");this.destroyComponent("vectorImage");this.destroyComponent("image");this.destroyComponent("placeholderRef");this.destroyComponent("input");this.dirty=!0;this.hotContexts=
[];this.children={};this.eventSubscribers=[];this.resources=[];this.container=null;this.events=[];this.actionGroups={};this.variables={};this.states={};this.parent=null;this.log=[]};StageItem.prototype.destroyComponent=function(a){this[a]&&($(this[a]).remove(),this[a]=null)};var removeDOMElement=function(a){a.get&&(a=a.get(0));a.parentNode&&a.parentNode.removeChild(a)};StageItem.prototype.getTimeline=function(){return(this.layer||this.slide).timeline};
StageItem.prototype.HandleBoundVarChanged=function(a,b,c,d,e,f,g){this.render(a,b,c,d,e,f,g)};StageItem.prototype.render=function(){if(this.ref)switch(this.innerType){case "swf":this.ref.css("background-color","orange"),player.addToShowQueue(me);case "textfield":case "image":this.content.src!=Element.PixelSrc&&(this.ref.css("background","transparent url("+escape(this.content.src)+") no-repeat"),player.addToShowQueue(me))}};
StageItem.prototype.show=function(a,b){if(!this.destroyed){this.createRef(this.parent.ref);this.loadResources();var c=this;if(!this.visible||this.dirty)if(this.dirty=!1,!this.hiddenByLayer){if(a&&a.isUserInitiated)this.actionControlled=!0;if("audio"!=this.type){"vectorshape"!=this.innerType&&this.applyMask();c.textlib&&c.textTemplate&&c.content.src==Element.PixelSrc&&c.textTemplate&&c.renderTextTemplate();if(b&&(0!=b.duration||"custom"==b.transition)){if(!this.ref)return;this.setVisible(!0);for(var d in this.children)this.children[d].bParentHidden&&
player.addToShowQueue(this.children[d]);player.addToShowQueue(c);this.setOnStage(!0);c.handleEvent("ontransitionin",null,null,!1,!0);c.runningTransition=b;c.pendingHide=!1;c.pendingShow=!0;c.transitioning=!1;c.justShowed=!0;setTimeout(function(){c.justShowed=!1},0);d=b.convertToAnimation(c,!0);c.animated=!0;d.start(c,b.reverse,a,function(){c.transitioning=!1;if(c.ref&&c.pendingShow){c.pendingHide=!1;c.pendingShow=!1;for(var a in c.children)c.children[a].bParentHidden&&(c.children[a].shapemaskid&&
c.children[a].renderOnUpdate&&player.addToRenderQueue(c.children[a]),player.addToShowQueue(c.children[a]));player.addToShowQueue(c)}c.handleEvent("ontransitionincomplete",null,null,!1,!0)});c.transitioning=!0}else{if(!this.visible)c.justShowed=!0,setTimeout(function(){c.justShowed=!1},0);c.runningTransition=null;c.pendingHide=!1;c.pendingShow=!1;this.setVisible(!0);this.shapemaskid&&this.renderOnUpdate&&player.addToRenderQueue(c);this.bShowQueue=!0;player.addToShowQueue(c);$(this.ref).css("opacity",
1);for(d in c.children)c.children[d].bParentHidden&&(c.children[d].shapemaskid&&c.children[d].renderOnUpdate&&player.addToRenderQueue(c.children[d]),player.addToShowQueue(c.children[d]));this.setOnStage(!0);c.handleEvent("ontransitionin",null,null,!1,!0);c.handleEvent("ontransitionincomplete",null,null,!1,!0)}c.group&&c.group.show(null,null,null,!0)}0<c.events.length&&(!c.ref.data("events")||!c.ref.data("events").mouseup&&!c.ref.data("events").mousedown&&!c.ref.data("events").touchstart&&!c.ref.data("events").touchend)&&
this.bindEvents();this.shuffleGroup&&this.shuffleGroup.shuffle()}}};StageItem.prototype.setOnStage=function(a,b){this.setProperty("OnStage",(a&&this.visible).toString(),b);$.each(this.children,function(c,d){d.setOnStage&&d.setOnStage(a,b)})};StageItem.prototype.quickShow=function(){this.setVisible(!0);if("audio"!=this.type&&this.slide&&this.slide==player.currentSlide()&&this.ref)player.addToShowQueue(this),this.pendingShow=this.pendingHide=!1;this.setOnStage(!0,!0)};
StageItem.prototype.quickHide=function(){this.setVisible(!1);if("audio"!=this.type&&"ItemGroup"!=this.type&&this.slide&&this.slide==player.currentSlide()&&this.ref)this.ref.hide(),player.removeFromShowQueue(this),this.pendingShow=this.pendingHide=!1;this.setOnStage(!1,!0)};
StageItem.prototype.hide=function(a,b){if(this.visible&&this.ref){this.showOnFirstStep=!1;var c=this;if(a&&a.isUserInitiated)this.actionControlled=!0;if("audio"!=this.type)if(c.handleEvent("ontransitionout",null,null,!1,!0),b&&(0!=b.duration||"custom"==b.transition)){c.runningTransition=b;c.pendingHide=!0;c.pendingShow=!1;c.transitioning=!1;var d=b.convertToAnimation(c,!1);c.animated=!0;d.start(c,b.reverse,a,function(){c.setVisible(!1);c.setOnStage(!1);c.transitioning=!1;if(c.ref&&c.pendingHide)c.pendingHide=
!1,c.pendingShow=!1,c.ref.hide(),player.removeFromShowQueue(c);c.handleEvent("ontransitionoutcomplete",null,null,!1,!0)});c.transitioning=!0}else this.stopCurrentAnimations(!0),this.setVisible(!1),this.setOnStage(!1),c.runningTransition=null,c.pendingHide=!1,c.pendingShow=!1,this.ref&&(this.ref.hide(),player.removeFromShowQueue(this)),c.handleEvent("ontransitionoutcomplete",null,null,!1,!0)}};
StageItem.prototype.applyMask=function(){if(this.vectorMask){this.vectorMask.m_nXOffset=this.vectorMask.left;this.vectorMask.m_nYOffset=this.vectorMask.top;this.vectorMask.width=this.vectorMask.right-this.vectorMask.left;this.vectorMask.height=this.vectorMask.bottom-this.vectorMask.top;this.vectorMask.rectShape=new ppRect(this.vectorMask.left,this.vectorMask.top,this.vectorMask.right,this.vectorMask.bottom);if(!this.vectorMask.canvas)this.vectorMask.canvas=document.createElement("CANVAS"),this.vectorMask.canvas.width=
this.vectorMask.right-this.vectorMask.left,this.vectorMask.canvas.height=this.vectorMask.bottom-this.vectorMask.top;ppArt.itemID=this.id;ppArt.item=this;ppArt.DrawVector(this.vectorMask,this.vectorMask.path,null,null,null,null,null);var a=this.vectorMask.canvas.toDataURL();this.ref.css("mask-image","url("+a+")");this.ref.css("-webkit-mask-image","url("+a+")");this.ref.css("-moz-mask-image","url("+a+")");this.ref.css("-ms-mask-image","url("+a+")")}};
StageItem.prototype.applyMaskRectangle=function(){if(this.shapemaskid){var a=this.parseObjref(this.shapemaskid).target;this.maskShape=a;1>=Math.abs(a.x)&&1>=Math.abs(a.y)?(this.maskref=$("<div class='item shapemask'></div>"),this.maskref.css("width",a.width),this.maskref.css("height",a.height),this.maskref.css("left",a.x),this.maskref.css("top",a.y),this.maskref.css("z-index",this.depth),this.maskref.show(),this.parent.ref.append(this.maskref),this.maskref.append(this.ref)):(this.maskref=$("<div class='item shapemask'></div>"),
this.maskref.css("width",a.width),this.maskref.css("height",a.height),this.maskref.css("left",a.x),this.maskref.css("top",a.y),this.maskref.css("z-index",this.depth),this.maskref.show(),this.parent.ref.append(this.maskref),this.maskref.append(this.ref),this.maskTranslate="translate3d("+-a.x+"px, "+-a.y+"px, 0px) ",this.maskTranslateIE="translate("+-a.x+"px, "+-a.y+"px) ",this.ref.css("-webkit-transform",this.maskTranslate),this.ref.css("-moz-transform",this.maskTranslate),this.ref.css("-ms-transform",
this.maskTranslateIE));a.isShapeMask=!0;this.setZIndexBase=StageItem.prototype.setZIndex;this.setZIndex=function(a){this.setZIndexBase(a);this.maskref.css("z-index",this.depth)};this.deepEach(function(b,c){c.ancestorMaskShape=a})}};StageItem.prototype.shouldBindEvent=function(a){if(player.showItemInfo)return!0;var b=this,c=!1;$.each(b.events,function(d,e){if(e.trigger==a)c=!0;else{var f=b.parent;f&&f.shouldBindEvent&&!c&&(c=f.shouldBindEvent(a))}});return c};
StageItem.prototype.bindStoryEvent=function(a,b,c){if(this.shouldBindEvent(b)){var d=this;this.ref.bind(a,function(a){"onrelease"==b&&playerDiagnostics.updateItemInfo(d);var f,g=function(f,g){$.each(f,function(f,h){if(h.trigger==b&&(!c||"function"!=typeof c||c(a)))h.triggerEvent(d,!0),g=!1});return g};f=g(d.events,!0);d.group&&d.group.events&&d.group.events.length&&(f=g(d.group.events,f));return f})}};
StageItem.prototype.bindVarListener=function(a,b){if(void 0===b||isNaN(b))b=0;for(var c=0;c<this.events.length;c++){var d=this.events[c];if("onvarchanged"==d.trigger&&d.varname==a&&d.boundByItemID==this.id)return d}d=new StoryEvent(this);d.trigger="onvarchanged";d.varname=a;d.boundByItemID=this.id;d.filter=function(b){return b==a};c=new TimelineAction(this);c.type="HandleBoundVarChanged";c.item=this;d.actions.push(c);this.events.push(d);c=this.parseObjref(a);c.target.registerVariableEventSubscriber(this,
c.variable,b);return d};
StageItem.prototype.renderTextTemplate=function(){function a(b,c){var d=parseInt($(c).attr("data-font-size"));d||(d=parseInt($(c).css("font-size").replace("px","")),$(c).attr("data-font-size",d));d=Math.floor(d*g);$(c).css("font-size",d+"px");$.each($(c).children(),a)}function b(b){for(;f.get(0).clientHeight>c.textTemplateHeight&&10>h++;)g-=b,a(0,f)}var c=this,d=c.textTemplate;if(d){var d=d.replace(/pt'/ig,"px'"),e=d.match(/\&(.*?);/g);e&&$.each(e,function(a,b){var e=b.replace(/\&|\$|;/g,""),f=c.extractVariable(e);
if(null===f||"undefined"===typeof f)f="";!isNaN(parseFloat(f))&&isFinite(f)&&(f=Math.round(100*parseFloat(f))/100);d=d.replace(b,f);c.bindVarListener(e)});if(!c.contentRef)c.contentRef=c.ref;c.contentRef.empty();var f=$(d);f.find("textformat").each(function(a,b){if(""==b.innerHTML)b.innerHTML=" ";var c=$(b),d=parseInt(c.attr("blockindent")),e=parseInt(c.attr("indent"));0<d&&0==e&&(c.css("padding-left",d+"px"),c.css("display","block"))});if(!StageItem.contentSizer)StageItem.contentSizer=$("<div class='contentsizer'></div>"),
$(document.body).append(StageItem.contentSizer);StageItem.contentSizer.css("width",c.textTemplateWidth);StageItem.contentSizer.append(f);var g=1,h=0;b(0.05);1>g&&(g+=0.05,a(0,f),b(0.01));e=$('<div class="vertical-group"></div>');e.append(f);c.contentRef.append(e);e=c.textTemplateTop+VectorShape.VARTEXT_MARGIN_TOP;c.contentRef.css("left",c.textTemplateLeft+VectorShape.VARTEXT_MARGIN_LEFT-c.xoffset+"px");c.contentRef.css("top",e+"px");c.contentRef.css("width",c.textTemplateWidth+"px");c.contentRef.css("height",
c.textTemplateHeight+"px");f.find("a").each(function(a,b){$(b).click(function(){var a=b.href.replace("event:","");c.handleEvent("onlinkrelease",a,null,!1,!1,!0);return!1})})}};StageItem.prototype.getBitMask=function(){return this.lastRenderedState&&this.stateMasks&&this.stateMasks[this.lastRenderedState]?this.stateMasks[this.lastRenderedState]:this.bitMask};
StageItem.prototype.fixRef=function(){if(!this.isState&&this.ref.get(0).id){var a=$("#"+this.ref.get(0).id);if(a.get(0)&&this.ref.get(0)!=a.get(0))this.ref=a}};
StageItem.prototype.getAABB=function(){var a=this,b=5E3,c=5E3,d=-5E3,e=-5E3;$.each([[0,0],[this.width,0],[this.width,this.height],[0,this.height]],function(f,g){var h=a.matrix.transformPoint(g[0]-a.xoffset,g[1]-a.yoffset),j=h.x,h=h.y;j<b&&(b=j);j>d&&(d=j);h<c&&(c=h);h>e&&(e=h)});player.showDebugOverlap&&player.testContext&&setTimeout(function(){player.testContext.strokeStyle="rgba(0,0,255,0.5)";player.testContext.strokeRect(b,c,d-b,e-c)},0);return new ppRect(b,c,d,e)};
StageItem.prototype.GetBoundingRect=StageItem.prototype.getAABB;
StageItem.prototype.getAABB_simple=function(){if(0==this.rotation){var a={};a.left=this.x+this.dragX;a.top=this.y+this.dragY;a.right=this.x+this.dragX+this.width;a.bottom=this.y+this.dragY+this.height;return a}var a={left:5E3,top:5E3,right:-5E3,bottom:-5E3},b=[[-this.width/2,-this.height/2],[this.width/2,-this.height/2],[this.width/2,this.height/2],[-this.width/2,this.height/2]],c=Math.cos(this.rotation*Math.PI/180),d=Math.sin(this.rotation*Math.PI/180);$.each(b,function(b,f){x=-f[0]*c+f[1]*d;y=f[0]*
d-f[1]*c;if(x<a.left)a.left=x;if(x>a.right)a.right=x;if(y<a.top)a.top=y;if(y>a.bottom)a.bottom=y});a.left+=this.x+this.dragX+this.rotatexpos;a.top+=this.y+this.dragY+this.rotateypos;a.right+=this.x+this.dragX+this.rotatexpos;a.bottom+=this.y+this.dragY+this.rotateypos;player.showDebugOverlap&&player.testContext&&setTimeout(function(){player.testContext.strokeStyle="rgba(0,0,255,0.5)";player.testContext.strokeRect(a.left,a.top,a.right-a.left,a.bottom-a.top)},0);return a};
StageItem.prototype.testRotatedOverlap=function(a){var b=this.getAABB(),c=a.getAABB(),d,e,f,g;d=BitMask.max(b.left,c.left);e=BitMask.min(b.right,c.right);f=BitMask.max(b.top,c.top);g=BitMask.min(b.bottom,c.bottom);if(b.right<c.left||b.left>c.right||b.bottom<c.top||b.top>c.bottom)return!1;if(player.showDebugOverlap){if(!player.testCanvas)player.testCanvas=$("<canvas id='test' width='1000' height='1000' style='position:absolute;z-index:200;left:0px;top:0px;'></canvas>"),$("#slideframe").append(player.testCanvas),
player.testContext=player.testCanvas.get(0).getContext("2d"),player.testContext.fillStyle="rgba(255,255,0,0.5)";player.testCanvas.show();clearTimeout(player.testCanvasClear);player.testCanvasClear=setTimeout(function(){player.testCanvas.hide()},1E3);if(!player.showDebugOverlapPersistent)player.testContext.clearRect(0,0,1E3,1E3),player.testContext.fillStyle="rgba(0,255,255,0.2)",player.testContext.fillRect(b.left,b.top,b.right-b.left,b.bottom-b.top),player.testContext.fillStyle="rgba(0,0,255,0.2)",
player.testContext.fillRect(c.left,c.top,c.right-c.left,c.bottom-c.top),player.testContext.strokeStyle="rgba(255,0,255,0.8)",player.testContext.strokeRect(d,f,e-d,g-f)}b=e-d;g=b*(g-f);c=Math.max(Math.min(parseInt(g/256),64),1);for(e=0;e<g;e+=c){var h=d+e%b,j=f+Math.floor(e/b);if(player.showDebugOverlap)this.isPointActive(h,j)?a.isPointActive(h,j)?a.isPointObscured(h,j,this,function(a){return a.dropArea})?(player.testContext.fillStyle="rgba(255,0,0,0.9)",player.testContext.fillRect(h-1,j-1,2,2)):(player.testContext.fillStyle=
"rgba(0,255,0,0.9)",player.testContext.fillRect(h-2,j-2,4,4)):(player.testContext.fillStyle="rgba(255,255,0,0.9)",player.testContext.fillRect(h-1,j-1,2,2)):(player.testContext.fillStyle=a.isPointActive(h,j)?"rgba(0,0,0,0.5)":"rgba(100,100,100,0.2)",player.testContext.fillRect(h-1,j-1,2,2));if(this.isPointActive(h,j)&&a.isPointActive(h,j)&&!a.isPointObscured(h,j,this,function(a){return a.dropArea}))return!0}return!1};var Layer=function(a,b){this.container=a||$(document.body);this.ref=null;this.constructElement();this.timelineEvents=[];this.clips=[];this.duration=10;this.active=!0;this.slide=b;this.layer=null;this.offsetParent=this.parent=b;this.transitionedIn=this.viewed=!1;this.timeline=new Timeline(this)};Layer.prototype=new StageItem;Layer.prototype.objectType="Layer";Layer.prototype.innerType="Layer";
Layer.prototype.getItemIndex=function(){var a=this,b=0,c=-1;if(this.itemIndex)return this.itemIndex;$.each(this.slide.children,function(d,e){"Layer"==e.innerType&&(e==a&&(c=b),b++)});return this.itemIndex=c};
Layer.prototype.restoreFromResumeData=function(a){this.compactResumeData=a;var b=[];this.deepEach(function(a,c){c.resume&&"ShuffleGroup"!=c.innerType&&b.push(c)});a=new bwChunk(a);this.timeline.setResumeTime(bwChunk.BaseNto10(a.Data(),a.Length()));for(var a=a.NextChunk(),a=new bwChunk(a.Data()),c=0;!a.isNothing;){var d=b[c];d&&d.restoreFromResumeData(a.ChunkData());a=a.NextChunk();c++}};
Layer.prototype.getResumeData=function(){var a="";if(this.resume&&this.viewed){var b="",c="";this.deepEach(function(a,c){c.resume&&"ShuffleGroup"!=c.innerType&&(b+=bwChunk.CreateChunk(c.GetResumeData()))});this.clips.forEach(function(a){"audio"==a.innerType&&(c+=bwChunk.CreateChunk(a.GetResumeData()))});var d=bwChunk.Base10toN(this.timeline.getCurrentTime()),a=a+bwChunk.CreateChunk(d),a=a+bwChunk.CreateChunk(b),a=a+bwChunk.CreateChunk(c);this.hasVariables()&&(a+=this.getVariableResumeData())}return a};
Layer.prototype.toBaseData=Element.prototype.toData;Layer.prototype.toData=function(){var a=this.toBaseData();a.currentTime=this.timeline.getCurrentTime();return a};Layer.prototype.updateBaseFromData=Element.prototype.updateFromData;Layer.prototype.updateFromData=function(a){this.updateBaseFromData(a);this.timeline.setResumeTime(a.currentTime)};
Layer.prototype.loadFromXML=function(a){var b=this;this.id=$(a).attr("id");this.modal="true"==$(a).attr("modal");this.resume="true"==$(a).attr("resume");this.pauseparent="true"==$(a).attr("pauseparent");this.depth=parseInt($(a).attr("depth"));this.enableseek="true"==$(a).attr("enableseek");this.enablereplay="true"==$(a).attr("enablereplay");this.hideobjectsondisplay=$(a).children("hideobjectsondisplay").children();this.rotatexpos=Math.round($(a).attr("rotatexpos"))||0;this.rotateypos=Math.round($(a).attr("rotateypos"))||
0;this.loadChildrenFromXML(a,b.slide,b,function(a){a.canSimplify=!1});$(a).children("audiolib").children("audio").each(function(a,d){var e=new Audio;e.loadFromXML(d,b.slide,b);e.createRef();b.children[e.id]=e});this.timeline.loadFromXML(a);$(a).children("background").each(function(a,d){b.background=new Background(b.ref);b.background.loadFromXML(d);if(!b.background.src)b.backgroundReady=!0;b.ref&&b.background.apply(b.ref)});this.loadElementInfoFromXML(a);this.loadAnimationsFromXML(a);this.depth=++this.slide.topZ;
this.type="layer"};Layer.prototype.resetElement=Element.prototype.reset;Layer.prototype.reset=function(a){this.resume?player.useCompactResume&&this.compactResumeData?this.restoreFromResumeData(this.compactResumeData):this.resumeData&&this.updateFromData(this.resumeData):(this.resetElement(a),this.deepEach(function(a,c){"Interaction"!=c.innerType&&c.reset()}),this.transitionedIn=!1,a||(this.setVisible(!1),this.ref&&this.ref.hide()),this.timeline.resetTimeline())};Layer.prototype.createBaseRef=StageItem.prototype.createRef;
Layer.prototype.destroyBaseRef=StageItem.prototype.destroyRef;Layer.prototype.createRef=function(){if(this.ref||!this.createBaseRef())return!1;this.ref.removeClass("item");this.ref.addClass("layer");this.background&&this.background.apply(this.ref);this.ref.css("display","none");return!0};Layer.prototype.destroyRef=function(){this.timeline&&this.timeline.destroyRef();this.destroyBaseRef()};Layer.prototype.getTimeline=function(){return this.slide.timeline};
Layer.prototype.triggerShowComplete=function(){this.transitioning=!1;if(this.visible){this.handleEvent("ontransitionincomplete",null,null,!1,!0);this.timeline.playTimeline();if("oncomplete"==this.hideOthers){var a=this;$.each(player.currentSlide().layers,function(b,c){c!=a&&c.hide()})}this.transitionedIn=!0;this.handleEvent("onslidestart",null,null,!1,!0)}};
Layer.prototype.show=function(a,b){$(".currentlayer").removeClass("currentlayer");this.ref.addClass("currentlayer");if("onstart"==this.hideOthers){var c=this;$.each(player.currentSlide().layers,function(a,b){b!=c&&b.hide()})}if(this.visible)this.depth=++this.slide.topZ,this.ref.css("z-index",this.depth);else{a||(a=new EventInfo("",-1,this.slide.timeline,!0));this.createRef(this.parent.ref);this.ref.css("display","block");this.viewed=!0;player.modalLayer=null;if(this.modal){if(!this.modalfence)this.modalfence=
$("<div class='modalfence'></div>"),this.parent.ref.append(this.modalfence),this.modalfence.bind("click",function(){return!1});player.modalLayer=this;this.modalfence.show()}this.slide.addToLayerStack(this);this.depth=++this.slide.topZ;this.ref.css("z-index",this.depth);this.resume&&this.compactResumeData&&this.restoreFromResumeData(this.compactResumeData);this.timeline.initDisplay();player.timelineManager.addTimeline(this.timeline);this.setVisible(!0);if(b&&0<b.duration){var d=this;b.convertToAnimation(this,
!0).start(this,b.reverse,new EventInfo("",-1,player.timelineManager,!0),function(){d.triggerShowComplete()});this.setOnStage(!0);this.handleEvent("ontransitionin",null,null,!1,!0)}else this.runningTransition=null,this.setOnStage(!0),this.handleEvent("ontransitionin",null,null,!1,!0),this.triggerShowComplete()}};Layer.prototype.emptyLayer=function(){this.timelineEvents=[]};
Layer.prototype.hide=function(a){if(this.visible){this.timeline.pauseTimeline();$.each(this.clips,function(a,b){b.timelinePaused()});player.timelineManager.removeTimeline(this.timeline);this.setVisible(!1);player.modalLayer=null;var b=this,c=function(){b.ref.css("display","none");b.handleEvent("ontransitionoutcomplete",null,null,!1,!0);b.modalfence&&b.modalfence.hide();b.destroyWebobjects();b.resume?b.compactResumeData=b.getResumeData():b.reset();b.timeline.getIsActiveTimeline()&&player.timelineManager.setActiveTimeline(b.slide.timeline);
b.slide.removeFromLayerStack(b);b.setOnStage(!1)};b.handleEvent("ontransitionout",null,null,!1,!0);a&&0!=a.duration?(a.setTarget(this),a.apply(function(){c()},null,null,"ease-out",new EventInfo("",b.slide.timeline.getCurrentTime(),b.slide.timeline,!0))):(b.runningTransition=null,c())}};Layer.prototype.hideBaseObjects=function(){for(var a=0;a<this.hideobjectsondisplay.length;a++){var b=this.parseObjref($(this.hideobjectsondisplay[a]).attr("value")).target;if(b.visible)b.hiddenByLayer=!0,b.quickHide()}};
Layer.prototype.restoreBaseObjects=function(){for(var a=0;a<this.hideobjectsondisplay.length;a++){var b=this.parseObjref($(this.hideobjectsondisplay[a]).attr("value")).target;if(b.hiddenByLayer)b.hiddenByLayer=!1,b.quickShow()}};Layer.prototype.destroyWebobjects=function(){$.each(this.children,function(a,b){b.destroyWebobjects&&b.destroyWebobjects()})};Layer.prototype.play=function(){this.timeline.playTimeline()};Layer.prototype.pause=function(){this.timeline.pauseTimeline()};
Layer.prototype.notifyTimelinePlayed=function(){for(var a=0;a<this.clips.length;a++)this.clips[a].timelinePlayed()};Layer.prototype.notifyTimelinePaused=function(){for(var a=0;a<this.clips.length;a++)this.clips[a].timelinePaused()};Layer.prototype.triggerTimelineComplete=function(){this.handleEvent("ontimelinecomplete");this.slide.checkAllOpenTimelinesComplete()};var SlideFrame=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.active=!0};SlideFrame.prototype=new StageItem;SlideFrame.prototype.innerType="SlideFrame";SlideFrame.prototype.objectType="Item";
SlideFrame.prototype.loadFromXML=function(a){var b=this;this.id=$(a).attr("id");this.resume=$(a).attr("resume");this.shapemaskid=$(a).attr("shapemaskid");this.xscale=parseInt($(a).attr("xscale"));this.yscale=parseInt($(a).attr("yscale"));this.alpha=parseInt($(a).attr("alpha"));this.scrolling=$(a).attr("scrolling");this.startingslide=$(a).attr("startingslide");this.scalecontents="true"==$(a).attr("scalecontents");this.xml=a;this.loadElementInfoFromXML(a);this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);
if(this.shapemaskid=$(a).attr("shapemaskid"))if(a=this.parseObjref(this.shapemaskid).target,"vectorshape"==a.innerType)a.isShapeMask=!0;$(b.xml).children("background").each(function(a,d){b.background=new Background(b.ref);b.background.loadFromXML(d)});this.canSimplify=!1};SlideFrame.prototype.createBaseRef=StageItem.prototype.createRef;SlideFrame.prototype.destroyBaseRef=StageItem.prototype.destroyRef;
SlideFrame.prototype.createRef=function(){if(this.ref||!this.createBaseRef())return!1;this.background&&this.background.apply(this.ref);return!0};SlideFrame.prototype.destroyRef=function(){this.destroyBaseRef()};SlideFrame.prototype.pauseMyFramedSlides=function(){var a=this;$.each(player.framedSlides,function(b,c){c==a.framedSlide&&c.pauseClips()})};SlideFrame.prototype.pauseOtherFramedSlides=function(){var a=this;$.each(player.framedSlides,function(b,c){c!=a.framedSlide&&c.pauseClips()})};
SlideFrame.prototype.showSlide=function(a){var b=this;this.framedSlide=a;player.updateViewCount(a);player.framedSlides[a.id]=a;a.loadContentFromXML();a.offsetParent=b;a.window=player.currentWindow||player;a.blockAndLoad(function(){a.restorePlayerControls();player.hideLoadingSpinner();player.shouldShowLoadingSpinner=!1;clearTimeout(player.loadingSpinnerTimeout);a.createRef();a.ref.hide();a.width<b.width&&a.ref.css("left",parseInt(b.width-a.width)/2);a.height<b.height&&a.ref.css("top",parseInt(b.height-
a.height)/2);b.ref.append(a.ref);setTimeout(function(){if(a.ref){a.ref.show();a.play(!1,!1,a!=player.currentFramedSlide);a.deferredFrameLayoutXML&&a.set_frame_layout(a.deferredFrameLayoutXML);var c;player.neverPreload||setTimeout(function(){a.slideIndex+1<story.allSlides.length&&story.allSlides[a.slideIndex+1].loadContentFromXML()},1E3);a.variables.WindowId=b.slide.variables.WindowId}},0);a.ref.addClass("framed");a.updateMatrixComplete(!0);b.children={};b.children[a.id]=a;a.framedSlides[a.id]=a;a.setVisible(!0);
player.slideLoadQueue.restart()})};SlideFrame.prototype.showBase=StageItem.prototype.show;
SlideFrame.prototype.show=function(a,b,c){if(!this.visible){this.showBase(a,null,c);this.ref.show();a=story.parseObjref(this.startingslide).target;c||this.showSlide(a);this.framedSlide=a;player.currentFramedSlide=a;a.ref&&a.fitToContainer();if(player.hasShownFirstSlide)player.hasAdvanced=!0;player.hasShownFirstSlide=!0;setTimeout(function(){player.currentSlide().saveIfNecessary();story.saveToLocalStorage()},0);a.transitionedIn=!1;a.setVisible(!0);a.handleTransitionIn()}};
SlideFrame.prototype.hideBase=SlideFrame.prototype.hide;SlideFrame.prototype.hide=function(a,b){this.hideBase(a,b);this.pauseMyFramedSlides();this.framedSlide&&(this.framedSlide.hide(),this.framedSlide.unloadContent())};
SlideFrame.prototype.emptyElement=function(){this.events=[];this.actionGroups={};this.content={};this.states={};this.colors={};this.resources=[];this.eventSubscribers=[];this.hotContexts=[];this.matrix=new MatrixTransform;this.isRotated=!1;this.parent=null;this.originalHeight=this.originalWidth=this.originalZ=this.originalY=this.originalX=this.rotation=this.yoffset=this.xoffset=this.rotateypos=this.rotatexpos=this.dragY=this.dragX=this.y=this.x=0;this.animated=!1;this.stateCount=0;this.xml=null};var VectorShape=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="vectorshape";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.deferredResourceIndex=0;this.canvas=this.lastRenderedState=null;this.m_nYOffset=this.m_nXOffset=0;this.height=this.width=1E3;this.maxCharIndex=this.charIndex=0;this.vectorImage=null;this.isShapeMask=this.vectorHot=
!1};VectorShape.prototype=new StageItem;VectorShape.prototype.objectType="Item";VectorShape.prototype.innerType="vectorshape";VectorShape.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;VectorShape.VARTEXT_MARGIN_LEFT=10;VectorShape.VARTEXT_MARGIN_TOP=2;VectorShape.VARTEXT_MARGIN_RIGHT=10;VectorShape.VARTEXT_MARGIN_BOTTOM=2;
VectorShape.prototype.loadFromXML=function(a,b,c){var d=this;this.loadBaseFromXML(a,b,c);this.originalWidth=parseInt($(a).attr("width"));this.originalHeight=parseInt($(a).attr("height"));this.originalX=this.x;this.originalY=this.y;this.xoffset=parseInt($(a).attr("xoffset"));this.yoffset=parseInt($(a).attr("yoffset"));if(0<$(a).children("data").children("textdata").children("vartext").length)this.textlib=$(a).children("data");this.canSimplify=!1;this.maskpath=PathLib.getPathFromXML($(a).children("mask").children("vectordata").children("pr"));
$(a).children("states").children().each(function(a,b){var c=$(b).attr("name"),h=$(b).children("data").children("vectordata"),j={left:h.attr("left"),top:h.attr("top"),right:h.attr("right"),bottom:h.attr("bottom"),path:PathLib.getPathFromXML(h.children("pr")),index:a};if(!j.path||""==j.path)j.path=h.children("path").text();d.states[c]=j;d.stateCount++});this.loadLinksFromXML(a);this.loadMarkerEffectFromXML(a)};
VectorShape.prototype.loadLinksFromXML=function(a){var b=this;$(a).children("textlib").children("textdata").each(function(a,d){var e=$(d).attr("id");$(d).children("linkdata").children("link").each(function(a,c){var d=new LinkArea(b.ref,b.slide,b.layer,e);d.parent=b;d.loadFromXML(c,b.slide,b.layer);b.links[a+"_"+d.id]=d;b.hasLinks=!0})});if(b.hasLinks)b.isPointActive=StageItem.prototype.isPointActive};
VectorShape.prototype.loadMarkerEffectFromXML=function(a){var b=this;$(a).children("imagelib").children("imagedata").each(function(a,d){var e=$(d).attr("url"),f=parseInt($(d).attr("width")),g=parseInt($(d).attr("height"));if(-1<e.indexOf("_swirl.swf"))b.markerEffect={type:"swirl",width:f,height:g};else if(-1<e.indexOf("_glow.swf"))b.markerEffect={type:"glow",width:f,height:g}})};VectorShape.prototype.createBaseRef=StageItem.prototype.createRef;VectorShape.prototype.destroyBaseRef=StageItem.prototype.destroyRef;
VectorShape.prototype.createRef=function(){if(this.ref)return!1;var a=this;if(!this.createBaseRef())return!1;if(!this.contentRef)this.contentRef=$('<div class="item unhideable vartext"></div>');this.ref.append(this.contentRef);this.ref.css("width",a.originalWidth);this.ref.css("height",a.originalHeight);var b=$(a.xml).find("textdata").first().attr("valign");b&&a.contentRef.addClass("v"+b);this.markerEffect&&this.createMarkerEffectRef();b=$('<canvas class="content" width="'+a.originalWidth+'" height="'+
a.originalHeight+'"></canvas>');if(player.useBackgroundCanvasWorkaround)this.imageBufferName="b"+this.getFullObjref().replace(/[^0-9a-zA-Z]+/g,""),b=$('<div class="content" width="'+a.originalWidth+'" height="'+a.originalHeight+'"></div>'),b.css("width",a.originalWidth),b.css("height",a.originalHeight),b.css("background","-webkit-canvas("+this.imageBufferName+")");b.css("position","absolute");b.css("-webkit-transform","translate3d(0px,0px, 0px)");this.ref.append(b);this.jcanvas=b;this.canvas=b.get(0);
this.context=player.useBackgroundCanvasWorkaround?document.getCSSCanvasContext("2d",this.imageBufferName,a.originalWidth,a.originalHeight):this.canvas.getContext("2d");if(window.chrome&&!player.suppressVectorImage)this.vectorImage=document.createElement("img"),this.vectorImage.style.webkitTransform="translate3d(0px,0px, 0px)",this.vectorImage.style.position="absolute",this.ref.append(a.vectorImage);if(this.renderAsBackground)this.altRef=$('<div class="item unhideable alternate"></div>'),this.altRef.css("width",
a.originalWidth),this.altRef.css("height",a.originalHeight),this.ref.append(this.altRef);this.lastRenderedState=null;this.render(a.variables.ObjectState,!0,null,"VectorShape createRef");player.showLinkAreas&&$.each(a.links,function(b,d){d.createRef(a)});a.isShapeMask&&a.ref.remove();return!0};
VectorShape.prototype.createMarkerEffectRef=function(){this.markerEffectRef=$('<canvas class="markereffect" width="'+this.markerEffect.width+'" height="'+this.markerEffect.height+'"></canvas>');this.markerEffectRef.css("position","absolute");var a=this.markerEffectRef.get(0).getContext("2d"),b=this.markerEffect.width/2;switch(this.markerEffect.type){case "swirl":this.markerEffectRef.addClass("spinning");a.moveTo(b,b);a.arc(b,1.1*b,0.87*b,3*Math.PI/2,2*Math.PI,!1);a.lineTo(b,1.4*b);a.closePath();b=
a.createLinearGradient(0,0,0,this.markerEffect.height);b.addColorStop(0,"rgba(255,255,255,0)");b.addColorStop(0.5,"rgba(255,255,255,1)");b.addColorStop(1,"rgba(255,255,255,1)");a.fillStyle=b;a.fill();break;case "glow":this.markerEffectRef=$('<div class="markereffect glowing"></div>'),this.markerEffectRef.css("position","absolute"),this.markerEffectRef.css("width",this.width),this.markerEffectRef.css("height",this.height),this.markerEffectRef.css("border-radius",this.width/2)}this.ref.append(this.markerEffectRef);
this.updateMarkerEffectPosition()};VectorShape.prototype.updateMarkerEffectPosition=function(){if(this.markerEffect)switch(this.markerEffect.type){case "swirl":var a=-(this.markerEffect.height-this.height)/2-this.yoffset;this.markerEffectRef.css("left",-(this.markerEffect.width-this.width)/2-this.xoffset);this.markerEffectRef.css("top",a);break;case "glow":this.markerEffectRef.css("left",-this.xoffset),this.markerEffectRef.css("top",-this.yoffset)}};
VectorShape.prototype.destroyRef=function(){this.destroyBaseRef();if(this.canvas)$(this.canvas).remove(),this.canvas=null;if(null!=this.vectorImage)this.vectorImage.parentNode&&this.vectorImage.parentNode.removeChild(this.vectorImage),this.vectorImage.src="",this.vectorImage=null;if(this.contentRef)this.contentRef.remove(),this.contentRef=null;this.bitMask=this.lastRenderedState=null;this.stateMasks={}};VectorShape.prototype.renderCallback=function(){};
StageItem.prototype.getMask=function(){var a={path:"",offX:0,offY:0,transform:null,type:""};if(this.maskpath)a.path=this.maskpath,a.type="maskpath";else if(this.shapemaskid){var b=this.parseObjref(this.shapemaskid).target;a.path=b.content.path;a.transform=b.currentTransform;a.type="shapemask";a.item=b}return a};
VectorShape.prototype.render=function(a,b,c,d,e,f,g){if(this.ref&&this.visible){if(a)this.nextRenderState=a;else{if(this.nextRenderState)return;a=this.lastRenderedState?this.lastRenderedState:"_default"}this.allResourcesLoaded()?(b=b||this.renderOnUpdateValues&&this.renderOnUpdateValues.queued&&this.renderOnUpdateValues.force,this.renderOnUpdateValues={},this.renderOnUpdateValues.closePathCallback=c,this.renderOnUpdateValues.debugFrom=d,this.renderOnUpdateValues.deferred=e,this.renderOnUpdateValues.strLinkId=
f,this.renderOnUpdateValues.bDoRender=!0,this.renderOnUpdateValues.state=a,this.renderOnUpdateValues.force=b,this.renderScheduled=this.renderOnUpdateValues.queued=!0,g?this.renderOnUpdate():player.addToRenderQueue(this)):(this.lastRenderedState=a,this.blocked=!0)}};VectorShape.prototype.setVisible=function(a){if(a!=this.visible)(this.visible=a)&&this.render()};
VectorShape.prototype.renderOnUpdate=function(){var a=this.renderOnUpdateValues.state,b=this.renderOnUpdateValues.strLinkId;this.renderScheduled=this.renderOnUpdateValues.bDoRender=!1;this.nextRenderState=null;if(this.ref&&!this.destroyed&&this.visible){var c=this;if(this.renderOnUpdateValues.force||a!=c.lastRenderedState)if(c.allResourcesLoaded()){c.blocked=!1;if(!c.canvas)c.canvas=$(this.ref).find("canvas").get(0);if(player.useSafeCanvas)this.ref.css("background-color","#"+parseInt(900*Math.random()+
1100)%1E3);else{c.lastRenderedState=a;c.m_nXOffset=c.xoffset;c.m_nYOffset=c.yoffset;c.width=c.width;c.height=c.height;var d=new ppTextLib(c.xml),e=c.content.path;if(c.states[a])e=c.states[a].path,c.rectShape=new ppRect(c.states[a].left,c.states[a].top,c.states[a].right,c.states[a].bottom);else if(this.originalRectShape)this.rectShape=this.originalRectShape;if(c.rectShape&&0==c.rectShape.right&&0==c.rectShape.bottom)c.rectShape.right=c.width,c.rectShape.bottom=c.height;if(e){var f=c.getMask(),g=f.path,
h=this.context=player.useBackgroundCanvasWorkaround?document.getCSSCanvasContext("2d",this.imageBufferName,c.originalWidth,c.originalHeight):this.canvas.getContext("2d"),j=null;g&&"shapemask"==f.type&&f.item.registerVariableEventSubscriber(c,"animationstep");g&&(j=function(a){h.setTransform(1,0,0,1,0,0);f.item&&(f.item.m_nXOffset!=a.offX||f.item.m_nYOffset!=a.offY)&&h.translate(f.item.m_nXOffset-a.offX,f.item.m_nYOffset-a.offY);if(null!=f.transform&&null!=f.transform.scale&&!isNaN(f.transform.scale.x)){if(0==
f.transform.scale.y)f.transform.scale.y=1.0E-6;if(0==f.transform.scale.x)f.transform.scale.x=1.0E-6;h.scale(f.transform.scale.x/100,f.transform.scale.y/100)}ppMask.DrawPath(h,c.rectShape,g,f.offX,f.offY);h.closePath();h.clip();h.setTransform(1,0,0,1,0,0);if(player.drawMaskDebugShapes){if(!c.debugMaskContext)a=$('<canvas class="content" width="'+c.width+'" height="'+c.height+'" style="border:solid 1px #000;margin:5px;"></canvas><textarea>'+g+"</textarea>"),$(document.body).append(a),c.debugMaskContext=
a.get(0).getContext("2d");c.debugMaskContext.fillStyle="#ccc";c.debugMaskContext.strokeStyle="#000";c.debugMaskContext.clearRect(0,0,1E3,1E3);c.debugMaskContext.fillRect(0,0,1E3,1E3);c.debugMaskContext.fillStyle="#000";c.debugMaskContext.beginPath();ppMask.DrawPath(c.debugMaskContext,c.rectShape,g,f.offX,f.offY);c.debugMaskContext.fill();c.debugMaskContext.fillStyle="#66f";c.debugMaskContext.font="10px sans-serif";c.debugMaskContext.fillText(c.getFullObjref(),0,20)}});ppArt.itemID=c.id;ppArt.item=
c;ppArt.m_bMaskMode=!1;ppArt.DrawVector(c,e,d,player.fontlib,c.imagelib,b,j);if(this.overStepped)c.height=c.requiredRenderHeight,c.rectShape.bottom=c.height,ppArt.DrawVector(c,e,d,player.fontlib,c.imagelib,b,j),console.warn("Vectorshape Overstep",c.id,c);c.imageBitMaskInfo=ppArt.m_arrMaskRefs&&0<ppArt.m_arrMaskRefs.length?ppArt.m_arrMaskRefs[0]:null;ppArt.m_bRenderOnSlideBg&&c.slide&&c.slide.renderBgLoadStack.push(c);if(0>=c.canvas.width&&0>=c.canvas.height)c.canvas.width=1,c.canvas.height=1;if(null!=
c.vectorImage)try{var l=c.canvas.toDataURL("image/png");c.canvas.style.visibility="hidden";c.vectorImage.src=l}catch(m){c.canvas.style.visibility="visible",c.vectorImage.style.visibility="hidden"}if(player.drawMaskDebugShapes&&c.debugMaskContext){if(!c.debugCopyContext)b=$('<canvas class="content" width="'+c.width+'" height="'+c.height+'" style="border:solid 1px #000;margin:5px;"></canvas>'),$(document.body).append(b),c.debugCopyContext=b.get(0).getContext("2d");c.debugCopyContext.fillStyle="#ccc";
c.debugCopyContext.fillRect(0,0,1E3,1E3);c.debugCopyContext.drawImage(c.canvas,0,0,c.width,c.height,0,0,c.width,c.height)}for(var k in c.links)if(b=c.links[k],d=ppArt.m_listTextOffsets[b.textid])b.linkdx=d.x,b.linkdy=d.y;c.m_nXOffset=Math.round(c.m_nXOffset);c.m_nYOffset=Math.round(c.m_nYOffset);if(c.m_nXOffset!=c.xoffset||c.m_nYOffset!=c.yoffset)c.xoffset=c.m_nXOffset,c.yoffset=c.m_nYOffset,c.applySize(c.ref),this.updateMarkerEffectPosition&&c.updateMarkerEffectPosition();if(a&&!c.stateMasks)c.stateMasks=
{};k=function(a){var b=null;if(player.usePixelTesting)return new BitMask(!0,c.width,c.height);if(a){var d=null;a.maskRef&&(d=player.bitmasks[a.maskRef]);if(a.isOpaque||!d)return new BitMask(!0,a.width*a.scaleX,a.height*a.scaleY,a.width,a.height,c.xoffset,c.yoffset);b=new BitMask(!1,a.width*a.scaleX,a.height*a.scaleY,a.width,a.height,c.xoffset,c.yoffset);b.loadFromRLE(d);b.pixels&&!b.isOpaque&&(c.width!=c.canvas.width||c.height!=c.canvas.height)&&b.resize(c.canvas.width,c.canvas.height,-c.xoffset,
-c.yoffset);return b}if(c.hasLinks)return new BitMask(!0,c.canvas.width,c.canvas.height,c.canvas.width,c.canvas.height,c.xoffset,c.yoffset);b=new BitMask(!1,c.canvas.width,c.canvas.height);if(!c.context)c.context=c.canvas.getContext("2d");try{b.loadFromContext(c.context)}catch(e){b.isOpaque=!0}return b};if(a&&!c.stateMasks[a])c.stateMasks[a]=k(c.imageBitMaskInfo);else if(!c.bitMask||c.bitMask.isOpaque)c.bitMask=k(c.imageBitMaskInfo);player.showBitmask&&c.showBitmask&&c.showBitmask()}c.renderForeground&&
c.renderForeground();c.updateDragPosition&&c.dragging&&c.updateDragPosition()}}else c.lastRenderedState=a,c.blocked=!0}this.renderOnUpdateValues.queued=!1};VectorShape.prototype.showBitmask=function(){var a=this.getBitMask();if(!this.debugMask)this.debugMask=document.createElement("canvas"),this.ref.append(this.debugMask),this.debugMask.style.webkitTransform="translate3d("+a.xoffset+"px,"+a.yoffset+"px, 0px)",this.debugMask.style.position="absolute";a.drawDebug(this.debugMask)};
VectorShape.prototype.renderForeground=function(){if(this.textlib)this.ref.addClass("textlib"),this.textTemplate||this.updateTextTemplate(),this.renderTextTemplate();else if(this.hasImagelib){if(!this.image)this.image=new Image,this.image.src=this.content.src;this.ref.css("background","url("+escape(this.image.src)+")");this.ref.removeClass("failedcanvas")}};VectorShape.prototype.resetStageItem=StageItem.prototype.reset;
VectorShape.prototype.reset=function(a,b){this.resetStageItem(a,b);if(this.ref)this.x=this.originalX,this.y=this.originalY};var Media=function(){this.playState=0;this.syncToTimeline=this.playOnUnblock=this.blocked=!1;this.syncTargetTimeline=null;this.triggerTime=-1;this.autoplay=!1;this.autoplayTime=-1;this.autoplayTimeline=null;this.isMedia=!0;this.mediaParent=null;this.silentMode=!1;this.intervalSilent=null};Media.prototype=new StageItem;Media.playState={PAUSED:0,TIMELINE_PAUSED:1,VIDEO_BUSY:2,BLOCKED_PLAYING:3,PLAYING:4,COMPLETE:5};Media.prototype.destroyMediaBaseRef=StageItem.prototype.destroyRef;
Media.prototype.resetStageItem=StageItem.prototype.reset;Media.prototype.resetElement=Element.prototype.reset;Media.prototype.debug_trace=function(){};Media.prototype.getTimelineAncestor=function(){for(var a=this.parent,b=4;a&&0<b--;){if("Layer"==a.innerType||"Slide"==a.innerType)return a;a=this.parent}return this.slide};Media.prototype.renderCallback=function(){};Media.prototype.render=function(){};
Media.prototype.setMediaSyncInfo=function(a,b){if("TimelineEvent"==a.type){if(this.syncToTimeline=!0,this.syncTargetTimeline=a.timeline,this.triggerTime=a.time,b)this.autoplayTime=this.triggerTime,this.autoplayTimeline=this.syncTargetTimeline}else this.autoplay&&b?(this.syncToTimeline=!0,this.syncTargetTimeline=this.autoplayTimeline,this.triggerTime=this.autoplayTime):this.syncToTimeline=!1};
Media.prototype.blockOnMe=function(){if(!this.destroyed){if(this.checkReady){var a=this;if(!this.readyInterval)this.readyInterval=setInterval(function(){a.checkReady()},30)}player.block(this)}};Media.prototype.unblockIfBlocked=function(){clearInterval(this.readyInterval);this.readyInterval=null;player.unblock(this)};Media.prototype.addToBlockableMedia=function(){this.destroyed||player.addToBlockableMedia(this)};Media.prototype.removeFromBlockableMedia=function(){this.blocked=!1;player.removeFromBlockableMedia(this)};
Media.prototype.actionOnUnblocked=function(){if(this.playOnUnblock)this.blocked=!1,this.playClip()};Media.prototype.readyOrLoad=function(){return!0};
Media.prototype.timelinePaused=function(){if(this.autoplay&&this.syncTargetTimeline&&(this.syncToTimeline=!0,this.playState==Media.playState.PAUSED))this.playState=Media.playState.PLAYING;if(this.playState!=Media.playState.PAUSED&&this.playState!=Media.playState.COMPLETE)this.playOnUnblock=!1,this.removeFromBlockableMedia(),this.pauseSimple(),this.playState=Media.playState.TIMELINE_PAUSED};
Media.prototype.timelinePlayed=function(){if(this.playState!=Media.playState.PAUSED&&this.playState!=Media.playState.COMPLETE)if(this.blocked)this.playState=Media.playState.BLOCKED_PLAYING,this.playOnUnblock=!0,this.addToBlockableMedia();else if(!this.getIsPlaying())this.playState=Media.playState.TIMELINE_PAUSED,this.playClip()};Media.prototype.timelineSetup=function(){this.playState=Media.playState.TIMELINE_PAUSED};
Media.prototype.playClip=function(){this.playOnUnblock=!0;this.addToBlockableMedia();if(this.readyOrLoad()){if(player.blocked)return this.playState=Media.playState.BLOCKED_PLAYING,this.blocked=!0,!1;this.playState=Media.playState.PLAYING;return!0}this.playState=Media.playState.BLOCKED_PLAYING;this.blocked=!0;this.blockOnMe();return!1};
Media.prototype.pauseClip=function(){this.playOnUnblock=!1;this.removeFromBlockableMedia();this.unblockIfBlocked();if(this.playState!=Media.playState.COMPLETE)this.playState=Media.playState.PAUSED};Media.prototype.pauseOnBlock=function(){if(this.playState.PLAYING||this.playState.BLOCKED_PLAYING)this.playOnUnblock=!0;this.pauseSimple()};Media.prototype.pauseSimple=function(){};
Media.prototype.destroyRef=function(){this.removeFromBlockableMedia();this.unblockIfBlocked();clearTimeout(this.timeoutSilent);this.timeoutSilent=!0;this.syncTargetTimeline=this.autoplayTimeline=this.mediaParent=null;this.destroyMediaBaseRef()};Media.prototype.reset=function(a){this.isVideo?this.resetStageItem(a):this.resetElement(a);if(!a)this.playState=Media.playState.PAUSED,this.playOnUnblock=this.blocked=!1,this.removeFromBlockableMedia(),this.unblockIfBlocked()};
Media.prototype.getIsPlaying=function(){return this.playState==Media.playState.PLAYING||this.playState==Media.playState.BLOCKED_PLAYING};Media.prototype.setMeSilentMode=function(){this.pauseClip();this.silentMode=!0};Media.prototype.timelinePlayedSilent=function(){if(this.playState!=Media.playState.PAUSED&&this.playState!=Media.playState.COMPLETE)this.playState=Media.playState.PLAYING,this.playClipSilent()};
Media.prototype.timelinePausedSilent=function(){if(this.playState!=Media.playState.PAUSED&&this.playState!=Media.playState.COMPLETE)this.playState=Media.playState.TIMELINE_PAUSED};Media.prototype.playClipSilent=function(){this.playState=Media.playState.PLAYING;var a=this;if(null==this.timeoutSilent)this.timeoutSilent=setTimeout(function(){a.handleEvent("onmediacomplete")},500)};Media.prototype.pauseClipSilent=function(){this.playState=Media.playState.PAUSED};var Audio=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="audio";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.audioRef=null;this.playing=!1;this.xml="";this.audioLoaded=this.playOnDecode=this.decodeOnLoad=this.decoding=this.decoded=!1};Audio.masterVolume=0.8;Audio.prototype=new Media;
Audio.prototype.objectType="Item";Audio.prototype.innerType="audio";Audio.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;Audio.prototype.resetMedia=Media.prototype.reset;Audio.prototype.destroyBaseRef=Media.prototype.destroyRef;Audio.prototype.playClipBase=Media.prototype.playClip;Audio.prototype.pauseClipBase=Media.prototype.pauseClip;
Audio.prototype.GetResumeData=function(){var a="";if(this.slide.resume){a=0;this.syncToTimeline&&(a+=1);this.playing&&(a+=2);if(this.playing||this.m_bResumeOnSeek)a+=4;a=a.toString()}return a};Audio.prototype.SetResumeData=function(a){if(0<a.length)a=parseInt(a,10),this.syncToTimeline=0<(a&1),this.m_bResumeOnSeek=0<(a&4)};
Audio.prototype.loadFromXML=function(a,b,c){this.parent=c?c:b;this.slide=b;this.layer=c;this.children={};this.xml=a;this.id=$(a).attr("id");this.loadElementInfoFromXML(a);this.content.src=player.basepath+$(a).attr("url");this.content.duration=parseInt($(a).attr("duration"));this.duration=this.content.duration;c&&c.clips&&c.clips.push?(c.clips.push(this),this.layered=!0):b&&b.clips&&b.clips.push&&b.clips.push(this);if(!this.resource&&this.slide)this.resource=this.createResource(this.slide,this.content.src)};
Audio.prototype.createRef=function(){if(this.ref)return!1;if(player.silentMode)return this.setSilent(),!0;var a=this;this.container=$(document.body);this.ref=$('<audio preload="auto" src="'+a.content.src+'"></audio>');this.container.append(this.ref);this.audioRef=this.ref.get(0);this.audioRef.item=this;this.ref.bind("canplay",function(){a.checkReady()});this.ref.bind("timeupdate",function(){a.checkReady()});this.ref.bind("error",function(){a.onLoadError()});this.ref.bind("stalled",function(){a.onLoadError()});
this.ref.bind("ended",function(){a.playState=Media.playState.COMPLETE;a.handleEvent("onmediacomplete")});this.ref.bind("play",function(){a.correctPosition()});return!0};Audio.setMasterVolume=function(a){Audio.masterVolume=a};Audio.prototype.checkReady=function(){this.audioRef&&3<=this.audioRef.readyState&&this.unblockIfBlocked()};Audio.prototype.onLoadError=function(){this.setSilent()};
Audio.prototype.correctPosition=function(){if(!isNaN(this.correctedPosition)&&this.shouldSetPosition)try{this.setCurrentTime(me.correctedPosition),this.shouldSetPosition=!1}catch(a){}};Audio.prototype.destroyRef=function(){this.pauseClip();this.audioRef=this.audioRef.item=null;this.destroyBaseRef()};Audio.prototype.reset=function(a){this.resetMedia(a);if(!a)this.pauseClip(),this.currentTime=0};Audio.prototype.readyOrLoad=function(){return this.audioRef&&3<=this.audioRef.readyState?!0:!1};
Audio.prototype.playClip=function(){if(this.playState!=Media.playState.PLAYING){if(this.syncToTimeline&&this.syncTargetTimeline&&0<=this.triggerTime)this.currentTime=(this.syncTargetTimeline.getCurrentTime()-this.triggerTime)/1E3;if(0>this.currentTime||1E3*this.currentTime>=this.content.duration)return this.pauseClip(),!1;if(!this.playClipBase())return!1;if(this.audioRef&&this.audioRef.play){if(this.currentTime!=this.audioRef.currentTime&&void 0!==this.currentTime)try{this.setCurrentTime(this.currentTime)}catch(a){}try{this.audioRef.play(),
this.audioRef.volume=Math.min(Audio.masterVolume*player.clipVolume,1)}catch(b){this.setSilent()}}return!0}};Audio.prototype.pauseClip=function(){this.pauseSimple();this.pauseClipBase()};Audio.prototype.pauseSimple=function(){if(this.audioRef&&this.audioRef.pause)try{this.audioRef.pause()}catch(a){}};Audio.prototype.getCurrentTime=function(){return this.audioRef?this.audioRef.currentTime:0};
Audio.prototype.setCurrentTime=function(a){if(this.audioRef&&(1E3*a<player.TICK_DURATION&&(a=0),0.5<Math.abs(a-this.audioRef.currentTime)))this.audioRef.currentTime=a};Audio.prototype.setSilent=function(){var a=this.getIsPlaying();this.setMeSilentMode();this.playClip=Media.prototype.playClipSilent;this.pauseClip=Media.prototype.pauseClipSilent;this.timelinePlayed=Media.prototype.timelinePlayedSilent;this.timelinePaused=Media.prototype.timelinePausedSilent;a&&this.playClip()};
Audio.prototype.setVolume=function(a){if(this.ref)this.ref.get(0).volume=a};var Video=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="video";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.isVideo=this.isMedia=!0;this.videoDisabled=!1;this.posterCanvas=null;this.showPlay=!0;this.videoref=this.poster=null;this.readyCount=0;this.ios7iPhone=player.isIPhone&&player.isIOS7;var d=this;this.onLoadError=
function(){d.setLoadError()};this.onMediaReady=function(){d.setMediaReady()};this.onMediaCompleted=function(){d.setMediaComplete()};this.onPosterClicked=function(){d.posterClicked()};this.onPosterLoaded=function(){d.posterLoaded()};this.xml=""};Video.createSingleVideoRef=function(){if(player.isMobile&&!Video.singleVideoRef)Video.singleVideoRef=document.createElement("video"),Video.singleVideoRef.setAttribute("src",""),Video.singleVideoRef.style.position="absolute"};
Video.iOSPrepare=function(){Video.restrictedMode=player.isMobile;Video.restrictedMode&&Video.singleVideoRef&&(Video.singleVideoRef.load(),Video.singleVideoRef.play())};
Video.requestVideoRef=function(a,b){if(Video.restrictedMode)return b||null==Video.currentOwner||Video.currentOwner.destroyed||!Video.currentOwner.getIsPlaying()||Video.currentOwner.slide!=a.slide?(Video.currentOwner&&!Video.currentOwner.destroyed&&Video.currentOwner.releaseVideo(),Video.currentOwner=a,Video.singleVideoRef):null;var c=document.createElement("video");c.style.position="absolute";return c};Video.currentOwner=null;Video.prototype=new Media;Video.prototype.objectType="Item";
Video.prototype.innerType="video";Video.prototype.createBaseRef=StageItem.prototype.createRef;Video.prototype.showBase=StageItem.prototype.show;Video.prototype.resetMedia=Media.prototype.reset;Video.prototype.destroyBaseRef=Media.prototype.destroyRef;Video.prototype.playClipBase=Media.prototype.playClip;Video.prototype.pauseClipBase=Media.prototype.pauseClip;Video.prototype.setOnStageBase=StageItem.prototype.setOnStage;
Video.prototype.loadFromXML=function(a,b,c){this.slide=b;this.layer=c;this.children={};this.innerType=this.type="video";this.id=$(a).attr("id");this.xml=a;this.loadElementInfoFromXML(a);this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);this.canSimplify=!1;var d=$(a).find("videodata");this.content.src=player.basepath+d.attr("url");this.content.poster=player.basepath+d.attr("poster");this.content.hasPoster=""!=d.attr("poster");this.content.type=d.attr("type");this.content.duration=d.attr("duration");
this.content.autoplay="true"==$(a).attr("autoplay");this.content.showcontrols="true"==$(a).attr("showcontrols");this.content.autorewind="true"==$(a).attr("autorewind");this.content.loop="true"==$(a).attr("loop");this.content.captureanimation="true"==$(a).attr("captureanimation");this.duration=this.content.duration;(this.autoplay=this.content.autoplay)&&this.timelineSetup();this.createPoster();this.isUnsupportedType="youtube"==this.content.type||-1<this.content.src.indexOf(".swf");this.usehandcursor=
"true"==$(a).attr("usehandcursor");this.loadMaskFromXML(a);this.content.src=this.content.src.replace(".flv",".mp4");if(this.mediaParent&&"Layer"==this.mediaParent.innerType)c=this.mediaParent;c&&c.clips&&c.clips.push?(c.clips.push(this),this.layered=!0):b&&b.clips&&b.clips.push&&b.clips.push(this);if(!this.resource)this.resource=this.createResource(this.slide,this.content.src);this.canSimplify=!1};
Video.prototype.createRef=function(){if(this.parent.ref)this.container=this.parent.ref;else return this.parent.createRef(),!1;if(this.ref)return!1;this.created=!0;if(!this.createBaseRef())return!1;this.ref.get(0).appendChild(this.posterCanvas);player.noVideo||this.isUnsupportedType?this.disableVideo():this.requestVideo();return!0};Video.prototype.setOnStage=function(a,b){this.setOnStageBase(a,b);this.pauseClip()};Video.prototype.setLoadError=function(){this.disableVideo()};
Video.prototype.setMediaComplete=function(){this.playState=Media.playState.COMPLETE;this.handleEvent("onmediacomplete")};Video.prototype.setMediaReady=function(){this.checkReady()};Video.prototype.appendVideoRef=function(){this.ref.get(0).appendChild(this.videoref)};
Video.prototype.isVideoReady=function(){var a=!1;if(this.videoref){if(1==this.videoref.readyState&&!this.playQueued)this.playQueued=!0,this.videoref.play(),this.videoref.pause();if((a=3<=this.videoref.readyState)&&!this.videoShowing)this.videoShowing=!0,this.hidePoster(),this.ios7iPhone||this.appendVideoRef()}return a};Video.prototype.checkReady=function(){this.isVideoReady()&&this.unblockIfBlocked()};
Video.prototype.correctPosition=function(){if(!isNaN(this.correctedPosition)&&this.shouldSetPosition)try{this.setCurrentTime(this.correctedPosition),this.shouldSetPosition=!1}catch(a){}};
Video.prototype.destroyRef=function(){this.videoref&&(this.videoref.removeEventListener("canplay",this.onMediaReady),this.videoref.removeEventListener("ended",this.onMediaCompleted),this.videoref.removeEventListener("error",this.onLoadError),null!=this.videoref.parentNode&&this.videoref.parentNode.removeChild(this.videoref));this.posterImg&&this.posterImg.removeEventListener("load",this.onPosterLoaded);this.posterCanvas&&this.posterCanvas.removeEventListener("click",this.onPosterClicked);this.onPosterClicked=
this.onPosterLoaded=this.onLoadError=this.onMediaCompleted=this.onMediaReady=null;this.pauseClip();if(Video.currentOwner==this)Video.currentOwner=null;this.posterImg=this.posterCanvas=this.videoref=null;this.destroyBaseRef()};Video.prototype.reset=function(a){this.resetMedia(a);a||(this.pauseClip(),this.setCurrentTime(0))};
Video.prototype.createPoster=function(){if(this.content.hasPoster)this.posterImg=document.createElement("img"),this.posterImg.addEventListener("load",this.onPosterLoaded),this.posterImg.src=this.content.poster,this.posterImg.style.width=this.width+"px",this.posterImg.style.height=this.height+"px",this.posterImg.style.position="absolute";this.posterCanvas=document.createElement("canvas");this.posterCanvas.width=this.width;this.posterCanvas.height=this.height;this.posterCanvas.style.position="absolute";
this.posterCanvas.addEventListener("click",this.onPosterClicked);this.drawPoster(!0)};Video.prototype.posterClicked=function(){this.requestVideo(!0)&&this.playClip()};Video.prototype.posterLoaded=function(){this.drawPoster(this.showPlay)};
Video.prototype.drawPoster=function(a){this.showPlay=a;var b=this.posterCanvas.getContext("2d");b.clearRect(0,0,this.posterCanvas.width,this.posterCanvas.height);this.posterImg&&this.posterImg.complete?b.drawImage(this.posterImg,0,0):(b.fillStyle="rgba(0, 0, 0, 1)",b.rect(0,0,this.width,this.height),b.fill());var c=this.width/2,d=this.height/2;if(a&&!this.videoDisabled)b.beginPath(),b.fillStyle="rgba(0, 0, 0, 1)",b.arc(c,d,36,0,2*Math.PI),b.fill(),b.beginPath(),b.fillStyle="rgba(255, 255, 255, 1)",
b.moveTo(c-14,d-18),b.lineTo(c-14,d+18),b.lineTo(c+23,d),b.lineTo(c-14,d-18),b.fill()};
Video.prototype.setVideoControl=function(a){this.videoref=a;null!=this.videoref.parentNode&&this.videoref.parentNode.removeChild(this.videoref);this.playQueued=!1;this.ios7iPhone&&this.appendVideoRef();this.hidePosterPlay();this.videoref.addEventListener("canplay",this.onMediaReady);this.videoref.addEventListener("ended",this.onMediaCompleted);this.videoref.addEventListener("error",this.onLoadError);this.videoref.setAttribute("src",this.content.src);this.videoref.style.width=this.width+"px";this.videoref.style.height=
this.height+"px";this.content.hasPoster?(!player.isChrome||player.isMobile)&&this.videoref.setAttribute("poster",this.content.poster):this.videoref.removeAttribute("poster");this.content.showcontrols?this.videoref.setAttribute("controls",""):this.videoref.removeAttribute("controls")};Video.prototype.requestVideo=function(a){return null==this.videoref?(a=Video.requestVideoRef(this,a))?(this.setVideoControl(a),!0):!1:!0};
Video.prototype.releaseVideo=function(){if(this.videoref)this.currentTime=this.videoref.currentTime,this.showPoster(),this.videoref.pause(),this.videoref.removeEventListener("canplay",this.onMediaReady),this.videoref.removeEventListener("ended",this.onMediaCompleted),this.videoref.removeEventListener("error",this.onLoadError),this.videoref=null,this.videoShowing=!1,this.unblockIfBlocked(),this.removeFromBlockableMedia()};
Video.prototype.disableVideo=function(){var a=this.getIsPlaying();this.setMeSilentMode();this.playClip=Media.prototype.playClipSilent;this.pauseClip=Media.prototype.pauseClipSilent;this.timelinePlayed=Media.prototype.timelinePlayedSilent;this.timelinePaused=Media.prototype.timelinePausedSilent;this.videoDisabled=!0;this.drawPoster(!1);this.ref.get(0).appendChild(this.posterCanvas);a&&this.playClip()};Video.prototype.showPoster=function(){this.drawPoster(!0);this.ref.get(0).appendChild(this.posterCanvas)};
Video.prototype.hidePosterPlay=function(){this.drawPoster(!1)};Video.prototype.hidePoster=function(){this.posterCanvas.parent&&this.posterCanvas.parent.removeChild(this.posterCanvas)};
Video.prototype.show=function(a,b,c){this.showBase(a,b,c);this.container&&!this.content.autoplay&&0==this.ref.parent().length&&(this.container.append(this.ref),this.ref.show());this.setMediaSyncInfo(a,"TimelineEvent"==a.type);if(c){if(this.autoplay&&(this.timelineSetup(),this.isVideoReady()))this.videoref.currentTime=(this.syncTargetTimeline.getCurrentTime()-this.triggerTime)/1E3,this.videoref.play(),this.videoref.pause()}else this.startAutoPlay()};
Video.prototype.startAutoPlay=function(){if(this.autoplay)this.requestVideo()?this.playClip():this.playState=Media.playState.VIDEO_BUSY};
Video.prototype.playClip=function(){var a=this.playState!=Media.playState.PLAYING;if(this.visible&&this.requestVideo()){if(!this.playClipBase())return!1;0==this.ref.parent().length&&(this.container.append(this.ref),this.ref.show());if(this.syncToTimeline&&this.syncTargetTimeline&&0<=this.triggerTime)this.currentTime=(this.syncTargetTimeline.getCurrentTime()-this.triggerTime)/1E3,a=!0;a&&(isNaN(this.currentTime)||this.setCurrentTime(this.currentTime));this.videoref.play()}};
Video.prototype.pauseClip=function(){this.pauseSimple();this.pauseClipBase()};Video.prototype.pauseSimple=function(){if(null!=this.videoref){if(this.playState==Media.playState.PLAYING)this.currentTime=this.videoref.currentTime;this.videoref.pause()}};Video.prototype.getCurrentTime=function(){return this.videoref?this.videoref.currentTime:this.currentTime};
Video.prototype.setCurrentTime=function(a){1E3*a<player.TICK_DURATION&&(a=0);this.currentTime=a;if(this.videoref&&1E3*Math.abs(this.currentTime-this.videoref.currentTime)>player.TICK_DURATION)this.videoref.currentTime=this.currentTime};Video.prototype.setVolume=function(a){if(this.videoref)this.videoref.volume=a};Video.prototype.readyOrLoad=function(){return 3<=this.videoref.readyState?!0:!1};
Video.prototype.isPointObscured=function(a,b,c,d){var e=this.matrix.unTransformPoint(a,b);return this.content.showcontrols&&e.y>this.height-35?!0:StageItem.prototype.isPointObscured.call(this,a,b,c,d)};Video.getStoreReference=function(){return""};Video.getSrcFromStoreReference=function(){return null};Video.addToRefStore=function(){return null};var LinkArea=function(a,b,c,d){this.textid=d;this.linkdy=this.linkdx=0;this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement()};LinkArea.prototype=new VectorShape;LinkArea.prototype.innerType="LinkArea";LinkArea.prototype.objectType="Item";LinkArea.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;LinkArea.prototype.renderBase=VectorShape.prototype.render;LinkArea.prototype.renderOnUpdate=VectorShape.prototype.renderOnUpdate;
LinkArea.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);b=$(a).children("textdata").children("vectortext").children("pr");if(1==b.length){a=$(a).children("textdata").children("vectortext");if(null!=$(a).attr("top"))this.originalRectShape=this.rectShape=new ppRect(parseInt($(a).attr("left")),parseInt($(a).attr("top")),parseInt($(a).attr("right")),parseInt($(a).attr("bottom")));if(1==b.length)this.content.path=PathLib.getPathFromXML(b)}this.type="LinkArea"};
LinkArea.prototype.createRef=function(){if(!player.showLinkAreas)return!0;if(this.ref)return!1;this.ref=$("<div class='item linkplaceholder'></div>");this.applySize(this.ref);this.ref.show();this.parent.ref.append(this.ref);return!0};LinkArea.prototype.render=function(a){switch(a){case "onrollover":this.parent.render(this.parent.lastRenderedState,!0,null,"LinkArea render",!1,this.id);break;case "onrollout":this.parent.render(null,!0)}};
LinkArea.prototype.handleIfOver=function(a,b,c){b=this.parent.getCanvasPoint(b.x,b.y);if(b.x>this.xpos+this.linkdx&&b.x<this.xpos+this.linkdx+this.width&&b.y>this.ypos+this.linkdy&&b.y<this.ypos+this.linkdy+this.height){if(!c||!this.isMouseOver)this.isMouseOver=!0,this.parent.handleEvent(a,this.id,null,!1,!1,!0),this.render(a);return!0}return!1};
LinkArea.prototype.handleIfOut=function(a,b){var c=this.parent.getCanvasPoint(b.x,b.y);if(!(c.x>this.xpos+this.linkdx&&c.x<this.xpos+this.linkdx+this.width&&c.y>this.ypos+this.linkdy&&c.y<this.ypos+this.linkdy+this.height)){if(this.isMouseOver)this.isMouseOver=!1,this.parent.handleEvent(a,this.id,null,!1,!1,!0),this.render(a);return!0}return!1};var TextInput=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.content={fontsize:18,font:"Arial"};this.constructElement();this.events=[];this.clickFocus=this.active=!0};TextInput.prototype=new StageItem;TextInput.prototype.innerType="TextInput";TextInput.prototype.objectType="Item";TextInput.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;TextInput.prototype.showBase=StageItem.prototype.show;TextInput.prototype.hideBase=StageItem.prototype.hide;
TextInput.prototype.extractNextSpecialVar=function(a){a=bwChunk.DecodeString(a);"^"==a&&(a="");this.variables.Text=a;if(this.ref&&this.input)this.input[0].value=a};TextInput.prototype.getExtraResumeVars=function(){var a="";this.variableResumes.VAR_TEXT=!0;this.variableDefaults.VAR_TEXT=a;this.variableTypes.VAR_TEXT="string";if(this.ref&&this.input)a=this.input[0].value;return{VAR_TEXT:a}};
TextInput.prototype.loadFromXML=function(a,b,c){this.content.numeric="true"==$(a).attr("numeric");this.content.multiline="true"==$(a).attr("multiline");this.content.maxchars=parseInt($(a).attr("maxchars"));this.content.fontsize=$(a).attr("fontsize");this.content.textcolor=$(a).attr("textcolor").replace("0x","#");this.content.bold="true"==$(a).attr("bold");this.content.font=$(a).attr("font");this.content.rtl="true"==$(a).attr("rtl");this.bindto=$(a).attr("bindto");this.content.instructionText="";var d=
$(a).children("data").children("textdata").text();""==d&&(d=$(a).children("background").children("vectordata").attr("alttext"));if(""!=d)this.content.instructionText=d;var e=$(a).children("background").children("vectordata").children("path"),d=$(a).children("background").children("vectordata").children("pr");if(1==e.length||1==d.length){var f=$(a).children("background").children("vectordata");if(null!=$(f).attr("top"))this.originalRectShape=this.rectShape=new ppRect(parseInt($(f).attr("left")),parseInt($(f).attr("top")),
parseInt($(f).attr("right")),parseInt($(f).attr("bottom")));this.content.path=1==d.length?PathLib.getPathFromXML(d):e.text()}this.loadBaseFromXML(a,b,c);this.updateMatrixComplete();this.type="textinput";this.variables.Text="";b=$(a).children("data").children("textdata");f=$(a).children("data").children("textdata").children("vectortext");d=f.children("pr");if(1==d.length){this.placeholderSprite={canvas:null,m_nXOffset:0,m_nYOffset:0,width:1E3,height:1E3,charIndex:0,maxCharIndex:0,vectorHot:!1,isShapeMask:!1};
if(null!=$(f).attr("top"))this.placeholderSprite.x=$(b).attr("xpos")-5,this.placeholderSprite.y=$(b).attr("ypos"),this.placeholderSprite.width=$(b).attr("width"),this.placeholderSprite.height=$(b).attr("height"),this.placeholderSprite.rectShape=new ppRect(parseInt($(f).attr("left")),parseInt($(f).attr("top")),parseInt($(f).attr("right")),parseInt($(f).attr("bottom"))),this.placeholderSprite.rectShape.right=Math.max(this.placeholderSprite.rectShape.right,this.placeholderSprite.width),this.placeholderSprite.rectShape.bottom=
Math.max(this.placeholderSprite.rectShape.bottom,this.placeholderSprite.height),this.placeholderSprite.originalRectShape=this.rectShape;this.placeholderSprite.path=PathLib.getPathFromXML(d)}};
TextInput.prototype.validate=function(){if(!this.input)return!1;var a=this.input.get(0).value;if(this.content.numeric&&!a.match(/^-?([0-9]*\.|)[0-9]*$/))return!1;if(!isNaN(this.content.maxchars)&&0<this.content.maxchars&&a.length>this.content.maxchars)this.input.get(0).value=a.substr(0,this.content.maxchars);return!0};
TextInput.prototype.createRef=function(){if(this.ref)return!1;var a=this;this.container=this.parent.ref;this.ref=$('<div class="item textinput interactive"></div>');this.applySize(this.ref);this.container.append(this.ref);var b=this.content.multiline?$("<textarea tabindex='-1'>"):$("<input type='text' tabindex='-1'>");b.css("position","absolute");b.css("padding-left","10px");b.css("padding-right","10px");b.css("font-size",this.content.fontsize+"px");b.css("font-family",this.content.font+",Arial,Sans-Serif");
b.css("color",this.content.textcolor);b.attr("size",this.content.maxchars);this.placeholderSprite||b.attr("placeholder",this.content.instructionText);b.css("width",this.width-15);this.content.rtl&&b.addClass("rtl");if(void 0!==this.variables.Text&&""!=this.variables.Text)b.get(0).value=this.variables.Text;var c=$("<canvas></canvas>");c.css("position","absolute");this.ref.append(c);this.canvas=c.get(0);this.placeholderSprite?(c=$("<canvas></canvas>"),c.css("position","absolute"),c.css("left",this.placeholderSprite.x+
"px"),c.css("top",this.placeholderSprite.y+"px"),c.attr("width",this.width+"px"),c.attr("height",this.height+"px"),c.attr("id",this.id+"_placeholder"),this.ref.append(c),this.placeholderSprite.canvas=c.get(0),this.placeholderRef=c):this.placeholderRef=$("<div/>");this.ref.append(b);this.input=b;if(this.isDisabled)this.input.get(0).disabled=!0;this.ref.addClass("interactive");this.contentRef=this.ref;a.input.bind("change",function(){a.variables.Text=this.value;""!=a.input.get(0).value&&a.placeholderRef.hide()});
a.inputLength=0;a.input.bind("keydown",function(){a.beforeText=a.input.get(0).value});var d=function(b){if(!a.validate(b.value))b.value=a.beforeText;a.variables.Text=b.value;a.bindto&&""!=a.bindto&&a.setVariable(a.bindto,b.value);a.inputLength=b.value.length};a.input.bind("keyup",function(b){var c=a.input.get(0);if(a.content.multiline&&13==b.keyCode&&c.value.length==a.inputLength){var g=a.GetSelection(),h=c.value,j=String.fromCharCode(13);if(g.start==g.end){var l=h.charCodeAt(g.start);if(10==l||13==
l)j+=String.fromCharCode(13)}c.value=h.substr(0,g.start)+j+h.substr(g.end,h.length);a.SetSelection(g.start+1)}if(player.iOSKeyboardFault)switch(b.keyCode){case 8:if(0<c.value.length)c.value=c.value.substr(0,c.value.length-1)}d(c)});if(player.isIOSlt8&&window!=top)return a.input.bind("keypress",function(b){var c=this,g=c.value;setTimeout(function(){var h=g+String.fromCharCode(b.charCode);if(c.value==g&&h.length>g.length&&h!=g&&a.validate(h))player.iOSKeyboardFault=!0,1<h.length&&h.substr(1,1).toLowerCase()!=
h.substr(1,1)&&(h=h.substr(0,1)+h.substr(1,1).toLowerCase()+h.substr(2)),c.value=h,d(c),c.focus()},200)}),!0;a.input.bind("focus",function(){a.placeholderRef.hide()});a.input.bind("blur",function(){a.handleEvent("onlosefocus",null,null,!1,!1,!0);""==a.input.get(0).value&&a.placeholderRef.show()});if(a.bindto&&""!=a.bindto)a.bindVarListener(a.bindto).triggerEvent(a,!1),a.variables.Text=this.input.get(0).value;this.content.path||($(this.canvas).hide(),this.ref.addClass("defaultbackground"));if(this.placeholderSprite)b=
new ppTextLib(a.xml),ppArt.itemID=a.id,ppArt.item=a,ppArt.m_bMaskMode=!1,ppArt.DrawVector(this.placeholderSprite,this.placeholderSprite.path,b,player.fontlib,a.imagelib,null,null);(""!=a.input.get(0).value||a.variables.ReviewMode||a.isDisabled)&&this.placeholderRef.hide();return!0};
TextInput.prototype.GetSelection=function(){var a=this.input.get(0),b={start:a.value.length-1,end:a.value.length-1};if("selectionStart"in a&&document.activeElement==a)b.start=a.selectionStart,b.end=a.selectionEnd;else if(a.createTextRange){var c=document.selection.createRange();if(c.parentElement()===a){var d=a.createTextRange();d.moveToBookmark(c.getBookmark());for(c=0;0<d.compareEndPoints("EndToStart",d);d.moveEnd("character",-1))++c;d.setEndPoint("StartToStart",a.createTextRange());b.start=0;for(b.end=
c;0<d.compareEndPoints("EndToStart",d);d.moveEnd("character",-1))++b.start,++b.end}}return b};TextInput.prototype.SetSelection=function(a,b){var c=this.input.get(0);2>arguments.length&&(b=a);if("selectionStart"in c)setTimeout(function(){c.selectionStart=a;c.selectionEnd=b},1);else if(c.createTextRange){var d=c.createTextRange();d.moveStart("character",a);d.collapse();d.moveEnd("character",b-a);d.select()}};TextInput.prototype.renderBackground=VectorShape.prototype.render;
TextInput.prototype.renderOnUpdate=VectorShape.prototype.renderOnUpdate;TextInput.prototype.setVisible=VectorShape.prototype.setVisible;
TextInput.prototype.render=function(){if(this.input&&this.visible){this.content.path&&this.renderBackground("",!0,null,"textinput createref");if(this.bindto&&""!=this.bindto){var a=this.extractVariable(this.bindto);if(a!=this.input.get(0).value)this.input.get(0).value=a;this.variables.Text=a}(""!=this.input.get(0).value||this.variables.ReviewMode||this.isDisabled)&&this.placeholderRef.hide()}};
TextInput.prototype.applySize=function(a){a.css("left",this.x+"px");a.css("top",this.y+"px");a.css("width",this.width+"px");a.css("height",this.height+"px");"Layer"!=this.innerType&&"ExpandingLabel"!=this.innerType&&0<this.depth&&a.css("z-index",this.depth);$(this.canvas).css("left",this.xoffset+"px");$(this.canvas).css("top",this.yoffset+"px");if(0!=this.rotation)a.css("-webkit-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-webkit-transform","rotate("+
this.rotation+"deg)"),a.css("-moz-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-moz-transform","rotate("+this.rotation+"deg)"),a.css("-o-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-o-transform","rotate("+this.rotation+"deg)"),a.css("-ms-transform-origin",this.rotatexpos-this.xoffset+"px "+(this.rotateypos-this.yoffset)+"px"),a.css("-ms-transform","rotate("+this.rotation+"deg)"),this.canSimplify=
!1};TextInput.prototype.set_review=function(a){a?this.placeholderRef.hide():this.input&&""==this.input.get(0).value&&this.placeholderRef.show()};var DragItem=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="textfield";this.active=!0;this.id=Math.random();this.name="item";this.visible=this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.resumeSelectedItem=-1;this.xml="";this.deferredResourceIndex=0;this.fillet=10;this.lastRenderedState=null;this.snapy=this.snapx=0;this.multidrop=this.dragreturn=!0;this.dropoffsety=this.dropoffsetx=0;this.canvas=
null;this.m_nYOffset=this.m_nXOffset=0;this.height=this.width=1E3;this.downY=this.downX=this.dragY=this.dragX=0;this.dropArea=null;this.dragDropIDs={global:!0};this.dragOverIDs={global:!0};this.currentlyOver={};this.isDragItem=!0};DragItem.prototype=new Item;DragItem.prototype.objectType="Item";DragItem.prototype.innerType="Item";
DragItem.prototype.restoreFromResumeData=function(a){StageItem.prototype.restoreFromResumeData.call(this,a);if("wordbank"==this.style){if(0<=this.resumeSelectedItem)this.dropArea=this.getItemByTypeStyle("droparea","wordbank"),this.dropArea.variables.DragConnectData=this.connectdata,this.parent=this.dropArea.parent,this.x=this.dropArea.x,this.y=this.dropArea.y,this.depth=++this.slide.topZ;this.resumeSelectedItem=-1;this.ref&&this.applySize(this.ref)}};
DragItem.prototype.extractNextSpecialVar=function(a){var b=this.getItemByResumeIndex(bwChunk.BaseNto10(a));if("wordbank"==this.style)this.resumeSelectedItem=a;else if(b&&(this.dock(b,!0),"wordbank"==this.style))this.parent=this.dropArea.parent,this.x=this.dropArea.x,this.y=this.dropArea.y,this.depth=++this.slide.topZ};
DragItem.prototype.getExtraResumeVars=function(){var a=-1;this.variableResumes.VAR_SELECTED_ITEM=!0;this.variableDefaults.VAR_SELECTED_ITEM=-1;this.variableTypes.VAR_SELECTED_ITEM="number";this.dropArea&&(a=this.dropArea.getItemIndex());return{VAR_SELECTED_ITEM:a}};DragItem.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;DragItem.prototype.toBaseData=Element.prototype.toData;
DragItem.prototype.toData=function(a){a=this.toBaseData(a);a.x=this.x;a.y=this.y;if(this.depth!=this.originalZ)a.depth=this.depth;return a};DragItem.prototype.updateBaseFromData=Element.prototype.updateFromData;
DragItem.prototype.updateFromData=function(a,b){this.updateBaseFromData(a,b);if(!b){if(!isNaN(parseInt(a.x)))this.x=parseInt(a.x);if(!isNaN(parseInt(a.y)))this.y=parseInt(a.y);if(a.depth&&(this.depth=a.depth,this.depth>this.slide.topZ))this.slide.topZ=this.depth}if(a.variables&&a.variables.DropTargetId&&(this.dropArea=this.parent.children[a.variables.DropTargetId],!this.dropArea))this.dropArea=this.slide.findDescendantById(a.variables.DropTargetId);this.ref&&this.updatePosition()};
DragItem.prototype.resetStageItem=StageItem.prototype.reset;DragItem.prototype.reset=function(a){this.resetStageItem(a);if(!a){this.x=this.originalX;this.y=this.originalY;if(this.shuffled)this.x=this.shuffleX,this.y=this.shuffleY;this.dragY=this.dragX=0;this.dropArea=null;this.updatePosition();if(isNaN(this.x))this.x=this.originalX,this.y=this.originalY}};
StageItem.prototype.convertToDragItem=function(a){this.toBaseData=DragItem.prototype.toBaseData;this.toData=DragItem.prototype.toData;this.updateBaseFromData=DragItem.prototype.updateBaseFromData;this.updateFromData=DragItem.prototype.updateFromData;this.resetStageItem=DragItem.prototype.resetStageItem;this.reset=DragItem.prototype.reset;this.initDrag=DragItem.prototype.initDrag;this.mousedown=DragItem.prototype.mousedown;this.mousemove=DragItem.prototype.mousemove;this.mouseup=DragItem.prototype.mouseup;
this.fixPositionEvent=DragItem.prototype.fixPositionEvent;this.updateDragPosition=DragItem.prototype.updateDragPosition;this.ensureDragOnstage=DragItem.prototype.ensureDragOnstage;this.testOverlap=DragItem.prototype.testOverlap;this.findDropArea=DragItem.prototype.findDropArea;this.dock=DragItem.prototype.dock;this.undock=DragItem.prototype.undock;this.updatePosition=DragItem.prototype.updatePosition;this.reParent=DragItem.prototype.reParent;this.getExtraResumeVars=DragItem.prototype.getExtraResumeVars;
this.parseDragGroupsFromXML=DropArea.prototype.parseDragGroupsFromXML;this.extractNextSpecialVar=DragItem.prototype.extractNextSpecialVar;this.updateScrollAreaAncestorPosition=DragItem.prototype.updateScrollAreaAncestorPosition;this.updateDragDelayed=DragItem.prototype.updateDragDelayed;this.drop=DragItem.prototype.drop;this.cancelDrag=DragItem.prototype.cancelDrag;this.lastRenderedState=null;this.currentlyOver={};switch(this.innerType){case "textfield":case "image":break;case "ItemGroup":case "StateGroup":break;
default:this.render=VectorShape.prototype.render,this.renderOnUpdate=VectorShape.prototype.renderOnUpdate,this.setVisible=VectorShape.prototype.setVisible}this.droptype=$(a).children("dragdrop").attr("droptype");this.snapx=parseInt($(a).children("dragdrop").attr("snapx"));this.snapy=parseInt($(a).children("dragdrop").attr("snapy"));this.dragreturn="true"==$(a).children("dragdrop").attr("dragreturn");this.multidrop="true"==$(a).children("dragdrop").attr("multidrop");this.dropoffsetx=parseInt($(a).children("dragdrop").attr("dropoffsetx"));
this.dropoffsety=parseInt($(a).children("dragdrop").attr("dropoffsety"));this.originalX=this.x;this.originalY=this.y;this.downY=this.downX=this.dragY=this.dragX=0;this.parseDragGroupsFromXML(a);this.isDragItem=!0};StageItem.prototype.convertRefToDragItem=function(){this.ref.addClass("dragitem");this.setInteractive()};DragItem.prototype.bustScrollAreas=function(){};DragItem.initialized=!1;
DragItem.init=function(){DragItem.initialized=!0;DragItem.cargo=null;var a=function(a){DragItem.cargo&&(DragItem.cargo.mousemove(a),a.preventDefault())};player.isMobile?($(document.body).bind("touchmove",a),$(window).bind("touchend",DragItem.handleMouseUp)):($(document.body).bind("mousemove",a),$(window).bind("mouseup",DragItem.handleMouseUp))};DragItem.handleMouseUp=function(a){DragItem.cargo&&(DragItem.cargo.mouseup(a),a.preventDefault())};
DragItem.cancelDrag=function(){if(DragItem.cargo)DragItem.cargo.dragging=!1;DragItem.cargo=null;$(".item").removeClass("dragging")};
DragItem.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.parseDragGroupsFromXML(a);this.style=$(a).attr("style");this.connectdata=$(a).attr("connectdata");this.reviewdata=$(a).attr("reviewdata");this.width=parseInt($(a).attr("width"));this.height=parseInt($(a).attr("height"));this.originalX=this.x;this.originalY=this.y;this.alttext=$(this.xml).find("textdata").attr("alttext");if("wordbank"==this.style&&!this.colors.hover)b=new Background(this.ref),b.rotation="90",b.fillType=
"linear",b.stops.push(b.parseStop('<color rgb="0xBBF8FB" alpha="100" stop="0" />')),b.stops.push(b.parseStop('<color rgb="0xA5E8EB" alpha="100" stop="100" />')),this.colors.hover=b;this.variables.DropTargetId="";b=$(a).children("data").children("textdata");a=$(a).children("data").children("textdata").children("vectortext");c=a.children("pr");if(1==c.length){this.textSprite={canvas:null,m_nXOffset:0,m_nYOffset:0,width:1E3,height:1E3,charIndex:0,maxCharIndex:0,vectorHot:!1,isShapeMask:!1};if(null!=
$(a).attr("top"))this.textSprite.x=$(b).attr("xpos"),this.textSprite.y=$(b).attr("ypos"),this.textSprite.width=$(b).attr("width"),this.textSprite.height=$(b).attr("height"),this.textSprite.rectShape=new ppRect(parseInt($(a).attr("left")),parseInt($(a).attr("top")),parseInt($(a).attr("right")),parseInt($(a).attr("bottom"))),this.textSprite.rectShape.right=Math.max(this.textSprite.rectShape.right,this.width),this.textSprite.rectShape.bottom=Math.max(this.textSprite.rectShape.bottom,this.height),this.textSprite.originalRectShape=
this.rectShape;this.textSprite.path=PathLib.getPathFromXML(c)}this.canSimplify=!1};
DragItem.prototype.parseDragGroupsFromXML=function(a){var b=$(a).children("dragdrop").children("dragoverids").children("dragoverid"),a=$(a).children("dragdrop").children("dragdropids").children("dragdropid");if(0==b.length&&0==a.length)this.dragDropIDs={global:!0},this.dragOverIDs={global:!0};else{this.dragDropIDs={};this.dragOverIDs={};var c=this;b.each(function(a,b){var f=$(b).text();c.dragOverIDs[f]=!0});a.each(function(a,b){var f=$(b).text();c.dragDropIDs[f]=!0})}};
DragItem.prototype.initDrag=function(){var a=this;a.canSimplify=!1;a.ref.bind(player.isMobile?"touchstart":"mouseover mousedown",function(){a.style&&!a.isDisabled&&!a.parent.isDisabled&&(("wordbank"==a.style||"matching"==a.style)&&a.dropArea?a.render("",!1,null,"over/down (docked) "+a.style):a.render("hover",!1,null,"over/down "+a.style))});a.ref.bind("mouseout",function(){a.style&&a.render("",!1,null,"mouseout "+a.style)});a.ref.bind("touchend",function(){a.style&&a.render("")});DragItem.initialized||
DragItem.init();a.updateMatrixComplete()};DragItem.setVisible=Element.prototype.setVisible;DragItem.prototype.createBaseRef=StageItem.prototype.createRef;
DragItem.prototype.createRef=function(){if(this.ref)return this.render(null,!0),!1;if(!this.createBaseRef())return!1;this.ref.addClass("dragitem");this.setInteractive();var a=$("<canvas></canvas>");a.attr("width",this.width);a.attr("height",this.height);a.css("position","absolute");this.ref.append(a);var b=$("<canvas></canvas>");b.attr("width",this.width);b.attr("height",this.height);b.css("margin","0 0 0 "+2*this.fillet+"px");b.css("position","absolute");this.ref.append(b);if(this.textSprite){var c=
$("<canvas></canvas>");c.css("position","absolute");c.css("left",this.textSprite.x+"px");c.css("top",this.textSprite.y+"px");c.attr("width",this.width+"px");c.attr("height",this.height+"px");c.attr("id",this.id+"_text");this.ref.append(c);this.textSprite.canvas=c.get(0);this.textRef=c}this.border=a.get(0);this.canvas=b.get(0);this.initDrag();this.render(null,!0);return!0};
DragItem.prototype.renderCallback=function(){this.width=this.originalWidth;this.height=this.originalHeight;this.render();this.contentRef.css("margin-top",parseInt(this.height/2)-10);this.contentRef.empty();this.contentRef.text(this.alttext)};
DragItem.prototype.render=function(a,b){if(this.ref&&(b||a!=this.lastRenderedState)){this.lastRenderedState=a;var c=this.border.getContext("2d"),d=parseInt(900*Math.random()+1100)%1E3;c.fillStyle="#"+d;c.fillStyle="#fff";c.lineWidth=1;c.strokeStyle="#ccc";d=c.createLinearGradient(0,0,0,this.height);d.addColorStop(0,"#fcfcfc");d.addColorStop(1,"#eaeaea");c.fillStyle=d;this.colors[a]&&this.colors[a].applyCanvas(c,this,!0,!1);d=this.fillet;switch(this.style){case "matching":c.clearRect(0,0,this.width,
this.height);c.beginPath();c.moveTo(d+0.5,0.5);c.lineTo(this.width-0.5,0.5);c.lineTo(this.width-0.5,this.height-0.5);c.lineTo(d+0.5,this.height-0.5);c.lineTo(d+0.5,this.height-d-0.5);c.lineTo(0.5,this.height-d-0.5);c.lineTo(0.5,d+0.5);c.lineTo(d+0.5,d+0.5);c.lineTo(d+0.5,0.5);c.fill();c.save();c.clip();c.strokeStyle="#fff";c.lineWidth=5;c.stroke();c.restore();c.save();c.lineWidth=1;c.strokeStyle="#ccc";if(c.setLineDash&&(this.variables.ReviewMode||!this.dropArea))c.strokeStyle="#aaa",c.setLineDash([1.3]);
if(this.colors[a])c.strokeStyle=this.colors[a].stops[0].color;c.stroke();c.restore();if(this.variables.ReviewMode){c.fillStyle="#DB0000";if(this.dropArea&&this.reviewdata==this.dropArea.reviewdata)c.fillStyle="#008520";d=8;c.beginPath();c.arc(8.5,8.5,d,0,2*Math.PI);c.fill();d=6.8;c.beginPath();c.strokeStyle="rgba(255,255,255,0.6)";c.lineWidth=0.8;c.arc(8.4,8.4,d,0,2*Math.PI);c.fill();c.stroke();c.fillStyle="#fff";c.font="10px sans-serif";c.textBaseline="top";1<this.reviewdata.length?c.fillText(this.reviewdata,
2,2):c.fillText(this.reviewdata,5,2);if(this.dropArea&&this.dropArea.matchingDragItem!=this)this.dropArea.matchingDragItem=this,this.dropArea.variables.ReviewMode=this.variables.ReviewMode,this.dropArea.render(this.dropArea.lastRenderedState,!0)}break;case "wordbank":d=this.height/2;c.beginPath();c.moveTo(d+0.5,0.5);c.lineTo(this.width-d-0.5,0.5);c.arc(this.width-d-0.5,d,d-c.lineWidth/2,3*Math.PI/2,Math.PI/2);c.lineTo(d+0.5,this.height-0.5);c.arc(d+0.5,d,d-c.lineWidth/2,Math.PI/2,3*Math.PI/2);c.fill();
c.save();c.clip();c.strokeStyle="#fff";c.lineWidth=3.4;c.stroke();c.restore();if(this.variables.ReviewMode)if("1"==this.reviewdata)c.lineWidth=2,c.strokeStyle="#008520";else if(this.dropArea)c.lineWidth=2,c.strokeStyle="#DB0000";if(0!=c.lineWidth){if(this.colors[a])c.strokeStyle=this.colors[a].stops[0].color;c.stroke()}break;default:c.fillRect(0.5,0.5,this.width,this.height-c.lineWidth),c.strokeRect(0.5,0.5,this.width,this.height-c.lineWidth)}if(this.textSprite)c=new ppTextLib(this.xml),ppArt.itemID=
this.id,ppArt.item=this,ppArt.m_bMaskMode=!1,ppArt.DrawVector(this.textSprite,this.textSprite.path,c,player.fontlib,this.imagelib,null,null)}};
DragItem.prototype.fixPositionEvent=function(a){if(!a.fixed){a.fixed=!0;if(a.originalEvent.touches)0<a.originalEvent.touches.length?(a.pageX=a.originalEvent.touches[0].pageX,a.pageY=a.originalEvent.touches[0].pageY):(a.pageX=a.originalEvent.changedTouches[0].pageX,a.pageY=a.originalEvent.changedTouches[0].pageY);a.pageX=parseInt(a.pageX/player.currentZoom());a.pageY=parseInt(a.pageY/player.currentZoom());var b=$(".framewrap").offset(),c=a.pageX-b.left,d=a.pageY-b.top;if(!player.frameScale||isNaN(player.frameScale))player.frameScale=
1;player.scaleWithTransform?(a.pageX=parseInt(c/player.frameScale+b.left),a.pageY=parseInt(d/player.frameScale+b.top)):(a.pageX=parseInt(c/player.frameScale+b.left/player.frameScale),a.pageY=parseInt(d/player.frameScale+b.top/player.frameScale));a.pageX=parseInt(a.pageX/this.slide.scale);a.pageY=parseInt(a.pageY/this.slide.scale)}};
DragItem.prototype.cancelDrag=function(){DragItem.cargo&&DragItem.cargo!=this?DragItem.cargo.cancelDrag():(this.dropArea=null,DragItem.dropArea=null,DragItem.dragOver=null,this.dragY=this.dragX=0,this.parent!=this.originalParent&&this.reParent(this.originalParent),this.drop(),this.updatePosition())};
DragItem.prototype.mousedown=function(a){var b=1;if(a.originalEvent&&a.originalEvent.touches&&(b=a.originalEvent.touches.length,1<b)){this.cancelDrag();return}if(!this.isDisabled&&!this.parent.isDisabled)if("wordbank"==this.style&&this.dropArea)this.render("");else{this.fixPositionEvent(a);this.downScrollTop=0;if(this.nearestScrollAreaAncestor)this.downScrollTop=this.nearestScrollAreaAncestor.ref.get(0).scrollTop;else if("sequence"==this.style)this.downScrollTop=this.parent.ref.get(0).scrollTop;this.findAncestorOfType("ScrollArea")&&
this.reParent(this.slide);this.downX=a.pageX;this.downY=a.pageY;this.lastX=this.x;this.lastY=this.y;if(this.depth<this.slide.topZ){if(!this.originalZ)this.originalZ=this.depth;this.depth=++this.slide.topZ;this.setZIndex(this.depth,!0)}this.dragStarted=!1;this.dragging=!0;DragItem.cargo=this;this.ref.addClass("dragging");this.handleEvent("ondragstart",null,null,!1,!1,!0);this.handleEvent("onpress",null,null,!1,!1,!0)}};
DragItem.prototype.reParent=function(a){if(a&&a!=this.parent){var b=this.findAncestorOfType("ScrollArea"),c=a.findAncestorOfType("ScrollArea"),d=this.parent.ref.offset(),e=a.ref.offset(),f=0,g=0,h=0,j=0;if(b&&(f=b.ref.get(0).scrollTop,g=b.ref.get(0).scrollLeft,!b.scrollPlaceHolder))b.scrollPlaceHolder=$("<div class='scrollplaceholder'/>"),b.scrollPlaceHolder.css("top",b.ref.get(0).scrollHeight-1),b.scrollPlaceHolder.css("left",b.ref.get(0).scrollWidth-1),b.ref.append(b.scrollPlaceHolder);if(c)h=c.ref.get(0).scrollTop,
j=c.ref.get(0).scrollLeft;b=f-h;j=g-j;a.ref.append(this.ref);this.offsetParent=this.parent=a;g=player.scaleWithTransform?player.frameScale:1;j=(d.left-e.left-j)/g;b=(d.top-e.top-b)/g;if("matching"==this.style||"wordbank"==this.style)j=(d.left-e.left)/g,b=(d.top-e.top)/g,j/=this.slide.scale,b/=this.slide.scale;if(this.nearestScrollAreaAncestor&&a==this.originalParent)this.downScrollTop=this.downScrollTop||0,a=this.nearestScrollAreaAncestor.ref.get(0).scrollTop,this.downScrollTop!=a&&(b+=this.downScrollTop-
a);this.x=Math.round(this.x+j);this.y=Math.round(this.y+b);this.updateDragPosition()}};DragItem.prototype.mousemove=function(a){a.originalEvent&&a.originalEvent.touches&&1<a.originalEvent.touches.length?this.cancelDrag():(DragItem.currentEvent=a,DragItem.currentItem=this)};
DragItem.prototype.updateDragDelayed=function(){var a=DragItem.currentEvent;DragItem.currentItem=null;if(this.dragging){this.fixPositionEvent(a);if(!this.dragStarted)this.dragStarted=!0,this.handleEvent("ondragdisconnect",null,null,!1,!0,!1);if(this.dragging)swipe.moved=!0,this.dragX=a.pageX-this.downX,this.dragY=a.pageY-this.downY,this.updateDragPosition(),this.findDropArea(),this.updateScrollAreaAncestorPosition(a)}};
DragItem.prototype.updateScrollAreaAncestorPosition=function(a){if(this.nearestScrollAreaAncestor){var b=this.nearestScrollAreaAncestor.ref.offset(),a=a.pageY-b.top;0>a&&(this.nearestScrollAreaAncestor.ref.get(0).scrollTop+=a,this.nearestScrollAreaAncestor.updateMatrixComplete(!0));a>this.nearestScrollAreaAncestor.ref.get(0).offsetHeight&&(this.nearestScrollAreaAncestor.ref.get(0).scrollTop+=a-this.nearestScrollAreaAncestor.ref.get(0).offsetHeight,this.nearestScrollAreaAncestor.updateMatrixComplete(!0))}};
DragItem.prototype.mouseup=function(a){this.fixPositionEvent(a);this.drop();this.mouseupCallback&&this.mouseupCallback(a);$.each(this.children,function(a,c){if(void 0!=c.dragX)c.dragX=0,c.dragY=0});!this.dropArea&&this.dragreturn?this.originalParent&&this.originalParent!=this.parent&&(this.reParent(this.originalParent),this.updatePosition()):this.dropArea&&"matching"!=this.style&&this.dropArea.parent!=this.parent&&(this.reParent(this.dropArea.parent),this.updatePosition());this.updateMatrixComplete(!0)};
DragItem.prototype.drop=function(){this.dragging=!1;DragItem.cargo=null;$(".item").removeClass("dragging");if(this.dragStarted){this.ensureDragOnstage();this.updateDragPosition();var a=!1;DragItem.dropArea?("matching"==this.style&&this.parent!=this.originalParent&&this.reParent(this.originalParent),this.dock(DragItem.dropArea,!1),DragItem.dragOver=null,DragItem.dropArea=null,DropArea.update(),a=!0):(this.undock(),this.dragreturn&&"sequence"!=this.style&&this.originalZ&&this.setZIndex(this.originalZ,
!0));this.setElementProperty("dragX",0,!0);this.setElementProperty("dragY",0,!0);swipe.moved=!1;this.handleEvent("ondragend",null,null,!1,!1,!0);a&&this.handleEvent("ondragconnect",null,null,!1,!1,!0)}};DragItem.prototype.updateDragPosition=function(){this.ref.css("left",this.x+this.xoffset+this.dragX);this.ref.css("top",this.y+this.yoffset+this.dragY);this.updateMatrixComplete(!0)};
DragItem.prototype.ensureDragOnstage=function(){var a=this.matrix.transformPoint(0,0);0>a.x&&(this.dragX-=a.x);0>a.y&&(this.dragY-=a.y);a.x>this.slide.width-this.width&&(this.dragX+=this.slide.width-this.width-a.x);a.y>this.slide.height-this.height&&(this.dragY+=this.slide.height-this.height-a.y)};
StageItem.prototype.testOverlap=function(a){if(0<$(".modalfence:visible").length)return!1;var b=this;if("ItemGroup"==a.innerType||"StateGroup"==a.innerType){var c=!1;$.each(a.children,function(a,e){c=c||b.testOverlap(e)});return c}return"ItemGroup"==b.innerType||"StateGroup"==b.innerType?(c=!1,$.each(b.children,function(d,e){e.testOverlap&&(e.setElementProperty("dragX",b.dragX,!0),e.setElementProperty("dragY",b.dragY,!0),c=c||e.testOverlap(a))}),c):this.testRotatedOverlap(a)};
VectorShape.prototype.getCanvasPoint=function(a,b){return this.matrix.unTransformPoint(a,b)};StageItem.prototype.isPointWithinMaskShape=function(a,b){return this.ancestorMaskShape?this.ancestorMaskShape.testOver(a,b):!0};StageItem.prototype.isPointActive=function(a,b,c,d){return!this.visible||this==c||d&&d(this)?!1:this.testOver(a,b)&&this.isPointWithinMaskShape(a,b)};
VectorShape.prototype.isPointActive=function(a,b,c,d){if(!this.visible||this==c||d&&d(this)||!this.testOver(a,b)||!this.isPointWithinMaskShape(a,b))return!1;a=this.getCanvasPoint(a,b);b=this.getBitMask().isPointActive(a.x,a.y);if(BitMask.showDebug&&player.monitoringItem==this&&"_default_Hover"==this.lastRenderedState){if(!BitMask.testCanvas)BitMask.testCanvas=$("<canvas id='test' width='1000' height='1000' style='position:absolute;z-index:200;left:0px;top:0px;'></canvas>"),$(document.body).append(BitMask.testCanvas),
BitMask.testContext=BitMask.testCanvas.get(0).getContext("2d"),BitMask.testContext.fillStyle="rgba(255,255,0,0.5)";BitMask.testCanvas.show();clearTimeout(BitMask.testCanvasClear);BitMask.testCanvasClear=setTimeout(function(){BitMask.testCanvas.hide()},1E3);BitMask.testContext.clearRect(0,0,1E3,1E3);this.getBitMask().drawDebug(BitMask.testCanvas.get(0));BitMask.testContext.fillStyle=b?"rgba(0,255,0,1)":"rgba(255,0,0,1)";BitMask.testContext.fillRect(a.x-2,a.y-2,4,4)}return b};
VectorShape.prototype.isHotContextPointActive=function(a,b){if(0==this.hotContexts.length)return!1;var c=this.getCanvasPoint(a,b);if(0>=c.x||0>=c.y||c.x>=this.canvas.width||c.y>=this.canvas.height)return!1;for(var d=0;d<this.hotContexts.length;d++)if(0!=this.hotContexts[d].getImageData(c.x,c.y,1,1).data[3])return!0;return!1};StageItem.prototype.isAbove=function(a){for(var b=this;b;){for(var c=a;c;){if(c.parent==b.parent)return b.depth>c.depth;c=c.parent}b=b.parent}return!1};
StageItem.prototype.isPointObscured=function(a,b,c,d,e){var f=this,g=!1;f.slide.deepEach(function(e,j){if(!g&&!j.isShapeMask&&j!=f&&j!=c&&j.isAbove&&j.isAbove(f)&&j.isPointActive(a,b)&&(!c||!c.isAncestor(j)))if("ScrollArea"==j.innerType){var l=j.ref.get(0).scrollTop;g=j.isPointActive(a,b-l,c,d)}else j.nearestScrollAreaAncestor&&j.nearestScrollAreaAncestor!=f.nearestScrollAreaAncestor?(l=j.nearestScrollAreaAncestor.ref.get(0).scrollTop,g=j.nearestScrollAreaAncestor.testOver(a,b)&&j.isPointActive(a,
b-l,c,d)):j.isHotspotMarker||(g=!0)},function(a){if(e&&a.layer&&a.layer!=f.layer)return!1;var b=d&&d(a);return a!=f&&a.visible&&a!=c&&!b});f.scrollArea&&(g=g||!f.scrollArea.isPointVisible(a,b));return g};
DragItem.prototype.findDropArea=function(){for(var a=null,b=1E5,c=0;c<this.slide.dragDropAndOver.length;c++)if((area=this.slide.dragDropAndOver[c])&&(util.hasMutualKey(area.dragDropIDs,this.dragDropIDs)||util.hasMutualKey(area.dragOverIDs,this.dragOverIDs))&&this.testOverlap(area)){var d=this.slideX()+this.dragX,e=this.slideY()+this.dragY,d=Math.sqrt(Math.pow(d-area.slideX(),2)+Math.pow(e-area.slideY(),2));d<b&&(a=area,b=d)}this.variables.DragOverId="";c=b=null;if(null!=a){a.isDropArea&&util.hasMutualKey(a.dragDropIDs,
this.dragDropIDs)&&(b=a);if(a.announceDragOver&&util.hasMutualKey(a.dragOverIDs,this.dragOverIDs))c=a,this.variables.DragOverId=c.id;(null==c||DragItem.dragOver!=c)&&this.handleEvent("ondragout",null,null,!1,!1,!0);null!=DragItem.dragOver&&DragItem.dragOver!=c&&DragItem.dragOver.handleEvent("ondragout",null,null,!1,!1,!0);null!=c&&(this.handleEvent("ondragover",null,null,!1,!1,!0),c.handleEvent("ondragover",null,null,!1,!1,!0))}else null!=DragItem.dragOver&&(DragItem.dragOver.handleEvent("ondragout",
null,null,!1,!1,!0),this.handleEvent("ondragout",null,null,!1,!1,!0));DragItem.dragOver=c;DragItem.dropArea=b;DropArea.update();return b};DragItem.prototype.swapPositionsWith=function(a){var b=this.y;this.y=a.y;a.y=b;this.ref.css("top",this.y+"px");a.ref.css("top",a.y+"px")};
DragItem.prototype.updatePosition=function(){var a=this.fillet||0;if(this.dropArea)switch(this.dropArea.droptype){case "matching":this.x=this.dropArea.x+this.dropArea.width-a;this.y=this.dropArea.y;if(this.variables.ReviewMode)this.x=parseInt(this.originalX);break;case "snap":this.x=this.dropArea.x+this.dropArea.snapx-this.snapx;this.y=this.dropArea.y+this.dropArea.snapy-this.snapy;break;case "tile":break;case "free":if(void 0==this.lastX)this.lastX=this.x,this.lastY=this.y;this.x=this.dragX+this.lastX;
this.y=this.dragY+this.lastY;this.lastX=this.x;this.lastY=this.y;break;case "stackoffset":break;case "stackrandom":if(void 0==this.randx&&(this.randx=Math.random(),this.randy=Math.random(),1==this.dropArea.dockedItemCount))this.randy=this.randx=0.5;var a=parseInt(2*this.randx*this.dropArea.dropoffsetx)-this.dropArea.dropoffsetx,b=parseInt(2*this.randy*this.dropArea.dropoffsety)-this.dropArea.dropoffsety;this.x=this.dropArea.x+this.dropArea.snapx-this.snapx+a;this.y=this.dropArea.y+this.dropArea.snapy-
this.snapy+b;break;case "wordbank":this.x=this.dropArea.x;this.y=this.dropArea.y;break;default:this.x=this.dropArea.x,this.y=this.dropArea.y}else if(this.dragreturn)if(this.shuffled&&"sequence"!=this.style){if(this.x=parseInt(this.shuffleX),"matching"!=this.style)this.y=parseInt(this.shuffleY)}else{if(this.x=parseInt(this.originalX),"matching"!=this.style)this.y=parseInt(this.originalY)}else this.x+=this.dragX,this.y+=this.dragY;this.x=Math.round(this.x);this.y=Math.round(this.y);this.ref&&(this.ref.css("left",
this.x+this.xoffset+"px"),this.ref.css("top",this.y+this.yoffset+"px"));this.updateMatrixComplete(!0)};DragItem.prototype.undock=function(a){if(this.dropArea)this.dropArea.variables.DragConnectData="",this.dropArea.dockedItemCount--,this.dropArea.dragItem=null;this.variables.DropTargetId="";if(!a)this.dropArea=null,this.dragreturn&&this.originalParent&&this.originalParent!=this.parent&&this.reParent(this.originalParent),this.updatePosition(),DropArea.unstackItem(this),DropArea.update()};
DragItem.prototype.dock=function(a,b){var c=this;"matching"==c.style?(c.slide.dragItems.forEach(function(b){b&&b!=c&&Math.round(b.y)==Math.round(a.y)&&(c.reParent(b.parent),c.swapPositionsWith(b),b.undock())}),c.dropArea=a,c.render("",!1,null,"dock "+c.style)):"wordbank"==c.style&&(c.slide.dragItems.forEach(function(a){a&&a!=c&&a.undock()}),c.render("",!1,null,"dock "+c.style));this.dropArea&&this.undock(!0);a.variables.DragConnectData=this.connectdata;a.dragItem=this;a.dockedItemCount++;c.variables.DropTargetId=
a.id;c.dropArea=a;DropArea.unstackItem(this,c.dropArea);c.updatePosition();c.render(c.lastRenderedState);a&&(!a.multidrop&&0<a.dockedItemCount&&c.slide.dragItems.forEach(function(b){if(b&&b!=c&&b.dropArea==a)b.x=parseInt(b.originalX),b.y=parseInt(b.originalY),b.undock()}),a.findSlot(this),a.updateSlotPositions());swipe.moved=!1;b||a.handleEvent("ondragconnect",null,null,!1,!1,!0)};DragItem.prototype.set_review=function(){this.render("",!0)};var bwDragPathItem=function(){};bwDragPathItem.CUBIC="cubic";bwDragPathItem.QUADRATIC="quadratic";bwDragPathItem.LINE="line";
StageItem.prototype.convertToDragPathItem=function(a){this.reset=this.resetElement;this.StageElementSetOnStage=StageItem.prototype.setOnStage;this.initDrag=bwDragPathItem.prototype.initDrag;this.mousedown=bwDragPathItem.prototype.mousedown;this.mousemove=bwDragPathItem.prototype.mousemove;this.mouseup=bwDragPathItem.prototype.mouseup;this.cancelDrag=bwDragPathItem.prototype.cancelDrag;this.updateDraggingPosition=bwDragPathItem.prototype.updateDraggingPosition;this.drop=bwDragPathItem.prototype.drop;
this.parseDragPathFromXML=bwDragPathItem.prototype.parseDragPathFromXML;this.SetVariableValue=bwDragPathItem.prototype.SetVariableValue;this.UpdateVariableValue=bwDragPathItem.prototype.UpdateVariableValue;this.GetPointAtLength=bwDragPathItem.prototype.GetPointAtLength;this.GetSegmentAndPositionAtLength=bwDragPathItem.prototype.GetSegmentAndPositionAtLength;this.HandleBoundVarChanged=bwDragPathItem.prototype.HandleBoundVarChanged;this.GetDragPathResumeData=bwDragPathItem.prototype.GetDragPathResumeData;
this.SetDragPathResumeData=bwDragPathItem.prototype.SetDragPathResumeData;this.getMousePoint=bwDragPathItem.prototype.getMousePoint;this.setOnStage=bwDragPathItem.prototype.setOnStage;this.ResetPosition=bwDragPathItem.prototype.ResetPosition;this.UpdateValueToMatchLinkedVariable=bwDragPathItem.prototype.UpdateValueToMatchLinkedVariable;this.m_ptRawOffset=new Point(0,0);this.m_ptLastPos=null;this.m_vecPath=[];this.m_bLiveUpdate=this.m_bSnap=!1;this.m_nEndValue=this.m_nStartValue=NaN;this.m_nVarRange=
0;this.m_nIncrement=1;this.m_nSnapInterval=NaN;this.m_bMouseDown=!1;this.m_nCurrentLength=this.m_nTotalLength=0;this.m_nPrecision=10;this.m_strBindTo="";this.m_ptHidingPos=null;this.m_bShownAtLeastOnce=!1;this.hasDragPath=this.isDragItem=!0;this.parseDragPathFromXML(a);this.m_strBindTo&&""!=this.m_strBindTo&&(this.bindVarListener(this.m_strBindTo),this.SetVariableValue(this.extractVariable(this.m_strBindTo)))};
bwDragPathItem.prototype.parseDragPathFromXML=function(a){a=$(a).children("dragpath")[0];this.m_nStartValue=parseFloat($(a).attr("startvalue"));this.m_nEndValue=parseFloat($(a).attr("endvalue"));this.m_nVarRange=this.m_nEndValue-this.m_nStartValue;this.m_strBindTo=$(a).attr("bindto");this.m_bSnap="true"==$(a).attr("snap");this.m_bLiveUpdate="true"==$(a).attr("snap");for(var b=null,c="",d=$(a).children("path"),e=0;e<d.length;++e){var f=$(d).children()[e],c=$(f).attr("type");switch(c){case bwDragPathItem.CUBIC:b=
new bwCubicBezierSegment(this,f,this.m_nPrecision);break;case bwDragPathItem.QUADRATIC:b=new bwQuadraticBezierSegment(this,f,this.m_nPrecision);break;case bwDragPathItem.LINE:b=new bwLineSegment(this,f)}this.m_nTotalLength+=b.GetLength();this.m_vecPath.push(b)}if(this.m_bSnap)this.m_nIncrement=parseFloat($(a).attr("increment")),this.m_nSnapInterval=this.m_nIncrement*this.m_nTotalLength/this.m_nVarRange;this.m_strBindTo&&""!=this.m_strBindTo&&this.bindVarListener(this.m_strBindTo)};
bwDragPathItem.initialized=!1;bwDragPathItem.init=function(){bwDragPathItem.initialized=!0;bwDragPathItem.cargo=null;var a=function(a){bwDragPathItem.cargo&&(bwDragPathItem.cargo.mousemove(a),a.preventDefault())};player.isMobile?($(document.body).bind("touchmove",a),$(window).bind("touchend",bwDragPathItem.handleMouseUp)):($(document.body).bind("mousemove",a),$(window).bind("mouseup",bwDragPathItem.handleMouseUp))};
bwDragPathItem.handleMouseUp=function(a){bwDragPathItem.cargo&&(bwDragPathItem.cargo.mouseup(a),a.preventDefault())};bwDragPathItem.cancelDrag=function(){bwDragPathItem.cargo&&bwDragPathItem.cargo.cancelDrag()};bwDragPathItem.prototype.GetDragPathResumeData=function(){var a=bwChunk.Base10toN(this.m_ptRawOffset.x,2);return a+=bwChunk.Base10toN(this.m_ptRawOffset.y,2)};
bwDragPathItem.prototype.SetDragPathResumeData=function(a){this.m_ptRawOffset.x=bwChunk.BaseNto10(a.substr(0,2));this.m_ptRawOffset.y=bwChunk.BaseNto10(a.substr(2,2));return a.substr(4)};bwDragPathItem.prototype.GetPointAtLength=function(a){for(var b=0,c=0;b<this.m_vecPath.length-1&&a>=c+this.m_vecPath[b].GetLength();)c+=this.m_vecPath[b].GetLength(),++b;a=Math.max(0,Math.min(this.m_vecPath[b].GetLength(),a-c));return this.m_vecPath[b].GetPointAtPosition(a)};
bwDragPathItem.prototype.initDrag=function(){bwDragPathItem.initialized||bwDragPathItem.init();this.updateMatrixComplete()};bwDragPathItem.prototype.getMousePoint=function(a){var b=0,c=0;a.originalEvent.touches?0<a.originalEvent.touches.length?(b=a.originalEvent.touches[0].pageX,c=a.originalEvent.touches[0].pageY):(b=a.originalEvent.changedTouches[0].pageX,c=a.originalEvent.changedTouches[0].pageY):(b=a.pageX,c=a.pageY);return new Point(b,c)};
bwDragPathItem.prototype.cancelDrag=function(){this.drop();this.handleEvent("ondragpathmouseend");this.m_bMouseDown=!1};bwDragPathItem.prototype.drop=function(){this.dragging=!1;bwDragPathItem.cargo=null;swipe.moved=!1;this.handleEvent("onrelease",null,null,!1,!1,!0)};
bwDragPathItem.prototype.mousedown=function(a){this.m_bMouseDown=!0;var b=1;if(a.originalEvent&&a.originalEvent.touches&&(b=a.originalEvent.touches.length,1<b)){this.cancelDrag();return}a=MouseEvents.getMousePoint(a);a=MouseEvents.globalToLocal(this.ref.get(0),a);b=player.isMobile?2:0;if(!(a.x<this.xoffset-b||a.x>this.width+b-this.xoffset||a.y<this.yoffset-b||a.y>this.height+b-this.yoffset)&&!this.isDisabled&&!this.parent.isDisabled)this.m_ptTargetOffset=new Point(a.x-this.rotatexpos,a.y-this.rotateypos),
a=new MatrixTransform,a.rotate(this.getGlobalRotation()*ppArt.DEGREE_MULTIPLIER),this.m_ptTargetOffset=a.transformPoint(this.m_ptTargetOffset.x,this.m_ptTargetOffset.y),this.dragging=!0,bwDragPathItem.cargo=this,this.handleEvent("onpress",null,null,!1,!1,!0)};bwDragPathItem.prototype.mousemove=function(a){if(a.originalEvent&&a.originalEvent.touches&&1<a.originalEvent.touches.length)this.cancelDrag();else if(this.dragging)swipe.moved=!0,this.updateDraggingPosition(this.getMousePoint(a),this.m_bLiveUpdate)};
bwDragPathItem.prototype.mouseup=function(a){this.drop();this.updateDraggingPosition(this.getMousePoint(a),!0);this.x=Math.round(this.x);this.y=Math.round(this.y);this.handleEvent("ondragpathmouseend");this.m_bMouseDown=!1};
bwDragPathItem.prototype.updateDraggingPosition=function(a,b){var c=MouseEvents.globalToLocal(this.slide.ref.get(0),a),c=new Point(c.x-this.m_ptTargetOffset.x,c.y-this.m_ptTargetOffset.y),d=new Point(this.m_ptRawOffset.x,this.m_ptRawOffset.y),c=new Point(c.x-this.m_ptLastPos.x,c.y-this.m_ptLastPos.y),c=new Point(this.m_ptRawOffset.x+c.x,this.m_ptRawOffset.y+c.y),e=this.m_vecPath[0];this.m_ptRawOffset=e.GetDragPoint(c,this.m_bSnap?this.m_nSnapInterval:NaN);this.m_nCurrentLength=e.GetDistanceForPoint(this.m_ptRawOffset);
if(this.m_ptRawOffset.x!=d.x||this.m_ptRawOffset.y!=d.y){d=new Point(this.m_ptRawOffset.x-d.x,this.m_ptRawOffset.y-d.y);if(null!=this.m_ptLastPos)this.m_ptLastPos=new Point(this.m_ptLastPos.x+d.x,this.m_ptLastPos.y+d.y);this.x+=d.x;this.y+=d.y;this.ref&&(this.ref.css("left",this.x+this.xoffset),this.ref.css("top",this.y+this.yoffset));this.updateMatrixComplete(!0)}b&&this.UpdateVariableValue()};
bwDragPathItem.prototype.ResetPosition=function(){this.SetVariableValue(this.m_nStartValue);this.m_ptRawOffset=new Point(0,0);var a=MouseEvents.localToGlobal(this.ref.get(0),new Point(this.rotatexpos,this.rotateypos));this.m_ptLastPos=MouseEvents.globalToLocal(this.slide.ref.get(0),a);this.UpdateValueToMatchLinkedVariable()};
bwDragPathItem.prototype.setOnStage=function(a,b){this.StageElementSetOnStage(a,b);if(a){var c=this;setTimeout(function(){if(null==c.m_ptHidingPos||c.m_ptHidingPos.x!=c.x||c.m_ptHidingPos.y!=c.y)c.ResetPosition(),c.m_ptHidingPos=null;this.m_bShownAtLeastOnce=!0},0)}else if(this.m_bShownAtLeastOnce)this.m_ptHidingPos=new Point(this.x,this.y)};bwDragPathItem.prototype.UpdateValueToMatchLinkedVariable=function(){this.m_strBindTo&&""!=this.m_strBindTo&&this.SetVariableValue(this.extractVariable(this.m_strBindTo))};
bwDragPathItem.prototype.HandleBoundVarChanged=function(){this.UpdateValueToMatchLinkedVariable()};
bwDragPathItem.prototype.SetVariableValue=function(a){if(!this.m_bMouseDown){var b=new Point(this.m_ptRawOffset.x,this.m_ptRawOffset.y),a=(a-this.m_nStartValue)/this.m_nVarRange*this.m_nTotalLength;this.m_ptRawOffset=this.GetPointAtLength(a);this.m_nCurrentLength=this.GetSegmentAndPositionAtLength(a).segment.GetDistanceForPoint(this.m_ptRawOffset);b=new Point(this.m_ptRawOffset.x-b.x,this.m_ptRawOffset.y-b.y);if(null!=this.m_ptLastPos)this.m_ptLastPos=new Point(this.m_ptLastPos.x+b.x,this.m_ptLastPos.y+
b.y);this.x+=b.x;this.y+=b.y;this.ref&&(this.ref.css("left",this.x+this.xoffset),this.ref.css("top",this.y+this.yoffset));this.updateMatrixComplete(!0)}};bwDragPathItem.prototype.GetSegmentAndPositionAtLength=function(a){for(var b=0,c=this.m_vecPath[0],d=c.GetLength(),e=0;b<this.m_vecPath.length-1&&a>=e;)++b,c=this.m_vecPath[b],d=c.GetLength(),e+=d;a=Math.max(0,Math.min(d,a-e));return{segment:c,position:a}};
bwDragPathItem.prototype.UpdateVariableValue=function(){if(this.m_strBindTo&&""!=this.m_strBindTo){var a=this.m_nStartValue+this.m_nCurrentLength/this.m_nTotalLength*this.m_nVarRange;isNaN(this.m_nIncrement)||(a=Math.round(a/this.m_nIncrement)*this.m_nIncrement);var b=Math.min(this.m_nStartValue,this.m_nEndValue),c=Math.max(this.m_nStartValue,this.m_nEndValue),a=Math.max(b,Math.min(c,a));this.setVariable(this.m_strBindTo,a)}};var DropArea=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="droparea";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.deferredResourceIndex=0;this.fillet=10;this.droptype="matching";this.lastRenderedState=null;this.snapy=this.snapx=0;this.multidrop=this.dragreturn=!0;this.dropoffsety=this.dropoffsetx=0;this.slots=[];this.dragItemIDs=
[];this.dockedItemCount=0;this.canvas=this.dragItem=null;this.m_nYOffset=this.m_nXOffset=0;this.m_nHeight=this.m_nWidth=1E3;this.dragDropIDs={global:!0};this.dragOverIDs={global:!0};this.isDropArea=!0};DropArea.prototype=new StageItem;DropArea.prototype.objectType="Item";DropArea.prototype.innerType="DropArea";DropArea.prototype.extractNextSpecialVar=function(a){if(a=this.getItemByResumeIndex(bwChunk.BaseNto10(a)))this.dragItem=a};
DropArea.prototype.getExtraResumeVars=function(){var a=-1;this.variableResumes.VAR_SELECTED_ITEM=!0;this.variableDefaults.VAR_SELECTED_ITEM=-1;this.variableTypes.VAR_SELECTED_ITEM="number";switch(this.style){case "matching":case "wordbank":return this.dragItem&&(a=this.dragItem.getItemIndex()),{VAR_SELECTED_ITEM:a};default:return{}}};DropArea.prototype.toBaseData=Element.prototype.toData;
DropArea.prototype.toData=function(a){var b=this.toBaseData(a);if(this.DragConnectData)b.DragConnectData=this.DragConnectData;if(this.slots&&0<this.slots.length)b.slots=[],$.each(this.slots,function(a,d){b.slots.push(d.id)});return b};DropArea.prototype.updateBaseFromData=Element.prototype.updateFromData;
DropArea.prototype.updateFromData=function(a){var b=this;this.updateBaseFromData(a);if(a.DragConnectData)this.DragConnectData=a.DragConnectData;if(a.slots)this.slots=[],$.each(a.slots,function(a,d){var e=b.parent.children[d];e&&b.slots.push(e)})};DropArea.prototype.resetStageItem=Element.prototype.reset;DropArea.prototype.reset=function(a){this.resetStageItem(a);this.slots=[];this.dragItemIDs=[];this.dockedItemCount=0;this.dragitem=null};
StageItem.prototype.convertToDropArea=function(a){this.toBaseData=DropArea.prototype.toBaseData;this.toData=DropArea.prototype.toData;this.updateBaseFromData=DropArea.prototype.updateBaseFromData;this.updateFromData=DropArea.prototype.updateFromData;this.resetStageItem=DropArea.prototype.resetStageItem;this.reset=DropArea.prototype.reset;this.update=DragItem.prototype.update;this.findSlot=DropArea.prototype.findSlot;this.findTileSlot=DropArea.prototype.findTileSlot;this.findOffsetSlot=DropArea.prototype.findOffsetSlot;
this.updateSlotPositions=DropArea.prototype.updateSlotPositions;this.unstack=DropArea.prototype.unstack;this.parseDragGroupsFromXML=DropArea.prototype.parseDragGroupsFromXML;this.getDragItemIndex=DropArea.prototype.getDragItemIndex;this.getExtraResumeVars=DropArea.prototype.getExtraResumeVars;this.extractNextSpecialVar=DropArea.prototype.extractNextSpecialVar;this.lastRenderedState=null;switch(this.innerType){case "textfield":case "image":break;case "ItemGroup":case "StateGroup":this.render=function(){};
break;default:this.render=VectorShape.prototype.render,this.renderOnUpdate=VectorShape.prototype.renderOnUpdate,this.setVisible=VectorShape.prototype.setVisible}this.originalWidth=parseInt($(a).attr("width"));this.originalHeight=parseInt($(a).attr("height"));this.originalX=this.x;this.originalY=this.y;this.droptype=$(a).children("dragdrop").attr("droptype");this.snapx=parseInt($(a).children("dragdrop").attr("snapx"));this.snapy=parseInt($(a).children("dragdrop").attr("snapy"));this.dragreturn="true"==
$(a).children("dragdrop").attr("dragreturn");this.multidrop="true"==$(a).children("dragdrop").attr("multidrop");this.dropoffsetx=parseInt($(a).children("dragdrop").attr("dropoffsetx"));this.dropoffsety=parseInt($(a).children("dragdrop").attr("dropoffsety"));this.slots=[];this.dragItemIDs=[];this.dockedItemCount=0;this.isDropArea=!0;this.variables.DragConnectData="";this.variableDefaults.DragConnectData="";this.parseDragGroupsFromXML(a)};
DropArea.update=function(){player.currentSlide().dropAreas.forEach(function(a){a&&("droparea"==a.innerType&&(a==DragItem.dropArea?a.render("over"):a.render()),a.updateSlotPositions())});DragItem.cargo&&DragItem.dropArea&&DragItem.dropArea.findSlot(DragItem.cargo)};DropArea.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;DropArea.prototype.parseDragGroupsFromXML=DragItem.prototype.parseDragGroupsFromXML;
DropArea.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.style=$(a).attr("style");this.droptype=$(a).attr("style");this.reviewdata=$(a).attr("reviewdata");this.originalWidth=parseInt($(a).attr("width"));this.originalHeight=parseInt($(a).attr("height"));this.alttext=$(this.xml).find("textdata").attr("alttext");this.variables.DragConnectData="";this.variableDefaults.DragConnectData="";b=$(a).children("data").children("textdata");a=$(a).children("data").children("textdata").children("vectortext");
c=a.children("pr");if(1==c.length){this.textSprite={canvas:null,m_nXOffset:0,m_nYOffset:0,width:1E3,height:1E3,charIndex:0,maxCharIndex:0,vectorHot:!1,isShapeMask:!1};if(null!=$(a).attr("top"))this.textSprite.x=$(b).attr("xpos"),this.textSprite.y=$(b).attr("ypos"),this.textSprite.width=$(b).attr("width"),this.textSprite.height=$(b).attr("height"),this.textSprite.rectShape=new ppRect(parseInt($(a).attr("left")),parseInt($(a).attr("top")),parseInt($(a).attr("right")),parseInt($(a).attr("bottom"))),
this.textSprite.rectShape.right=Math.max(this.textSprite.rectShape.right,this.width),this.textSprite.rectShape.bottom=Math.max(this.textSprite.rectShape.bottom,this.height),this.textSprite.originalRectShape=this.rectShape;this.textSprite.path=PathLib.getPathFromXML(c)}this.canSimplify=!1};DropArea.prototype.loadDragDropFromXML=function(){};DropArea.prototype.createBaseRef=StageItem.prototype.createRef;
DropArea.prototype.createRef=function(){if(this.ref)return this.render(null,!0),!1;this.type="droparea";if(!this.createBaseRef())return!1;this.ref.addClass("droparea");var a=$("<canvas></canvas>");a.attr("width",this.width);a.attr("height",this.height);a.css("position","absolute");this.ref.append(a);var b=$("<canvas></canvas>");b.attr("width",this.width);b.attr("height",this.height);b.css("margin","0 0 0 "+this.fillet+"px");b.css("position","absolute");this.ref.append(b);if(this.textSprite){var c=
$("<canvas></canvas>");c.css("position","absolute");c.css("left",this.textSprite.x+"px");c.css("top",this.textSprite.y+"px");c.attr("width",this.width+"px");c.attr("height",this.height+"px");c.attr("id",this.id+"_text");this.ref.append(c);this.textSprite.canvas=c.get(0);this.textRef=c}this.border=a.get(0);this.jcanvas=b;this.canvas=b.get(0);this.bindEvents();this.render();return!0};
DropArea.prototype.bindEvents=function(){var a=this;a.ref.bind("dragstart",function(a){a.preventDefault()});a.ref.bind("mouseover",function(){DragItem.cargo&&a.render("over")});a.ref.bind("mouseout",function(){a.render("out")})};DropArea.prototype.renderCallback=function(){};
DropArea.prototype.render=function(a,b){if(this.ref&&(b||a!=this.lastRenderedState)){this.lastRenderedState=a;var c=this.border.getContext("2d"),d=parseInt(900*Math.random()+1100)%1E3;c.fillStyle="#"+d;c.fillStyle="#fff";c.lineWidth=1;c.strokeStyle="#ccc";d=c.createLinearGradient(0,0,0,this.height);d.addColorStop(0,"#fcfcfc");d.addColorStop(1,"#eaeaea");c.fillStyle=d;this.colors[a]&&this.colors[a].applyCanvas(c,this,!0,!1);switch(a){case "over":c.lineWidth=3;break;default:c.lineWidth=1}var d=c.lineWidth/
2,e=this.fillet;switch(this.style){case "matching":c.beginPath();c.moveTo(0+d,0+d);c.lineTo(this.width-d,0+d);c.lineTo(this.width-d,e-d);c.lineTo(this.width-e-d,e-d);c.lineTo(this.width-e-d,this.height-e+d);c.lineTo(this.width-d,this.height-e+d);c.lineTo(this.width-d,this.height-d);c.lineTo(0+d,this.height-d);c.lineTo(0+d,0+d);c.fill();c.save();c.clip();c.strokeStyle="#fff";c.lineWidth=5;c.stroke();c.restore();c.lineWidth=1;c.strokeStyle="#ccc";c.stroke();if(this.variables.ReviewMode){c.fillStyle=
"#DB0000";if(this.matchingDragItem&&this.matchingDragItem.reviewdata==this.reviewdata)c.fillStyle="#008520";e=8;c.beginPath();c.arc(8,8,e,0,2*Math.PI);c.fill();e=7;c.beginPath();c.fillStyle="#000";c.strokeStyle="rgba(255,255,255,0.5)";c.lineWidth=0.5;c.arc(8,8,e,0,2*Math.PI);c.fill();c.stroke();c.fillStyle="#fff";c.font="10px sans-serif";c.textBaseline="top";1<this.reviewdata.length?c.fillText(this.reviewdata,2,2):c.fillText(this.reviewdata,5,2)}break;case "wordbank":if(this.variables.ReviewMode)c.lineWidth=
2,c.strokeStyle="#DB0000";e=this.height/2;c.beginPath();c.moveTo(e+d,d);c.lineTo(this.width-e-d,d);c.arc(this.width-e-d,e,e-c.lineWidth/2,3*Math.PI/2,Math.PI/2);c.lineTo(e+d,this.height-d);c.arc(e+d,e,e-c.lineWidth/2,Math.PI/2,3*Math.PI/2);c.fill();c.stroke();break;default:c.fillRect(d,d,this.width,this.height-c.lineWidth),c.strokeRect(d,d,this.width,this.height-c.lineWidth)}if(this.textSprite)c=new ppTextLib(this.xml),ppArt.itemID=this.id,ppArt.item=this,ppArt.m_bMaskMode=!1,ppArt.DrawVector(this.textSprite,
this.textSprite.path,c,player.fontlib,this.imagelib,null,null)}};
DropArea.prototype.updateSlotPositions=function(){switch(this.droptype){case "stackrandom":case "free":return;case "stackoffset":for(var a=0,b=0;b<this.slots.length;b++){var c=this.slots[b];if(c!=DragItem.cargo)c.x=this.x+b*this.dropoffsetx,c.y=this.y+b*this.dropoffsety,c.ref.css("left",c.x+c.xoffset+"px"),c.ref.css("top",c.y+c.yoffset+"px"),c.updateMatrixComplete(!0),0==a?a=c.depth:c.setZIndex(a+b)}return}for(var d=a=0,e=0,b=0;b<this.slots.length;b++){c=this.slots[b];a+c.width>this.width&&(a=0,d+=
e);if(c!=DragItem.cargo)c.x=this.x+a,c.y=this.y+d,c.updatePosition();e=c.height;a+=c.width}};DropArea.prototype.findSlot=function(a){"tile"==this.droptype?(this.findTileSlot(a),this.updateSlotPositions()):"stackoffset"==this.droptype&&(this.findOffsetSlot(a),this.updateSlotPositions())};
DropArea.prototype.findTileSlot=function(a){var b=a.x-this.x+a.dragX+a.snapx,c=a.y-this.y+a.dragY+a.snapy,d=this.slots.indexOf(a);-1<d&&this.slots.splice(d,1);if(0>b&&0>c)this.slots.splice(0,0,a);else{for(var e=0,f=0,g=0,h=0,d=h=0;d<this.slots.length;d++){var j=this.slots[d],e=e+g;e+j.width>this.width&&(e=0,f+=h);g=j.width;h=j.height;if(b+a.width<=this.width&&b<=e+g&&c<=f+h){this.slots.splice(d,0,a);return}if(c<=f+h&&e+g>=this.width){this.slots.splice(d,0,a);return}}this.slots.push(a)}};
DropArea.prototype.findOffsetSlot=function(a){var b=a.x-this.x+a.dragX,c=a.y-this.y+a.dragY,d=this.slots.indexOf(a);-1<d&&this.slots.splice(d,1);for(d=0;d<this.slots.length;d++)if(b<d*this.dropoffsetx&&c<d*this.dropoffsety){this.slots.splice(d,0,a);return}this.slots.push(a)};DropArea.prototype.getDragItemIndex=function(a){if(0==this.slots.length)return 0;for(var b=0;b<this.slots.length;b++)if(this.slots[b]==a)return b;return-1};
DropArea.unstackItem=function(a,b){player.currentSlide().dropAreas.forEach(function(c){c!=b&&c.unstack(a)})};DropArea.prototype.unstack=function(a){a=this.slots.indexOf(a);-1<a&&this.slots.splice(a,1)};DragItem.prototype.set_review=function(){this.render("",!0)};var DropList=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.content={fontsize:18,font:"Arial"};this.constructElement();this.events=[];this.clickFocus=this.active=!0;this.originalIndices={}};DropList.prototype=new StageItem;DropList.prototype.innerType="DropList";DropList.prototype.objectType="Item";DropList.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;DropList.prototype.showBase=StageItem.prototype.show;DropList.prototype.hideBase=StageItem.prototype.hide;
DropList.prototype.toBaseData=Element.prototype.toData;DropList.prototype.toData=function(){var a=this.toBaseData();if(this.shuffleOrder)a.shuffleOrder=this.shuffleOrder;return a};DropList.prototype.updateBaseFromData=Element.prototype.updateFromData;DropList.prototype.updateFromData=function(a){this.updateBaseFromData(a);if(a.shuffleOrder)this.shuffleOrder=a.shuffleOrder};
DropList.prototype.extractNextSpecialVar=function(a){a=$(this.xml).children("data").children("itemlist").children().get(a);a=$(a).attr("itemdata");this.variables.SelectedItemData=a;this.ref&&this.select&&this.select.val(a)};DropList.prototype.getExtraResumeVars=function(){this.variableResumes.VAR_SELECTED_ITEM=!0;this.variableDefaults.VAR_SELECTED_ITEM=-1;this.variableTypes.VAR_SELECTED_ITEM="number";var a=-1;this.ref&&this.select&&(a=this.originalIndices[this.select.val()],void 0===a&&(a=-1));return{VAR_SELECTED_ITEM:a}};
DropList.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.updateMatrixComplete();this.alttext=$(a).children("data").children("textdata ").attr("alttext");this.shuffle="true"==$(a).attr("shuffle");this.originalWidth=this.width;this.reviewWidth=parseInt($(a).attr("reviewwidth"));this.shuffleOrder=[];this.type="droplist"};DropList.prototype.update=function(){this.variables.SelectedItemData=this.select.val()};
DropList.prototype.createRef=function(){if(this.ref)return this.update(),!1;var a=this;this.container=this.parent.ref;this.ref=$('<div class="item droplist interactive"></div>');this.applySize(this.ref);this.container.append(this.ref);this.canvas=this.ref.get(0);this.select=$('<select tabindex="-1"></select>');this.select.css("font-size",this.content.fontsize+"px");this.select.css("font-family",this.content.font+",Arial,Sans-Serif");this.applySize(this.select);this.ref.append(this.select);if(this.isDisabled)this.select.get(0).disabled=
!0;this.contentRef=this.ref;var b={};$(this.xml).children("data").children("itemlist").children().each(function(c,e){var f=$(e).attr("itemdata"),g=$(e).children("textdata").attr("alttext"),h=$("<option value='"+f+"'>"+g+"</option>");a.originalIndices[f]=c;b[g]=h;a.shuffleOrder.length<=c&&a.shuffleOrder.push(0.5<Math.random());a.shuffle&&a.shuffleOrder[c]?a.select.prepend(h):a.select.append(h)});if(this.alttext&&""!=this.alttext)if(b[this.alttext])b[this.alttext].get(0).selected=!0;else{var c=$("<option value=''>"+
this.alttext+"</option>");a.select.prepend(c)}void 0!=this.variables.SelectedItemData&&this.select.val(this.variables.SelectedItemData);a.select.bind("change click",function(){a.update()});a.select.bind("blur",function(){a.handleEvent("onlosefocus",null,null,!1,!1,!0)});a.update();return!0};DropList.prototype.set_review=function(a){this.select&&this.select.css("width",a?this.reviewWidth:this.originalWidth)};var Button=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="textfield";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.deferredResourceIndex=0;this.canvas=null;this.m_nYOffset=this.m_nXOffset=0;this.height=this.width=1E3};Button.prototype=new StageItem;Button.prototype.objectType="Item";Button.prototype.innerType="Item";
Button.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;
Button.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.style=$(a).attr("style");this.connectdata=$(a).attr("connectdata");this.originalWidth=parseInt($(a).attr("width"));this.originalHeight=parseInt($(a).attr("height"));this.originalX=this.x;this.originalY=this.y;if(0<$(a).children("data").children("textdata").children("vartext").length)this.textlib=$(a).children("data");b=$(a).children("data").children("textdata").children("vectortext").children("path");c=$(a).children("data").children("textdata").children("vectortext").children("pr");
if(1==b.length||1==c.length){a=$(a).children("data").children("textdata").children("vectortext");if(null!=$(a).attr("top"))this.originalRectShape=this.rectShape=new ppRect(parseInt($(a).attr("left")),parseInt($(a).attr("top")),parseInt($(a).attr("right")),parseInt($(a).attr("bottom")));this.content.path=1==c.length?PathLib.getPathFromXML(c):b.text()}this.canSimplify=!1};Button.prototype.createBaseRef=StageItem.prototype.createRef;
Button.prototype.createRef=function(){if(this.ref||!this.createBaseRef())return!1;this.ref.addClass("interactive");if(1<this.ref.children().length)return!1;this.contentRef=$('<div class="item unhideable"></div>');this.contentRef.css("width","100%");this.ref.append(this.contentRef);var a=$("<canvas></canvas>");a.css("position","absolute");this.ref.append(a);var b=$("<canvas></canvas>");b.css("position","relative");this.ref.append(b);this.jcanvas=b;this.border=a.get(0);this.canvas=b.get(0);this.render("btn_bg");
this.ref.css("width",this.width-2);this.ref.css("height",this.height-2);return!0};Button.prototype.destroyBaseRef=StageItem.prototype.destroyRef;Button.prototype.destroyRef=function(){this.ref.empty();this.contentRef.remove();this.contentRef=null;this.destroyBaseRef()};Button.prototype.bindEventsBase=StageItem.prototype.bindEvents;
Button.prototype.bindEvents=function(){var a=this;this.bindEventsBase();this.ref.bind("mouseover",function(){a.render("btn_hover")});this.ref.bind("mouseout mouseup",function(){a.render("btn_bg")});this.ref.bind("mousedown",function(){a.render("btn_down")})};Button.prototype.applySize=function(a){Element.prototype.applySize.call(this,a);this.ref.css("width",this.width-2);this.ref.css("height",this.height-2)};
Button.prototype.renderCallback=function(){this.width=this.originalWidth;this.height=this.originalHeight;this.render("btn_bg")};Button.prototype.render=function(a){this.ref&&(this.colors[a]&&this.colors[a].apply(this.ref,this,!0,!1),this.colors.btn_border&&this.ref.css("border-color",this.colors.btn_border.toColorString()),this.renderVectorForeground(a))};Button.prototype.renderVectorForeground=VectorShape.prototype.render;Button.prototype.renderOnUpdate=VectorShape.prototype.renderOnUpdate;
Button.prototype.setVisible=VectorShape.prototype.setVisible;
Button.prototype.renderCanvas=function(a){if(this.ref){var b=this.border.getContext("2d"),c=parseInt(900*Math.random()+1100)%1E3;b.fillStyle="#"+c;b.fillStyle="#fff";b.lineWidth=1;b.strokeStyle="#ccc";c=b.createLinearGradient(0,0,0,this.height);c.addColorStop(0,"#fcfcfc");c.addColorStop(1,"#eaeaea");b.fillStyle=c;this.colors[a]&&this.colors[a].applyCanvas(b,this,!0,!1);b.fillRect(0.5,0.5,this.width,this.height-1);b.strokeRect(0.5,0.5,this.width,this.height-1)}};var ImageItem=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.type="image";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.stateRefs={};this.xml="";this.deferredResourceIndex=0;this.canvas=null;this.m_nYOffset=this.m_nXOffset=0;this.height=this.width=1E3};ImageItem.prototype=new StageItem;ImageItem.prototype.objectType="Item";ImageItem.prototype.innerType="Image";
ImageItem.extractAnimatedGif=function(a){var b=null;$(a).children("imagelib").children("imagedata").each(function(a,d){var e=$(d).attr("altimage");e&&e.indexOf(".gif")==e.length-4&&(b=e)});return b};ImageItem.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;
ImageItem.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.width=parseInt($(a).attr("width"));this.height=parseInt($(a).attr("height"));this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);this.zoomtype=$(a).attr("zoomtype");this.zoomiconurl=$(a).attr("zoomiconurl");this.btnxpos=parseInt($(a).attr("btnxpos"));this.btnypos=parseInt($(a).attr("btnypos"));if(0<$(a).children("zoomdata").children("imagedata").length)this.zoomSrc=player.basepath+$(a).children("zoomdata").children("imagedata").attr("url"),
this.zoomDataType=$(a).children("zoomdata").children("imagedata").attr("type"),this.zoomWidth=parseInt($(a).children("zoomdata").children("imagedata").attr("width")),this.zoomHeight=parseInt($(a).children("zoomdata").children("imagedata").attr("height"));if(0<$(a).children("zoomdata").children("html5data").length)this.zoomSrc=player.basepath+"mobile/"+$(a).children("zoomdata").children("html5data").attr("url");this.canSimplify=!1;this.createStates(a)};
ImageItem.prototype.createStates=function(a){var b=this;b.states._default={index:-1,xml:$(a)};$(a).children("states").children().each(function(a,d){var e=$(d).attr("name");b.states[e]={index:a,xml:d};b.stateCount++})};
ImageItem.prototype.loadContentFromXML=function(a){this.content.src=Element.PixelSrc;var b=$(a).find("html5data"),c=null;0<b.length&&b.attr("url")&&(c="mobile/"+b.attr("url"));c||(c=$(a).children("zoomdata").children("imagedata").attr("url"));c||(c=$(a).children("data").children("imagedata").attr("url"));if(c&&(this.content.src=player.basepath+c,this.content.src.indexOf(".swf")==this.content.src.length-4))this.content.src=this.content.src.replace(".swf",".png"),this.content.src=this.content.src.replace(globals.strContentFolder,
"mobile");0<$(a).children("imagelib").length&&this.loadImageDataFromXML(a)};ImageItem.prototype.destroyBaseRef=StageItem.prototype.destroyRef;ImageItem.prototype.destroyRef=function(){if(this.zoomButton)this.zoomButton.remove(),this.zoomButton=null;if(this.zoomImage)this.zoomImage.remove(),this.zoomImage=null;this.stateRefs={};this.destroyBaseRef()};ImageItem.prototype.createBaseRef=StageItem.prototype.createRef;
ImageItem.prototype.createRef=function(){if(this.ref||!this.createBaseRef())return!1;this.loadContentFromXML(this.xml,this.slide,this.layer);this.contentRef=$('<image class="item unhideable"></image>');this.contentRef.attr("width",this.width);this.contentRef.attr("height",this.height);this.contentRef.attr("src",this.content.src);this.contentRef.css("z-index",this.depth);this.ref.append(this.contentRef);var a=this;if(this.zoomDataType&&!this.zoomButtom){this.zoomiconurl?(this.zoomButton=$("<div style='position: absolute; visibility:hidden;'></div>"),
this.zoomButtonImage=$("<img src='"+player.basepath+this.zoomiconurl+"'>"),this.zoomButton.append(this.zoomButtonImage),this.zoomButtonImage.bind("load",function(){a.zoomButton.css("left",a.btnxpos-a.xoffset-a.zoomButtonImage[0].naturalWidth/2);a.zoomButton.css("top",a.btnypos-a.yoffset-a.zoomButtonImage[0].naturalHeight/2);a.zoomButton.css("visibility","visible")})):this.zoomButton=$("<div class='zoombutton'><div class='zoombuttoninner'></div></div>");this.zoomButton.css("left",this.btnxpos-this.xoffset);
this.zoomButton.css("top",this.btnypos-this.yoffset);this.zoomButton.css("z-index",this.depth+1);this.ref.addClass("interactive");this.ref.addClass("clickable");this.ref.append(this.zoomButton);if(document.all&&player.isLocalFileSystem)this.zoomtype="flashwindow";"htmlwindow"==this.zoomtype?this.setupZoomExternal():this.setupZoomLightbox()}return!0};
ImageItem.prototype.setupZoomLightbox=function(){var a=this,b=$("<image class='zoomimage'/>");b.attr("src",this.zoomSrc);b.attr("width",this.zoomWidth);b.attr("height",this.zoomHeight);$(document.body).append(b);b.hide();this.zoomImage=b;if(!a.clickEvent){b=new StoryEvent(a);b.trigger="onrelease";var c=new TimelineAction(a);c.type="zoom_image";c.xml="<zoom_image/>";c.item=a;b.actions.push(c);a.events.push(b);a.clickEvent=b}this.zoomButton.bind(player.isMobile?"touchend":"click",function(){a.zoom_image()})};
ImageItem.prototype.setZoomedCSS=function(a){var b=player.scaleWithTransform?1:player.frameScale,c=$(".framewrap").offset(),d=c.left*b,c=c.top*b,e=d+player.frame.containerWidth*player.frameScale,f=c+player.frame.containerHeight*player.frameScale,g=f-c,h=e-d,j=this.zoomWidth,l=this.zoomHeight,j=j*player.frameScale,l=l*player.frameScale,m=j/l;m>player.frame.aspectRatio&&j>h?(j=h,l=h*this.zoomHeight/this.zoomWidth):m<=player.frame.aspectRatio&&l>g&&(l=g,j=g/this.zoomHeight*this.zoomWidth);g=this.ref.offset().left*
b+this.width/2-j/2;b=this.ref.offset().top*b+this.height/2-l/2;g<d&&(g=d);b<c&&(b=c);g+j>e&&(g=g-(g+j)+e);b+l>f&&(b=b-(b+l)+f);a.css("width",j);a.css("height",l);a.css("left",g);a.css("top",b)};
ImageItem.prototype.zoom_image=function(){var a=this,b=this.zoomImage,c=player.scaleWithTransform?1:player.frameScale;b.css("width",a.width*player.frameScale);b.css("height",a.height*player.frameScale);b.css("left",a.ref.offset().left*c);b.css("top",a.ref.offset().top*c);b.css("-webkit-transition-property","width,height,left,top");b.css("-webkit-transition-duration","300ms");b.css("-moz-transition-property","width,height,left,top");b.css("-moz-transition-duration","300ms");b.css("-ms-transition-property",
"width,height,left,top");b.css("-ms-transition-duration","300ms");setTimeout(function(){a.setZoomedCSS(b)},0);setTimeout(function(){a.handleEvent("onzoomopened",null,null,!1,!0)},300);b.show();var d=$(".frameInterstitial");0==d.length&&(d=$("<div class='frameInterstitial'></div>"),$(".framewrap").prepend(d));d.removeClass("dark");player.modalInterstitial=!0;player.currentZoomImage=a;MouseEvents.suppressPendingHide();if(!a.addedHideable)MouseEvents.addHideable(".zoomimage",".zoombutton,.image",function(){player.modalInterstitial=
!1;a.zoomed&&(c=player.scaleWithTransform?1:player.frameScale,b.css("-webkit-transition-duration","200ms"),b.css("-moz-transition-duration","200ms"),b.css("-ms-transition-duration","200ms"),b.css("width",a.width*player.frameScale),b.css("height",a.height*player.frameScale),b.css("left",a.ref.offset().left*c),b.css("top",a.ref.offset().top*c),setTimeout(function(){$(".zoomimage").hide();a.handleEvent("onzoomclosed",null,null,!1,!0)},200),player.isIE&&$(".zoomimage").hide());d.hide();player.showingInterstitial=
!1;a.zoomed=!1;player.currentZoomImage=null}),a.addedHideable=!0;d.removeClass("black white");d.unbind();d.show();a.zoomed=!0;a.zoomedImage=b};ImageItem.ZoomRandom=Math.random();
ImageItem.prototype.setupZoomExternal=function(){var a=this,b=player.isMobile?"touchend":"click";if(!a.boundClick)a.boundClick=!0,this.ref.bind(b,function(){if(document.all)if(player.isLocalFileSystem)a.zoomWindow=window.open(a.zoomSrc,story.resumeID+ImageItem.ZoomRandom+"_zoom");else try{a.zoomWindow&&a.zoomWindow.close(),a.zoomWindow=window.open("",story.resumeID+ImageItem.ZoomRandom+"_zoom"),a.zoomWindow.document.body.innerHTML="<base href='"+location.href+"'><img src='"+a.zoomSrc+"' style='max-width:100%;max-height:100%;'/>"}catch(b){a.zoomWindow=
window.open(a.zoomSrc,story.resumeID+ImageItem.ZoomRandom+"_zoom")}else player.useSimpleZoom?a.zoomWindow=window.open(a.zoomSrc,story.resumeID+ImageItem.ZoomRandom+"_zoom"):(a.zoomWindow=window.open("",story.resumeID+"_zoom"),$(a.zoomWindow.document.body).empty(),$(a.zoomWindow.document.body).append($("<base href='"+location.href+"'><img src='"+a.zoomSrc+"' style='max-width:100%;max-height:100%;'/>")))})};
ImageItem.prototype.render=function(a){var b=this.states[a];if(b){var c=$(b.xml).children("data").children("html5data"),b=$(b.xml).children("data").children("imagedata");this.x=this.xpos+parseInt(b.attr("mobiledx"));this.y=this.ypos+parseInt(b.attr("mobiledy"));this.width=parseInt(c.attr("width"));this.height=parseInt(c.attr("height"));this.content.src=player.basepath+"mobile/"+c.attr("url");if(this.stateRefs[a])this.contentRef.remove(),this.contentRef=this.stateRefs[a],this.ref.append(this.contentRef),
this.applySize(this.ref);else{var d=this;this.stateRefs[a]=$('<image class="item unhideable"></image>');this.stateRefs[a].attr("width",this.width);this.stateRefs[a].attr("height",this.height);this.stateRefs[a].attr("src",this.content.src);this.stateRefs[a].css("z-index",this.depth);var e=function(){d.stateRefs[a][0].removeEventListener("load",e);d.contentRef.remove();d.contentRef=d.stateRefs[a];d.ref.append(d.contentRef);d.applySize(d.ref)};this.stateRefs[a][0].addEventListener("load",e,!1)}}};
ImageItem.prototype.applySize=function(a){Element.prototype.applySize.call(this,a);this.contentRef&&(this.contentRef.attr("width",this.width),this.contentRef.attr("height",this.height))};var ItemGroup=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.active=!0};ItemGroup.prototype=new StageItem;ItemGroup.prototype.innerType="ItemGroup";ItemGroup.prototype.objectType="Item";
ItemGroup.prototype.loadFromXML=function(a){this.id=$(a).attr("id");this.shapemaskid=$(a).attr("shapemaskid");this.xml=a;this.loadElementInfoFromXML(a);this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);if(0<$(this.xml).children("dragdrop").length&&("true"==$(this.xml).children("dragdrop").first().attr("dragenabled")&&this.convertToDragItem(this.xml),"true"==$(this.xml).children("dragdrop").first().attr("dropenabled")&&this.convertToDropArea(this.xml),"true"==$(this.xml).children("dragdrop").first().attr("dragoverenabled")))this.announceDragOver=
!0,this.setupDragOver(this.xml);this.loadChildrenFromXML(a,this.slide,this.layer,function(a){a.canSimplify=!1});this.canSimplify=!1};ItemGroup.prototype.createBaseRef=StageItem.prototype.createRef;ItemGroup.prototype.createRef=function(){return this.ref||!this.createBaseRef()?!1:!0};ItemGroup.prototype.renderForeground=function(){};ItemGroup.prototype.isPointActive=function(a,b,c,d){var e=!1,f;for(f in this.children){var g=this.children[f];if(g!=c&&(!d||!d(g)))e=e||g.isPointActive(a,b,c,d)}return e};var ShuffleGroup=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.active=!0};ShuffleGroup.prototype=new ItemGroup;ShuffleGroup.prototype.innerType="ShuffleGroup";ShuffleGroup.prototype.objectType="Item";ShuffleGroup.ShuffleArray=function(a){for(var b,c,d=a.length;d;b=Math.floor(Math.random()*d),c=a[--d],a[d]=a[b],a[b]=c);return a};
ShuffleGroup.SortObjectArray=function(a,b){var c=[];$.each(a,function(a,e){for(var f=0;f<c.length;f++)if(e[b]<c[f][b]){c.splice(f,0,e);return}c.push(e)});return c};ShuffleGroup.prototype.loadBaseFromXML=ItemGroup.prototype.loadFromXML;ShuffleGroup.prototype.loadFromXML=function(a){var b=this;b.xml=a;this.loadBaseFromXML(a);this.shuffleAttr=$(a).attr("shuffle");this.canSimplify=!1;$.each(this.children,function(a,d){d.shuffleGroup=b;b.depth=Math.max(b.depth,d.depth)});this.originalZ=this.depth};
ShuffleGroup.prototype.createBaseRef=StageItem.prototype.createRef;ShuffleGroup.prototype.createRef=function(){var a=this.createBaseRef();this.ref.addClass("unhideable");return a};ShuffleGroup.prototype.baseShow=ShuffleGroup.prototype.show;ShuffleGroup.prototype.show=function(a,b,c){this.baseShow(a,b,c);"false"!=this.shuffleAttr&&this.shuffle()};ShuffleGroup.prototype.hide=function(){};ShuffleGroup.prototype.quickHide=function(){};
ShuffleGroup.prototype.shuffle=function(){if(!("true"!=this.shuffleAttr||this.shuffled)){if(0<$(this.xml).find("droplist").length)this.shuffleDropLists();else{var a=[];$.each(this.children,function(b,c){c.shuffleX=c.x;c.shuffleY=c.y;a.push(c)});1<a.length&&this.ShuffleObjects(a)}this.shuffled=!0}};ShuffleGroup.prototype.shuffleDropLists=function(){var a=this;$.each(this.children,function(b,c){"droplist"==c.innerType&&(a.shuffleSelect(c.select.get(0)),c.update())})};
ShuffleGroup.prototype.shuffleSelect=function(a){for(var b=a.options,c=[],d=b.length-1;0<=d;d--)c.push(b[d]),$(b[d]).remove();for(;c.length;)d=c.splice(this.getRandomIndex(c),1)[0],b.add(d);a.selectedIndex=0};
ShuffleGroup.prototype.shuffleRows=function(){if(!this.shuffled){this.shuffled=!0;var a={},b=[],c=[];$.each(this.children,function(d,f){a[f.x]&&(a={},b.push(c),c=[]);c.push(f);a[f.x]=f});b.push(c);for(var d=0;10>d;d++)this.swapRow(this.getRandomMember(b),this.getRandomMember(b));$.each(this.children,function(a,b){b.shuffled=!0;b.shuffleX=b.x-b.xoffset;b.shuffleY=b.y-b.yoffset})}};ShuffleGroup.prototype.getRandomIndex=function(a){return parseInt(Math.random()*a.length)};
ShuffleGroup.prototype.getRandomMember=function(a){var b=this.getRandomIndex(a);return a[b]};ShuffleGroup.prototype.swapRow=function(a,b){var c=this;a!=b&&$.each(a,function(a,e){c.swapItem(e,b[a])})};
ShuffleGroup.prototype.swapItem=function(a,b,c){if(!(a==b||!a||!b)){var d=a.y,e=a.x;a.y=b.y;b.y=d;a.originalY=a.y;b.originalY=b.y;a.ref.css("top",a.y+"px");b.ref.css("top",b.y+"px");if(c)a.x=b.x,b.x=e,a.originalX=a.x,b.originalX=b.x,a.ref.css("left",a.x+"px"),b.ref.css("left",b.x+"px");a.updateMatrixComplete(!0);b.updateMatrixComplete(!0)}};
ShuffleGroup.prototype.ShuffleObjects=function(a){for(var b=[],c=null,d=null,c=void 0,e=0,d=0,f=[],e=0;e<a.length;e++)f.push(ppRect.FromWidthHeight(a[e].shuffleX,a[e].shuffleY,a[e].width,a[e].height));var g=ShuffleGroup.ShuffleArray(a);if(this.CheckDisplayDown(a,b)){a=ShuffleGroup.SortObjectArray(a,"y");for(e=0;e<a.length;e++)if(a[e].shufflelock){c=g[e];for(d=0;d<g.length&&!(g[d]==a[e]);d++);g[e]=g[d];g[d]=c}g[0].shuffleX="right"==b[1].HAlign?a[0].shuffleX+a[0].width-g[0].width:a[0].shuffleX;g[0].shuffleY=
a[0].shuffleY;for(e=1;e<g.length;e++)switch(c=g[e],d=g[e-1],c.shuffleY=d.shuffleY+d.height+b[e].yoffset,b[e].HAlign){case "left":c.shuffleX=d.shuffleX;break;case "right":c.shuffleX=d.shuffleX+d.width-c.width;break;case "xoffset":c.shuffleX=d.shuffleX+b[e].xoffset;break;case "woffset":c.shuffleX=d.shuffleX+d.width+b[e].xoffset}}else if(this.CheckDisplayAcross(a,b)){a=ShuffleGroup.SortObjectArray(a,"x");for(e=0;e<a.length;e++)if(a[e].shufflelock){c=g[e];for(d=0;d<g.length&&!(g[d]==a[e]);d++);g[e]=g[d];
g[d]=c}g[0].shuffleX=a[0].shuffleX;g[0].shuffleY=a[0].shuffleY;for(e=1;e<g.length;e++)switch(c=g[e],d=g[e-1],c.shuffleX=d.shuffleX+d.width+b[e].xoffset,b[e].VAlign){case "top":c.shuffleY=d.shuffleY;break;case "bottom":c.shuffleY=d.shuffleY+d.height-c.height;break;case "yoffset":c.shuffleY=d.shuffleY+b[e].yoffset;break;case "xoffset":c.shuffleY=d.shuffleY+d.height+b[e].yoffset}}else{for(e=0;e<a.length;e++)if(a[e].shufflelock){c=g[e];for(d=0;d<g.length&&!(g[d]==a[e]);d++);g[e]=g[d];g[d]=c}for(e=0;e<
g.length;e++)g[e].shuffleX=f[e].left,g[e].shuffleY=f[e].top}for(e=0;e<a.length;e++)b=a[e],b.shuffled=!0,b.x=b.shuffleX,b.y=b.shuffleY,b.ref&&b.applySize(b.ref),b.updateMatrixComplete(!0)};ShuffleGroup.prototype.CompareYPos=function(a,b){return a.shuffleY>b.shuffleY?1:a.shuffleY<b.shuffleY?-1:0};
ShuffleGroup.prototype.CheckDisplayDown=function(a,b){var c=!0,a=ShuffleGroup.SortObjectArray(a,"y");b[0]={};for(var d=1;d<a.length;d++)if(a[d].shuffleY<a[d-1].shuffleY+0.75*a[d-1].height){c=!1;break}else b[d]={},b[d].yoffset=a[d].shuffleY-(a[d-1].shuffleY+a[d-1].height),a[d-1].shuffleX==a[d].shuffleX?b[d].HAlign="left":a[d-1].shuffleX+a[d-1].width==a[d].shuffleX+a[d].width?b[d].HAlign="right":a[d-1].shuffleX+a[d-1].width>a[d].shuffleX?(b[d].HAlign="xoffset",b[d].xoffset=a[d].shuffleX-a[d-1].shuffleX):
(b[d].HAlign="woffset",b[d].xoffset=a[d].shuffleX-(a[d-1].shuffleX+a[d-1].width));return c};
ShuffleGroup.prototype.CheckDisplayAcross=function(a,b){var c=!0,a=ShuffleGroup.SortObjectArray(a,"x");b[0]={};for(var d=1;d<a.length;d++)if(a[d].shuffleX<a[d-1].shuffleX+a[d-1].width){c=!1;break}else b[d]={},b[d].xoffset=a[d].shuffleX-(a[d-1].shuffleX+a[d-1].width),a[d-1].shuffleY==a[d].shuffleY?b[d].VAlign="top":a[d-1].shuffleY+a[d-1].height==a[d].shuffleY+a[d].height?b[d].VAlign="bottom":a[d-1].shuffleY+a[d-1].height>a[d].shuffleY?(b[d].VAlign="yoffset",b[d].yoffset=a[d].shuffleY-a[d-1].shuffleY):
(b[d].VAlign="xoffset",b[d].yoffset=a[d].shuffleY-(a[d-1].shuffleY+a[d-1].height));return c};var ScrollArea=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.active=!0};ScrollArea.prototype=new ItemGroup;ScrollArea.prototype.innerType="ScrollArea";ScrollArea.prototype.objectType="Item";ScrollArea.prototype.loadBaseFromXML=ItemGroup.prototype.loadFromXML;
ScrollArea.prototype.loadFromXML=function(a){var b=this;b.xml=a;this.loadBaseFromXML(a);$(b.xml).children("background").each(function(a,d){b.background=new Background(b.ref);b.background.loadFromXML(d)});this.canSimplify=!1;$.each(this.children,function(a,d){d.scrollArea=b})};ScrollArea.prototype.baseShow=ScrollArea.prototype.show;ScrollArea.prototype.show=function(a,b,c){this.baseShow(a,b,c)};
ScrollArea.prototype.createRef=function(){if(!this.parent.ref)return this.parent.createRef(),!1;this.container=this.parent.ref;if(this.ref)return this.render(null,!1,null,"StageItem createRef"),!1;var a=this;this.ref=$('<div class="item scrollarea"></div>');this.ref.addClass(this.type);this.ref.addClass(this.innerType.toLowerCase());this.ref.addClass("item_"+this.id);this.ref.attr("id","item_"+this.id);player.showItemInfo&&this.ref.append($('<div class="itemid">'+this.id+"</div>"));this.applySize(this.ref);
this.container.append(this.ref);a.background&&a.background.apply(a.ref);var b=0;$.each(this.children,function(a,d){d.createRef&&d.createRef();b=Math.max(b,d.y+d.yoffset+d.height);"ShuffleGroup"==d.innerType&&$.each(d.children,function(a,c){b=Math.max(b,c.y+c.yoffset+c.height)})});b<=this.height&&this.ref.removeClass("scrollarea");a.setVisible(!1);this.ref.bind("scroll",function(){var b=a.ref.get(0);if(b.scrollHeight<=b.scrollTop+a.height)a.hasScrolledToEnd=!0;b=a.ref.get(0);b.style.cssText+=";-webkit-transform:rotateZ(0deg)";
player.uselessOffsetHeight=b.offsetHeight;b.style.cssText+=";-webkit-transform:none";a.updateMatrixComplete(!0)});-1<navigator.userAgent.indexOf("AppleWebKit")&&-1<navigator.userAgent.indexOf("Macintosh")&&a.ref.css("border","solid 1px transparent");return!0};ScrollArea.prototype.isPointVisible=function(a,b){var c=this.matrix.unTransformPoint(a,b),d=this.ref.get(0).scrollTop;return c.y>=d&&c.y<=d+this.height};
ScrollArea.prototype.getScrollPosition=function(){return this.ref?this.ref.get(0).scrollTop:0};ScrollArea.prototype.Viewed=function(){return!this.ref?"false":this.ref.get(0).scrollHeight<=this.height||this.hasScrolledToEnd?"true":"false"};ScrollArea.prototype.hasScrollBars=function(){return this.ref.get(0).offsetHeight<this.ref.get(0).scrollHeight};ScrollArea.prototype.isPointActiveBase=ItemGroup.prototype.isPointActive;
ScrollArea.prototype.isPointActive=function(a,b,c,d){return this.testOver(a,b)&&this.isPointActiveBase(a,b,c,d)};var StateGroup=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.active=!0};StateGroup.prototype=new ItemGroup;StateGroup.prototype.innerType="StateGroup";
StateGroup.prototype.loadFromXML=function(a){var b=this;this.id=$(a).attr("id");this.xml=a;this.loadElementInfoFromXML(a);this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);if(0<$(this.xml).children("dragdrop").length&&("true"==$(b.xml).children("dragdrop").first().attr("dragenabled")&&b.convertToDragItem(b.xml),"true"==$(b.xml).children("dragdrop").first().attr("dropenabled")&&b.convertToDropArea(b.xml),"true"==$(b.xml).children("dragdrop").first().attr("dragoverenabled")))this.announceDragOver=
!0,b.setupDragOver(b.xml);this.loadChildrenFromXML(a,b.slide,b.layer,function(a){a.canSimplify=!1;a.group=b});this.canSimplify=!1;for(var c in this.children)if(this.children[c].hasDragPath){this.containsDragPath=!0;break}this.actionstates={};this.actionstateindices={};$(a).children("actionstates").children().each(function(a,c){var f=$(c).attr("name"),g=$(c).children("actions").children();b.actionstates[f]=g;b.actionstateindices[f]=a})};StateGroup.prototype.render=VectorShape.prototype.render;
StateGroup.prototype.renderOnUpdate=VectorShape.prototype.renderOnUpdate;StateGroup.prototype.setVisible=VectorShape.prototype.setVisible;StateGroup.prototype.executeStateActions=function(a){var b=this;(a=b.actionstates[a])&&$.each(a,function(a,d){b.runAction(d)})};var ExpandingLabel=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.expandedHeight=0;this.constructElement();this.events=[];this.active=!0;this.showContent=this.showTitle=!1;this.VAR_EXPANDED="_expanded";this.GROW_TITLE_TIME=250;this.GROW_CONTENT_TIME=500;this.ARROW_HEIGHT=18;this.FILL_BORDER="border";this.FILL_BG="bg";this.borderwidth=1;this.arrowxpos=this.arrowypos=0;this.m_strAlign="top";this.m_nContentHeight=0;this.m_nRadius=8;this.m_nTitleHeight=
80;this.m_nContentYOffset=36;this.m_bHideTitleOnComplete=this.m_bShowContentOnComplete=this.m_bAnimatingContentOut=this.m_bAnimatingContentIn=this.m_bAnimatingTitleOut=this.m_bAnimatingTitleIn=this.m_bContentShowing=this.m_bTitleShowing=!1;this.m_nGrowStartTime=0;this.m_nTextHeight=30;this.m_nMarginRight=this.m_nMarginLeft=5;this.m_nMarginRightTitle=20;this.m_nMarginText=this.m_nMarginBottom=this.m_nMarginTop=5;this.m_nHotspotHeight=0;this.m_bShowCloseButton=!1};ExpandingLabel.prototype=new StageItem;
ExpandingLabel.prototype.innerType="ExpandingLabel";ExpandingLabel.prototype.objectType="Item";ExpandingLabel.prototype.extractNextSpecialBool=function(a){this.showContent=a};ExpandingLabel.prototype.getExtraResumeVars=function(){this.variableResumes.VAR_EXPANDED=!0;this.variableDefaults.VAR_EXPANDED=!1;this.variableTypes.VAR_EXPANDED="bool";return{VAR_EXPANDED:this.showContent}};ExpandingLabel.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;
ExpandingLabel.prototype.loadFromXML=function(a,b,c){var d=this,e=$(a).children("objects");e.remove();this.loadBaseFromXML(a,b,c);this.expandedHeight=this.height;$(a).append(e);this.id=$(a).attr("id");this.xml=a;this.borderwidth=parseInt($(a).attr("borderwidth"));this.contentheight=parseInt($(a).attr("contentheight"));this.arrowxpos=parseInt($(a).attr("arrowxpos"));this.arrowypos=parseInt($(a).attr("arrowypos"));this.showclosebutton="true"==$(a).attr("showclosebutton");this.hasContent=0<$(a).children("objects").length;
if(0>this.arrowypos){this.m_strAlign="top";if(0>this.arrowxpos)this.arrowxpos=0;if(this.arrowxpos>this.width)this.arrowxpos=this.width;this.arrowypos=this.ARROW_HEIGHT}else if(this.arrowypos>this.expandedHeight){this.m_strAlign="bottom";if(0>this.arrowxpos)this.arrowxpos=0;if(this.arrowxpos>this.width)this.arrowxpos=this.width;this.arrowypos=this.expandedHeight+this.ARROW_HEIGHT}else if(this.arrowxpos>this.width)this.m_strAlign="left",this.arrowxpos=this.width+this.ARROW_HEIGHT;else if(0>this.arrowxpos)this.m_strAlign=
"right",this.arrowxpos=this.ARROW_HEIGHT;this.hasContent=!1;this.loadChildrenFromXML(a,d.slide,d.layer,function(a){a.canSimplify=!1;d.hasContent=!0});this.canSimplify=!1};ExpandingLabel.prototype.createBaseRef=StageItem.prototype.createRef;ExpandingLabel.prototype.destroyBaseRef=StageItem.prototype.destroyRef;ExpandingLabel.prototype.renderForeground=VectorShape.prototype.renderForeground;ExpandingLabel.prototype.renderVector=VectorShape.prototype.render;ExpandingLabel.prototype.renderOnUpdate=VectorShape.prototype.renderOnUpdate;
ExpandingLabel.prototype.setVisible=VectorShape.prototype.setVisible;
ExpandingLabel.prototype.createRef=function(){if(this.ref)return!1;var a=this;if(!this.createBaseRef())return!1;this.ref.addClass("expandinglabel interactive");this.ref.children().addClass("expandinglabelcontent");this.expandingLabelContent=this.ref.children();this.canvasWidth=a.width+2*a.borderwidth+a.ARROW_HEIGHT;this.canvasHeight=this.expandedHeight+2*a.borderwidth+a.ARROW_HEIGHT;var b=$('<canvas class="content" width="'+this.canvasWidth+'" height="'+this.canvasHeight+'"></canvas>');b.css("position",
"absolute");this.ref.append(b);this.backgroundCanvas=b.get(0);b=$('<canvas class="content expandinglabeltitlecanvas" width="'+this.canvasWidth+'" height="'+this.canvasHeight+'"></canvas>');b.css("position","absolute");this.ref.append(b);this.jcanvas=b;this.canvas=b.get(0);this.contentRef=$('<div class="item unhideable expandinglabeltitle"></div>');this.contentRef.css("width","100%");this.ref.prepend(this.contentRef);this.ref.css("width",a.width);this.ref.css("height",this.expandedHeight);this.setVisible(!1);
this.hide();setTimeout(function(){var b=a.id.replace("_expandinglabel","");if(b!=a.id)a.button=a.parent.children[b],a.button&&a.button.ref&&a.button.ref.addClass("interactive")},0);return!0};
ExpandingLabel.prototype.show=function(a,b,c){this.createRef(this.parent.ref);if(this.visible){var d=this;if(b){if(!c||0==b.duration)this.setVisible(!0),this.variables.Expanded="true",d.ref.show(),d.handleEvent("ontransitionin",null,null,!1,!0),b.setTarget(this),b.apply(function(){d.handleEvent("ontransitionincomplete",null,null,!1,!0)},null,null,null,a)}else this.setVisible(!0),this.variables.Expanded="true",d.ref.show(),d.handleEvent("ontransitionin",null,null,!1,!0),d.handleEvent("ontransitionincomplete",
null,null,!1,!0)}};ExpandingLabel.prototype.hide=function(a,b){this.setVisible(!1);this.variables.Expanded="false";var c=this;c.handleEvent("ontransitionout",null,null,!1,!0);b?(b.setTarget(this),b.apply(function(){c.ref&&c.ref.hide();c.handleEvent("ontransitionoutcomplete",null,null,!1,!0)},null,null,null,a)):(this.ref&&this.ref.hide(),c.handleEvent("ontransitionoutcomplete",null,null,!1,!0))};
ExpandingLabel.prototype.render=function(a,b){if(this.ref&&this.visible){this.renderVector(a,b);var c=this.width,d=this.showContent||!this.hasContent?this.expandedHeight:this.m_nTextHeight+this.m_nMarginTop+this.m_nMarginBottom,e=this.reposition(),f=this.backgroundCanvas.getContext("2d");f.lineWidth=this.borderwidth;this.colors[this.FILL_BORDER]?this.colors[this.FILL_BORDER].applyCanvas(f,this,!1,!0):f.strokeStyle="#EEECE1";this.colors[this.FILL_BG]?this.colors[this.FILL_BG].applyCanvas(f,this,!0,
!1):f.fillStyle="#FAFAFA";f.clearRect(0,0,this.canvasWidth,this.canvasHeight);f.save();f.translate(f.lineWidth/2,f.lineWidth/2);f.beginPath();$(this.canvas).css("margin","6px 8px 0px "+(f.lineWidth+5)+"px");switch(this.m_strAlign){case "top":f.translate(0,this.ARROW_HEIGHT);$(this.backgroundCanvas).css("margin-top",-this.ARROW_HEIGHT+"px");this.DrawBottomCaption(f,0,-this.ARROW_HEIGHT,c,d,this.m_nRadius,this.arrowxpos,this.ARROW_HEIGHT);break;case "bottom":this.DrawTopCaption(f,0,0,c,d,this.m_nRadius,
this.arrowxpos,this.ARROW_HEIGHT);break;case "left":this.DrawLeftCaption(f,0,0,c,d,this.m_nRadius,e,this.ARROW_HEIGHT);break;case "right":f.translate(this.ARROW_HEIGHT,0),$(this.backgroundCanvas).css("margin-left",-this.ARROW_HEIGHT+"px"),this.DrawRightCaption(f,-this.ARROW_HEIGHT,0,c,d,this.m_nRadius,e,this.ARROW_HEIGHT)}f.fill();f.stroke();f.restore();this.renderForeground()}};
ExpandingLabel.prototype.reposition=function(){var a=this.showContent||!this.hasContent?this.expandedHeight:this.m_nTextHeight+this.m_nMarginTop+this.m_nMarginBottom,b=this.arrowypos;this.showContent?(this.ref.css("top",this.y),this.expandingLabelContent.show()):("right"==this.m_strAlign||"left"==this.m_strAlign?(b=this.arrowypos/this.expandedHeight*a,this.ref.css("top",this.y+this.arrowypos-b)):"bottom"==this.m_strAlign&&this.ref.css("top",this.y+this.expandedHeight-a),this.expandingLabelContent.hide());
return b};ExpandingLabel.prototype.applySize=function(a){Element.prototype.applySize.call(this,a);this.ref&&this.expandingLabelContent&&this.reposition()};ExpandingLabel.prototype.hideOthers=function(){var a=this;a.slide.expandingLabels.forEach(function(b){b!=a&&b.hide()})};
ExpandingLabel.prototype.togglecontent=function(){this.showContent=!this.showContent;this.variables.Expanded=this.showContent.toString();this.showContent?($(".above").removeClass("above"),$(".showing").removeClass("showing"),this.hideOthers(),this.render(null,!0,this.width,this.expandedHeight),this.setVisible(!0),this.show(),this.ref.addClass("above showing"),this.button&&this.button.ref&&this.button.ref.addClass("above showing"),this.handleEvent("onobjectevent","contentin",null,!1,!1,!0),this.handleEvent("onobjectevent",
"contentincomplete",null,!1,!1,!0)):(this.hide(),$(".above").removeClass("above"),this.handleEvent("onobjectevent","contentout",null,!1,!1,!0),this.handleEvent("onobjectevent","contentoutcomplete",null,!1,!1,!0))};
ExpandingLabel.prototype.showcomplete=function(){this.showContent=!0;this.variables.Expanded=this.showContent.toString();$(".above").removeClass("above");$(".showing").removeClass("showing");this.hideOthers();this.render(null,!0,this.width,this.expandedHeight);this.setVisible(!0);this.show();this.ref.addClass("above showing");this.button&&this.button.ref&&this.button.ref.addClass("above showing");this.handleEvent("onobjectevent","contentin");this.handleEvent("onobjectevent","contentincomplete",null,
!1,!1,!0)};ExpandingLabel.prototype.hidecomplete=function(){this.variables.Expanded="false";this.hide();$(".above").removeClass("above");this.showTitle=this.showContent=!1;this.handleEvent("onobjectevent","contentout",null,!1,!1,!0);this.handleEvent("onobjectevent","contentoutcomplete",null,!1,!1,!0)};
ExpandingLabel.prototype.showtitle=function(){if(!this.showContent){var a=this.m_nTextHeight+this.m_nMarginTop+this.m_nMarginBottom,b=this.expandedHeight-a;this.setVisible(!0);this.showTitle=!0;this.showContent=!1;this.variables.Expanded="false";this.show();$(".above").removeClass("above");this.ref.addClass("above");this.button&&this.button.ref&&this.button.ref.addClass("above");this.render(null,!0,this.width,a,0,b)}};
ExpandingLabel.prototype.hidetitle=function(){if(!this.showContent)this.setVisible(!1),this.showContent=this.showTitle=!1,this.variables.Expanded="false",this.hide(),$(".above").removeClass("above")};
ExpandingLabel.prototype.DrawTopCaption=function(a,b,c,d,e,f,g,h){0>f&&(f=0);var j=g<=f+h/2,l=g>=d-(f+h/2),m=g-h/2,k=d-(g+h/2),n=0;j&&(m=g,k=d-(g+h));l&&(m=g-h,k=d-g);0>m&&(m=0);0>k&&(k=0);m>d&&(m=d);k>d&&(k=d);var g=h/2,p=0,p=f;m+h>d&&(n=h,h=n-(m+n-d)/2,m-=(m+n-d)/2);k+h>d&&(n=h,h=n-(k+n-d)/2,k-=(k+n-d)/2);n=d-k;k<f&&(n=d-f);a.moveTo(b+n,c);a.lineTo(b+d-p,c);a.arcTo(b+d,c,b+d,c+p,p);p=f;k<f&&(p=k);a.lineTo(b+d,c+e-p);a.arcTo(b+d,c+e,b+d-p,c+e,p);p=f;a.lineTo(b+d-k,c+e);m<f&&(p=m);j?a.lineTo(b+m,
c+e+h):l?a.lineTo(b+d-k,c+e+h):a.lineTo(b+m+g,c+e+h);a.lineTo(b+m,c+e);a.lineTo(b+p,c+e);a.arcTo(b,c+e,b,c+e-p,p);p=f;a.lineTo(b,c+p);a.arcTo(b,c,b+p,c,p);a.lineTo(b+n,c)};
ExpandingLabel.prototype.DrawBottomCaption=function(a,b,c,d,e,f,g,h){0>f&&(f=0);var j=g<=f+h/2,l=g>=d-(f+h/2),m=g-h/2,k=d-(g+h/2),n=0;j&&(m=g,k=d-(g+h));l&&(m=g-h,k=d-g);0>m&&(m=0);0>k&&(k=0);m>d&&(m=d);k>d&&(k=d);var g=h/2,p=0,p=f;k<f&&(p=k);m+h>d&&(n=h,c+=(m+n-d)/2,h=n-(m+n-d)/2,m-=(m+n-d)/2);k+h>d&&(n=h,c+=(k+n-d)/2,h=n-(k+n-d)/2,k-=(k+n-d)/2);n=d-k;a.moveTo(b+n,c+h);a.lineTo(b+d-p,c+h);a.arcTo(b+d,c+h,b+d,c+h+p,p);p=f;a.lineTo(b+d,c+e+h-p);a.arcTo(b+d,c+h+e,b+d-p,c+e+h,p);p=f;a.lineTo(b+p,c+h+
e);a.arcTo(b,c+e+h,b,c+e+h-p,p);p=f;m<f&&(p=m);a.lineTo(b,c+h+p);a.arcTo(b,c+h,b+p,c+h,p);a.lineTo(b+m,c+h);j?a.lineTo(b+m,c):l?a.lineTo(b+d-k,c):a.lineTo(b+m+g,c);a.lineTo(b+n,c+h)};
ExpandingLabel.prototype.DrawLeftCaption=function(a,b,c,d,e,f,g,h){0>f&&(f=0);var j=g<=h/2,l=g>=e-h/2,m=g-h/2,k=e-(g+h/2),n=0;j&&(m=g,k=e-(g+h));l&&(m=g-h,k=e-g);0>m&&(m=0);0>k&&(k=0);m>e&&(m=e);k>e&&(k=e);n=f;g=d/2;a.moveTo(b+g,c);n=f;m<f&&(n=m);a.lineTo(b+d-n,c);a.arcTo(b+d,c,b+d,c+n,n);k+h>e&&(n=h,h=n-(k+n-e)/2,k-=(k+n-e)/2);if(m+h>e)var p=m,n=h,m=p-(p+n-e)/2,h=n-(p+n-e)/2;a.lineTo(b+d,c+m);j?a.lineTo(b+d+h,c+m):l?a.lineTo(b+d+h,c+e-k):a.lineTo(b+d+h,c+m+h/2);a.lineTo(b+d,c+m+h);n=f;k<f&&(n=k);
a.lineTo(b+d,c+e-n);a.arcTo(b+d,c+e,b+d-n,c+e,n);n=f;a.lineTo(b+n,c+e);a.arcTo(b,c+e,b,c+e-n,n);n=f;a.lineTo(b,c+n);a.arcTo(b,c,b+n,c,n);a.lineTo(b+g,c)};
ExpandingLabel.prototype.DrawRightCaption=function(a,b,c,d,e,f,g,h){0>f&&(f=0);var j=g<=h/2,l=g>=e-h/2,m=g-h/2,k=e-(g+h/2),n=0;j&&(m=g,k=e-(g+h));l&&(m=g-h,k=e-g);0>m&&(m=0);0>k&&(k=0);m>e&&(m=e);k>e&&(k=e);n=f;g=d/2;a.moveTo(b+h+g,c);a.lineTo(b+h+d-n,c);a.arcTo(b+h+d,c,b+h+d,c+n,n);a.lineTo(b+h+d,c+e-n);a.arcTo(b+h+d,c+e,b+h+d-n,c+e,n);n=f;k<f&&(n=k);a.lineTo(b+h+n,c+e);a.arcTo(b+h,c+e,b+h,c+e-n,n);k+h>e&&(n=h,b+=(k+n-e)/2,h=n-(k+n-e)/2,k-=(k+n-e)/2);m+h>e&&(d=m,n=h,b+=(d+n-e)/2,m=d-(d+n-e)/2,h=
n-(d+n-e)/2);a.lineTo(b+h,c+e-k);j?a.lineTo(b,c+m):l?a.lineTo(b,c+e-k):a.lineTo(b,c+m+h/2);a.lineTo(b+h,c+m);n=f;m<f&&(n=m);a.lineTo(b+h,c+n);a.arcTo(b+h,c,b+h+n,c,n);a.lineTo(b+h+g,c)};var SequenceCtrl=function(a,b,c){this.resumeItemOrder=[];this.container=a||$(document.body);this.ref=null;this.constructElement();this.slide=b;this.layer=c;this.constructElement();this.events=[];this.active=!0;this.currentIndex=0;this.content={};this.colors={};this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.deferredResourceIndex=0;this.padY=20;this.padX=25;this.originalIndex=this.dropIndex=-1;this.indexedChildren=[]};
SequenceCtrl.prototype=new StageItem;SequenceCtrl.prototype.objectType="Item";SequenceCtrl.prototype.innerType="SequenceCtrl";SequenceCtrl.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;SequenceCtrl.prototype.shuffleRows=ShuffleGroup.prototype.shuffleRows;SequenceCtrl.prototype.shuffleElements=ShuffleGroup.prototype.shuffleElements;SequenceCtrl.prototype.getRandomMember=ShuffleGroup.prototype.getRandomMember;SequenceCtrl.prototype.getRandomIndex=ShuffleGroup.prototype.getRandomIndex;
SequenceCtrl.prototype.swapRow=ShuffleGroup.prototype.swapRow;SequenceCtrl.prototype.swapItem=ShuffleGroup.prototype.swapItem;SequenceCtrl.prototype.extractNextSpecialVar=function(a){a=bwChunk.CreateChunk(a);for(a=new bwChunk(a);!a.EOF();)this.resumeItemOrder.push(a.NextUBase10(1))};
SequenceCtrl.prototype.restoreFromResumeData=function(a){StageItem.prototype.restoreFromResumeData.call(this,a);for(var a=10,b=0,c=0;c<this.resumeItemOrder.length;c++){var d=this.indexedChildren[this.resumeItemOrder[c]];d.y=a;this.variables["_pos"+b]=d.itemdata;a+=d.height+this.padY;b++}this.resumeItemOrder=[];this.shuffled=!0};
SequenceCtrl.prototype.getExtraResumeVars=function(){this.variableResumes.VAR_ITEM_ORDER=!0;this.variableDefaults.VAR_ITEM_ORDER="";this.variableTypes.VAR_ITEM_ORDER="string";var a="";if(this.ref){var b=this.getOrderedItemList();$.each(b,function(b,d){a+=bwChunk.UBase10toN(d.sequenceIndex)})}return{VAR_ITEM_ORDER:a}};
SequenceCtrl.prototype.loadFromXML=function(a,b,c){var d=this;this.loadBaseFromXML(a,b,c);this.loadSizeFromXML(a);this.loadAnimationsFromXML(a);this.canSimplify=!1;var e=10;$(a).children("data").children("itemlist").children().each(function(a,c){var h=new SequenceItem(d.ref,b);h.offsetY=e;h.offsetX=d.padX;h.sequenceIndex=a;h.loadFromXML(c,b);h.width=d.width-d.padX;h.parent=d;h.offsetParent=d;d.children[h.id]=h;d.indexedChildren[a]=h;e+=h.height+d.padY;d.indicatorWidth=h.width;d.indicatorOffsetX=h.x})};
SequenceCtrl.prototype.createBaseRef=StageItem.prototype.createRef;
SequenceCtrl.prototype.createRef=function(){var a=this;if(this.ref)return!1;this.container=this.parent.ref;this.ref=$('<div class="item sequencectrl interactive"></div>');this.container.append(this.ref);this.applySize(this.ref);this.indicator=$('<div class="sequenceindicator"></div>');this.indicator.css("width",this.width);this.container.append(this.indicator);this.contentRef=this.ref;this.indicator.css("left",this.x+this.indicatorOffsetX);this.indicator.css("width",this.indicatorWidth);var b=0;$.each(a.children,
function(c,d){d.createRef();a.appendLineNumber(b++,d)});this.shuffleRows();this.ref.bind("scroll",function(){var b=a.ref.get(0);if(b.scrollHeight<=b.scrollTop+a.height)a.hasScrolledToEnd=!0;b=a.ref.get(0);b.style.cssText+=";-webkit-transform:rotateZ(0deg)";player.uselessOffsetHeight=b.offsetHeight;b.style.cssText+=";-webkit-transform:none";a.updateMatrixComplete(!0)});this.slide.ref.bind("scroll",function(){this.scrollLeft=this.scrollTop=0});this.updateScore();return!0};
SequenceCtrl.prototype.appendLineNumber=function(a,b){var c=b.offsetY,d=$('<div class="sequencelinenumber"></div>');d.text(a+1+".");d.css("top",-1E3);$(document.body).append(d);var e=d.height();0<e&&e<b.height&&(c+=(b.height-e)/2);d.css("top",c);this.variables.ReviewMode&&d.addClass("correct");this.ref.append(d)};
SequenceCtrl.prototype.getOrderedItemList=function(){var a=[];$.each(this.children,function(b,c){for(var d=!1,e=0;e<a.length;e++)if(!d&&c.y<a[e].y){a.splice(e,0,c);d=!0;break}d||a.push(c)});return a};SequenceCtrl.prototype.updateScore=function(){var a=this,b=a.getOrderedItemList();$.each(b,function(b,d){a.variables["_pos"+b]=d.itemdata;d.currentIndex=b})};
SequenceCtrl.prototype.set_review=function(){var a=this.ref.children(".sequencelinenumber"),b=this.getOrderedItemList();$.each(b,function(b,d){var e=$(a[b]);e.text(d.sequenceIndex+1+".");d.sequenceIndex==b?e.addClass("correct"):e.addClass("incorrect")})};SequenceCtrl.prototype.showBase=StageItem.prototype.show;SequenceCtrl.prototype.show=function(a,b,c,d){this.parent.ref&&(this.render(),this.showBase(a,b,c,d),d||$.each(this.children,function(d,f){f.show&&(f.ref.show(),f.render(),f.show(a,b,c))}))};
SequenceCtrl.prototype.Viewed=function(){return!this.ref?"false":this.ref.get(0).scrollHeight<=this.height||this.hasScrolledToEnd?"true":"false"};var SequenceItem=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="item";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.offsetY=this.offsetX=this.deferredResourceIndex=0;this.canvas=null;this.m_nYOffset=this.m_nXOffset=0;this.m_nHeight=this.m_nWidth=1E3};SequenceItem.prototype=new StageItem;
SequenceItem.prototype.objectType="Item";SequenceItem.prototype.innerType="SequenceItem";SequenceItem.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;
SequenceItem.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.id=$(a).attr("itemdata").split("_")[1];this.itemdata=$(a).attr("itemdata");this.width=parseInt($(a).children("textdata").first().attr("width"));this.height=parseInt($(a).children("textdata").first().attr("height"));this.x=this.offsetX;this.y=this.offsetY;this.originalWidth=this.width;this.originalHeight=this.height;this.canSimplify=!1;b=new Background(this.ref);b.rotation="90";b.fillType="linear";b.stops.push(b.parseStop('<color rgb="0xBBF8FB" alpha="100" stop="0" />'));
b.stops.push(b.parseStop('<color rgb="0xA5E8EB" alpha="100" stop="100" />'));this.colors.hover=b;b=$(a).children("textdata");a=$(a).children("textdata").children("vectortext");c=a.children("pr");if(1==c.length){this.textSprite={canvas:null,m_nXOffset:0,m_nYOffset:0,width:1E3,height:1E3,charIndex:0,maxCharIndex:0,vectorHot:!1,isShapeMask:!1};if(null!=$(a).attr("top"))this.textSprite.x=$(b).attr("xpos"),this.textSprite.y=$(b).attr("ypos"),this.textSprite.width=$(b).attr("width"),this.textSprite.height=
$(b).attr("height"),this.textSprite.rectShape=new ppRect(parseInt($(a).attr("left")),parseInt($(a).attr("top")),parseInt($(a).attr("right")),parseInt($(a).attr("bottom"))),this.textSprite.rectShape.right=Math.max(this.textSprite.rectShape.right,this.width),this.textSprite.rectShape.bottom=Math.max(this.textSprite.rectShape.bottom,this.height),this.textSprite.originalRectShape=this.rectShape;this.textSprite.path=PathLib.getPathFromXML(c)}};SequenceItem.prototype.createBaseRef=StageItem.prototype.createRef;
SequenceItem.prototype.createRef=function(){if(this.ref)return this.render(),!1;this.container=this.parent.ref;this.ref=$('<div class="item sequenceitem interactive"></div>');this.container.append(this.ref);this.ref.css("left",this.x+"px");this.ref.css("top",this.y+"px");this.ref.css("width",this.width+"px");this.ref.css("height",this.height+"px");this.contentRef=$('<div class="item unhideable"></div>');this.contentRef.css("margin","4px 20px");var a=$('<canvas class="content"></canvas>');a.css("position",
"relative");this.ref.append(a);this.canvas=a.get(0);$(this.ref).css("width",this.width);$(this.ref).css("height",this.height);$(this.canvas).attr("width",this.width);$(this.canvas).attr("height",this.height);if(this.textSprite)a=$("<canvas></canvas>"),a.css("position","absolute"),a.css("left",this.textSprite.x+"px"),a.css("top",this.textSprite.y+"px"),a.attr("width",this.width+"px"),a.attr("height",this.height+"px"),a.attr("id",this.id+"_text"),this.ref.append(a),this.textSprite.canvas=a.get(0),this.textRef=
a;this.textTemplate="<span>"+this.textlib.children("textdata").attr("lmstext")+"</span>";this.renderTextTemplate();this.convertToDragItem(this.xml);this.style="sequence";this.dragreturn=!0;this.initDrag();this.render=SequenceItem.prototype.renderOverride;this.updateDragPosition=SequenceItem.prototype.updateDragPositionOverride;this.findDropArea=SequenceItem.prototype.findDropAreaOverride;this.mouseupCallback=SequenceItem.prototype.Drop;this.show();return!0};
SequenceItem.prototype.updateDragPositionOverride=function(){if(!this.ghost)this.ghost=this.ref.clone(),this.ghost.css("opacity",0.7),this.parent.container.append(this.ghost),this.ghostCanvas=this.ghost.find("canvas").get(0);var a=this.parent.ref.get(0).scrollTop,b=this.x+this.dragX+this.parent.x,a=this.getScrolledY()+this.parent.y-a;this.ghost.show();this.ghost.css("left",b);this.ghost.css("top",a);this.render("",this.ghostCanvas);this.render("hover",this.canvas)};
SequenceItem.prototype.renderCallback=function(){};
SequenceItem.prototype.renderOverride=function(a,b){var b=b||this.canvas,c=b.getContext("2d"),d=parseInt(900*Math.random()+1100)%1E3;c.fillStyle="#"+d;c.fillStyle="#fff";c.lineWidth=1;c.strokeStyle="#C7C7C7";d=c.createLinearGradient(0,0,0,this.height);d.addColorStop(0,"#fcfcfc");d.addColorStop(1,"#eaeaea");c.fillStyle=d;this.colors[a]&&this.colors[a].applyCanvas(c,this,!0,!1);d=this.height/2;c.beginPath();c.moveTo(d+0.5,0.5);c.lineTo(this.width-d-0.5,0.5);c.arc(this.width-d-0.5,d,d,3*Math.PI/2,Math.PI/
2);c.lineTo(d+0.5,this.height-0.5);c.arc(d+0.5,d,d,Math.PI/2,3*Math.PI/2);c.fill();c.save();c.clip();c.strokeStyle="#fff";c.lineWidth=3.4;c.stroke();c.restore();if(this.colors[a])c.strokeStyle=this.colors[a].stops[0].color;c.stroke();if(this.textSprite)c=new ppTextLib(this.xml),ppArt.itemID=this.id,ppArt.item=this,ppArt.m_bMaskMode=!1,ppArt.DrawVector(this.textSprite,this.textSprite.path,c,player.fontlib,this.imagelib,null,null)};
SequenceItem.prototype.getScrolledY=function(){var a=this.downScrollTop||0;return this.y+this.dragY+this.parent.ref.get(0).scrollTop-a};
SequenceItem.prototype.findDropAreaOverride=function(){for(var a=this.parent.getOrderedItemList(),b=-1,c=this.getScrolledY(),d=this.parent.y,e=a.length-1;0<=e;e--){var f=a[e];c<f.y+f.height/2&&(b=e,d=this.parent.y+f.y-this.parent.padY/2);if(f==this)this.parent.originalIndex=e}-1==b&&(f=a[a.length-1],d=this.parent.y+f.y+f.height+this.parent.padY/2);d-=this.parent.ref.get(0).scrollTop;this.parent.indicator.show();this.parent.indicator.css("top",d);this.parent.dropIndex=b;player.lastSequenceDropIndex=
b};
SequenceItem.prototype.Drop=function(){if(-1==this.parent.originalIndex)this.parent.indicator.hide(),this.ghost&&this.ghost.hide();else{if(this.parent.dropIndex!=player.lastSequenceDropIndex)this.parent.dropIndex=player.lastSequenceDropIndex;this.parent.indicator.hide();this.ghost&&this.ghost.hide();var a=this.parent.getOrderedItemList();if(-1==this.parent.dropIndex)this.parent.dropIndex=a.length;if(this.parent.dropIndex!=this.parent.originalIndex)for(var b=this.parent.dropIndex>this.parent.originalIndex?1:
-1,c=this.parent.dropIndex>this.parent.originalIndex?0:-1,d=this.parent.originalIndex;d!=this.parent.dropIndex+c;d+=b)this.parent.swapItem(this,a[d]);this.variables._checked="true";this.parent.updateScore();this.parent.dropIndex=-1;this.parent.originalIndex=-1}this.render()};var HotspotMarker=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.xml="";this.angle=0;this.speed=0.05;this.isHotspotMarker=!0};HotspotMarker.prototype=new StageItem;HotspotMarker.prototype.objectType="Item";HotspotMarker.prototype.innerType="HotspotMarker";HotspotMarker.prototype.toBaseData=Element.prototype.toData;HotspotMarker.prototype.toData=function(a){a=this.toBaseData(a);if(this.x!=this.originalX)a.x=this.x;if(this.y!=this.originalY)a.y=this.y;return a};
HotspotMarker.prototype.updateBaseFromData=Element.prototype.updateFromData;HotspotMarker.prototype.updateFromData=function(a){this.updateBaseFromData(a);if(a.x)this.x=a.x;if(a.y)this.y=a.y};HotspotMarker.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;HotspotMarker.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.originalX=this.x;this.originalY=this.y;this.height=this.width=38;this.spinnerRadius=5;this.ring1Radius=7;this.ring2Radius=16};
HotspotMarker.prototype.createBaseRef=StageItem.prototype.createRef;
HotspotMarker.prototype.createRef=function(){if(this.ref)return this.render(),!1;var a=this;if(!this.createBaseRef())return!1;this.ref.addClass("hotspotmarker");this.ref.css("margin-left",-this.width/2);this.ref.css("margin-top",-this.height/2);var b=$("<canvas></canvas>");b.attr("width",this.width);b.attr("height",this.height);this.ref.append(b);this.jcanvas=b;this.canvas=b.get(0);var b=parseInt(this.parent.variables[this.id.replace("_marker","_xpos")]),c=parseInt(this.parent.variables[this.id.replace("_marker",
"_ypos")]);!isNaN(b)&&-1<b?(this.ref.css("left",b),this.ref.css("top",c),setTimeout(function(){a.ref&&a.ref.show()},100)):(this.ref.css("left",-100),this.ref.css("top",-100));if(!this.spinning)this.step(),this.spinning=!0;this.ref.show();return!0};
HotspotMarker.prototype.render=function(){function a(a){a=a%6/4;1<a&&(a=0);0.5<a&&(a=1-a);0>a&&(a=0);return a}if(this.ref){var b=this.canvas.getContext("2d"),c=this.width/2-2;b.clearRect(0,0,this.width,this.height);b.save();b.translate(c+2,c+2);b.rotate(this.angle);b.beginPath();b.arc(0,0,this.spinnerRadius,0,2*Math.PI);b.fillStyle="#000";b.fill();b.beginPath();b.moveTo(0,0);b.arc(0,0,this.spinnerRadius,0,Math.PI/2);b.lineTo(0,0);b.arc(0,0,this.spinnerRadius,Math.PI,3*Math.PI/2);b.fillStyle="#fff";
b.fill();var c=a(this.angle+0.5),d=a(this.angle);if(0<c)b.strokeStyle="rgba(0,255,255,0)",b.strokeStyle="rgba(100,255,255,"+c+")",b.lineWidth=4,b.beginPath(),b.arc(0,0,this.ring1Radius,0,2*Math.PI),b.stroke(),b.beginPath(),b.strokeStyle="rgba(100,255,255,"+d+")",b.arc(0,0,this.ring2Radius,0,2*Math.PI),b.stroke();b.restore()}};
HotspotMarker.prototype.step=function(){var a=this;if(this.ref){this.angle+=this.speed;this.render();var a=this,b=a.ref.get(0);a.ref.show();setTimeout(function(){a.ref&&a.ref.show()},100)}HotspotMarker.requestAnimFrame()(function(){a.step()},b)};HotspotMarker.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}};var SWFItem=function(a,b,c){this.container=a||$(document.body);this.slide=b;this.layer=c;this.ref=null;this.constructElement();this.currentIndex=0;this.content={};this.colors={};this.type="swf";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml=""};SWFItem.prototype=new StageItem;SWFItem.prototype.objectType="Item";SWFItem.prototype.innerType="SWFItem";SWFItem.prototype.createBaseRef=StageItem.prototype.createRef;
SWFItem.prototype.destroyBaseRef=StageItem.prototype.destroyRef;SWFItem.prototype.createRef=function(){if(!this.parent.ref)return this.parent.createRef(),!1;if(this.ref)return this.container.append(this.ref),!1;this.container=this.parent.ref;this.ref=$('<div class="item swf unsupported"><h1>Not Supported</h1>SWF objects cannot be rendered by the HTML5 player.</div>');this.ref.addClass(this.type);this.applySize(this.ref);this.container.append(this.ref);return!0};SWFItem.prototype.renderCallback=function(){};
SWFItem.prototype.render=function(){};var WebObject=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.type="webobject";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.canvas=null;this.m_nYOffset=this.m_nXOffset=0;this.height=this.width=1E3};WebObject.prototype=new StageItem;WebObject.prototype.objectType="WebObject";WebObject.prototype.innerType="WebObject";WebObject.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;
WebObject.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.canSimplify=!1};WebObject.prototype.loadContentFromXML=function(a){this.url=$(a).attr("url");if(0==!this.url.indexOf("http"))this.url=player.basepath+this.url;this.thumb=$(a).attr("thumb");this.loadtype=$(a).attr("loadtype")};WebObject.prototype.destroyBaseRef=StageItem.prototype.destroyRef;WebObject.prototype.destroyRef=function(){this.destroyBaseRef()};WebObject.prototype.createBaseRef=StageItem.prototype.createRef;
WebObject.prototype.createRef=function(){if(this.ref||!this.createBaseRef())return!1;this.contentRef=$("<iframe class='item webobject unhideable'></iframe>");this.contentRef.attr("width",this.width);this.contentRef.attr("height",this.height);player.isIOS&&this.ref.addClass("frameclipper");this.ref.append(this.contentRef);this.contentRef.show();if("auto"==this.loadtype)this.contentRef.attr("src",this.url);else if(this.thumbRef=$("<image class='item unhideable'/>"),this.thumbRef.attr("width",this.width),
this.thumbRef.attr("height",this.height),this.thumbRef.attr("src",player.basepath+this.thumb),this.ref.append(this.thumbRef),this.thumbRef.show(),!this.clickEvent){var a=new StoryEvent(this);a.trigger="onrelease";var b=new TimelineAction(this);b.type="load_webobject";b.xml="<load_webobject/>";b.item=this;a.actions.push(b);this.events.push(a);this.clickEvent=a}return!0};WebObject.prototype.render=function(){};
WebObject.prototype.load_webobject=function(){this.contentRef.attr("src",this.url);this.thumbRef.removeClass("unhideable");this.thumbRef.hide()};var Annotation=function(a){this.container=a||$(document.body);this.ref=null;this.constructElement();this.type="Annotation";this.active=!0;this.id=Math.random();this.name="item";this.layered=!1;this.canSimplify=!0;this.hasEvents=!1;this.xml="";this.canvas=null;this.m_nYOffset=this.m_nXOffset=0;this.height=this.width=1E3};Annotation.prototype=new StageItem;Annotation.prototype.objectType="Annotation";Annotation.prototype.innerType="Annotation";Annotation.prototype.loadBaseFromXML=StageItem.prototype.loadFromXML;
Annotation.prototype.loadFromXML=function(a,b,c){this.loadBaseFromXML(a,b,c);this.originalWidth=parseInt($(a).attr("width"));this.originalHeight=parseInt($(a).attr("height"));this.originalX=this.x;this.originalY=this.y;this.style=$(a).attr("style");this.arrowstyle=$(a).attr("arrowstyle");this.animationtype=$(a).attr("animationtype");this.loopcount=parseInt($(a).attr("loopcount"));this.borderwidth=parseInt($(a).attr("borderwidth"));this.boxradius=parseInt($(a).attr("boxradius"));this.xscale=parseInt($(a).attr("xscale"));
this.yscale=parseInt($(a).attr("yscale"));if(1<this.loopcount&&"draw"!=this.animationtype)this.loopcount=2*(this.loopcount-1)+1;this.canSimplify=!1;switch(this.style){case "arrow":this.convertToArrow();break;case "rectangle":this.convertToRectangle();break;case "spotlight":this.convertToSpotlight()}this.adjustSize&&this.adjustSize()};Annotation.prototype.destroyBaseRef=StageItem.prototype.destroyRef;
Annotation.prototype.destroyRef=function(){if(this.offCanvas)this.offCanvas.destroy?this.offCanvas.destroy():this.offCanvas.remove&&this.offCanvas.remove(),this.offCanvas=null;this.destroyBaseRef()};Annotation.prototype.createBaseRef=StageItem.prototype.createRef;
Annotation.prototype.createRef=function(){if(this.ref)return!1;this.preCreateRef&&this.preCreateRef();if(!this.createBaseRef())return!1;this.ref.css("width",this.width);this.ref.css("height",this.height);var a=$('<canvas class="content" width="'+this.width+'" height="'+this.height+'"></canvas>');a.css("position","absolute");this.ref.append(a);if("spotlight"==this.style)this.spotRef=$('<canvas class="content spotlight" width="'+this.slide.width+'" height="'+this.slide.height+'"></canvas>'),this.spotRef.css("position",
"absolute"),this.spotRef.css("z-index","990"),this.spotContext=this.spotRef.get(0).getContext("2d"),this.spotRef.hide(),this.slide.ref.append(this.spotRef);this.jcanvas=a;this.canvas=a.get(0);this.context=this.canvas.getContext("2d");this.lastRenderedState=null;this.render(null,!0,null,"VectorShape createRef");return!0};Annotation.prototype.baseShow=Annotation.prototype.show;
Annotation.prototype.show=function(a,b,c){this.baseShow(a,b,c);this.spotRef&&this.spotRef.show();b=this.getTimeline();c=b.getCurrentTime();if(a&&"TimelineEvent"==a.type)c=a.time;this.animation||this.setupAnimation(b,c);this.animation.start(this,!1,a,function(){});this.ref.show()};Annotation.prototype.baseHide=Annotation.prototype.hide;Annotation.prototype.hide=function(a,b,c){this.baseHide(a,b,c);this.spotRef&&this.spotRef.hide()};
Annotation.prototype.setupAnimation=function(a,b){if(!this.animation)this.animation=new Animation,this.animation.uniqueID=this.id+="_"+Animation.sequence++,this.animation.persistent=!0,this.animation.item=this,this.animation.target=this.ref,this.animation.bwa=new bwAnnotationAnimation(this),this.animation.bwa.setSegmentPhaseIn(!0),this.animation.bwa.setTriggerTime(b),this.animation.bwa.setStartTime(b),this.animation.bwa.setStartXPos(this.m_nShuffleXPos),this.animation.bwa.setStartYPos(this.m_nShuffleYPos),
this.animation.bwa.setEndXPos(this.m_nShuffleXPos),this.animation.bwa.setEndYPos(this.m_nShuffleYPos),this.animation.bwa.setSegmentDuration(this.GetSegmentDuration(this.animationtype)),this.animation.bwa.SetEffects(this.animationtype,this.loopcount),this.animation.duration=this.animation.bwa.getDuration()};
Annotation.prototype.render=function(){switch(this.style){case "arrow":this.renderArrow();break;case "rectangle":this.animationtype!=bwAnnotationAnimation.TRANS_STRETCH&&this.renderRectangle();break;case "spotlight":this.animationtype!=bwAnnotationAnimation.TRANS_DRAW&&this.UpdateDraw(1)}};Annotation.prototype.renderRectangle=function(){this.drawStrokedRoundRect(0,0,this.width,this.height)};
Annotation.prototype.drawStrokedRoundRect=function(a,b,c,d){this.context.clearRect(a,b,c,d);a+=this.borderwidth/2+1;b+=this.borderwidth/2+1;c-=this.borderwidth+2;d-=this.borderwidth+2;this.context.lineWidth=this.borderwidth;this.context.strokeStyle=this.colors.bordercolor.toColorString();this.drawRoundRect(a,b,c,d);this.context.stroke();a--;b--;this.context.strokeStyle="rgba(0,0,0,0.2)";this.drawRoundRect(a,b,c+2,d+2);this.context.stroke()};
Annotation.prototype.drawRoundRect=function(a,b,c,d,e){var f=this.boxradius,e=e||this.context;e.beginPath();e.moveTo(a+f,b);e.lineTo(a+c-f,b);e.arc(a+c-f,b+f,f,3*Math.PI/2,0,!1);e.lineTo(a+c,b+d-f);e.arc(a+c-f,b+d-f,f,0,Math.PI/2,!1);e.lineTo(a+f,b+d);e.arc(a+f,b+d-f,f,Math.PI/2,Math.PI,!1);e.lineTo(a,b+f);e.arc(a+f,b+f,f,Math.PI,3*Math.PI/2,!1)};Annotation.prototype.GetSegmentDuration=function(){return 333};
Annotation.prototype.UpdateTarget=function(a,b){if(a!=this.lastUpdatePercent)this.lastUpdatePercent=a,b!=bwAnnotationAnimation.TRANS_INT_APPEAR&&(b&bwAnnotationAnimation.TRANS_INT_FADE?this.UpdateFade(a):b&bwAnnotationAnimation.TRANS_INT_STRETCH?this.UpdateStretch(a):b&bwAnnotationAnimation.TRANS_INT_BOUNCE?this.UpdateBounce(a):b&bwAnnotationAnimation.TRANS_INT_DRAW&&this.UpdateDraw(a))};function AnnotationShape(){this.y=this.x=100;this.scale=1;this.rotation=Math.PI/8;this.fillStyle="#00f";this.borderStyle="#fff"}AnnotationShape.Shapes={};AnnotationShape.ShapeNames="anArrowRnd,anArrowSqr,anCheck,anTriangleLg,anTriangleSm,anV,anX".split(",");AnnotationShape.ShapeMap={arrowround:"anArrowRnd",arrowsquare:"anArrowSqr",check:"anCheck",arrowtriangle:"anTriangleSm",trianglelarge:"anTriangleLg",arrowv:"anV",cross:"anX"};
AnnotationShape.ShineDelta={anArrowRnd:[-12.4,2],anArrowSqr:[-11.9,-0.1999999999999993],anCheck:[0.09999999999999964,0.10000000000000053],anTriangleLg:[-12.100000000000001,-0.1999999999999993],anTriangleSm:[-8.200000000000001,-0.2999999999999998],anV:[-5.5,0],anX:[-0.10000000000000142,0]};
AnnotationShape.prototype.initialize=function(a){a.restore();a.save();a.setTransform(this.scale,0,0,this.scale,this.x,this.y);a.globalAlpha=1;switch(this.methodName){case "shadow":a.transform(1,0,0,1,0,1);a.globalAlpha=0.199;a.rotate(this.rotation);break;case "fill":a.rotate(this.rotation);break;case "border":a.rotate(this.rotation);break;case "mask":a.rotate(this.rotation);break;case "shine":var b=AnnotationShape.ShineDelta[this.shapeName];a.rotate(this.rotation);a.transform(1,0,0,1,b[0],b[1]);a.rotate(-this.rotation);
a.transform(1,0,0,1,-b[0],-b[1]);a.save();this.mask(a);a.restore();a.clip()}};AnnotationShape.prototype.draw=function(a){a.clearRect(0,0,1E3,1E3);var b=["shadow","border","fill","shine","drawmask"],c;for(c in b){var d=b[c];if(this[d])this[d](a)}a.restore()};AnnotationShape.prototype.getCurrentFillStyle=function(){return"shadow"==this.methodName?"#000":this.fillStyle};AnnotationShape.prototype.getCurrentBorderStyle=function(){return this.borderStyle};AnnotationShape.Shapes.anArrowRnd=new AnnotationShape;
AnnotationShape.Shapes.anArrowRnd.shadow=function(a){this.shapeName="anArrowRnd";this.methodName="shadow";this.initialize(a);a.transform(1,0,0,1,-29.3,-11.9);a.transform(1,0,0,1,14.2,12);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(1.1,-12.8);a.quadraticCurveTo(-2,-12.5,-2,-8.9);a.lineTo(-2,-7.9);a.lineTo(-11,-7.9);a.quadraticCurveTo(-15,-7.9,-15,-3.9);a.lineTo(-15,5);a.quadraticCurveTo(-15.1,6.9,-14,7.9);a.quadraticCurveTo(-13.1,8.9,-11,8.9);a.lineTo(-2,8.9);a.lineTo(-2,9);a.quadraticCurveTo(-2,
11,-1,12);a.quadraticCurveTo(-0.1,13,1.7,13);a.lineTo(1.7,13);a.quadraticCurveTo(2.3,13,2.9,12.8);a.quadraticCurveTo(3,12.7,3,12.7);a.quadraticCurveTo(3.1,12.7,3.2,12.6);a.quadraticCurveTo(3.3,12.6,3.5,12.5);a.quadraticCurveTo(4.1,12.3,4.7,11.8);a.quadraticCurveTo(4.7,11.8,4.7,11.8);a.lineTo(14.3,2);a.quadraticCurveTo(15.1,1.1,15.2,0);a.quadraticCurveTo(15.1,-1,14.3,-1.9);a.lineTo(4.8,-11.5);a.quadraticCurveTo(4.8,-11.6,4.8,-11.6);a.quadraticCurveTo(4.3,-11.9,3.9,-12.1);a.lineTo(3.9,-12.2);a.quadraticCurveTo(3.7,
-12.3,3.5,-12.4);a.quadraticCurveTo(3.3,-12.5,3.1,-12.6);a.quadraticCurveTo(3,-12.6,3,-12.6);a.quadraticCurveTo(2.4,-12.9,1.7,-12.9);a.quadraticCurveTo(1.6,-12.9,1.6,-12.9);a.quadraticCurveTo(1.4,-12.9,1.1,-12.8);a.lineTo(1.1,-12.8);a.moveTo(13.2,0);a.quadraticCurveTo(13.2,0.3,12.9,0.7);a.lineTo(3.3,10.4);a.lineTo(3.3,10.3);a.quadraticCurveTo(3.1,10.5,2.8,10.7);a.quadraticCurveTo(2.7,10.7,2.6,10.7);a.quadraticCurveTo(2.5,10.7,2.4,10.8);a.quadraticCurveTo(2.3,10.8,2.3,10.9);a.quadraticCurveTo(2.2,
10.9,2.2,10.9);a.quadraticCurveTo(1.9,11,1.7,11);a.lineTo(1.7,11);a.quadraticCurveTo(0.7,11,0.2,10.6);a.quadraticCurveTo(-0.1,10,0,9);a.lineTo(0,7.9);a.quadraticCurveTo(-0.1,7.5,-0.3,7.2);a.quadraticCurveTo(-0.6,6.9,-1,6.9);a.lineTo(-11,6.9);a.quadraticCurveTo(-12.1,6.9,-12.6,6.5);a.quadraticCurveTo(-13.1,5.9,-13,5);a.lineTo(-13,-3.9);a.quadraticCurveTo(-13,-5.9,-11,-5.9);a.lineTo(-1,-5.9);a.quadraticCurveTo(-0.6,-5.9,-0.3,-6.2);a.quadraticCurveTo(-0.1,-6.5,0,-6.9);a.lineTo(0,-8.9);a.quadraticCurveTo(-0.1,
-10.7,1.4,-10.8);a.quadraticCurveTo(1.5,-10.9,1.6,-10.9);a.quadraticCurveTo(1.7,-10.9,1.7,-10.9);a.quadraticCurveTo(1.9,-10.9,2.2,-10.8);a.quadraticCurveTo(2.2,-10.8,2.2,-10.8);a.quadraticCurveTo(2.4,-10.7,2.6,-10.6);a.quadraticCurveTo(2.6,-10.6,2.7,-10.5);a.lineTo(2.7,-10.5);a.quadraticCurveTo(2.8,-10.4,3,-10.4);a.quadraticCurveTo(3.2,-10.3,3.5,-10.1);a.lineTo(12.9,-0.5);a.quadraticCurveTo(13.2,-0.2,13.2,0);a.lineTo(13.2,0);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowRnd.border=function(a){this.shapeName="anArrowRnd";this.methodName="border";this.initialize(a);a.transform(1,0,0,1,-27.299999999999997,-10);a.transform(1,0,0,1,12.2,10.1);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(2.6,-11.7);a.quadraticCurveTo(2.2,-11.9,1.7,-11.9);a.quadraticCurveTo(1.6,-11.9,1.6,-11.9);a.quadraticCurveTo(1.4,-11.9,1.3,-11.9);a.quadraticCurveTo(-1.1,-11.7,-1,-8.9);a.lineTo(-1,-6.9);a.lineTo(-11,-6.9);a.quadraticCurveTo(-14,-6.9,-14,
-3.9);a.lineTo(-14,4.9);a.quadraticCurveTo(-14.1,7.9,-11,7.9);a.lineTo(-1,7.9);a.lineTo(-1,9);a.quadraticCurveTo(-1,12.1,1.7,12);a.quadraticCurveTo(2.2,12,2.6,11.8);a.quadraticCurveTo(2.7,11.7,2.9,11.6);a.quadraticCurveTo(3,11.6,3.1,11.6);a.lineTo(3,11.6);a.quadraticCurveTo(3.6,11.5,4,11);a.lineTo(13.6,1.3);a.quadraticCurveTo(14.2,0.8,14.2,0);a.quadraticCurveTo(14.2,-0.7,13.6,-1.3);a.lineTo(4.1,-10.9);a.quadraticCurveTo(3.8,-11.2,3.4,-11.3);a.quadraticCurveTo(3.3,-11.3,3.3,-11.4);a.lineTo(3.3,-11.4);
a.quadraticCurveTo(3.2,-11.4,3,-11.5);a.quadraticCurveTo(2.8,-11.6,2.6,-11.7);a.lineTo(2.6,-11.7);a.moveTo(1.6,-9.9);a.quadraticCurveTo(1.6,-9.9,1.7,-9.9);a.quadraticCurveTo(1.9,-9.8,2.1,-9.7);a.quadraticCurveTo(2.3,-9.6,2.4,-9.6);a.quadraticCurveTo(2.5,-9.5,2.7,-9.5);a.lineTo(12.2,0);a.lineTo(2.5,9.6);a.quadraticCurveTo(2.3,9.7,2.1,9.8);a.quadraticCurveTo(1.9,9.9,1.7,10);a.quadraticCurveTo(0.8,10,0.8,9);a.lineTo(0.8,5.9);a.lineTo(-11,5.9);a.quadraticCurveTo(-12.1,5.9,-12,4.9);a.lineTo(-12,-3.9);
a.quadraticCurveTo(-12.1,-4.9,-11,-4.9);a.lineTo(0.8,-4.9);a.lineTo(0.8,-8.9);a.quadraticCurveTo(0.8,-9.8,1.6,-9.9);a.lineTo(1.6,-9.9);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowRnd.fill=function(a){this.shapeName="anArrowRnd";this.methodName="fill";this.initialize(a);a.transform(1,0,0,1,-27.3,-10);a.transform(1,0,0,1,12.2,10.1);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(0.8,-8.9);a.quadraticCurveTo(0.8,-9.8,1.6,-9.9);a.quadraticCurveTo(1.6,-9.9,1.7,-9.9);a.quadraticCurveTo(1.9,-9.8,2.1,-9.7);a.quadraticCurveTo(2.3,-9.6,2.4,-9.6);a.quadraticCurveTo(2.5,-9.5,2.7,-9.5);a.lineTo(12.2,0);a.lineTo(2.5,9.6);a.quadraticCurveTo(2.3,
9.7,2.1,9.8);a.quadraticCurveTo(1.9,9.9,1.7,10);a.quadraticCurveTo(0.8,10,0.8,9);a.lineTo(0.8,5.9);a.lineTo(-11,5.9);a.quadraticCurveTo(-12.1,5.9,-12,4.9);a.lineTo(-12,-3.9);a.quadraticCurveTo(-12.1,-4.9,-11,-4.9);a.lineTo(0.8,-4.9);a.lineTo(0.8,-8.9);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowRnd.shine=function(a){this.shapeName="anArrowRnd";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,-12.4,2);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");b.addColorStop(1,"rgba(255,255,255,0.102)");
a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowRnd.mask=function(a){this.shapeName="anArrowRnd";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,-13.6,0.1);a.beginPath();a.moveTo(-0.5,-8.9);a.quadraticCurveTo(-0.5,-9.8,0.1,-9.9);a.quadraticCurveTo(0.1,-9.9,0.2,-9.9);a.quadraticCurveTo(0.4,-9.8,0.6,-9.7);a.quadraticCurveTo(0.8,-9.6,0.9,-9.6);a.quadraticCurveTo(1,-9.5,1.2,-9.5);a.lineTo(10.7,0);a.lineTo(1,9.6);a.quadraticCurveTo(0.8,9.7,0.6,9.8);a.quadraticCurveTo(0.4,9.9,0.2,10);a.quadraticCurveTo(-0.5,
10,-0.5,9);a.lineTo(-0.5,5.9);a.lineTo(-12.5,5.9);a.quadraticCurveTo(-13.6,5.9,-13.5,4.9);a.lineTo(-13.5,-3.9);a.quadraticCurveTo(-13.6,-4.9,-12.5,-4.9);a.lineTo(-0.5,-4.9);a.lineTo(-0.5,-8.9);a.closePath()};AnnotationShape.Shapes.anArrowSqr=new AnnotationShape;
AnnotationShape.Shapes.anArrowSqr.shadow=function(a){this.shapeName="anArrowSqr";this.methodName="shadow";this.initialize(a);a.transform(1,0,0,1,-28.900000000000002,-13.9);a.transform(1,0,0,1,13.7,14.7);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(-0.8,-15.5);a.quadraticCurveTo(-2.1,-15.5,-2.9,-14.6);a.lineTo(-3,-14.6);a.lineTo(-6.5,-11.1);a.lineTo(-6.5,-11.1);a.quadraticCurveTo(-7.1,-10.6,-7.3,-9.8);a.quadraticCurveTo(-7.3,-9.7,-7.3,-9.7);a.quadraticCurveTo(-7.5,-9,-7.3,-8.2);a.lineTo(-7.3,
-8.2);a.quadraticCurveTo(-7.1,-7.5,-6.5,-6.8);a.lineTo(-6.5,-6.8);a.lineTo(-5,-5.3);a.lineTo(-11.6,-5.3);a.quadraticCurveTo(-12.8,-5.3,-13.6,-4.5);a.quadraticCurveTo(-13.7,-4.5,-13.7,-4.4);a.quadraticCurveTo(-14.5,-3.6,-14.6,-2.3);a.lineTo(-14.6,2.5);a.quadraticCurveTo(-14.5,3.7,-13.7,4.6);a.quadraticCurveTo(-12.8,5.4,-11.6,5.5);a.lineTo(-5,5.5);a.lineTo(-6.5,7);a.lineTo(-6.5,7);a.quadraticCurveTo(-7.4,7.8,-7.4,9.1);a.quadraticCurveTo(-7.4,10.4,-6.5,11.3);a.lineTo(-2.9,14.8);a.quadraticCurveTo(-2.1,
15.6,-0.9,15.7);a.quadraticCurveTo(0.2,15.6,1.1,14.8);a.lineTo(11,4.9);a.quadraticCurveTo(11.1,4.8,11.2,4.7);a.quadraticCurveTo(11.3,4.6,11.5,4.5);a.quadraticCurveTo(11.6,4.3,11.7,4.2);a.lineTo(13.8,2);a.quadraticCurveTo(14.6,1.1,14.7,0);a.quadraticCurveTo(14.6,-1.1,13.8,-1.9);a.lineTo(10.3,-5.5);a.quadraticCurveTo(10.1,-5.7,9.9,-5.8);a.lineTo(1.1,-14.6);a.quadraticCurveTo(0.2,-15.6,-0.8,-15.5);a.lineTo(-0.8,-15.5);a.moveTo(8.7,-4.2);a.quadraticCurveTo(8.8,-4.2,8.9,-4.1);a.lineTo(12.4,-0.5);a.quadraticCurveTo(12.7,
-0.3,12.7,0);a.quadraticCurveTo(12.7,0.3,12.4,0.7);a.lineTo(10.2,2.9);a.quadraticCurveTo(10.1,2.9,10.1,3);a.quadraticCurveTo(10,3.1,10,3.2);a.quadraticCurveTo(9.9,3.2,9.8,3.3);a.quadraticCurveTo(9.7,3.3,9.7,3.4);a.lineTo(-0.1,13.4);a.quadraticCurveTo(-0.4,13.7,-0.9,13.7);a.quadraticCurveTo(-1.3,13.7,-1.5,13.4);a.lineTo(-5.1,9.9);a.quadraticCurveTo(-5.4,9.5,-5.4,9.1);a.quadraticCurveTo(-5.4,8.7,-5.1,8.4);a.quadraticCurveTo(-5.1,8.4,-5.1,8.4);a.lineTo(-1.8,5.2);a.quadraticCurveTo(-1.5,4.9,-1.5,4.5);
a.quadraticCurveTo(-1.6,4,-1.9,3.8);a.quadraticCurveTo(-2.1,3.5,-2.5,3.5);a.lineTo(-11.6,3.5);a.quadraticCurveTo(-12,3.5,-12.2,3.2);a.quadraticCurveTo(-12.6,2.9,-12.6,2.5);a.lineTo(-12.6,-2.3);a.quadraticCurveTo(-12.6,-2.8,-12.3,-3);a.quadraticCurveTo(-12.2,-3.1,-12.2,-3.1);a.quadraticCurveTo(-12,-3.4,-11.6,-3.3);a.lineTo(-2.5,-3.3);a.quadraticCurveTo(-2.1,-3.4,-1.9,-3.6);a.quadraticCurveTo(-1.6,-3.9,-1.5,-4.3);a.quadraticCurveTo(-1.6,-4.8,-1.9,-5.1);a.lineTo(-5.1,-8.3);a.lineTo(-5.1,-8.2);a.quadraticCurveTo(-5.3,
-8.4,-5.3,-8.6);a.quadraticCurveTo(-5.3,-8.7,-5.3,-8.7);a.quadraticCurveTo(-5.4,-9,-5.4,-9.2);a.quadraticCurveTo(-5.3,-9.3,-5.3,-9.3);a.quadraticCurveTo(-5.3,-9.5,-5.1,-9.6);a.quadraticCurveTo(-5.1,-9.7,-5.1,-9.7);a.lineTo(-1.5,-13.2);a.lineTo(-1.5,-13.2);a.quadraticCurveTo(-1.2,-13.6,-0.8,-13.5);a.quadraticCurveTo(-0.4,-13.5,-0.1,-13.2);a.lineTo(8.6,-4.3);a.quadraticCurveTo(8.6,-4.3,8.7,-4.2);a.lineTo(8.7,-4.2);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowSqr.border=function(a){this.shapeName="anArrowSqr";this.methodName="border";this.initialize(a);a.transform(1,0,0,1,-26.9,-12);a.transform(1,0,0,1,11.7,12.7);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(-0.8,-14.6);a.quadraticCurveTo(-1.7,-14.6,-2.3,-14);a.lineTo(-5.8,-10.4);a.quadraticCurveTo(-6.2,-10,-6.3,-9.5);a.quadraticCurveTo(-6.5,-9,-6.3,-8.5);a.quadraticCurveTo(-6.2,-8,-5.8,-7.6);a.lineTo(-2.6,-4.4);a.lineTo(-11.6,-4.4);a.quadraticCurveTo(-12.4,
-4.4,-13,-3.8);a.quadraticCurveTo(-13.6,-3.2,-13.6,-2.4);a.lineTo(-13.6,2.4);a.quadraticCurveTo(-13.6,3.3,-13,3.9);a.quadraticCurveTo(-12.4,4.5,-11.6,4.4);a.lineTo(-2.6,4.4);a.lineTo(-5.8,7.7);a.quadraticCurveTo(-6.4,8.3,-6.4,9.1);a.quadraticCurveTo(-6.4,9.9,-5.8,10.5);a.lineTo(-2.3,14.1);a.quadraticCurveTo(-1.7,14.7,-0.9,14.6);a.quadraticCurveTo(0,14.7,0.4,14.1);a.lineTo(10.3,4.1);a.quadraticCurveTo(10.5,4,10.6,3.9);a.quadraticCurveTo(10.8,3.7,10.9,3.5);a.lineTo(13.1,1.3);a.quadraticCurveTo(13.7,
0.7,13.6,0);a.quadraticCurveTo(13.6,-0.7,13.1,-1.3);a.lineTo(9.5,-4.8);a.quadraticCurveTo(9.4,-5,9.2,-5.1);a.lineTo(0.4,-14);a.quadraticCurveTo(0,-14.6,-0.8,-14.6);a.lineTo(-0.8,-14.6);a.moveTo(9.2,2.4);a.lineTo(9.1,2.4);a.lineTo(-0.9,12.6);a.lineTo(-4.4,9.1);a.lineTo(2.1,2.4);a.lineTo(-11.6,2.4);a.lineTo(-11.6,-2.4);a.lineTo(2.1,-2.4);a.lineTo(-4.4,-9);a.lineTo(-0.9,-12.6);a.lineTo(8.1,-3.4);a.lineTo(8.1,-3.4);a.lineTo(11.6,0);a.lineTo(9.2,2.4);a.lineTo(9.2,2.4);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowSqr.fill=function(a){this.shapeName="anArrowSqr";this.methodName="fill";this.initialize(a);a.transform(0.998,0,0,0.998,-26.9758,-11.975);a.transform(1,0,0,1,11.8,12.7);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(9.2,2.5);a.lineTo(-0.8,12.7);a.lineTo(-4.4,9.1);a.lineTo(2.1,2.5);a.lineTo(-11.6,2.5);a.lineTo(-11.6,-2.3);a.lineTo(2.1,-2.3);a.lineTo(-4.4,-9);a.lineTo(-0.9,-12.6);a.lineTo(8.1,-3.4);a.lineTo(8.1,-3.4);a.lineTo(11.7,0);a.lineTo(9.2,2.4);a.lineTo(9.2,
2.5);a.lineTo(9.2,2.5);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowSqr.shine=function(a){this.shapeName="anArrowSqr";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,-11.9,-0.1999999999999993);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");b.addColorStop(1,
"rgba(255,255,255,0.102)");a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anArrowSqr.mask=function(a){this.shapeName="anArrowSqr";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,-13.4,0.7);a.beginPath();a.moveTo(7.3,2.5);a.lineTo(-2.6,12.6);a.lineTo(-6.2,9.1);a.lineTo(0.3,2.5);a.lineTo(-13.4,2.5);a.lineTo(-13.4,-2.3);a.lineTo(0.3,-2.3);a.lineTo(-6.2,-9);a.lineTo(-2.7,-12.5);a.lineTo(6.3,-3.4);a.lineTo(6.3,-3.4);a.lineTo(9.9,0);a.lineTo(7.4,2.4);a.lineTo(7.4,2.5);a.lineTo(7.3,2.5);a.closePath()};AnnotationShape.Shapes.anCheck=new AnnotationShape;
AnnotationShape.Shapes.anCheck.shadow=function(a){this.shapeName="anCheck";this.methodName="shadow";this.initialize(a);a.transform(1,0,0,1,-15,-12);a.transform(1,0,0,1,14.5,12);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(9.5,-12);a.quadraticCurveTo(8.9,-12.6,8.1,-12.7);a.lineTo(8.2,-12.7);a.quadraticCurveTo(7.4,-12.9,6.7,-12.7);a.quadraticCurveTo(6.6,-12.7,6.6,-12.7);a.quadraticCurveTo(5.8,-12.5,5.3,-12);a.lineTo(-2,-4.5);a.lineTo(-5.1,-7.6);a.quadraticCurveTo(-5.7,-8.2,-6.5,-8.4);
a.lineTo(-6.4,-8.4);a.quadraticCurveTo(-7.2,-8.6,-7.9,-8.4);a.quadraticCurveTo(-8,-8.4,-8,-8.4);a.quadraticCurveTo(-8.9,-8.2,-9.4,-7.6);a.lineTo(-9.4,-7.6);a.lineTo(-14.5,-2.5);a.lineTo(-14.4,-2.5);a.quadraticCurveTo(-15.4,-1.6,-15.3,-0.4);a.quadraticCurveTo(-15.4,0.6,-14.4,1.5);a.lineTo(-4.1,12);a.quadraticCurveTo(-3.3,12.9,-2,12.9);a.quadraticCurveTo(-0.7,12.9,0,12);a.lineTo(14.6,-2.6);a.quadraticCurveTo(15.4,-3.5,15.5,-4.7);a.quadraticCurveTo(15.4,-5.8,14.6,-6.7);a.lineTo(14.6,-6.8);a.lineTo(9.5,
-12);a.lineTo(9.5,-12);a.moveTo(8.1,-10.6);a.lineTo(13.2,-5.4);a.lineTo(13.2,-5.4);a.quadraticCurveTo(13.5,-5.1,13.5,-4.7);a.quadraticCurveTo(13.5,-4.3,13.2,-4);a.lineTo(-1.2,10.6);a.quadraticCurveTo(-1.6,10.9,-2,10.9);a.quadraticCurveTo(-2.4,10.9,-2.7,10.7);a.lineTo(-13,0.1);a.quadraticCurveTo(-13.3,0,-13.3,-0.4);a.quadraticCurveTo(-13.3,-0.8,-13,-1.1);a.lineTo(-13,-1.1);a.lineTo(-7.9,-6.2);a.quadraticCurveTo(-7.9,-6.2,-7.9,-6.3);a.quadraticCurveTo(-7.8,-6.4,-7.6,-6.4);a.quadraticCurveTo(-7.5,-6.4,
-7.5,-6.5);a.quadraticCurveTo(-7.2,-6.5,-7,-6.4);a.quadraticCurveTo(-6.9,-6.4,-6.9,-6.4);a.quadraticCurveTo(-6.7,-6.4,-6.5,-6.2);a.lineTo(-2.7,-2.4);a.quadraticCurveTo(-2.4,-2.1,-2,-2.1);a.quadraticCurveTo(-1.6,-2.1,-1.3,-2.4);a.lineTo(6.7,-10.6);a.quadraticCurveTo(6.7,-10.6,6.7,-10.6);a.quadraticCurveTo(6.8,-10.8,7,-10.8);a.quadraticCurveTo(7.1,-10.8,7.1,-10.8);a.quadraticCurveTo(7.4,-10.9,7.6,-10.8);a.quadraticCurveTo(7.7,-10.8,7.7,-10.8);a.quadraticCurveTo(7.9,-10.7,8.1,-10.6);a.lineTo(8.1,-10.6);
a.closePath();a.fill()};
AnnotationShape.Shapes.anCheck.border=function(a){this.shapeName="anCheck";this.methodName="border";this.initialize(a);a.transform(1,0,0,1,-12.9,-10);a.transform(1,0,0,1,12.5,10);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(6.8,-11.8);a.quadraticCurveTo(7.3,-11.9,7.9,-11.8);a.quadraticCurveTo(8.4,-11.6,8.8,-11.3);a.lineTo(13.9,-6.1);a.quadraticCurveTo(14.5,-5.5,14.4,-4.7);a.quadraticCurveTo(14.5,-3.8,13.9,-3.3);a.lineTo(-0.6,11.3);a.quadraticCurveTo(-1.2,11.9,-2,11.9);a.quadraticCurveTo(-2.8,
11.9,-3.4,11.3);a.lineTo(-13.8,0.8);a.quadraticCurveTo(-14.4,0.3,-14.4,-0.4);a.quadraticCurveTo(-14.4,-1.2,-13.8,-1.8);a.lineTo(-8.7,-6.9);a.quadraticCurveTo(-8.3,-7.3,-7.8,-7.4);a.quadraticCurveTo(-7.3,-7.6,-6.7,-7.4);a.quadraticCurveTo(-6.2,-7.3,-5.8,-6.9);a.lineTo(-2,-3.1);a.lineTo(5.9,-11.3);a.quadraticCurveTo(6.3,-11.6,6.8,-11.8);a.lineTo(6.8,-11.8);a.moveTo(-2,-0.2);a.lineTo(-7.3,-5.5);a.lineTo(-12.4,-0.4);a.lineTo(-2,9.9);a.lineTo(12.4,-4.7);a.lineTo(7.3,-9.9);a.lineTo(-2,-0.2);a.closePath();
a.fill()};AnnotationShape.Shapes.anCheck.fill=function(a){this.shapeName="anCheck";this.methodName="fill";this.initialize(a);a.transform(1,0,0,1,-12.9,-10);a.transform(1,0,0,1,12.5,10);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(12.5,-4.7);a.lineTo(7.3,-9.9);a.lineTo(-2,-0.2);a.lineTo(-7.3,-5.5);a.lineTo(-12.4,-0.4);a.lineTo(-2,10);a.lineTo(12.5,-4.7);a.closePath();a.fill()};
AnnotationShape.Shapes.anCheck.shine=function(a){this.shapeName="anCheck";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,0.09999999999999964,0.10000000000000053);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");b.addColorStop(1,
"rgba(255,255,255,0.102)");a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};AnnotationShape.Shapes.anCheck.mask=function(a){this.shapeName="anCheck";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,-0.4,0);a.beginPath();a.moveTo(12.5,-4.7);a.lineTo(7.3,-9.9);a.lineTo(-2,-0.2);a.lineTo(-7.3,-5.5);a.lineTo(-12.4,-0.4);a.lineTo(-2,10);a.lineTo(12.5,-4.7);a.closePath()};
AnnotationShape.Shapes.anTriangleLg=new AnnotationShape;
AnnotationShape.Shapes.anTriangleLg.border=function(a){this.shapeName="anTriangleLg";this.methodName="border";this.initialize(a);a.transform(1,0,0,0.998,-21.9,-11.875);a.transform(1,0,0,1,10.9,12.6);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(-8.9,-14.3);a.quadraticCurveTo(-8.1,-14,-7.2,-13.6);a.quadraticCurveTo(-7.2,-13.5,-7.1,-13.5);a.lineTo(-0.9,-9.6);a.lineTo(-0.9,-9.6);a.lineTo(11.9,-1.5);a.quadraticCurveTo(12.5,-1.1,12.7,-0.4);a.quadraticCurveTo(13,0,12.7,0.7);a.quadraticCurveTo(12.5,
1.3,11.9,1.7);a.lineTo(-7.1,13.6);a.quadraticCurveTo(-7.2,13.6,-7.2,13.7);a.quadraticCurveTo(-8.1,14.1,-8.9,14.4);a.quadraticCurveTo(-9.1,14.4,-9.2,14.4);a.quadraticCurveTo(-11,14.6,-11.8,13.6);a.quadraticCurveTo(-12.8,12.8,-12.8,11.1);a.lineTo(-12.8,-11.1);a.quadraticCurveTo(-12.8,-11.2,-12.8,-11.2);a.quadraticCurveTo(-12.7,-12.8,-11.8,-13.5);a.quadraticCurveTo(-11,-14.5,-9.2,-14.3);a.quadraticCurveTo(-9.1,-14.3,-8.9,-14.3);a.lineTo(-8.9,-14.3);a.moveTo(-10.6,-11.7);a.lineTo(-10.8,-11.1);a.quadraticCurveTo(-10.8,
-11,-10.8,-11);a.lineTo(-10.8,11.1);a.quadraticCurveTo(-10.7,12.6,-9.4,12.4);a.quadraticCurveTo(-8.8,12.3,-8.2,11.9);a.lineTo(10.8,0);a.lineTo(-4.7,-9.6);a.lineTo(-4.7,-9.6);a.lineTo(-8.2,-11.8);a.quadraticCurveTo(-8.8,-12.2,-9.4,-12.3);a.quadraticCurveTo(-10.4,-12.4,-10.7,-11.7);a.lineTo(-10.6,-11.7);a.closePath();a.fill()};
AnnotationShape.Shapes.anTriangleLg.fill=function(a){this.shapeName="anTriangleLg";this.methodName="fill";this.initialize(a);a.transform(1,0,0,0.996,-21.9,-11.9496);a.transform(1,0,0,1,10.9,12.5);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(-8.1,11.9);a.quadraticCurveTo(-8.8,12.3,-9.4,12.4);a.quadraticCurveTo(-10.7,12.6,-10.8,11.1);a.lineTo(-10.8,-11);a.lineTo(-10.4,-12);a.quadraticCurveTo(-9.8,-12.8,-8.2,-11.8);a.lineTo(10.9,0.1);a.lineTo(-8.1,11.9);a.closePath();a.fill()};
AnnotationShape.Shapes.anTriangleLg.shine=function(a){this.shapeName="anTriangleLg";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,-12.100000000000001,-0.1999999999999993);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");
b.addColorStop(1,"rgba(255,255,255,0.102)");a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anTriangleLg.mask=function(a){this.shapeName="anTriangleLg";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,-10.9,0.4);a.beginPath();a.moveTo(-8.2,11.9);a.quadraticCurveTo(-8.9,12.3,-9.5,12.4);a.quadraticCurveTo(-10.8,12.6,-10.9,11.1);a.lineTo(-10.9,-11);a.lineTo(-10.5,-11.9);a.quadraticCurveTo(-9.9,-12.7,-8.3,-11.8);a.lineTo(10.8,0.1);a.lineTo(-8.2,11.9);a.closePath()};AnnotationShape.Shapes.anTriangleSm=new AnnotationShape;
AnnotationShape.Shapes.anTriangleSm.shadow=function(a){this.shapeName="anTriangleSm";this.methodName="shadow";this.initialize(a);a.transform(0.995,0,0,1,-16.851499999999998,-15);a.transform(1,0,0,1,9.2,14.5);a.beginPath();a.strokeStyle="#000000";a.lineWidth="2";a.lineCap="round";a.lineJoin="round";a.miterLimit="10";a.moveTo(-2.6,-13.1);a.quadraticCurveTo(-3.4,-13.9,-4.4,-14.2);a.quadraticCurveTo(-4.5,-14.2,-4.5,-14.2);a.quadraticCurveTo(-4.9,-14.4,-5.3,-14.4);a.quadraticCurveTo(-7,-14.4,-8,-13.3);
a.quadraticCurveTo(-8.1,-13.2,-8.1,-13.1);a.quadraticCurveTo(-8.6,-12.6,-8.7,-12.1);a.lineTo(-8.7,-12.3);a.quadraticCurveTo(-8.9,-11.8,-9,-11.3);a.quadraticCurveTo(-9.1,-11,-9.1,-10.7);a.lineTo(-9.1,10.8);a.quadraticCurveTo(-9.1,11.5,-8.7,12.2);a.quadraticCurveTo(-8.6,12.6,-8.4,12.9);a.quadraticCurveTo(-8.3,13.1,-8,13.4);a.quadraticCurveTo(-7.2,14.2,-5.9,14.4);a.quadraticCurveTo(-5.8,14.5,-5.6,14.4);a.quadraticCurveTo(-5.5,14.4,-5.4,14.4);a.quadraticCurveTo(-5.3,14.4,-5.2,14.4);a.lineTo(-5.2,14.4);
a.quadraticCurveTo(-5,14.5,-4.8,14.4);a.quadraticCurveTo(-3.8,14.2,-2.9,13.4);a.quadraticCurveTo(-2.8,13.4,-2.7,13.3);a.lineTo(-1.6,12.2);a.quadraticCurveTo(-1.5,12.2,-1.5,12.1);a.quadraticCurveTo(-0.8,11.4,-0.2,10.8);a.lineTo(-0.1,10.7);a.quadraticCurveTo(4.2,6,8.7,1.3);a.quadraticCurveTo(9.2,0.7,9.2,0);a.quadraticCurveTo(9.2,-0.7,8.7,-1.3);a.quadraticCurveTo(4.3,-5.9,0,-10.5);a.quadraticCurveTo(0,-10.5,0,-10.5);a.quadraticCurveTo(-0.4,-10.9,-0.7,-11.3);a.quadraticCurveTo(-1.7,-12.2,-2.7,-13.2);
a.lineTo(-2.6,-13.1);a.closePath();a.stroke()};
AnnotationShape.Shapes.anTriangleSm.border=function(a){this.shapeName="anTriangleSm";this.methodName="border";this.initialize(a);a.transform(1,0,0,0.997,-14.9,-12.9622);a.transform(1,0,0,1,7.2,12.5);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(-2.6,-13.1);a.lineTo(-2.7,-13.2);a.quadraticCurveTo(-1.7,-12.2,-0.7,-11.3);a.quadraticCurveTo(-0.4,-10.9,0,-10.5);a.quadraticCurveTo(0,-10.5,0,-10.5);a.quadraticCurveTo(4.3,-5.9,8.7,-1.3);a.quadraticCurveTo(9.2,-0.7,9.2,0);a.quadraticCurveTo(9.2,
0.7,8.7,1.3);a.quadraticCurveTo(4.2,6,-0.1,10.7);a.lineTo(-0.2,10.8);a.quadraticCurveTo(-0.8,11.4,-1.5,12.1);a.quadraticCurveTo(-1.5,12.2,-1.6,12.2);a.lineTo(-2.7,13.3);a.quadraticCurveTo(-2.8,13.4,-2.9,13.4);a.quadraticCurveTo(-3.8,14.2,-4.8,14.4);a.quadraticCurveTo(-5,14.5,-5.2,14.4);a.lineTo(-5.2,14.4);a.quadraticCurveTo(-5.3,14.4,-5.4,14.4);a.quadraticCurveTo(-5.5,14.4,-5.6,14.4);a.quadraticCurveTo(-5.8,14.5,-5.9,14.4);a.quadraticCurveTo(-7.2,14.2,-8,13.4);a.quadraticCurveTo(-8.3,13.1,-8.4,12.9);
a.quadraticCurveTo(-8.6,12.6,-8.7,12.2);a.quadraticCurveTo(-9.1,11.5,-9.1,10.8);a.lineTo(-9.1,-10.7);a.quadraticCurveTo(-9.1,-11,-9,-11.3);a.quadraticCurveTo(-8.9,-11.8,-8.7,-12.3);a.lineTo(-8.7,-12.1);a.quadraticCurveTo(-8.6,-12.6,-8.1,-13.1);a.quadraticCurveTo(-8.1,-13.2,-8,-13.3);a.quadraticCurveTo(-7,-14.4,-5.3,-14.4);a.quadraticCurveTo(-4.9,-14.4,-4.5,-14.2);a.quadraticCurveTo(-4.5,-14.2,-4.4,-14.2);a.quadraticCurveTo(-3.4,-13.9,-2.6,-13.1);a.lineTo(-2.6,-13.1);a.moveTo(-4.1,-11.7);a.quadraticCurveTo(-4.5,
-12.2,-5.1,-12.3);a.quadraticCurveTo(-5.2,-12.4,-5.4,-12.4);a.quadraticCurveTo(-6.1,-12.3,-6.6,-11.9);a.quadraticCurveTo(-6.8,-11.6,-6.9,-11.4);a.quadraticCurveTo(-7.1,-11,-7.1,-10.7);a.lineTo(-7.1,-10.7);a.lineTo(-7.1,10.8);a.quadraticCurveTo(-7.1,11.2,-6.9,11.5);a.quadraticCurveTo(-6.9,11.6,-6.8,11.7);a.quadraticCurveTo(-6.7,11.8,-6.6,11.9);a.quadraticCurveTo(-6.2,12.4,-5.6,12.4);a.quadraticCurveTo(-5.5,12.4,-5.4,12.4);a.quadraticCurveTo(-5.3,12.5,-5.3,12.4);a.lineTo(-5.2,12.4);a.quadraticCurveTo(-4.6,
12.4,-4.2,11.9);a.quadraticCurveTo(-4.1,11.9,-4.1,11.8);a.lineTo(-3,10.7);a.quadraticCurveTo(-2.3,10,-1.6,9.3);a.quadraticCurveTo(2.7,4.6,7.2,0);a.quadraticCurveTo(2.8,-4.5,-1.4,-9.1);a.quadraticCurveTo(-1.8,-9.5,-2.1,-9.9);a.quadraticCurveTo(-3.1,-10.8,-4.1,-11.7);a.lineTo(-4.1,-11.7);a.closePath();a.fill()};
AnnotationShape.Shapes.anTriangleSm.fill=function(a){this.shapeName="anTriangleSm";this.methodName="fill";this.initialize(a);a.transform(1,0,0,1,-14.9,-12.9);a.transform(1,0,0,1,7.3,12.5);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(-5.4,-12.4);a.quadraticCurveTo(-6.1,-12.3,-6.6,-11.9);a.quadraticCurveTo(-6.8,-11.6,-6.9,-11.4);a.quadraticCurveTo(-7.1,-11,-7.1,-10.7);a.lineTo(-7.1,-10.7);a.lineTo(-7.1,10.8);a.quadraticCurveTo(-7.1,11.2,-6.9,11.5);a.quadraticCurveTo(-6.9,11.6,-6.8,
11.7);a.quadraticCurveTo(-6.7,11.8,-6.6,11.9);a.quadraticCurveTo(-6.2,12.4,-5.6,12.4);a.quadraticCurveTo(-5.5,12.4,-5.4,12.4);a.quadraticCurveTo(-5.3,12.5,-5.3,12.4);a.lineTo(-5.2,12.4);a.quadraticCurveTo(-4.6,12.4,-4.2,11.9);a.quadraticCurveTo(-4.1,11.9,-4.1,11.8);a.lineTo(-3,10.7);a.quadraticCurveTo(-2.3,10,-1.6,9.3);a.quadraticCurveTo(2.7,4.6,7.2,0);a.quadraticCurveTo(2.8,-4.5,-1.4,-9.1);a.quadraticCurveTo(-1.8,-9.5,-2.2,-9.9);a.quadraticCurveTo(-3.1,-10.8,-4.1,-11.7);a.quadraticCurveTo(-4.5,-12.2,
-5.1,-12.3);a.quadraticCurveTo(-5.2,-12.4,-5.4,-12.4);a.lineTo(-5.4,-12.4);a.closePath();a.fill()};
AnnotationShape.Shapes.anTriangleSm.shine=function(a){this.shapeName="anTriangleSm";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,-8.200000000000001,-0.2999999999999998);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");
b.addColorStop(1,"rgba(255,255,255,0.102)");a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anTriangleSm.mask=function(a){this.shapeName="anTriangleSm";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,-7.4,-0.4);a.beginPath();a.moveTo(-5.6,-12.4);a.quadraticCurveTo(-6.3,-12.3,-6.9,-11.9);a.quadraticCurveTo(-7.1,-11.6,-7.2,-11.4);a.quadraticCurveTo(-7.3,-11,-7.3,-10.7);a.lineTo(-7.4,-10.7);a.lineTo(-7.4,10.8);a.quadraticCurveTo(-7.3,11.2,-7.2,11.5);a.quadraticCurveTo(-7.1,11.6,-7,11.7);a.quadraticCurveTo(-7,11.8,-6.9,11.9);a.quadraticCurveTo(-6.4,12.4,
-5.9,12.4);a.quadraticCurveTo(-5.8,12.4,-5.7,12.4);a.quadraticCurveTo(-5.6,12.5,-5.5,12.4);a.lineTo(-5.5,12.4);a.quadraticCurveTo(-4.9,12.4,-4.5,11.9);a.quadraticCurveTo(-4.4,11.9,-4.3,11.8);a.lineTo(-3.2,10.7);a.quadraticCurveTo(-2.5,10,-1.9,9.3);a.quadraticCurveTo(2.4,4.6,7,0);a.quadraticCurveTo(2.5,-4.5,-1.7,-9.1);a.quadraticCurveTo(-2,-9.5,-2.4,-9.9);a.quadraticCurveTo(-3.4,-10.8,-4.3,-11.7);a.quadraticCurveTo(-4.7,-12.2,-5.3,-12.3);a.quadraticCurveTo(-5.5,-12.4,-5.6,-12.4);a.lineTo(-5.6,-12.4);
a.closePath()};AnnotationShape.Shapes.anV=new AnnotationShape;
AnnotationShape.Shapes.anV.shadow=function(a){this.shapeName="anV";this.methodName="shadow";this.initialize(a);a.transform(1,0,0,1,-18,-14);a.transform(1,0,0,1,10,14.4);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(-1.9,-14.4);a.quadraticCurveTo(-3.5,-15.5,-5.5,-15.3);a.quadraticCurveTo(-7.6,-15.1,-9,-13.6);a.quadraticCurveTo(-9.1,-13.6,-9.1,-13.5);a.quadraticCurveTo(-10.5,-12.2,-10.8,-10.2);a.lineTo(-10.7,-10.3);a.quadraticCurveTo(-11.1,-8.2,-10.1,-6.4);a.quadraticCurveTo(-9.9,-6,
-9.5,-5.7);a.lineTo(-3.7,0);a.lineTo(-9.5,5.9);a.lineTo(-9.5,5.9);a.quadraticCurveTo(-9.7,6.1,-9.9,6.4);a.lineTo(-9.9,6.3);a.quadraticCurveTo(-11.1,8,-10.7,10.3);a.lineTo(-10.8,10.3);a.quadraticCurveTo(-10.5,12.3,-9,13.8);a.lineTo(-9,13.8);a.quadraticCurveTo(-9,13.8,-8.9,13.9);a.quadraticCurveTo(-7.6,15.1,-5.7,15.4);a.quadraticCurveTo(-5.6,15.4,-5.5,15.4);a.quadraticCurveTo(-5.5,15.4,-5.4,15.4);a.quadraticCurveTo(-5.4,15.4,-5.3,15.4);a.quadraticCurveTo(-3.5,15.5,-1.9,14.5);a.quadraticCurveTo(-1.9,
14.5,-1.8,14.5);a.quadraticCurveTo(-1.6,14.3,-1.4,14.2);a.quadraticCurveTo(-1.4,14.1,-1.3,14.1);a.lineTo(10.1,2.1);a.lineTo(10.1,2);a.quadraticCurveTo(10.9,1.1,10.9,0);a.quadraticCurveTo(10.9,-1,10.1,-1.9);a.lineTo(10.1,-1.9);a.lineTo(-1.3,-14);a.quadraticCurveTo(-1.4,-14,-1.4,-14.1);a.quadraticCurveTo(-1.6,-14.2,-1.8,-14.4);a.quadraticCurveTo(-1.9,-14.4,-1.9,-14.4);a.lineTo(-1.9,-14.4);a.moveTo(-2.7,-12.6);a.lineTo(8.7,-0.5);a.lineTo(8.7,-0.6);a.quadraticCurveTo(8.9,-0.3,8.9,0);a.quadraticCurveTo(8.9,
0.4,8.7,0.7);a.lineTo(8.7,0.7);a.lineTo(-2.7,12.7);a.quadraticCurveTo(-2.8,12.7,-2.9,12.8);a.quadraticCurveTo(-3,12.8,-3,12.9);a.quadraticCurveTo(-4.1,13.5,-5.2,13.4);a.quadraticCurveTo(-5.3,13.4,-5.3,13.4);a.lineTo(-5.4,13.4);a.quadraticCurveTo(-6.7,13.2,-7.6,12.4);a.lineTo(-7.6,12.4);a.lineTo(-7.6,12.4);a.quadraticCurveTo(-8.6,11.4,-8.8,10);a.lineTo(-8.8,10);a.quadraticCurveTo(-9,8.6,-8.2,7.5);a.lineTo(-8.2,7.5);a.quadraticCurveTo(-8.2,7.4,-8.1,7.3);a.lineTo(-8.1,7.3);a.lineTo(-1.6,0.7);a.quadraticCurveTo(-1.3,
0.4,-1.3,0);a.quadraticCurveTo(-1.3,-0.2,-1.6,-0.5);a.lineTo(-8.1,-7.2);a.quadraticCurveTo(-8.2,-7.3,-8.3,-7.3);a.quadraticCurveTo(-8.3,-7.4,-8.3,-7.4);a.quadraticCurveTo(-9,-8.6,-8.8,-9.9);a.quadraticCurveTo(-8.8,-9.9,-8.8,-10);a.quadraticCurveTo(-8.6,-11.3,-7.6,-12.2);a.quadraticCurveTo(-7.5,-12.2,-7.5,-12.3);a.quadraticCurveTo(-6.6,-13.2,-5.3,-13.3);a.quadraticCurveTo(-4.1,-13.4,-3,-12.8);a.quadraticCurveTo(-3,-12.8,-2.9,-12.7);a.quadraticCurveTo(-2.8,-12.7,-2.7,-12.6);a.lineTo(-2.7,-12.6);a.closePath();
a.fill()};
AnnotationShape.Shapes.anV.border=function(a){this.shapeName="anV";this.methodName="border";this.initialize(a);a.transform(1,0,0,0.998,-15.9,-11.975);a.transform(1,0,0,1,8,12.4);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(-5.4,-14.3);a.quadraticCurveTo(-3.8,-14.5,-2.4,-13.6);a.quadraticCurveTo(-2.2,-13.5,-2,-13.3);a.lineTo(9.4,-1.2);a.quadraticCurveTo(9.9,-0.7,9.9,0);a.quadraticCurveTo(9.9,0.8,9.4,1.4);a.lineTo(-2,13.4);a.quadraticCurveTo(-2.2,13.5,-2.4,13.7);a.quadraticCurveTo(-3.7,14.5,
-5.3,14.4);a.quadraticCurveTo(-5.4,14.4,-5.5,14.4);a.quadraticCurveTo(-7.1,14.1,-8.3,13.1);a.quadraticCurveTo(-8.3,13.1,-8.3,13);a.quadraticCurveTo(-9.6,11.8,-9.8,10.2);a.lineTo(-9.8,10.1);a.quadraticCurveTo(-10.1,8.3,-9.1,6.9);a.quadraticCurveTo(-9,6.7,-8.8,6.6);a.lineTo(-2.3,0);a.lineTo(-8.9,-6.5);a.quadraticCurveTo(-9.1,-6.7,-9.2,-6.9);a.quadraticCurveTo(-10,-8.4,-9.8,-10.1);a.quadraticCurveTo(-9.5,-11.8,-8.3,-12.9);a.lineTo(-8.3,-12.9);a.quadraticCurveTo(-7.1,-14.1,-5.4,-14.3);a.lineTo(-5.4,-14.3);
a.moveTo(-7.8,-9.8);a.quadraticCurveTo(-8,-8.8,-7.5,-8);a.lineTo(0.3,0);a.lineTo(-7.4,8);a.quadraticCurveTo(-8,8.8,-7.8,9.8);a.quadraticCurveTo(-7.7,10.9,-6.9,11.6);a.quadraticCurveTo(-6.2,12.3,-5.2,12.4);a.quadraticCurveTo(-4.3,12.5,-3.5,12);a.lineTo(7.9,0);a.lineTo(-3.5,-11.9);a.quadraticCurveTo(-4.3,-12.4,-5.2,-12.3);a.quadraticCurveTo(-6.2,-12.2,-6.9,-11.5);a.quadraticCurveTo(-7.7,-10.8,-7.8,-9.8);a.lineTo(-7.8,-9.8);a.closePath();a.fill()};
AnnotationShape.Shapes.anV.fill=function(a){this.shapeName="anV";this.methodName="fill";this.initialize(a);a.transform(1,0,0,0.998,-15.9,-11.975);a.transform(1,0,0,1,8,12.5);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(-6.9,-11.5);a.quadraticCurveTo(-7.7,-10.8,-7.8,-9.8);a.quadraticCurveTo(-8,-8.8,-7.5,-8);a.lineTo(0.3,0);a.lineTo(-7.4,8);a.quadraticCurveTo(-8,8.8,-7.8,9.9);a.quadraticCurveTo(-7.7,10.9,-6.9,11.6);a.quadraticCurveTo(-6.2,12.3,-5.2,12.4);a.quadraticCurveTo(-4.3,12.5,
-3.5,12);a.lineTo(7.9,0);a.lineTo(-3.5,-11.9);a.quadraticCurveTo(-4.3,-12.4,-5.2,-12.3);a.quadraticCurveTo(-6.2,-12.2,-6.9,-11.5);a.lineTo(-6.9,-11.5);a.closePath();a.fill()};
AnnotationShape.Shapes.anV.shine=function(a){this.shapeName="anV";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,-5.5,0);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");b.addColorStop(1,"rgba(255,255,255,0.102)");
a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anV.mask=function(a){this.shapeName="anV";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,-7.9,0.4);a.beginPath();a.moveTo(-6.9,-11.5);a.quadraticCurveTo(-7.7,-10.8,-7.8,-9.8);a.quadraticCurveTo(-8,-8.8,-7.5,-8);a.lineTo(0.3,0);a.lineTo(-7.4,8);a.quadraticCurveTo(-8,8.8,-7.8,9.9);a.quadraticCurveTo(-7.7,10.9,-6.9,11.6);a.quadraticCurveTo(-6.2,12.3,-5.2,12.4);a.quadraticCurveTo(-4.3,12.5,-3.5,12);a.lineTo(7.9,0);a.lineTo(-3.5,-11.9);a.quadraticCurveTo(-4.3,-12.4,
-5.2,-12.3);a.quadraticCurveTo(-6.2,-12.2,-6.9,-11.5);a.lineTo(-6.9,-11.5);a.closePath()};AnnotationShape.Shapes.anX=new AnnotationShape;
AnnotationShape.Shapes.anX.shadow=function(a){this.shapeName="anX";this.methodName="shadow";this.initialize(a);a.transform(1,0,0,1,-13.9,-14);a.transform(1,0,0,1,14.5,14.5);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(6,-15.4);a.quadraticCurveTo(4.7,-15.3,3.9,-14.5);a.lineTo(0,-10.6);a.lineTo(-3.7,-14.5);a.quadraticCurveTo(-4.6,-15.3,-5.9,-15.4);a.quadraticCurveTo(-7.1,-15.3,-8,-14.5);a.lineTo(-14.5,-8);a.quadraticCurveTo(-15.3,-7.2,-15.4,-5.9);a.quadraticCurveTo(-15.3,-4.6,-14.5,
-3.8);a.lineTo(-10.5,0);a.lineTo(-14.5,3.9);a.quadraticCurveTo(-15.4,4.8,-15.4,6);a.quadraticCurveTo(-15.3,7.3,-14.5,8.2);a.lineTo(-8,14.6);a.quadraticCurveTo(-7.2,15.4,-5.9,15.5);a.quadraticCurveTo(-4.7,15.4,-3.8,14.6);a.lineTo(-3.8,14.6);a.lineTo(0,10.7);a.lineTo(3.9,14.6);a.quadraticCurveTo(4.7,15.4,6,15.5);a.quadraticCurveTo(7.2,15.4,8.1,14.6);a.lineTo(8.1,14.6);a.lineTo(14.6,8.2);a.lineTo(14.6,8.2);a.quadraticCurveTo(15.4,7.3,15.5,6);a.quadraticCurveTo(15.4,4.7,14.6,3.9);a.lineTo(10.7,0);a.lineTo(14.6,
-3.7);a.lineTo(14.6,-3.7);a.quadraticCurveTo(15.5,-4.6,15.5,-5.8);a.quadraticCurveTo(15.4,-7,14.6,-7.9);a.lineTo(14.6,-8);a.lineTo(8.2,-14.5);a.lineTo(8.2,-14.5);a.quadraticCurveTo(7.3,-15.3,6,-15.4);a.lineTo(6,-15.4);a.moveTo(6.8,-13.1);a.lineTo(13.2,-6.6);a.quadraticCurveTo(13.5,-6.2,13.5,-5.8);a.quadraticCurveTo(13.4,-5.4,13.2,-5.1);a.lineTo(13.2,-5.1);a.lineTo(8.6,-0.6);a.quadraticCurveTo(8.3,-0.3,8.3,0);a.quadraticCurveTo(8.3,0.4,8.6,0.6);a.lineTo(13.2,5.3);a.quadraticCurveTo(13.5,5.6,13.5,6);
a.quadraticCurveTo(13.5,6.4,13.2,6.8);a.lineTo(6.7,13.2);a.quadraticCurveTo(6.4,13.5,6,13.5);a.quadraticCurveTo(5.6,13.5,5.3,13.2);a.lineTo(0.6,8.6);a.quadraticCurveTo(0.4,8.3,0,8.3);a.quadraticCurveTo(-0.3,8.2,-0.5,8.5);a.lineTo(-5.2,13.2);a.lineTo(-5.2,13.2);a.quadraticCurveTo(-5.5,13.5,-5.9,13.5);a.quadraticCurveTo(-6.3,13.5,-6.6,13.2);a.lineTo(-13.1,6.8);a.quadraticCurveTo(-13.4,6.4,-13.4,6);a.quadraticCurveTo(-13.3,5.6,-13.1,5.3);a.lineTo(-8.4,0.7);a.quadraticCurveTo(-8.1,0.4,-8.1,0);a.quadraticCurveTo(-8.1,
-0.2,-8.4,-0.5);a.lineTo(-13.1,-5.2);a.quadraticCurveTo(-13.4,-5.5,-13.4,-5.9);a.quadraticCurveTo(-13.4,-6.3,-13.1,-6.6);a.lineTo(-6.5,-13.1);a.quadraticCurveTo(-6.3,-13.4,-5.9,-13.4);a.quadraticCurveTo(-5.4,-13.4,-5.1,-13.1);a.lineTo(-0.5,-8.5);a.quadraticCurveTo(-0.2,-8.2,0,-8.2);a.quadraticCurveTo(0.4,-8.2,0.7,-8.5);a.lineTo(5.3,-13.1);a.quadraticCurveTo(5.6,-13.4,6,-13.4);a.quadraticCurveTo(6.4,-13.4,6.8,-13.1);a.lineTo(6.8,-13.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anX.border=function(a){this.shapeName="anX";this.methodName="border";this.initialize(a);a.transform(1,0,0,1,-12,-12);a.transform(1,0,0,1,12.5,12.5);a.beginPath();a.fillStyle=this.getCurrentBorderStyle();a.moveTo(-5.9,-14.3);a.quadraticCurveTo(-5,-14.4,-4.4,-13.8);a.lineTo(0,-9.1);a.lineTo(4.6,-13.7);a.quadraticCurveTo(5.2,-14.3,6,-14.3);a.quadraticCurveTo(6.8,-14.3,7.4,-13.7);a.lineTo(13.9,-7.2);a.quadraticCurveTo(14.5,-6.7,14.4,-5.8);a.quadraticCurveTo(14.4,-5,13.8,-4.4);a.lineTo(9.2,
0);a.lineTo(13.9,4.6);a.quadraticCurveTo(14.5,5.2,14.4,6);a.quadraticCurveTo(14.4,6.8,13.8,7.4);a.lineTo(7.4,13.9);a.quadraticCurveTo(6.8,14.5,6,14.5);a.quadraticCurveTo(5.2,14.5,4.6,13.9);a.lineTo(0,9.3);a.lineTo(-4.5,13.9);a.quadraticCurveTo(-5.1,14.5,-5.9,14.5);a.quadraticCurveTo(-6.7,14.5,-7.3,13.9);a.lineTo(-13.8,7.4);a.quadraticCurveTo(-14.4,6.8,-14.4,6);a.quadraticCurveTo(-14.4,5.2,-13.8,4.6);a.lineTo(-9.1,0);a.lineTo(-13.8,-4.5);a.quadraticCurveTo(-14.4,-5.1,-14.4,-5.9);a.quadraticCurveTo(-14.4,
-6.7,-13.8,-7.3);a.lineTo(-7.3,-13.8);a.quadraticCurveTo(-6.7,-14.4,-5.9,-14.3);a.lineTo(-5.9,-14.3);a.moveTo(-5.9,-12.3);a.lineTo(-12.4,-5.9);a.lineTo(-6.3,0);a.lineTo(-12.4,6);a.lineTo(-5.9,12.5);a.lineTo(0,6.4);a.lineTo(6,12.4);a.lineTo(12.4,6);a.lineTo(6.4,0);a.lineTo(12.4,-5.9);a.lineTo(6,-12.3);a.lineTo(0,-6.3);a.lineTo(-5.9,-12.3);a.closePath();a.fill()};
AnnotationShape.Shapes.anX.fill=function(a){this.shapeName="anX";this.methodName="fill";this.initialize(a);a.transform(1,0,0,1,-12,-12);a.transform(1,0,0,1,12.5,12.5);a.beginPath();a.fillStyle=this.getCurrentFillStyle();a.moveTo(0,-6.3);a.lineTo(-5.9,-12.4);a.lineTo(-12.4,-5.9);a.lineTo(-6.3,0);a.lineTo(-12.4,6);a.lineTo(-5.9,12.5);a.lineTo(0,6.4);a.lineTo(6,12.4);a.lineTo(12.5,6);a.lineTo(6.4,0);a.lineTo(12.5,-5.9);a.lineTo(6,-12.4);a.lineTo(0,-6.3);a.closePath();a.fill()};
AnnotationShape.Shapes.anX.shine=function(a){this.shapeName="anX";this.methodName="shine";this.initialize(a);a.transform(1,0,0,1,-0.10000000000000142,0);a.transform(1,0,0,1,0,0);a.beginPath();a.fillStyle="rgba(0,255,0,0)";a.moveTo(-19.9,-19.9);a.lineTo(20,-19.9);a.lineTo(20,20);a.lineTo(-19.9,20);a.lineTo(-19.9,-19.9);a.closePath();a.fill();a.transform(1,0,0,1,0,-6.2);a.beginPath();var b=a.createLinearGradient(0,-12.1,0,12.3);b.addColorStop(0,"rgba(255,255,255,0.702)");b.addColorStop(1,"rgba(255,255,255,0.102)");
a.fillStyle=b;a.moveTo(-19.9,-11.1);a.lineTo(20,-11.1);a.lineTo(20,11.2);a.quadraticCurveTo(9.5,-5,-19.9,10.9);a.lineTo(-19.9,-11.1);a.closePath();a.fill()};
AnnotationShape.Shapes.anX.mask=function(a){this.shapeName="anX";this.methodName="mask";this.initialize(a);a.transform(1,0,0,1,0.5,0.5);a.beginPath();a.moveTo(0,-6.3);a.lineTo(-5.9,-12.4);a.lineTo(-12.4,-5.9);a.lineTo(-6.3,0);a.lineTo(-12.4,6);a.lineTo(-5.9,12.5);a.lineTo(0,6.4);a.lineTo(6,12.4);a.lineTo(12.5,6);a.lineTo(6.4,0);a.lineTo(12.5,-5.9);a.lineTo(6,-12.4);a.lineTo(0,-6.3);a.closePath()};AnnotationShape.ShapeNames="anArrowRnd,anArrowSqr,anCheck,anTriangleLg,anTriangleSm,anV,anX".split(",");var bwAnnotationArrow={STYLE_CHECK:"check",STYLE_CROSS:"cross",STYLE_ROUND:"arrowround",STYLE_SQUARE:"arrowsquare",STYLE_TRIANGLE:"arrowtriangle",STYLE_V:"arrowv",SYMBOL_CHECK:"anCheck",SYMBOL_CROSS:"anX",SYMBOL_ROUND:"anArrowRnd",SYMBOL_SQUARE:"anArrowSqr",SYMBOL_TRIANGLE:"anTriangleSm",SYMBOL_V:"anV",PROPERTY_FILL:"mcFill",PROPERTY_BORDER:"mcBorder",PROPERTY_MASK_LEG:"mcMaskLeg",SYMBOL_CHECK_MASK:"anCheckMask",SYMBOL_CROSS_MASK:"anXMask",SYMBOL_CROSS_MASK_LEG:"maskLeg",DURATION_FADE:333,DURATION_BOUNCE:300,
DURATION_DRAW:780,BOUNCE_DISTANCE:15,TOTAL_MASK_FRAMES:26,MASK_LEG_FRAMES:18,HTML5_SCALE_FACTOR:0.017};
Annotation.prototype.convertToArrow=function(){this.m_nFrame=1;this.m_nShadowY=this.m_nShadowX=0;this.drawMaskLegs={};this.adjustSize=function(){this.width=2*this.xscale;this.height=2*this.yscale;this.originalWidth=this.width;this.originalHeight=this.height;this.cx=this.width/2;this.cy=this.height/2;this.x-=this.cx;this.y-=this.cy;this.originalX=this.x;this.originalY=this.y;this.shapeRotation=this.rotation*Math.PI/180;this.rotation=0;this.m_nInitAlpha=100};this.getShapeObject=function(){var a=AnnotationShape.Shapes[AnnotationShape.ShapeMap[this.arrowstyle]];
a.x=this.cx;a.y=this.cy;a.rotation=this.shapeRotation;a.scale=this.xscale*bwAnnotationArrow.HTML5_SCALE_FACTOR;a.fillStyle=this.colors.fillcolor.stops[0].color;a.borderStyle=this.colors.bordercolor.stops[0].color;return a};this.renderArrow=function(){this.getShapeObject().draw(this.context)};this.GetSegmentDuration=function(a){switch(a){case bwAnnotationAnimation.TRANS_FADE:a=bwAnnotationArrow.DURATION_FADE;break;case bwAnnotationAnimation.TRANS_BOUNCE:a=bwAnnotationArrow.DURATION_BOUNCE;break;case bwAnnotationAnimation.TRANS_DRAW:a=
bwAnnotationArrow.DURATION_DRAW;break;default:a=0}return a};this.UpdateFade=function(a){this.alpha=this.m_nInitAlpha*(1-a);this.ref.css("opacity",this.alpha/100)};this.UpdateDraw=function(a){this.EnsureOffCanvasExists();if(this.canvas){var b=this,c=this.getShapeObject();c.drawmask=function(c){this.initialize(c);this.initialize(b.offContext);var c=b.drawMaskLegs[b.arrowstyle],e=c.length,f=Math.floor(a*e),g=(a-f/e)*e;f>=e&&(f=e-1,g=1);c[f].call(b,g)};c.draw(this.context);c.drawmask=null;if(this.m_mcMask)this.m_mcMask.gotoAndStop(this.m_nFrame),
this.m_mcMask.visible=1<=a?!1:!0;if(this.m_mcMaskLeg)this.m_mcMaskLeg.gotoAndStop(this.m_nFrame),this.m_mcMaskLeg.visible=a>=bwAnnotationArrow.MASK_LEG_FRAMES/bwAnnotationArrow.TOTAL_MASK_FRAMES?!1:!0}};this.UpdateBounce=function(a){if(void 0===this.m_nBounceX)this.m_nBounceX=this.x,this.m_nBounceY=this.y;var b=0,c=0,c=this.shapeRotation,a=1-a;0.25>a?(b=Math.cos(c)*bwAnnotationArrow.BOUNCE_DISTANCE/2*a,c=Math.sin(c)*bwAnnotationArrow.BOUNCE_DISTANCE/2*a):(b=Math.cos(c)*(bwAnnotationArrow.BOUNCE_DISTANCE/
2+bwAnnotationArrow.BOUNCE_DISTANCE/2*a),c=Math.sin(c)*(bwAnnotationArrow.BOUNCE_DISTANCE/2+bwAnnotationArrow.BOUNCE_DISTANCE/2*a));this.x=this.m_nBounceX-b;this.y=this.m_nBounceY-c;this.ref.css("left",this.x);this.ref.css("top",this.y)};this.CROSS_MASK_WIDTH=9;this.DrawCrossMaskLeg1=function(a){var b=this.offContext;b.beginPath();b.rotate(-Math.PI/4);b.translate(0.5*-this.CROSS_MASK_WIDTH,-15);var c=this.CROSS_MASK_WIDTH,a=parseInt(33*a);b.moveTo(0,0);b.lineTo(c,0);b.lineTo(c,a);b.lineTo(0,a);b.closePath();
b.rotate(Math.PI/4);b.restore();b.save();b.clip();this.offContext.drawImage(this.canvas,0,0);this.context.restore();this.context.clearRect(0,0,1E3,1E3);this.context.drawImage(this.offCanvas,0,0);this.offContext.restore();this.offContext.clearRect(0,0,1E3,1E3);b.restore()};this.DrawCrossMaskLeg2=function(a){var b=this.offContext;b.beginPath();b.rotate(-Math.PI/4);b.translate(-17,-15);var c=this.CROSS_MASK_WIDTH,d=parseInt(33*a),d=33;b.moveTo(17-0.5*this.CROSS_MASK_WIDTH,0);b.lineTo(c+17-0.5*this.CROSS_MASK_WIDTH,
0);b.lineTo(c+17-0.5*this.CROSS_MASK_WIDTH,d);b.lineTo(17-0.5*this.CROSS_MASK_WIDTH,d);c=33*a;b.moveTo(0,0);b.lineTo(c+0,0);b.lineTo(c+0,d);b.lineTo(0,d);b.closePath();b.rotate(Math.PI/4);b.restore();b.save();b.clip();this.offContext.drawImage(this.canvas,0,0);this.context.restore();this.context.clearRect(0,0,1E3,1E3);this.context.drawImage(this.offCanvas,0,0);this.offContext.restore();this.offContext.clearRect(0,0,1E3,1E3);b.restore()};this.DrawCheckMaskLeg1=function(a){var b=this.offContext;b.beginPath();
b.rotate(-Math.PI/4);b.translate(-12.3,-12.3);a=parseInt(21.5*a);b.moveTo(0,0);b.lineTo(13,0);b.lineTo(13,a);b.lineTo(0,a);b.closePath();b.rotate(Math.PI/4);b.restore();b.save();b.clip();this.offContext.drawImage(this.canvas,0,0);this.context.restore();this.context.clearRect(0,0,1E3,1E3);this.context.drawImage(this.offCanvas,0,0);this.offContext.restore();this.offContext.clearRect(0,0,1E3,1E3);b.restore()};this.DrawCheckMaskLeg2=function(a){var b=this.offContext;b.beginPath();b.rotate(-Math.PI/4);
b.translate(-12.3,-12.3);a=13+14*a;b.moveTo(0,0);b.lineTo(a,0);b.lineTo(a,22);b.lineTo(0,22);b.closePath();b.rotate(Math.PI/4);b.restore();b.save();b.clip();this.offContext.drawImage(this.canvas,0,0);this.context.restore();this.context.clearRect(0,0,1E3,1E3);this.context.drawImage(this.offCanvas,0,0);this.offContext.restore();this.offContext.clearRect(0,0,1E3,1E3);b.restore()};this.drawMaskLegs[bwAnnotationArrow.STYLE_CROSS]=[this.DrawCrossMaskLeg1,this.DrawCrossMaskLeg2];this.drawMaskLegs[bwAnnotationArrow.STYLE_CHECK]=
[this.DrawCheckMaskLeg1,this.DrawCheckMaskLeg2];this.EnsureOffCanvasExists=function(){if(!this.offCanvas){var a=$('<canvas class="content offcanvas" width="'+this.width+'" height="'+this.height+'"></canvas>');this.offCanvas=a.get(0);this.offContext=this.offCanvas.getContext("2d");$(document.body).append(a)}}};var bwAnnotationRectangle={DURATION_FADE:333,DURATION_STRETCH:333};
Annotation.prototype.convertToRectangle=function(){this.m_nInitAlpha=100;this.renderArrow=function(){this.getShapeObject().draw(this.context)};this.GetSegmentDuration=function(a){switch(a){case bwAnnotationAnimation.TRANS_FADE:a=bwAnnotationRectangle.DURATION_FADE;break;case bwAnnotationAnimation.TRANS_STRETCH:a=bwAnnotationRectangle.DURATION_STRETCH;break;default:a=0}return a};this.UpdateFade=function(a){this.alpha=this.m_nInitAlpha*(1-a);this.ref.css("opacity",this.alpha/100)};this.UpdateStretch=
function(a){var b=0.6+0.4*(1-a);this.context.clearRect(0,0,this.width,this.height);a=0.5*this.height*(1-b);b=0.5*this.width*(1-b);this.drawStrokedRoundRect(a,b,this.width-2*a,this.height-2*b)}};var bwAnnotationSpotlight={DURATION_DRAW_BORDER:1E3,DURATION_DRAW_SHADE:500};bwAnnotationSpotlight.DURATION_DRAW=bwAnnotationSpotlight.DURATION_DRAW_BORDER+bwAnnotationSpotlight.DURATION_DRAW_SHADE;bwAnnotationSpotlight.POSITION_TOP_RIGHT=1;bwAnnotationSpotlight.POSITION_BOTTOM_RIGHT=3;bwAnnotationSpotlight.POSITION_BOTTOM_LEFT=5;bwAnnotationSpotlight.POSITION_TOP_LEFT=7;bwAnnotationSpotlight.POSITION_TOP=0;bwAnnotationSpotlight.POSITION_RIGHT=2;bwAnnotationSpotlight.POSITION_BOTTOM=4;
bwAnnotationSpotlight.POSITION_LEFT=6;bwAnnotationSpotlight.CANVAS_PAD=4;
Annotation.prototype.convertToSpotlight=function(){this.m_nBoxRadius=this.boxradius;this.m_nWidth=this.originalWidth;this.m_nHeight=this.originalHeight;this.m_nHorizontalLength=this.originalWidth-2*this.boxradius;this.m_nVerticalLength=this.originalHeight-2*this.boxradius;this.m_nCornerLength=0.25*2*Math.PI*this.boxradius;this.m_nPerimeterLength=2*this.m_nHorizontalLength+2*this.m_nVerticalLength+4*this.m_nCornerLength;this.m_arrPositions=[bwAnnotationSpotlight.POSITION_TOP,bwAnnotationSpotlight.POSITION_TOP_RIGHT,
bwAnnotationSpotlight.POSITION_RIGHT,bwAnnotationSpotlight.POSITION_BOTTOM_RIGHT,bwAnnotationSpotlight.POSITION_BOTTOM,bwAnnotationSpotlight.POSITION_BOTTOM_LEFT,bwAnnotationSpotlight.POSITION_LEFT,bwAnnotationSpotlight.POSITION_TOP_LEFT];this.m_nCurrentFillAlpha=0;this.adjustSize=function(){this.originalX=this.x;this.originalY=this.y;this.originalWidth=this.width;this.originalHeight=this.height;this.x-=bwAnnotationSpotlight.CANVAS_PAD;this.y-=bwAnnotationSpotlight.CANVAS_PAD;this.width+=2*bwAnnotationSpotlight.CANVAS_PAD;
this.height+=2*bwAnnotationSpotlight.CANVAS_PAD};this.GetSegmentDuration=function(a){switch(a){case bwAnnotationAnimation.TRANS_DRAW:a=bwAnnotationSpotlight.DURATION_DRAW;break;default:a=0}return a};this.UpdateDraw=function(a){this.context.restore();this.context.save();this.context.clearRect(0,0,this.width,this.height);this.context.lineCap="round";this.context.translate(bwAnnotationSpotlight.CANVAS_PAD,bwAnnotationSpotlight.CANVAS_PAD);this.context.beginPath();this.context.lineWidth=this.borderwidth;
this.context.strokeStyle=this.colors.bordercolor.toColorString();this.context.moveTo(this.m_nBoxRadius,0);var b=a/0.67;1<b&&(b=1);this.m_nCurrentPerimeterLength=this.m_nLengthToDraw=b*this.m_nPerimeterLength;var c=1;1<=b?(a=(a-0.67)/0.33,1<a&&(a=1),this.DrawSpotlightMask(a),c=1-a):this.spotContext.clearRect(0,0,this.slide.width,this.slide.height);this.context.shadowOffsetX=2;this.context.shadowOffsetY=2;this.context.shadowBlur=4;this.context.shadowColor="rgba(0,0,0,"+0.5*c+")";this.DrawRoundedRect(b)};
this.DrawSpotlightMask=function(a){this.spotContext.save();this.spotContext.clearRect(0,0,this.slide.width,this.slide.height);this.spotContext.fillStyle=this.colors.fillcolor.toColorString();this.spotContext.globalAlpha=1*a;this.spotContext.fillRect(0,0,this.slide.width,this.slide.height);this.spotContext.globalAlpha=1;this.spotContext.fillStyle="rgba(0,0,0,1)";this.spotContext.globalCompositeOperation="destination-out";this.drawRoundRect(this.slideX()+bwAnnotationSpotlight.CANVAS_PAD,this.slideY()+
bwAnnotationSpotlight.CANVAS_PAD,this.originalWidth,this.originalHeight,this.spotContext);this.spotContext.fill();this.spotContext.restore()};this.DrawRoundedRect=function(){for(var a=bwAnnotationSpotlight.POSITION_TOP;0<this.m_nLengthToDraw;)0==a%2?this.DrawSide(this.m_arrPositions[a]):0<this.m_nBoxRadius?this.DrawCorner(this.m_arrPositions[a]):(a++,this.DrawSide(this.m_arrPositions[a])),a++;this.context.stroke();this.m_nCurrentPerimeterLength=this.m_nLengthToDraw=this.m_nPerimeterLength};this.DrawSide=
function(a){var b=Math.min(this.m_nLengthToDraw,a==bwAnnotationSpotlight.POSITION_TOP||a==bwAnnotationSpotlight.POSITION_BOTTOM?this.m_nHorizontalLength:this.m_nVerticalLength),c=0,d=0;switch(a){case bwAnnotationSpotlight.POSITION_TOP:c=this.m_nBoxRadius+b;d=0;break;case bwAnnotationSpotlight.POSITION_RIGHT:c=this.m_nWidth;d=this.m_nBoxRadius+b;break;case bwAnnotationSpotlight.POSITION_BOTTOM:c=this.m_nHorizontalLength-b+this.m_nBoxRadius;d=this.m_nHeight;break;case bwAnnotationSpotlight.POSITION_LEFT:c=
0,d=this.m_nVerticalLength-b+this.m_nBoxRadius}this.context.lineTo(c,d);this.m_nLengthToDraw-=b};this.DrawCorner=function(a){var b=Math.min(this.m_nLengthToDraw,this.m_nCornerLength),c=0,d=0,e=0;switch(a){case bwAnnotationSpotlight.POSITION_TOP_RIGHT:c=this.m_nWidth-this.m_nBoxRadius;d=this.m_nBoxRadius;e=Math.PI+Math.PI/2;break;case bwAnnotationSpotlight.POSITION_BOTTOM_RIGHT:c=this.m_nWidth-this.m_nBoxRadius;d=this.m_nHeight-this.m_nBoxRadius;e=0;break;case bwAnnotationSpotlight.POSITION_BOTTOM_LEFT:c=
this.m_nBoxRadius;d=this.m_nHeight-this.m_nBoxRadius;e=Math.PI/2;break;case bwAnnotationSpotlight.POSITION_TOP_LEFT:d=c=this.m_nBoxRadius,e=Math.PI}this.context.arc(c,d,this.m_nBoxRadius,e,e+b/this.m_nCornerLength*Math.PI/2);this.m_nLengthToDraw-=b}};var Resource=function(a,b,c){this.item=a;this.src=b;this.loading=this.loaded=!1;this.callback=c;this.poolImage=null};Resource.ImagePool=[];Resource.LoadedImagesLog={};Resource.TotalPixels=0;Resource.LoadedImageCount=0;Resource.PreloadThreshold=2E6;
Resource.prototype.load=function(a,b){if(!a&&0!=a)throw"undefined index "+a;var c=this;if(this.loaded||this.deferLoading)c.execCallback(b);else if(!this.loading)switch(this.item.type){case "audio":case "video":c.execCallback(b);break;default:var d=Resource.LoadedImagesLog[c.src];if(d){c.item.imageWidth=d.width;c.item.imageHeight=d.height;c.poolImage=d;c.item.imagelib&&$.each(c.item.imagelib.m_listImages,function(a,b){if(c.imgLibID==b.Id)b.width=c.item.imageWidth,b.height=c.item.imageHeight,b.imgNode=
d});c.loaded=!0;c.execCallback(b);c.unbind();break}if(!c.poolImage)c.poolImage=document.createElement("img"),c.poolImage.className="loader";c.loadHandler=function(){if(c.poolImage){c.item.imageWidth=c.poolImage.width||c.poolImage.naturalWidth;c.item.imageHeight=c.poolImage.height||c.poolImage.naturalHeight;Resource.LoadedImagesLog[c.src]=c.poolImage;Resource.TotalPixels+=c.item.imageWidth*c.item.imageHeight;Resource.LoadedImageCount++;c.loading=!1;if(!c.loaded)c.loaded=!0,c.execCallback(b);c.unbind()}};
c.errorHandler=function(){c.item.ref&&c.item.ref.addClass("missing");c.loaded=!0;c.execCallback(b);c.unbind();return!1};c.poolImage.addEventListener("load",c.loadHandler,!1);c.poolImage.addEventListener("error",c.errorHandler,!1);c.timeout=setTimeout(function(){if(!c.loaded)c.item.ref&&c.item.ref.addClass("missing"),c.loaded=!0,c.execCallback(b);c.unbind()},1E4);c.poolImage.src=c.src;this.loading=!0}};
Resource.prototype.unload=function(a){if(this.src)switch(this.item.type){case "audio":case "video":this.execCallback(a);break;default:this.unbind(),delete Resource.LoadedImagesLog[this.src],delete this.poolImage,this.loaded=!1}};Resource.prototype.unbind=function(){this.poolImage&&(this.poolImage.removeEventListener("load",this.loadHandler,!1),this.poolImage.removeEventListener("error",this.errorHandler,!1),clearTimeout(this.timeout))};
Resource.prototype.execCallback=function(a){a&&a(this);this.callback&&this.callback(this)};var TimelineEvent=function(a,b,c){this.eventInfo=new EventInfo("TimelineEvent",-1,a,!1);this.actions=[];this.loadFromXML(b,c)};TimelineEvent.prototype.loadFromXML=function(a,b){var c=this;this.eventInfo.time=parseInt($(b).attr("time"));$(b).children("actions").children().each(function(b,e){var f=new TimelineAction(a);f.loadFromXML(e,c);c.actions.push(f)})};
TimelineEvent.prototype.triggerEvent=function(a){this.eventInfo.isUserInitiated=!1;EventLogger.logBeginEvent(this,null);var b=!0;player.currentTimelineEvent=this;for(var c=0;c<this.actions.length&&b;c++)b=this.actions[c].performAction(this.eventInfo,a);player.currentTimelineEvent=null;EventLogger.logEndEvent(null)};TimelineEvent.prototype.revert=function(a){for(var b=0;b<this.actions.length;b++)this.actions[b].revert(a)};
TimelineEvent.prototype.destroy=function(){this.eventInfo=null;for(var a=0;a<this.actions.length;a++)this.actions[a].destroy();this.actions=[]};var TimelineAction=function(a){this.type="show";this.item=this.transition=null;this.xml="";this.variables={};this.parentElement=a};TimelineAction.actparams={};TimelineAction.prototype.loadFromXML=function(a){this.type=a.tagName.toLowerCase();this.xml=a};TimelineAction.prototype.getItem=function(){var a=this.item;if(!a){var b=this.parentElement.parseObjrefFromXML(this.xml),a=b.target||this.parentElement;if(b.success&&!b.isVariableRef)this.item=a}return a};
TimelineAction.prototype.getTransition=function(){if(!this.transition){var a=this.getItem();this.transition=new Transition;this.transition.loadFromXML(this.xml,a)}return this.transition};TimelineAction.prototype.performAction=function(a,b){var c=!0;EventLogger.logBeginAction(this);c="function"===typeof this[this.type]?this[this.type](a,b):this.parentElement.runAction(this.xml,a);EventLogger.logEndAction();return c};
TimelineAction.prototype.revert=function(a){var b=this.getItem();b&&a&&"show"==this.type&&b.reset(!0)};TimelineAction.prototype.destroy=function(){this.xml=this.item=this.transition=null;this.variables={};this.parentElement=null};TimelineAction.prototype.show=function(a,b,c){var d=!0,e=this.getItem();if(e){var f=this.getTransition();c&&(f=null);if("Slide"==e.innerType)return!0;"SlideFrame"==e.innerType&&(d=!1);e.show(a,f,b,c)}return d};
TimelineAction.prototype.hide=function(a,b,c){if(b=this.getItem()){var d=this.getTransition();c&&(d=null);b.hide(a,d)}return!0};TimelineAction.prototype.hideallslidelayers=function(){$(".layer").hide();$.each(player.currentSlide().layers,function(a,b){b.hide()});return!0};TimelineAction.prototype.hide_slidelayer=function(){var a=this.getItem();a.hide(this.getTransition());a.transitioning&&a.ref.hide();return!0};
TimelineAction.prototype.show_slidelayer=function(a){var b=this.getItem();b.hideOthers=$(this.xml).attr("hideothers");var c=new Transition(b);c.loadFromXML(this.xml);b.show(a,c);return!0};
TimelineAction.prototype.media_seek=function(a,b){if(b)return!0;var c=this.getItem();if(c&&c.setCurrentTime){c.syncToTimeline="TimelineEvent"==a.type;var d=parseInt($(this.xml).attr("position"));c.shouldSetPosition=!1;if(parseInt(1E3*c.getCurrentTime())!=d){c.correctedPosition=d;c.shouldSetPosition=!0;try{c.setCurrentTime(d/1E3),c.shouldSetPosition=!1}catch(e){setTimeout(function(){c.shouldSetPosition=!1},100)}}}return!0};
TimelineAction.prototype.set_volume=function(){var a=this.getItem(),b=parseInt($(this.xml).attr("volume"));player.clipVolume=b/100;b=util.min(b,100);b=util.max(b,0);a.setVolume(b/100*player.volumeSlider.volume/100);return!0};TimelineAction.prototype.media_toggle=function(a,b){if(b)return!0;var c=this.getItem();if(c)c.getIsPlaying()?(c.media_toggled=!1,this.media_pause(a)):(c.media_toggled=!0,this.media_play(a));return!0};
TimelineAction.prototype.media_play=function(a,b){var c=this.getItem();if(c){c.syncToTimeline="TimelineEvent"==a.type;c.setMediaSyncInfo&&c.setMediaSyncInfo(a);if(b)return c.timelineSetup(),!0;c.playClip&&c.playClip()}return!0};TimelineAction.prototype.media_pause=function(a){var b=this.getItem();if(b&&b.pauseClip)b.syncToTimeline="TimelineEvent"==a.type,b.pauseClip();return!0};
TimelineAction.prototype.move=function(a){var b=this.getItem();if(!b)return!0;this.animation=new Animation;this.animation.loadFromXML(this.xml,b);var c=new bwTweenEvent(b,this.xml,0,0),d=new bwTweenPosition(this.m_oTarget,this.xml);c.m_oPositionTween=d;c.m_nStartTime=0;this.animation.bwa.m_arrTweens.push(c);this.id="move"+Math.random();this.animation.start(b,!1,a,function(){b.handleEvent("onmovecomplete")});if(a&&"StoryEvent"==a.type&&a.isUserInitiated)b.actionMoved=!0;return!0};
TimelineAction.prototype.zoompan=function(a){var b=this.getItem();if(!this.zoomPanObj)this.zoomPanObj=new ZoomPan,this.zoomPanObj.loadFromXML(this.xml),this.zoomPanObj.toAnimation(this.xml,b);this.id="zoompan"+Math.random();b.pushAnimation(this.zoomPanObj.animation);this.zoomPanObj.animation.start(b,!1,a,function(){b.animatingZoomPan=!1});return b.animatingZoomPan=!0};
TimelineAction.prototype.object_action=function(){var a=$(this.xml).attr("command"),b=this.getItem();if("function"==typeof b[a])return b[a](this.xml),!0;switch(a){case "togglecontent":b.visible?b.hide():b.show();break;case "hidecomplete":b.hide();break;case "showtitle":break;case "hidetitle":break;default:console.error("unknown object_action command",a)}return!0};
TimelineAction.prototype.adjustvar=function(a,b,c){var c=c||$(this.xml).attr("variable"),d=this.parentElement;if(0==c.indexOf("_children."))for(var e in d.children){var f=c.replace("_children.",e+".");this.adjustvar(a,b,f)}else{e=$(this.xml).attr("operator");b=$(this.xml).children("value").attr("type");f=$(this.xml).children("value").attr("value");switch(e){case "toggle":f="true"==d.extractVariable(c)?"false":"true";break;case "add":a=d.extractVariable(f,b);e=d.extractVariable(c);"number"==b?(e=parseFloat(e),
a=parseFloat(a),isNaN(e)&&(e=0),isNaN(a)&&(a=0)):"var"==b&&!isNaN(parseFloat(a))&&(e=parseFloat(e),a=parseFloat(a),isNaN(e)&&(e=0));f=e+a;break;case "sub":a=d.extractVariable(f,b);e=parseFloat(d.extractVariable(c));isNaN(e)&&(e=0);f=e-parseFloat(a);break;case "mult":a=d.extractVariable(f,b);e=parseFloat(d.extractVariable(c));isNaN(e)&&(e=0);f=e*parseFloat(a);break;case "div":a=d.extractVariable(f,b);e=parseFloat(d.extractVariable(c));isNaN(e)&&(e=0);f=e/parseFloat(a);isNaN(f)&&(f=0);break;case "set":f=
$(this.xml).children("value").attr("value");if("property"==b||"variable"==b||"var"==b)f=d.extractVariable(f,b);"number"==b&&(f=parseFloat(f));break;default:console.error("unknown adjustvar operator",e,a,d.id)}d||(d=story);d.setVariable(c,f)}return!0};TimelineAction.prototype.exe_actiongroup=function(a){var b=$(this.xml).attr("id"),c=this.parentElement,d=c.runActionGroup(b,a);d&&c.group&&(d=c.group.runActionGroup(b,a));return d};
TimelineAction.prototype.HandleBoundVarChanged=function(){this.getItem().HandleBoundVarChanged(null,!0,null,"TimelineAction.prototype.HandleBoundVarChanged");return!0};var StoryEvent=function(a){this.eventInfo=new EventInfo("StoryEvent",-1,null,!0);this.actions=[];this.trigger="";this.parentElement=a};
StoryEvent.prototype.loadFromXML=function(a){var b=this;this.trigger=a.tagName.toLowerCase();this.xml=a;$(a).children("actions").children().each(function(a,c){var f=new TimelineAction(b.parentElement);f.loadFromXML(c,b);b.actions.push(f)});switch(b.trigger){case "onvarchanged":case "onpropchanged":var c=$(a).attr("varname");c||(c=$(a).attr("propname"));a=parseInt($(a).attr("priority"));isNaN(a)&&(a=0);c=this.parentElement.parseObjref(c);b.varname=c.variable;b.filter=function(a){return void 0===a?
void 0:a==b.varname};c.target.registerVariableEventSubscriber(this.parentElement,c.variable,a);break;case "onobjectevent":b.eventname=$(a).attr("eventname");b.filter=function(a){return a==b.eventname};break;case "onkeypress":b.keyCode=$(a).attr("keycode");b.shiftKey="true"==$(a).attr("shift");b.ctrlKey="true"==$(a).attr("ctrl");b.altKey="true"==$(a).attr("alt");b.filter=function(a){var c=a.keyCode==b.keyCode&&a.shiftKey==b.shiftKey&&a.ctrlKey==b.ctrlKey&&a.altKey==b.altKey;c&&13==a.keyCode&&a.target.blur();
return c};break;case "onlinkrelease":b.triggerid=$(a).attr("triggerid");b.filter=function(a){return a==b.triggerid};break;default:b.filter=function(){return!0}}};StoryEvent.prototype.triggerEvent=function(a,b,c){var d=c||this.eventInfo;d.isUserInitiated=b;EventLogger.logBeginEvent(this,a);var e=!0;$.each(this.actions,function(a,b){e&&(e=b.performAction(d,!1,!1))});EventLogger.logEndEvent(a);return e};var Background=function(a){this.container=a||$(document.body);this.backgroundType="fill";this.fillType="linear";this.stops=[]};
Background.prototype.loadFromXML=function(a,b){var c=this;c.backgroundType=b||$(a).attr("type");switch(this.backgroundType){case "fill":c.rotation=$(a).children("fill").attr("rotation");c.fillType=$(a).children("fill").attr("type");c.stops=[];var d=$(a).attr("url");if(d)c.src=player.basepath+"mobile/"+d;$(a).children("fill").children("colors").children("color").each(function(a,b){var d=c.parseStop(b);c.stops.push(d)});break;case "swf":c.src=player.basepath+""+$(a).children("imagedata").attr("url").replace(globals.strContentFolder,
"mobile").replace(".swf",".jpg");break;case "vector":d=$(a).children("vectordata"),c.state={left:d.attr("left"),top:d.attr("top"),right:d.attr("right"),bottom:d.attr("bottom"),path:PathLib.getPathFromXML(d.children("pr"))},c.rectShape=new ppRect(c.state.left,c.state.top,c.state.right,c.state.bottom)}};
Background.prototype.parseStop=function(a){return{rawcolor:$(a).attr("rgb").replace("0x","#"),color:Background.parseRGBA($(a).attr("rgb"),$(a).attr("alpha")),stop:parseInt($(a).attr("stop"))/255,alpha:parseInt($(a).attr("alpha"))/100}};Background.parseRGBA=function(a,b){var c=Frame.parseRGB(a.replace("0x","#"));c.push(parseInt(b)/100);return"rgba("+c.join(",")+")"};Background.prototype.colorStops=function(){var a="";$.each(this.stops,function(b,c){""!=a&&(a+=",");a+=c.color+" "+100*c.stop+"%"});return a};
Background.prototype.toColorString=function(){return this.stops[0].color};Background.prototype.toCssString=function(){switch(this.backgroundType){case "fill":return 0==this.stops.length&&this.src?"transparent url("+this.src+") no-repeat":1==this.stops.length?this.stops[0].color:"-webkit-linear-gradient("+((parseInt(this.rotation)+180)%360+"deg")+", "+this.colorStops()+")";case "swf":return"transparent url("+this.src+") no-repeat"}};
Background.prototype.toCss=function(){if(player.noImg)return{};var a={};switch(this.backgroundType){case "fill":if(0==this.stops.length&&this.src)a.background="transparent url("+escape(this.src)+") no-repeat";else if(1==this.stops.length)a.background=this.stops[0].color;else{var b=(parseInt(this.rotation)+180)%360+"deg";a.background="-webkit-linear-gradient("+b+", "+this.colorStops()+")"}break;case "swf":a.background="transparent url("+escape(this.src)+") no-repeat";break;case "vector":if(this.generateVectorSrc(),
a.background="transparent url("+this.src+") no-repeat",this.m_nXOffset||this.m_nYOffset)a["background-position"]=this.m_nXOffset+"px "+this.m_nYOffset+"px"}return a};
Background.prototype.generateVectorSrc=function(){if(!this.src)this.canvas=document.createElement("canvas"),this.canvas.width=this.state.right,this.canvas.height=this.state.bottom,this.rotation=this.m_nYOffset=this.m_nXOffset=0,this.height=this.width=1E3,ppArt.DrawVector(this,this.state.path,null,player.fontlib,this.imagelib,null),this.src=this.canvas.toDataURL("image/png"),this.canvas=null};
Background.prototype.apply=function(a){this.container=a||this.container;var b=this;$.each(this.toCss(),function(a,d){$(b.container).css(a,d);if(0==d.indexOf("-webkit-")){var e=d.substr(8);$(b.container).css(a,"-o-"+e);$(b.container).css(a,"-moz-"+e);$(b.container).css(a,"-ms-"+e)}})};Background.prototype.toCanvasGradient=function(a,b){var c=a.createLinearGradient(0,0,0,b);$.each(this.stops,function(a,b){c.addColorStop(b.stop,b.color)});return c};
Background.prototype.applyCanvas=function(a,b,c,d){var e,b=ppArt.GetGradientLine(0,0,b.width,b.height,this.rotation);e=a.createLinearGradient(b.x1,b.y1,b.x2,b.y2);$.each(this.stops,function(a,b){e.addColorStop(b.stop,b.color)});if(c)a.fillStyle=e;if(d)a.strokeStyle=e};var SlideBank=function(){this.constructElement();this.id="_slidebank_"+SlideBank.index;SlideBank.index++;this.bankSlideIndex=0};SlideBank.prototype=new Element;SlideBank.prototype.objectType="SlideBank";SlideBank.prototype.innerType="SlideBank";SlideBank.index=0;
SlideBank.prototype.loadFromXML=function(a){var b=this;this.children={};$(a).children("slides").children("slide").each(function(a,d){var e=new Slide(story.container);e.loadFromXML($(d));e.parent=b;story.allSlides.push(e);story.slideLookup[e.id]=e;b.children[e.id]=e;e.slideIndex=story.allSlides.length-1;e.bankSlideIndex=b.bankSlideIndex++})};var SlideDraw=function(){this.constructElement();this.interactions={};this.exitActions=[];this.draw=[];this.orderedChildren=[];this.navLinks=[];this.sceneDrawIndex=this.drawIndex=0;this.quiz=null;this.populated=this.created=!1};SlideDraw.NextSlideIndex=0;SlideDraw.drawNavData={};SlideDraw.prototype=new Element;SlideDraw.prototype.objectType="SlideDraw";SlideDraw.prototype.innerType="SlideDraw";SlideDraw.prototype.getRandomMember=ShuffleGroup.prototype.getRandomMember;
SlideDraw.prototype.getRandomIndex=ShuffleGroup.prototype.getRandomIndex;SlideDraw.populateDraws=function(){$.each(story.children,function(a,b){"Scene"==b.innerType&&b.populateDraws()});player.calculateTotalViewSlides();player.frame.updateMenuData(SlideDraw.drawNavData,null)};
SlideDraw.resetDraws=function(){$.each(story.children,function(a,b){"Scene"==b.innerType&&b.resetDraws()});SlideDraw.NextSlideIndex=0;for(var a=story.allSlides.splice(story.lastNonDrawSlideIndex,story.allSlides.length-story.lastNonDrawSlideIndex),b=0;b<a.length;b++){var c=a[b];c.destroyRef();c.reduce()}};SlideDraw.addNavData=function(a){$.extend(this.drawNavData,a)};
SlideDraw.prototype.restoreFromResumeData=function(a){this.compactResumeData=bwChunk.CreateChunk(a);a=new bwChunk(a);for(this.draw=[];!a.EOF();){var b=a.NextUBase10(2),c=this.refs[b];c?this.draw.push(c):console.warn("invalid draw index on resume",this.draw,b)}b={};b[this.getFullObjref(!0)]=this.populateDraw();SlideDraw.addNavData(b);b=0;for(a=a.NextChunk();!a.isNothing;)c=this.orderedChildren[b],c.compactResumeData=a.ChunkData(),c.restoreFromResumeData(a.ChunkData(),!0),b++,a=a.NextChunk()};
SlideDraw.prototype.getResumeData=function(){var a="",b="";$.each(this.orderedChildren,function(c,e){a+=bwChunk.UBase10toN(e.drawListIndex,2);b=e.compactResumeData?b+e.compactResumeData:b+bwChunk.EMPTY_CHUNK});var c=bwChunk.CreateChunk(bwChunk.CreateChunk(a)+b);this.compactResumeData=c;this.parent.compactResumeData=this.parent.getResumeData();return c};SlideDraw.prototype.toBaseData=Element.prototype.toData;SlideDraw.prototype.toData=function(a){a=this.toBaseData(a);a.draw=this.draw;return a};
SlideDraw.prototype.updateBaseFromData=Element.prototype.updateFromData;SlideDraw.prototype.updateFromData=function(a){this.updateBaseFromData(a);if(a.draw)this.draw=a.draw,this.populateDraw()};
SlideDraw.prototype.loadFromXML=function(a){var b=this;this.id=$(a).attr("id");this.lmsid=$(a).attr("lmsid");this.shuffle="true"==$(a).attr("shuffle");this.shufflecount=parseInt($(a).attr("shufflecount"));this.navindex=parseInt($(a).attr("navindex"));b.variables.Id=$(a).attr("id");b.variableDefaults.Id=$(a).attr("id");b.variables.WindowId="_frame";b.variableDefaults.WindowId="_frame";$(a).children("exitaction").children().each(function(a,d){var e=new TimelineAction(b);e.loadFromXML(d,b);b.exitActions.push(e)});
this.refs=[];$(a).children("sliderefs").children("slideref").each(function(a,d){var e={id:$(d).attr("id"),index:a,shuffleinclude:"true"==$(d).attr("shuffleinclude"),linknext:"true"==$(d).attr("linknext"),linkprev:"true"==$(d).attr("linkprev"),skipreview:"true"==$(d).attr("skipreview"),showinmenu:"true"==$(d).attr("showinmenu")};b.refs.push(e)})};
SlideDraw.prototype.createDraw=function(){if(this.shuffle){var a=this;this.draw=[];for(var b=[],c=[],d=[];0<this.refs.length&&this.refs[0].linkprev;){var e=this.refs.shift();a.draw.push(e)}for(;0<this.refs.length&&this.refs[this.refs.length-1].linknext;)d.unshift(this.refs.pop());$.each(this.refs,function(a,d){c.push(d);d.linknext||(b.push(c),c=[])});for(e=0;a.draw.length+d.length<this.shufflecount&&0<b.length&&100>e++;){var f=this.shufflecount-a.draw.length-d.length,g=a.getRandomIndex(b),h=b[g];
h.length<=f&&($.each(h,function(b,c){a.draw.push(c)}),b.splice(g,1))}if(100<=e&&0<b.length){var j=1E3,j=null;$.each(b,function(a,b){if(!j||j.length>b.length)j=b});$.each(j,function(b,c){a.draw.push(c)})}for(;0<d.length;)a.draw.push(d.shift());this.created=!0}else this.createDrawUnshuffled()};SlideDraw.prototype.createDrawUnshuffled=function(){for(this.draw=[];this.refs.length;)this.draw.push(this.refs.shift())};SlideDraw.prototype.getQuiz=function(){return this.quiz};
SlideDraw.prototype.populateDraw=function(){var a=this;this.children={};var b=[];$.each(this.draw,function(c,d){var e=d.id,f=story.slideLookup[e],g=new Slide(f.container);g.loadFromXML($(f.xml));g.parent=a;g.slideBank=a;story.allSlides.push(g);player.slideLoadQueue.push(story.allSlides.length-1);g.originalSlideIndex=g.slideIndex;g.drawSlideIndex=c;g.slideIndex=story.allSlides.length-1;g.slideIndexForResume=SlideDraw.NextSlideIndex++;g.sceneIndex=a.parent.sceneIndex;g.drawIndex=a.sceneDrawIndex;g.navindex=
a.navindex;g.skipreview=d.skipreview;g.showinmenu=d.showinmenu;g.bankSlideIndex=f.bankSlideIndex;g.drawListIndex=d.index;a.children[e]=g;a.orderedChildren.push(g);b.push(g.getNavPack())});player.slideLoadQueue.restart();this.populated=!0;return b};SlideDraw.prototype.showFirst=function(){player.currentDraw=this;var a=this.getFirstSlide();this.parent.compactResumeData=this.parent.getResumeData();player.showSlideIndex(a.slideIndex,null,!0)};
SlideDraw.prototype.getFirstSlide=function(){this.drawIndex=0;player.currentDraw=this;0==this.draw.length&&SlideDraw.populateDraws();return this.children[this.draw[this.drawIndex].id]};SlideDraw.prototype.getFirstSpecifiedSlide=function(){return story.slideLookup[this.refs[0].id]};
SlideDraw.prototype.playnextdrawslide=function(){function a(){10<c++||b.fullyLoaded?player.currentWindow?player.currentWindow.showSlide(b,!1):player.showSlideIndex(b.slideIndex,null,!0):setTimeout(a,200)}player.currentDraw=this;0==this.draw.length&&SlideDraw.populateDraws();if(player.currentSlide().parent==this)this.drawIndex=player.currentSlide().drawSlideIndex;this.drawIndex++;if(this.drawIndex>=this.draw.length)player.currentSlide().saveIfNecessary(),this.fireExitActions();else{var b=this.children[this.draw[this.drawIndex].id];
b.loadContentFromXML();var c=0;a()}};SlideDraw.prototype.fireExitActions=function(){var a=this;$.each(this.exitActions,function(b,c){c.performAction(a,!1,!1)})};SlideDraw.prototype.sniffDrawIndex=function(a){var b=this;$.each(this.draw,function(c,d){if(d==a.id)b.drawIndex=c})};SlideDraw.prototype.resetSlide=function(a,b){$.each(this.children,function(c,d){d.resetSlide(a,b)});this.compactResumeData=""};
SlideDraw.prototype.resetDraw=function(){var a=this;$.each(this.children,function(b,c){c.destroyRef();c.reduce();delete a[b]});this.compactResumeData="";this.interactions={};this.exitActions=[];this.draw=[];this.orderedChildren=[];this.navLinks=[];this.sceneDrawIndex=this.drawIndex=0;this.quiz=null;this.populated=this.created=!1};var SlideListNode=function(a,b){if(!b)b={},this.isRoot=!0;this.parent=a;this.link=b;this.children=[];this.listitems=[];this.expanded=!0;if(!b.nodes)b.nodes=[];b.nodes.push(this)};SlideListNode.traverse=function(a,b){b(a);for(var c=0;c<a.children.length;c++)SlideListNode.traverse(a.children[c],b)};SlideListNode.prototype.find=function(a){var b=null;SlideListNode.traverse(this,function(c){if(c.slideid==a||c.actionlinkid==a)b=c});return b};SlideListNode.prototype.push=function(a){this.children.push(a)};
SlideListNode.prototype.hasChildren=function(){return 0<this.children.length};SlideListNode.prototype.toggleExpand=function(){this.hasChildren()&&(this.expanded?this.collapse():this.expand(),this.updateDescendants())};SlideListNode.prototype.expand=function(){this.expanded=!0};SlideListNode.prototype.collapse=function(a){a&&$.each(this.children,function(a,c){c.collapse(!0,!0)});this.expanded=!1};SlideListNode.prototype.show=function(){$.each(this.listitems,function(a,b){b.show()})};
SlideListNode.prototype.hide=function(){$.each(this.listitems,function(a,b){b.hide()})};SlideListNode.prototype.updateDescendants=function(a){var b=a||!this.expanded;$.each(this.children,function(a,d){b?d.hide():d.show();0<d.children.length&&!b&&d.expanded&&d.expand();d.updateDescendants(b)});this.expanded?$.each(this.listitems,function(a,b){b.addClass("open")}):$.each(this.listitems,function(a,b){b.removeClass("open")})};var SlideList=function(a){this.container=a||$(document.body);this.ref=null;this.ref=$("#menu_container");this.contentRef=$("#slide_list");this.closed=!1;this.tree=new SlideListNode;player.simplenav&&(this.contentRef.removeClass("menu_list"),this.contentRef.addClass("slidelist"))};SlideList.arrDepthIndents=[];
SlideList.SetDepth=function(a,b,c){var d=12*b,c=SlideList.GetStringWidth(""+c),e=""+b+"_"+(""+c);if(0>SlideList.arrDepthIndents.indexOf(e)){if(!SlideList.styleSheet)SlideList.styleSheet=new CustomStyleSheet;var f="ul.slidelist li.depth"+e,g=player.frame.rtl?"right":"left",h=player.frame.rtl?"padding-right":"padding-left";SlideList.styleSheet.add(f,h,d+c+6+"px");0<c?(SlideList.styleSheet.add(f,"text-indent",b-c+4+"px"),SlideList.styleSheet.add(f+".has_children","text-indent",-(c+12)+"px"),SlideList.styleSheet.add(f+
".has_children>span",g,-(9*(b-1)+23)+"px"),SlideList.styleSheet.add(f+".has_children.open>span",g,-(9*(b-1)+25)+"px")):SlideList.styleSheet.add(f+".has_children",h,d-10+"px");SlideList.styleSheet.add(f+".correct:before",g,213-d+"px");SlideList.styleSheet.add(f+".incorrect:before",g,213-d+"px");SlideList.styleSheet.add(".toptab"+f+".correct:before",g,270-d+"px");SlideList.styleSheet.add(".toptab"+f+".incorrect:before",g,270-d+"px");SlideList.styleSheet.build();SlideList.arrDepthIndents.push(e)}a.addClass("depth"+
e)};SlideList.GetStringWidth=function(a){var b=0;if(a){var b=$("ul.slidelist").css("font-size")+" "+$("ul.slidelist").css("font-family"),c=player.frame.rtl?"right":"left",a=$("<div>"+a+"</div>").css({position:"absolute","float":c,"white-space":"nowrap",visibility:"hidden",font:b}).appendTo($("body")),b=a.width();a.remove()}return b};
SlideList.prototype.build=function(a,b,c,d,e){var f=this,b=b||f.contentRef,c=c||"",d=d||1,e=e||new SlideListNode;f.hasBuilt=!0;if(!player.frame.options.levelrestriction)player.frame.options.levelrestriction=Frame.LEVEL_RESTRICTION_UNRESTRICTED;if(!player.frame.options.levelbehavior)player.frame.options.levelbehavior=Frame.LEVEL_BEHAVIOR_INSIDE;for(var g=function(a,c){var g=a.displaytext;c&&(g=c+" "+g);var h=$("<li>"+g+"</li>");a.slideid?h.attr("id",a.slideid):a.drawid&&h.attr("id",a.drawid);SlideList.SetDepth(h,
d,c);var j=new SlideListNode(e,a);e.push(j);h.toggleExpand=function(){j.toggleExpand();return!1};h.click(function(b){if(f.scroll.moved||player.currentWindow&&"MessageWnd"==player.currentWindow.id)return!1;if(h.hasClass("has_children")&&1==h.children("span").length){var c=h.children("span").position().left;if(b.offsetX<c+10&&!h.hasClass("neither"))return h.toggleExpand()}if($(this).hasClass("selected")||$(this).hasClass("locked")||player.frame.options.flow==Frame.FLOW_LOCKED)return!1;if(a.actionlinkid)return player.frame.followActionLink(a.actionlinkid,
player.frame.options.flow),!1;player.frame.followSlideLink(a.slideid,player.frame.options.flow);return!1});b.append(h);a.links&&(g=$("<span/>"),h.prepend(g),h.addClass("has_children open"),player.frame.options.levelrestriction!=Frame.LEVEL_RESTRICTION_UNRESTRICTED&&h.addClass("neither"),f.build(a.links,b,c,d+1,j));player.frame.options.enableresultsicons&&(g=player.frame.slideStatus[a.slideid])&&g.status&&h.addClass(g.status);j.listitems.push(h);a.expand||h.toggleExpand();g=a.slideid.replace("_player.",
"");player.listSlidesViewed[g]&&f.markVisited(a.slideid)},h=player.frame.options.autonumber,j=0,l,m=0;m<a.length;m++){var k=a[m];if(k.drawid){if(k=player.frame.drawNavData[k.drawid])for(var n=0;n<k.length;n++){var p=k[n];p.showinmenu&&(l=h?c+(j+1)+".":"",g({slideid:p.slideid,displaytext:p.title,expand:!0,parent:e},l),j++)}}else l=h?c+(m+1)+".":"",g(k,l)}};SlideList.prototype.toggle=function(){this.visible?this.hide():this.show()};
SlideList.prototype.show=function(){if(!this.visible)this.visible=!0,Transition.applyCss({"-webkit-transition-property":"none","-webkit-transition-duration":"0ms",opacity:1,display:"block"},this.portraitContainer),$("#control-menu").addClass("active"),this.refresh(),this.scrollSelectedIntoView(1)};SlideList.prototype.hide=function(){if(this.visible)this.visible=!1,this.portraitContainer.hide(),$("#control-menu").removeClass("active")};SlideList.prototype.refresh=function(){this.scroll={moved:!1}};
SlideList.prototype.scrollSelectedIntoView=function(a){a=isNaN(a)?500:a;$(".slidelist .selected").each(function(a,c){var d=$(c).closest(".slidelist"),e=$(c).position().top,f=$(c).height(),g=d.position().top,h=d.parent().height(),j=d.parent().get(0).scrollTop,l=e-g-f,e=e-g-h+2*f;if(j<e)d.parent().get(0).scrollTop=e;if(j>l)d.parent().get(0).scrollTop=l})};SlideList.prototype.markNode=function(a,b){a.listitems&&$.each(a.listitems,function(a,d){d.addClass(b)})};
SlideList.prototype.markVisited=function(a){var b=this,c=null;SlideListNode.traverse(this.tree,function(d){if(d.link.slideid&&-1<a.indexOf(d.link.slideid)||d.link.actionlinkid&&-1<a.indexOf(d.link.actionlinkid)){b.markNode(d,"visited");var e=d.link.slideid||d.link.actionlinkid,f=c?c.link.slideid||c.link.actionlinkid:"";if(e==a||!c||e.length>f.length)c=d}});return c};
SlideList.prototype.markSelectedVisited=function(a){$("ul.menu_list li").removeClass("selected");$("ul.slidelist li").removeClass("selected");(a=this.markVisited(a))&&this.markNode(a,"selected");return a};SlideList.parseDepth=function(a){var b=-1;if(a.get(0).classList)for(var c in a.get(0).classList){var d=a.get(0).classList[c];d&&d.indexOf&&0==d.indexOf("depth")&&(b=parseInt(d.replace("depth","")))}return b};
SlideList.prototype.collapseSections=function(a,b,c){if(Frame.navLinks&&player.frame.slideList&&b){for(a=c;a&&a.parent&&!a.parent.isRoot;)a=a.parent;player.frame.options.autocollapse&&a&&a.collapse();if(player.frame.options.levelrestriction==Frame.LEVEL_BEHAVIOR_INSIDE&&player.frame.options.levelbehavior==Frame.LEVEL_BEHAVIOR_REACHED)player.frame.options.levelbehavior=Frame.LEVEL_BEHAVIOR_INSIDE;a=player.frame.options.levelbehavior==Frame.LEVEL_BEHAVIOR_INSIDE?b:null;for(c=player.frame.options.levelrestriction==
Frame.LEVEL_BEHAVIOR_INSIDE?b:null;b&&!b.isRoot;)player.frame.options.levelbehavior!=Frame.LEVEL_BEHAVIOR_MANUAL&&b!=a&&b.expand(),b!=c&&$.each(b.listitems,function(a,b){b.removeClass("neither")}),b=b.parent;player.frame.slideList.tree.updateDescendants()}};SlideList.prototype.collapseAll=function(){this.tree.collapse(!0);this.tree.expand();this.tree.updateDescendants()};
SlideList.shorten=function(a,b){if(a.length>b){for(var c=a.substr(0,b-3),d=c.length-1;0<d;d--)if(" "==c.substr(d,1))return c.substr(0,d)+"&hellip;";return"&hellip;"}return a};var FileList=function(a){this.container=a||$(document.body);this.ref=null;this.loaded=this.visible=!1;this.ref=$('<div id="filelist"><div id="filelistscroll"></div></div>');this.contentRef=this.ref.children("#filelistscroll");this.container.append(this.ref)};
FileList.prototype.load=function(){var a=this;$.ajax({url:"/ListFiles.aspx",dataType:"xml",success:function(b){a.contentRef.empty();var c=$('<ul class="navlist"><li tabindex="0" class="divider">Open<span class="icon icon-x"></span></li></ul>');c.find(".divider").click(function(){a.hide()});$(b).find("file").each(function(b,e){var f=$(e).attr("name"),g=$('<li tabindex="-1">'+f+'<span class="icon icon-r"></span></li>');g.click(function(){if(!a.scroll.moved)player.basepath=f,player.load(function(){$("#slideframe").css("opacity",
"1.0");player.setSlideIndex(0);player.restart();$(".slide").show()}),a.hide()});c.append(g)});a.contentRef.append(c);a.contentRef.append($('<br style="clear:both;">'))},error:function(){}})};
FileList.prototype.addScene=function(a,b){var c=$('<ul class="navlist"><li tabindex="0" class="divider">'+b+"</li></ul>");$.each(a,function(a,b){var f=$('<li tabindex="-1">'+b.title+'<span class="icon-r"></span></li>');f.click(function(){player.showSlideIndex(a,"pan"==player.animations?2:null,!0);player.frame.slideList.hide()});c.append(f)});this.contentRef.append(c)};
FileList.prototype.show=function(){if(!this.visible){this.visible=!0;this.load();var a=this,b={"-webkit-transition-property":"-webkit-transform, opacity","-webkit-transition-duration":"400ms","-webkit-transform-origin":"center center","-webkit-transition-timing-function":"ease-out","-webkit-transform":"translate3d(0px,0px,0px) scale(1) rotate(0)"};this.ref.show();Transition.applyCss({"-webkit-transition-property":"-webkit-transform, opacity","-webkit-transition-duration":"0ms","-webkit-transform-origin":"center center",
"-webkit-transition-timing-function":"ease-in","-webkit-transform":"translate3d(0px,-100%,0px) scale(1) rotate(0)"},this.ref);setTimeout(function(){a.ref.unbind("webkitTransitionEnd");a.ref.bind("webkitTransitionEnd",function(){a.ref.unbind("webkitTransitionEnd");a.refresh()});Transition.applyCss(b,a.ref);a.refresh()},0)}};
FileList.prototype.hide=function(){var a=this;if(this.visible)this.visible=!1,this.ref.unbind("webkitTransitionEnd"),this.ref.bind("webkitTransitionEnd",function(){a.ref.unbind("webkitTransitionEnd")}),Transition.applyCss({"-webkit-transition-property":"-webkit-transform, opacity","-webkit-transition-duration":"200ms","-webkit-transform-origin":"center center","-webkit-transition-timing-function":"ease-in","-webkit-transform":"translate3d(0px,-100%,0px) scale(1) rotate(0)"},this.ref)};
FileList.prototype.refresh=function(){if(!this.scroll)this.scroll=new iScroll("filelistscroll",{desktopCompatibility:!0});this.scroll.refresh()};var Transition=function(a){this.target=null;this.transition=Transition.TransType.appear;this.duration=0;this.direction=1;this.reverse=this.pan=this.wipe=!1;this.runCount=0;this.hasContext=!1;a&&this.setTarget(a)};Transition.TransType={appear:"appear",fly:"fly",fade:"fade",grow:"grow",spin:"spin",custom:"custom",tween:"tween"};
Transition.Direction={1:{getLeft:function(a){return-a.targetWidth},getTop:function(a,b){return b}},2:{getLeft:function(a){return a.containerWidth},getTop:function(a,b){return b}},4:{getLeft:function(a,b){return b},getTop:function(a){return-a.targetHeight}},8:{getLeft:function(a,b){return b},getTop:function(a){return a.containerHeight}}};Transition.prototype.toString=function(){return"[duration:"+this.duration+", direction:"+this.direction+", type:"+this.transition+"]"};
Transition.prototype.setTarget=function(a){this.target=a;this.hasContext||this.sniffContext()};
Transition.prototype.sniffContext=function(){if(player.width&&1!=player.width){switch(this.target.objectType){case "Item":this.targetLeft=this.target.x;this.targetTop=this.target.y;this.targetWidth=this.target.width;this.targetHeight=this.target.height;this.containerWidth=player.width;this.containerHeight=player.height;break;case "Layer":this.targetTop=this.targetLeft=0;this.targetWidth=player.width;this.targetHeight=player.height;this.containerWidth=player.width;this.containerHeight=player.height;
break;case "Slide":this.targetTop=this.targetLeft=0;this.targetWidth=player.width;this.targetHeight=player.height;this.containerWidth=player.width;this.containerHeight=player.height;break;case "Bounce":this.targetTop=this.targetLeft=0,this.targetWidth=player.width/10,this.targetHeight=player.height/10,this.containerWidth=player.width/10,this.containerHeight=player.height/10}this.hasContext=!0}};
Transition.prototype.loadFromXML=function(a,b){b&&this.setTarget(b);this.transition=$(a).attr("transition");this.animationid=$(a).attr("animationid");$(a).attr("transduration")?(this.duration=parseInt($(a).attr("transduration")),this.direction=$(a).attr("transdir"),this.wipe="true"==$(a).attr("wipetrans")):(this.duration=parseInt($(a).attr("duration")),this.direction=$(a).attr("direction"));this.reverse="true"==$(a).attr("reverse");if(this.transition==Transition.TransType.tween){var c=$(a).children("slidetransition");
if(0!=c.length)this.duration=parseInt(c.attr("duration")),this.wipe="true"==c.attr("wipetrans"),this.convertedAnimation=new Animation,this.convertedAnimation.loadFromXML(c,this.target),this.duration=this.convertedAnimation.duration,this.target.animations&&this.target.pushAnimation(this.convertedAnimation);else if(this.target.showanimationid){this.animationid=this.target.showanimationid;c=a.children("animations").children("animation#"+this.animationid);this.transition=Transition.TransType.custom;var d=
this.target.animations[this.animationid];d.xml=c;this.duration=d.duration;this.wipe=d.wipetrans;this.convertedAnimation=d}}else if(this.transition==Transition.TransType.appear&&this.duration)this.duration=0};Transition.applyCss=function(a,b){$.each(a,function(a,d){$(b).css(a,d)})};Transition.prototype.applyCss=function(a,b){Transition.applyCss(a,b)};Transition.prototype.apply=function(a,b,c,d,e){this.transition==Transition.TransType.custom?this.applyCustom(a,b,c,d,e):console.warn("legacy transition type detected")};
Transition.prototype.applyCustom=function(a,b,c,d,e){this.target.animations[this.animationid].start(this.target,!1,e,a)};
Transition.prototype.convertToAnimation=function(a,b){if(this.transition==Transition.TransType.custom&&a.animations[this.animationid])return a.animations[this.animationid];if(this.convertedAnimation)return this.convertedAnimation;this.runCount++;var c=new Animation,d=new bwAnimation;d.setDuration(this.duration);d.SetEffects(this.transition);d.setTransitionIn(b);d.setStartXPos(a.originalX);d.setStartYPos(a.originalY);d.setStartAlpha(100);d.setStartXScale(1);d.setStartYScale(1);d.setEndXPos(a.originalX);
d.setEndYPos(a.originalY);d.setEndAlpha(100);d.setEndRotation(0);d.setEndXScale(1);d.setEndYScale(1);a.pushAnimation(c);if(d.getFlyEnabled()){var e=this.direction;e&bwAnimation.TRANS_DIR_LEFT?d.setStartXPos(-a.width+a.xoffset):e&bwAnimation.TRANS_DIR_RIGHT&&d.setStartXPos(a.container.width()+a.xoffset);e&bwAnimation.TRANS_DIR_TOP?d.setStartYPos(-a.height+a.yoffset):e&bwAnimation.TRANS_DIR_BOTTOM&&d.setStartYPos(a.container.height()+a.yoffset)}d.getFadeEnabled()&&d.setStartAlpha(0);d.getGrowEnabled()&&
(d.setStartXScale(0),d.setStartYScale(0));d.m_bReverse=this.reverse||this.wipe;c.bwa=d;c.item=a;c.target=a.ref;c.isTransition=!0;c.uniqueID="trans_"+a.getFullObjref()+"_"+Animation.sequence++;c.duration=this.duration;return this.convertedAnimation=c};var Animation=function(){this.ended=this.running=!1;this.startTime=0;this.ms=-1;this.userInitiated=!0;this.paused=!1};Animation.sequence=0;
Animation.prototype.loadFromXML=function(a,b){this.item=b;this.xml=a;this.id=$(a).attr("id");this.wipetrans="true"==$(a).attr("wipetrans");this.pushdirection=$(a).attr("pushdirection");this.imageBounds={width:50,height:50};this.uniqueID=$(a).parent().parent().attr("id")+"_"+this.id;b&&(this.uniqueID+="_"+b.getFullObjref());this.uniqueID+="_"+Animation.sequence++;this.duration=parseInt($(a).attr("duration"));if(0==this.duration)this.isZeroLength=!0,this.duration=1;this.tweens=[];this.endCallback=null;
this.bwa=new bwObjectAnimation(a,!1,null,this.item)};Animation.prototype.resumeActionAnimation=function(){if(this.userInitiated&&this.paused)this.paused=!1,this.startTime=this.timeline.getCurrentTime(!0)-this.suspendTime};Animation.prototype.suspendActionAnimation=function(){if(this.userInitiated&&!this.paused)this.paused=!0,this.suspendTime=this.timeline.getCurrentTime(!0)-this.startTime};
Animation.prototype.step=function(){var a=this.timeline.getCurrentTime(this.userInitiated)-this.startTime;this.seek(this.target,this.reverse,a,!0);a>=this.duration&&this.end()};
Animation.prototype.seek=function(a,b,c,d){if(!(!a||!this.item.ref||a!=this.item.ref&&a.attr("id")!=this.item.ref.attr("id"))&&!(this.ms==c&&0!=this.ms)){if(c>this.bwa.m_nDuration)c=this.bwa.m_nDuration;b&&(c=this.bwa.m_nDuration-c);if(this.item.ref){this.ms=c;var b=this.bwa.GetTransformAtTime(c),e=new MatrixTransform,f="",g="",h=this.item.rotatexpos-this.item.xoffset,j=this.item.rotateypos-this.item.yoffset,l,m;this.item.maskTranslate&&(f+=this.item.maskTranslate,g+=this.item.maskTranslateIE);if(b.scale&&
!isNaN(b.scale.x)){var k=1;if("Slide"==this.item.innerType&&void 0!==this.item.fitScale&&1!=this.item.fitScale)k=this.item.fitScale;"SlideFrame"==this.item.innerType&&!this.item.scalecontents?(this.item.ref.css("width",this.item.width*b.scale.x/100*k),this.item.ref.css("height",this.item.height*b.scale.y/100*k)):(e.scale(b.scale.x/100*k,b.scale.y/100*k),f+="scale("+b.scale.x/100*k+","+b.scale.y/100*k+") ",g+="scale("+b.scale.x/100*k+","+b.scale.y/100*k+") ");this.item.scale=b.scale.x/100*k}else void 0!==
this.item.scale&&1!=this.item.scale&&(e.scale(this.item.scale,this.item.scale),f+="scale("+this.item.scale+") ",g+="scale("+this.item.scale+") ");if(b.position&&!isNaN(b.position.x))if(b.position.x=parseInt(b.position.x),b.position.y=parseInt(b.position.y),d){if(this.item&&(this.item.x=parseInt(b.position.x),this.item.y=parseInt(b.position.y),this.item.ref.css("left",this.item.x+this.item.xoffset),this.item.ref.css("top",this.item.y+this.item.yoffset),this.pushItem&&this.pushItem.ref))this.pushItem.x=
parseInt(b.position.x)+this.pushOffset.x,this.pushItem.y=parseInt(b.position.y)+this.pushOffset.y,this.pushItem.ref.css("left",this.pushItem.x+this.pushItem.xoffset),this.pushItem.ref.css("top",this.pushItem.y+this.pushItem.yoffset)}else if(e.translate(parseInt(b.position.x),parseInt(b.position.y)),f+="translate3d("+parseInt(b.position.x)+"px,"+parseInt(b.position.y)+"px,0px) ",g+="translate("+parseInt(b.position.x)+"px,"+parseInt(b.position.y)+"px) ",this.item)this.item.x=parseInt(b.position.x),
this.item.y=parseInt(b.position.y),this.item.ref.css("left",0),this.item.ref.css("top",0);this.item.realRotation=this.item.rotation;isNaN(b.rotation)?0!=this.item.rotation&&(f+="rotate("+this.item.rotation+"deg) ",g+="rotate("+this.item.rotation+"deg) "):(e.rotateDegrees(parseInt(b.rotation)),b.rotation=parseInt(b.rotation),d=parseInt(b.rotation)%360,f+="rotate("+d+"deg) ",g+="rotate("+d+"deg) ",this.item.rotation=d);isNaN(b.alpha)?$(a).css("opacity",1):$(a).css("opacity",b.alpha/100);if(b.skew&&
!isNaN(b.skew.x))b.skew.x*=-1,b.skew.y*=-1,f+="skew("+b.skew.x+"deg,"+b.skew.y+"deg) ",g+="skew("+b.skew.x+"deg,"+b.skew.y+"deg) ",h=b.skew.regpoint.x,j=b.skew.regpoint.y,l=0,m=0;b.matrix&&(f+=b.matrix.toCSSTransform(),g+=b.matrix.toCSSTransform());if(b.mask)if(e=b.mask,d=b.mask.m_oMaskTween,c=(c-e.m_nStartTime)/e.m_nDuration,player.useMaskImage||!d.m_shMask.isClipPath())(e=this.getMaskSteps(d))||(e=this.getMaskSteps(bwTweenMask.TweenType.FULL)),k=parseInt(1*c/bwMaskBase.PRECOMPUTED_STEP_SIZE),k=
Math.min(e.length-1,k),k=Math.max(0,k),e=e[k],$(a).css("-webkit-mask-image","url("+e+")"),$(a).css("-webkit-mask-size","cover"),$(a).css("-webkit-mask-position","center"),1<=c&&!d.m_shMask.getExitAnimation()&&$(a).css("-webkit-mask-image","");else if(1<=c&&!d.m_shMask.getExitAnimation())$(a).css("-webkit-mask-image",""),$(a).css("-webkit-clip-path","");else{if(!this.item.animationMasked||"none"==$(a).css("-webkit-mask-image"))$(a).css("-webkit-mask-image","url("+Element.BlackPixelSrc+")"),this.item.animationMasked=
!0;d.m_strType==bwTweenMask.TweenType.FULL&&(e=this.item.x-this.item.originalX,k=this.item.y-this.item.originalY,$(a).css("-webkit-mask-size",this.item.width+"px "+this.item.height+"px"),$(a).css("-webkit-mask-position",-e+"px "+-k+"px"),$(a).css("-webkit-mask-repeat","no-repeat"));d=d.m_shMask.GetClipPath(c);$(a).css("-webkit-clip-path","polygon("+d+")")}l=l||0;m=m||0;$(a).css("-webkit-transform-origin",h+l+"px "+(j+m)+"px");$(a).css("-webkit-transform",f);$(a).css("-moz-transform-origin",h+l+"px "+
(j+m)+"px");$(a).css("-moz-transform",f);$(a).css("-ms-transform-origin",h+l+"px "+(j+m)+"px");$(a).css("-ms-transform",g);a.hasTransformed=!0;this.item.updateMatrix();this.item.currentTransform=b;this.item.rotation=this.item.realRotation;this.item.handleVarChanged("animationstep","animationstep")}}};
Animation.prototype.setupMaskAnimation=function(){this.maskCanvas=document.createElement("CANVAS");this.maskCanvas.width=this.imageBounds.width;this.maskCanvas.height=this.imageBounds.height;this.maskContext=this.maskCanvas.getContext("2d");this.item.AnimationMask={};this.item.BoundsForAnimationMask=new ppRect(0,0,this.imageBounds.width,this.imageBounds.height);this.item.AnimationMask.graphics=new MaskGraphics(this.maskContext,this.item.BoundsForAnimationMask)};
Animation.prototype.getMaskSteps=function(a){var b=a.m_shMask.GetUniqueConfigurationKey(a.m_strType);this.maskCanvas||this.setupMaskAnimation();if(player.computedMasks[b])return player.computedMasks[b];for(var c=this.imageBounds.width,d=this.imageBounds.height,e=[],f=0;f<1+bwMaskBase.PRECOMPUTED_STEP_SIZE;f+=bwMaskBase.PRECOMPUTED_STEP_SIZE){this.maskContext.clearRect(0,0,c,d);this.maskContext.beginPath();a.m_shMask.Draw(f);this.maskContext.closePath();this.maskContext.fillStyle="#000";this.maskContext.fill();
var g=this.maskCanvas.toDataURL();e.push(g)}return player.computedMasks[b]=e};
Animation.prototype.start=function(a,b,c,d){var e="";if(this.running&&!this.ended&&b!=this.reverse)e=this.id;a.stopCurrentAnimations(!0,e);c&&c.timeline?this.timeline=c.timeline:a&&a.getTimeline?this.timeline=a.getTimeline():(console.warn("Starting animation on slide timeline"),this.timeline=player.currentSlide().timeline);this.startTime=this.timeline.getCurrentTime(c.isUserInitiated);if(null!=c&&0<=c.time&&this.timeline==c.timeline)this.startTime=c.time;this.bwa.updateTweenValues();this.target=a.ref;
this.reverse=b;this.running=!0;this.paused=this.ended=!1;this.item.currentTransform=null;this.item.animating=!0;this.item.animationEnded=!1;this.endCallback=d;this.item.pushAnimation(this);this.isZeroLength?(this.bwa.m_bReverse=this.reverse,this.seek(this.target,this.reverse,0,!0),this.end()):(this.userInitiated=a.actionControlled=c.isUserInitiated,this.timeline.addAnimation(this))};Animation.prototype.reset=function(){this.seek(this.target,this.reverse,0,!0)};
Animation.prototype.finish=function(a){!this.ended&&this.running&&(this.seek(this.target,this.reverse,this.duration,!0),this.end(a))};
Animation.prototype.end=function(a){var b=this;if(!this.ended&&this.running)this.ended=!0,this.running=!1,this.item.animating=!1,this.item.animationEnded=!0,this.item.updateMatrixComplete(!0),this.timeline.removeAnimation(this),a||this.item&&this.item.handleEvent&&this.item.handleEvent("onanimationcomplete",this.reverse,function(a,d,e){a=$(e.xml).attr("id");e="true"==$(e.xml).attr("reverse");return b.id==a&&b.reverse==e},!1,!0,this.userInitiated,new EventInfo("",this.startTime+this.duration,this.timeline,
this.userInitiated)),this.endCallback&&this.endCallback(a)};Animation.prototype.destroy=function(){this.xml=this.item=null;this.tweens=[];this.bwa=this.endCallback=null};var BlendMode={NORMAL:1,LAYER:2};function Point(a,b){this.x=a;this.y=b}function ForceInt(a){a=parseInt(a);isNaN(a)&&(a=0);return a}function BezierSegment(a,b,c,d){this.start=a;this.end=d;this.c1=b;this.c2=c}
BezierSegment.prototype.getValue=function(a){var a=1-a,b=new function(a,b){a||(a=0);b||(b=0);return{x:a,y:b}};b.x=this.start.x*a*a*a+this.c1.x*3*a*a*(1-a)+this.c2.x*3*a*(1-a)*(1-a)+this.end.x*(1-a)*(1-a)*(1-a);b.y=this.start.y*a*a*a+this.c1.y*3*a*a*(1-a)+this.c2.y*3*a*(1-a)*(1-a)+this.end.y*(1-a)*(1-a)*(1-a);return b};function getTimer(){return 0};function bwAnimation(a){this.m_strEasing=bwAnimation.EASE_CUBIC;this.m_nAnimationType=this.m_nCurrentTime=this.m_nDuration=this.m_nStartTime=this.m_nTriggerTime=0;this.m_bTransitionIn=!0;this.m_nStartY=this.m_nStartX=0;this.m_nSpinCount=1;this.m_nCurRotation=this.m_nCurYPos=this.m_nCurXPos=0;this.m_nCurYScale=this.m_nCurXScale=1;this.m_nEndY=this.m_nEndX=3735928495;this.m_nStartScaleY=this.m_nStartScaleX=this.m_nEndRotation=0;this.m_nEndScaleY=this.m_nEndScaleX=1;this.m_nStartAlpha=0;this.m_nEndAlpha=
1;this.m_aoTarget=null;this.m_bAdjustRotation=!0;this.m_bTimelineAnimating=this.m_bAnimating=!1;this.m_aoTarget=a}bwAnimation.TRANS_APPEAR="appear";bwAnimation.TRANS_FADE="fade";bwAnimation.TRANS_FLY="fly";bwAnimation.TRANS_GROW="grow";bwAnimation.TRANS_SPIN="spin";bwAnimation.TRANS_MASK="mask";bwAnimation.TRANS_INT_FADE=1;bwAnimation.TRANS_INT_FLY=2;bwAnimation.TRANS_INT_GROW=4;bwAnimation.TRANS_INT_SPIN=8;bwAnimation.TRANS_INT_MASK=16;bwAnimation.TRANS_DIR_LEFT=1;bwAnimation.TRANS_DIR_RIGHT=2;
bwAnimation.TRANS_DIR_TOP=4;bwAnimation.TRANS_DIR_BOTTOM=8;bwAnimation.EASE_BOUNCE="bounce";bwAnimation.EASE_CIRCULAR="circular";bwAnimation.EASE_CUBIC="cubic";bwAnimation.EASE_EXPONENTIAL="exponetial";bwAnimation.EASE_LINEAR="linear";bwAnimation.EASE_QUADRATIC="quadradic";bwAnimation.EASE_QUARTIC="quartic";bwAnimation.EASE_QUINTIC="quintic";bwAnimation.EASE_SINE="sine";bwAnimation.EASING_STEP_COUNT=1E3;
bwAnimation.getEasedPercent=function(a,b,c){b=bwAnimation.getEasingLookup(b,c);c=Math.round(a*bwAnimation.EASING_STEP_COUNT);return!(c in b)?a:b[c]};bwAnimation.getBezierPoint=function(a,b,c,d,e){var a=1-a,f=new function(a,b){a||(a=0);b||(b=0);return{x:a,y:b}};f.x=b.x*a*a*a+d.x*3*a*a*(1-a)+e.x*3*a*(1-a)*(1-a)+c.x*(1-a)*(1-a)*(1-a);f.y=b.y*a*a*a+d.y*3*a*a*(1-a)+e.y*3*a*(1-a)*(1-a)+c.y*(1-a)*(1-a)*(1-a);return f};bwAnimation.EasingLookups={};
bwAnimation.getEasingLookup=function(a,b){function c(a,b,c,d){for(var e=-1,m={},k=0;1>=k;k+=1/bwAnimation.EASING_STEP_COUNT)for(var n=bwAnimation.getBezierPoint(k,new Point(0,0),new Point(1,1),new Point(a,b),new Point(c,d)),p=Math.round(n.x*bwAnimation.EASING_STEP_COUNT),r=e+1;r<=p;r++)m[r]=n.y,e=r;m[0]=0;m[bwAnimation.EASING_STEP_COUNT]=1;return m}function d(){for(var a={},b=0;b<=bwAnimation.EASING_STEP_COUNT;b++){var c=b/bwAnimation.EASING_STEP_COUNT,d=void 0;c<1/2.75?d=7.5625*Math.pow(c,2):c<2/
2.75?(c-=1.5/2.75,d=7.5625*Math.pow(c,2)+0.75):c<2.5/2.75?(c-=2.25/2.75,d=7.5625*Math.pow(c,2)+0.9375):(c-=2.625/2.75,d=7.5625*Math.pow(c,2)+0.984375);a[b]=d}return a}var e=b;if(a==bwTween.EASE_LINEAR)e=bwTween.EASE_LINEAR;if(e in bwAnimation.EasingLookups)return bwAnimation.EasingLookups[e];switch(e){case bwTween.EASE_IN:bwAnimation.EasingLookups[e]=c(0.42,0,1,1);break;case bwTween.EASE_OUT:bwAnimation.EasingLookups[e]=c(0,0,0.58,1);break;case bwTween.EASE_INOUT:bwAnimation.EasingLookups[e]=c(0.42,
0,0.58,1);break;case bwTween.EASE_BOUNCE:bwAnimation.EasingLookups[e]=d();break;default:bwAnimation.EasingLookups[e]=function(){for(var a=[],b=0;b<=bwAnimation.EASING_STEP_COUNT;b++)a[b]=b/bwAnimation.EASING_STEP_COUNT;return a}()}return bwAnimation.EasingLookups[e]};bwAnimation.prototype.getAppear=function(){return 0==this.m_nAnimationType};bwAnimation.prototype.getFlyEnabled=function(){return 0<(this.m_nAnimationType&bwAnimation.TRANS_INT_FLY)};
bwAnimation.prototype.getFadeEnabled=function(){return 0<(this.m_nAnimationType&bwAnimation.TRANS_INT_FADE)};bwAnimation.prototype.getGrowEnabled=function(){return 0<(this.m_nAnimationType&bwAnimation.TRANS_INT_GROW)};bwAnimation.prototype.getSpinEnabled=function(){return 0<(this.m_nAnimationType&bwAnimation.TRANS_INT_SPIN)};bwAnimation.prototype.getMaskEnabled=function(){return 0<(this.m_nAnimationType&bwAnimation.TRANS_INT_MASK)};
bwAnimation.prototype.SetEffects=function(a){this.m_nAnimationType=0;0<=a.indexOf(bwAnimation.TRANS_FADE)&&(this.m_nAnimationType+=bwAnimation.TRANS_INT_FADE);0<=a.indexOf(bwAnimation.TRANS_FLY)&&(this.m_nAnimationType+=bwAnimation.TRANS_INT_FLY);0<=a.indexOf(bwAnimation.TRANS_GROW)&&(this.m_nAnimationType+=bwAnimation.TRANS_INT_GROW);0<=a.indexOf(bwAnimation.TRANS_SPIN)&&(this.m_nAnimationType+=bwAnimation.TRANS_INT_SPIN);0<=a.indexOf(bwAnimation.TRANS_MASK)&&(this.m_nAnimationType+=bwAnimation.TRANS_INT_MASK);
if(a==bwAnimation.TRANS_APPEAR)this.m_nDuration=this.m_nAnimationType=0};bwAnimation.prototype.AddEffect=function(a){var b=0;switch(a){case bwAnimation.TRANS_FADE:b=bwAnimation.TRANS_INT_FADE;break;case bwAnimation.TRANS_FLY:b=bwAnimation.TRANS_INT_FLY;break;case bwAnimation.TRANS_GROW:b=bwAnimation.TRANS_INT_GROW;break;case bwAnimation.TRANS_SPIN:b=bwAnimation.TRANS_INT_SPIN;break;case bwAnimation.TRANS_MASK:b=bwAnimation.TRANS_INT_MASK}this.m_nAnimationType&b||(this.m_nAnimationType+=b)};
bwAnimation.prototype.getTimelineAnimating=function(){return this.m_bTimelineAnimating};bwAnimation.prototype.setTimelineAnimating=function(a){this.m_bTimelineAnimating=a&&0<this.m_nAnimationType&&0<this.m_nDuration};bwAnimation.prototype.getAnimating=function(){return this.m_bAnimating};bwAnimation.prototype.setTarget=function(a){this.m_aoTarget=a};bwAnimation.prototype.getTarget=function(){return this.m_aoTarget};bwAnimation.prototype.getTriggerTime=function(){return this.m_nTriggerTime};
bwAnimation.prototype.setTriggerTime=function(a){this.m_nTriggerTime=a};bwAnimation.prototype.getStartTime=function(){return this.m_nStartTime};bwAnimation.prototype.setStartTime=function(a){this.m_nStartTime=a};bwAnimation.prototype.getDuration=function(){return this.m_nDuration};bwAnimation.prototype.setDuration=function(a){this.m_nDuration=a};bwAnimation.prototype.getTime=function(){return this.m_nCurrentTime};bwAnimation.prototype.setTime=function(a){this.m_nCurrentTime=a;this.UpdateTarget()};
bwAnimation.prototype.getStartXPos=function(){return this.m_nStartX};bwAnimation.prototype.setStartXPos=function(a){this.m_nStartX=a};bwAnimation.prototype.getStartYPos=function(){return this.m_nStartY};bwAnimation.prototype.setStartYPos=function(a){this.m_nStartY=a};bwAnimation.prototype.getEndXPos=function(){return this.m_nEndX};bwAnimation.prototype.setEndXPos=function(a){this.m_nEndX=a};bwAnimation.prototype.getEndYPos=function(){return this.m_nEndY};
bwAnimation.prototype.setEndYPos=function(a){this.m_nEndY=a};bwAnimation.prototype.getEndRotation=function(){return this.m_nEndRotation};bwAnimation.prototype.setEndRotation=function(a){this.m_nEndRotation=a};bwAnimation.prototype.getStartXScale=function(){return this.m_nStartScaleX};bwAnimation.prototype.setStartXScale=function(a){this.m_nStartScaleX=a};bwAnimation.prototype.getStartYScale=function(){return this.m_nStartScaleY};
bwAnimation.prototype.setStartYScale=function(a){this.m_nStartScaleY=a};bwAnimation.prototype.getEndXScale=function(){return this.m_nEndScaleX};bwAnimation.prototype.setEndXScale=function(a){this.m_nEndScaleX=a};bwAnimation.prototype.getEndYScale=function(){return this.m_nEndScaleY};bwAnimation.prototype.setEndYScale=function(a){this.m_nEndScaleY=a};bwAnimation.prototype.getEndAlpha=function(){return this.m_nEndAlpha};bwAnimation.prototype.setEndAlpha=function(a){this.m_nEndAlpha=a};
bwAnimation.prototype.getStartAlpha=function(){return this.m_nStartAlpha};bwAnimation.prototype.setStartAlpha=function(a){this.m_nStartAlpha=a};bwAnimation.prototype.setEasing=function(a){this.m_strEasing=a};bwAnimation.prototype.getEasing=function(){return this.m_strEasing};bwAnimation.prototype.getTransitionIn=function(){return this.m_bTransitionIn};bwAnimation.prototype.setTransitionIn=function(a){this.m_bTransitionIn=a};
bwAnimation.prototype.GetTransformAtTime=function(a){var b=null,c=null,d=NaN,e=NaN,a=a/this.m_nDuration;this.m_bReverse&&(a=1-a);0>a&&(a=0);if(1<a||0==this.m_nDuration)a=1;this.m_nCurrentTime>=this.m_nDuration&&(a=1);this.m_bTransitionIn||(a=1-a);a=bwAnimation.getEasedPercent(a,bwTween.EASE_EXPONENTIAL,bwTween.EASE_INOUT);this.m_nCurXPos=this.m_nEndX;this.m_nCurYPos=this.m_nEndY;this.m_nAnimationType&bwAnimation.TRANS_INT_FADE&&(e=this.m_nStartAlpha+(this.m_nEndAlpha-this.m_nStartAlpha)*a);if(this.m_nAnimationType&
bwAnimation.TRANS_INT_FLY)this.m_nCurXPos=this.m_nStartX+(this.m_nEndX-this.m_nStartX)*a,this.m_nCurYPos=this.m_nStartY+(this.m_nEndY-this.m_nStartY)*a,b=new Point(this.m_nCurXPos,this.m_nCurYPos);if(this.m_nAnimationType&bwAnimation.TRANS_INT_GROW)this.m_nCurXScale=(this.m_nEndScaleX-this.m_nStartScaleX)*a+this.m_nStartScaleX,this.m_nCurYScale=(this.m_nEndScaleY-this.m_nStartScaleY)*a+this.m_nStartScaleY,c=new Point(100*this.m_nCurXScale,100*this.m_nCurYScale);this.m_nAnimationType&bwAnimation.TRANS_INT_SPIN&&
(d=(360*this.m_nSpinCount+this.m_nEndRotation)*a);return{position:b,scale:c,rotation:d,alpha:e}};bwAnimation.prototype.getAdjustRotation=function(){return this.m_bAdjustRotation};bwAnimation.prototype.setAdjustRotation=function(a){this.m_bAdjustRotation=a};bwAnimation.prototype.StopAnimation=function(){if(this.m_bAnimating)this.m_bAnimating=!1};
bwAnimation.prototype.PlayAnimation=function(){if(null!=this.m_aoTarget){if(3735928495==this.m_nEndX)this.m_nEndX=this.m_aoTarget.x;if(3735928495==this.m_nEndY)this.m_nEndY=this.m_aoTarget.y;this.m_nStartTime=this.getTimer();(this.m_bAnimating=!0)&&this.StepAnimation(null)}};bwAnimation.prototype.CompleteAnimation=function(){this.m_nCurrentTime=this.m_nDuration;this.m_bAnimating=!1;this.UpdateTarget()};
bwAnimation.prototype.StepAnimation=function(){var a=!1;this.m_nCurrentTime=this.getTimer()-this.m_nStartTime;if(this.m_nCurrentTime>=this.m_nDuration)a=!0,this.m_nCurrentTime=this.m_nDuration,this.m_bAnimating=!1;this.UpdateTarget();return a};bwAnimation.prototype.Destroy=function(){this.StopAnimation();this.m_aoTarget=null};function bwObjectAnimation(a,b,c,d){this.m_nCurrentTime=this.m_nDuration=this.m_nStartTime=this.m_nTriggerTime=0;this.m_bReverse=!1;this.m_xmlData=null;this.m_strId="";this.m_bHideOnComplete=this.m_bShowOnStart=this.m_bAnimating=!1;this.m_ptStartPos=this.m_arrTweens=this.m_oTarget=this.m_oActionHandler=null;this.m_bTimelineAnimating=!1;this.m_oActionHandler=c;this.m_oTarget=d;this.m_xmlData=a;this.m_ptStartPos=new Point(this.m_oTarget.x,this.m_oTarget.y);this.ParseXMLData()}
bwObjectAnimation.prototype.ParseXMLData=function(){this.m_strId=$(this.m_xmlData).attr("id");this.m_bShowOnStart="true"==$(this.m_xmlData).attr("showonstart");this.m_bHideOnComplete="true"==$(this.m_xmlData).attr("hideoncomplete");this.m_nDuration=parseInt($(this.m_xmlData).attr("duration"));if(0==this.m_nDuration)this.isZeroLength=!0,this.m_nDuration=1;var a=$(this.m_xmlData).children("tweens").children("tween"),b=a.length,c=0,d=null;this.m_arrTweens=[];for(c=0;c<b;c++)d=new bwTweenEvent(this.m_oTarget,
a[c],this.m_oTarget.rotation,this.m_oTarget.matrix.getRotation()),this.m_arrTweens.push(d)};bwObjectAnimation.prototype.updateTweenValues=function(){if(this.m_xmlData){var a=$(this.m_xmlData).children("tweens").children("tween"),b=a.length;if(0<b){var c=0,d=null;this.m_arrTweens=[];for(c=0;c<b;c++)d=new bwTweenEvent(this.m_oTarget,a[c],this.m_oTarget.rotation,this.m_oTarget.matrix.getRotation()),this.m_arrTweens.push(d)}}};bwObjectAnimation.prototype.getTimelineAnimating=function(){return this.m_bTimelineAnimating};
bwObjectAnimation.prototype.setTimelineAnimating=function(a){this.m_bTimelineAnimating=a};bwObjectAnimation.prototype.getReverse=function(){return this.m_bReverse};bwObjectAnimation.prototype.ReverseAnimation=function(a){alert("reversing "+this.m_bReverse);if(this.m_bAnimating)this.m_nStartTime=a-(this.m_nDuration-(a-this.m_nStartTime)),SyncAnimation(a)};bwObjectAnimation.prototype.getId=function(){return this.m_strId};bwObjectAnimation.prototype.getAnimating=function(){return this.m_bAnimating};
bwObjectAnimation.prototype.getTriggerTime=function(){return this.m_nTriggerTime};bwObjectAnimation.prototype.setTriggerTime=function(a){this.m_nTriggerTime=a};bwObjectAnimation.prototype.getStartTime=function(){return this.m_nStartTime};bwObjectAnimation.prototype.setStartTime=function(a){this.m_nStartTime=a};bwObjectAnimation.prototype.getDuration=function(){return this.m_nDuration};
bwObjectAnimation.prototype.UpdateTarget=function(){var a=null,b=null,c=null,d=null,e=null,f=NaN,g=NaN,h=a=NaN,j=this.m_nCurrentTime,l=0;if(this.m_bReverse){j=this.m_nDuration-this.m_nCurrentTime;for(l=this.m_arrTweens.length-1;0<=l;l--)a=this.m_arrTweens[l],b=a.GetPointAtTime(j,this.m_bReverse),d=a.GetScaleAtTime(j,this.m_bReverse),f=a.GetRotationAtTime(j,this.m_bReverse),a=a.GetAlphaAtTime(j,this.m_bReverse),null!=b&&(c=b),null!=d&&(e=d),isNaN(f)||(g=f),isNaN(a)||(h=a)}else for(l=0;l<this.m_arrTweens.length;l++)a=
this.m_arrTweens[l],b=a.GetPointAtTime(j,this.m_bReverse),d=a.GetScaleAtTime(j,this.m_bReverse),f=a.GetRotationAtTime(j,this.m_bReverse),a=a.GetAlphaAtTime(j,this.m_bReverse),null!=b&&(c=b),null!=d&&(e=d),isNaN(f)||(g=f),isNaN(a)||(h=a);b=new Matrix;isNaN(g)?b.rotate(this.m_oTarget.rotation*DEGREE_MULTIPLIER):(this.m_oTarget.rotation=g,b.rotate(g*DEGREE_MULTIPLIER));if(!isNaN(h))this.m_oTarget.alpha=h/100;null!=e?(bwUtils.debug_trace("Scale: "+e.x+", "+e.y),this.m_oTarget.scaleX=e.x/100,this.m_oTarget.scaleY=
e.y/100,b.scale(e.x/100,e.y/100)):b.scale(this.m_oTarget.scaleX,this.m_oTarget.scaleY);e=null;null!=c?(e=b.transformPoint(new Point(this.m_oTarget.RotateXPos,this.m_oTarget.RotateYPos)),this.m_oTarget.x=c.x+(this.m_oTarget.RotateXPos-e.x),this.m_oTarget.y=c.y+(this.m_oTarget.RotateYPos-e.y)):(e=b.transformPoint(new Point(this.m_oTarget.RotateXPos,this.m_oTarget.RotateYPos)),this.m_oTarget.x=this.m_ptStartPos.x+(this.m_oTarget.RotateXPos-e.x),this.m_oTarget.y=this.m_ptStartPos.y+(this.m_oTarget.RotateYPos-
e.y),c=this.m_ptStartPos);this.m_oTarget.RawXPos=c.x;this.m_oTarget.RawYPos=c.y};
bwObjectAnimation.prototype.GetTransformAtTime=function(a){for(var b=this,c=null,d=null,e=null,f=null,g=null,h=NaN,j=NaN,l=NaN,m=NaN,k=null,n=null,p=null,r=null,o=null,t=null,v=null,w=null,A=0,B=function(c){d=c.GetPointAtTime(a,b.m_bReverse);f=c.GetScaleAtTime(a,b.m_bReverse);h=c.GetRotationAtTime(a,b.m_bReverse);l=c.GetAlphaAtTime(a,b.m_bReverse);k=c.GetMaskAtTime(a,b.m_bReverse);p=c.GetSkewAtTime(a,b.m_bReverse);o=c.GetColorAtTime(a,b.m_bReverse);v=c.GetMatrixAtTime(a,b.m_bReverse);null==e&&null!=
d&&(e=d);null==g&&null!=f&&(g=f);isNaN(j)&&!isNaN(h)&&(j=h);isNaN(m)&&!isNaN(l)&&(m=l);null==n&&null!=k&&(n=k);null==r&&null!=p&&(r=p);null==t&&null!=o&&(t=o);null==w&&null!=v&&(w=v)},A=0;A<this.m_arrTweens.length;A++)c=this.m_arrTweens[A],a>=c.getStartTime()&&a<=c.getStartTime()+c.getDuration()&&B(c);for(A=0;A<this.m_arrTweens.length;A++)c=this.m_arrTweens[A],(a<c.getStartTime()||a>c.getStartTime()+c.getDuration())&&B(c);return{position:e,scale:g,rotation:j,alpha:m,mask:n,skew:r,color:t,matrix:w}};
bwObjectAnimation.prototype.SyncAnimation=function(a){var b=!1;this.m_nCurrentTime=a-this.m_nStartTime;if(this.m_nCurrentTime>=this.m_nDuration)b=!0,this.m_nCurrentTime=this.m_nDuration,this.m_bAnimating=!1,this.m_oActionHandler.RemoveAnimationTimer(SyncAnimation);UpdateTarget();if(b&&this.m_oTarget.blendMode!=BlendMode.NORMAL)this.m_oTarget.blendMode=BlendMode.NORMAL;return b};
bwObjectAnimation.prototype.StepAnimation=function(){var a=!1;this.m_nCurrentTime=getTimer()-this.m_nStartTime;if(this.m_nCurrentTime>=this.m_nDuration)a=!0,this.m_nCurrentTime=this.m_nDuration,this.m_bAnimating=!1,this.m_oActionHandler.RemoveAnimationTimer(StepAnimation);UpdateTarget();if(a){if(this.m_oTarget.blendMode!=BlendMode.NORMAL)this.m_oTarget.blendMode=BlendMode.NORMAL;var b=new bwAnimationEvent(bwAnimationEvent.ANIMATION_COMPLETE);b.AnimationId=this.m_strId;b.Reverse=this.m_bReverse;dispatchEvent(b)}return a};
bwObjectAnimation.prototype.StopAnimation=function(){if(this.m_bAnimating)this.m_bAnimating=!1,this.m_oActionHandler.RemoveAnimationTimer(SyncAnimation)};bwObjectAnimation.prototype.PlayAnimation=function(){if(null!=this.m_oTarget)this.m_nStartTime=this.m_oActionHandler.EventTime,this.m_bAnimating=!0,this.m_oActionHandler.AddAnimationTimer(SyncAnimation),StepAnimation()};
bwObjectAnimation.prototype.CompleteAnimation=function(){this.m_nCurrentTime=this.m_nDuration;this.m_bAnimating=!1;this.m_oActionHandler.RemoveAnimationTimer(SyncAnimation);UpdateTarget();var a=this.m_oTarget;if(a&&a.blendMode!=BlendMode.NORMAL)a.blendMode=BlendMode.NORMAL};bwObjectAnimation.prototype.Destroy=function(){StopAnimation();this.m_oTarget.SlideOwner.RemoveAnimation(this);this.m_oTarget=null};function bwAnnotationAnimation(a){this.m_aoTarget=a;this.m_nSegmentDuration=this.m_nDuration=this.m_nStartTime=this.m_nTriggerTime=0;this.m_nSegments=-1;this.m_nAnimationType=this.m_nTotalElapsedTime=this.m_nCurrentSegment=0;this.m_bSegmentPhaseIn=this.m_bTransitionIn=!0;this.m_nStartY=this.m_nStartX=0;this.m_nEndY=this.m_nEndX=NaN;this.m_bTimelineAnimating=this.m_bAnimating=!1}bwAnnotationAnimation.DURATION_WAIT=120;bwAnnotationAnimation.TRANS_APPEAR="appear";bwAnnotationAnimation.TRANS_FADE="fade";
bwAnnotationAnimation.TRANS_BOUNCE="bounce";bwAnnotationAnimation.TRANS_DRAW="draw";bwAnnotationAnimation.TRANS_STRETCH="stretch";bwAnnotationAnimation.TRANS_INT_APPEAR=0;bwAnnotationAnimation.TRANS_INT_FADE=1;bwAnnotationAnimation.TRANS_INT_BOUNCE=2;bwAnnotationAnimation.TRANS_INT_DRAW=4;bwAnnotationAnimation.TRANS_INT_STRETCH=8;bwAnnotationAnimation.DURATION_INFINITE=999999999;
bwAnnotationAnimation.prototype.GetTime=function(){var a=player.currentSlide();return this.m_nDuration==bwAnnotationAnimation.DURATION_INFINITE&&a.ended&&a.endedAnimationTime?a.duration+player.animationTime-a.endedAnimationTime:a.getAnimationTime()};bwAnnotationAnimation.prototype.bwAnnotationAnimation=function(a){this.m_aoTarget=a};bwAnnotationAnimation.prototype.GetTransformAtTime=function(a){this.StepAnimation(a);return{}};
bwAnnotationAnimation.prototype.StepAnimation=function(){var a=!1;this.m_nTotalElapsedTime=this.GetTime()-this.m_nStartTime;this.m_nCurrentSegment=1;var b=this.m_nTotalElapsedTime,c=2*this.m_nSegmentDuration+bwAnnotationAnimation.DURATION_WAIT,d=2*Math.floor(b/c);this.m_nCurrentSegment+=d;b-c*d/2>this.m_nSegmentDuration+bwAnnotationAnimation.DURATION_WAIT&&this.m_nCurrentSegment++;-1==this.m_nSegments&&(this.m_nCurrentSegment%=2);if(this.m_nCurrentSegment>this.m_nSegments&&-1!=this.m_nSegments)this.m_nCurrentSegment=
this.m_nSegments;this.m_bSegmentPhaseIn=this.m_nAnimationType==bwAnnotationAnimation.TRANS_INT_DRAW?!1:this.m_nAnimationType==bwAnnotationAnimation.TRANS_INT_BOUNCE?0==this.m_nCurrentSegment%2?!0:!1:0==this.m_nCurrentSegment%2?!1:!0;if(this.m_nTotalElapsedTime>=this.m_nDuration&&-1!=this.m_nSegments)a=!0,this.m_nTotalElapsedTime=this.m_nDuration,this.m_bAnimating=!1;this.UpdateTarget();return a};
bwAnnotationAnimation.prototype.UpdateTarget=function(){var a=0==this.m_nCurrentSegment%2,b=this.m_nCurrentSegment-1,c=b*this.m_nSegmentDuration+Math.floor(b/2)*bwAnnotationAnimation.DURATION_WAIT;-1!=this.m_nSegments?c=this.m_nTotalElapsedTime-c:(c=this.m_nTotalElapsedTime,a&&(c-=this.m_nSegmentDuration),c%=2*this.m_nSegmentDuration+bwAnnotationAnimation.DURATION_WAIT);a&&(c=Math.max(c-bwAnnotationAnimation.DURATION_WAIT,0));a=this.GetEasePercent(c/this.m_nSegmentDuration,2,this.m_bSegmentPhaseIn);
0>a&&(a=0);if(1<a||0==this.m_nDuration)a=1;0>b&&(a=0);this.m_nTotalElapsedTime>=this.m_nDuration&&-1!=this.m_nSegments&&(a=this.m_bSegmentPhaseIn?0:1);this.m_aoTarget&&this.m_aoTarget.UpdateTarget(a,this.m_nAnimationType)};bwAnnotationAnimation.prototype.StopAnimation=function(){if(this.m_bAnimating)this.m_bAnimating=!1};
bwAnnotationAnimation.prototype.PlayAnimation=function(){if(null!=this.m_aoTarget){if(isNaN(this.m_nEndX))this.m_nEndX=this.m_aoTarget.x;if(isNaN(this.m_nEndY))this.m_nEndY=this.m_aoTarget.y;(this.m_bAnimating=!0)&&this.StepAnimation(null)}};bwAnnotationAnimation.prototype.CompleteAnimation=function(){this.m_nTotalElapsedTime=this.m_nDuration;this.m_bAnimating=!1;UpdateTarget();var a=this.m_aoTarget;if(a&&a.blendMode!=BlendMode.NORMAL)a.blendMode=BlendMode.NORMAL};
bwAnnotationAnimation.prototype.Destroy=function(){StopAnimation();this.m_aoTarget=null};
bwAnnotationAnimation.prototype.SetEffects=function(a,b){this.m_nDuration=this.m_nSegmentDuration*b+bwAnnotationAnimation.DURATION_WAIT*Math.floor(b/2);if(a==bwAnnotationAnimation.TRANS_APPEAR)this.m_nAnimationType=bwAnnotationAnimation.TRANS_INT_APPEAR;else if(a==bwAnnotationAnimation.TRANS_FADE)this.m_nAnimationType=0==b?bwAnnotationAnimation.TRANS_INT_APPEAR:bwAnnotationAnimation.TRANS_INT_FADE;else if(a==bwAnnotationAnimation.TRANS_STRETCH)this.m_nAnimationType=0==b?bwAnnotationAnimation.TRANS_INT_APPEAR:
bwAnnotationAnimation.TRANS_INT_STRETCH;else if(a==bwAnnotationAnimation.TRANS_BOUNCE)this.m_nAnimationType=bwAnnotationAnimation.TRANS_INT_BOUNCE;else if(a==bwAnnotationAnimation.TRANS_DRAW)this.m_nAnimationType=bwAnnotationAnimation.TRANS_INT_DRAW;if(0<=b)this.m_nSegments=b;if(-1==b)this.m_nDuration=bwAnnotationAnimation.DURATION_INFINITE};bwAnnotationAnimation.prototype.GetEasePercent=function(a,b,c){c&&(a=1-a);return 1-(Math.pow(2,b-b*a)-1)/(Math.pow(2,b)-1)};
bwAnnotationAnimation.prototype.getAnimating=function(){return this.m_bAnimating};bwAnnotationAnimation.prototype.setTarget=function(a){this.m_aoTarget=a};bwAnnotationAnimation.prototype.getTarget=function(){return this.m_aoTarget};bwAnnotationAnimation.prototype.getDuration=function(){return this.m_nDuration};bwAnnotationAnimation.prototype.setDuration=function(a){this.m_nDuration=a};bwAnnotationAnimation.prototype.getTime=function(){return this.m_nTotalElapsedTime};
bwAnnotationAnimation.prototype.setTime=function(a){this.m_nTotalElapsedTime=a;UpdateTarget()};bwAnnotationAnimation.prototype.getStartXPos=function(){return this.m_nStartX};bwAnnotationAnimation.prototype.setStartXPos=function(a){this.m_nStartX=a};bwAnnotationAnimation.prototype.getStartYPos=function(){return this.m_nStartY};bwAnnotationAnimation.prototype.setStartYPos=function(a){this.m_nStartY=a};bwAnnotationAnimation.prototype.getEndXPos=function(){return this.m_nEndX};
bwAnnotationAnimation.prototype.setEndXPos=function(a){this.m_nEndX=a};bwAnnotationAnimation.prototype.getEndYPos=function(){return this.m_nEndY};bwAnnotationAnimation.prototype.setEndYPos=function(a){this.m_nEndY=a};bwAnnotationAnimation.prototype.getTransitionIn=function(){return this.m_bTransitionIn};bwAnnotationAnimation.prototype.setTransitionIn=function(a){this.m_bTransitionIn=a};bwAnnotationAnimation.prototype.getSegmentPhaseIn=function(){return this.m_bSegmentPhaseIn};
bwAnnotationAnimation.prototype.setSegmentPhaseIn=function(a){this.m_bSegmentPhaseIn=a};bwAnnotationAnimation.prototype.getSegmentDuration=function(){return this.m_nSegmentDuration};bwAnnotationAnimation.prototype.setSegmentDuration=function(a){this.m_nSegmentDuration=a};bwAnnotationAnimation.prototype.getCurrentSegment=function(){return this.m_nCurrentSegment};bwAnnotationAnimation.prototype.getSegments=function(){return this.m_nSegments};
bwAnnotationAnimation.prototype.setSegments=function(a){this.m_nSegments=a};bwAnnotationAnimation.prototype.getTriggerTime=function(){return this.m_nTriggerTime};bwAnnotationAnimation.prototype.setTriggerTime=function(a){this.m_nTriggerTime=a};bwAnnotationAnimation.prototype.getStartTime=function(){return this.m_nStartTime};bwAnnotationAnimation.prototype.setStartTime=function(a){this.m_nStartTime=a};bwAnnotationAnimation.prototype.getTimelineAnimating=function(){return this.m_bTimelineAnimating};
bwAnnotationAnimation.prototype.setTimelineAnimating=function(a){this.m_bTimelineAnimating=a&&0<this.m_nAnimationType&&0<this.m_nDuration};function bwCubicBezierSegment(a,b,c,d){this.m_nPrecision=10;this.m_nAccuracy=0.5;this.m_arrDistances=this.m_oCurve=this.m_grDebug=this.m_ptControlB=this.m_ptControlA=this.m_ptAnchorB=this.m_ptAnchorA=null;this.m_nLast=0;this.m_oTarget=this.m_xmlData=null;this.m_oTarget=a;this.m_nPrecision=c;this.m_grDebug=d;if(b)this.m_xmlData=b,this.ParseXML()}
bwCubicBezierSegment.prototype.ParseXML=function(){var a=$(this.m_xmlData).children("anchora")[0],b=$(this.m_xmlData).children("anchorb")[0],c=$(this.m_xmlData).children("controla")[0],d=$(this.m_xmlData).children("controlb")[0];this.m_ptAnchorA=bwTweenPosition.GetPoint(this.m_oTarget,a);this.m_ptAnchorB=bwTweenPosition.GetPoint(this.m_oTarget,b);this.m_ptControlA=bwTweenPosition.GetPoint(this.m_oTarget,c);this.m_ptControlB=bwTweenPosition.GetPoint(this.m_oTarget,d);this.m_oCurve=new BezierSegment(this.m_ptAnchorA,
this.m_ptControlA,this.m_ptControlB,this.m_ptAnchorB);this.BuildDistances()};bwCubicBezierSegment.prototype.GetLength=function(){return this.m_arrDistances[this.m_arrDistances.length-1].Distance};
bwCubicBezierSegment.prototype.GetPointAtPosition=function(a){for(var b=null,c=0;c<this.m_arrDistances.length;c++)if(this.m_arrDistances[c].Distance>=a){b=this.m_arrDistances[c].Distance>a?this.FindPointByDistance(a,this.m_arrDistances[c-1].Time,this.m_arrDistances[c].Time,this.m_arrDistances[c-1].Distance,this.m_arrDistances[c-1].CurvePoint):this.m_arrDistances[c].CurvePoint;break}if(!b)b=this.m_arrDistances[c-1].CurvePoint;return b};
bwCubicBezierSegment.prototype.FindPointByDistance=function(a,b,c,d,e){for(var f=(b+c)/2,g=this.m_oCurve.getValue(f),h=g.x-e.x,j=g.y-e.y,h=d+Math.sqrt(h*h+j*j),l=0;Math.abs(h-a)>this.m_nAccuracy&&100>l;)h<a?(b=f,e=g,d=h):h>a&&(c=f),f=(b+c)/2,g=this.m_oCurve.getValue(f),h=g.x-e.x,j=g.y-e.y,h=d+Math.sqrt(h*h+j*j),l++;return g};
bwCubicBezierSegment.prototype.BuildDistances=function(){var a=0,b=this.m_oCurve.getValue(0),c=null,d=0,e=0,f=0,d=null;this.m_arrDistances=[];d={};d.CurvePoint=b;d.Distance=f;d.Time=0;this.m_arrDistances.push(d);for(var g=1;g<=this.m_nPrecision;g++)a=g/this.m_nPrecision,c=this.m_oCurve.getValue(a),d=c.x-b.x,e=c.y-b.y,f+=Math.sqrt(d*d+e*e),d={},d.CurvePoint=c,d.Distance=f,d.Time=a,this.m_arrDistances.push(d),b=c};function bwQuadraticBezierSegment(a,b,c,d){this.m_nPrecision=10;this.m_nAccuracy=0.5;this.m_oTarget=this.m_xmlData=this.m_grDebug=this.m_arrDistances=this.m_ptControl=this.m_ptAnchorB=this.m_ptAnchorA=null;this.m_oTarget=a;this.m_nPrecision=c;this.m_grDebug=d;if(b)this.m_xmlData=b,this.ParseXML()}
bwQuadraticBezierSegment.prototype.ParseXML=function(){this.m_ptAnchorA=bwTweenPosition.GetPoint(this.m_oTarget,this.m_xmlData.anchora[0]);this.m_ptAnchorB=bwTweenPosition.GetPoint(this.m_oTarget,this.m_xmlData.anchorb[0]);this.m_ptControl=bwTweenPosition.GetPoint(this.m_oTarget,this.m_xmlData.controla[0]);this.BuildDistances()};bwQuadraticBezierSegment.prototype.GetLength=function(){return this.m_arrDistances[this.m_arrDistances.length-1].Distance};
bwQuadraticBezierSegment.prototype.GetPointAtPosition=function(a){for(var b=null,c=0;c<this.m_arrDistances.length;c++)if(this.m_arrDistances[c].Distance>=a){b=this.m_arrDistances[c].Distance>a?FindPointByDistance(a,this.m_arrDistances[c-1].Time,this.m_arrDistances[c].Time,this.m_arrDistances[c-1].Distance,this.m_arrDistances[c-1].CurvePoint):this.m_arrDistances[c].CurvePoint;break}if(!b)b=this.m_arrDistances[c-1].CurvePoint;return b};
bwQuadraticBezierSegment.prototype.FindPointByDistance=function(a,b,c,d,e){for(var f=(b+c)/2,g=GetPointAtTime(f),h=g.x-e.x,j=g.y-e.y,h=d+Math.sqrt(h*h+j*j),l=0;Math.abs(h-a)>this.m_nAccuracy&&100>l;)h<a?(b=f,e=g,d=h):h>a&&(c=f),f=(b+c)/2,g=GetPointAtTime(f),h=g.x-e.x,j=g.y-e.y,h=d+Math.sqrt(h*h+j*j),l++;return g};
bwQuadraticBezierSegment.prototype.BuildDistances=function(){var a=0,b=GetPointAtTime(0),c=null,d=0,e=0,f=0,d=null;this.m_arrDistances=[];d={};d.CurvePoint=b;d.Distance=f;d.Time=0;this.m_arrDistances.push(d);for(var g=1;g<=this.m_nPrecision;g++)a=g/this.m_nPrecision,c=GetPointAtTime(a),d=c.x-b.x,e=c.y-b.y,f+=Math.sqrt(d*d+e*e),d={},d.CurvePoint=c,d.Distance=f,d.Time=a,this.m_arrDistances.push(d),b=c,this.m_grDebug&&(this.m_grDebug.beginFill(16711680),this.m_grDebug.drawCircle(c.x,c.y,0.5),this.m_grDebug.endFill())};
bwQuadraticBezierSegment.prototype.GetPointAtTime=function(a){return new Point((1-a)*(1-a)*this.m_ptAnchorA.x+2*a*(1-a)*this.m_ptControl.x+a*a*this.m_ptAnchorB.x,(1-a)*(1-a)*this.m_ptAnchorA.y+2*a*(1-a)*this.m_ptControl.y+a*a*this.m_ptAnchorB.y)};var license="TERMS OF USE - EASING EQUATIONSOpen source under the BSD License. Copyright \ufffd 2001 Robert PennerAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materialsprovided with the distribution.Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THECOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTEGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
bwEasingLinear=function(){};bwEasingLinear.easeIn=function(a,b,c,d){return c*a/d+b};bwEasingLinear.easeOut=bwEasingLinear.easeIn;bwEasingLinear.easeInOut=bwEasingLinear.easeIn;var bwEasingQuadratic=function(){};bwEasingQuadratic.easeIn=function(a,b,c,d){return c*(a/=d)*a+b};bwEasingQuadratic.easeOut=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};bwEasingQuadratic.easeInOut=function(a,b,c,d){return 1>(a/=d/2)?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b};var bwEasingCubic=function(){};
bwEasingCubic.easeIn=function(a,b,c,d){return c*Math.pow(a/d,3)+b};bwEasingCubic.easeOut=function(a,b,c,d){return c*(Math.pow(a/d-1,3)+1)+b};bwEasingCubic.easeInOut=function(a,b,c,d){return 1>(a/=d/2)?c/2*Math.pow(a,3)+b:c/2*(Math.pow(a-2,3)+2)+b};var bwEasingQuartic=function(){};bwEasingQuartic.easeIn=function(a,b,c,d){return c*Math.pow(a/d,4)+b};bwEasingQuartic.easeOut=function(a,b,c,d){return-c*(Math.pow(a/d-1,4)-1)+b};
bwEasingQuartic.easeInOut=function(a,b,c,d){return 1>(a/=d/2)?c/2*Math.pow(a,4)+b:-c/2*(Math.pow(a-2,4)-2)+b};var bwEasingQuintic=function(){};bwEasingQuintic.easeIn=function(a,b,c,d){return c*Math.pow(a/d,5)+b};bwEasingQuintic.easeOut=function(a,b,c,d){return c*(Math.pow(a/d-1,5)+1)+b};bwEasingQuintic.easeInOut=function(a,b,c,d){return 1>(a/=d/2)?c/2*Math.pow(a,5)+b:c/2*(Math.pow(a-2,5)+2)+b};var bwEasingSine=function(){};
bwEasingSine.easeIn=function(a,b,c,d){return c*(1-Math.cos(a/d*(Math.PI/2)))+b};bwEasingSine.easeOut=function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b};bwEasingSine.easeInOut=function(a,b,c,d){return c/2*(1-Math.cos(Math.PI*a/d))+b};var bwEasingExponential=function(){};bwEasingExponential.easeIn=function(a,b,c,d){return c*Math.pow(2,10*(a/d-1))+b};bwEasingExponential.easeOut=function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b};
bwEasingExponential.easeInOut=function(a,b,c,d){return 1>(a/=d/2)?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b};var bwEasingCircular=function(){};bwEasingCircular.easeIn=function(a,b,c,d){return c*(1-Math.sqrt(1-(a/=d)*a))+b};bwEasingCircular.easeOut=function(a,b,c,d){return c*Math.sqrt(1-(a=a/d-1)*a)+b};bwEasingCircular.easeInOut=function(a,b,c,d){return 1>(a/=d/2)?c/2*(1-Math.sqrt(1-a*a))+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b};var bwEasingBounce=function(){};
bwEasingBounce.easeIn=function(a,b,c,d){return c-bwEasingBounce.easeOut(d-a,0,c,d)+b};bwEasingBounce.easeOut=function(a,b,c,d){return(a/=d)<1/2.75?c*7.5625*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+0.984375)+b};bwEasingBounce.easeInOut=function(a,b,c,d){return a<d/2?0.5*bwEasingBounce.easeIn(2*a,0,c,d)+b:0.5*bwEasingBounce.easeOut(2*a-d,0,c,d)+0.5*c+b};var bwEasingBack=function(){};
bwEasingBack.easeIn=function(a,b,c,d,e){e||(e=1.70158);return c*(a/=d)*a*((e+1)*a-e)+b};bwEasingBack.easeOut=function(a,b,c,d,e){e||(e=1.70158);return c*((a=a/d-1)*a*((e+1)*a+e)+1)+b};bwEasingBack.easeInOut=function(a,b,c,d,e){e||(e=1.70158);return 1>(a/=d/2)?c/2*a*a*(((e*=1.525)+1)*a-e)+b:c/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b};var bwEasingElastic=function(){};
bwEasingElastic.easeIn=function(a,b,c,d,e,f){if(0==a)return b;if(1==(a/=d))return b+c;f||(f=0.3*d);!e||e<Math.abs(c)?(e=c,c=f/4):c=f/(2*Math.PI)*Math.asin(c/e);return-(e*Math.pow(2,10*(a-=1))*Math.sin((a*d-c)*2*Math.PI/f))+b};bwEasingElastic.easeOut=function(a,b,c,d,e,f){if(0==a)return b;if(1==(a/=d))return b+c;f||(f=0.3*d);var g;!e||e<Math.abs(c)?(e=c,g=f/4):g=f/(2*Math.PI)*Math.asin(c/e);return e*Math.pow(2,-10*a)*Math.sin((a*d-g)*2*Math.PI/f)+c+b};
bwEasingElastic.easeInOut=function(a,b,c,d,e,f){if(0==a)return b;if(2==(a/=d/2))return b+c;f||(f=d*0.3*1.5);var g;!e||e<Math.abs(c)?(e=c,g=f/4):g=f/(2*Math.PI)*Math.asin(c/e);return 1>a?-0.5*e*Math.pow(2,10*(a-=1))*Math.sin((a*d-g)*2*Math.PI/f)+b:0.5*e*Math.pow(2,-10*(a-=1))*Math.sin((a*d-g)*2*Math.PI/f)+c+b};function bwTweenEvent(a,b,c){this.m_oTarget=this.m_xmlData=null;this.m_nDuration=this.m_nStartTime=0;this.m_oColorTween=this.m_oSkewTween=this.m_oMaskTween=this.m_oAlphaTween=this.m_oScaleTween=this.m_oRotationTween=this.m_oPositionTween=null;this.m_nInitRotation=c||0;this.m_xmlData=b;this.m_oTarget=a;this.ParseXMLData()}bwTweenEvent.prototype.getStartTime=function(){return this.m_nStartTime};bwTweenEvent.prototype.getDuration=function(){return this.m_nDuration};
bwTweenEvent.prototype.ParseXMLData=function(){this.m_nStartTime=parseInt($(this.m_xmlData).attr("time"));this.m_nDuration=parseInt($(this.m_xmlData).attr("duration"));if(0==this.m_nDuration)this.isZeroLength=!0,this.m_nDuration=1;if(0!=$(this.m_xmlData).children("position").length)this.m_oPositionTween=new bwTweenPosition(this.m_oTarget,$(this.m_xmlData).children("position")[0]);if(0!=$(this.m_xmlData).children("scale").length)"true"==$(this.m_xmlData).children("scale").attr("useglobalaxes")?this.AddOrUpdateMatrixTween($(this.m_xmlData).children("scale")[0],
bwTweenMatrix.FROM_SCALE,this.m_nInitRotation):this.m_oScaleTween=new bwTweenScale(this.m_oTarget,$(this.m_xmlData).children("scale")[0]);if(0!=$(this.m_xmlData).children("rotation").length)this.m_oRotationTween=new bwTweenRotation(this.m_oTarget,$(this.m_xmlData).children("rotation")[0]);if(0!=$(this.m_xmlData).children("alpha").length)this.m_oAlphaTween=new bwTweenAlpha(this.m_oTarget,$(this.m_xmlData).children("alpha")[0]);if(0!=$(this.m_xmlData).children("mask").length)this.m_oMaskTween=new bwTweenMask(this.m_oTarget,
$(this.m_xmlData).children("mask")[0]);if(0!=$(this.m_xmlData).children("skew").length)"true"==$(this.m_xmlData).children("skew").attr("useglobalaxes")?this.AddOrUpdateMatrixTween($(this.m_xmlData).children("skew")[0],bwTweenMatrix.FROM_SKEW,this.m_nInitRotation):this.m_oSkewTween=new bwTweenSkew(this.m_oTarget,$(this.m_xmlData).children("skew")[0])};
bwTweenEvent.prototype.AddOrUpdateMatrixTween=function(a,b,c){null==this.m_oMatrixTween?this.m_oMatrixTween=new bwTweenMatrix(this.m_oTarget,a,b,c):this.m_oMatrixTween.ModifyExistingMatrix(a,b,c)};bwTweenEvent.prototype.GetPointAtTime=function(a,b){var c=null;if(this.m_oPositionTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oPositionTween.GetPointAtTime(a,b)}return c};
bwTweenEvent.prototype.GetRotationAtTime=function(a,b){var c=NaN;if(this.m_oRotationTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oRotationTween.GetRotationAtTime(a,b)}return c};bwTweenEvent.prototype.GetScaleAtTime=function(a,b){var c=null;if(this.m_oScaleTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oScaleTween.GetScaleAtTime(a,b)}return c};
bwTweenEvent.prototype.GetAlphaAtTime=function(a,b){var c=NaN;if(this.m_oAlphaTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oAlphaTween.GetAlphaAtTime(a,b)}return c};bwTweenEvent.prototype.GetSkewAtTime=function(a,b){var c=null;if(this.m_oSkewTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oSkewTween.GetSkewAtTime(a,b)}return c};
bwTweenEvent.prototype.GetMatrixAtTime=function(a,b){var c=null;if(this.m_oMatrixTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oMatrixTween.GetMatrixAtTime(a,b)}return c};bwTweenEvent.prototype.GetSkewRegPoint=function(){return this.m_oSkewTween?this.m_oSkewTween.GetSkewRegPoint():null};bwTweenEvent.prototype.GetMaskAtTime=function(){return this.m_oMaskTween?this:null};
bwTweenEvent.prototype.GetColorAtTime=function(a,b){var c=null;if(this.m_oColorTween){a-=this.m_nStartTime;0>a&&(a=0);if(a>this.m_nDuration)a=this.m_nDuration;c=this.m_oColorTween.GetColorTransformAtTime(a,b)}return c};function bwTween(a,b){this.SEGMENT_QUADRATIC="quadratic";this.SEGMENT_CUBIC="cubic";this.SEGMENT_LINE="line";this.PRECISION=10;this.m_oTarget=this.m_xmlData=null;this.m_nDuration=0;this.m_nEasingType=this.EASE_LINEAR;this.m_nEasingDirection=this.EASE_INOUT;this.m_clsEasing=bwEasingQuadratic;this.m_xmlData=b;this.m_oTarget=a}bwTween.EASE_BOUNCE="bounce";bwTween.EASE_CIRCULAR="circular";bwTween.EASE_CUBIC="cubic";bwTween.EASE_EXPONENTIAL="exponetial";bwTween.EASE_LINEAR="linear";
bwTween.EASE_QUADRATIC="quadradic";bwTween.EASE_QUARTIC="quartic";bwTween.EASE_QUINTIC="quintic";bwTween.EASE_SINE="sine";bwTween.EASE_IN="easein";bwTween.EASE_OUT="easeout";bwTween.EASE_INOUT="easeinout";bwTween.CLASSES={};bwTween.CLASSES[bwTween.EASE_BOUNCE]=bwEasingBounce;bwTween.CLASSES[bwTween.EASE_CIRCULAR]=bwEasingCircular;bwTween.CLASSES[bwTween.EASE_CUBIC]=bwEasingCubic;bwTween.CLASSES[bwTween.EASE_EXPONENTIAL]=bwEasingExponential;bwTween.CLASSES[bwTween.EASE_LINEAR]=bwEasingLinear;
bwTween.CLASSES[bwTween.EASE_QUADRATIC]=bwEasingQuadratic;bwTween.CLASSES[bwTween.EASE_QUARTIC]=bwEasingQuartic;bwTween.CLASSES[bwTween.EASE_QUINTIC]=bwEasingQuintic;bwTween.CLASSES[bwTween.EASE_SINE]=bwEasingSine;
bwTween.prototype.ParseXMLData=function(){this.m_nDuration=$(this.m_xmlData).attr("duration");if((this.m_nEasingType=$(this.m_xmlData).attr("easing"))&&bwTween.CLASSES.hasOwnProperty(this.m_nEasingType))this.m_clsEasing=bwTween.CLASSES[this.m_nEasingType];this.m_nEasingDirection=$(this.m_xmlData).attr("easingdir");if(0==this.m_nDuration)this.isZeroLength=!0,this.m_nDuration=1};
bwTween.GetValue=function(a,b){var c=0,c=b.charAt(0),d=b.charAt(1),e=1,f=!1;"$"==c||"$"==d?("$"==d&&(e=2,f=!0),c=a.GetProperty(b.substr(e)),f&&(c=-c)):"#"==c||"#"==d?("#"==d&&(e=2,f=!0),c=a.GetVariable(b.substr(e)),f&&(c=-c)):c=parseFloat(b);isNaN(c)&&(c=0);return parseFloat(c)};bwTween.prototype.GetValue=function(a){return bwTween.GetValue(this.m_oTarget,a)};
bwTween.prototype.GetDistanceAtTime=function(a,b,c){b=Math.max(0,Math.min(this.m_nDuration,b));c=c?0:1;if(0<this.m_nDuration)switch(this.m_nEasingDirection){case bwTween.EASE_IN:c=this.m_clsEasing.easeIn(b,0,1,this.m_nDuration);break;case bwTween.EASE_OUT:c=this.m_clsEasing.easeOut(b,0,1,this.m_nDuration);break;default:c=this.m_clsEasing.easeInOut(b,0,1,this.m_nDuration)}return c*a};function bwTweenAlpha(a,b){this.m_arrSegments=null;this.m_nLength=0;this.m_arrSegments=[];bwTween.call(this,a,b);this.ParseXMLData()}bwTweenAlpha.prototype=new bwTween;bwTweenAlpha.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);for(var a=$(this.m_xmlData).children("path").children("segment"),b=a.length,c=null,d=0;d<b;d++)c=this.GetAlphaSegment(a[d]),this.m_arrSegments.push(c),this.m_nLength+=c.Length};
bwTweenAlpha.prototype.GetAlphaSegment=function(a){var b=bwTween.GetValue(this.m_oTarget,$(a).attr("start"))+bwTween.GetValue(this.m_oTarget,$(a).attr("dstart")),a=bwTween.GetValue(this.m_oTarget,$(a).attr("end"))+bwTween.GetValue(this.m_oTarget,$(a).attr("dend"));return new bwAlphaSegment(b,a)};
bwTweenAlpha.prototype.GetAlphaAtTime=function(a,b){if(this.isZeroLength)return b?this.m_arrSegments[0].Start:this.m_arrSegments[this.m_arrSegments.length-1].End;for(var c=0,d=0,e=this.GetDistanceAtTime(this.m_nLength,a,b);c<this.m_arrSegments.length&&e>d+this.m_arrSegments[c].getLength();)d+=this.m_arrSegments[c].getLength(),c++;var f=0;return f=this.m_arrSegments[c].Reverse?this.m_arrSegments[c].Start-(e-d):this.m_arrSegments[c].Start+(e-d)};
function bwAlphaSegment(a,b){this.Length=this.End=this.Start=this.nLength=0;this.Reverse=!1;this.Start=a;this.End=b;this.CalcLength()}bwAlphaSegment.prototype.CalcLength=function(){this.End<this.Start?(this.Reverse=!0,this.Length=this.Start-this.End):this.Length=this.End-this.Start};bwAlphaSegment.prototype.getLength=function(){return this.Length};function bwTweenPosition(a,b){this.m_nLength=0;this.m_arrSegments=null;this.m_arrSegments=[];bwTween.call(this,a,b);this.ParseXMLData()}bwTweenPosition.prototype=new bwTween;
bwTweenPosition.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);for(var a=null,b=$(this.m_xmlData).children("path").children("segment"),c=b.length,d="",e=0;e<c;e++){d=$(b[e]).attr("type");switch(d){case this.SEGMENT_CUBIC:a=new bwCubicBezierSegment(this.m_oTarget,b[e],this.PRECISION);break;case this.SEGMENT_QUADRATIC:a=new bwQuadraticBezierSegment(this.m_oTarget,b[e],this.PRECISION);break;case this.SEGMENT_LINE:a=new bwLineSegment(this.m_oTarget,b[e])}this.m_arrSegments.push(a);
this.m_nLength+=a.GetLength()}};
bwTweenPosition.prototype.GetPointAtTime=function(a,b){if(this.isZeroLength){var c=this.m_arrSegments[0].GetPointAtPosition(0);b||(c=this.m_arrSegments[this.m_arrSegments.length-1].GetPointAtPosition(this.m_nLength));c.x=Math.round(c.x);c.y=Math.round(c.y);return c}for(var d=c=0,e=this.GetDistanceAtTime(this.m_nLength,a,b);c<this.m_arrSegments.length&&e>d+this.m_arrSegments[c].GetLength();)d+=this.m_arrSegments[c].GetLength(),c++;c=this.m_arrSegments[c].GetPointAtPosition(e-d);c.x=Math.round(c.x);
c.y=Math.round(c.y);return c};bwTweenPosition.GetPoint=function(a,b){var c=$(b).attr("x"),d=$(b).attr("y"),e=$(b).attr("dx"),f=$(b).attr("dy"),g=0,h=0,j=0,l=0;null!=a?(g=bwTween.GetValue(a,c),h=bwTween.GetValue(a,d),j=bwTween.GetValue(a,e),l=bwTween.GetValue(a,f)):(g=ForceInt(c),h=ForceInt(d),j=ForceInt(e),l=ForceInt(f));return new Point(g+j,h+l)};bwTweenPosition.prototype.GetPoint=function(a,b){return bwTweenPosition.GetPoint(a,b)};function bwTweenRotation(a,b){this.m_arrSegments=null;this.m_nLength=0;this.m_arrSegments=[];bwTween.call(this,a,b);this.ParseXMLData()}bwTweenRotation.prototype=new bwTween;bwTweenRotation.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);for(var a=$(this.m_xmlData).children("path").children("segment"),b=a.length,c=null,d=0,d=0;d<b;d++)c=this.GetRotationSegment(a[d]),this.m_arrSegments.push(c),this.m_nLength+=c.Length};
bwTweenRotation.prototype.GetRotationSegment=function(a){var b=bwTween.GetValue(this.m_oTarget,$(a).attr("start"))+bwTween.GetValue(this.m_oTarget,$(a).attr("dstart")),a=bwTween.GetValue(this.m_oTarget,$(a).attr("end"))+bwTween.GetValue(this.m_oTarget,$(a).attr("dend"));return new bwRotationSegment(b,a)};
bwTweenRotation.prototype.GetRotationAtTime=function(a,b){if(this.isZeroLength)return b?this.m_arrSegments[0].Start:this.m_arrSegments[this.m_arrSegments.length-1].End;for(var c=0,d=0,e=this.GetDistanceAtTime(this.m_nLength,a,b);c<this.m_arrSegments.length&&e>d+this.m_arrSegments[c].getLength();)d+=this.m_arrSegments[c].getLength(),c++;var f=0;return f=this.m_arrSegments[c].Reverse?this.m_arrSegments[c].Start-(e-d):this.m_arrSegments[c].Start+(e-d)};
function bwRotationSegment(a,b){this.Length=this.End=this.Start=0;this.Reverse=!1;this.Start=a;this.End=b;this.CalcLength()}bwRotationSegment.prototype.CalcLength=function(){this.End<this.Start?(this.Reverse=!0,this.Length=this.Start-this.End):this.Length=this.End-this.Start};bwRotationSegment.prototype.getLength=function(){return this.Length};function bwTweenScale(a,b){this.m_arrSegments=null;this.m_nLength=0;this.m_arrSegments=[];bwTween.call(this,a,b);this.ParseXMLData()}bwTweenScale.prototype=new bwTween;
bwTweenScale.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);for(var a=$(this.m_xmlData).children("path").children("segment"),b=a.length,c=null,d=0,d=0;d<b;d++){var e=a[d],f=bwTween.GetValue(this.m_oTarget,$(e).attr("startx")),g=bwTween.GetValue(this.m_oTarget,$(e).attr("starty")),h=bwTween.GetValue(this.m_oTarget,$(e).attr("dsx")),j=bwTween.GetValue(this.m_oTarget,$(e).attr("dsy")),c=bwTween.GetValue(this.m_oTarget,$(e).attr("endx")),l=bwTween.GetValue(this.m_oTarget,
$(e).attr("endy")),m=bwTween.GetValue(this.m_oTarget,$(e).attr("dex")),e=bwTween.GetValue(this.m_oTarget,$(e).attr("dey")),f=new Point(f+h,g+j),c=new Point(c+m,l+e),c=new bwScaleSegment(f,c);this.m_arrSegments.push(c);this.m_nLength+=c.getLength()}};
bwTweenScale.prototype.GetScaleAtTime=function(a,b){if(this.isZeroLength)return b?this.m_arrSegments[0].GetPointAtPosition(0):this.m_arrSegments[this.m_arrSegments.length-1].GetPointAtPosition(this.m_nLength);for(var c=0,d=0,e=this.GetDistanceAtTime(this.m_nLength,a,b);c<this.m_arrSegments.length&&e>d+this.m_arrSegments[c].getLength();)d+=this.m_arrSegments[c].getLength(),c++;return this.m_arrSegments[c].GetPointAtPosition(e-d)};
function bwScaleSegment(a,b){this.m_nAngle=this.m_nLength=0;this.m_ptAnchorB=this.m_ptAnchorA=null;this.m_nDY=this.m_nDX=0;this.m_ptAnchorA=a;this.m_ptAnchorB=b;this.m_nDX=this.m_ptAnchorB.x-this.m_ptAnchorA.x;this.m_nDY=this.m_ptAnchorB.y-this.m_ptAnchorA.y;this.CalcLength()}
bwScaleSegment.prototype.CalcLength=function(){var a=this.m_ptAnchorB.x-this.m_ptAnchorA.x,b=this.m_ptAnchorB.y-this.m_ptAnchorA.y;this.m_nLength=Math.sqrt(a*a+b*b);this.m_nAngle=Math.atan((this.m_ptAnchorB.y-this.m_ptAnchorA.y)/(this.m_ptAnchorB.x-this.m_ptAnchorA.x));if(this.m_ptAnchorB.x==this.m_ptAnchorA.x&&this.m_ptAnchorB.y==this.m_ptAnchorA.y)this.m_nAngle=0;this.m_ptAnchorB.x<this.m_ptAnchorA.x&&(this.m_nAngle+=Math.PI)};
bwScaleSegment.prototype.GetPointAtPosition=function(a){a/=this.m_nLength;0==this.m_nLength&&(a=0);return new Point(this.m_ptAnchorA.x+this.m_nDX*a,this.m_ptAnchorA.y+this.m_nDY*a)};bwScaleSegment.prototype.getLength=function(){return this.m_nLength};function bwTweenSkew(a,b){this.m_arrSegments=[];this.m_nLength=0;this.m_ptSkewReg=null;bwTween.call(this,a,b);this.ParseXMLData()}bwTweenSkew.prototype=new bwTween;bwTweenSkew.prototype.GetSkewAtTime=function(a,b){var c=this.GetDistanceAtTime(this.m_nLength,a,b),d,e;for(e in this.m_arrSegments){d=this.m_arrSegments[e];var f=d.Length;if(f<c)c-=f;else break}c=d.GetPointAtPosition(c);c.regpoint=this.m_ptSkewReg;return c};bwTweenSkew.prototype.GetSkewRegPoint=function(){return this.m_ptSkewReg};
bwTweenSkew.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);var a=$(this.m_xmlData).children("regpoint");this.m_ptSkewReg=new Point(parseFloat(a.attr("x")),parseFloat(a.attr("y")));for(var a=$(this.m_xmlData).children("path").children("segment"),b=a.length,c=null,d=0,d=0;d<b;d++){var e=a[d],f=bwTween.GetValue(this.m_oTarget,$(e).attr("startx")),g=bwTween.GetValue(this.m_oTarget,$(e).attr("starty")),h=bwTween.GetValue(this.m_oTarget,$(e).attr("dstartx")),j=bwTween.GetValue(this.m_oTarget,
$(e).attr("dstarty")),c=bwTween.GetValue(this.m_oTarget,$(e).attr("endx")),l=bwTween.GetValue(this.m_oTarget,$(e).attr("endy")),m=bwTween.GetValue(this.m_oTarget,$(e).attr("dendx")),e=bwTween.GetValue(this.m_oTarget,$(e).attr("dendy")),f=new Point(f+h,g+j),c=new Point(c+m,l+e),c=new bwSkewSegment(f,c);this.m_arrSegments.push(c);this.m_nLength+=c.getLength()}};
function bwSkewSegment(a,b){this.m_ptStart=a;this.m_ptEnd=b;this.m_nDeltaX=this.m_ptEnd.x-this.m_ptStart.x;this.m_nDeltaY=this.m_ptEnd.y-this.m_ptStart.y;this.Length=Math.sqrt(this.m_nDeltaX*this.m_nDeltaX+this.m_nDeltaY*this.m_nDeltaY)}bwSkewSegment.prototype.GetPointAtPosition=function(a){a=0==this.Length?0:a/this.Length;return new Point(this.m_ptStart.x+this.m_nDeltaX*a,this.m_ptStart.y+this.m_nDeltaY*a)};bwSkewSegment.prototype.getLength=function(){return this.Length};var bwTweenMatrix=function(a,b,c,d){this.m_arrMatrices=[];this.m_nLength=0;this.m_strFrom=c||bwTweenMatrix.FROM_NONE;this.m_nInitRotation=d||0;this.m_bZeroScaleAtEnd=!1;bwTween.call(this,a,b);this.ParseXMLData()};bwTweenMatrix.prototype=new bwTween;bwTweenMatrix.FROM_NONE="fromNone";bwTweenMatrix.FROM_SCALE="fromScale";bwTweenMatrix.FROM_SKEW="fromSkew";bwTweenMatrix.TOP_LEFT="topleft";bwTweenMatrix.TOP_RIGHT="topright";bwTweenMatrix.BOTTOM_LEFT="bottomleft";bwTweenMatrix.BOTTOM_RIGHT="bottomright";
bwTweenMatrix.DEGREE_MULTIPLIER=2*Math.PI/360;bwTweenMatrix.prototype.GetMatrixAtTime=function(a,b){var c=this.GetDistanceAtTime(this.m_nLength,a,b),d=parseInt(c),e=c-d,f=null;this.m_bZeroScaleAtEnd&&d==c?f=new MatrixTransform:(0==e&&0<d&&(d--,e=1),d<this.m_arrMatrices.length&&(f=this.m_arrMatrices[d].GetMatrixAtPosition(e)));return f};bwTweenMatrix.prototype.ModifyExistingMatrix=function(a,b,c){this.m_xmlData=a;this.m_bFromScale=b||!1;this.m_nInitRotation=c||0;this.CreateAndAddSegments($(this.m_xmlData).children("path").children("segment"))};
bwTweenMatrix.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);this.CreateAndAddSegments($(this.m_xmlData).children("path").children("segment"))};bwTweenMatrix.prototype.CreateAndAddSegments=function(a){for(var b=a.length,c=null,d=c=null,e=0;e<b;e++)d=e<this.m_arrMatrices.length?this.m_arrMatrices[e]:null,c=a[e],c=this.CreateMatrixSegment(c,d),this.m_arrMatrices[e]=c;this.m_nLength=Math.max(this.m_nLength,b)};
bwTweenMatrix.prototype.CreateMatrixSegment=function(a,b){var c=null;this.m_strFrom==bwTweenMatrix.FROM_SCALE?c=this.BuildSegmentFromScaleXML(a,b):this.m_strFrom==bwTweenMatrix.FROM_SKEW&&(c=this.BuildSegmentFromSkewXML(a,b));return c};
bwTweenMatrix.prototype.BuildSegmentFromScaleXML=function(a,b){var c=this.m_nInitRotation*bwTweenMatrix.DEGREE_MULTIPLIER,d="true"==a.startrelative?this.m_oTarget.scaleX:1,e="true"==a.startrelative?this.m_oTarget.scaleY:1,f=null!=b?b.MatrixStart:new MatrixTransform,g=d*(this.GetValue($(a).attr("startx"))+this.GetValue($(a).attr("dsx")))/100,h=e*(this.GetValue($(a).attr("starty"))+this.GetValue($(a).attr("dsy")))/100;if(1!=g||1!=h)f.rotate(-c),f.scale(g,h),f.rotate(c);g=null!=b?b.MatrixEnd:new MatrixTransform;
d=d*(this.GetValue($(a).attr("endx"))+this.GetValue($(a).attr("dex")))/100;e=e*(this.GetValue($(a).attr("endy"))+this.GetValue($(a).attr("dey")))/100;this.m_bZeroScaleAtEnd=0==d||0==e;if(1!=d||1!=e)g.rotate(-c),g.scale(d,e),g.rotate(c);return new bwMatrixSegment(f,g)};
bwTweenMatrix.prototype.GetSkewRotation=function(){var a=this.m_nInitRotation,b=$(this.m_xmlData).attr("corner");b==bwTweenMatrix.TOP_RIGHT&&(a+=90);b==bwTweenMatrix.TOP_LEFT?a+=180:b==bwTweenMatrix.BOTTOM_LEFT&&(a+=270);return(a+360)%360};
bwTweenMatrix.prototype.GetSkewRegPoint=function(){var a=this.GetSkewRotation(),b=this.m_oTarget.GetBoundingRect();null==b&&(b=new ppRect(0,0,this.m_oTarget.width,this.m_oTarget.height));var c=b.GetWidth(),b=b.GetHeight(),c=0.5*c,b=0.5*b,d=NaN,e=NaN;45>=a?(d=0.5*-c,e=-b):90>=a?(d=-c,e=-b):135>=a?(d=-c,e=0):180>=a?(d=0,e=b):225>=a?(d=c,e=b):270>=a?(d=c,e=0):(d=315>=a?c:0,e=-b);return{x:d,y:e}};
bwTweenMatrix.prototype.BuildSegmentFromSkewXML=function(a,b){var c=this.GetSkewRegPoint(),d=c.x,c=c.y,e=this.GetSkewRotation(),e=this.ToRadians(e),f=null!=b?b.MatrixStart:new MatrixTransform,g=this.ToRadians(this.GetValue($(a).attr("startx"))+this.GetValue($(a).attr("dstartx"))),h=this.ToRadians(this.GetValue($(a).attr("starty"))+this.GetValue($(a).attr("dstarty")));if(0!=g||0!=h){var j=this.GetValue($(a).attr("startstretchx"))/100,l=this.GetValue($(a).attr("startstretchy"))/100;f.translate(-d,-c);
f.rotate(-e);f.scale(j,l);this.SkewMatrix(f,g,h);f.rotate(e);f.translate(d,c)}g=null!=b?b.MatrixEnd:new MatrixTransform;h=this.ToRadians(this.GetValue($(a).attr("endx"))+this.GetValue($(a).attr("dendx")));j=this.ToRadians(this.GetValue($(a).attr("endy"))+this.GetValue($(a).attr("dendy")));if(0!=h||0!=j){var l=this.GetValue($(a).attr("endstretchx"))/100,m=this.GetValue($(a).attr("endstretchy"))/100;g.translate(-d,-c);g.rotate(-e);g.scale(l,m);this.SkewMatrix(g,h,j);g.rotate(e);g.translate(d,c)}return new bwMatrixSegment(f,
g)};bwTweenMatrix.prototype.ToRadians=function(a){return a*bwTweenMatrix.DEGREE_MULTIPLIER};bwTweenMatrix.prototype.SkewMatrix=function(a,b,c){var d=new MatrixTransform;d.m[1]=Math.tan(-c);d.m[2]=Math.tan(-b);a.concat(d)};
var bwMatrixSegment=function(a,b){this.MatrixStart=a;this.MatrixEnd=b;this.m_matrixDelta=MatrixTransform.fromValues(this.MatrixEnd.m[0]-this.MatrixStart.m[0],this.MatrixEnd.m[1]-this.MatrixStart.m[1],this.MatrixEnd.m[2]-this.MatrixStart.m[2],this.MatrixEnd.m[3]-this.MatrixStart.m[3],this.MatrixEnd.m[4]-this.MatrixStart.m[4],this.MatrixEnd.m[5]-this.MatrixStart.m[5])};
bwMatrixSegment.prototype.GetMatrixAtPosition=function(a){1<a&&(a=1);0>a&&(a=0);return MatrixTransform.fromValues(this.MatrixStart.m[0]+this.m_matrixDelta.m[0]*a,this.MatrixStart.m[1]+this.m_matrixDelta.m[1]*a,this.MatrixStart.m[2]+this.m_matrixDelta.m[2]*a,this.MatrixStart.m[3]+this.m_matrixDelta.m[3]*a,this.MatrixStart.m[4]+this.m_matrixDelta.m[4]*a,this.MatrixStart.m[5]+this.m_matrixDelta.m[5]*a)};function bwLineSegment(a,b,c){this.m_nAngle=this.m_nLength=0;this.m_rectBounds=new ppRect;this.m_oTarget=this.m_xmlData=this.m_ptAnchorB=this.m_ptAnchorA=this.m_grDebug=this.m_ptSlope=null;this.m_oTarget=a;this.m_grDebug=c;if(b)this.m_xmlData=b,this.ParseXML()}bwLineSegment.ANGLE_LEEWAY=30;bwLineSegment.PI=Math.PI;bwLineSegment.HALF_PI=0.5*bwLineSegment.PI;bwLineSegment.PI_AND_A_HALF=1.5*bwLineSegment.PI;bwLineSegment.TWO_PI=2*bwLineSegment.PI;
bwLineSegment.prototype.ParseXML=function(){var a=$(this.m_xmlData).children("anchora")[0],b=$(this.m_xmlData).children("anchorb")[0];this.m_ptAnchorA=bwTweenPosition.GetPoint(this.m_oTarget,a);this.m_ptAnchorB=bwTweenPosition.GetPoint(this.m_oTarget,b);this.m_rectBounds.top=this.m_ptAnchorA.y<this.m_ptAnchorB.y?this.m_ptAnchorA.y:this.m_ptAnchorB.y;this.m_rectBounds.bottom=this.m_ptAnchorA.y>this.m_ptAnchorB.y?this.m_ptAnchorA.y:this.m_ptAnchorB.y;this.m_rectBounds.left=this.m_ptAnchorA.x<this.m_ptAnchorB.x?
this.m_ptAnchorA.x:this.m_ptAnchorB.x;this.m_rectBounds.right=this.m_ptAnchorA.x>this.m_ptAnchorB.x?this.m_ptAnchorA.x:this.m_ptAnchorB.x;this.CalculateAngleAndLength()};bwLineSegment.prototype.ParseZoomPan=function(a){var b=player.width/a.lastwidth*a.getZoomModifier(),c=player.width/a.width*a.getZoomModifier();this.m_ptAnchorA=new Point(-a.lastx*b,-a.lasty*b);this.m_ptAnchorB=new Point(-a.xpos*c,-a.ypos*c);this.CalculateAngleAndLength()};
bwLineSegment.prototype.CalculateAngleAndLength=function(){this.m_ptSlope=new Point(this.m_ptAnchorB.x-this.m_ptAnchorA.x,this.m_ptAnchorB.y-this.m_ptAnchorA.y);this.m_nLength=Math.sqrt(this.m_ptSlope.x*this.m_ptSlope.x+this.m_ptSlope.y*this.m_ptSlope.y);this.m_nAngle=this.m_ptAnchorB.x==this.m_ptAnchorA.x&&this.m_ptAnchorB.y==this.m_ptAnchorA.y?0:Math.atan((this.m_ptAnchorB.y-this.m_ptAnchorA.y)/(this.m_ptAnchorB.x-this.m_ptAnchorA.x));this.m_ptAnchorB.x<this.m_ptAnchorA.x&&(this.m_nAngle+=Math.PI);
this.m_grDebug&&(this.m_grDebug.lineStyle(1,16711680),this.m_grDebug.moveTo(this.m_ptAnchorA.x,this.m_ptAnchorA.y),this.m_grDebug.lineTo(this.m_ptAnchorB.x,this.m_ptAnchorB.y))};
bwLineSegment.prototype.GetDragPoint=function(a,b){for(var c=this.m_oTarget.getParentGlobalRotation()*ppArt.DEGREE_MULTIPLIER,d=this.m_nAngle+c;0>d;)d+=bwLineSegment.TWO_PI;for(;d>bwLineSegment.TWO_PI;)d-=bwLineSegment.TWO_PI;var e=bwLineSegment.ANGLE_LEEWAY*ppArt.DEGREE_MULTIPLIER,f=new Point(a.x,a.y);if(0==this.m_nLength)f=this.m_ptAnchorA;else{var g=new MatrixTransform;g.rotate(-c);c=new Point(f.x,f.y);c.x=0==d?0:c.y/Math.tan(d);c=g.transformPoint(c.x,c.y);c.x=Math.max(this.m_rectBounds.left,Math.min(this.m_rectBounds.right,
c.x));c.y=Math.max(this.m_rectBounds.top,Math.min(this.m_rectBounds.bottom,c.y));f=new Point(f.x,f.y);f.y=f.x*Math.tan(d);f=g.transformPoint(f.x,f.y);f.x=Math.max(this.m_rectBounds.left,Math.min(this.m_rectBounds.right,f.x));f.y=Math.max(this.m_rectBounds.top,Math.min(this.m_rectBounds.bottom,f.y));f=Math.abs(d-bwLineSegment.HALF_PI)<=e||Math.abs(d-bwLineSegment.PI_AND_A_HALF)<=e?c:d<=e||Math.abs(d-bwLineSegment.TWO_PI)<=e||Math.abs(d-bwLineSegment.PI)<=e?f:this.GetDistanceForPoint(f)>this.GetDistanceForPoint(c)?
f:c;if(!isNaN(b)&&!(f.x==this.m_ptAnchorA.x&&f.y==this.m_ptAnchorA.y||f.x==this.m_ptAnchorB.x&&f.y==this.m_ptAnchorB.y)){d=this.GetDistanceForPoint(f);d=d>=this.m_nLength?this.m_nLength:Math.round(d/b)*b;d=this.GetPointAtPosition(d);if(0>f.x&&0<d.x||0<f.x&&0>d.x)d.x*=-1;if(0>f.y&&0<d.y||0<f.y&&0>d.y)d.y*=-1;f=d}}return f};bwLineSegment.prototype.GetPointAtPosition=function(a){return new Point(this.m_ptAnchorA.x+a*Math.cos(this.m_nAngle),this.m_ptAnchorA.y+a*Math.sin(this.m_nAngle))};
bwLineSegment.prototype.GetDistanceForPoint=function(a){var b=a.x-this.m_ptAnchorA.x,a=a.y-this.m_ptAnchorA.y;return Math.sqrt(b*b+a*a)};bwLineSegment.prototype.GetLength=function(){return this.m_nLength};function MaskGraphics(a,b){this.context=a;this.rect=b;this.m_nYOffset=this.m_nXOffset=this.m_nCurYPos=this.m_nCurXPos=0}MaskGraphics.prototype.clear=function(){this.context.clearRect(0,0,this.rect.GetWidth(),this.rect.GetHeight())};MaskGraphics.prototype.beginFill=function(){};MaskGraphics.prototype.endFill=function(){};MaskGraphics.prototype.moveTo=function(a,b){this.context.moveTo(a+this.m_nXOffset,b+this.m_nYOffset);this.m_nCurXPos=a+this.m_nXOffset;this.m_nCurYPos=b+this.m_nYOffset};
MaskGraphics.prototype.lineTo=function(a,b){this.context.lineTo(a+this.m_nXOffset,b+this.m_nYOffset);this.m_nCurXPos=a+this.m_nXOffset;this.m_nCurYPos=b+this.m_nYOffset};MaskGraphics.prototype.curveTo=function(a,b,c,d,e){this.context.arcTo(a,b,c,d,e)};MaskGraphics.prototype.arc=function(a,b,c,d,e,f){this.context.arc(a,b,c,d,e,f)};
MaskGraphics.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.context.bezierCurveTo(a+this.m_nXOffset,b+this.m_nYOffset,c+this.m_nXOffset,d+this.m_nYOffset,e+this.m_nXOffset,f+this.m_nYOffset);this.m_nCurXPos=e+this.m_nXOffset;this.m_nCurYPos=f+this.m_nYOffset};MaskGraphics.prototype.drawRect=function(a,b,c,d){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.lineTo(a,b)};
MaskGraphics.prototype.drawEllipse=function(a,b,c,d){var e=0.5522848*(c/2),f=0.5522848*(d/2),g=a+c,h=b+d,c=a+c/2,d=b+d/2;this.moveTo(a,d);this.bezierCurveTo(a,d-f,c-e,b,c,b);this.bezierCurveTo(c+e,b,g,d-f,g,d);this.bezierCurveTo(g,d+f,c+e,h,c,h);this.bezierCurveTo(c-e,h,a,d+f,a,d)};function bwMaskBase(a,b){this.IN="in";this.OUT="out";this.VERTICAL="vertical";this.HORIZONTAL="horizontal";this.ACROSS="across";this.DOWN="down";this.VERTICAL_IN="verticalin";this.VERTICAL_OUT="verticalout";this.HORIZONTAL_IN="horizontalin";this.HORIZONTAL_OUT="horizontalout";this.FROM_BOTTOM="frombottom";this.FROM_TOP="fromtop";this.FROM_LEFT="fromleft";this.FROM_RIGHT="fromright";this.LEFT_DOWN="leftdown";this.LEFT_UP="leftup";this.RIGHT_DOWN="rightdown";this.RIGHT_UP="rightup";this.CLOCKWISE="clockwise";
this.COUNTER_CLOCKWISE="counterclockwise";this.ENTRANCE="entrance";this.EXIT="exit";this.MASK_COLOR=16711680;this.m_oTarget=a;this.m_xmlData=b;this.m_oSettings={};this.m_bExitAnimation=!1;this.ParseXMLData();this.m_clipPoints=[]}bwMaskBase.PRECOMPUTED_STEP_SIZE=0.05;bwMaskBase.prototype.Draw=function(){};
bwMaskBase.prototype.ParseXMLData=function(){var a=this;this.m_bExitAnimation=$(this.m_xmlData).attr("effecttype")==this.EXIT;this.m_oSettings={};$(this.m_xmlData).children("settings").children("setting").each(function(b,c){a.m_oSettings[$(c).attr("name")]=$(c).attr("value")})};bwMaskBase.prototype.getInverse=function(){return!1};bwMaskBase.prototype.isClipPath=function(){return!0};bwMaskBase.prototype.getExitAnimation=function(){return this.m_bExitAnimation};
bwMaskBase.prototype.getTargetRect=function(){var a=this.m_oTarget.BoundsForAnimationMask.clone();a.inflate(5,5);return a};bwMaskBase.prototype.getScaledMaskRect=function(a,b,c){isNaN(c)&&(c=b);var d=a.clone();d.inflate(0.5*-a.GetWidth()*(1-b),0.5*-a.GetHeight()*(1-c));return d};bwMaskBase.prototype.StartClipPath=function(){this.m_clipPoints=[]};bwMaskBase.prototype.AddClipPathPoint=function(a,b){this.m_clipPoints.push(a+"% "+b+"%")};
bwMaskBase.prototype.AddClipPathRect=function(a){this.AddClipPathPoint(a.left,a.top);this.AddClipPathPoint(a.right,a.top);this.AddClipPathPoint(a.right,a.bottom);this.AddClipPathPoint(a.left,a.bottom);this.AddClipPathPoint(a.left,a.top)};bwMaskBase.prototype.AddClipPathRectBounds=function(a,b,c,d){c=a+c;d=b+d;this.AddClipPathPoint(a,b);this.AddClipPathPoint(c,b);this.AddClipPathPoint(c,d);this.AddClipPathPoint(a,d);this.AddClipPathPoint(a,b)};
bwMaskBase.prototype.AddClipPathExtentsCCW=function(){this.AddClipPathPoint(0,0);this.AddClipPathPoint(0,100);this.AddClipPathPoint(100,100);this.AddClipPathPoint(100,0);this.AddClipPathPoint(0,0)};bwMaskBase.prototype.FinishClipPath=function(){return this.m_clipPoints.join(",")};bwMaskBase.prototype.GetUniqueConfigurationKey=function(a){var a=a||"",b;for(b in this.m_oSettings)a+=this.m_oSettings[b];a+=this.getExitAnimation()?"_exit":"";return a+=this.getInverse()?"_inverse":""};function bwMaskWipe(a,b){bwMaskBase.call(this,a,b)}bwMaskWipe.prototype=new bwMaskBase;
bwMaskWipe.prototype.Draw=function(a){this.getExitAnimation()&&(a=1-a);var b=this.getTargetRect(),c=b.clone();if(this.getDirection()==this.FROM_BOTTOM||this.getDirection()==this.FROM_TOP){var d=c.GetHeight(),d=d*a;this.getDirection()==this.FROM_BOTTOM&&!this.getExitAnimation()||this.getDirection()==this.FROM_TOP&&this.getExitAnimation()?(c.bottom=b.bottom,c.top=c.bottom-d):c.bottom=c.top+d}else d=c.GetWidth(),d*=a,this.getDirection()==this.FROM_RIGHT&&!this.getExitAnimation()||this.getDirection()==
this.FROM_LEFT&&this.getExitAnimation()?(c.right=b.right,c.left=c.right-d):c.right=c.left+d;a=this.m_oTarget.AnimationMask.graphics;a.clear();a.beginFill(this.MASK_COLOR,1);a.drawRect(c.left,c.top,c.GetWidth(),c.GetHeight());a.endFill()};
bwMaskWipe.prototype.GetClipPath=function(a){this.getExitAnimation()&&(a=1-a);var b=new ppRect(0,0,100,100);this.getDirection()==this.FROM_BOTTOM||this.getDirection()==this.FROM_TOP?(a*=100,this.getDirection()==this.FROM_BOTTOM&&!this.getExitAnimation()||this.getDirection()==this.FROM_TOP&&this.getExitAnimation()?b.top=100-a:b.bottom=a):(a*=100,this.getDirection()==this.FROM_RIGHT&&!this.getExitAnimation()||this.getDirection()==this.FROM_LEFT&&this.getExitAnimation()?b.left=100-a:b.right=a);this.StartClipPath();
this.AddClipPathRect(b);return this.FinishClipPath()};bwMaskWipe.prototype.getDirection=function(){return this.m_oSettings.direction};function bwMaskBlinds(a,b){bwMaskBase.call(this,a,b);this.NUM_OF_BLINDS=6}bwMaskBlinds.prototype=new bwMaskBase;
bwMaskBlinds.prototype.Draw=function(a){this.getExitAnimation()&&(a=1-a);var b=this.getTargetRect(),c=this.m_oTarget.AnimationMask.graphics;c.clear();c.beginFill(this.MASK_COLOR,1);if(1==a)c.drawRect(b.left,b.top,b.GetWidth(),b.GetHeight());else for(var d=b.GetWidth()/(!this.getVertical()?1:this.NUM_OF_BLINDS),e=b.GetHeight()/(this.getVertical()?1:this.NUM_OF_BLINDS),f=0;f<this.NUM_OF_BLINDS;f++){var g=!this.getVertical()?b.left:b.left+d*f,h=this.getVertical()?b.top:b.top+e*f,j=!this.getVertical()?
b.GetWidth():d*a,l=this.getVertical()?b.GetHeight():e*a;c.drawRect(g,h,j,l)}c.endFill()};
bwMaskBlinds.prototype.GetClipPath=function(a){this.getExitAnimation()&&(a=1-a);this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else for(var b=new ppRect(0,0,100,100),c=100/(!this.getVertical()?1:this.NUM_OF_BLINDS),d=100/(this.getVertical()?1:this.NUM_OF_BLINDS),e=0;e<this.NUM_OF_BLINDS;e++){var f=!this.getVertical()?b.left:b.left+c*e,g=this.getVertical()?b.top:b.top+d*e,h=!this.getVertical()?b.GetWidth():c*a,j=this.getVertical()?b.GetHeight():d*a;this.AddClipPathRect(new ppRect(f,
g,f+h,g+j))}return this.FinishClipPath()};bwMaskBlinds.prototype.getVertical=function(){return this.m_oSettings.direction==this.VERTICAL};function bwMaskBox(a,b){bwMaskBase.call(this,a,b)}bwMaskBox.prototype=new bwMaskBase;
bwMaskBox.prototype.Draw=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);var c=this.getTargetRect(),d=this.m_oTarget.AnimationMask.graphics;d.clear();d.beginFill(this.MASK_COLOR,1);1==a?d.drawRect(c.left,c.top,c.GetWidth(),c.GetHeight()):(a=this.getScaledMaskRect(c,a),b?(d.drawRect(c.left,c.top,a.right-c.left,a.top-c.top),d.drawRect(a.right,c.top,c.right-a.right,a.bottom-c.top),d.drawRect(a.left,a.bottom,c.right-a.left,c.bottom-a.bottom),d.drawRect(c.left,a.top,a.left-
c.left,c.bottom-a.top)):d.drawRect(a.left,a.top,a.GetWidth(),a.GetHeight()));d.endFill()};bwMaskBox.prototype.GetClipPath=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);a=this.getScaledMaskRect(new ppRect(0,0,100,100),a);this.StartClipPath();b&&this.AddClipPathExtentsCCW();this.AddClipPathRect(a);return this.FinishClipPath()};bwMaskBox.prototype.getInverse=function(){return this.m_oSettings.direction==this.IN};function bwMaskCheckerboard(a,b){this.NUM_OF_ROWS=this.NUM_OF_COLS=6;this.NUM_OF_ROWS=this.NUM_OF_COLS=16;this.m_maskMethod=this.MASK_IMAGE;bwMaskBase.call(this,a,b)}bwMaskCheckerboard.prototype=new bwMaskBase;bwMaskCheckerboard.prototype.isClipPath=function(){return!1};
bwMaskCheckerboard.prototype.GetClipPath=function(a){this.getExitAnimation()&&(a=1-a);this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else{var b=new ppRect(0,0,100,100),c=b.GetWidth()/this.NUM_OF_COLS,d=b.GetHeight()/this.NUM_OF_ROWS;if(this.getAcross())for(var e=0;e<this.NUM_OF_COLS;e+=2)for(var f=0;f<this.NUM_OF_ROWS;f++){var g=1==f%2?e+1:e,g=b.left+c*g,h=b.top+d*f;this.AddClipPathRectBounds(g,h,Math.min(c,2*c*a),d);0.5<a&&(g=0==f%2?e+1:e,g=b.left+c*g,this.AddClipPathRectBounds(g,
h,c*(2*a-1),d))}else for(f=0;f<this.NUM_OF_ROWS;f+=2)for(e=0;e<this.NUM_OF_COLS;e++)g=b.left+c*e,h=1==e%2?f+1:f,h=b.top+d*h,this.AddClipPathRectBounds(g,h,c,Math.min(d,2*d*a)),0.5<a&&(h=0==e%2?f+1:f,h=b.top+d*h,this.AddClipPathRectBounds(g,h,c,d*(2*a-1)))}return this.FinishClipPath()};
bwMaskCheckerboard.prototype.Draw=function(a){if(this.getExitAnimation()&&0.9<a){var b=this.m_oTarget.AnimationMask.graphics;b.clear()}else{this.getExitAnimation()&&(a=1-a);var c=this.getTargetRect(),d=c.GetWidth()/this.NUM_OF_COLS,e=c.GetHeight()/this.NUM_OF_ROWS,b=this.m_oTarget.AnimationMask.graphics;b.clear();b.beginFill(this.MASK_COLOR,1);if(this.getAcross())for(var f=0;f<this.NUM_OF_COLS;f+=2)for(var g=0;g<this.NUM_OF_ROWS;g++){var h=1==g%2?f+1:f,h=c.left+d*h,j=c.top+e*g;b.drawRect(h,j,Math.min(d,
2*d*a),e);0.5<a&&(h=0==g%2?f+1:f,h=c.left+d*h,b.drawRect(h,j,d*(2*a-1),e))}else for(g=0;g<this.NUM_OF_ROWS;g+=2)for(f=0;f<this.NUM_OF_COLS;f++)h=c.left+d*f,j=1==f%2?g+1:g,j=c.top+e*j,b.drawRect(h,j,d,Math.min(e,2*e*a)),0.5<a&&(j=0==f%2?g+1:g,j=c.top+e*j,b.drawRect(h,j,d,e*(2*a-1)));b.endFill()}};bwMaskCheckerboard.prototype.getAcross=function(){return this.m_oSettings.direction==this.ACROSS};function bwMaskCircle(a,b){bwMaskBase.call(this,a,b)}bwMaskCircle.prototype=new bwMaskBase;
bwMaskCircle.prototype.Draw=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);var c=this.getTargetRect(),d=this.m_oTarget.AnimationMask.graphics;d.clear();d.beginFill(this.MASK_COLOR,1);if(1==a)d.drawRect(c.left,c.top,c.GetWidth(),c.GetHeight());else{var e=this.getScaledMaskRect(c,a),f=c.GetWidth()*a,g=c.GetHeight()*a,a=f/2,g=g/2,f=Math.sqrt(g*g+a*a);b?(b=e.left+a,e=e.top+g,a=Math.PI/2,d.moveTo(c.left,c.top),d.lineTo(c.left,e),d.arc(b,e,f,2*a,3*a,!1),d.lineTo(b,c.top),
d.lineTo(c.left,c.top),d.moveTo(c.right,c.top),d.lineTo(b,c.top),d.arc(b,e,f,3*a,4*a,!1),d.lineTo(c.right,e),d.lineTo(c.right,c.top),d.moveTo(c.right,c.bottom),d.lineTo(c.right,e),d.arc(b,e,f,0*a,1*a,!1),d.lineTo(b,c.bottom),d.lineTo(c.right,c.bottom),d.moveTo(c.left,c.bottom),d.lineTo(b,c.bottom),d.arc(b,e,f,1*a,2*a,!1),d.lineTo(c.left,e),d.lineTo(c.left,c.bottom)):d.context.arc(e.left+a,e.top+g,f,0,2*Math.PI,!1)}d.endFill()};
bwMaskCircle.prototype.GetClipPath=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else{var c=this.getScaledMaskRect(new ppRect(0,0,100,100),a),d=nCenterY=50,a=c.GetWidth()/2,c=c.GetHeight()/2,e=Math.sqrt(a*a+c*c);b&&this.AddClipPathExtentsCCW();for(var b=0,a=2*Math.PI/30,f=this,c=function(a){var b=d+Math.cos(a)*e,a=nCenterY-Math.sin(a)*e;f.AddClipPathPoint(b,a)},g=0;30>g;g++)c(b),b-=a;c(0)}return this.FinishClipPath()};
bwMaskCircle.prototype.getInverse=function(){return this.m_oSettings.direction==this.IN};function bwMaskDiamond(a,b){bwMaskBase.call(this,a,b)}bwMaskDiamond.prototype=new bwMaskBase;
bwMaskDiamond.prototype.Draw=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);var c=this.getTargetRect(),d=this.m_oTarget.AnimationMask.graphics;d.clear();d.beginFill(this.MASK_COLOR,1);if(1==a)d.drawRect(c.left,c.top,c.GetWidth(),c.GetHeight());else{var e=c.GetWidth()*a,f=c.GetHeight()*a,a=c.left+c.GetWidth()/2,g=c.top+c.GetHeight()/2,e=new ppRect(a-e,g-f,a+e,g+f);b?(d.moveTo(c.left,c.top),d.lineTo(a,c.top),d.lineTo(a,e.top),d.lineTo(e.left,g),d.lineTo(c.left,g),d.lineTo(c.left,
c.top),d.moveTo(a,c.top),d.lineTo(c.right,c.top),d.lineTo(c.right,g),d.lineTo(e.right,g),d.lineTo(a,e.top),d.lineTo(a,c.top),d.moveTo(c.right,g),d.lineTo(c.right,c.bottom),d.lineTo(a,c.bottom),d.lineTo(a,e.bottom),d.lineTo(e.right,g),d.lineTo(c.right,g),d.moveTo(c.left,g),d.lineTo(e.left,g),d.lineTo(a,e.bottom),d.lineTo(a,c.bottom),d.lineTo(c.left,c.bottom),d.lineTo(c.left,g)):(d.moveTo(a,e.top),d.lineTo(e.right,g),d.lineTo(a,e.bottom),d.lineTo(e.left,g),d.lineTo(a,e.top))}d.endFill()};
bwMaskDiamond.prototype.GetClipPath=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);a=Math.min(a,1);a=Math.max(a,0);this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else{var c=new ppRect(0,0,100,100),d=c.GetWidth()*a,a=c.GetHeight()*a,d=new ppRect(50-d,50-a,50+d,50+a);b&&this.AddClipPathExtentsCCW();this.AddClipPathPoint(50,d.top);this.AddClipPathPoint(d.right,50);this.AddClipPathPoint(50,d.bottom);this.AddClipPathPoint(d.left,50);this.AddClipPathPoint(50,
d.top)}return this.FinishClipPath()};bwMaskDiamond.prototype.getInverse=function(){return this.m_oSettings.direction==this.IN};function bwMaskDissolve(a,b){this.MIN_BLOCK_SIZE=3;this.MAX_BYTE=255;this.MAX_COLS=this.MAX_ROWS=this.MAX_BYTE=20;this.DISSOLVE_LEVELS=this.InitDissolveLevels();this.m_nPreviousPercent=0;bwMaskBase.call(this,a,b)}bwMaskDissolve.prototype=new bwMaskBase;bwMaskDissolve.prototype.InitDissolveLevels=function(){for(var a=[],b=[],c=0;c<=this.MAX_COLS;++c)b.push(c);for(c=0;c<=this.MAX_ROWS;++c)for(var d=b.slice();0<d.length;){var e=Math.floor(Math.random()*d.length),e=d.splice(e,1);a.push(e[0])}return a};
bwMaskDissolve.prototype.isClipPath=function(){return!1};
bwMaskDissolve.prototype.Draw=function(a){var b=this.m_oTarget.AnimationMask.graphics,c;if(this.getExitAnimation()){if(a=1-a,b.clear(),0>=a)return}else{if(1<=a){b.clear();b.beginFill(this.MASK_COLOR,1);b.drawRect(0,0,100,100);b.endFill();return}if(0>=a){b.clear();return}c=0<a&&a>=this.m_nPreviousPercent?Math.ceil(this.MAX_LEVEL*this.m_nPreviousPercent):-1;0>=c&&b.clear()}c=Math.round(this.MAX_BYTE*a);var d=this.getTargetRect(),e=Math.min(this.MAX_BYTE,Math.floor(d.GetWidth()/this.MIN_BLOCK_SIZE)),
f=Math.min(this.MAX_BYTE,Math.floor(d.GetHeight()/this.MIN_BLOCK_SIZE)),g=d.GetWidth()/e,h=d.GetHeight()/f;b.beginFill(this.MASK_COLOR,1);for(var j=0;j<f;j++)for(var l=d.top+h*j,m=j*this.MAX_BYTE,k=0;k<e;k++)this.DISSOLVE_LEVELS[m+k]<=c&&b.drawRect(d.left+g*k,l,g,h);b.endFill();this.m_nPreviousPercent=a};
bwMaskDissolve.prototype.GetClipPath=function(a){var b=a>=this.m_nPreviousPercent?Math.round(this.MAX_BYTE*this.m_nPreviousPercent):0,c=Math.round(this.MAX_BYTE*a),d=this.getTargetRect(),e=Math.min(this.MAX_BYTE,Math.floor(d.GetWidth()/this.MIN_BLOCK_SIZE)),f=Math.min(this.MAX_BYTE,Math.floor(d.GetHeight()/this.MIN_BLOCK_SIZE)),g=d.GetWidth()/e,h=d.GetHeight()/f;this.StartClipPath();this.m_clipPoints.push("evenodd");for(var j=0;j<f;j++)for(var l=d.top+h*j,m=j*this.MAX_BYTE,k=0;k<e;k++){var n=this.DISSOLVE_LEVELS[m+
k];n>b&&n<=c&&this.AddClipPathRectBounds(d.left+g*k,l,g,h)}this.m_nPreviousPercent=a;return this.FinishClipPath()};function bwMaskFull(a,b){bwMaskBase.call(this,a,b)}bwMaskFull.prototype=new bwMaskBase;bwMaskFull.prototype.Draw=function(a){if(this.getExitAnimation()&&0.99<a)a=this.m_oTarget.AnimationMask.graphics,a.clear();else{var b=this.m_oTarget.BoundsForAnimationMask.clone(),a=this.m_oTarget.AnimationMask.graphics;a.clear();a.beginFill(this.MASK_COLOR,1);a.drawRect(b.left,b.top,b.GetWidth(),b.GetHeight());a.endFill()}};
bwMaskFull.prototype.GetClipPath=function(a){this.StartClipPath();this.getExitAnimation()&&1==a?this.AddClipPathRectBounds(0,0,0,0):this.AddClipPathRectBounds(0,0,100,100);return this.FinishClipPath()};function bwMaskPlus(a,b){bwMaskBase.call(this,a,b)}bwMaskPlus.prototype=new bwMaskBase;
bwMaskPlus.prototype.Draw=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);var c=this.getTargetRect(),d=this.m_oTarget.AnimationMask.graphics;d.clear();d.beginFill(this.MASK_COLOR,1);1==a?d.drawRect(c.left,c.top,c.GetWidth(),c.GetHeight()):(a=this.getScaledMaskRect(c,a),b?(d.drawRect(c.left,c.top,a.left-c.left,a.top-c.top),d.drawRect(a.right,c.top,c.right-a.right,a.top-c.top),d.drawRect(a.right,a.bottom,c.right-a.right,c.bottom-a.bottom),d.drawRect(c.left,a.bottom,a.left-
c.left,c.bottom-a.bottom)):(d.moveTo(a.left,c.top),d.lineTo(a.right,c.top),d.lineTo(a.right,a.top),d.lineTo(c.right,a.top),d.lineTo(c.right,a.bottom),d.lineTo(a.right,a.bottom),d.lineTo(a.right,c.bottom),d.lineTo(a.left,c.bottom),d.lineTo(a.left,a.bottom),d.lineTo(c.left,a.bottom),d.lineTo(c.left,a.top),d.lineTo(a.left,a.top),d.lineTo(a.left,c.top)));d.endFill()};
bwMaskPlus.prototype.GetClipPath=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else{var c=new ppRect(0,0,100,100),a=this.getScaledMaskRect(c,a);b&&this.AddClipPathExtentsCCW();this.AddClipPathPoint(a.left,c.top);this.AddClipPathPoint(a.right,c.top);this.AddClipPathPoint(a.right,a.top);this.AddClipPathPoint(c.right,a.top);this.AddClipPathPoint(c.right,a.bottom);this.AddClipPathPoint(a.right,a.bottom);
this.AddClipPathPoint(a.right,c.bottom);this.AddClipPathPoint(a.left,c.bottom);this.AddClipPathPoint(a.left,a.bottom);this.AddClipPathPoint(c.left,a.bottom);this.AddClipPathPoint(c.left,a.top);this.AddClipPathPoint(a.left,a.top);this.AddClipPathPoint(a.left,c.top)}return this.FinishClipPath()};bwMaskPlus.prototype.getInverse=function(){return this.m_oSettings.direction==this.IN};function bwMaskRandomBars(a,b){bwMaskBase.call(this,a,b);this.MAX_BARS=1E3;this.BAR_MIN=1;this.Init()}bwMaskRandomBars.prototype=new bwMaskBase;bwMaskRandomBars.prototype.Draw=bwMaskFull.prototype.Draw;
bwMaskRandomBars.prototype.GetClipPath=function(a){this.getExitAnimation()&&(a=1-a);var b=new ppRect(0,0,100,100);this.StartClipPath();if(0==a)return this.AddClipPathRectBounds(0,0,0,0),this.FinishClipPath();if(1==a)return this.AddClipPathRect(b),this.FinishClipPath();for(var a=Math.floor(this.m_nBars*a),c=0;c<a;++c){var d=this.m_arrShuffledIndices[c];this.m_oSettings.direction==this.HORIZONTAL?this.AddClipPathRectBounds(b.left,b.top+d*this.m_nBarSize,b.GetWidth(),this.m_nBarSize):this.AddClipPathRectBounds(b.left+
d*this.m_nBarSize,b.top,this.m_nBarSize,b.GetHeight())}return this.FinishClipPath()};
bwMaskRandomBars.prototype.Init=function(){var a=new ppRect(0,0,100,100);switch(this.m_oSettings.direction){case this.HORIZONTAL:this.m_nBarSize=Math.max(this.BAR_MIN,Math.ceil(a.GetHeight()/this.MAX_BARS));this.m_nBars=Math.ceil(a.GetHeight()/this.m_nBarSize);break;default:this.m_nBarSize=Math.max(this.BAR_MIN,Math.ceil(a.GetWidth()/this.MAX_BARS)),this.m_nBars=Math.ceil(a.GetWidth()/this.m_nBarSize)}for(var a=Array(this.m_nBars),b=0;b<this.m_nBars;b++)a[b]=b;for(var c=Array(this.m_nBars),d=0,b=
0;b<this.m_nBars;b++)d=parseInt(Math.random()*a.length),c[b]=a.splice(d,1)[0];this.m_arrShuffledIndices=c};function bwMaskSplit(a,b){bwMaskBase.call(this,a,b)}bwMaskSplit.prototype=new bwMaskBase;bwMaskSplit.prototype.GetClipPath=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);var c=new ppRect(0,0,100,100),d=!this.getVertical()?1:a,a=this.getVertical()?1:a,c=this.getScaledMaskRect(c,d,a);this.StartClipPath();b&&this.AddClipPathExtentsCCW();this.AddClipPathRect(c);return this.FinishClipPath()};
bwMaskSplit.prototype.Draw=function(a){var b=this.getInverse();b&&(a=1-a);this.getExitAnimation()&&(b=!b);var c=this.getTargetRect(),d=!this.getVertical()?1:a,e=this.getVertical()?1:a,f=this.getScaledMaskRect(c,d,e),a=this.m_oTarget.AnimationMask.graphics;a.clear();a.beginFill(this.MASK_COLOR,1);b?(b=1==d?c.GetWidth():f.left-c.left,d=1==e?c.GetHeight():f.top-c.top,a.drawRect(c.left,c.top,b,d),a.drawRect(c.right-b,c.bottom-d,b,d)):a.drawRect(f.left,f.top,f.GetWidth(),f.GetHeight());a.endFill()};
bwMaskSplit.prototype.getInverse=function(){return this.getDirection()==this.VERTICAL_IN||this.getDirection()==this.HORIZONTAL_IN};bwMaskSplit.prototype.getVertical=function(){return this.getDirection()==this.VERTICAL_IN||this.getDirection()==this.VERTICAL_OUT};bwMaskSplit.prototype.getDirection=function(){return this.m_oSettings.direction};function bwMaskStrips(a,b){bwMaskBase.call(this,a,b);this.NUM_OF_ROWS=20;this.MIN_ROW_HEIGHT=10;this.MAX_ROW_HEIGHT=30}bwMaskStrips.prototype=new bwMaskBase;bwMaskStrips.prototype.Draw=bwMaskFull.prototype.Draw;
bwMaskStrips.prototype.GetClipPath=function(a){this.getExitAnimation()&&(a=1-a);this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else{var b=new ppRect(0,0,100,100),c=Math.max(this.MIN_ROW_HEIGHT,Math.min(this.MAX_ROW_HEIGHT,b.GetHeight(),Math.ceil(b.GetHeight()/this.NUM_OF_ROWS))),d=Math.ceil(b.GetHeight()/c),e=b.GetWidth()+d*c,f=this.m_oSettings.direction==this.LEFT_DOWN||this.m_oSettings.direction==this.LEFT_UP,g=this.m_oSettings.direction==this.LEFT_DOWN||this.m_oSettings.direction==
this.RIGHT_DOWN,h=f?b.right:b.left,j=g?b.top:b.bottom;this.AddClipPathPoint(h,j);for(var l=0;l<d;l++){var m=l*c,k=e*a-m,k=f?Math.max(b.left,b.right-k):Math.min(b.right,b.left+k);if(!f&&k<h||f&&k>h)break;var m=g?b.top+m:b.bottom-m,n=g?Math.min(b.bottom,m+c):Math.min(b.bottom,m-c);this.AddClipPathPoint(k,m);this.AddClipPathPoint(k,n)}this.AddClipPathPoint(h,n);this.AddClipPathPoint(h,j)}return this.FinishClipPath()};function bwMaskWedge(a,b){bwMaskBase.call(this,a,b)}bwMaskWedge.prototype=new bwMaskBase;
bwMaskWedge.prototype.Draw=function(a){this.getExitAnimation()&&(a=1-a);var b=this.getTargetRect(),c=b.GetWidth()/2,d=b.GetHeight()/2,e=b.left+c,b=b.top+d,c=Math.sqrt(c*c+d*d),d=this.m_oTarget.AnimationMask.graphics;d.clear();d.beginFill(this.MASK_COLOR,1);d.moveTo(e,b);var f=2*Math.PI*a,a=Math.PI/2-Math.PI*a,g=e+Math.cos(a)*c,h=b-Math.sin(a)*c;d.lineTo(g,h);g=Math.ceil(Math.abs(f)/(Math.PI/4));f/=g;for(h=0;h<g;h++){var a=a+f,j=e+Math.cos(a)*c,l=b-Math.sin(a)*c,m=a-f/2,k=e+Math.cos(m)*(c/Math.cos(f/
2)),m=b-Math.sin(m)*(c/Math.cos(f/2));d.curveTo(k,m,j,l,c)}d.lineTo(e,b);d.endFill()};
bwMaskWedge.prototype.GetClipPath=function(a){this.getExitAnimation()&&(a=1-a);var b=new ppRect(0,0,100,100),c=b.GetWidth()/2,d=b.GetHeight()/2,e=b.left+c,b=b.top+d,c=Math.sqrt(c*c+d*d),c=1.5*c;this.StartClipPath();this.AddClipPathPoint(e,b);var f=2*Math.PI*a,d=Math.PI/2,d=d+(this.getExitAnimation()?Math.PI*(1-a):-Math.PI*a),a=e+Math.cos(d)*c,g=b-Math.sin(d)*c;this.AddClipPathPoint(a,g);a=Math.ceil(Math.abs(f)/(Math.PI/4));f/=a;for(g=0;g<a;g++){var d=d+f,h=e+Math.cos(d)*c,j=b-Math.sin(d)*c,l=d-f/
2;Math.cos(l);Math.cos(f/2);Math.sin(l);Math.cos(f/2);this.AddClipPathPoint(h,j)}this.AddClipPathPoint(e,b);return this.FinishClipPath()};function bwMaskWheel(a,b){bwMaskBase.call(this,a,b)}bwMaskWheel.prototype=new bwMaskBase;
bwMaskWheel.prototype.Draw=function(a){var b=this.getTargetRect(),c=this.m_oTarget.AnimationMask.graphics;c.clear();if(1==a)c.beginFill(this.MASK_COLOR,1),c.drawRect(b.left,b.top,b.GetWidth(),b.GetHeight()),c.endFill();else for(var d=b.GetWidth()/2,e=b.GetHeight()/2,f=b.left+d,b=b.top+e,d=Math.sqrt(d*d+e*e),e=parseInt(this.m_oSettings.spokes),e=2*Math.PI/e,g=0;g<this.nSpokes;g++)this.drawWedge(c,f,b,d,Math.PI/2-e*(g+a),e*a)};
bwMaskWheel.prototype.drawWedge=function(a,b,c,d,e,f){a.beginFill(this.MASK_COLOR,1);a.moveTo(b,c);var g=b+Math.cos(e)*d,h=c-Math.sin(e)*d;a.lineTo(g,h);g=Math.ceil(Math.abs(f)/(Math.PI/4));f/=g;for(h=0;h<g;h++){var e=e+f,j=b+Math.cos(e)*d,l=c-Math.sin(e)*d,m=e-f/2,k=b+Math.cos(m)*(d/Math.cos(f/2)),m=c-Math.sin(m)*(d/Math.cos(f/2));a.curveTo(k,m,j,l,d)}a.lineTo(b,c);a.endFill()};
bwMaskWheel.prototype.GetClipPath=function(a){this.StartClipPath();if(1==a)this.AddClipPathRectBounds(0,0,100,100);else for(var b=new ppRect(0,0,100,100),c=b.GetWidth()/2,d=b.GetHeight()/2,e=b.left+c,b=b.top+d,c=Math.sqrt(c*c+d*d),d=parseInt(this.m_oSettings.spokes),f=2*Math.PI/d,c=1.5*c,g=0;g<d;g++)nStartAngle=Math.PI/2-f*(this.getCounterClockwise()?g:g+a),this.getExitAnimation()?this.AddWedgeClipPath(e,b,c,Math.PI-nStartAngle,f*(1-a)):this.AddWedgeClipPath(e,b,c,nStartAngle,f*a);return this.FinishClipPath()};
bwMaskWheel.prototype.AddWedgeClipPath=function(a,b,c,d,e){this.AddClipPathPoint(a,b);var f=a+Math.cos(d)*c,g=b-Math.sin(d)*c;this.AddClipPathPoint(f,g);f=Math.ceil(Math.abs(e)/(Math.PI/4));e/=f;for(g=0;g<f;g++){var d=d+e,h=a+Math.cos(d)*c,j=b-Math.sin(d)*c;this.AddClipPathPoint(h,j)}this.AddClipPathPoint(a,b)};bwMaskWheel.prototype.getCounterClockwise=function(){var a=this.m_oSettings.direction!=this.CLOCKWISE;return this.getExitAnimation()?!a:a};function bwTweenMask(a,b){this.m_strType="";this.m_shMask=null;this.m_bTextOnly=this.m_bShowAnimationMask=!1;this.m_nStartTime=0;bwTween.call(this,a,b);this.ParseXMLData()}bwTweenMask.prototype=new bwTween;bwTweenMask.TweenType={};bwTweenMask.TweenType.BLINDS="blinds";bwTweenMask.TweenType.BOX="box";bwTweenMask.TweenType.CHECKERBOARD="checkerboard";bwTweenMask.TweenType.CIRCLE="circle";bwTweenMask.TweenType.CLOCK="clock";bwTweenMask.TweenType.COMB="comb";bwTweenMask.TweenType.DIAMOND="diamond";
bwTweenMask.TweenType.DISSOLVE="dissolve";bwTweenMask.TweenType.FULL="full";bwTweenMask.TweenType.PLUS="plus";bwTweenMask.TweenType.RANDOM_BARS="randombars";bwTweenMask.TweenType.SPLIT="split";bwTweenMask.TweenType.STRIPS="strips";bwTweenMask.TweenType.WEDGE="wedge";bwTweenMask.TweenType.WHEEL="wheel";bwTweenMask.TweenType.WIPE="wipe";bwTweenMask.CLASSES={};bwTweenMask.CLASSES[bwTweenMask.TweenType.BLINDS]=bwMaskBlinds;bwTweenMask.CLASSES[bwTweenMask.TweenType.BOX]=bwMaskBox;
bwTweenMask.CLASSES[bwTweenMask.TweenType.CHECKERBOARD]=bwMaskCheckerboard;bwTweenMask.CLASSES[bwTweenMask.TweenType.CIRCLE]=bwMaskCircle;bwTweenMask.CLASSES[bwTweenMask.TweenType.DIAMOND]=bwMaskDiamond;bwTweenMask.CLASSES[bwTweenMask.TweenType.DISSOLVE]=bwMaskDissolve;bwTweenMask.CLASSES[bwTweenMask.TweenType.FULL]=bwMaskFull;bwTweenMask.CLASSES[bwTweenMask.TweenType.PLUS]=bwMaskPlus;bwTweenMask.CLASSES[bwTweenMask.TweenType.RANDOM_BARS]=bwMaskRandomBars;
bwTweenMask.CLASSES[bwTweenMask.TweenType.SPLIT]=bwMaskSplit;bwTweenMask.CLASSES[bwTweenMask.TweenType.STRIPS]=bwMaskStrips;bwTweenMask.CLASSES[bwTweenMask.TweenType.WEDGE]=bwMaskWedge;bwTweenMask.CLASSES[bwTweenMask.TweenType.WHEEL]=bwMaskWheel;bwTweenMask.CLASSES[bwTweenMask.TweenType.WIPE]=bwMaskWipe;
-1<location.href.indexOf("forcemasks=1")&&(bwTweenMask.CLASSES[bwTweenMask.TweenType.BLINDS]=bwMaskBlinds,bwTweenMask.CLASSES[bwTweenMask.TweenType.BOX]=bwMaskBox,bwTweenMask.CLASSES[bwTweenMask.TweenType.CHECKERBOARD]=bwMaskCheckerboard,bwTweenMask.CLASSES[bwTweenMask.TweenType.CIRCLE]=bwMaskCircle,bwTweenMask.CLASSES[bwTweenMask.TweenType.DIAMOND]=bwMaskDiamond,bwTweenMask.CLASSES[bwTweenMask.TweenType.DISSOLVE]=bwMaskDissolve,bwTweenMask.CLASSES[bwTweenMask.TweenType.FULL]=bwMaskFull,bwTweenMask.CLASSES[bwTweenMask.TweenType.PLUS]=
bwMaskPlus,bwTweenMask.CLASSES[bwTweenMask.TweenType.SPLIT]=bwMaskSplit,bwTweenMask.CLASSES[bwTweenMask.TweenType.WEDGE]=bwMaskWedge,bwTweenMask.CLASSES[bwTweenMask.TweenType.WHEEL]=bwMaskWheel,bwTweenMask.CLASSES[bwTweenMask.TweenType.WIPE]=bwMaskWipe);bwTweenMask.prototype.get_StartTime=function(){return this.m_nStartTime};bwTweenMask.prototype.set_StartTime=function(a){this.m_nStartTime=a};bwTweenMask.prototype.get_TextOnly=function(){return this.m_bTextOnly};
bwTweenMask.prototype.set_TextOnly=function(a){this.m_bTextOnly=a};bwTweenMask.prototype.toString=function(){return"bwTweenMask:: Type: "+this.m_strType};bwTweenMask.prototype.get_Type=function(){return this.m_strType};bwTweenMask.prototype.get_ShowAnimationMask=function(){return this.m_bShowAnimationMask};bwTweenMask.prototype.DrawMaskAtTime=function(a,b){this.m_shMask.Draw(this.GetDistanceAtTime(1,a,b));this.m_oTarget.ApplyAnimationMask(this.m_bShowAnimationMask)};
bwTweenMask.prototype.ParseXMLData=function(){bwTween.prototype.ParseXMLData.call(this);this.m_strType=$(this.m_xmlData).attr("type");this.m_bShowAnimationMask="true"==this.m_xmlData.showanimationmask;this.m_strType&&bwTweenMask.CLASSES.hasOwnProperty(this.m_strType)?this.m_shMask=new bwTweenMask.CLASSES[this.m_strType](this.m_oTarget,this.m_xmlData):(this.m_strType=bwTweenMask.TweenType.FULL,this.m_shMask=new bwTweenMask.CLASSES[bwTweenMask.TweenType.FULL](this.m_oTarget,this.m_xmlData))};var Quiz=function(){this.xml="";this.sliderefs=[];this.quizrefs=[];this.constructElement();this.variables.Score=0;this.attemptCount=this.variables.PercentScore=0;this.m_bCompleted=this.m_bEvaluated=!1};Quiz.prototype=new Element;Quiz.prototype.objectType="Quiz";Quiz.prototype.innerType="Quiz";Quiz.prototype.toBaseData=Element.prototype.toData;Quiz.prototype.toData=function(){var a=this.toBaseData();if(0<this.attemptCount)a.attemptCount=this.attemptCount;return a};
Quiz.prototype.updateBaseFromData=Element.prototype.updateFromData;Quiz.prototype.updateFromData=function(a){this.updateBaseFromData(a);if(a.attemptCount)this.attemptCount=a.attemptCount};Quiz.prototype.SetResumeData=function(a){this.m_bEvaluated="1"==a.substr(0,1);this.m_bCompleted="1"==a.substr(1,1)};Quiz.prototype.GetResumeData=function(){var a;a=""+(this.m_bEvaluated?"1":"0");return a+=this.m_bCompleted?"1":"0"};
Quiz.prototype.loadFromXML=function(a,b){var c=this;this.parent=b;this.children={};this.id=$(a).attr("id");this.lmstext=$(a).attr("lmstext");this.issurvey="true"==$(a).attr("issurvey");this.passpercent=$(a).attr("passpercent");this.submitall=$(a).attr("submitall");this.submitunanswered=$(a).attr("submitunanswered");this.scoretype=$(a).attr("scoretype");this.variables.PassPercent=this.passpercent;this.variables.PassScore=0;this.loadElementInfoFromXML(a);$(a).children("sliderefs").children("slideref").each(function(a,
b){var d=$(b).attr("id");c.sliderefs.push(d);c.parseObjref(d).target.quiz=c});$(a).children("quizrefs").children("quizref").each(function(a,b){var d={id:$(b).attr("id"),weight:parseInt($(b).attr("weight")),mustpass:"true"==$(b).attr("id")};c.quizrefs.push(d)});if(b.g_listQuizzes){var d=new QuizData(this.id,this.lmstext);d.nPassingScore=this.passpercent;b.g_listQuizzes[this.id]=d}};
Quiz.prototype.AllQuestionsSubmitted=function(a){if(this.m_bCompleted)return"true";var b=!0;$.each(this.sliderefs,function(c,d){var e=story.parseObjref(d).target;if(e){var f=function(c){b=b&&c.isAnswered();a||(b=b&&c.isSubmitted())};"SlideDraw"==e.innerType?$.each(e.children,function(a,b){f(b)}):f(e)}});return b?"true":"false"};Quiz.prototype.AllQuestionsAnswered=function(){return this.AllQuestionsSubmitted(!0)};Quiz.prototype.QuizComplete=function(){return this.m_bCompleted?"true":"false"};
Quiz.SEARCH_UNANSWERED="SEARCH_UNANSWERED";Quiz.SEARCH_UNSUBMITTED="SEARCH_UNSUBMITTED";Quiz.SEARCH_VIEWED="SEARCH_VIEWED";
Quiz.prototype.findNextSlide=function(a,b){var c=[];$.each(this.sliderefs,function(a,b){var d=story.parseObjref(b).target;d&&("SlideDraw"==d.innerType?$.each(d.children,function(a,b){c.push(b)}):c.push(d))});b&&c.push(b);for(var d=player.currentWindowSlide||player.currentFramedSlide||player.currentSlide(),e=!1,f=0;f<2*c.length;f++){var g=c[f%c.length];if(e)switch(a){case Quiz.SEARCH_UNANSWERED:if(!g.isAnswered())return g;break;case Quiz.SEARCH_UNSUBMITTED:if(!g.isSubmitted())return g;break;case Quiz.SEARCH_VIEWED:if(g.variables.Visited)return g}else if(g===
d||f>=c.length-1)e=!0}return null};Quiz.prototype.setquizcomplete=function(a){a=this.parseObjrefFromXML(a).target;a.m_bCompleted=!0;player.lmsManager.handleQuizComplete(a)};Quiz.prototype.reset=function(a){Element.prototype.reset.call(this,a);this.m_bCompleted=this.m_bEvaluated=!1;this.variables.PassPercent=this.passpercent;this.variables.PassScore=0};
Quiz.prototype.Passed=function(){var a=this.variables.Score>=this.variables.PassScore;return(a=(a=a&&this.m_bCompleted)&&this.m_bEvaluated)?"true":"false"};
Quiz.dump=function(){$.each(story.quizzes,function(a,b){console.log("d:quiz",b,b.variables.Score);$.each(b.sliderefs,function(a,d){var e=story.parseObjref(d).target;if(e){var f=function(a,b){var c=0;if(0<b.attempts.length)c=b.attempts[0].answers.length;console.log(["d:interaction",b.id,b.concatChoices(b.lmsResponses),b.GetResumeData(),b.attempts.length,c,b])};"SlideDraw"==e.innerType&&$.each(e.children,function(a,c){("partial"!=b.scoretype||c.variables.Visited)&&$.each(c.interactions,f)});("partial"!=
b.scoretype||e.variables.Visited)&&$.each(e.interactions,f)}})})};var Answer=function(){this.xml="";this.constructElement()};Answer.prototype=new Element;Answer.prototype.objectType="Answer";Answer.prototype.innerType="Answer";Answer.prototype.loadFromXML=function(a,b){this.parent=b;this.children={};this.id=$(a).attr("id");this.points=$(a).attr("points");this.status=$(a).attr("status");this.actions=$(a).children("actions").children();this.evaluate=$(a).children("evaluate").children()};var Choice=function(){this.xml="";this.constructElement();this.selected=!1;this.pairs=[]};Choice.prototype=new Element;Choice.prototype.objectType="Choice";Choice.prototype.innerType="Choice";
Choice.prototype.loadFromXML=function(a,b){this.parent=b;this.children={};this.id=$(a).attr("id");if(this.lmstext=$(a).attr("lmstext"))this.lmstext=this.lmstext.replace(String.fromCharCode(8216),"'"),this.lmstext=this.lmstext.replace(String.fromCharCode(8217),"'"),this.lmstext=this.lmstext.replace(String.fromCharCode(8218),"'");this.matchedCase=!0};Choice.FromParameters=function(a,b,c){var d=new Choice;d.id=a;d.lmstext=b;d.parent=c};
Choice.prototype.hasPair=function(a){for(var b=0;b<this.pairs.length;b++)if(this.pairs[b]==a)return!0;return!1};Choice.prototype.findPair=function(a){for(var b=0;b<this.pairs.length;b++)if(this.pairs[b]==a)return a;return null};Choice.prototype.addPair=function(a){this.hasPair(a)||this.pairs.push(a)};var ResponseData=function(a,b,c,d,e,f){this.m_bValid=!0;this.m_bPairResponse=a;this.m_strChoice=b;this.m_strStatement=c||"";if(!b||0==this.m_strChoice.length)this.m_bValid=!1;else if(this.m_bPairResponse&&(!c||0==this.m_strStatement.length))this.m_bValid=!1;if(this.lmstext=d)this.lmstext=this.lmstext.replace(String.fromCharCode(8216),"'"),this.lmstext=this.lmstext.replace(String.fromCharCode(8217),"'"),this.lmstext=this.lmstext.replace(String.fromCharCode(8218),"'");this.statementLMSText=e;this.interaction=
f};ResponseData.TYPE_STATEMENTS="statements";ResponseData.TYPE_CHOICES="choices";ResponseData.prototype.IsPair=function(){return this.m_bPairResponse};ResponseData.prototype.ChoiceID=function(){return this.m_strChoice};ResponseData.prototype.StatementID=function(){return this.m_strStatement};ResponseData.prototype.IsValid=function(){return this.m_bValid};
ResponseData.prototype.GetResumeData=function(a,b){var c;c=0+(this.m_bPairResponse?1:0);c+=this.m_bValid?2:0;c=""+bwChunk.UBase10toN(c,1);this.m_bValid&&(c+=this.GetResumeResponseIndex(ResponseData.TYPE_CHOICES,this.m_strChoice,a),this.m_bPairResponse&&(c+=this.GetResumeResponseIndex(ResponseData.TYPE_STATEMENTS,this.m_strStatement,b)));return c};
ResponseData.prototype.SetResumeData=function(a,b,c){var d=bwChunk.UBaseNto10(a.substr(0,1));this.m_bPairResponse=0<(d&1);this.m_bValid=0<(d&2);a=a.substr(1);this.m_bValid&&(a=this.SetResumeResponse(ResponseData.TYPE_CHOICES,a,b),this.m_bPairResponse&&this.SetResumeResponse(ResponseData.TYPE_STATEMENTS,a,c))};
ResponseData.prototype.GetResumeResponseIndex=function(a,b,c){var d=b.split("."),e=-1,f="";if(2==d.length&&d[0]==a){var a=0,g;for(g in c){if(c[g].id==d[1]){e=a;break}a++}}return f=0<=e?"0"+bwChunk.UBase10toN(e,2):"1"+bwChunk.CreateChunk(b)};ResponseData.prototype.GetResponseByIndex=function(a,b){var c=0,d;for(d in a){if(c==b)return a[d];c++}return null};
ResponseData.prototype.SetResumeResponse=function(a,b,c){var d="0"==b.substr(0,1),e=-1,b=b.substr(1);d?(e=bwChunk.UBaseNto10(b.substr(0,2)),b=b.substr(2),c=this.GetResponseByIndex(c,e).id,a==ResponseData.TYPE_CHOICES?(this.m_strChoice=a+"."+c,this.lmstext=this.GetLMSText(c)):(this.m_strStatement=a+"."+c,this.statementLMSText=this.GetLMSText(c))):(b=new bwChunk(b),a==ResponseData.TYPE_CHOICES?(this.m_strChoice=b.Data(),this.lmstext=this.GetLMSText(this.m_strChoice)):(this.m_strStatement=b.Data(),this.statementLMSText=
this.GetLMSText(this.m_strStatement)),b=b.Remainder());return b};ResponseData.prototype.GetLMSText=function(a){return!this.interaction?"":(a=this.interaction.children[a])?a.lmstext:""};var Interaction=function(){this.xml="";this.choices={};this.answers={};this.statements={};this.responseActions=[];this.responses={};this.correctResponses={};this.attempts=[];this.variables={};this.lmsResponses=[];this.lmsCorrectResponses=[];this.skipEnabled=!1;this.constructElement();this.m_bUnanswered=this.m_bAnswered=this.scoreAO=!1;this.m_nUserAnswerIndex=-1};Interaction.prototype=new Element;Interaction.prototype.objectType="Interaction";Interaction.prototype.innerType="Interaction";
Interaction.slideStatus={};Interaction.prototype.toBaseData=Element.prototype.toData;Interaction.prototype.toData=function(){var a=this.toBaseData();$.each(this.responses,function(b,c){if(!a.responses)a.responses={};a.responses[b]=c.toData()});if(0<this.attempts.length)a.attempts=this.attempts;return a};
Interaction.prototype.restoreFromResumeChunk=function(a){var b=a.NextUBase10(2);this.m_bAnswered="1"==a.NextString(1);this.m_bUnanswered="1"==a.NextString(1);if(0<b){var c=a.NextString(1),d=a.NextChunkedBase10(),e=a.NextChunkedBase10();a.NextChunkedBase10();a="";switch(c){case "0":a="correct";break;case "1":a="incomplete";break;case "2":a="incorrect";break;case "3":a="neutral"}this.variables.AttemptCount=b;this.variables.Points=d;this.variables.Status=a;if("incomplete"!=this.variables.Status)for(;this.attempts.length<
b;)this.attempts.push({time:player.elapsedTime(),isfinal:!0,sent:!1,pointsAwarded:e,result:a,answers:[]})}else{b=a.NextUBase10(2);this.lmsResponses=[];c=a.NextString();for(a=0;a<b;a++){c=new bwChunk(c);e=new ResponseData(!1,"","","","",this);e.SetResumeData(c.Data(),this.choices,this.statements);this.lmsResponses.push(e);d=this.choices[e.ChoiceID()];e=this.statements[e.StatementID()];if(d)d.selected=!0,this.responses[d.longID]=d,this.m_bUnanswered=!1,e&&(d.addPair(e),e.addPair(d));c=c.Remainder()}this.evaluate(!0,
!0,!0,!0)}this.updateSlideList()};
Interaction.prototype.GetResumeData=function(){var a="",b=this.attempts.length,c=parseInt(this.variables.Points)||0,d=this.variables.Status,a=a+bwChunk.UBase10toN(b,2),a=a+(this.m_bAnswered?"1":"0"),a=a+(this.m_bUnanswered?"1":"0");if(0<b){switch(d){case "correct":a+="0";break;case "incomplete":a+="1";break;case "incorrect":a+="2";break;case "neutral":a+="3"}a+=bwChunk.CreateChunk(bwChunk.Base10toN(c));1<b&&(c=(b=this.attempts[this.attempts-1])?parseInt(b.pointsAwarded)||0:0);a+=bwChunk.CreateChunk(bwChunk.Base10toN(c));
a+=bwChunk.CreateChunk(bwChunk.Base10toN(this.m_nUserAnswerIndex))}else{a+=bwChunk.UBase10toN(this.lmsResponses.length,2);for(b=0;b<this.lmsResponses.length;b++)a+=bwChunk.CreateChunk(this.lmsResponses[b].GetResumeData(this.choices,this.statements))}return a};Interaction.prototype.updateBaseFromData=Element.prototype.updateFromData;Interaction.prototype.updateFromData=function(a){this.updateBaseFromData(a);if(a.responses)this.responses={};if(a.attempts)this.attempts=a.attempts};
Interaction.prototype.resetElement=Element.prototype.reset;Interaction.prototype.reset=function(){this.resetElement();this.choices={};this.answers={};this.statements={};this.responseActions=[];this.responses={};this.correctResponses={};this.lmsResponses=[];this.lmsCorrectResponses=[];this.attempts=[];this.variables={};this.loadFromXML(this.xml,this.parent);this.m_nUserAnswerIndex=-1;this.m_bUnanswered=this.m_bAnswered=!1};
Interaction.prototype.loadFromXML=function(a,b){var c=this;this.slide=this.parent=b;this.children={};this.xml=a;this.id=$(a).attr("id");this.lmsid=$(a).attr("lmsid");this.lmstext=$(a).attr("lmstext");this.interactionType=$(a).attr("type");this.maxpoints=$(a).attr("maxpoints");this.aoinclude=$(a).attr("aoinclude");this.istracked=$(a).attr("istracked");this.issurvey="true"==$(a).attr("issurvey");this.skipEnabled="true"==$(a).attr("skipenabled");$(a).children("choices").children("choice").each(function(a,
b){var f=new Choice;f.loadFromXML(b,this);f.longID="choices."+f.id;c.choices[f.id]=f;c.children[f.id]=f});$(a).children("statements").children("statement").each(function(a,b){var f=new Choice;f.loadFromXML(b,this);f.innerType="Statement";f.longID="statements."+f.id;c.statements[f.id]=f;c.children[f.id]=f});$(a).children("answers").children("answer").each(function(a,b){var f=new Answer;f.loadFromXML(b,this);c.answers[f.id]=f;c.children[f.id]=f});this.responseActions=$(a).children("response_definition").children("actions").children();
this.variables.AttemptCount=0;this.variableDefaults.AttemptCount=0};
Interaction.prototype.evaluate=function(a,b,c,d){var e=this.slide;this.scoreAO=!b;if(!d)e.responses={},this.responses={},this.lmsResponses=[];this.lmsCorrectResponses=[];this.variables.AttemptCount++;this.partialEvaluate&&(this.variables.AttemptCount=1);d||($.each(this.choices,function(a,b){b.selected=!1;b.pairs=[]}),$.each(this.statements,function(a,b){b.pairs=[]}),$.each(this.responseActions,function(a,b){e.runAction(b)}));var b=!1,d=!0,f=0;$.each(this.answers,function(a,b){$.each(b.evaluate,function(){f++})});
var g=0,h;for(h in this.responses)g++;this.m_bUnanswered=!0;h=0;for(var j in this.answers){var l=this.answers[j],m=!0,k=!1,n=0;$.each(l.evaluate,function(){n++});for(var p=0<parseInt(l.points),r=0;r<l.evaluate.length;r++){var o=l.evaluate[r];switch(o.tagName){case "other":m=!d&&!b?!0:1==f?!0:!1;break;case "equals":var t=$(o).attr("choiceid"),o="true"==$(o).attr("ignorecase"),t=this.parseObjref(t).target,o=t.selected&&(o||t.matchedCase),m=m&&o,k=k||o;switch(this.interactionType){case "fillin":case "numeric":m=
k;break;case "multipleresponse":g!=n&&(m=!1);break;case "multiplechoice":case "truefalse":break;default:console.warn("unknown interactionType",this.interactionType)}p&&this.lmsCorrectResponses.push(new ResponseData(!1,t.id,"",t.lmstext,""));break;case "condition":m=m&&e.evaluateCondition(o,this);break;case "pair":var t=$(o).attr("choiceid"),o=$(o).attr("statementid"),t=this.parseObjref(t).target,o=this.parseObjref(o).target,v=t.hasPair(o);if(v){var w=t.findPair(o),A=0;$.each(l.evaluate,function(a,
b){-1<$(b).attr("statementid").indexOf(w.id)&&A++});v=v&&A==w.pairs.length}m=m&&v;k=k||v;p&&this.lmsCorrectResponses.push(new ResponseData(!0,t.id,o.id,t.lmstext,o.lmstext))}}m&&(k=!0);if(k)this.m_bUnanswered=!1,this.m_bAnswered=!0;if(c){if(!this.partialEvaluate)this.partialEvaluate={};this.partialEvaluate.attemptCount=this.variables.AttemptCount;if(m)this.partialEvaluate.status=l.status,this.partialEvaluate.points=l.points,this.m_nUserAnswerIndex=h,b=!0}else if(m){this.variables.Status=l.status;
this.variables.Points=l.points;this.m_nUserAnswerIndex=h;if(!a)for(r=0;r<l.actions.length;r++)e.runAction(l.actions[r]);b=!0}d=!1;h++}c||Interaction.updateScore("from interaction evaluate: "+this.id);this.updateSlideList(!0);if(c){if(0<g)this.m_bAnswered=!0;this.variables.AttemptCount--}else b||this.variables.AttemptCount--,this.partialEvaluate=null,this.noteAttempt(),"view"!=story.scoring.type&&player.lmsManager.handleInteractionEvaluated(this)};
Interaction.prototype.noteAttempt=function(){var a={time:player.elapsedTime(),isfinal:!0,sent:!1,pointsAwarded:this.variables.Points,result:this.variables.Status,answers:[]};$.each(this.lmsResponses,function(b,c){a.answers.push(c.m_bPairResponse?{statementid:c.statementLMSText,choiceid:c.lmstext}:{choiceid:c.lmstext})});this.attempts.push(a)};
Interaction.prototype.updateSlideList=function(a){if(player.frame.options.enableresultsicons&&this.slide.showmenuresulticon){var b="";switch(this.variables.Status){case "correct":b="correct";break;case "incorrect":b="incorrect";break;case "neutral":case "unanswered":case void 0:b="";break;default:b=""}b={status:b,points:parseInt(this.variables.Points)};Interaction.slideStatus[this.slide.getFullObjref(!0)]=b;a&&player.frame.updateMenuData(null,Interaction.slideStatus)}};
Interaction.prototype.Answered=function(){return this.m_bAnswered?"true":"false"};Interaction.getCurrentQuiz=function(){var a=null,b=player.currentSlide().getFullObjref(!0);$.each(story.quizzes,function(c,d){$.each(d.sliderefs,function(c,f){-1<b.indexOf(f)&&(a=d)})});return a};
Interaction.updateScore=function(){$.each(story.quizzes,function(a,b){var c=0,d=0,e=0;$.each(b.sliderefs,function(a,g){var h=story.parseObjref(g).target;if(h){var j=function(a,b){e++;d+=parseInt(b.maxpoints);var f=parseInt(b.variables.Points)||0;c+=f};"SlideDraw"==h.innerType&&$.each(h.children,function(a,c){("partial"!=b.scoretype||c.variables.Visited)&&$.each(c.interactions,j)});("partial"!=b.scoretype||h.variables.Visited)&&$.each(h.interactions,j)}});b.variables.Score=c;b.maxscore=d;b.variables.PercentScore=
parseFloat(parseInt(1E4*c/d)/100);isNaN(b.variables.PercentScore)&&(b.variables.PercentScore=0);b.variables.PassScore=Math.ceil(parseFloat(b.variables.PassPercent*d/100));if(window&&window.g_oContentResults)window.g_oContentResults.nScore=b.variables.PercentScore;b.handleVarChanged("Score","onvarchanged")});$.each(story.quizzes,function(a,b){if(0!=b.quizrefs.length){var c=0,d=0;$.each(b.quizrefs,function(a,b){var g=story.parseObjref(b.id).target;g&&!isNaN(g.variables.Score)&&(c+=g.variables.Score,
d+=g.maxscore)});b.variables.Score=c;b.maxscore=d;b.variables.PercentScore=parseFloat(parseInt(1E4*c/d)/100);isNaN(b.variables.PercentScore)&&(b.variables.PercentScore=0);b.variables.PassScore=Math.ceil(parseFloat(b.variables.PassPercent*d/100));if(window&&window.g_oContentResults)window.g_oContentResults.nScore=b.variables.PercentScore;b.handleVarChanged("Score","onvarchanged")}})};
Interaction.partialEvaluateSlide=function(a){$.each(a.interactions,function(a,c){(!c.variables.Status||"unanswered"==c.variables.Status)&&c.evaluate(!0,!0,!0)})};
Interaction.eval_all_unanswered=function(a){var b={},c=function(a){var c=!1;$.each(a.interactions,function(a,b){if(!b.variables.Status||"unanswered"==b.variables.Status){(!b.partialEvaluate||!b.partialEvaluate.status||"unanswered"!=b.partialEvaluate.status)&&b.evaluate(!0,!0,!0);if(b.partialEvaluate)b.variables.Status=b.partialEvaluate.status,b.variables.Points=b.partialEvaluate.points,b.variables.AttemptCount=b.partialEvaluate.attemptCount,b.updateSlideList();b.variables.Status||(b.variables.Status=
"unanswered");for(c=!0;b.attempts.length<b.variables.AttemptCount;){var d={time:player.elapsedTime(),isfinal:!0,sent:!1,pointsAwarded:b.variables.Points,result:b.variables.Status,answers:[]};b.attempts.push(d)}}b.m_bAnswered=!0});if(c)a.rebuildInteractionData(),b[a.parent.id]=a.parent};if(a&&"Quiz"==a.innerType)a.m_bEvaluated=!0,$.each(a.sliderefs,function(a,b){var f=story.parseObjref(b).target;f&&("SlideDraw"==f.innerType?$.each(f.children,function(a,b){c(b)}):c(f))}),$.each(b,function(a,b){b.compactResumeData=
b.getResumeData()}),Interaction.updateScore("from eval_all_unanswered"),player.frame.updateMenuData(null,Interaction.slideStatus)};Interaction.setquizcomplete=function(a){a=story.parseObjrefFromXML(a).target;a.m_bCompleted=!0;player.lmsManager.handleQuizComplete(a)};function Scoring(){this.scorerefs={}}
Scoring.prototype.loadFromXML=function(a,b){var c=this;this.parent=b;this.scorerefs={};this.id=$(a).attr("id");this.type=$(a).attr("type");this.passpercent=$(a).attr("passpercent");this.viewthreshold=parseInt($(a).attr("viewthreshold"));this.passstatus=$(a).attr("passstatus");this.failstatus=$(a).attr("failstatus");if(isNaN(this.viewthreshold))this.viewthreshold=0;$(a).children("scorerefs").children("scoreref").each(function(a,b){var f={};f.type=$(b).attr("type");f.ref=$(b).attr("ref");f.weight=$(b).attr("weight");
f.maxvalue=$(b).attr("maxvalue");f.mustpass=$(b).attr("mustpass");c.scorerefs[f.ref]=f})};function AOClient(){this.endpoint="http://"+window.location.host+"/services/content/api.asmx";if(-1<location.href.indexOf("aomock=1"))this.endpoint="/AOMock/AO.asmx";this.apiVersion="0.0";this.sendcount=0}
AOClient.prototype.call=function(a,b,c,d){var e="http://articulate.com/KnowledgeFlash/Services/Content/Api/"+a,f=$.parseXML(b),g=this,h=this.endpoint+"?rand="+Math.random();$.ajax({url:h,type:"POST",dataType:"xml",data:f,headers:{SOAPAction:e},processData:!1,contentType:'text/xml; charset="utf-8"',cache:!1,success:function(a,b,d){c&&c(a,b,d)},error:function(){if(-1<location.search.indexOf("aodebug="))debugger;d&&!window.manuallyClosing&&confirm("Unable to connect to the server.  Please verify you can connect to the internet. Retry?")&&
g.call(a,b,c,d);return!1}})};AOClient.prototype.wrapWithEnvelope=function(a){return'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>'+a+"</soap:Body></soap:Envelope>"};
AOClient.prototype.getVanillaXML=function(a){return this.wrapWithEnvelope("<"+a+' xmlns="http://articulate.com/KnowledgeFlash/Services/Content/Api"><contentUrl>'+escape(location.href)+"</contentUrl></"+a+">")};AOClient.prototype.GetApiVersion=function(){var a=this;this.call("GetApiVersion",this.getVanillaXML("GetApiVersion"),function(b){this.apiVersion=$(b).find("GetApiVersionResult").text();a.apiVersionReturned=!0})};
AOClient.prototype.GetSessionId=function(){var a=this;this.call("GetSessionId",this.getVanillaXML("GetSessionId"),function(b){player.aoSessionID=$(b).find("GetSessionIdResult").text();a.getSessionIdReturned=!0})};AOClient.prototype.GetResumeInfo=function(){var a=this;this.call("GetResumeInfo",this.getVanillaXML("GetResumeInfo"),function(b){b=$(b).find("GetResumeInfoResult").text();player.aoResumeData=b;a.getResumeInfoReturned=!0})};
AOClient.prototype.RefreshSession=function(){this.call("RefreshSession",this.getVanillaXML("RefreshSession"),function(a){$(a).find("RefreshSessionResult").text()})};AOClient.prototype.SetViewBasedComplete=function(){};AOClient.prototype.SavePlayerData=function(){this.call("SavePlayerData",this.wrapWithEnvelope(story.toAOData()),function(){var a=story.getDescendantsByType("Interaction");$.each(a,function(a,c){$.each(c.attempts,function(a,b){b.sent=!0})})},!0);this.sendcount++};
AOClient.prototype.SaveResume=function(){var a="",a=player.useCompactResume?story.toResumeData():JSON.stringify(story.toData(!0));this.call("SaveResume",this.wrapWithEnvelope('<SaveResume xmlns="http://articulate.com/KnowledgeFlash/Services/Content/Api"><contentUrl>'+escape(location.href)+'</contentUrl><playerdata sessionid="string"><resumeData>'+a+"</resumeData></playerdata></SaveResume>"),function(){})};
AOClient.prototype.reCapitalize=function(a,b){$.each(b,function(b,d){a=a.replace(RegExp("<"+d,"ig"),"<"+d);a=a.replace(RegExp("</"+d,"ig"),"</"+d);a=a.replace(RegExp(d+'="',"ig"),d+'="')});return a};AOClient.prototype.handleInteractionEvaluated=function(){(player.isMobile||-1<location.search.indexOf("aoforce=1"))&&player.aoClient.SavePlayerData(!0)};
AOClient.prototype.init=function(){var a=this;this.GetApiVersion();this.GetSessionId();this.GetResumeInfo();this.refreshInterval=setInterval(function(){a.RefreshSession()},6E4);var b=!1;$(window).bind("unload beforeunload",function(){b||(a.SavePlayerData(!1),b=!0)})};AOClient.prototype.isReady=function(){return!0==this.apiVersionReturned&&!0==this.getSessionIdReturned&&!0==this.getResumeInfoReturned?!0:!1};
Interaction.prototype.toAOData=function(){var a=this,b=$("<interaction/>");b.attr("idRef",this.getFullObjref());b.attr("type",this.interactionType);$.each(this.attempts,function(c,d){var e=$("<attempt/>");e.attr("time",d.time);e.attr("final",d.isfinal);e.attr("sent",d.sent);e.attr("pointsAwarded",d.pointsAwarded);e.attr("result",d.result);switch(a.interactionType){case "fillin":case "numeric":$.each(d.answers,function(a,b){var c=$("<answer/>");c.get(0).innerHTML=b.choiceid;e.append(c)});break;case "likert":case "matching":case "sequence":$.each(d.answers,
function(a,b){var c=$("<answer/>");c.attr("statementid",b.statementid);c.attr("choiceid",b.choiceid);e.append(c)});break;default:$.each(d.answers,function(a,b){var c=$("<answer/>");c.attr("choiceid",b.choiceid);e.append(c)})}b.append(e)});return b};
Quiz.prototype.toAOData=function(){var a=$("<quiz/>");a.attr("idRef",this.getFullObjref());a.attr("duration",player.elapsedTime());this.issurvey?this.status=this.m_bCompleted?"complete":"incomplete":(a.attr("score",this.variables.Score),a.attr("possibleScore",this.maxscore),this.status=this.m_bCompleted?parseInt(this.variables.Score)>=parseInt(this.variables.PassScore)?story.scoring.passstatus:story.scoring.failstatus:"incomplete");a.attr("status",this.status);var b=$("<interactions/>");$.each(this.sliderefs,
function(a,d){function e(a){$.each(a.interactions,function(a,c){(c.scoreAO||player.forceAO)&&b.append($(c.toAOData()))})}var f=story.parseObjref(d).target;"SlideDraw"==f.innerType?$.each(f.children,function(a,b){e(b)}):e(f)});a.append(b);return a.get(0).outerHTML};
Storyline.prototype.toAOData=function(){var a=$('<SavePlayerData xmlns="http://articulate.com/KnowledgeFlash/Services/Content/Api"/>');a.append($("<contentUrl>"+location.href+"</contentUrl>"));var b=$("<playerdata/>");b.attr("sessionid",player.aoSessionID);b.attr("sendcount",player.aoClient.sendcount);var c=story.toResumeData();b.append($("<resumeData>"+c+"</resumeData>"));$.each(this.allSlides,function(a,b){if(b!=player.currentSlide()&&b.compactResumeData&&!b.hasRestoredInteractions)try{b.restoreFromResumeData(b.compactResumeData,
!0)}catch(c){}b.hasRestoredInteractions=!0});var c=$("<results/>"),d=$("<summary/>"),e=$("<quizzes/>"),f=$("<viewdata/>"),g=0,h=0,j=story.scoring.failstatus;$.each(this.quizzes,function(a,b){if(story.scoring.scorerefs[b.id])g+=parseInt(b.variables.Score),h+=b.maxscore,e.append($(b.toAOData())),j=b.status});for(var l in player.listSlidesViewed){var m=story.parseObjref(l).target;if(m.trackviews){var k=$("<slide/>");k.attr("id",m.getFullObjref());k.attr("viewgroupid",m.viewgroupid);f.append(k)}}f.attr("total",
player.totalViewSlides);f.attr("viewed",player.currentSlidesViewed);f.attr("viewedcomplete",player.completeSlidesViewed);b.append(f);l=parseFloat(parseInt(1E4*g/h)/100);isNaN(l)&&(l=0);if("view"==story.scoring.type){if(0<story.scoring.viewthreshold&&player.completeSlidesViewed>=story.scoring.viewthreshold)j=story.scoring.passstatus;d.attr("slidesviewed",player.completeSlidesViewed);d.attr("slidestotal",player.totalViewSlides);d.attr("duration",player.elapsedTime());d.attr("status",j)}else d.attr("duration",
player.elapsedTime()),d.attr("status",j),c.append(e),"quiz"==story.scoring.type&&(d.attr("score",l),d.attr("possibleScore",100));c.append(d);b.append(c);a.append(b);return player.aoClient.reCapitalize(a.get(0).outerHTML,"SavePlayerData,resumeData,contentUrl,idRef,pointsAwarded,possibleScore".split(","))};function LMSClient(){}
LMSClient.prototype.initResume=function(){var a="";if(window&&window.lms_DoFSCommand){window.hasLMS=!0;window.lmsAPI=parent;if(!parent.GetDataChunk&&window.GetDataChunk)window.lmsAPI=window;if(!window.lmsAPI.GetDataChunk)window.g_bAPIPresent=!1,window.g_bLMSPresent=window.lmsAPI.IsLmsPresent&&window.lmsAPI.IsLmsPresent();window.g_bAPIPresent=!0;if(!window.lmsAPI.GetDataChunk)window.g_bAPIPresent=!1,window.hasLMS=!1,player.hasLMS=!1,player.lmsManager.hasLMS=!1;window.g_bLMSPresent=window.lmsAPI.IsLmsPresent&&
window.lmsAPI.IsLmsPresent();if(window.g_bAPIPresent)a=window.lmsAPI.GetDataChunk("cmi.suspend_data"),window.lmsAPI.g_strResumeData=a,window.g_strResumeData=a,window.LMSCommit(),window.lms_DoFSCommand("BW_InitResume")}return a};LMSClient.prototype.handleInteractionEvaluated=function(a){if("view"!=story.scoring.type){a=a.toLMSData();try{window.lms_DoFSCommand("BW_StoreQuestionResult",a)}catch(b){}window.lms_DoFSCommand("BW_UpdateStatus")}};LMSClient.prototype.handleClosePlayer=function(){try{window.lms_DoFSCommand("BW_ClosePlayer")}catch(a){}return!1};
LMSClient.prototype.sendResumeData=function(){if(player.useCompactResume){var a=story.toResumeData();lms_DoFSCommand("BW_SetResumeData",a);player.isMobile&&ForceCommit()}};LMSClient.prototype.reportViewBasedComplete=function(){window.g_oContentResults.nScore=100;window.g_oContentResults.strStatus=story.scoring.passstatus;window.g_oContentResults.strType="view";window.lms_DoFSCommand("BW_UpdateViewStatus",story.scoring.passstatus+"|~|view")};
Interaction.prototype.toLMSData=function(){var a=[],b=this.parent,c=null;$.each(story.quizzes,function(a,d){$.each(d.sliderefs,function(a,e){var f=story.parseObjref(e).target;f==b?c=d:"SlideDraw"==f.innerType&&$.each(f.children,function(a,e){e==b&&(c=d)})})});if(!b||!c)return"";for(var d=c.attemptCount,e=parseInt(this.variables.AttemptCount-1),f=0,g=0;g<c.sliderefs.length;g++)-1<c.sliderefs[g].indexOf(b.id)&&(f=g+1);d=b.parent.lmsid+"_"+b.lmsid+"_"+this.lmsid+"_"+d+"_"+e;b.parent.parent&&b.parent.parent.lmsid&&
(d=b.parent.parent.lmsid+"_"+d);a.push(c.id);a.push(d);a.push(this.lmsid);a.push(this.interactionType);a.push(this.concatChoices(this.lmsCorrectResponses));a.push(this.concatChoices(this.lmsResponses));a.push("0");a.push(this.variables.Status);a.push(this.variables.Points);a.push(GetTime(new Date));a.push("1");a.push(f);a.push(this.lmstext);a.push(c.lmstext);a.push(this.istracked);return a.join(window.g_strLDelim||"|~|")};
Interaction.prototype.concatChoices=function(a){var b=[],c=window.g_strLInteractionDelim||"|#|";$.each(a,function(a,c){c.m_bPairResponse&&b.push(c.statementLMSText);b.push(c.lmstext)});return b.join(c)};
Quiz.prototype.reportLMSStatus=function(){if("view"!=story.scoring.type&&story.scoring.scorerefs[this.id]){var a=[],b="",b=parseInt(this.variables.Score)>=parseInt(this.variables.PassScore)?story.scoring.passstatus:story.scoring.failstatus,c=100*this.variables.Score/this.maxscore,d=100*this.variables.PassScore/this.maxscore;a.push(b);a.push(c);a.push(0);a.push(100);a.push(d);a.push("quiz");a=a.join(window.g_strLDelim||"|~|");window.g_oContentResults.nScore=c;window.g_oContentResults.strStatus=b;window.lms_DoFSCommand("BW_UpdateStatus",
a)}};function LMSManager(){this.hasTinCan=this.hasLMS=this.hasAO=!1;this.viewedSlides={}}LMSManager.prototype.initResume=function(){if(this.hasLMS)return player.lmsClient.initResume()};LMSManager.prototype.handleInteractionEvaluated=function(a){this.hasAO?player.aoClient.handleInteractionEvaluated(a):this.hasLMS?player.lmsClient.handleInteractionEvaluated(a):this.hasTinCan&&player.tinCanClient.handleInteractionEvaluated(a)};
LMSManager.prototype.handleSlideViewed=function(a){a.trackviews&&(this.viewedSlides[a.id]=!0);a.viewedCurrent=!0;0<story.scoring.viewthreshold&&"view"==story.scoring.type&&player.completeSlidesViewed>=story.scoring.viewthreshold?this.hasAO?(player.aoClient.SetViewBasedComplete(),player.aoClient.SavePlayerData(!0)):this.hasLMS?(player.lmsClient.reportViewBasedComplete(),player.lmsClient.sendResumeData()):this.hasTinCan&&player.tinCanClient.reportViewBasedComplete(player.completeSlidesViewed):player.isIOS&&
0<story.scoring.viewthreshold&&"view"==story.scoring.type&&this.hasAO&&player.aoClient.SavePlayerData(!0);this.hasLMS?player.lmsClient.sendResumeData():this.hasAO?player.aoClient.SaveResume():this.hasTinCan&&(player.tinCanClient.handleSlideViewed(a),player.tinCanClient.sendResumeData())};LMSManager.prototype.handleQuizComplete=function(a){this.hasAO&&player.aoClient.SavePlayerData(!0);this.hasLMS&&a.reportLMSStatus();this.hasTinCan&&player.tinCanClient.reportQuizComplete(a)};
LMSManager.prototype.handleClosePlayer=function(){var a=!1;this.hasLMS&&(a=player.lmsClient.handleClosePlayer());this.hasTinCan&&(a=player.tinCanClient.handleClosePlayer());return a};LMSManager.prototype.initTinCan=function(){this.hasTinCan&&player.tinCanClient.init()};
LMSManager.prototype.init=function(){if(globals.bAOSupport||window.g_bAOSupport||player.useAO)player.aoClient=new AOClient,player.aoClient.init(),this.hasAO=!0;else if(globals.bTinCan||window.g_bTinCan||player.useTinCan)player.tinCanClient=new TinCanClient,this.hasTinCan=!0;else if(window&&window.lms_DoFSCommand){player.lmsClient=new LMSClient;player.hasLMS=!0;window.lmsAPI=parent;if(!parent.GetDataChunk&&window.GetDataChunk)window.lmsAPI=window;window.g_bAPIPresent=!0;window.g_bLMSPresent=window.lmsAPI.IsLmsPresent&&
window.lmsAPI.IsLmsPresent();this.hasLMS=!0}};LMSManager.prototype.isReady=function(){return this.hasAO?player.aoClient.isReady():this.hasTinCan?player.tinCanClient.isReady():!0};function QuizData(a,b){this.strQuizId=a;this.strQuizName=b;this.arrQuestions=[];this.dtmFinished=new Date;this.strStatus="";this.nScore=0;this.nPassingScore=80;this.nMinScore=0;this.nMaxScore=100;this.nPtScore=0;this.nPtMax=100;this.AddQuestionResult=function(a){for(var b=!1,e=0;e<this.arrQuestions.length;e++)this.arrQuestions[e].nQuestionNumber==a.nQuestionNumber&&(this.arrQuestions[e]=a,b=!0);b||this.arrQuestions.push(a)}}
function ContentResults(){this.dtmFinished=new Date;this.nPassingScore=80;this.nScore=0;this.strStatus="incomplete";this.strType="quiz"}function QuestionResults(a,b,c,d,e,f,g,h,j,l,m,k,n){this.strId=a;this.strLMSId=b;this.strType=c;this.strCorrectResponse=d;this.strUserResponse=e;this.nLatency=f;this.strStatus=g;this.nPoints=h;this.strCompletedTime=j;this.nWeight=l;this.nQuestionNumber=m;this.strDescription=k;this.bTracked=n}
function GetTime(a){var b="",b=a.getHours(),c=a.getMinutes(),d=""+c,a=a.getSeconds(),e=""+a;10>c&&(d="0"+c);10>a&&(e="0"+a);return b+":"+d+":"+e}function GetDate(a){var b="";return b=a.getMonth()+1+"/"+a.getDate()+"/"+a.getFullYear()}if(window){window.g_oContentResults=new ContentResults;window.g_listQuizzes={};var unloadFired=!1;$(window).bind("unload beforeunload",function(){!unloadFired&&parent.LMSUnload&&(parent.LMSUnload(),unloadFired=!0)})};var TC_PARAM_AUTH="auth",TC_PARAM_REG="registration",TC_PARAM_ACTIVITY_ID="activity_id",TC_PARAM_ACTOR="actor",TC_PARAM_ENDPOINT="endpoint",TC_PARAM_GROUPING="grouping",TC_PARAM_CONTENT_ENDPOINT="content_endpoint",TC_PARAM_CONTENT_TOKEN="content_token",TC_PARAM_ACCEPT_LANGUAGE="Accept-Language",TC_PARAM_ACTIVITY_PLATFORM="activity_platform",TC_PARAM_TINCAN="tincan",REQ_TYPE_RESUME_SAVE=1,REQ_TYPE_RESUME_RESTORE=2,REQ_TYPE_TRACKING=3,URI_PREFIX="http://",URI_DELIM="/";
function AlertError(a){console.error("Fatal Comm Error: "+a);alert("ERROR: "+a)}function ppTinCanRequest(a,b,c,d,e){this.MessageType=a;this.Method=b;this.Data=c;this.Url=d;this.Callback=e}
function ppTinCanComm(a,b){this.m_nVersion=b;this.debugNoLRS=this.m_bHasRegistration=!1;this.m_listParams={};this.m_listCustomParams={};this.m_jsActor={};this.m_strQueryString=a;this.ParseQueryString(this.m_strQueryString);this.m_bClosePlayer=this.m_bStopPosting=this.m_bWaitingTinCanResponse=!1;this.m_arrTinCanMsgQueue=[];this.m_pfnFatalError=AlertError;this.m_bIE=document.all&&-1!=navigator.appVersion.indexOf("MSIE")?!0:!1}
ppTinCanComm.prototype.PostOnClose=function(){for(this.m_bStopPosting=!0;0<this.m_arrTinCanMsgQueue.length;)this.PostSyncRequest(this.m_arrTinCanMsgQueue.shift())};ppTinCanComm.prototype.GetAuth=function(){return this.m_listParams[TC_PARAM_AUTH]};ppTinCanComm.prototype.HasRegistration=function(){return this.m_bHasRegistration};ppTinCanComm.prototype.GetRegistration=function(){return this.m_listParams[TC_PARAM_REG]};
ppTinCanComm.prototype.GetActivityId=function(){var a=URI_PREFIX+player.courseId;this.m_listParams[TC_PARAM_ACTIVITY_ID]&&(a=this.m_listParams[TC_PARAM_ACTIVITY_ID]);return a};ppTinCanComm.prototype.FormatUri=function(){var a=this.GetActivityId(),b=Array.prototype.slice.call(arguments);if(1>this.m_nVersion)a=0<b.length?b.join("."):this.GetActivityId();else if(null!=b&&0<b.length)for(var c=0;c<b.length;c++)a=a+URI_DELIM+b[c];return a};ppTinCanComm.prototype.GetActor=function(){return this.m_listParams[TC_PARAM_ACTOR]};
ppTinCanComm.prototype.GetActorObj=function(){return this.m_jsActor};ppTinCanComm.prototype.GetEndPoint=function(){return this.m_listParams[TC_PARAM_ENDPOINT]};ppTinCanComm.prototype.GetGrouping=function(){return this.m_listParams[TC_PARAM_GROUPING]};
ppTinCanComm.prototype.ParseQueryString=function(a){for(var a=a.split("&"),b="",c="",b="",d=0,e=0;e<a.length;e++)if(b=a[e],d=b.indexOf("="),c=decodeURIComponent(b.substr(0,d)),b=decodeURIComponent(b.substr(d+1)),this.m_listParams[c]=b,!(this.debugNoLRS&&"name"==c))switch(c){case TC_PARAM_ACTOR:this.CreateActor(b);break;case TC_PARAM_REG:this.m_bHasRegistration=!0;break;case TC_PARAM_AUTH:case TC_PARAM_GROUPING:case TC_PARAM_ACTIVITY_ID:case TC_PARAM_ENDPOINT:case TC_PARAM_CONTENT_ENDPOINT:case TC_PARAM_CONTENT_TOKEN:case TC_PARAM_ACCEPT_LANGUAGE:case TC_PARAM_ACTIVITY_PLATFORM:case TC_PARAM_TINCAN:break;
default:this.m_listCustomParams[c]=b}};
ppTinCanComm.prototype.CreateActor=function(a){a=JSON.parse(a);if(1>this.m_nVersion)this.m_jsActor=a;else{this.m_jsActor={};var b=null,c;for(c in a)b=a[c],Array.isArray(b)&&(b=b[0]),this.m_jsActor[c]=b;if(null!=this.m_jsActor.account){c={homePage:"-",name:"-"};if(null!=this.m_jsActor.account.homePage)c.homePage=this.m_jsActor.account.homePage;else if(null!=this.m_jsActor.account.accountServiceHomePage)c.homePage=this.m_jsActor.account.accountServiceHomePage;if(null!=this.m_jsActor.account.name)c.name=
this.m_jsActor.account.name;else if(null!=this.m_jsActor.account.accountName)c.name=this.m_jsActor.account.accountName;this.m_jsActor.account=c}}};ppTinCanComm.prototype.ConvertToPost=function(a,b,c,d,e,f){var g="",h;for(h in e)g+=h+"="+encodeURIComponent(e[h])+"&";0<d.length&&(g+="content="+encodeURIComponent(d));this.QueueRequest(new ppTinCanRequest(a,"POST",g,b+"?method="+c,f))};
ppTinCanComm.prototype.GetHeaders=function(){var a={};a.Authorization=this.m_listParams[TC_PARAM_AUTH];this.HasRegistration()&&1>this.m_nVersion&&(a.registration=this.m_listParams[TC_PARAM_REG]);a["Content-Type"]="application/json";1<=this.m_nVersion&&(a["X-Experience-API-Version"]="1.0.0");for(var b in this.m_listCustomParams)a[b]=this.m_listCustomParams[b];return a};
ppTinCanComm.prototype.QueueRequest=function(a){this.m_bWaitingTinCanResponse||this.m_bStopPosting?this.m_arrTinCanMsgQueue.push(a):this.PostAsyncRequest(a)};
ppTinCanComm.prototype.PostAsyncRequest=function(a){try{this.UseXDomainRequest(a.Url)?this.PostXDomainRequest(a,!1):this.PostXmlHttp(a)}catch(b){confirm("Unable to connect to server.  Please verify that you are connected to the internet. Retry?")?(this.m_bWaitingTinCanResponse=!1,this.QueueRequest(a)):this.debugNoLRS?this.OnSendComplete():(this.m_bFatalError=this.m_bStopPosting=!0,this.m_pfnFatalError(0),this.m_bClosePlayer&&this.DoClosePlayer())}};
ppTinCanComm.prototype.PostXDomainRequest=function(a,b){var c=new XDomainRequest;c.open(a.Method,a.Url);c.TCRequest=a;c.TCComm=this;c.status=0;c.onload=function(){c.status=200;b||this.TCComm.OnSendComplete(c)};c.onerror=function(){c.status=-1;b||this.TCComm.OnSendError(c)};c.send(strData);if(b)for(var d=(new Date).getTime();5E3>(new Date).getTime()-d&&0==c.status;){var e=new XMLHttpRequest;e.open("GET",window.location+"?"+(new Date).getTime(),!1);e.send(null)}return c.status};
ppTinCanComm.prototype.PostXmlHttp=function(a){var b=this.CreateXmlHttp();if(null!=b)this.m_bWaitingTinCanResponse=!0,b.TCRequest=a,b.TCComm=this,b.onreadystatechange=function(){4==b.readyState&&(400<=b.status&&!(this.m_bIE&&1223==b.status)?this.TCComm.OnSendError(b):this.TCComm.OnSendComplete(b))},b.open(a.Method,a.Url,!0),b.send(a.Data)};
ppTinCanComm.prototype.OnSendComplete=function(a){null!=a&&null!=a.TCRequest.Callback&&void 0!=a.TCRequest.Callback&&a.TCRequest.Callback(a.responseText);this.m_bWaitingTinCanResponse=!1;0<this.m_arrTinCanMsgQueue.length&&!this.m_bStopPosting?this.QueueRequest(this.m_arrTinCanMsgQueue.shift()):this.m_bClosePlayer&&this.DoClosePlayer()};
ppTinCanComm.prototype.OnSendError=function(a){a.TCRequest.MessageType==REQ_TYPE_RESUME_RESTORE?(a.TCRequest.Callback(""),this.m_bWaitingTinCanResponse=!1,0<this.m_arrTinCanMsgQueue.length&&!this.m_bStopPosting&&this.QueueRequest(this.m_arrTinCanMsgQueue.shift())):confirm("Unable to connect to server.  Please verify that you are connected to the internet. Retry? ")?(this.m_bWaitingTinCanResponse=!1,this.QueueRequest(a.TCRequest)):this.debugNoLRS?this.OnSendComplete():(this.m_bFatalError=this.m_bStopPosting=
!0,a.status&&this.m_pfnFatalError(a.status))};ppTinCanComm.prototype.ClosePlayer=function(){this.m_bStopPosting||this.m_bFatalError?this.DoClosePlayer():0==this.m_arrTinCanMsgQueue.length&&this.DoClosePlayer();this.m_bClosePlayer=!0};ppTinCanComm.prototype.DoClosePlayer=function(){setTimeout(function(){top.window.open("","_self");top.window.close()},10)};
ppTinCanComm.prototype.CreateXmlHttp=function(){var a=null,b=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"],c=0;if(window.XMLHttpRequest)try{a=new XMLHttpRequest}catch(d){a=null}if(null==a&&window.ActiveXObject)for(;null==a&&c<b.length;){try{a=new ActiveXObject(b[c])}catch(e){a=null}c++}return a};
ppTinCanComm.prototype.PostSyncRequest=function(a){try{var b=0,b=this.UseXDomainRequest(a.Url)?this.PostXDomainRequest(a,!0):this.PostSyncXmlHttp(a);if(200!=b)confirm("Could not save the result data. You may need to login again. Retry?")?this.PostSyncRequest(a):this.m_bFatalError=!0}catch(c){confirm("Unable to connect to server.  Please verify that you are connected to the internet. Retry?")?this.PostSyncRequest(a):this.m_bFatalError=!0}};
ppTinCanComm.prototype.PostSyncXmlHttp=function(a){var b=this.CreateXmlHttp(),c=200;null!=b&&(b.open(a.Method,a.Url,!1),b.send(a.Data),400<=b.status&&!(this.m_bIE&&1223==b.status)&&(c=-1));return c};ppTinCanComm.prototype.UseXDomainRequest=function(a){var b=!1;if(window.XDomainRequest){this.CreateXmlHttp();var b=document.createElement("a"),c=document.createElement("a");b.href=a;c.href=window.location;b=b.hostname!=c.hostname||b.protocol!=c.protocol||b.port!=c.port}return b};function TinCanDefinitions(){this.TINCAN_FILE="tincan.xml";this.langCode="und";this.activityTypes={COURSE:"http://adlnet.gov/expapi/activities/course",MODULE:"http://adlnet.gov/expapi/activities/module",MEETING:"http://adlnet.gov/expapi/activities/meeting",MEDIA:"http://adlnet.gov/expapi/activities/media",PERFORMANCE:"http://adlnet.gov/expapi/activities/performance",SIMULATION:"http://adlnet.gov/expapi/activities/simulation",ASSESSMENT:"http://adlnet.gov/expapi/activities/assessment",INTERACTION:"http://adlnet.gov/expapi/activities/interaction",
QUESTION:"http://adlnet.gov/expapi/activities/question",OBJECTIVE:"http://adlnet.gov/expapi/activities/objective",CMI_INTERACTION:"http://adlnet.gov/expapi/activities/cmi.interaction"};this.objectTypes={ACTIVITY:"Activity",AGENT:"Agent",GROUP:"Group",SUB_STATEMENT:"SubStatement",STATEMENT_REF:"StatementRef"}}
TinCanDefinitions.prototype.loadTinCanData=function(){var a=this;console.warn("Load File: "+player.basepath+a.TINCAN_FILE);$.ajax({url:player.basepath+a.TINCAN_FILE,dataType:"xml",success:function(b){a.onDataLoaded(b)},error:function(a,c,d){console.warn("Could not load the file 'tincan.xml': "+d)}})};TinCanDefinitions.prototype.onDataLoaded=function(){console.warn("Tincan Data Loaded")};
TinCanDefinitions.prototype.getCourseObject=function(a){return{id:a,definition:{name:{und:globals.strTitle},type:this.activityTypes.COURSE},objectType:this.objectTypes.ACTIVITY}};TinCanDefinitions.prototype.getQuizObject=function(a,b){return{id:a,definition:{name:{und:b.lmstext},description:{und:b.lmstext},type:this.activityTypes.OBJECTIVE},objectType:this.objectTypes.ACTIVITY}};
TinCanDefinitions.prototype.getSlideObject=function(a,b){return{id:a,definition:{name:{und:b.title},description:{und:b.title},type:this.activityTypes.MODULE},objectType:this.objectTypes.ACTIVITY}};
TinCanDefinitions.prototype.getInteractionObject=function(a,b,c){if(!c)c=b.slide.title;a={id:a,definition:{name:{und:c},description:{und:c},type:this.activityTypes.CMI_INTERACTION,interactionType:TinCanUtils.NormalizeType(b.interactionType)},objectType:this.objectTypes.ACTIVITY};this.addCorrectResponsesPattern(b,a.definition);this.addInteractionComponents(b,a.definition);return a};
TinCanDefinitions.prototype.addCorrectResponsesPattern=function(a,b){if(!a.issurvey){var c=a.lmsCorrectResponses,d="";switch(TinCanUtils.NormalizeType(a.interactionType)){case "sequencing":case "choice":d=TinCanUtils.FormatSingleResponse(c);break;case "matching":d=TinCanUtils.FormatPairResponse(c);break;case "fill-in":d=TinCanUtils.FormatTextResponse(c);break;case "likert":d=TinCanUtils.FormatSingleResponse(c)}b.correctResponsesPattern=[d]}};
TinCanDefinitions.prototype.addInteractionComponents=function(a,b){switch(TinCanUtils.NormalizeType(a.interactionType)){case "sequencing":case "choice":b.choices=this.createComponentChoices(a.choices);break;case "matching":b.source=this.createComponentChoices(a.statements);b.target=this.createComponentChoices(a.choices);break;case "likert":b.scale=this.createComponentChoices(a.choices)}};
TinCanDefinitions.prototype.createComponentChoices=function(a){var b=[],c;for(c in a){var d=a[c];b.push({id:d.id,description:{und:d.lmstext}})}return b};function TinCanUtils(){}TinCanUtils.TC_DELIM_CHOICE="[,]";TinCanUtils.TC_DELIM_STATEMENT="[.]";TinCanUtils.GetSimpleId=function(a){var b=a.lastIndexOf(".");0<=b&&(a=a.substr(b+1));return a};TinCanUtils.FormatPairResponse=function(a){for(var b="",c=0;c<a.length;c++)oResponseData=a[c],0<c&&(b+=TinCanUtils.TC_DELIM_CHOICE),b+=TinCanUtils.GetSimpleId(oResponseData.StatementID())+TinCanUtils.TC_DELIM_STATEMENT+TinCanUtils.GetSimpleId(oResponseData.ChoiceID());return b};
TinCanUtils.FormatSingleResponse=function(a){for(var b="",c=0;c<a.length;c++)oResponseData=a[c],0<c&&(b+=TinCanUtils.TC_DELIM_CHOICE),b+=TinCanUtils.GetSimpleId(oResponseData.ChoiceID());return b};TinCanUtils.FormatTextResponse=function(a){for(var b="",c=0;c<a.length;c++)oResponseData=a[c],0<c&&(b+=TinCanUtils.TC_DELIM_CHOICE),b+=oResponseData.lmstext;return b};
TinCanUtils.NormalizeType=function(a){var b="";switch(a){case "truefalse":case "wordbank":case "hotspot":case "multiplechoice":case "multipleresponse":b="choice";break;case "essay":case "fillin":case "numeric":b="fill-in";break;case "matching":b="matching";break;case "sequence":b="sequencing";break;case "likert":b="likert"}return b};var VERB_COMPLETED="completed",VERB_PASSED="passed",VERB_FAILED="failed",VERB_ATTEMPTED="attempted",VERB_EXPERIENCED="experienced",VERB_ANSWERED="answered",VERB_ID_COMPLETED="http://adlnet.gov/expapi/verbs/completed",VERB_ID_PASSED="http://adlnet.gov/expapi/verbs/passed",VERB_ID_FAILED="http://adlnet.gov/expapi/verbs/failed",VERB_ID_ATTEMPTED="http://adlnet.gov/expapi/verbs/attempted",VERB_ID_EXPERIENCED="http://adlnet.gov/expapi/verbs/experienced",VERB_ID_ANSWERED="http://adlnet.gov/expapi/verbs/answered";
function ppTinCanApi(a,b){this.m_nVersion=parseFloat(b);this.m_tcDefintions=new TinCanDefinitions;this.m_tcComm=new ppTinCanComm(a,this.m_nVersion)}ppTinCanApi.prototype.PostOnClose=function(){this.m_tcComm.PostOnClose()};
ppTinCanApi.prototype.UpdateResumeData=function(a){var b=this.m_tcComm.GetHeaders(),c="agent";1>this.m_nVersion&&(c="actor");b.activityId=this.m_tcComm.FormatUri();b[c]=JSON.stringify(this.m_tcComm.GetActorObj());b.stateId="resume";this.m_tcComm.HasRegistration()&&(b.registration=this.m_tcComm.GetRegistration());a={data:a};this.m_tcComm.ConvertToPost(REQ_TYPE_RESUME_SAVE,this.m_tcComm.GetEndPoint()+"activities/state","PUT",JSON.stringify(a),b,null)};
ppTinCanApi.prototype.NotifyCourseComplete=function(a,b,c,d){var e=this.GetVerb(VERB_COMPLETED);c||(e=b?this.GetVerb(VERB_PASSED):this.GetVerb(VERB_FAILED));e={verb:e,object:this.m_tcDefintions.getCourseObject(this.m_tcComm.FormatUri()),context:this.GetContext(this.m_tcComm.FormatUri())};e.result=c?{duration:this.ConvertMSToISO(d),completion:!0}:{score:{scaled:a/100},success:b?!0:!1,duration:this.ConvertMSToISO(d),completion:!0};this.PutStatement(e,REQ_TYPE_TRACKING)};
ppTinCanApi.prototype.NotifyQuizComplete=function(a){var b=a.variables.Score,c=b>=a.variables.PassScore,d=this.GetVerb(VERB_COMPLETED);a.issurvey||(d=c?this.GetVerb(VERB_PASSED):this.GetVerb(VERB_FAILED));d={verb:d,object:this.m_tcDefintions.getQuizObject(this.m_tcComm.FormatUri(a.id),a),context:this.GetContext(this.m_tcComm.FormatUri())};a.issurvey||(d.result={score:{scaled:b/100,raw:a.variables.Score,min:0,max:a.maxscore},success:c?!0:!1});this.PutStatement(d,REQ_TYPE_TRACKING)};
ppTinCanApi.prototype.NotifyCourseStarted=function(){this.PutStatement({verb:this.GetVerb(VERB_ATTEMPTED),object:this.m_tcDefintions.getCourseObject(this.m_tcComm.FormatUri()),context:this.GetContext(this.m_tcComm.FormatUri()),result:{completion:!1}},REQ_TYPE_TRACKING)};
ppTinCanApi.prototype.NotifyViewedComplete=function(a,b){var c={};c[this.m_tcComm.FormatUri("viewcount")]=a;c={completion:!0,duration:this.ConvertMSToISO(b),extensions:c};this.PutStatement({verb:this.GetVerb(VERB_COMPLETED),object:this.m_tcDefintions.getCourseObject(this.m_tcComm.FormatUri()),result:c,context:this.GetContext(this.m_tcComm.FormatUri())},REQ_TYPE_TRACKING)};
ppTinCanApi.prototype.NotifySlideViewed=function(a){this.PutStatement({verb:this.GetVerb(VERB_EXPERIENCED),object:this.m_tcDefintions.getSlideObject(this.m_tcComm.FormatUri(a.id),a),context:this.GetContext(this.m_tcComm.FormatUri())},REQ_TYPE_TRACKING)};
ppTinCanApi.prototype.LogLikertQuestion=function(a){var b=a.lmsResponses;if(null!=b&&0<b.length)for(var c=a.parent.id,d=a.parent.getQuiz().id,e=null,f=0;f<b.length;f++){var e=b[f],g={response:TinCanUtils.GetSimpleId(e.ChoiceID())};this.PutStatement({verb:this.GetVerb(VERB_ANSWERED),object:this.m_tcDefintions.getInteractionObject(this.m_tcComm.FormatUri(c,a.id,TinCanUtils.GetSimpleId(e.StatementID())),a,e.statementLMSText),result:g,context:this.GetContext(this.m_tcComm.FormatUri(d))},REQ_TYPE_TRACKING)}};
ppTinCanApi.prototype.LogNormalQuestion=function(a){var b=a.parent.id,c=a.parent.getQuiz().id,d="",e=TinCanUtils.NormalizeType(a.interactionType),f=a.lmsResponses;if(null!=f&&0<f.length)switch(e){case "fill-in":d=TinCanUtils.FormatTextResponse(f);break;case "sequencing":case "true-false":case "choice":d=TinCanUtils.FormatSingleResponse(f);break;case "matching":d=TinCanUtils.FormatPairResponse(f)}d={response:d};if(!a.issurvey)d.success="correct"==a.variables.Status,d.score={raw:Number(a.variables.Points)};
this.PutStatement({verb:this.GetVerb(VERB_ANSWERED),object:this.m_tcDefintions.getInteractionObject(this.m_tcComm.FormatUri(b,a.id),a),result:d,context:this.GetContext(this.m_tcComm.FormatUri(c))},REQ_TYPE_TRACKING)};ppTinCanApi.prototype.ClosePlayer=function(){return this.m_tcComm.ClosePlayer()};
ppTinCanApi.prototype.PutStatement=function(a){if(1<=this.m_nVersion)a.version="1.0.0";a.actor=this.m_tcComm.GetActorObj();var b=this.m_tcComm.GetHeaders();b.statementId=this.GetUUID();this.m_tcComm.ConvertToPost(REQ_TYPE_TRACKING,this.m_tcComm.GetEndPoint()+"statements","PUT",JSON.stringify(a),b,null)};
ppTinCanApi.prototype.GetContext=function(a){a={contextActivities:{grouping:{id:this.m_tcComm.FormatUri()},parent:{id:a}}};if(this.m_tcComm.HasRegistration())a.registration=this.m_tcComm.GetRegistration();return a};
ppTinCanApi.prototype.RequestResumeData=function(a){var b=this.m_tcComm.GetHeaders(),c="agent";1>this.m_nVersion&&(c="actor");b.activityId=this.m_tcComm.FormatUri();b[c]=JSON.stringify(this.m_tcComm.GetActorObj());b.stateId="resume";this.m_tcComm.HasRegistration()&&(b.registration=this.m_tcComm.GetRegistration());this.m_tcComm.ConvertToPost(REQ_TYPE_RESUME_RESTORE,this.m_tcComm.GetEndPoint()+"activities/state","GET","",b,a)};
ppTinCanApi.prototype.GetUUID=function(){var a;a="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)});return a=a.replace(/y/g,(Math.floor(4*Math.random())+8).toString(16))};ppTinCanApi.prototype.ConvertMSToISO=function(a){var b="P",a=Math.floor(a/10),c=0,d=0,e=0,e=Math.floor(a/864E4),a=a-864E4*e,d=Math.floor(a/36E4),a=a-36E4*d,c=Math.floor(a/6E3);0<e&&(b+=e+"D");return b+"T"+(d+"H")+(c+"M")+((a-6E3*c)/100+"S")};
ppTinCanApi.prototype.GetVerb=function(a){if(1>this.m_nVersion)return a;var b={};switch(a){case VERB_ANSWERED:b.id=VERB_ID_ANSWERED;break;case VERB_ATTEMPTED:b.id=VERB_ID_ATTEMPTED;break;case VERB_COMPLETED:b.id=VERB_ID_COMPLETED;break;case VERB_EXPERIENCED:b.id=VERB_ID_EXPERIENCED;break;case VERB_FAILED:b.id=VERB_ID_FAILED;break;case VERB_PASSED:b.id=VERB_ID_PASSED}return b};function TinCanClient(){}TinCanClient.prototype.GetResumeData=function(){var a=this;this.api.RequestResumeData(function(b){player.tinCanResumeData=null!=b&&0<b.length?JSON.parse(b).data:"";a.getResumeDataReturned=!0})};TinCanClient.prototype.SetViewBasedComplete=function(){};TinCanClient.prototype.SavePlayerData=function(){};TinCanClient.prototype.handleClosePlayer=function(){this.api.ClosePlayer();return!0};TinCanClient.prototype.handleSlideViewed=function(a){a.trackviews&&this.api.NotifySlideViewed(a)};
TinCanClient.prototype.handleInteractionEvaluated=function(a){"likert"==a.interactionType?this.api.LogLikertQuestion(a):this.api.LogNormalQuestion(a)};TinCanClient.prototype.reportViewBasedComplete=function(a){this.api.NotifyViewedComplete(a,new Date-this.startTime)};
TinCanClient.prototype.reportQuizComplete=function(a){var b=this,c=a.variables.Score>=a.variables.PassScore;this.api.NotifyQuizComplete(a);var d=new Date-this.startTime;"view"!=story.scoring.type&&$.each(story.scoring.scorerefs,function(e,f){var g=story.parseObjref(f.ref);g&&g.target&&g.target.id==a.id&&b.api.NotifyCourseComplete(a.variables.PercentScore,c,a.issurvey,d)})};TinCanClient.prototype.sendResumeData=function(){if(player.useCompactResume){var a=story.toResumeData();""!=a&&this.api.UpdateResumeData(a)}};
TinCanClient.prototype.init=function(){var a=this,b=document.location.search.substr(1);a.startTime=new Date;this.api=new ppTinCanApi(b,"1.0");this.GetResumeData();this.api.NotifyCourseStarted();var c=!1;$(window).bind("unload beforeunload",function(){c||(a.api.PostOnClose(),c=!0)})};TinCanClient.prototype.isReady=function(){return this.getResumeDataReturned};bwUtils={DEFAULT_STATE:"_default",GetTime:function(){return player.getAnimationTime()}};
function bwChunk(a){this.m_strRemainder="";this.m_nLength=-1;this.m_strChunkData=this.m_strData="";this.m_nOffset=0;this.isNothing=""==a;var b="",c=0,b=0,d=a,b=a.charAt(0);"~"==b?(c=parseInt(a.charAt(1)),b=a.substr(2,c),b=bwChunk.UBaseNto10(b),a=a.substr(2+c),this.m_nLength=2+c+b):(a=a.substr(1),b=bwChunk.UBaseNto10(b),this.m_nLength=1+b);if(0<b)this.m_strData=a.substr(0,b),a=a.substr(b);this.m_strChunkData=d.substr(0,d.length-a.length);this.m_strRemainder=a}bwChunk.EMPTY_CHUNK="0";
bwChunk.BASE_NUMBER=64;bwChunk.BASE_POW=6;bwChunk.m_arr10to64="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,$".split(",");
bwChunk.m_o64to10={v0:0,v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8,v9:9,va:10,vb:11,vc:12,vd:13,ve:14,vf:15,vg:16,vh:17,vi:18,vj:19,vk:20,vl:21,vm:22,vn:23,vo:24,vp:25,vq:26,vr:27,vs:28,vt:29,vu:30,vv:31,vw:32,vx:33,vy:34,vz:35,vA:36,vB:37,vC:38,vD:39,vE:40,vF:41,vG:42,vH:43,vI:44,vJ:45,vK:46,vL:47,vM:48,vN:49,vO:50,vP:51,vQ:52,vR:53,vS:54,vT:55,vU:56,vV:57,vW:58,vX:59,vY:60,vZ:61,v_:62,v$:63};bwChunk.prototype.ChunkData=function(){return this.m_strChunkData};bwChunk.prototype.Remainder=function(){return this.m_strRemainder};
bwChunk.prototype.Length=function(){return this.m_nLength};bwChunk.prototype.Data=function(){return this.m_strData};bwChunk.prototype.NextChunk=function(){return new bwChunk(this.Remainder())};bwChunk.prototype.Skip=function(a){this.m_nOffset+=a};bwChunk.prototype.NextString=function(a){if(!a)a=this.m_nLength;var b=this.m_strData.substr(this.m_nOffset,a);this.m_nOffset+=a;return b};
bwChunk.prototype.NextBase10=function(a){var b=bwChunk.BaseNto10(this.m_strData.substr(this.m_nOffset,a));this.m_nOffset+=a;return b};bwChunk.prototype.NextUBase10=function(a){var b=bwChunk.UBaseNto10(this.m_strData.substr(this.m_nOffset,a));this.m_nOffset+=a;return b};bwChunk.prototype.NextChunkedBase10=function(){var a=new bwChunk(this.m_strData.substr(this.m_nOffset)),b=a.Length(),a=bwChunk.BaseNto10(a.Data(),a.Length());this.m_nOffset+=b;return a};
bwChunk.prototype.NextChunkedUBase10=function(){var a=new bwChunk(this.m_strData.substr(this.m_nOffset)),b=a.Length(),a=bwChunk.UBaseNto10(a.Data(),a.Length());this.m_nOffset+=b;return a};bwChunk.prototype.IsEmpty=function(){return""==this.Data()};bwChunk.prototype.EOF=function(){return this.m_nOffset>=this.m_strData.length};bwChunk.CreateChunk=function(a){var b=a.length,c=bwChunk.UBase10toN(b),d="";return d=63<b?"~"+c.length+c+a:c+a};
bwChunk.UBase10toN=function(a,b){void 0==b&&(b=-1);for(var c=parseInt(a),d=0,e="",f=!0;0<c||f;)f=!1,d=c&bwChunk.BASE_NUMBER-1,e+=bwChunk.m_arr10to64[d],c>>=bwChunk.BASE_POW;for(;e.length<b;)e+="0";return e};bwChunk.UBaseNto10=function(a){for(var b=0,c="",d=0;d<a.length;d++)c="v"+a.charAt(d),b+=parseInt(bwChunk.m_o64to10[c])<<bwChunk.BASE_POW*d;return b};
bwChunk.Base10toN=function(a,b){void 0==b&&(b=-1);for(var c=parseInt(a),d=0,e="",f=!0,g=0>c,d=1;Math.pow(bwChunk.BASE_NUMBER,d)/2<=Math.abs(a);)d++;b<d&&(b=d);if(g){for(d=0;-c>=Math.pow(bwChunk.BASE_NUMBER,d)/2;)d++;c=Math.pow(bwChunk.BASE_NUMBER,d)+c}for(;0<c||f;)f=!1,d=c&bwChunk.BASE_NUMBER-1,e+=bwChunk.m_arr10to64[d],c>>=bwChunk.BASE_POW;for(;e.length<b;)e+=g?"$":"0";return e};
bwChunk.BaseNto10=function(a){for(var b=0,c="",d=0;d<a.length;d++)c="v"+a.charAt(d),b+=parseInt(bwChunk.m_o64to10[c])<<bwChunk.BASE_POW*d;a=Math.pow(bwChunk.BASE_NUMBER,a.length)/2;b>=a&&(b-=2*a);return b};bwChunk.GlobalReplace=function(a,b,c){b=b.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");return a.replace(RegExp(b,"g"),c)};bwChunk.GlobalUnReplace=function(a,b,c){return bwChunk.GlobalReplace(a,c,b)};
bwChunk.StringEncodings=[["^","^0"],["&","^1"],["'","^2"],["+","^3"],[String.fromCharCode(10),"^4"],[String.fromCharCode(13),"^5"],["?","^6"],[",","^7"],["%","^8"],["\\","^9"],['"',"^A"],["\u2018","^B"],["\u2019","^C"],["\u201c","^D"],["\u201d","^E"],[String.fromCharCode(160),"^F"],["\u00e9","^G"],["\u2014","^H"]];bwChunk.EncodeString=function(a){$.each(bwChunk.StringEncodings,function(b,c){a=bwChunk.GlobalReplace(a,c[0],c[1])});return a};
bwChunk.DecodeString=function(a){$.each(bwChunk.StringEncodings,function(b,c){a=bwChunk.GlobalReplace(a,c[1],c[0])});return a};function PathLib(){}PathLib.prototype.loadFromXML=function(a){var b=this;this.xml=a;this.id=$(a).attr("id");this.paths={};$(a).children("path").each(function(a,d){b.paths[$(d).attr("i")]=$(d).attr("p")})};PathLib.getPath=function(a,b){return story.pathlibs[a]&&story.pathlibs[a].paths[b]?story.pathlibs[a].paths[b]:""};PathLib.getPathFromXML=function(a){return PathLib.getPath($(a).attr("l"),$(a).attr("i"))};function BezierPath(a){a?this.setPoints(a):this.points=[]}BezierPath.nCr=function(a,b){for(var c=1,d=1;d<=b;d++)c*=(a+1-d)/d;return c};BezierPath.prototype.setPoints=function(a){a[0].time=0;a[a.length-1].time=100;this.points=a};
BezierPath.prototype.loadFromXML=function(a,b){var c=[];$(a).find("segment").children().each(function(a,e){var f=parseInt($(e).attr("x"))-b.x,g=parseInt($(e).attr("y"))-b.y;c.push({x:f,y:g})});this.setPoints(c);this.duration=$(a).attr("duration");this.easing=$(a).attr("easing");this.easingdir=$(a).attr("easingdir")};
BezierPath.prototype.getXYAtTime=function(a){var b=this.points;if(a<b[0].time)return b[0];if(a>b[b.length-1].time)return b[b.length-1];for(var c=0,d=b.length-1,e=1;e<b.length;e++){var f=b[e];if(a<f.time){d=e;break}void 0!=f.time&&(c=e)}for(var g=d-c,e=b[c].time,a=(a-e)/(b[d].time-e),h=d=0,e=0;e<=g;e++)var f=b[c+e],j=BezierPath.nCr(g,e)*Math.pow(1-a,g-e)*Math.pow(a,e),d=d+j*f.x,h=h+j*f.y;return{x:parseInt(d),y:parseInt(h)}};BezierPath.EasingSteps=[0,15,23.75,32.5,41.25,50,58.75,67.5,76.25,85,100];
BezierPath.DirectSteps=[0,10,20,30,40,50,60,70,80,90,100];
BezierPath.prototype.toKeyFrames=function(){var a="linear"!=this.easing,b="",c=BezierPath.DirectSteps;if(a)c=BezierPath.DirectSteps;for(var d=0;d<BezierPath.DirectSteps.length;d++){var e=c[d],f=this.getXYAtTime(BezierPath.DirectSteps[d]),g="linear";0==d&&a?g="ease-in":d==BezierPath.DirectSteps.length-2&&a&&(g="ease-out");block=e+"% {-webkit-transform: translateX("+f.x+"px) translateY("+f.y+"px);-webkit-animation-timing-function:"+g+";}";b+=block+"\r\n"}return"{"+b+"}"};var ZoomPan=function(){this.target=null;this.duration=750};ZoomPan.prototype.loadFromXML=function(a){this.lastx=parseInt($(a).attr("lastx"));this.lasty=parseInt($(a).attr("lasty"));this.lastwidth=parseInt($(a).attr("lastwidth"));this.lastheight=parseInt($(a).attr("lastheight"));this.xpos=parseInt($(a).attr("xpos"));this.ypos=parseInt($(a).attr("ypos"));this.width=parseInt($(a).attr("width"));this.height=parseInt($(a).attr("height"));this.duration=parseInt($(a).attr("duration"));this.staticimage=$(a).attr("staticimage")};
ZoomPan.prototype.getZoomModifier=function(){return player.currentWindow?player.currentWindow.zoomModifier:1};
ZoomPan.prototype.toAnimation=function(a,b){this.animation=new Animation;this.animation.loadFromXML(a,b);b.rotatexpos=0;b.rotateypos=0;var c=new bwTweenEvent(b,a,0,0);c.m_nStartTime=0;c.m_nDuration=this.duration;if(0==c.m_nDuration)c.isZeroLength=!0,c.m_nDuration=1;var d=new bwTweenPosition(b,a);d.m_nDuration=this.duration;d.m_nEasingType=bwTween.EASE_EXPONENTIAL;d.m_nEasingDirection=bwTween.EASE_INOUT;if(0==d.m_nDuration)d.isZeroLength=!0,d.m_nDuration=1;var e=new bwLineSegment(b);e.ParseZoomPan(this);
d.m_arrSegments.push(e);d.m_nLength=e.GetLength();e=new bwTweenScale(b,a);e.m_nDuration=this.duration;e.m_nEasingDirection=bwTween.EASE_INOUT;if(0==e.m_nDuration)e.isZeroLength=!0,e.m_nDuration=1;var f=100*player.width/this.lastwidth*this.getZoomModifier(),g=100*player.width/this.width*this.getZoomModifier(),f=new bwScaleSegment(new Point(f,f),new Point(g,g));e.m_arrSegments.push(f);e.m_nLength=f.m_nLength;c.m_oPositionTween=d;c.m_oScaleTween=e;this.animation.bwa.m_arrTweens.push(c);c=player.width/
this.width;c*=this.getZoomModifier();this.zoomParams={scale:c,scaledx:this.xpos*c,scaledy:this.ypos*c}};var swipe={swiping:!1,animating:!1,moved:!1,x:0,y:0,vx:0,vy:0,downX:0,downY:0,lastX:0,lastY:0,startTime:0,lastTime:0,quick:200,normal:300,modes:{follow:"follow",none:"none"}};
swipe.parseEventCoords=function(a){a.originalEvent.touches?0<a.originalEvent.touches.length?(swipe.x=a.originalEvent.touches[0].pageX,swipe.y=a.originalEvent.touches[0].pageY):(swipe.x=a.originalEvent.changedTouches[0].pageX,swipe.y=a.originalEvent.changedTouches[0].pageY):(swipe.x=a.pageX,swipe.y=a.pageY);var b=player.stackedWindowSlide&&player.currentWindow&&player.currentWindow.isPrompt;if(!a.frameScaled&&!b){swipe.rawX=swipe.x;swipe.rawY=swipe.y;var b=$(".framewrap").offset(),c=swipe.x-b.left,
d=swipe.y-b.top;player.scaleWithTransform?(swipe.x=parseInt(c/player.frameScale+b.left),swipe.y=parseInt(d/player.frameScale+b.top)):(swipe.x=parseInt(c/player.frameScale+b.left/player.frameScale),swipe.y=parseInt(d/player.frameScale+b.top/player.frameScale))}a.frameScaled=!0};
swipe.sniff=function(a,b){if(!a.originalEvent)a.originalEvent=a;swipe.lastX=swipe.x;swipe.lastY=swipe.y;swipe.parseEventCoords(a);swipe.deltaX=swipe.x-swipe.downX;swipe.deltaY=swipe.y-swipe.downY;swipe.deltaX*=1/player.currentZoom();swipe.deltay*=1/player.currentZoom();if(b){var c=new Date-swipe.lastTime;swipe.vx=(swipe.x-swipe.lastX)/c/player.currentZoom();swipe.vy=(swipe.y-swipe.lastY)/c/player.currentZoom()}swipe.lastTime=new Date;if(10<Math.abs(swipe.deltaX)||10<Math.abs(swipe.deltaY))swipe.moved=
!0};
swipe.getSlideCoords=function(a){a=a||player.currentSlide();if(!a.ref)return{x:0,y:0};var b=a.ref.offset(),c=player.stackedWindowSlide&&player.currentWindow&&player.currentWindow.isPrompt;if(player.scaleWithTransform&&!c)c=$(".framewrap").offset(),b.left=(b.left-c.left)/player.frameScale+c.left,b.top=(b.top-c.top)/player.frameScale+c.top;player.currentWindowSlide&&player.currentWindow&&player.currentWindow.onBody&&!player.scaleWithTransform&&(b.left/=player.frameScale,b.top/=player.frameScale);b.left-=
a.x;b.top-=a.y;a=(swipe.x-b.left)/player.currentZoom();b=(swipe.y-b.top)/player.currentZoom();player.zoomParams&&(a/=player.zoomParams.scale,b/=player.zoomParams.scale);player.currentWindowSlide&&player.currentWindow&&player.currentWindow.onBody&&(a*=player.frameScale,b*=player.frameScale);return{x:parseInt(a),y:parseInt(b)}};swipe.noteDownCoords=function(){swipe.downX=swipe.x;swipe.downY=swipe.y;swipe.moved=!1;swipe.startTime=new Date};
swipe.hasMoved=function(a){if(a)return swipe.x!=swipe.downX||swipe.y!=swipe.downY;var a=Math.abs(swipe.x-swipe.downX),b=Math.abs(swipe.y-swipe.downY);return 3<a||3<b};function BitMask(a,b,c,d,e,f,g){this.isOpaque=a;this.width=parseInt(b)||0;this.height=parseInt(c)||0;this.sourceWidth=d||this.width;this.sourceHeight=e||this.height;this.xoffset=f||0;this.yoffset=g||0}BitMask.showDebug=!1;BitMask.debugOnly=!1;BitMask.max=function(a,b){return a>b?a:b};BitMask.min=function(a,b){return a<b?a:b};BitMask.prototype.loadFromImageUrl=function(a,b){var c=this,d=new Image;d.onload=function(){c.loadFromImage(d);b&&b(d)};d.src=a};
BitMask.prototype.loadFromImage=function(a){var b=document.createElement("canvas");b.width=parseInt(a.width);b.height=parseInt(a.height);this.width=parseInt(a.width);this.height=parseInt(a.height);b=b.getContext("2d");b.drawImage(a,0,0);this.loadFromContext(b,a.width,a.height)};
BitMask.prototype.loadFromContext=function(a){this.pixels=[];for(var a=a.getImageData(0,0,this.width,this.height).data,b=0,c=0;c<this.height;c++){for(var d=[],e=0;e<this.width;e++)d.push(0!=a[b]||0!=a[b+1]||0!=a[b+2]||0!=a[b+3]),b+=4;this.pixels.push(d)}};
BitMask.prototype.loadFromRLE=function(a){this.pixels=[];var b=a.indexOf("X")>a.indexOf("O");-1==a.indexOf("O")&&(b=!1);for(var a=a.replace(/O/ig,"X").split("X"),c=[],d=0;d<a.length;d++){var e=parseInt(a[d],16);isNaN(e)&&(e=0);for(b=!b;0<=e;)c.length>this.sourceWidth-1&&(this.pixels.push(c),c=[]),c.push(b),e--}this.pixels.push(c);(this.sourceWidth!=this.width||this.sourceHeight!=this.height)&&this.fixScale()};
BitMask.prototype.fixScale=function(){for(var a=[],b=0;b<this.height;b++){var c=parseInt(b*this.sourceHeight/this.height),d=this.pixels[c];if(d){for(var c=[],e=0;e<this.width;e++){var f=parseInt(e*this.sourceWidth/this.width);c[e]=d[f]}a[b]=c}else console.warn("Bounds Error: "+c)}this.pixels=a};BitMask.prototype.resize=function(a,b,c,d){this.width=parseInt(a);this.height=parseInt(b);this.xoffset=c;this.yoffset=d};
BitMask.prototype.testOverlap=function(a,b,c,d){var e=this.width>b&&a.width>-b&&this.height>c&&a.height>-c;return!e||this.isOpaque&&a.isOpaque?e:this.testPixelOverlap(a,b,c,d)};
BitMask.prototype.testPixelOverlap=function(a,b,c,d){var b=parseInt(b),c=parseInt(c),e=0,f=BitMask.min(a.width+b,this.width);0<b&&(e=b,f=BitMask.min(this.width,this.width+b));var g=BitMask.min(f-e,a.width),h=0,j=BitMask.min(a.height+c,this.height);0<c&&(h=c,f=BitMask.min(this.height,this.height+c));f=BitMask.min(j-h,a.height);if(BitMask.showDebug){if(!BitMask.testCanvas)BitMask.testCanvas=$("<canvas id='test' width='1000' height='1000' style='position:absolute;z-index:200;left:0px;top:0px;'></canvas>"),
$(document.body).append(BitMask.testCanvas),BitMask.testContext=BitMask.testCanvas.get(0).getContext("2d"),BitMask.testContext.fillStyle="rgba(255,255,0,0.5)";BitMask.testCanvas.show();clearTimeout(BitMask.testCanvasClear);BitMask.testCanvasClear=setTimeout(function(){BitMask.testCanvas.hide()},1E3)}if(BitMask.showDebug)BitMask.testContext.fillStyle="rgba(255,255,0,0.5)",BitMask.testContext.clearRect(0,0,1E3,1E3),BitMask.testContext.fillRect(e,h,g,f);j=parseInt(10*Math.random())+30;BitMask.debugOnly&&
(j=1);for(var l=0,m=h;m<h+f;m++){for(l=e+l;l<e+g;l+=j){var k=this.isPointActive(l,m),n=a.isPointActive(l-b,m-c);if(k&&n){k=d&&d(l,m);if(BitMask.showDebug)k?(BitMask.testContext.fillStyle="rgba(255,0,0,0.9)",BitMask.testContext.fillRect(l-1,m-1,2,2)):(BitMask.testContext.fillStyle="rgba(0,255,0,0.9)",BitMask.testContext.fillRect(l-2,m-2,4,4));if(!k&&!BitMask.debugOnly)return!0}else if(k&&BitMask.showDebug)BitMask.testContext.fillStyle="rgba(0,255,255,0.9)",BitMask.testContext.fillRect(l-2,m-2,4,4);
else if(n&&BitMask.showDebug)BitMask.testContext.fillStyle="rgba(255,255,0,0.9)",BitMask.testContext.fillRect(l-2,m-2,4,4)}l=l%g%j}return!1};BitMask.prototype.isPointActive=function(a,b){if(this.isOpaque)return!0;a=parseInt(a)-this.xoffset;b=parseInt(b)-this.yoffset;return 0>b||0>a||b>=this.pixels.length||a>=this.pixels[b].length?!1:this.pixels[b][a]};
BitMask.prototype.drawDebug=function(a){if(this.pixels)if(a.width=this.pixels[0].length,a.height=this.pixels.length,a=a.getContext("2d"),this.isOpaque)a.fillStyle="rgba(0, 255, 0, .5)",a.fillRect(0,0,this.width,this.height);else for(var b=0;b<this.height&&b<this.pixels.length;b++)for(var c=0;c<this.width&&c<this.pixels[b].length;c++)if(this.pixels[b][c])a.fillStyle="rgba(255, 0, 0, .5)",a.fillRect(c,b,1,1)};var ResumeParser=function(){};ResumeParser.dump=function(a,b){for(var b=b||0,c=new bwChunk(a),d="",e=0;e<b;e++)d+="  ";console.log(d,c.Data(),c.Remainder());c.Data()&&ResumeParser.dump(c.Data(),b+1);c.Remainder()&&ResumeParser.dump(c.Remainder(),b)};var ProgressBar=function(a,b,c){this.container=a||$(document.body);this.ref=b;this.draggable=c;this.dragging=!1;this.index=0;this.zoomModifier=this.count=1;this.lastPercent=-1;this.onDragUpdate=null;this.ref||this.createRef();c&&this.bindDragEvents();this.progressBarElement=this.ref.children(".progress-bar");this.lastProgressPercent=-1};
ProgressBar.prototype.createRef=function(){if(this.ref)return!1;this.ref=$('<div class="progress-container"><div class="progress-bar"></div></div>');this.container.append(this.ref);return!0};ProgressBar.prototype.show=function(){this.ref.show()};ProgressBar.prototype.hide=function(){this.ref.hide()};
ProgressBar.prototype.update=function(){if(player.currentWindow&&player.currentWindow.progressBar&&this==player.progressBar)player.currentWindow.progressBar.update();else{var a=parseFloat(this.index/this.count);1<a&&(a=1);var b=player.frame.progressWidth?player.frame.progressWidth:this.progressBarElement.width();if(this.lastProgressPercent!=a||b!=this.lastProgressWidth){this.lastProgressPercent=a;if(this.seekCanvas){if(b!=this.lastProgressWidth)this.lastProgressWidth=b,this.seekCanvas.width=b}else this.seekCanvas=
document.createElement("canvas"),this.seekCanvas.style.webkitTransform="translate3d(0px,0px, 0px)",this.seekCanvas.width=b,this.seekCanvas.height=this.progressBarElement.height(),this.progressBarElement[0].appendChild(this.seekCanvas);var c=this.seekCanvas.getContext("2d"),a=b*a,d=0;a>=b-3&&(d=4);c.clearRect(0,0,b,16);c.fillStyle=player.frame.seekColor;this.drawRoundRect(c,0,0,a,16,{upperLeft:4,lowerLeft:4,upperRight:d,lowerRight:d});c.fill();if(a<b-2)c.beginPath(),c.strokeStyle="#B8B8B8",c.lineWidth=
1,c.moveTo(a,0),c.lineTo(a,16),c.stroke()}}};
ProgressBar.prototype.drawRoundRect=function(a,b,c,d,e,f){var g={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0};if("object"===typeof f)for(var h in f)g[h]=f[h];a.beginPath();a.moveTo(b+g.upperLeft,c);a.lineTo(b+d-g.upperRight,c);a.quadraticCurveTo(b+d,c,b+d,c+g.upperRight);a.lineTo(b+d,c+e-g.lowerRight);a.quadraticCurveTo(b+d,c+e,b+d-g.lowerRight,c+e);a.lineTo(b+g.lowerLeft,c+e);a.quadraticCurveTo(b,c+e,b,c+e-g.lowerLeft);a.lineTo(b,c+g.upperLeft);a.quadraticCurveTo(b,c,b+g.upperLeft,c);a.closePath()};
ProgressBar.prototype.setPercent=function(a){this.index=a*this.count};ProgressBar.prototype.getPercent=function(){return parseFloat(this.index)/parseFloat(this.count)};
ProgressBar.prototype.bindDragEvents=function(){var a=this;a.dragging=!1;var b=function(b){a.lastPercent=-1;var d=player.timelineManager.getActiveTimelineOwner();if(d&&d.enableseek&&!player.frame.readOnlySeekbar&&!$(this).hasClass("locked"))a.dragging=!0,a.wasPlaying=player.timelineManager.getIsActiveTimelinePlaying(),player.timelineManager.pauseActiveTimeline(),c(b)},c=function(b){if(a.dragging){var c=a.ref.offset().left,d=a.ref.width()*a.zoomModifier;swipe.parseEventCoords(b);b=(swipe.x-c)/d;0>
b&&(b=0);1<b&&(b=1);if(a.onDragUpdate&&b!=a.lastPercent)a.lastPercent=b,a.onDragUpdate(b)}},d=function(b){var d=player.timelineManager.getActiveTimelineOwner();if(d&&d.enableseek&&!player.frame.readOnlySeekbar&&a.dragging)c(b),a.dragging=!1,a.wasPlaying&&parseInt(a.index)!=parseInt(a.count)&&player.timelineManager.playActiveTimeline()};player.isMobile?($(this.ref).bind("touchstart",b),$(window).bind("touchmove",c),$(document.body).bind("touchmove",c),$(this.ref).bind("touchend",d),$(document.body).bind("touchend",
d),$(window).bind("touchend",d)):($(this.ref).bind("mousedown",b),$(window).bind("mousemove",c),$(this.ref).bind("mouseup",d),$(document.body).bind("mouseup",d),$(window).bind("mouseup",d))};ProgressBar.getCurrentProgressBar=function(){return player.currentWindow?null:player.progressBar};var VolumeSlider=function(a){this.button=a;this.visible=this.dragging=!1;this.volume=80;this.onDragUpdate=null;this.createRef();this.bindDragEvents();VolumeSlider.sliderList.push(this)};VolumeSlider.sliderList=[];
VolumeSlider.prototype.createRef=function(){this.button.find(".volume-slider").remove();this.ref=$('<div class="volume-touchpad"><div class="volume-slider"><div class="volume-handle"></div></div></div>');this.handle=this.ref.children().children().first();this.icon=this.button.children().first();this.button.prepend(this.ref)};VolumeSlider.prototype.toggle=function(){this.visible?this.hide():this.show()};VolumeSlider.prototype.show=function(){this.button.addClass("volume-open");this.visible=!0};
VolumeSlider.prototype.hide=function(){this.button.removeClass("volume-open");this.visible=this.dragging=!1};VolumeSlider.prototype.setVolume=function(a){this.volume=a;this.update()};VolumeSlider.prototype.update=function(){this.handle.css("top",parseInt(100-this.volume)+"%")};
VolumeSlider.prototype.bindDragEvents=function(){var a=this;a.dragging=!1;var b=function(b){a.dragging=!0;c(b);return!1},c=function(b){if(a.dragging){var c=a.ref.offset().top,d=a.ref.height();swipe.parseEventCoords(b);b=1-(swipe.rawY-c)/d;0>b&&(b=0);1<b&&(b=1);a.volume=parseInt(100*b);a.update();if(a.onDragUpdate)a.onDragUpdate(b);$.each(VolumeSlider.sliderList,function(b,c){if(c!=a)c.volume=a.volume,c.update()});return!1}},d=function(b){c(b);b=a.dragging;a.dragging=!1;if(b)return a.hide(),!1};player.isMobile?
($(this.ref).bind("touchstart",b),$(window).bind("touchmove",c),$(this.ref).bind("touchmove",c),$(this.ref).bind("touchend",d),$(document.body).bind("touchend",d),$(window).bind("touchend",d),this.button.bind("touchend",function(b){a.toggle();MouseEvents.processHideables(b);return!1})):($(this.ref).bind("mousedown touchstart",b),$(window).bind("mousemove touchmove",c),$(this.ref).bind("mouseup touchend",d),$(document.body).bind("mouseup touchend",d),$(window).bind("mouseup touchend",d),this.button.bind("click",
function(b){a.toggle();MouseEvents.processHideables(b);return!1}));MouseEvents.addHideable(".volume-slider",".volume-slider,.icon.volume",function(){a.hide()})};VolumeSlider.updateVolumeIcon=function(a){$(".icon.volume").removeClass("full half low off");0.9<a?$(".icon.volume").addClass("full"):0.5<a?$(".icon.volume").addClass("half"):0<a?$(".icon.volume").addClass("low"):$(".icon.volume").addClass("off")};function ppRect(a,b,c,d){this.left=parseFloat(a);this.top=parseFloat(b);this.right=parseFloat(c);this.bottom=parseFloat(d)}ppRect.FromWidthHeight=function(a,b,c,d){return new ppRect(a,b,a+c,b+d)};ppRect.prototype.GetWidth=function(){return this.right-this.left};ppRect.prototype.GetHeight=function(){return this.bottom-this.top};ppRect.prototype.Clone=function(){return new ppRect(this.left,this.top,this.right,this.bottom)};
ppRect.prototype.Translate=function(a,b){this.left+=a;this.right+=a;this.top+=b;this.bottom+=b};ppRect.prototype.Widen=function(a,b){this.left-=a;this.right+=a;this.top-=b;this.bottom+=b};ppRect.prototype.AddRect=function(a){if(this.left>a.left)this.left=a.left;if(this.right<a.right)this.right=a.right;if(this.top>a.top)this.top=a.top;if(this.bottom<a.bottom)this.bottom=a.bottom};
ppRect.prototype.RotateRect=function(a){if(0<a){var a=a*Math.PI/180,b=this.GetWidth(),c=this.GetHeight(),d=Math.cos(a),e=Math.sin(a),a=0*d+0*e,f=-0.0*e+0*d,g=b*d+0*e,h=b*e+0*d,j=b*d-c*e,l=b*e+c*d,b=0*d-c*e,e=-0.0*e+c*d,c=Math.min(f,h,l,e),d=Math.min(a,g,j,b),f=Math.max(f,h,l,e),a=Math.max(a,g,j,b);this.left=d;this.top=c;this.right=a;this.bottom=f}};ppRect.prototype.clone=ppRect.prototype.Clone;ppRect.prototype.inflate=ppRect.prototype.Widen;var ppRectBuilder={InitRect:function(){this.lineWidth=0;this.rectShape=new ppRect(0,0,1,1)},BuildRect:function(a,b,c,d){for(var e=0;e<a.length;e++)switch(a[e].cmd){case ppCommandParser.CMD_LINE_STYLE:case ppCommandParser.CMD_GRADIENT_LINE_STYLE:this.ProcessLineStyle(a[e]);break;case ppCommandParser.CMD_DRAW_ELLIPSE:case ppCommandParser.CMD_DRAW_RECTANGLE:this.ProcessSquareShape(a[e]);break;case ppCommandParser.CMD_DRAW_LINE:case ppCommandParser.CMD_DRAW_LINES:case ppCommandParser.CMD_DRAW_POLYGON:case ppCommandParser.CMD_DRAW_CURVE:case ppCommandParser.CMD_DRAW_CLOSED_CURVE:this.ProcessPoints(a[e])}this.rectShape.Widen(this.lineWidth,
this.lineWidth);for(e=0;e<a.length;e++)switch(a[e].cmd){case ppCommandParser.CMD_ADD_IMAGE:this.ProcessImage(a[e],c);break;case ppCommandParser.CMD_ADD_TEXT:this.ProcessText(a[e],b,c,d);break;case ppCommandParser.CMD_DRAW_TEXT:this.ProcessGlyphs(a[e])}},ProcessLineStyle:function(a){this.lineWidth=Math.max(a.lineWidth,this.lineWidth)},ProcessSquareShape:function(a){if(this.rectShape.left>a.x)this.rectShape.left=a.x;if(this.rectShape.right<a.x+a.width)this.rectShape.right=a.x+a.width;if(this.rectShape.top>
a.y)this.rectShape.top=a.y;if(this.rectShape.bottom<a.y+a.height)this.rectShape.bottom=a.y+a.height},ProcessPoints:function(a){for(var b=0;b<a.points.length;b++){if(this.rectShape.left>a.points[b].x)this.rectShape.left=a.points[b].x;else if(this.rectShape.right<a.points[b].x)this.rectShape.right=a.points[b].x;if(this.rectShape.top>a.points[b].y)this.rectShape.top=a.points[b].y;else if(this.rectShape.bottom<a.points[b].y)this.rectShape.bottom=a.points[b].y}},ProcessImage:function(a,b){var c=a.xpos,
d=a.ypos,e=b.GetImage(a.imageId),f=e.imgNode,g=e.nWidth*a.scaleX/f.naturalWidth,h=e.nHeight*a.scaleY/f.naturalHeight;0.01>Math.abs(g-1)&&(g=1);0.01>Math.abs(h-1)&&(h=1);var j={};j.x=Math.floor(c+e.nDX);j.y=Math.floor(d+e.nDY);j.width=Math.ceil((f.naturalWidth||f.width)*g);j.height=Math.ceil((f.naturalHeight||f.height)*h);this.ProcessSquareShape(j)},ProcessText:function(a,b,c,d){var e=this.rectShape;this.InitRect();var f=b.GetPathById(a.textId,d),f=ppCommandParser.ParsePath(f);a.textCommands=f;this.BuildRect(f,
b,c,d);this.rectShape.RotateRect(a.rotation);this.rectShape.Translate(a.xpos,a.ypos);this.rectShape.AddRect(e)},ProcessGlyphs:function(a){for(var b=0,c=0,d=0,e=0,f=0;f<a.newLines.length;f++){currentLine=a.newLines[f];var g=currentLine.xpos;if(currentLine.xpos<b)b=currentLine.xpos;if(currentLine.ypos<c)c=currentLine.ypos;if(currentLine.ypos>e)e=currentLine.ypos;for(var h=0;h<currentLine.glyphs.length;h++)g+=currentLine.glyphs[h].dx;g>d&&(d=g)}a={};a.x=b;a.y=c;a.width=d-b;a.height=e-c;this.ProcessSquareShape(a)}};function CommandData(a,b,c){this.cmd=a;this.name=b;this.callback=c}
var ppCommandParser={CMD_CREATE_SHAPE:"0",CMD_CREATE_MASK:"1",CMD_END_PATH:"2",CMD_CLOSE_PATH:"3",CMD_ADD_TEXT:"4",CMD_ADD_IMAGE:"5",CMD_ROTATION_DATA:"6",CMD_ADD_REFLECTION_TEXT:"7",CMD_START_SOLID_FILL:"A",CMD_START_GRADIENT_FILL:"B",CMD_START_BITMAP_FILL:"C",CMD_START_SLIDEBG_FILL:"D",CMD_END_FILL:"E",CMD_START_BITMAP_TILE_FILL:"F",CMD_REPEAT_FILL:"G",CMD_LINE_STYLE:"N",CMD_GRADIENT_LINE_STYLE:"O",CMD_CLEAR_LINE_STYLE:"P",CMD_REPEAT_LINE_STYLE:"Q",CMD_DEFAULT_HOT:"Z",CMD_DRAW_ELLIPSE:"b",CMD_DRAW_RECTANGLE:"c",
CMD_DRAW_LINE:"d",CMD_DRAW_LINES:"e",CMD_DRAW_POLYGON:"f",CMD_DRAW_CURVE:"g",CMD_DRAW_CLOSED_CURVE:"h",CMD_DRAW_TEXT:"i",CMD_DRAW_SHADOW:"t",CMD_DRAW_SHAPE_SHADOW:"u",CMD_DRAW_REFLECTION:"v",CMD_SOFTEN_EDGES:"w",CMD_DRAW_PERSPECTIVE_SHADOW:"x",TEXT_YOFFSET_FLAG:"#",BASE_NUMBER:64,BASE_POW:6,m_strPath:"",m_nPos:0,m_nStartOffset:0,m_o64to10:{"0":0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,g:16,h:17,i:18,j:19,k:20,l:21,m:22,n:23,o:24,p:25,q:26,r:27,s:28,t:29,u:30,v:31,w:32,x:33,
y:34,z:35,A:36,B:37,C:38,D:39,E:40,F:41,G:42,H:43,I:44,J:45,K:46,L:47,M:48,N:49,O:50,P:51,Q:52,R:53,S:54,T:55,U:56,V:57,W:58,X:59,Y:60,Z:61,_:62,$:63},UBaseNto10:function(a){var b=this.m_nStartOffset,c=0,d=0,e=0;"%"==this.m_strPath.charAt(this.m_nPos+b)&&(a=this.m_o64to10[this.m_strPath.charAt(this.m_nPos+b+1)],b+=2,e=2);for(var f=b;f<b+a;f++)c+=this.m_o64to10[this.m_strPath.charAt(this.m_nPos+f)]<<this.BASE_POW*d,d++;this.m_nStartOffset+=a+e;return c},BaseNto10:function(a){var b=this.m_nStartOffset,
c=0,d=0,e=0;"%"==this.m_strPath.charAt(this.m_nPos+b)&&(a=this.m_o64to10[this.m_strPath.charAt(this.m_nPos+b+1)],b+=2,e=2);for(var f=b;f<b+a;f++)c+=this.m_o64to10[this.m_strPath.charAt(this.m_nPos+f)]<<this.BASE_POW*d,d++;this.m_nStartOffset+=a+e;a=Math.pow(64,a)/2-1;return c-a},FBaseNto10:function(a){var b=this.m_nStartOffset,c=0,c=this.BaseNto10(2),a=this.UBaseNto10(a-2),c="00"==this.m_strPath.substr(b+this.m_nPos,2)?-a/4095:0>c?c-a/4095:c+a/4095;return Math.round(1E3*c)/1E3},ParsePath:function(a){var b=
[];this.m_strPath=a;for(this.m_nStartOffset=this.m_nPos=0;this.m_nPos<this.m_strPath.length;)a=this.m_strPath.charAt(this.m_nPos),this.m_nPos++,b.push(this.ParseCommand(a));return b},ParseCommand:function(a){var b=null;switch(a){case this.CMD_ROTATION_DATA:b=this.ParseRotationData(a);break;case this.CMD_CREATE_SHAPE:b=new CommandData(a,"CMD_CREATE_SHAPE",ppArt.CreateShape);b.hot="1"==this.m_strPath.substr(this.m_nPos,1);this.m_nPos++;break;case this.CMD_END_PATH:b=new CommandData(a,"CMD_END_PATH",
ppArt.EndPath);break;case this.CMD_CLOSE_PATH:b=new CommandData(a,"CMD_CLOSE_PATH",ppArt.ClosePath);break;case this.CMD_ADD_IMAGE:b=this.ParseAddImage(a);break;case this.CMD_START_SOLID_FILL:b=this.ParseStartSolidFill(a);break;case this.CMD_START_GRADIENT_FILL:b=this.ParseStartGradientFill(a);break;case this.CMD_START_BITMAP_FILL:b=this.ParseStartBitmapFill(a);break;case this.CMD_START_SLIDEBG_FILL:b=new CommandData(a,"CMD_START_SLIDEBG_FILL",ppArt.StartSlideBgFill);break;case this.CMD_END_FILL:b=
new CommandData(a,"CMD_END_FILL",ppArt.EndFill);break;case this.CMD_START_BITMAP_TILE_FILL:b=this.ParseStartBitmapTileFill(a);break;case this.CMD_REPEAT_FILL:b=new CommandData(a,"CMD_REPEAT_FILL",ppArt.RepeatFill);break;case this.CMD_LINE_STYLE:b=this.ParseSetLineStyle(a);break;case this.CMD_GRADIENT_LINE_STYLE:b=this.ParseSetGradientLineStyle(a);break;case this.CMD_CLEAR_LINE_STYLE:b=new CommandData(a,"CMD_CLEAR_LINE_STYLE",ppArt.ClearLineStyle);break;case this.CMD_REPEAT_LINE_STYLE:b=new CommandData(a,
"CMD_REPEAT_LINE_STYLE",ppArt.RepeatLineStyle);break;case this.CMD_DEFAULT_HOT:b=new CommandData(a,"CMD_DEFAULT_HOT",ppArt.SetShapeHot);break;case this.CMD_DRAW_ELLIPSE:b=this.ParseDrawEllipse(a);break;case this.CMD_DRAW_RECTANGLE:b=this.ParseDrawRectangle(a);break;case this.CMD_DRAW_LINE:b=this.ParseDrawLine(a);break;case this.CMD_DRAW_LINES:b=this.ParseDrawLines(a);break;case this.CMD_DRAW_POLYGON:b=this.ParseDrawPolygon(a);break;case this.CMD_DRAW_CURVE:case this.CMD_DRAW_CLOSED_CURVE:b=this.ParseDrawCurve(a);
break;case this.CMD_DRAW_SHADOW:case this.CMD_DRAW_SHAPE_SHADOW:b=this.ParseShadow(a);break;case this.CMD_DRAW_REFLECTION:b=this.ParseReflection(a);break;case this.CMD_DRAW_PERSPECTIVE_SHADOW:b=this.ParsePerspectiveShadow(a);break;case this.CMD_DRAW_TEXT:b=this.ParseDrawVectorText(a);break;case this.CMD_ADD_TEXT:case this.CMD_ADD_REFLECTION_TEXT:b=this.ParseAddText(a);break;default:console.warn("MISSING: "+a+" : "+this.m_nPos)}return b},ParseRotationData:function(a){a=new CommandData(a,"CMD_ROTATION_DATA",
ppArt.StoreRotationData);this.m_nStartOffset=0;a.rotationDistance=this.BaseNto10(2);a.rectRotated=new ppRect(this.BaseNto10(2),this.BaseNto10(2),this.BaseNto10(2),this.BaseNto10(2));a.polyRotated=[{x:this.BaseNto10(2),y:this.BaseNto10(2)},{x:this.BaseNto10(2),y:this.BaseNto10(2)},{x:this.BaseNto10(2),y:this.BaseNto10(2)},{x:this.BaseNto10(2),y:this.BaseNto10(2)}];this.m_nPos+=this.m_nStartOffset;return a},ParseAddImage:function(a){a=new CommandData(a,"CMD_ADD_IMAGE",ppArt.AddImage);this.m_nStartOffset=
0;a.imageId=this.m_strPath.substr(this.m_nPos,2);this.m_nStartOffset+=2;a.xpos=this.FBaseNto10(4);a.ypos=this.FBaseNto10(4);a.scaleX=this.FBaseNto10(4);a.scaleY=this.FBaseNto10(4);a.alpha=this.UBaseNto10(2)/100;this.m_nPos+=this.m_nStartOffset;return a},ParseStartSolidFill:function(a){a=new CommandData(a,"CMD_START_SOLID_FILL",ppArt.StartSolidFill);this.m_nStartOffset=0;a.color=this.UBaseNto10(4);a.alpha=this.UBaseNto10(2);this.m_nPos+=this.m_nStartOffset;return a},ParseStartGradientFill:function(a){a=
new CommandData(a,"CMD_START_GRADIENT_FILL",ppArt.StartGradientFill);this.m_nStartOffset=0;a.type=this.UBaseNto10(1);a.xpos=this.BaseNto10(2);a.ypos=this.BaseNto10(2);a.width=this.BaseNto10(2);a.height=this.BaseNto10(2);a.rotation=Math.round(360*this.UBaseNto10(2)/4095);var b=this.UBaseNto10(1);a.stops=[];for(var c,d,e,f=0;f<b;f++)c=this.UBaseNto10(4),d=this.UBaseNto10(2),e=this.UBaseNto10(2),a.stops.push({stop:e,color:c,alpha:d});this.m_nPos+=this.m_nStartOffset;return a},ParseStartBitmapFill:function(a){a=
new CommandData(a,"CMD_START_BITMAP_FILL",ppArt.StartBitmapFill);this.m_nStartOffset=0;a.imageId=this.m_strPath.substr(this.m_nPos,2);this.m_nStartOffset+=2;a.xpos=this.BaseNto10(2);a.ypos=this.BaseNto10(2);a.width=this.BaseNto10(2);a.height=this.BaseNto10(2);a.tx=this.BaseNto10(2);a.ty=this.BaseNto10(2);a.scaleX=this.FBaseNto10(4);a.scaleY=this.FBaseNto10(4);a.rotation=360*this.UBaseNto10(2)/4095;a.alpha=this.UBaseNto10(2)/100;this.m_nPos+=this.m_nStartOffset;return a},ParseStartBitmapTileFill:function(a){a=
new CommandData(a,"CMD_START_BITMAP_TILE_FILL",ppArt.StartBitmapTileFill);this.m_nStartOffset=0;a.imageId=this.m_strPath.substr(this.m_nPos,2);this.m_nStartOffset+=2;a.xpos=this.BaseNto10(2);a.ypos=this.BaseNto10(2);a.scaleX=this.FBaseNto10(4);a.scaleY=this.FBaseNto10(4);a.rotation=360*this.UBaseNto10(2)/4095;a.alpha=this.UBaseNto10(2)/100;a.mirrorType=this.UBaseNto10(1);this.m_nPos+=this.m_nStartOffset;return a},ParseSetLineStyle:function(a){a=new CommandData(a,"CMD_LINE_STYLE",ppArt.SetLineStyle);
this.m_nStartOffset=0;a.lineWidth=this.UBaseNto10(2);a.color=this.UBaseNto10(4);a.alpha=this.UBaseNto10(2);a.capJoin=this.UBaseNto10(1);a.scaleMode=this.UBaseNto10(1);this.m_nPos+=this.m_nStartOffset;return a},ParseSetGradientLineStyle:function(a){a=new CommandData(a,"CMD_GRADIENT_LINE_STYLE",ppArt.SetGradientLineStyle);this.m_nStartOffset=0;a.lineWidth=this.UBaseNto10(2);a.capJoin=this.UBaseNto10(1);a.type=this.UBaseNto10(1);a.scaleMode=this.UBaseNto10(1);a.xpos=this.BaseNto10(2);a.ypos=this.BaseNto10(2);
a.width=this.BaseNto10(2);a.height=this.BaseNto10(2);a.rotation=360*this.UBaseNto10(2)/4095;a.stops=[];for(var b=this.UBaseNto10(1),c,d,e,f=0;f<b;f++)c=this.UBaseNto10(4),d=this.UBaseNto10(2),e=this.UBaseNto10(2),a.stops.push({stop:e,color:c,alpha:d});this.m_nPos+=this.m_nStartOffset;return a},ParseDrawEllipse:function(a){a=new CommandData(a,"CMD_DRAW_ELLIPSE",ppArt.DrawEllipse);this.m_nStartOffset=0;a.x=this.FBaseNto10(4);a.y=this.FBaseNto10(4);a.width=this.FBaseNto10(4);a.height=this.FBaseNto10(4);
this.m_nPos+=this.m_nStartOffset;return a},ParseDrawRectangle:function(a){a=new CommandData(a,"CMD_DRAW_RECTANGLE",ppArt.DrawRectangle);this.m_nStartOffset=0;a.x=this.FBaseNto10(4);a.y=this.FBaseNto10(4);a.width=this.FBaseNto10(4);a.height=this.FBaseNto10(4);this.m_nPos+=this.m_nStartOffset;return a},ParseDrawLine:function(a){a=new CommandData(a,"CMD_DRAW_LINE",ppArt.DrawLines);this.m_nStartOffset=0;a.points=[];var b,c;b=this.FBaseNto10(4);c=this.FBaseNto10(4);a.points.push({x:b,y:c});b=this.FBaseNto10(4);
c=this.FBaseNto10(4);a.points.push({x:b,y:c});this.m_nPos+=this.m_nStartOffset;return a},ParseDrawLines:function(a){a=new CommandData(a,"CMD_DRAW_LINES",ppArt.DrawLines);this.m_nStartOffset=0;var b=this.UBaseNto10(2);a.points=[];for(var c=0;c<b;c++){var d=this.FBaseNto10(4),e=this.FBaseNto10(4);a.points.push({x:d,y:e})}this.m_nPos+=this.m_nStartOffset;return a},ParseDrawPolygon:function(a){a=new CommandData(a,"CMD_DRAW_POLYGON",ppArt.DrawPolygon);this.m_nStartOffset=0;var b=this.UBaseNto10(2);a.points=
[];for(var c=0;c<b;c++){var d=this.FBaseNto10(4),e=this.FBaseNto10(4);a.points.push({x:d,y:e})}this.m_nPos+=this.m_nStartOffset;return a},ParseDrawCurve:function(a){a=a==this.CMD_DRAW_CURVE?new CommandData(a,"CMD_DRAW_CURVE",ppArt.DrawCurve):new CommandData(a,"CMD_DRAW_CLOSED_CURVE",ppArt.DrawClosedCurve);this.m_nStartOffset=0;var b=this.UBaseNto10(2);a.points=[];for(var c=0;c<b;c++){var d=this.FBaseNto10(4),e=this.FBaseNto10(4);a.points.push({x:d,y:e})}this.m_nPos+=this.m_nStartOffset;return a},
ParseShadow:function(a){a=a==this.CMD_DRAW_SHADOW?new CommandData(a,"CMD_DRAW_SHADOW",ppArt.DrawGlobalShadow):new CommandData(a,"CMD_DRAW_SHAPE_SHADOW",ppArt.DrawShadow);this.m_nStartOffset=0;a.distance=this.FBaseNto10(4);a.angle=this.FBaseNto10(4);a.color=this.UBaseNto10(4);a.alpha=this.UBaseNto10(2);a.blurX=this.UBaseNto10(2);a.blurY=this.UBaseNto10(2);a.strength=this.UBaseNto10(2);a.quality=this.UBaseNto10(1);a.inner="1"==this.m_strPath.substr(this.m_nPos+21,1);this.m_nStartOffset+=1;a.scale=this.FBaseNto10(4);
this.m_nPos+=this.m_nStartOffset;return a},ParseReflection:function(a){this.m_nStartOffset=0;a=new CommandData(a,"CMD_DRAW_REFLECTION",ppArt.AddReflection);a.distance=this.UBaseNto10(2);a.stops=[this.UBaseNto10(2),this.UBaseNto10(2)];a.alphas=[this.UBaseNto10(2)/100,this.UBaseNto10(2)/100];a.scale=this.UBaseNto10(2)/100;this.m_nPos+=this.m_nStartOffset;return a},ParsePerspectiveShadow:function(a){this.m_nStartOffset=0;a=new CommandData(a,"CMD_DRAW_PERSPECTIVE_SHADOW",ppArt.AddPerspectiveShadow);a.distance=
this.FBaseNto10(4);a.angle=this.FBaseNto10(4);a.color=this.UBaseNto10(4);a.alpha=this.UBaseNto10(2);a.blurX=this.UBaseNto10(2);a.blurY=this.UBaseNto10(2);a.strength=this.UBaseNto10(2);a.quality=this.UBaseNto10(1);a.scaleX=this.FBaseNto10(4);a.scaleY=this.FBaseNto10(4);a.skewX=this.FBaseNto10(4);a.skewY=this.FBaseNto10(4);this.m_nPos+=this.m_nStartOffset;return a},ParseDrawVectorText:function(a){this.m_nStartOffset=0;a=new CommandData(a,"CMD_DRAW_TEXT",ppArt.DrawVectorText);a.fontId=this.m_strPath.substr(this.m_nPos,
2);this.m_nStartOffset+=2;a.scale=this.FBaseNto10(4);a.color=this.UBaseNto10(4);a.alpha=this.UBaseNto10(2);a.charLen=this.UBaseNto10(1);a.newLineCount=this.UBaseNto10(2);a.newLines=[];for(var b=0;b<a.newLineCount;b++){var c={};c.charCount=this.UBaseNto10(2);c.xpos=this.FBaseNto10(4);c.ypos=this.FBaseNto10(4);c.glyphs=[];a.newLines.push(c)}a.wordCount=this.UBaseNto10(3);a.wordIndexes=[];if(0<a.wordCount){c=this.UBaseNto10(1);for(b=0;b<a.wordCount;b++)a.wordIndexes.push(this.UBaseNto10(c))}for(var d=
c=0,e=0,b=0;b<a.newLines.length;b++){curLine=a.newLines[b];for(var f=0;f<curLine.charCount;f++)this.m_strPath.substr(this.m_nStartOffset+this.m_nPos,1)==this.TEXT_YOFFSET_FLAG?(this.m_nStartOffset+=1,d=this.FBaseNto10(4)):d=0,c=this.FBaseNto10(4),e=this.UBaseNto10(a.charLen),curLine.glyphs.push({dx:c,dy:d,index:e})}this.m_nPos+=this.m_nStartOffset;return a},ParseAddText:function(a){this.m_nStartOffset=0;commandData=a==this.CMD_ADD_TEXT?new CommandData(a,"CMD_ADD_TEXT",ppArt.AddText):new CommandData(a,
"CMD_ADD_REFLECTION_TEXT",ppArt.AddReflectionText);commandData.textId=this.m_strPath.substr(this.m_nPos,2);this.m_nStartOffset+=2;commandData.xpos=this.FBaseNto10(4);commandData.ypos=this.FBaseNto10(4);commandData.rotation=this.FBaseNto10(4);commandData.shadow="1"==this.m_strPath.substr(this.m_nPos+14,1);this.m_nStartOffset+=1;this.m_nPos+=this.m_nStartOffset;return commandData}};window.ppFudge=0.5;
function ppGraphics(a){ppArt.currentFudge=0;this.m_nXOffset=-a.left;this.m_nYOffset=-a.top;this.m_nWidth=a.right-a.left+1;this.m_nHeight=a.bottom-a.top+1;this.m_bVectorHot=this.m_bForMask=!1;this.m_nFillYPos=this.m_nFillXPos=this.m_nFillRotation=0;this.m_nFillScaleY=this.m_nFillScaleX=1;this.m_bRotatedFill=!1;this.m_nMaxLineWidth=0;if(0>=this.m_nWidth)this.m_nWidth=1;if(0>=this.m_nHeight)this.m_nHeight=1;this.m_ptOffset={x:0,y:0};this.m_bMergeFill=this.m_bMergeStroke=this.m_bLineDrawn=this.m_bStrokeStarted=
this.m_bFillStarted=!1;this.m_nCurYPos=this.m_nCurXPos=0;this.m_arrShadows=[];this.m_bHasInnerShadow=this.m_bHasShadow=!1;this.m_oFillCanvas=document.createElement("canvas");this.m_oStrokeCanvas=document.createElement("canvas");this.m_oFillCanvas.width=this.m_nWidth;this.m_oFillCanvas.height=this.m_nHeight;this.m_oStrokeCanvas.width=this.m_nWidth;this.m_oStrokeCanvas.height=this.m_nHeight;this.m_oFillContext=this.m_oFillCanvas.getContext("2d");this.m_oStrokeContext=this.m_oStrokeCanvas.getContext("2d");
if(player.canvasDebug&&(player.monitoringItem&&ppArt.itemID==player.monitoringItem.id||player.originalMonitoringItemID==ppArt.itemID))ppGraphics.setupTraceContext(this.m_oFillContext),ppGraphics.setupTraceContext(this.m_oStrokeContext);this.lineJoin=this.lineWidth=this.strokeStyle=this.fillStyle=null}ppGraphics.prototype.Destroy=function(){};ppGraphics.prototype.GetOffset=function(){return this.m_ptOffset};ppGraphics.prototype.IsEmpty=function(){return!this.m_bMergeFill&&!this.m_bMergeStroke};
ppGraphics.prototype.GetFinalCanvas=function(a){if(this.IsEmpty()){if(!a)this.m_oStrokeCanvas.width=1,this.m_oStrokeCanvas.height=1,this.m_oStrokeContext=this.m_oStrokeCanvas=null,this.m_oFillCanvas.width=1,this.m_oFillCanvas.height=1,this.m_oFillContext=this.m_oFillCanvas=null;return null}null==a&&(a=!1);var b=new ppRect(0,0,this.m_nWidth,this.m_nHeight);if(!a)for(var c=null,c=null,d=0,e=0,f=0;f<this.m_arrShadows.length;f++)c=this.m_arrShadows[f],c.bInner?this.DrawInnerShadow(c):(this.DrawShadow(c),
d=(this.m_nWidth-c.canvas.width)/2,e=(this.m_nHeight-c.canvas.height)/2,c.nXPos=d+c.nXOffset,c.nYPos=e+c.nYOffset,c=new ppRect(c.nXPos,c.nYPos,c.nXPos+c.canvas.width,c.nYPos+c.canvas.height),b.AddRect(c));d=null;e=!1;if(!a&&this.m_bHasShadow){if(1==this.m_arrShadows.length&&b.GetWidth()==this.m_arrShadows[0].canvas.width&&b.GetHeight()==this.m_arrShadows[0].canvas.height)this.finalCanvas=this.m_arrShadows[0].canvas,d=this.m_arrShadows[0].context,this.m_nWidth=this.m_arrShadows[0].canvas.width,this.m_nHeight=
this.m_arrShadows[0].canvas.height,this.m_ptOffset.x=-this.m_arrShadows[0].nXPos,this.m_ptOffset.y=-this.m_arrShadows[0].nYPos;else{this.finalCanvas=document.createElement("canvas");d=this.finalCanvas.getContext("2d");this.m_nWidth=b.GetWidth();this.m_nHeight=b.GetHeight();this.m_ptOffset.x=-b.left;this.m_ptOffset.y=-b.top;this.finalCanvas.width=this.m_nWidth;this.finalCanvas.height=this.m_nHeight;for(f=0;f<this.m_arrShadows.length;f++)if(c=this.m_arrShadows[f],!c.bInner)d.drawImage(c.canvas,c.nXPos-
b.left,c.nYPos-b.top),c.canvas.width=1,c.canvas.height=1}d.drawImage(this.m_oFillCanvas,-b.left,-b.top)}else!a&&0==b.left&&0==b.top&&this.m_oFillCanvas.width==this.m_nWidth&&this.m_oFillCanvas.height==this.m_nHeight?(this.finalCanvas=this.m_oFillCanvas,d=this.m_oFillContext,e=!0):(this.finalCanvas=document.createElement("canvas"),d=this.finalCanvas.getContext("2d"),this.finalCanvas.width=this.m_nWidth,this.finalCanvas.height=this.m_nHeight,d.drawImage(this.m_oFillCanvas,-b.left,-b.top));if(!a){if(!e)this.m_oFillCanvas.width=
1,this.m_oFillCanvas.height=1;this.m_oFillContext=this.m_oFillCanvas=null}this.m_bMergeStroke&&d.drawImage(this.m_oStrokeCanvas,-b.left,-b.top);if(!a)this.m_oStrokeCanvas.width=1,this.m_oStrokeCanvas.height=1,this.m_oStrokeContext=this.m_oStrokeCanvas=null;if(!a&&this.m_bHasInnerShadow){d.save();for(f=0;f<this.m_arrShadows.length;f++)if(c=this.m_arrShadows[f],c.bInner)d.shadowOffsetX=c.nXOffset,d.shadowOffsetY=c.nYOffset,d.shadowBlur=c.nBlur,d.shadowColor=ppArt.GetColor(c.nColor,c.nAlpha),d.globalCompositeOperation=
"source-atop",d.drawImage(c.canvas,-10,-10),c.canvas.width=1,c.canvas.height=1;d.restore()}if(player.canvasDebug&&(player.monitoringItem&&ppArt.itemID==player.monitoringItem.id||player.originalMonitoringItemID==ppArt.itemID))this.m_oStrokeContext.dump(),this.m_oFillContext.dump();return this.finalCanvas};
ppGraphics.prototype.AddImage=function(a,b,c,d,e,f){this.FillContext(this.m_oFillContext);this.m_bMergeFill=!0;if(0==this.m_oFillCanvas.width||0==this.m_oFillCanvas.height)this.m_oFillCanvas.width=a.width*d,this.m_oFillCanvas.height=a.height*e,this.m_oStrokeCanvas.width=this.m_oFillCanvas.width,this.m_oStrokeCanvas.height=this.m_oFillCanvas.height,this.m_nWidth=this.m_oFillCanvas.width,this.m_nHeight=this.m_oFillCanvas.height;var g=a.naturalWidth||a.width,h=a.naturalHeight||a.height;if(this.m_oFillCanvas.width<
Math.ceil(g*d)+b+(this.m_nXOffset+ppArt.currentFudge))this.m_oFillCanvas.width=Math.ceil(g*d)+b+(this.m_nXOffset+ppArt.currentFudge),this.m_oStrokeCanvas.width=this.m_oFillCanvas.width;if(this.m_oFillCanvas.height<Math.ceil(h*e)+c+(this.m_nYOffset+ppArt.currentFudge))this.m_oFillCanvas.height=Math.ceil(h*e)+c+(this.m_nYOffset+ppArt.currentFudge),this.m_oStrokeCanvas.height=this.m_oFillCanvas.height;this.m_bFillStarted=!1;this.m_oFillContext.beginPath();this.m_oFillContext.globalAlpha=f;b-=ppArt.currentFudge;
c-=ppArt.currentFudge;this.m_oFillContext.drawImage(a,0,0,g,h,b+(this.m_nXOffset+ppArt.currentFudge),c+(this.m_nYOffset+ppArt.currentFudge),Math.ceil(g*d),Math.ceil(h*e));this.m_oFillContext.globalAlpha=1};ppGraphics.prototype.StartSolidFill=function(a,b){this.FillContext(this.m_oFillContext);this.m_oFillContext.beginPath();this.m_oFillContext.fillStyle=ppArt.GetColor(a,b);this.m_bFillStarted=!0};
ppGraphics.prototype.StartGradientFill=function(a){this.FillContext(this.m_oFillContext);this.m_oFillContext.beginPath();this.m_oFillContext.fillStyle=a;this.m_bFillStarted=!0};ppGraphics.prototype.EndFill=function(){this.FillContext(this.m_oFillContext);this.m_bFillStarted=!1};ppGraphics.prototype.StartImageFill=function(a){this.FillContext(this.m_oFillContext);this.m_oFillContext.beginPath();this.m_oFillContext.fillStyle=a;this.m_bFillStarted=!0};
ppGraphics.prototype.StartRotatedImageFill=function(a,b,c,d,e,f){this.FillContext(this.m_oFillContext);this.m_nFillRotation=b;this.m_nFillXPos=c;this.m_nFillYPos=d;this.m_nFillScaleX=e;this.m_nFillScaleY=f;this.m_bRotatedFill=!0;this.m_oFillContext.beginPath();this.m_oFillContext.fillStyle=a;this.m_bFillStarted=!0};
ppGraphics.prototype.SetLineStyle=function(a,b,c,d,e){this.CreateNewStrokeCanvas();this.m_bStrokeStarted=!0;this.strokeStyle=ppArt.GetColor(b,c);this.lineWidth=Math.max(0.25,a);this.lineJoin=d;this.lineCap=e;if(0<a%2)ppArt.currentFudge=window.ppFudge;this.m_oStrokeContext.strokeStyle=this.strokeStyle;this.m_oStrokeContext.lineWidth=this.lineWidth;this.m_oStrokeContext.lineJoin=this.lineJoin};
ppGraphics.prototype.SetGradientLineStyle=function(a,b,c,d){this.CreateNewStrokeCanvas();this.m_bStrokeStarted=!0;this.strokeStyle=b;this.lineWidth=a;this.lineJoin=c;this.lineCap=d;if(0<a%2)ppArt.currentFudge=window.ppFudge;this.m_oStrokeContext.strokeStyle=b;this.m_oStrokeContext.lineWidth=this.lineWidth;this.m_oStrokeContext.lineJoin=this.lineJoin;this.m_bStrokeStarted=!0};ppGraphics.prototype.ClearLineStyle=function(){this.CreateNewStrokeCanvas();this.m_bStrokeStarted=!1};
ppGraphics.prototype.CreateNewStrokeCanvas=function(){ppArt.currentFudge=0;if(this.m_bLineDrawn){if(this.m_bStrokeStarted)this.m_nMaxLineWidth=Math.max(this.m_nMaxLineWidth,this.lineWidth),this.m_oStrokeContext.stroke(),this.m_bMergeStroke=!0;this.m_oStrokeContext.beginPath();this.m_bLineDrawn=!1}};ppGraphics.prototype.AddShadow=function(a,b,c,d,e,f,g,h,j){var l={};l.nXOffset=a;l.nYOffset=b;l.nBlur=c;l.nColor=d;l.nAlpha=e;l.nScale=f;l.nStrength=g;l.nQuality=h;l.bInner=j;this.m_arrShadows.push(l)};
ppGraphics.prototype.DrawShadow=function(a){var b=a.nBlur,c=a.nScale,d=this.GetFinalCanvas(!0);if(null!=d)a.canvas=document.createElement("canvas"),a.context=a.canvas.getContext("2d"),a.canvas.height=d.height*c+2*b,a.canvas.width=d.width*c+2*b,a.context.save(),a.context.shadowOffsetX=0,a.context.shadowOffsetY=d.height*c+2*b,a.context.shadowBlur=b,a.context.shadowColor=ppArt.GetColor(a.nColor,a.nAlpha),a.context.drawImage(d,0,0,d.width,d.height,b,b-a.canvas.height,d.width*c,d.height*c),a.context.restore(),
this.m_bHasShadow=!0,d.width=1,d.height=1};
ppGraphics.prototype.DrawInnerShadow=function(a){var b=this.GetFinalCanvas(!0);if(null!=b)this.m_bHasInnerShadow=!0,a.canvas=document.createElement("canvas"),a.canvas.width=b.width+20,a.canvas.height=b.height+20,a.context=a.canvas.getContext("2d"),a.context.fillStyle=ppArt.GetColor(a.nColor,a.nAlpha),a.context.moveTo(0,0),a.context.lineTo(a.canvas.width,0),a.context.lineTo(a.canvas.width,a.canvas.height),a.context.lineTo(0,a.canvas.height),a.context.lineTo(0,0),a.context.fill(),a.context.globalCompositeOperation=
"destination-out",a.context.drawImage(b,10,10),a.context.globalCompositeOperation="source-over",b.width=1,b.height=1};ppGraphics.prototype.fill=function(){this.FillContext(this.m_oFillContext);this.m_oFillContext.beginPath()};
ppGraphics.prototype.FillContext=function(a){if(this.m_bFillStarted)this.m_bMergeFill=!0,a.save(),a.translate(this.m_nXOffset+ppArt.currentFudge,this.m_nYOffset+ppArt.currentFudge),this.m_bRotatedFill&&(a.scale(this.m_nFillScaleX,this.m_nFillScaleY),a.translate(this.m_nFillXPos,this.m_nFillYPos),a.rotate(this.m_nFillRotation)),a.fill(),this.m_bRotatedFill=!1,a.restore()};
ppGraphics.prototype.stroke=function(){if(this.m_bLineDrawn&&this.m_bStrokeStarted)this.m_nMaxLineWidth=Math.max(this.m_nMaxLineWidth,this.lineWidth),this.m_oStrokeContext.stroke(),this.m_bMergeStroke=!0};ppGraphics.prototype.beginPath=function(){this.m_oFillContext.beginPath();this.m_oStrokeContext.beginPath();this.m_bLineDrawn=this.m_bFillStarted=this.m_bStrokeStarted=!1};
ppGraphics.prototype.closePath=function(){this.m_oFillContext.closePath();this.m_oStrokeContext.closePath();this.m_oFillContext.drawImage(this.m_oStrokeCanvas,0,0);this.m_oStrokeContext.clearRect(0,0,this.m_oStrokeCanvas.width,this.m_oStrokeCanvas.height)};
ppGraphics.prototype.lineTo=function(a,b){this.m_bForMask&&(a=Math.round(a),b=Math.round(b));this.m_bFillStarted&&this.m_oFillContext.lineTo(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge));if(this.m_bStrokeStarted)this.m_bLineDrawn=!0,this.m_oStrokeContext.lineTo(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge));this.m_nCurXPos=a+(this.m_nXOffset+ppArt.currentFudge);this.m_nCurYPos=b+(this.m_nYOffset+ppArt.currentFudge)};
ppGraphics.prototype.moveTo=function(a,b){this.m_bForMask&&(a=Math.round(a),b=Math.round(b));this.m_oFillContext.moveTo(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge));this.m_oStrokeContext.moveTo(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge));this.m_nCurXPos=a+(this.m_nXOffset+ppArt.currentFudge);this.m_nCurYPos=b+(this.m_nYOffset+ppArt.currentFudge)};
ppGraphics.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.m_bForMask&&(a=Math.round(a),b=Math.round(b),c=Math.round(c),d=Math.round(d),e=Math.round(e),f=Math.round(f));this.m_bFillStarted&&this.m_oFillContext.bezierCurveTo(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge),c+(this.m_nXOffset+ppArt.currentFudge),d+(this.m_nYOffset+ppArt.currentFudge),e+(this.m_nXOffset+ppArt.currentFudge),f+(this.m_nYOffset+ppArt.currentFudge));if(this.m_bStrokeStarted)this.m_bLineDrawn=
!0,this.m_oStrokeContext.bezierCurveTo(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge),c+(this.m_nXOffset+ppArt.currentFudge),d+(this.m_nYOffset+ppArt.currentFudge),e+(this.m_nXOffset+ppArt.currentFudge),f+(this.m_nYOffset+ppArt.currentFudge));this.m_nCurXPos=e+(this.m_nXOffset+ppArt.currentFudge);this.m_nCurYPos=f+(this.m_nYOffset+ppArt.currentFudge)};
ppGraphics.prototype.createLinearGradient=function(a,b,c,d){return this.m_oFillContext.createLinearGradient(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge),c+(this.m_nXOffset+ppArt.currentFudge),d+(this.m_nYOffset+ppArt.currentFudge))};
ppGraphics.prototype.createRadialGradient=function(a,b,c,d,e,f){return this.m_oFillContext.createRadialGradient(a+(this.m_nXOffset+ppArt.currentFudge),b+(this.m_nYOffset+ppArt.currentFudge),c,d+(this.m_nXOffset+ppArt.currentFudge),e+(this.m_nYOffset+ppArt.currentFudge),f)};ppGraphics.prototype.createPattern=function(a,b){return this.m_oFillContext.createPattern(a,b)};
ppGraphics.setupTraceContext=function(a){if(!a.dump){var b={},b=a;b.commands=[];var c=function(c){b["original_"+c]=a[c];b[c]=function(){for(var a="",f=0;f<b[c].arguments.length;f++)switch(""!=a&&(a+=","),typeof b[c].arguments[f]){case "string":a+="'"+b[c].arguments[f]+"'";break;default:a+=b[c].arguments[f]}a="context."+c+"("+a+");";b.commands.push(a);try{eval(a.replace(c,"original_"+c))}catch(g){}}};for(key in a)"function"==typeof a[key]&&c(key);b.dump=function(){console.log(ppArt.item.renderOnUpdateValues.state+
": "+this.commands.join("\r\n"))}}};var ppArt={LINE_CAP_SQUARE:1,LINE_CAP_FLAT:2,LINE_CAP_ROUND:4,LINE_JOIN_ROUND:8,LINE_JOIN_BEVEL:16,LINE_JOIN_MITER:32,DEGREE_MULTIPLIER:2*Math.PI/360,m_bPathStarted:!1,m_bShapeStarted:!1,m_nStartX:0,m_nStartY:0,m_arrGraphics:null,m_listTextOffsets:null,m_arrShadows:null,m_oGraphics:null,commandReflection:null,lastLineStyleCommand:null,lastFillCommand:null,m_bRenderOnSlideBg:!1,m_oSprite:null,m_nSpriteX:-1,m_nSpriteY:-1,currentSlide:null,rectRotated:null,polyRotated:null,m_nRotationDistance:0,m_nStartOffset:0,
GetColor:function(a,b){void 0==b&&(b=100);var c;c=b/100;0==c&&(c=0.005);return"rgba("+(a>>16)+","+(a>>8&255)+","+(a&255)+", "+c+")"},DrawVector:function(a,b,c,d,e,f,g){if(null!=a&&null!=a.slide)this.m_oSprite=a,this.m_nSpriteX=a.x,this.m_nSpriteY=a.y,this.currentSlide=a.slide;this.m_arrMaskRefs=[];this.m_bRenderOnSlideBg=!1;this.m_arrGraphics=[];this.m_listTextOffsets={};this.m_arrTextPaths=[];b=ppCommandParser.ParsePath(b);ppRectBuilder.InitRect();ppRectBuilder.BuildRect(b,c,e,f);if(!a.rectShape)a.rectShape=
new ppRect(-1,-1,a.m_nWidth+1,a.m_nHeight+1);a.rectShape.AddRect(ppRectBuilder.rectShape);this.rectShape=a.rectShape;this.m_nRotation=a.rotation;if(a.matrix)this.m_nRotation=a.matrix.getRotation()/this.DEGREE_MULTIPLIER;this.m_oGraphics=new ppGraphics(a.rectShape);this.m_arrGraphics.push(this.m_oGraphics);this.m_bShapeStarted=this.m_bPathStarted=!1;this.m_arrShadows=this.lastFillCommand=this.lastLineStyleCommand=this.commandReflection=null;if(ppArt.item)ppArt.item.charIndex=0,ppArt.item.overStepped=
!1;this.DrawPath(b,0,0,c,d,e,f);this.DrawDeferredText();if(ppArt.item)ppArt.item.maxCharIndex=Math.max(ppArt.item.charIndex,ppArt.item.maxCharIndex),ppArt.item.hotContexts=[];c=a.canvas.getContext?a.canvas.getContext("2d"):this.item.context;c.save();for(var b=[],h=null,f=e=0,d={x:0,y:0},j=0;j<this.m_arrGraphics.length;j++){if(1==this.m_arrGraphics.length&&null!=this.m_arrShadows){for(var l=this.m_arrGraphics[0],h=null,m=0;m<this.m_arrShadows.length;m++)h=this.m_arrShadows[m],l.AddShadow(h.nXOffset,
h.nYOffset,h.nBlurX,h.nColor,h.nAlpha,h.nScale,h.nStrength,h.nQuality,h.bInner);this.m_arrShadows=null}l=this.m_arrGraphics[j];m=l.GetFinalCanvas();if(null!=m){h={};h.canvas=m;h.offset=l.GetOffset();h.width=this.m_oGraphics.m_nWidth;h.height=this.m_oGraphics.m_nHeight;if(e<h.canvas.height)e=h.canvas.height;if(f<h.canvas.width)f=h.canvas.width;b.push(h);if(d.x<h.offset.x)d.x=h.offset.x;if(d.y<h.offset.y)d.y=h.offset.y;if(ppArt.item&&l.m_bVectorHot&&(ppArt.item.hotContexts.push(h.canvas.getContext("2d")),
player.showDebugOverlap))h.canvas.style.border="solid 1px #000",document.body.appendChild(h.canvas)}}h=null;if(1==b.length)h=b[0].canvas,d=b[0].offset;else{h=document.createElement("canvas");h.width=f;h.height=e;l=h.getContext("2d");for(j=0;j<b.length;j++)l.drawImage(b[j].canvas,d.x-b[j].offset.x,d.y-b[j].offset.y)}if(null!=this.m_arrShadows){l=new ppGraphics(new ppRect(0,0,f,e));l.AddImage(h,0,0,1,1,100);for(j=0;j<this.m_arrShadows.length;j++)h=this.m_arrShadows[j],l.AddShadow(h.nXOffset,h.nYOffset,
h.nBlurX,h.nColor,h.nAlpha,h.nScale,h.nStrength,h.nQuality,h.bInner);h=l.GetFinalCanvas();f=h.width;e=h.height;b=l.GetOffset();0<b.x&&(d.x+=b.x);0<b.y&&(d.y+=b.y)}b=new ppRect(0,0,f,e);e=new ppRect(0,0,f,e);f={x:0,y:0};this.commandReflection&&this.AdjustReflectionBounds(this.commandReflection,b,f,a.rectShape,this.rectRotated,a.rotation,a.rotatexpos,a.rotateypos,this.m_nRotationDistance);a.canvas.width=b.GetWidth();a.canvas.height=b.GetHeight();g&&g({offX:a.rectShape.left-(f.x+d.x),offY:a.rectShape.top-
(f.y+d.y)});0<h.width&&0<h.height&&c.drawImage(h,0,0,e.right,e.bottom,f.x,f.y,e.right,e.bottom);c.restore();a.m_nXOffset=a.rectShape.left-(f.x+d.x);a.m_nYOffset=a.rectShape.top-(f.y+d.y);this.commandReflection&&this.DrawReflection(this.commandReflection,c,a.canvas,a.rectShape,f,this.rectRotated,this.polyRotated,a.rotation,a.rotatexpos,a.rotateypos,this.m_nRotationDistance);for(var k in this.m_listTextOffsets)this.m_listTextOffsets[k].x+=f.x+d.x,this.m_listTextOffsets[k].y+=f.y+d.y;this.currentSlide=
null;this.m_arrGraphics=[];this.m_arrTextPaths=[];this.m_oGraphics=null;this.m_arrShadows=[]},DrawPath:function(a,b,c,d,e,f,g){this.m_oGraphics.beginPath();for(var h=0;h<a.length;h++)a[h].callback?a[h].callback.call(this,a[h],b,c,d,e,f,g):console.warn("Callback is undefined: "+a[h].name);this.m_oGraphics.fill();this.m_oGraphics.stroke()},ClearLineStyle:function(){this.m_oGraphics.ClearLineStyle()},RepeatLineStyle:function(a,b,c,d,e,f,g){this.lastLineStyleCommand&&this.lastLineStyleCommand.callback.call(this,
this.lastLineStyleCommand,b,c,d,e,f,g)},RepeatFill:function(a,b,c,d,e,f,g){this.lastFillCommand&&this.lastFillCommand.callback.call(this,this.lastFillCommand,b,c,d,e,f,g)},SetShapeHot:function(){if(this.item)this.item.vectorHot=!0},EndFill:function(){this.m_oGraphics.EndFill()},ClosePath:function(){this.m_oGraphics.lineTo(this.m_nStartX,this.m_nStartY);this.m_oGraphics.closePath();this.m_bShapeStarted=!0;this.m_bPathStarted=!1},EndPath:function(){this.m_oGraphics.fill();this.m_oGraphics.stroke();
this.m_bPathStarted=this.m_bShapeStarted=!1},CreateShape:function(a){this.m_oGraphics.fill();this.m_oGraphics.stroke();this.m_oGraphics=new ppGraphics(this.rectShape);this.m_arrGraphics.push(this.m_oGraphics);if(a.hot)this.m_oGraphics.m_bVectorHot=!0},GetGradientLine:function(a,b,c,d,e){for(var f=!1;180<=e;)e-=180,f=!f;var e=e*Math.PI/180,g=0,h=0,c=c/2,d=d/2;e<=Math.atan2(d,c)?(g=c,h=Math.tan(e)*c):e<=Math.PI/2?(g=Math.tan(Math.PI/2-e)*d,h=d):e<=Math.PI/2+Math.atan2(c,d)?(g=Math.tan(Math.PI/2-e)*
d,h=d):e<=Math.PI&&(g=-c,h=Math.tan(e)*-c);f&&(g=-g,h=-h);return{x1:a+c-g,y1:b+d-h,x2:a+c+g,y2:b+d+h}},StartGradientFill:function(a){this.m_oGraphics.fill();this.lastFillCommand=a;var b;if(2==a.type){b=a.width;if(a.height<a.width)b=a.height;b=this.m_oGraphics.createRadialGradient(a.xpos+a.width/2,a.ypos+a.height/2,0,a.xpos+a.width/2,a.ypos+a.height/2,b)}else b=this.GetGradientLine(a.xpos,a.ypos,a.width,a.height,a.rotation),b=this.m_oGraphics.createLinearGradient(b.x1,b.y1,b.x2,b.y2);for(var c=-1,
d=0;d<a.stops.length;d++)a.stops[d].stop!=c&&null!=b&&b.addColorStop(a.stops[d].stop/255,this.GetColor(a.stops[d].color,a.stops[d].alpha)),c=a.stops[d].stop;null!=b&&this.m_oGraphics.StartGradientFill(b)},SetGradientLineStyle:function(a){this.lastLineStyleCommand=a;var b="round",c="round",d;a.capJoin&this.LINE_CAP_FLAT?b="butt":a.capJoin&this.LINE_CAP_ROUND?b="round":a.capJoin&this.LINE_CAP_SQUARE&&(b="square");a.capJoin&this.LINE_JOIN_BEVEL?c="bevel":a.capJoin&this.LINE_JOIN_MITER?c="miter":a.capJoin&
this.LINE_JOIN_ROUND&&(c="round");if(2==a.type){d=a.width;if(a.height<a.width)d=a.height;d=this.m_oGraphics.createRadialGradient(a.xpos+a.width/2,a.ypos+a.height/2,0,a.xpos+a.width/2,a.ypos+a.height/2,d/2)}else d=this.GetGradientLine(a.xpos,a.ypos,a.width,a.height,a.rotation),d=this.m_oGraphics.createLinearGradient(d.x1,d.y1,d.x2,d.y2);if(null!=d){for(var e=0;e<a.stops.length;e++)d.addColorStop(a.stops[e].stop/255,this.GetColor(a.stops[e].color,a.stops[e].alpha));this.m_oGraphics.SetGradientLineStyle(a.lineWidth,
d,c,b)}},SetLineStyle:function(a){this.lastLineStyleCommand=a;var b="round",c="round";if(0==a.lineWidth)a.lineWidth=1.0E-4;a.capJoin&this.LINE_CAP_FLAT?b="butt":a.capJoin&this.LINE_CAP_ROUND?b="round":a.capJoin&this.LINE_CAP_SQUARE&&(b="square");a.capJoin&this.LINE_JOIN_BEVEL?c="bevel":a.capJoin&this.LINE_JOIN_MITER?c="miter":a.capJoin&this.LINE_JOIN_ROUND&&(c="round");this.m_oGraphics.SetLineStyle(a.lineWidth,a.color,a.alpha,c,b)},DrawGlobalShadow:function(a){if(null==this.m_arrShadows)this.m_arrShadows=
[];var b=this.m_nRotation;this.m_oSprite&&this.m_oSprite.getGlobalRotation&&(b=this.m_oSprite.getGlobalRotation());var c=a.angle-b,b=a.distance*Math.cos(c*this.DEGREE_MULTIPLIER),c=a.distance*Math.sin(c*this.DEGREE_MULTIPLIER),d={};d.nXOffset=b;d.nYOffset=c;d.nBlurX=a.blurX;d.nBlurY=a.blurY;d.nColor=a.color;d.nAlpha=a.alpha;d.nScale=a.scale;d.nStrength=1;d.nQuality=a.quality;d.bInner=a.inner;this.m_arrShadows.push(d)},DrawShadow:function(a){var b=a.angle-this.m_nRotation,c=a.distance*Math.cos(b*this.DEGREE_MULTIPLIER),
b=a.distance*Math.sin(b*this.DEGREE_MULTIPLIER);this.m_oGraphics.AddShadow(c,b,a.blurX,a.color,a.alpha,a.scale,1,a.quality,a.inner);return this.m_nStartOffset},AddPerspectiveShadow:function(){},AddReflection:function(a){this.commandReflection=a},StoreRotationData:function(a){this.m_nRotationDistance=a.rotationDistance;this.rectRotated=a.rectRotated;this.polyRotated=a.polyRotated;if(0==this.rectRotated.left&&0==this.rectRotated.right&&0==this.rectRotated.top&&0==this.rectRotated.bottom)this.rectRotated=
this.rectShape.Clone(),this.polyRotated=[{x:this.rectShape.left-10,y:this.rectShape.top-10},{x:this.rectShape.right+10,y:this.rectShape.top-10},{x:this.rectShape.right+10,y:this.rectShape.bottom+10},{x:this.rectShape.left-10,y:this.rectShape.bottom+10}]},AdjustReflectionBounds:function(a,b,c,d,e,f,g,h,j){this.m_nStartOffset=0;var l=a.distance;if(0<a.scale){var m=0,k=0,a=d.bottom;0!=f&&(m=(j+l/2)/Math.sin(f*this.DEGREE_MULTIPLIER),k=m*Math.cos(2*f*this.DEGREE_MULTIPLIER),a=m*Math.sin(2*f*this.DEGREE_MULTIPLIER));
f=m+c.x+g-d.left-k-(g+d.left-e.left)+d.left;d=c.y+h-d.top+a-(d.GetHeight()-h-(d.bottom-e.bottom));g=e.GetWidth();j=e.GetHeight();e=Math.floor(f);h=Math.floor(d);f=Math.ceil(f+g);d=Math.ceil(d+j);if(b.left>e)c.x=-e,b.left=e;if(b.top>h)c.y=-h,b.top=h;if(b.bottom<d)b.bottom=d;if(b.right<f)b.right=f}},DrawReflection:function(a,b,c,d,e,f,g,h,j,l,m){this.m_nStartOffset=0;var k=a.distance,n=a.stops,p=a.alphas,r=a.scale;if(0<r){a=document.createElement("canvas");a.style.border="red 1px dashed";a.width=f.GetWidth();
a.height=f.GetHeight();var o=a.getContext("2d");o.save();o.translate(j-f.left,d.GetHeight()-(l-d.top)-(d.bottom-f.bottom));o.scale(1,-1);o.rotate(2*h*this.DEGREE_MULTIPLIER);o.translate(-(j-d.left),-(l-d.top));o.drawImage(c,e.x,e.y,c.width-e.x,c.height-e.y,0,0,c.width-e.x,c.height-e.y);o.restore();Math.sqrt((g[3].x-g[0].x)*(g[3].x-g[0].x)+(g[3].y-g[0].y)*(g[3].y-g[0].y));var t=o.createLinearGradient(g[0].x,g[0].y,g[3].x,g[3].y);o.save();try{t.addColorStop(n[0]/255,"rgba(255, 255, 255, "+(1-p[0])+
")");t.addColorStop(n[1]/255*r,"rgba(255, 255, 255, "+(1-p[1])+")");t.addColorStop(n[1]/255*r+1.0E-4,"rgba(255, 255, 255, 100)");o.fillStyle=t;o.globalCompositeOperation="destination-out";o.moveTo(g[0].x,g[0].y);o.lineTo(g[1].x,g[1].y);o.lineTo(g[2].x,g[2].y);o.lineTo(g[3].x,g[3].y);o.lineTo(g[0].x,g[0].y);o.fill();var n=g=0,v=this.rectShape.bottom+k+this.m_oGraphics.m_nMaxLineWidth;0!=h&&(g=(m+k/2-2*this.m_oGraphics.m_nMaxLineWidth)/Math.sin(h*this.DEGREE_MULTIPLIER),n=g*Math.cos(2*h*this.DEGREE_MULTIPLIER),
v=g*Math.sin(2*h*this.DEGREE_MULTIPLIER));var w=g+e.x+j-d.left-n-(j+d.left-f.left)+d.left,A=e.y+l-d.top+v-(d.GetHeight()-l-(d.bottom-f.bottom));if(this.item.vectorHot){var B=document.createElement("canvas");B.style.border="red 1px dashed";B.width=c.width;B.height=c.height;var C=B.getContext("2d");C.drawImage(c,0,0,c.width,c.height);this.item.vectorHot=!1;ppArt.item.hotContexts.push(C)}b.drawImage(a,0,0,a.width,a.height,w,A,a.width,a.height)}catch(ca){}a.width=1;a.height=1}return this.m_nStartOffset},
StartSlideBgFill:function(a){this.lastFillCommand=a;this.m_nStartOffset=0;if(null!=this.currentSlide&&(null!=this.currentSlide.slideBgImage||this.currentSlide.background)){a=null;if(this.currentSlide.slideBgImage)a=this.currentSlide.slideBgImage;else try{a=document.createElement("canvas");a.width=this.currentSlide.width;a.height=this.currentSlide.height;var b=a.getContext("2d");this.currentSlide.background.applyCanvas(b,this.currentSlide,!0,!1);b.rect(0,0,this.currentSlide.width,this.currentSlide.height);
b.fill()}catch(c){}if(a){var d=document.createElement("canvas");d.width=a.width;d.height=a.height;b=d.getContext("2d");b.drawImage(a,-this.m_nSpriteX,-this.m_nSpriteY);this.m_oGraphics.StartImageFill(this.m_oGraphics.createPattern(d,"no-repeat"));d.width=1;d.height=1}}else if(!this.currentSlide.backgroundReady)this.m_bRenderOnSlideBg=!0;return this.m_nStartOffset},StartBitmapFill:function(a,b,c,d,e,f){this.lastFillCommand=a;this.m_oGraphics.fill();b=f.GetImage(a.imageId);c=b.imgNode;d=document.createElement("canvas");
d.width=a.width;d.height=a.height;var e=d.getContext("2d"),f=b.nWidth*a.scaleX/c.naturalWidth,g=b.nHeight*a.scaleY/c.naturalHeight,h=c.naturalWidth*f/2,j=c.naturalHeight*g/2;this.m_arrMaskRefs.push({isOpaque:0<b.strUrl.indexOf(".jpg"),maskRef:b.maskRef,x:b.nDX,y:b.nDY,width:c.naturalWidth,height:c.naturalHeight,scaleX:f,scaleY:g});e.translate(h+a.tx,j+a.ty);e.rotate(a.rotation*this.DEGREE_MULTIPLIER);e.translate(-h,-j);e.scale(f,g);e.drawImage(c,0,0);this.m_oGraphics.StartImageFill(this.m_oGraphics.createPattern(d,
"no-repeat"));d.width=1;d.height=1},StartBitmapTileFill:function(a,b,c,d,e,f){this.lastFillCommand=a;var g=f.GetImage(a.imageId),d=g.imgNode,h,e=g.nWidth*a.scaleX/d.naturalWidth,f=g.nHeight*a.scaleY/d.naturalHeight;this.m_arrMaskRefs.push({isOpaque:0<g.strUrl.indexOf(".jpg"),maskRef:g.maskRef,x:g.nDX,y:g.nDY,width:d.naturalWidth,height:d.naturalHeight,scaleX:e,scaleY:f});switch(a.mirrorType){case 0:h=document.createElement("canvas");h.width=d.naturalWidth;h.height=d.naturalHeight;g=h.getContext("2d");
g.drawImage(d,0,0);break;case 1:h=document.createElement("canvas");h.width=2*d.naturalWidth;h.height=d.naturalHeight;g=h.getContext("2d");g.drawImage(d,0,0);g.save();g.translate(d.naturalWidth,0);g.scale(-1,1);g.drawImage(d,-d.naturalWidth,0);g.restore();break;case 2:h=document.createElement("canvas");h.width=d.naturalWidth;h.height=2*d.naturalHeight;g=h.getContext("2d");g.drawImage(d,0,0);g.save();g.translate(0,d.naturalHeight);g.scale(1,-1);g.drawImage(d,0,-d.naturalHeight);g.restore();break;case 4:h=
document.createElement("canvas"),h.width=2*d.naturalWidth,h.height=2*d.naturalHeight,g=h.getContext("2d"),g.drawImage(d,0,0),g.save(),g.translate(0,d.naturalHeight),g.scale(1,-1),g.drawImage(d,0,-d.naturalHeight),g.restore(),g.save(),g.translate(d.naturalWidth,0),g.scale(-1,1),g.drawImage(d,-d.naturalWidth,0),g.restore(),g.save(),g.translate(d.naturalWidth,d.naturalHeight),g.scale(-1,-1),g.drawImage(d,-d.naturalWidth,-d.naturalHeight),g.restore()}this.m_oGraphics.StartRotatedImageFill(this.m_oGraphics.createPattern(h,
"repeat"),a.rotation*this.DEGREE_MULTIPLIER,a.xpos+b,a.ypos+c,e,f);h.width=1;h.height=1;return this.m_nStartOffset},CreateNewShape:function(){this.m_oGraphics.fill();this.m_oGraphics.stroke();if(!this.m_oGraphics.IsEmpty())this.m_oGraphics=new ppGraphics(this.rectShape),this.m_arrGraphics.push(this.m_oGraphics),this.m_oGraphics.m_bVectorHot=!0},AddImage:function(a,b,c,d,e,f){this.CreateNewShape();var b=a.xpos+b,c=a.ypos+c,f=f.GetImage(a.imageId),d=f.imgNode,e=f.nWidth*a.scaleX/d.naturalWidth,g=f.nHeight*
a.scaleY/d.naturalHeight;0.01>Math.abs(e-1)&&(e=1);0.01>Math.abs(g-1)&&(g=1);this.m_arrMaskRefs.push({isOpaque:0<f.strUrl.indexOf(".jpg"),maskRef:f.maskRef,x:b+f.nDX,y:c+f.nDY,width:d.naturalWidth,height:d.naturalHeight,scaleX:e,scaleY:g});this.m_oGraphics.AddImage(d,b+f.nDX,c+f.nDY,e,g,a.alpha);this.CreateNewShape()},StartSolidFill:function(a){this.lastFillCommand=a;this.m_oGraphics.StartSolidFill(a.color,a.alpha)},AddText:function(a,b,c,d,e,f,g,h){ppArt.item&&ppArt.item.updateTextTemplate&&ppArt.item.updateTextTemplate(a.textId);
h||(this.m_oGraphics.stroke(),this.m_oGraphics.fill(),this.m_listTextOffsets[a.textId]={id:a.textId,x:a.xpos+b,y:a.ypos+c},this.m_arrTextPaths.push({commandData:a,dx:b,dy:c,textLib:d,fontLib:e,strLinkId:g}))},AddReflectionText:function(){},DrawDeferredText:function(){for(var a=0;a<this.m_arrTextPaths.length;a++){var b,c,d,e;b=this.m_nRotationDistance;c=this.rectRotated;d=this.polyRotated;e=this.m_oGraphics.m_bVectorHot;this.m_oGraphics.m_bVectorHot=!1;var f=this.m_arrTextPaths[a],g=f.commandData,
h=g.textCommands;h||(h=f.textLib.GetPathById(g.textId,f.strLinkId),h=ppCommandParser.ParsePath(h),console.warn("COMMANDS NOT CREATED"));if(0!=f.nRotation){var j=g.xpos+f.dx+ppArt.m_oGraphics.m_nXOffset,l=g.ypos+f.dy+ppArt.m_oGraphics.m_nYOffset;ppArt.m_oGraphics.m_oFillContext.save();ppArt.m_oGraphics.m_oFillContext.translate(j,l);ppArt.m_oGraphics.m_oFillContext.rotate(g.rotation*Math.PI/180);ppArt.m_oGraphics.m_oFillContext.translate(-j,-l);ppArt.m_oGraphics.m_oStrokeContext.save();ppArt.m_oGraphics.m_oStrokeContext.translate(j,
l);ppArt.m_oGraphics.m_oStrokeContext.rotate(g.rotation*Math.PI/180);ppArt.m_oGraphics.m_oStrokeContext.translate(-j,-l);ppArt.DrawPath(h,g.xpos+f.dx,g.ypos+f.dy,f.textLib,f.fontLib,f.strLinkId);ppArt.m_oGraphics.m_oFillContext.restore();ppArt.m_oGraphics.m_oStrokeContext.restore()}else ppArt.DrawPath(h,g.xpos+f.dx,g.ypos+f.dy,f.textLib,f.fontLib,f.strLinkId);this.m_nRotationDistance=b;this.rectRotated=c;this.polyRotated=d;this.m_oGraphics.m_bVectorHot=e}},DrawPolygon:function(a,b,c){var d=a.points[0].x+
b,e=a.points[0].y+c;this.m_oGraphics.moveTo(d,e);for(var f=1;f<a.points.length;f++)this.m_oGraphics.lineTo(a.points[f].x+b,a.points[f].y+c);this.m_oGraphics.lineTo(d,e);this.m_bPathStarted=!1},DrawLines:function(a,b,c){this.m_nStartOffset=0;var d=a.points[0].x+b,e=a.points[0].y+c;this.m_bPathStarted?this.m_oGraphics.lineTo(d,e):(this.m_bPathStarted=!0,this.m_oGraphics.moveTo(d,e),this.m_nStartX=d,this.m_nStartY=e);for(d=1;d<a.points.length;d++)this.m_oGraphics.lineTo(a.points[d].x+b,a.points[d].y+
c);return this.m_nStartOffset},DrawClosedCurve:function(a,b,c){this.DrawCurve(a,b,c);this.m_oGraphics.closePath();this.m_bPathStarted=!1},DrawCurve:function(a,b,c){this.m_nStartOffset=0;var d=a.points[0].x+b,e=a.points[0].y+c,f,g,h,j,l=0;this.m_bPathStarted?(trace.noteCanvasCommand("lineTo",d,e),this.m_oGraphics.lineTo(d,e)):(this.m_bPathStarted=!0,trace.noteCanvasCommand("moveTo",d,e),this.m_oGraphics.moveTo(d,e),this.m_nStartX=d,this.m_nStartY=e);for(l=1;l<a.points.length;l+=3)d=a.points[l].x+b,
e=a.points[l].y+c,f=a.points[l+1].x+b,g=a.points[l+1].y+c,h=a.points[l+2].x+b,j=a.points[l+2].y+c,this.m_oGraphics.bezierCurveTo(d,e,f,g,h,j);return this.m_nStartOffset},DrawRectangle:function(a,b,c){b=a.x+b;c=a.y+c;this.m_oGraphics.moveTo(b,c);this.m_oGraphics.lineTo(b+a.width,c);this.m_oGraphics.lineTo(b+a.width,c+a.height);this.m_oGraphics.lineTo(b,c+a.height);this.m_oGraphics.lineTo(b,c);this.m_bPathStarted=!1},DrawVectorText:function(a,b,c){if(this.m_bPathStarted||this.m_bShapeStarted)this.m_oGraphics.fill(),
this.m_oGraphics.stroke(),this.m_bShapeStarted=this.m_bPathStarted=!1;var d,e,f=0,g=0,h=0,j=ppArt.item;if(j&&j.animateByCharacter&&!j.characterCanvases)j.characterCanvases=[];var l=0;if(1<a.newLines.length)l=a.newLines[1].ypos;else if(1==a.newLines.length)l=this.m_oGraphics.m_nHeight;for(var m=0;m<a.newLines.length;m++){var k=a.newLines[m];d=k.xpos+b+this.m_oGraphics.m_nXOffset;e=k.ypos+c+this.m_oGraphics.m_nYOffset;for(var n,p=0;p<k.glyphs.length;p++){n=k.glyphs[p];this.m_oGraphics.beginPath();this.m_oGraphics.SetLineStyle(1,
16711680,100,"round");if(""!=a.fontId){var r=g_listFonts[a.fontId];if(r){var o=this.m_oGraphics.m_oFillContext;if(j&&j.animateByCharacter){var t=a.newLines[0].xpos,v=a.newLines[0].ypos;if(!(j.characterCanvases.length>j.charIndex&&j.characterCanvases[j.charIndex])){var w=document.createElement("canvas");w.width=n.dx+d;w.height=l;w.className="glyph";o=w.getContext("2d");j.characterCanvases[j.charIndex]={canvas:w,context:o,x:d,y:e,scale:a.scale};j.charIndex++;j.ref.get(0).appendChild(w);$(w).css("left",
d-t);$(w).css("top",e-v);o.beginPath();o.fillStyle=ppArt.GetColor(a.color,255);r.DrawGlyph(n.index,o,a.newLines[0].xpos-0.5,a.newLines[0].ypos-0.5,a.scale);o.fill()}}else this.m_oGraphics.StartSolidFill(a.color,a.alpha),r=r.DrawGlyph(n.index,o,d,e+n.dy,a.scale),this.m_oGraphics.fill(),h=Math.max(h,r)}}else ppDebug.debug_trace("Could not find the font with id: "+a.fontId);d+=n.dx}d>f&&(f=d);e>g&&(g=e)}this.m_oGraphics.beginPath();h=Math.ceil(h);if(h>this.m_oGraphics.m_nHeight&&ppArt.item)ppArt.item.overStepped=
!0,ppArt.item.requiredRenderHeight=h},DrawEllipse:function(a,b,c){var b=a.x+b,c=a.y+c,d=0.5522848*(a.width/2),e=0.5522848*(a.height/2),f=b+a.width,g=c+a.height,h=b+a.width/2,a=c+a.height/2;this.m_oGraphics.moveTo(b,a);this.m_oGraphics.bezierCurveTo(b,a-e,h-d,c,h,c);this.m_oGraphics.bezierCurveTo(h+d,c,f,a-e,f,a);this.m_oGraphics.bezierCurveTo(f,a+e,h+d,g,h,g);this.m_oGraphics.bezierCurveTo(h-d,g,b,a+e,b,a);this.m_bPathStarted=!1}};var g_listFonts={};function AddFont(a,b){var c=document.getElementsByTagName("head")[0],d=document.createElement("script");d.type="text/javascript";$(d).load(function(){b(a)});d.src=a;c.appendChild(d)}
function RegisterFonts(a){"string"==typeof a&&(a=a.replace(/[\u000a\u000b\u000c\u000d\u0085\u2028\u2029]/g,""),a=a.replace(/&#x[0-8bcef];/ig,""));var b=null;window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml");for(var a=b.getElementsByTagName("font"),b=null,c=0;c<a.length;c++)b=new ppFont(a[c]),g_listFonts[b.Id]=b}
function ppFont(a){this.m_xmlData=null;this.m_listGlyphs={};this.m_bFontReady=!1;this.CMD_LINE="%";this.CMD_MOVE="^";this.CMD_CURVE="#";this.CMD_LINE_E="!";this.CMD_MOVE_E="(";this.CMD_CURVE_E=")";this.BASE_NUMBER=64;this.BASE_POW=6;this.m_o64to10={v0:0,v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8,v9:9,va:10,vb:11,vc:12,vd:13,ve:14,vf:15,vg:16,vh:17,vi:18,vj:19,vk:20,vl:21,vm:22,vn:23,vo:24,vp:25,vq:26,vr:27,vs:28,vt:29,vu:30,vv:31,vw:32,vx:33,vy:34,vz:35,vA:36,vB:37,vC:38,vD:39,vE:40,vF:41,vG:42,vH:43,
vI:44,vJ:45,vK:46,vL:47,vM:48,vN:49,vO:50,vP:51,vQ:52,vR:53,vS:54,vT:55,vU:56,vV:57,vW:58,vX:59,vY:60,vZ:61,v_:62,v$:63};this.Name=this.GetAttrStr(a,"name");this.Id=this.GetAttrStr(a,"id");this.m_xmlFontData=a;this.m_xmlData=a.getElementsByTagName("g");this.m_bFontReady=!0}
ppFont.prototype.LoadFontXML=function(){var a;window.XMLHttpRequest?a=new XMLHttpRequest:window.ActiveXObject&&(a=new ActiveXObject("MSXML2.XMLHTTP"));a.oOwner=this;this.m_xmlRequest=a;a.onreadystatechange=function(){4==a.readyState&&this.oOwner.OnReady(a.responseXML)};a.open("GET",this.m_strFileName,!0);a.send(null)};ppFont.prototype.GetGlyphData=function(a){var b="";null!=this.m_xmlData[a]?b=this.GetAttrStr(this.m_xmlData[a],"p"):ppDebug.debug_error("Glyph index out of range");return b};
ppFont.prototype.GetAttrStr=function(a,b){return a.attributes.getNamedItem(b).value};ppFont.prototype.DrawGlyph=function(a,b,c,d,e){var f=this.m_listGlyphs[a];null==f&&(this.CreateGlyphData(a),f=this.m_listGlyphs[a]);for(var g=f.length,h=0,j=0;j<g;j++){a=f[j];switch(a.cmd){case 0:b.quadraticCurveTo(e*a.x1+c,e*a.y1+d,e*a.x2+c,e*a.y2+d);h=Math.max(h,e*a.y2+d);break;case 1:b.lineTo(e*a.x1+c,e*a.y1+d);break;case 2:b.moveTo(e*a.x1+c,e*a.y1+d)}h=Math.max(h,e*a.y1+d)}return h};
ppFont.prototype.CreateGlyphData=function(a){this.m_strPath=this.GetGlyphData(a);this.m_nPos=0;var b=this.m_strPath.charAt(this.m_nPos);this.m_nPos++;var c="",d=[];for(this.m_listGlyphs[a]=d;this.m_nPos<this.m_strPath.length;)switch(c=this.m_strPath.charAt(this.m_nPos),this.m_nPos++,c){case this.CMD_CURVE:d.push(new ppGlyphCmd(0,this.BaseNto10(0,2),this.BaseNto10(2,2),this.BaseNto10(4,2),this.BaseNto10(6,2)));this.m_nPos+=8;break;case this.CMD_LINE:d.push(new ppGlyphCmd(1,this.BaseNto10(0,2),this.BaseNto10(2,
2)));this.m_nPos+=4;break;case this.CMD_MOVE:d.push(new ppGlyphCmd(2,this.BaseNto10(0,2),this.BaseNto10(2,2)));this.m_nPos+=4;break;case this.CMD_CURVE_E:d.push(new ppGlyphCmd(0,this.BaseNto10(0,3),this.BaseNto10(3,3),this.BaseNto10(6,3),this.BaseNto10(9,3)));this.m_nPos+=12;break;case this.CMD_LINE_E:d.push(new ppGlyphCmd(1,this.BaseNto10(0,3),this.BaseNto10(3,3),0,0));this.m_nPos+=6;break;case this.CMD_MOVE_E:d.push(new ppGlyphCmd(2,this.BaseNto10(0,3),this.BaseNto10(3,3),0,0));this.m_nPos+=6;break;
default:this.m_nPos--,b==this.CMD_CURVE?(d.push(new ppGlyphCmd(0,this.BaseNto10(0,2),this.BaseNto10(2,2),this.BaseNto10(4,2),this.BaseNto10(6,2))),this.m_nPos+=8):(d.push(new ppGlyphCmd(1,this.BaseNto10(0,2),this.BaseNto10(2,2))),this.m_nPos+=4)}};ppFont.prototype.UBaseNto10=function(a,b){for(var c=0,d="",e=0,f=a;f<a+b;f++)d="v"+this.m_strPath.charAt(this.m_nPos+f),c+=parseInt(this.m_o64to10[d])<<this.BASE_POW*e,e++;return c};
ppFont.prototype.BaseNto10=function(a,b){var c=2047;3==b&&(c=131071);return this.UBaseNto10(a,b)-c};function ppFontLib(a,b){this.m_strFontUrl=b;null==a&&(a="");this.m_strBasePath=a}ppFontLib.prototype.CreateFonts=function(a){null!=this.m_strFontUrl&&0<this.m_strFontUrl.length?AddFont(this.m_strBasePath+this.m_strFontUrl,a):a()};function ppGlyphCmd(a,b,c,d,e){this.cmd=a;this.x1=b;this.y1=c;this.x2=d;this.y2=e}
function ppTextLib(a){this.m_bHasXML=!1;if(null!=a)try{this.m_xmlData=a.getElementsByTagName("textdata"),this.m_bHasXML=!0}catch(b){this.m_bHasXML=!1}else ppDebug.debug_trace("Text data is null")}
ppTextLib.prototype.GetPathById=function(a,b){var c="",d="";if(this.m_bHasXML)try{for(var e=0;e<this.m_xmlData.length;e++)if(c=this.m_xmlData[e].attributes.getNamedItem("id").value,c==a){c=!1;if(null!=b)for(var f=this.m_xmlData[e].getElementsByTagName("link"),g=0;g<f.length;g++)if(strCurLinkId=f[g].attributes.getNamedItem("id").value,strCurLinkId==b){try{var h=f[g].getElementsByTagName("pr");f[g].getElementsByTagName("path");d=0<h.length?PathLib.getPathFromXML(h[0]):f[g].getElementsByTagName("path")[0].firstChild.nodeValue;
c=!0}catch(j){}break}c||(ppDebug.debug_trace("GetPathById matched ids "+a),h=this.m_xmlData[e].getElementsByTagName("pr"),this.m_xmlData[e].getElementsByTagName("path"),d=0<h.length?PathLib.getPathFromXML(h[0]):this.m_xmlData[e].getElementsByTagName("path")[0].firstChild.nodeValue);break}}catch(l){ppDebug.debug_trace("Text data is null");try{d=this.m_xmlData[0].getElementsByTagName("path")[0].firstChild.nodeValue,ppDebug.debug_trace("  fell back on path: "+d)}catch(m){d=""}}return d};function ppImageLib(){this.m_listImages={};this.m_nCount=0}ppImageLib.prototype.AddImage=function(a,b,c,d,e,f,g,h,j){var l={};l.Id=a;l.strUrl=b;l.strType=c;l.imgNode=d;l.nWidth=Number(e);l.nHeight=Number(f);l.nDX=Number(g);l.nDY=Number(h);l.maskRef=j;this.m_listImages[a]=l;this.m_nCount++;return l};ppImageLib.prototype.GetImage=function(a){return this.m_listImages[a]};
ppImageLib.prototype.Destroy=function(){for(var a in this.m_listImages)ppDebug.debug_trace("Destroy: "+this.m_listImages[a].Id),this.m_listImages[a].imgNode=null,this.m_listImages[a]=null;this.m_listImages=null};var ppMask={m_strPath:"",rectShape:null,m_oGraphics:null,DrawPath:function(a,b,c,d,e){this.m_strPath=c;this.rectShape=b;this.m_oGraphics=new ppGraphics(b);this.m_oGraphics.m_oStrokeContext=a;this.m_oGraphics.m_bStrokeStarted=!0;this.m_oGraphics.m_bForMask=!0;a.beginPath();b=ppCommandParser.ParsePath(c);for(c=0;c<b.length;c++)b[c].callback?b[c].callback.call(this,b[c],d,e):console.warn("Callback is undefined: "+b[c].name);a.closePath()}};var Frame=function(){this.control_layouts={};this.ready=!1;this.options={};this.colorGroups={};this.sidebarItems={};this.visibleSidebarItems={};this.windows={};this.transcripts={};this.drawNavData={};this.slideStatus={};this.hasLinksRight=this.hasLinksLeft=!1;this.defaultControlLayout=null;this.hasBottomBar=!1;this.controlOptions={};this.customTabCount=0;this.options.enableresultsicons=!0;this.seekColor="#f00"};Frame.controlMap={};Frame.presenterVisible=!1;Frame.logoVisible=!1;
Frame.LEVEL_BEHAVIOR_MANUAL="manual";Frame.LEVEL_BEHAVIOR_REACHED="reached";Frame.LEVEL_BEHAVIOR_INSIDE="inside";Frame.LEVEL_RESTRICTION_UNRESTRICTED="unrestricted";Frame.LEVEL_RESTRICTION_REACHED="reached";Frame.LEVEL_RESTRICTION_INSIDE="inside";Frame.FLOW_FREE="free";Frame.FLOW_RESTRICTED="restricted";Frame.FLOW_LOCKED="locked";Frame.NAV_WIDTH=220;Frame.LOGO_WIDTH=200;Frame.iconSrc="data:image/png;base64, ";
Frame.isPortrait=function(){var a=!1;player.isIOS&&(!player.isIOSlt8||!player.isCrossDomainFrame)?(a=player.isCrossDomainFrame?window.orientation:top.window.orientation,a=a/180==parseInt(a/180)):(a=Frame.getWindowSize(!0),a=a.width<a.height);return a};
Frame.getWindowSize=function(a){if(player.isCrossDomainFrame)if(0!=window.innerWidth)a={width:window.innerWidth,height:window.innerHeight};else{if(!Frame.windowSizer)Frame.windowSizer=document.createElement("DIV"),Frame.windowSizer.className="windowsizer",document.body.insertBefore(Frame.windowSizer,document.body.childNodes[0]);a={width:Frame.windowSizer.offsetWidth,height:Frame.windowSizer.offsetHeight}}else a=a?{width:top.window.innerWidth,height:top.window.innerHeight}:{width:window.innerWidth,
height:window.innerHeight};return Frame.windowSize=a};Frame.getDeviceOrientation=function(){return player.isIOS&&player.isIOSlt8&&player.isCrossDomainFrame?Frame.isPortrait()?90:0:player.isCrossDomainFrame?window.orientation:top.window.orientation};
Frame.resizeSpinners=function(){Frame.windowSize||Frame.getWindowSize(!1);var a=Frame.windowSize;$("#loadingSpinner").css("left",Math.floor(a.width/2)-50);$("#loadingSpinner").css("top",Math.floor(a.height/2)-50);$(".blocked").css("left",Math.floor(a.width/2)-50);$(".blocked").css("top",Math.floor(a.height/2)-50)};
Frame.prototype.loadFromXML=function(a){var b=this;b.xml=a;this.defaultLayoutName=$(a).find("bwFrame").attr("default_layout");this.textdirection=$(a).find("bwFrame").attr("textdirection");this.rtl="rtl"==this.textdirection;this.outputtype=$(a).find("bwFrame").attr("outputtype");player.presenters={};$(a).children("bwFrame").children("presenters").children("presenter").each(function(a,b){var e=new Presenter;e.loadFromXML(b);player.presenters[e.id]=e});this.parseColorSchemes(a);this.parseOptionGroups(a);
this.applyColorSchemes();this.applyRTL();$(a).find("control_layouts").children("control_layout").each(function(a,d){var e={controls:{}},f=$(d).attr("name");$(d).children("control").each(function(a,b){e.controls[$(b).attr("name")]="true"==$(b).attr("enabled")});b.control_layouts[f]=e;if(!b.defaultControlLayout)b.defaultControlLayout=e});Frame.initControlMaps();player.frame.slideList=new SlideList;Frame.navLinks=this.parseNavLinks($(a).children().children("nav_data").children("outline"));this.ready=
!0};Frame.prototype.updateMenuData=function(a,b){if(Frame.navLinks){if(a)this.drawNavData=a;if(b)this.slideStatus=b;this.slideList?this.slideList.contentRef.empty():this.slideList=new SlideList;this.slideList.tree=new SlideListNode;this.slideList.build(Frame.navLinks,null,null,null,this.slideList.tree)}};
Frame.initControlMaps=function(){Frame.controlMap={previous:$("#control-previous"),next:$("#control-next"),finish:$("#control-finish"),submit:$("#control-submit"),submitall:$("#control-submitall"),volume:$("#control-volume"),seekbar:$("#control-progress,#progressbar"),replay:$(".icon.restart"),pauseplay:$("#control-pauseplay"),resources:$(".tab.resources"),glossary:$(".tab.glossary"),transcript:$(".tab.transcript"),outline:$(".tab.outline"),close_btn:$("#NOT_IMPLEMENTED-close_btn"),search:$("#TODO-resources")};
Frame.windowControlMap={previous:$(".window #control-previous"),next:$(".window #control-next"),finish:$(".window #control-finish"),submit:$(".window #control-submit"),submitall:$(".window #control-submitall"),close_btn:$(".window .closeicon")}};
Frame.prototype.parseNavLinks=function(a,b){var c=this,d=[];$(a).children("links").children().each(function(a,f){var g=f.tagName,h=$(f).attr("type");switch(g){case "slidelink":"action"==h?d.push(c.parseActionLink(f,b)):d.push(c.parseSlideLink(f,b));break;case "slidedrawref":d.push(c.parseSlideDraw(f))}});return d};
Frame.prototype.parseSlideLink=function(a,b){var c={slideid:$(a).attr("slideid"),displaytext:$(a).attr("displaytext"),expand:"true"==$(a).attr("expand"),parent:b};if(0<$(a).children("links").length)c.links=this.parseNavLinks(a,c);var d=story.parseObjref(c.slideid).target;d&&d.navLinks&&d.navLinks.push(c);return c};
Frame.prototype.parseActionLink=function(a,b){var c={actionlinkid:$(a).attr("slideid"),displaytext:$(a).attr("displaytext"),expand:!1,parent:b};if(0<$(a).children("links").length)c.links=this.parseNavLinks(a,c);var d=story.parseObjref(c.actionlinkid).target;story.children[c.actionlinkid]&&(d=story.children[c.actionlinkid]);d&&d.navLinks&&d.navLinks.push(c);return c};Frame.prototype.parseSlideDraw=function(a){return{drawid:$(a).attr("drawid")}};Frame.prototype.setVisibility=function(a,b){b||a.hide()};
Frame.prototype.parseOptionGroups=function(a){var b=this;$(a).children().children("control_options").children("optiongroups").children("optiongroup").each(function(a,d){var e=$(d).attr("name");b.parseOptions(d,e)});if(!b.options.title_enabled&&!b.options.sidebar_enabled&&!b.cant_hide_topbar)b.top_bar_hidden=!0;b.top_bar_hidden&&$(".top_bar").hide();a=$("#menu_tabs>.tab");0<=a.length&&a.first().click()};
Frame.prototype.parseOptions=function(a,b){var c=this;$(a).children("options").children().each(function(a,e){$(e).get(0);var f=$(e).attr("name"),g=$(e).attr("value"),h="true"==g;c.options[f]=g;if("true"==g||"false"==g)c.options[f]=h;switch(f){case "title_enabled":c.setVisibility($("#storytitle"),h);break;case "title_text":story.title=g;$("#storytitle_section").text(g);document.title=g;break;case "video_enabled":c.options.video_width=parseInt($(e).find("option[name='width']").attr("value"));c.options.video_height=
parseInt($(e).find("option[name='height']").attr("value"));break;case "logo_enabled":h&&($(".landscape_menu").removeClass("no_logo"),$(".logo_background").show());Frame.logoVisible=h;break;case "logo_url":c.logoRef=$("<img/>");if(0<$(e).find("property[name='width']").length){f=parseInt($(e).find("property[name='width']").attr("value"));parseInt($(e).find("property[name='height']").attr("value"));if(f>Frame.LOGO_WIDTH)f=Frame.LOGO_WIDTH;c.logoRef.css("width",f)}else c.logoRef.bind("load",function(){c.logoRef.width()>
Frame.LOGO_WIDTH?c.logoRef.css("width",Frame.LOGO_WIDTH):c.logoRef.css("width",c.logoRef.width());c.updateLayout()});$(e).attr("value")&&($(".logo_background>.logo_section").append(c.logoRef),$(".logo_background>.logo_section").append("<div class='menu_divider'/>"));c.logoSrc&&c.logoRef.attr("src",c.logoSrc);break;case "html5_logo_url":c.logoSrc=player.basepath+g;c.logoRef&&c.logoRef.attr("src",c.logoSrc);break;case "sidebar_enabled":player.forceMenu||(c.setVisibility($("#control-menu"),h),c.setVisibility($("#portrait_menu"),
h),c.setVisibility($(".landscape_menu"),h));break;case "sidebarpos":$(".landscape_menu").addClass(g);break;case "tabs":c.customTabCount=0;$(e).children("listitems").children("listitem").each(function(a,b){var d=$(b).attr("name"),e="true"==$(b).attr("value"),f=$(b).attr("group");if(e){var g=function(a,b,d,e){c.addTopTab(a,b,d,e,o)};"sidebar"==f&&(g=function(a,b,d,e){c.addSideTab(a,b,d,e,o)},c.sidebarItems[d]=e);e=c.getTextLabel(d);switch(d){case "outline":"qm"==c.outputtype&&(d="question_list",e=c.getTextLabel(d),
""==e&&(d="outline",e=c.getTextLabel(d)));g(f,e,$("#slide_list"),d);break;case "glossary":c.glossaryPanel=new GlossaryPanel;c.glossaryPanel.loadFromXML($(c.xml).find("glossary_data").first());g(f,e,c.glossaryPanel.ref,d);break;case "resources":c.resourcesPanel=new ResourcesPanel;c.resourcesPanel.loadFromXML($(c.xml).find("resource_data").first());g(f,e,c.resourcesPanel.ref,d);break;case "transcript":c.transcriptPanel=new TranscriptPanel;c.transcriptPanel.loadFromXML($(c.xml).find("transcript_data").first());
g(f,e,c.transcriptPanel.ref,d);break;case "customlink":var e=$(b).find("property[name='title']").attr("value"),h=$(b).find("property[name='data']").attr("value"),o="true"==$(b).find("property[name='ignoreSlideLock']").attr("value");c.customTabCount++;g(f,e,h,d,o)}}});break;case "info_enabled":$(e).children("options").children('option[name="default"]').each(function(a,b){var d=$(b).attr("value");c.options.info_enabled_default=d});h&&($(".landscape_menu").removeClass("no_logo"),$(".logo_background").show(),
c.updatePresenter(c.options.info_enabled_default));break;case "wraplistitems":h&&$(".framewrap").addClass("wraplistitems");break;case "seekbar":h?$(e).children("options").children('option[name="readonly"]').each(function(a,b){var d="true"==$(b).attr("value");c.readOnlySeekbar=d}):($(".player_controls").css("display","none!important"),$("#control-progress").css("display","none"));break;case "bottombar_enabled":if(c.setVisibility($(".bottom_bar"),h),c.setVisibility($("#controls"),h),h)c.shouldHaveBottomBar=
!0,c.hasBottomBar=!0}c.parseOptions(e,b)})};
Frame.prototype.addTopTab=function(a,b,c,d,e){var f=this;f.top_bar_hidden=!1;f.cant_hide_topbar=!0;if("customlink"==d)return f.addTopLink(a,b,c,d,e);var g=$('<div class="toptab tab '+d+'"><span class="label '+d+'">'+b+'</span><div class="menu_container"></div></div>');g.children(".menu_container").append(c);"linkright"==a?($("#toplinks_right").prepend(g),f.hasLinksRight=!0):($("#toplinks_left").append(g),f.hasLinksLeft=!0);this.formatTopTabs(a);a=player.isMobile?"touchend":"click";g.children("span").first().bind(a,
function(a){if(g.hasClass("active"))g.removeClass("active");else if(MouseEvents.processHideables(a),$("#topbar .active").removeClass("active"),g.addClass("active"),!f.registeredTopBar)MouseEvents.addHideable(".toptab.active",".toptab .menu_container, #frameswitch",function(){$(".toptab.active").removeClass("active")}),f.registeredTopBar=!0;return!1})};
Frame.prototype.addSideTab=function(a,b,c,d){a=$('<li class="tab '+d+'"><span class="left label '+d+'">'+b+"</span></li>");$("#menu_tabs").append(a);$("#menu_container").append(c);var e=a.children("span").first();a.bind("click",function(){$("#topbar .active").removeClass("active");$("#menu_tabs .active").removeClass("active");$("#menu_container .active").removeClass("active");e.addClass("active");c.addClass("active");return!1})};
Frame.prototype.formatTopTabs=function(a){a="linkright"==a?"#toplinks_right":"#toplinks_left";this.colorGroups.base&&($(".toptab-separator").remove(),$(a).children(":visible").each(function(a,c){0!=a&&$(c).parent().append($("<div class='toptab-separator'></div>"),$(c))}))};
Frame.prototype.addTopLink=function(a,b,c,d,e){var f=$('<div class="toptab customlink"><span class="label '+d+'">'+b+"</span></div>");"linkright"==a?($("#toplinks_right").prepend(f),this.hasLinksRight=!0):($("#toplinks_left").append(f),this.hasLinksLeft=!0);this.formatTopTabs(a);e&&f.addClass("ignorelocked");f.children("span").first().bind("click",function(){(!f.hasClass("locked")||e)&&story.handleEvent("onobjectevent",c,null,!1,!1,!0);return!1})};
Frame.prototype.parseColorSchemes=function(a){var b=this;$(a).children().children("colorschemes").children("colorscheme").children("color_group").each(function(a,d){var e=$(d).attr("name");b.parseColorGroup(d,e)})};Frame.prototype.parseColorGroup=function(a,b){var c={};$(a).children("group_colors").children("color").each(function(a,b){var f=$(b).attr("name"),g=new Background;g.loadFromXML($(b),"fill");c[f]=g});this.colorGroups[b]=c};
Frame.prototype.applyRTL=function(){if(this.rtl){$(document.body).addClass("rtl");var a=$('<div id="control-previous" class="controlbar-button right"><div class="label prev">PREV</div><a class="icon next-slide"></a></div>'),b=$('<div id="control-next" class="controlbar-button right"><a class="icon previous-slide"></a><div class="label next">NEXT</div></div>');$("#control-previous").remove();$("#control-next").remove();a.insertBefore($("#control-submitall"));b.insertBefore($("#control-submitall"));
Frame.initControlMaps()}};
Frame.prototype.applyColorSchemes=function(){if(!player.noframe&&!player.noframecolor&&($.each(story.children,function(a,b){"Window"==b.innerType&&-1==b.linkid.indexOf("StoryPopup")&&b.ref&&player.frame.colorGroups.window&&player.frame.colorGroups.window.bg&&setTimeout(function(){try{b.ref.css("background-color",player.frame.colorGroups.window.bg.toCssString()),b.ref.css("color",player.frame.colorGroups.window.text.toCssString()),b.ref.find("h1").css("color",player.frame.colorGroups.window.text.toCssString()),b.ref.css("border-color",
player.frame.colorGroups.window.divb.toCssString()),b.ref.find("hr").css("border-color",player.frame.colorGroups.window.divb.toCssString())}catch(a){}},0)}),player.isHTML5)){var a=new CustomStyleSheet,b=function(b,c,d){if(player.frame.colorGroups[b]&&player.frame.colorGroups[b][c]){var e=player.frame.colorGroups[b][c].toCssString(),b=player.frame.colorGroups[b][c].toColorString();a.add(d,"background-color",b);a.add(d,"background",e);a.add(d,"background",e.replace("-webkit","-moz"));a.add(d,"background",
e.replace("-webkit","-ms"))}},c=function(b,c,d){if(player.frame.colorGroups[b]&&player.frame.colorGroups[b][c])switch(b=player.frame.colorGroups[b][c],b.backgroundType){case "fill":a.add(d,"border-color",b.stops[0].color)}},d=function(b,c,d,e,f,k){if(player.frame.colorGroups[b]&&player.frame.colorGroups[b][c])switch(b=player.frame.colorGroups[b][c],b.backgroundType){case "fill":b=b.toColorString(),k&&(b=k+b),f&&(b+=f),a.add(d,e,b)}};b("base","bg","#slidebg");b("base","slide_bg",".framewrap,.bg");
b("base","slide_bg",".window.LightboxControlsWnd");b("base","menu_shade",".landscape_menu");c("base","border",".framewrap");c("base","border",".landscape_menu");d("base","text","a,body","color");d("base","diva",".toptab-separator","border-left-color");d("base","divb",".toptab-separator","border-right-color");b("button","btn_bg",".controlbar-button");c("button","btn_border",".controlbar-button");d("button","btn_glow",".controlbar-button","box-shadow"," 0px 0px 1px 1px");player.isMobile||(b("button",
"btn_hover",".controlbar-button:hover"),b("button","btn_bg",".controlbar-button.volume-open:hover"));b("button","btn_down",".controlbar-button.right.pressed");b("seekcontrol","seek_bg","#progressbar");this.seekColor=player.frame.colorGroups.seekcontrol.seek_position.toColorString();c("seekcontrol","seek_border","#progressbar,.progress-bar");b("seekcontrol","bg","#control-progress");c("seekcontrol","border","#control-progress");b("volume","thumb_bg",".volume-handle");b("volume","slider_bg",".volume-slider");
c("volume","thumb_border",".volume-handle");c("volume","slider_border",".volume-slider");d("volume","thumb_inner",".volume-handle","-webkit-box-shadow"," 0px 0px 1px 1px","inset ");d("volume","thumb_inner",".volume-handle","-moz-box-shadow"," 0px 0px 1px 1px","inset ");d("volume","thumb_inner",".volume-handle","-ms-box-shadow"," 0px 0px 1px 1px","inset ");d("volume","thumb_inner",".volume-handle","box-shadow"," 0px 0px 1px 1px","inset ");b("menu","bg",".menu_container");d("listitem","text","ul.menu_list a",
"color");d("listitem","text","ul.slidelist li","color");d("listitem","text",".menu_container li a","color");d("listitem","viewed","ul.menu_list li.visited > a","color");d("listitem","viewed","ul.slidelist li.visited","color");player.isMobile||(b("listitem","hover","li.has_children.open li>a:hover"),b("listitem","hover","ul.slidelist li:hover"),d("listitem","text","ul.menu_list li.visited > a:hover","color"),d("listitem","text","ul.slidelist li.visited:hover","color"),b("listitem","selected","ul.menu_list li.selected, ul.menu_list li.selected > a, ul.menu_list li.selected > a:hover"),
b("listitem","selected","ul.slidelist li.selected, ul.slidelist li.selected > a:hover"));d("listitem","lines","ul.menu_list>li","border-top-color");d("listitem","lines","ul.slidelist li.divider","border-bottom-color");d("listitem","selected_text","ul.menu_list li.selected > a","color");d("listitem","selected_text","ul.slidelist li.selected","color");d("listitem","text","ul.menu_list li.has_children > span","border-left-color");d("listitem","text","ul.menu_list li.has_children.open > span","border-top-color");
d("listitem","text","ul.slidelist li>span","border-left-color");d("listitem","text","ul.slidelist li.open>span","border-top-color");b("menu","bg","ul.menu_nav li span.active, .toptab.active>span");d("tabs","text","ul.menu_nav li span","color");d("tabs","selected","ul.menu_nav li span.active, .toptab.active>span","color");c("window","divb",".toptab.active>span,.toptab .menu_container");d("window","divb",".logo_background .menu_divider","border-bottom-color");c("resource","separator",".resources_container hr");
c("transcript","div",".transcript_container hr");d("transcript","heading_text",".transcript_title","color");d("menu","shadow",".toptab .menu_container","-webkit-box-shadow"," 0px 0px 20px");d("menu","shadow",".toptab .menu_container","-moz-box-shadow"," 0px 0px 20px");d("menu","shadow",".toptab .menu_container","-ms-box-shadow"," 0px 0px 20px");d("menu","shadow",".toptab .menu_container","box-shadow"," 0px 0px 20px");b("glossary","bg",".glossary_section");b("tabs","bg",".glossary_section_header");
player.isMobile||b("glossary","hover",".glossary_section li:hover");b("glossary","selected",".glossary_section li.active");d("glossary","selected",".glossary_section li.active","color");d("glossary","diva",".glossary_section_header, .glossary_section:first-child","border-bottom-color");d("glossary","divc",".glossary_section_header","border-top-color");d("glossary","text",".glossary_container li a","color");d("glossary","heading_text",".glossary_section .label","color");d("glossary","selected_text",
".glossary_section li.active a","color");b("glossary","selected",".glossary_section li.active");b("logo","bg",".logo_background>.logo_section");b("infopanel","bg",".logo_background>.presenter_section");b("infopanel","bg",".logo_background>.presenter_video_section");d("logo","shadow",".logo_background","box-shadow"," 0px 1px 0px 0px","");d("infopanel","name_text",".presenter_info .presenter_name","color");d("infopanel","title_text",".presenter_info .presenter_title","color");d("infopanel","link_text",
".presenter_info a","color");d("infopanel","link_hover",".presenter_info a:hover","color");b("infopanelpopup","bg",".presenter_detail");d("infopanelpopup","name_text",".presenter_detail .presenter_name","color");d("infopanelpopup","title_text",".presenter_detail .presenter_title","color");d("infopanelpopup","link_text",".presenter_detail a","color");d("infopanelpopup","link_hover",".presenter_detail a:hover","color");if(player.frame.colorGroups.button&&player.frame.colorGroups.button.btn_icon_color){var b=
player.frame.colorGroups.button.btn_text_shadow.stops[0],c=player.frame.colorGroups.seekcontrol.btn_icon_color.stops[0],e=player.frame.colorGroups.seekcontrol.btn_icon_shadow.stops[0],f=player.frame.colorGroups.seekcontrol.btn_icon_hover.stops[0];this.prepIconSprite(".controlbar-button .icon",player.frame.colorGroups.button.btn_icon_color.stops[0],b,a);this.prepIconSprite("#control-progress .icon",c,e,a);player.isMobile||this.prepIconSprite("#control-progress .icon:hover",f,b,a);d("button","btn_icon_color",
".controlbar-button .label","color");d("button","btn_text_shadow",".controlbar-button .label","text-shadow","","0px 1px 1px ")}a.add(".zoombuttoninner","background-image","url("+Frame.iconSrc+")");a.add("ul.slidelist li.correct:before","background-image","url("+Frame.iconSrc+")");a.add("ul.slidelist li.incorrect:before","background-image","url("+Frame.iconSrc+")");a.build()}};
Frame.prototype.applyColorDirect=function(a,b,c,d,e,f){if(player.frame.colorGroups[a]&&player.frame.colorGroups[a][b])switch(a=player.frame.colorGroups[a][b],a.backgroundType){case "fill":a=a.toColorString(),f&&(a=f+a),e&&(a+=e),$(c).css(d,a)}};
Frame.prototype.applyBackgroundDirect=function(a,b,c){if(player.frame.colorGroups&&player.frame.colorGroups[a]&&player.frame.colorGroups[a][b]){var d=player.frame.colorGroups[a][b].toCssString(),a=player.frame.colorGroups[a][b].toColorString();$(c).css("background-color",a);$(c).css("background",d)}};Frame.parseRGB=function(a){a=a.replace("#","");return[parseInt(a.substr(0,2),16),parseInt(a.substr(2,2),16),parseInt(a.substr(4,2),16)]};
Frame.prototype.prepIconSprite=function(a,b,c,d){var e=Frame.parseRGB(b.rawcolor),f=Frame.parseRGB(c.rawcolor);e.push(b.alpha);f.push(c.alpha);var g=new Image;$(g).bind("load",function(){var b=document.createElement("canvas");b.width=246;b.height=16;var c=b.getContext("2d");c.drawImage(g,0,0);if(c.getImageData){for(var l=c.getImageData(0,0,b.width,b.height),m=0;m<l.data.length-4;m+=4){var k=l.data[m];0!=l.data[m+3]&&(l.data[m]=e[0],l.data[m+1]=e[1],l.data[m+2]=e[2],l.data[m+3]=255-k)}c.clearRect(l,
0,0,b.width,b.height);c.putImageData(l,0,0);c.shadowColor="rgba("+f[0]+","+f[1]+","+f[2]+","+f[3]+")";c.shadowOffsetX=0;c.shadowOffsetY=1;c.shadowBlur=1;c.clearRect(l,0,0,b.width,b.height);c.drawImage(b,0,0);b=b.toDataURL("image/png");d&&d.add(a,"background-image","url("+b+")");d.build()}else d&&d.add(a,"background-image","url("+Frame.iconSrc+")")});g.src=Frame.iconSrc};
Frame.prototype.set_window_control_layout=function(a){Frame.initControlMaps();player.currentWindow?this.set_frame_layout(a,Frame.windowControlMap):this.set_frame_layout(a)};
Frame.prototype.set_frame_layout=function(a,b){var c=void 0!=b,b=b||Frame.controlMap,d=!0,e=$(".contentpane>#controls");player.currentWindow&&player.currentWindow.ref&&(e=player.currentWindow.ref.find("#controls"));c&&player.currentWindow&&!player.currentWindow.progressBar&&(e=$("<div/>"),d=!1);var f=this,g=$(a).attr("name");f.currentLayoutName=g;var h=f.control_layouts[g];if(!h)h=f.control_layouts[f.defaultLayoutName],f.currentLayoutName=f.defaultLayoutName;if(!h)h=f.defaultControlLayout;if(h){f.updateTextLabels();
var j=0,l=!1,m=!1,k=!1,g=this.shouldHaveBottomBar;if(this.options.forceseekbar)h.controls.seekbar=!0,h.controls.pauseplay=!0,h.controls.replay=!0;if(!c)f.visibleSidebarItems={};$.each(h.controls,function(a,d){var e=b[a];if(e)d?(e.show(),("previous"==a||"next"==a||"submit"==a||"submitall"==a||"finish"==a)&&j++,"volume"==a&&(l=!0),"seekbar"==a&&(m=!0),"pauseplay"==a&&(k=!0)):e.hide();else if("logo"==a)Frame.logoVisible=player.frame.options.logo_enabled&&d;d&&f.sidebarItems[a]&&!c&&(f.visibleSidebarItems[a]=
!0)});1!=player.width&&(this.updateLayout(!0),player.isMobile&&this.reorient(!0));if(d){$("#controls .disabled").removeClass("disabled");var n=17+7*j;$.each(["#control-previous","#control-next","#control-submit","#control-submitall","#control-finish"],function(a,b){var c=$(b);"block"==c.css("display")&&(n+=c.get(0).offsetWidth)});l&&(n+=40);d=this.availableWidth-n;e.find("#control-progress").css("width",d);this.progressWidthOuter=d;this.resizeProgressBar();!m&&k?(e.find("#progressbar,.icon.restart").hide(),
e.find("#control-progress,#control-pauseplay").show(),e.find("#control-progress").css("width",16),e.find("#control-progress").addClass("compact")):e.find("#control-progress").removeClass("compact");m?$("#control-volume").css("margin-right","7px"):$("#control-volume").css("margin-right",0);this.layoutMenuTabs();!l&&!m&&0==j&&(g=!1);this.hasBottomBar=g;this.updateLayout();0==$("#menu_tabs>.tab:visible>.active").length&&$("#menu_tabs>.tab:visible").first().click();this.formatTopTabs("linkleft");this.formatTopTabs("linkright")}}};
Frame.prototype.layoutMenuTabs=function(a){var a=a||7,b=$(".landscape_menu #menu_tabs>li>span:visible"),c=b.length;if(2<c){var d=Frame.NAV_WIDTH,e=0,f=[],g=0,h=0,j;$("ul.menu_nav li span").css("padding","0px "+a+"px");for(e=0;e<c;e++){j=b.eq(e);j.css("width","initial");var l=$("<div />").css({margin:0,padding:0});j.append(l);g=l.width();l.remove();f.push({tab:j,width:g});h+=g}d-=2*c*a;b=d-h;d/=c;if(0>b&&2<a)this.layoutMenuTabs(a-1);else{f.sort(function(a,b){return a.width>b.width?1:a.width<b.width?
-1:0});for(e=0;e<c;e++)j=f[e].tab,g=f[e].width,0<b?g+=2>=c?a:b/c:g<d?d+=(d-g)/(c-(e+1)):g=d,j.css("width",g)}}};Frame.prototype.resizeProgressBar=function(){var a=ProgressBar.getCurrentProgressBar();if(a){var b=a.ref.parent(),a=b.children(),b=b.parent().find("#control-progress .progress-container");this.progressWidth=this.progressWidthOuter-11;for(var c=0;c<a.length;c++)a[c]!=b[0]&&(this.progressWidth-=a[c].offsetWidth);b.css("width",this.progressWidth)}};
Frame.prototype.isSidebarVisible=function(){for(key in this.visibleSidebarItems)return!0;return!1};Frame.prototype.initOrientation=function(){this.updateLayout()};Frame.prototype.reorient=function(a){1!=player.width&&this.updateLayout(a)};Frame.prototype.updateLayout=function(){this.updateFrameLayout();this.updatePlayerLayout();this.updateSidebarLayout();this.resizeProgressBar()};
Frame.prototype.updateSidebarLayout=function(){var a=$(".logo_background").height(),a=$(".logo_background").is(":visible")?a+8:0;navListHeight=this.navListHeight-a;$(".landscape_menu .menu_container").css("height",navListHeight+"px")};
Frame.prototype.updatePlayerLayout=function(){Frame.resizeSpinners();if(!player.noframe){var a=this.availableSlideWidth,b=0;player.frame.top_bar_hidden?$("#topbar").addClass("empty"):this.options.title_enabled?($("#storytitle").removeClass("alone"),$(".toptab").removeClass("alone"),$(".toptab").removeClass("notitle"),$("#topbar").removeClass("empty"),!(0<$("#topbar>#toplinks_left .toptab:visible").length)&&this.hasLinksRight&&($("#storytitle").addClass("alone"),$(".toptab").addClass("alone")),b+=
20):($("#storytitle").removeClass("alone"),$(".toptab").removeClass("alone"),$("#topbar").removeClass("empty"),$(".toptab").addClass("notitle"),0==$("#topbar .toptab:visible").length&&$("#topbar").addClass("empty"));if(this.hasLinksLeft||this.hasLinksRight)b+=20;var c=this.options.logo_enabled&&Frame.logoVisible||Frame.presenterVisible,d=player.frame.options.sidebar_enabled&&this.isSidebarVisible(),e=player.frame.bottom_bar_hidden||!player.frame.hasBottomBar?-9:41,f=d||c?240:0,g="left"==player.frame.options.sidebarpos?
f:0,h=this.containerWidth,j=this.containerHeight;this.bottomBarOffset=e;h=h-f-20+2;e=j-b-e-20-7;this.availableWidth=h;this.availableHeight=e;this.availableSlideWidth=h;this.availableSlideHeight=e;var l="left"==player.frame.options.sidebarpos?0:h+20,f="left"==player.frame.options.sidebarpos?f+10:10,f=f-1;$(".landscape_menu").css("left",l);$(".contentpane>#controls").css("left",f);$(".contentpane>#controls").css("width",h);$("#topbar").css("left",f);$("#topbar").css("width",h);$(".toptab .menu_container").css("height",
parseInt(0.8*e));f=10;l=g+10-1;j=j-20+2;this.updateInfoPanel(this.updatePresenter());this.navListHeight=j-25;var m=(e-player.height)/2;if(0<m)f=Math.floor(m+10),this.availableSlideHeight=e-2*m;e=(h-player.width)/2;if(0<e)l=e+g+10,this.availableSlideWidth=h-2*e;if(player.isIE&&!player.hasCompensatedIESize)player.width-=2,player.hasCompensatedIESize=!0;b="#slideframe{margin-left:"+l+"px!important;margin-top:"+f+"px!important;top:"+b+"px!important;}#slideframe, .slide{width:"+player.width+"px;height:"+
player.height+"px;}.landscape_menu{height: "+j+"px;}.landscape_menu{display: "+(d||c?"block":"none")+";}.landscape_menu>#menu_tabs,.landscape_menu>#menu_container{display: "+(d?"block":"none")+";}.interstitial{height:"+window.innerHeight+"px;}";player.frame.options.seekbar||(b+=".player_controls{display:none!important;}");if(!player.rotateLandscapeStyleSheet)player.rotateLandscapeStyleSheet=document.createElement("style"),document.body.appendChild(player.rotateLandscapeStyleSheet);player.rotateLandscapeStyleSheet.innerHTML=
b;player.landscapeScale=1;player.zoom=1;(d||c)&&$(".landscape_menu").css("display","");a!=this.availableSlideWidth&&player.currentSlide()&&player.currentSlide().ref&&player.currentSlide().fitToContainer()}};
Frame.prototype.updateFrameLayout=function(){if(!player.isMobile||player.hasNavOutsideFrame){var a=Frame.getWindowSize(!1),b=a.width,c=a.height,d=story.frameWidth-2,e=story.frameHeight-2,a=1;if(player.scaleToFit){a=story.frameWidth/story.frameHeight>b/c?b/story.frameWidth:c/story.frameHeight;$("document.body").css("overflow","hidden");if(a!=player.frameScale&&1!=a)player.frameScale=a,$.each(story.children,function(a,b){"Window"==b.innerType&&b.resize()});if(player.isMobile){var f=Frame.getWindowSize(!1),
f=0.5*Math.min(f.width,f.height),g=$("div.launch_interstitial>a");g.css("width",f+"px");g.css("height",f+"px");g.css("margin-left",-parseInt(f/2)+"px");g.css("margin-top",-parseInt(f/2)+"px")}}f=parseInt((c-e*a)/2-1);g=parseInt((b-d*a)/2-1);player.scaleWithTransform||(f=parseInt((c-e*a)/2/a-1),g=parseInt((b-d*a)/2/a-1));player.isIE&&(g-=0,f+=1,d-=1,e-=1);0>f&&(f=0);0>g&&(g=0);this.containerWidth=d;this.containerHeight=e;this.containerLeft=g;this.containerTop=f;this.aspectRatio=d/e;$(".framewrap").css("width",
d);$(".framewrap").css("height",e);$(".framewrap").css("top",f);$(".framewrap").css("left",g);b="";b=player.scaleWithTransform?".framewrap{-webkit-transform-origin:top left;-webkit-transform:translate3d(0px,0px,0px) scale("+a+");-moz-transform-origin:top left;-moz-transform:translate3d(0px,0px,0px) scale("+a+");-ms-transform-origin:top left;-ms-transform:translate(0px,0px) scale("+a+");}":".framewrap{zoom:"+a+";-webkit-transform-origin:top left;-webkit-transform:translate3d(0px,0px,0px);-moz-transform-origin:top left;-moz-transform:translate3d(0px,0px,0px)-ms-transform-origin:top left;-ms-transform:translate(0px,0px)}";
if(!player.frameLandscapeStyleSheet)player.frameLandscapeStyleSheet=document.createElement("style"),document.body.appendChild(player.frameLandscapeStyleSheet);player.frameLandscapeStyleSheet.innerHTML=b;player.frameScale=a;var h=0;$(".toptab").each(function(a,b){$(b).hasClass("customlink")||(h+=$(b).width())});b=Math.floor((this.availableSlideWidth-h)/this.customTabCount);$(".toptab.customlink").css("max-width",b+"px")}};
Frame.prototype.getTextLabel=function(a){return $(this.xml).find("string_table").first().children("string[id='"+a+"']").text()};
Frame.prototype.updateTextLabels=function(){$(this.xml).find("string_table").first().children("string").each(function(a,b){var c=$(b).attr("id"),d=$(b).text(),b=$(".label."+c);0<b.length&&(b.text(d),b.parent().hasClass("controlbar-button")&&(c=player.isMobile?0.88:0.82,player.isFF&&(c=1),c=b.get(0).offsetWidth*(1-c),0!=c&&!b.get(0).previousSibling&&"relative"!=b.css("position")&&(b.css("position","relative"),b.css("left",c))))})};
Frame.prototype.updatePresenter=function(a){var b=Frame.presenterVisible;Presenter.clearPresenters();if(!a)a=player.currentSlide().presenterref;player.frame.applyBackgroundDirect("logo","bg",".logo_background>.logo_section");player.frame.applyColorDirect("logo","shadow",".logo_background","box-shadow"," 0px 1px 0px 0px","");player.frame.applyBackgroundDirect("infopanel","bg",".logo_background>.presenter_section");player.frame.applyBackgroundDirect("infopanel","bg",".logo_background>.presenter_video_section");
Frame.presenterTextVisible=!1;Frame.presenterVideoVisible=!1;if(player.currentSlide().presenterVideoUrl)return-1<player.currentSlide().presenterVideoUrl.indexOf(".swf")?(Frame.presenterVideoVisible=!1,null):this.updatePresenterVideo(player.currentSlide().presenterVideoUrl,a);var c=null;if(a&&"none"!=a){$(".landscape_menu").removeClass("no_logo");$(".logo_background").show();if(c=player.presenters[a])c.show(),player.currentSlide().presenter=c,Frame.presenterVisible=!0,Frame.presenterTextVisible=!0;
else if(!this.options.logo_enabled||!Frame.logoVisible)$(".landscape_menu").addClass("no_logo"),$(".logo_background").hide();if(!this.options.logo_enabled||!Frame.logoVisible)player.frame.applyBackgroundDirect("infopanel","bg",".logo_background>.logo_section"),player.frame.applyColorDirect("infopanel","shadow",".logo_background","box-shadow"," 0px 1px 0px 0px","")}else!this.options.logo_enabled||!Frame.logoVisible?($(".landscape_menu").addClass("no_logo"),$(".logo_background").hide()):($(".landscape_menu").removeClass("no_logo"),
$(".logo_background").show(),player.frame.applyBackgroundDirect&&(player.frame.applyBackgroundDirect("logo","bg",".logo_background>.logo_section"),player.frame.applyBackgroundDirect("logo","bg",".logo_background>.presenter_section"),player.frame.applyBackgroundDirect("logo","bg",".logo_background>.presenter_video_section"),player.frame.applyColorDirect("logo","shadow",".logo_background","box-shadow"," 0px 1px 0px 0px",""))),Frame.presenterVisible=!1;b!=Frame.presenterVisible&&setTimeout(function(){player.frame.updatePlayerLayout()},
0);return c};
Frame.prototype.updatePresenterVideo=function(a,b){$(".landscape_menu").removeClass("no_logo");$(".logo_background").show();var c=player.presenters[a];if(!c)b&&"none"!=b?(c=player.presenters[b].copy(),c.hasText=!0):(c=new Presenter,c.hasText=!1),c.createVideoRef(a,player.currentSlide().presenterVideoWidth,player.currentSlide().presenterVideoHeight,player.currentSlide()),player.presenters[a]=c;Frame.presenterTextVisible=c.hasText;c.show();player.currentSlide().presenter=c;Frame.presenterVisible=!0;
Frame.presenterVideoVisible=!0;if(!this.options.logo_enabled||!Frame.logoVisible)player.frame.applyBackgroundDirect("infopanel","bg",".logo_background>.logo_section"),player.frame.applyColorDirect("infopanel","shadow",".logo_background","box-shadow"," 0px 1px 0px 0px","");return c};
Frame.prototype.updateInfoPanel=function(a){var b=Frame.logoVisible&&this.options.logo_enabled;$(".logo_section").show();$(".presenter_section").show();Frame.presenterVideoVisible&&a&&($(".presenter_video_section").removeClass("roundbottom, roundtop"),b||($(".logo_section").hide(),$(".presenter_video_section").addClass("roundtop")),Frame.presenterTextVisible||($(".presenter_section").hide(),$(".presenter_video_section").addClass("roundbottom")),a.setMask(!b&&!a.narrowVideo,!Frame.presenterTextVisible&&
!a.narrowVideo))};
Frame.prototype.tickPresentationTimer=function(){var a=player.timelineManager.getActiveTimelineSlide();if(a&&!(!this.options.time_enabled&&!this.options.elapsedandtotaltime||-1==a.starttime)){var b=this.options.time_format;this.options.elapsedandtotaltime&&"none"==this.options.time_format&&(b="totalelapsed");if(!this.presentationTimer)this.presentationTimer=$('<span class="presentation_timer"></span>'),$("#timer_section").append(this.presentationTimer);$("#storytitle").show();var c=a.starttime+a.timeline.getCurrentTime();
if("pause"==a.elapsedtimemode)c=a.starttime;(a=Timer.Format(c,story.lessonduration,b,this.rtl))&&(a="("+a+")");this.presentationTimer.text(a)}};
Frame.prototype.debugTopNav=function(){var a=this;this.topNavSelector=$("<div class='topnavselector'></div>");$(document.body).append(this.topNavSelector);var b=function(b){var d=$("<input id='box_"+b+"' type='checkbox'><label for='box_"+b+"'>"+b+"</label>");d.first()[0].checked=player.frame[b];d.click(function(){var a=d.first()[0].checked;player.frame[b]=a;player.frame.updateLayout()});a.topNavSelector.append(d)};b("top_bar_hidden");b("hasLinksLeft");b("hasLinksRight");$("#topbar").css("background-color",
"aqua");$("#toplinks_right").css("background-color","yellow");$("#toplinks_left").css("background-color","orange");$("#topbar > #storytitle").css("background-color","lime")};Frame.prototype.setControlEnabled=function(a,b){b?Frame.controlMap[a].removeClass("disabled"):Frame.controlMap[a].addClass("disabled")};Frame.prototype.setWindowControlEnabled=function(a,b){b?Frame.windowControlMap[a].removeClass("disabled"):Frame.windowControlMap[a].addClass("disabled")};
Frame.prototype.setControlVisible=function(a,b){b?Frame.controlMap[a].show():Frame.controlMap[a].hide()};Frame.prototype.setWindowControlVisible=function(a,b){b?Frame.windowControlMap[a].show():Frame.windowControlMap[a].hide()};
Frame.findCurrentFrame=function(){var a=null;if(self!=top&&!player.isCrossDomainFrame)try{$.each(top.document.getElementsByTagName("iframe"),function(b,d){d.contentWindow==self&&(a=d)}),$.each(top.document.getElementsByTagName("frame"),function(b,d){d.contentWindow==self&&(a=d)})}catch(b){}return a};
Frame.prototype.followSlideLink=function(a,b){var c=story.parseObjref(a).target;if(c&&(b!=Frame.FLOW_RESTRICTED||c.variables.Visited))TimelineAction.actparams._ActTargetWindow="_frame",player.showSlideID(a,!0)};
Frame.prototype.followActionLink=function(a,b){if(!(b==Frame.FLOW_RESTRICTED&&void 0===story.m_listViewedActionLinks[a])){TimelineAction.actparams._ActTargetWindow="_frame";var c=story.parseObjref(a).target;story.children[a]&&(c=story.children[a]);c&&c.navLinks&&c.runActions();story.m_listViewedActionLinks[a]=story.actionLinkIndices[a]}};
Frame.prototype.setSlide=function(a,b){var c=a.slideid;if(b!=Frame.WINDOW_FRAME)(c=this.windows[b])&&c.titleRef&&c.titleRef.html(a.title);else{$("ul.menu_list li").removeClass("selected locked");$("ul.slidelist li").removeClass("selected locked");$(".controlbar-button.right,.control-submitall").removeClass("locked");$(".toptab.customlink").removeClass("locked");$(".progress-container").removeClass("locked");var d=this.slideList.markSelectedVisited(c);if(this.selectedNode!=d)this.slideList.collapseSections(c,
d,this.selectedNode),this.selectedNode=d;a.slidelock&&($("ul.menu_list li").addClass("locked"),$("ul.slidelist li").addClass("locked"),$(".controlbar-button.right,.control-submitall").addClass("locked"),$(".toptab.customlink").addClass("locked"),$(".progress-container").addClass("locked"));this.slideList.scrollSelectedIntoView();player.frame.transcriptPanel&&((c=player.frame.transcriptPanel.transcripts[a.transcriptid])?c.show(a.title):player.frame.transcriptPanel.showTitleOnly(a.title));this.currentSlideHasSimpleNavigation=
a.simplenavigation}};function ResourcesPanel(){}ResourcesPanel.prototype.loadFromXML=function(a){var b=this;this.xml=a;this.description=$(a).attr("description");this.resources=[];$(a).children("resources").children("resource").each(function(a,d){var e={};e.url=$(d).attr("url");e.image=player.basepath+$(d).attr("image");e.title=$(d).attr("title");b.resources.push(e)});this.createRef()};
ResourcesPanel.prototype.createRef=function(){if(this.ref)return!1;var a=$("<div class='resources_container'></div>");a.append($("<div class='resources_description'>"+this.description+"</div>"));a.append($("<hr/>"));var b=$("<ul></ul>");$.each(this.resources,function(a,d){var e=$("<li><a href='"+d.url+"' target='_blank'><img src='"+d.image+"' class='resources_icon'/>"+d.title+"</a></li>");b.append(e)});a.append(b);this.ref=a;return!0};function GlossaryPanel(){}GlossaryPanel.prototype.loadFromXML=function(a){var b=this;this.xml=a;this.terms=[];$(a).children("terms").children("term").each(function(a,d){var e={};e.title=$(d).attr("title");e.definition=$(d).text();b.terms.push(e)});this.createRef()};
GlossaryPanel.prototype.createRef=function(){if(this.ref)return!1;var a=$("<div class='glossary_container'></div>"),b=$("<div id='glossaryscroll' class='glossary_section scrollarea'></div>");b.append($("<div class='glossary_section_header label terms'>Terms</div>"));var c=$("<ul></ul>");$.each(this.terms,function(a,b){var f=$("<li><a href='javascript:void(null);' >"+b.title+"</a></li>");f.click(function(){$(".definitiontext").hide();$(".glossary_container .active").removeClass("active");b.defref&&
(f.addClass("active"),b.defref.show())});c.append(f)});b.append(c);a.append(b);b=$("<div class='glossary_section'></div>");b.append($("<div class='glossary_section_header label definition'>Definition</div>"));$.each(this.terms,function(a,c){var f=$("<div class='definitiontext'>"+c.definition+"</div>");c.defref=f;b.append(f)});a.append(b);this.ref=a;return!0};function TranscriptPanel(){}
TranscriptPanel.prototype.loadFromXML=function(a){var b=this;this.xml=a;this.transcripts={};$(a).children("slidetranscripts").children("slidetranscript").each(function(a,d){var e={};e.slideid=$(d).attr("slideid");e.notespng=$(d).attr("notespng");e.slidebank="true"==$(d).attr("slidebank");e.content=$(d).text();b.transcripts[e.slideid]=e;var f=story.parseObjref(e.slideid).target;f.transcript=e;e.show=function(){b.titleref.html(f.title);$(".transcript_content").hide();e.contentref&&e.contentref.show()}});
this.createRef()};TranscriptPanel.prototype.createRef=function(){if(this.ref)return!1;var a=$("<div class='transcript_container'></div>");this.titleref=$("<div class='transcript_title'></div>");a.append(this.titleref);$.each(this.transcripts,function(b,c){var d=c.content;c.notespng&&(d="<img src='"+(player.basepath+c.notespng)+"'>");d=$("<div class='transcript_content'><hr/>"+d+"</div>");c.contentref=d;a.append(d)});this.ref=a;return!0};
TranscriptPanel.prototype.showTitleOnly=function(a){this.titleref.html(a);$(".transcript_content").hide();if(!this.emptyContentRef)this.emptyContentRef=$("<div class='transcript_content'><hr/></div>"),this.ref.append(this.emptyContentRef);this.emptyContentRef.show()};function Presenter(){this.isVideo=!1}Presenter.prototype.loadFromXML=function(a){this.xml=a;this.id=$(a).attr("id");this.photoSwf=$(a).attr("photo");this.mobilephoto=$(a).attr("mobilephoto");this.name=$(a).attr("name");this.title=$(a).attr("title");this.email=$(a).attr("email");this.bioHtml=$(a).children("bioHtml").text();this.photoImageSrc=this.mobilephoto;this.createRef()};Presenter.HEIGHT_RATIO=0.76;Presenter.prototype.copy=function(){var a=new Presenter;a.loadFromXML(this.xml);return a};
Presenter.prototype.createRef=function(){if(this.ref)return!1;var a=$("<div class='presenter_info'><div class='imgwrap'><img></div><span class='presenter_name'/><span class='presenter_title'/><a class='presenter_link'/></div>");this.ref=a;a=a.find("img");this.photoImageSrc?a.attr("src",player.basepath+this.photoImageSrc):a.remove();this.setPresenterInfo();return!0};
Presenter.prototype.createVideoRef=function(a,b,c,d){this.videoUrl=player.basepath+a;this.videoUniqueKey=Video.getStoreReference(d,this.videoUrl);var a=$("<div class='presenter_info video'><span class='presenter_name'/><span class='presenter_title'/><a class='presenter_link'/></div>"),d=$("<video/>"),e=Frame.NAV_WIDTH,f=Math.round(c*Frame.NAV_WIDTH/b),g=Math.round(Frame.NAV_WIDTH*Presenter.HEIGHT_RATIO);f>g&&(f=g,e=Math.round(b*g/c));if(e>Frame.NAV_WIDTH)e=Frame.NAV_WIDTH,f=Math.round(c*e/b);this.narrowVideo=
e<Frame.NAV_WIDTH;this.width=e;this.height=f;this.video=d;d.attr("width",e);d.attr("height",f);d.attr("src",this.videoUrl);this.ref=a;this.setPresenterInfo();this.isVideo=!0};Presenter.prototype.setMask=function(a,b){var c=Presenter.getVideoMaskUrl(this.width,this.height,a,b);this.video.css("-webkit-mask-image",c);this.video.css("mask-image",c)};
Presenter.getVideoMaskUrl=function(a,b,c,d){var e=document.createElement("canvas");e.width=a;e.height=b;var f=e.getContext("2d");f.fillRect(4,0,a-8,b);f.fillRect(0,4,a,b-8);d?(f.arc(4,b-4,4,0,7),f.arc(a-4,b-4,4,0,7)):f.fillRect(0,b-8,a,b);c?(f.arc(4,4,4,0,7),f.arc(a-4,4,4,0,7)):f.fillRect(0,0,a,8);f.fill();return"url("+e.toDataURL()+")"};
Presenter.prototype.setPresenterInfo=function(){var a=this.ref;a.children(".presenter_name").text(this.name);a.children(".presenter_title").text(this.title);a=a.children(".presenter_link");this.bioHtml?(a.text(player.frame.getTextLabel(this.email?"more_info":"bio")),a.attr("href","javascript:void(null)")):this.email?(a.text(player.frame.getTextLabel("send_an_email")),a.attr("href","mailto:"+this.email),a.attr("target","_blank")):a.hide()};
Presenter.clearPresenters=function(){$(".logo_background .presenter_info").remove();$(".logo_background video").remove()};Presenter.prototype.show=function(){var a=this;Presenter.clearPresenters();$(".logo_background>.presenter_section").append(this.ref);this.video&&$(".logo_background>.presenter_video_section").append(this.video);this.ref.children(".presenter_link").unbind("click");this.bioHtml&&this.ref.children(".presenter_link").bind("click",function(){a.showDetail()});this.video&&this.video.get(0).play()};
Presenter.prototype.showDetail=function(){var a=this,b=$(".presenterInterstitial");0==b.length&&(b=$("<div class='presenterInterstitial'></div>"),$("#slidecontainer").prepend(b));if(!this.constructedCard){a.card=$("<div class='presenter_detail'><span class='presenter_bio'/><a class='presenter_mail'/><a class='presenter_close'/><canvas class='presenter_closebutton' width=26 height=26/></div>");a.card.children(".presenter_bio").html(this.bioHtml);a.card.children(".presenter_mail").text(player.frame.getTextLabel("send_an_email"));
a.card.children(".presenter_mail").attr("href","mailto:"+a.email);a.card.children(".presenter_mail").attr("target","_blank");a.card.children(".presenter_close").text(player.frame.getTextLabel("close"));a.card.children(".presenter_close").attr("href","javascript:void(null)");$("#slidecontainer").prepend(a.card);a.email||a.card.children(".presenter_mail").hide();var c=a.card.children(".presenter_closebutton").get(0).getContext("2d");c.lineCap="round";var d=c.createLinearGradient(0,0,0,26);d.addColorStop(0,
"#f99");d.addColorStop(1,"#933");c.fillStyle="#f00";c.strokeStyle=d;c.lineWidth=1;c.arc(13,13,12,0,2*Math.PI);c.fill();c.stroke();c.beginPath();c.strokeStyle="#fff";c.lineWidth=2;c.moveTo(9,9);c.lineTo(17,17);c.moveTo(17,9);c.lineTo(9,17);c.stroke();a.card.children(".presenter_close,.presenter_closebutton").bind("click",function(){MouseEvents.processHideables()});MouseEvents.addHideable(".presenter_detail",".presenter_link,.presenter_detail",function(){a.card.hide();b.hide()});a.constructedCard=!0}this.card.show();
b.unbind();b.show()};Presenter.prototype.videoPrepared=function(){return player.isMobile?player.nextPreparedClipID==this.videoUniqueKey&&Video.prepList[this.videoUniqueKey]:!0};Presenter.prototype.tick=function(a){if(this.isVideo&&this.ref){var b=this.video.get(0);a.getIsPlaying()?this.videoPrepared()&&(b.paused||b.ended)&&b.play():!b.paused&&!b.ended&&b.pause();if(0.2<Math.abs(b.currentTime-a.getCurrentTime()/1E3))try{b.currentTime=a.getCurrentTime()/1E3}catch(c){}}};var browser={g_nWindowWidth:0,g_nWindowHeight:0,g_nSizeInterval:null,g_nIntervalCount:0};browser.IE=document.all&&-1!=navigator.appVersion.indexOf("MSIE")?!0:!1;browser.IE6=document.all&&-1!=navigator.appVersion.indexOf("MSIE 6.")?!0:!1;browser.FF=-1!=navigator.userAgent.indexOf("Firefox")?!0:!1;browser.Safari3=navigator.appVersion.indexOf("Safari")&&navigator.appVersion.indexOf("Version/3");browser.ResizeBrowser=function(a){switch(a){case "fullscreen":browser.ResizeFullScreen();break;case "optimal":browser.ResizeOptimal()}};
browser.ResizeFullScreen=function(){top.moveTo(0,0);top.window.resizeTo(screen.availWidth,screen.availHeight)};
browser.ResizeOptimal=function(){var a=0,b=0,a=browser.GetXPos(),b=browser.GetYPos(),c=!1;browser.g_nWindowWidth=browser.g_nWidth+30;browser.g_nWindowHeight=browser.g_nHeight+30;if(screen.availWidth>browser.g_nWindowWidth&&screen.availHeight>browser.g_nWindowHeight){if(browser.GetContentWidth()!=browser.g_nWidth||browser.GetContentHeight()!=browser.g_nHeight)if(a+browser.g_nWindowWidth>screen.availWidth&&(c=!0,a=screen.availWidth-browser.g_nWindowWidth-5),b+browser.g_nWindowHeight+160>screen.availHeight&&
(c=!0,b=screen.availHeight-browser.g_nWindowHeight-165),0>a&&(a=0),0>b&&(b=0),c&&top.window.moveTo(a,b),top.window.resizeTo(browser.g_nWindowWidth,browser.g_nWindowHeight),a=browser.g_nWindowWidth-browser.GetContentWidth(),b=browser.g_nWindowHeight-browser.GetContentHeight(),browser.g_nWindowWidth=browser.g_nWidth+a,browser.g_nWindowHeight=browser.g_nHeight+b,top.window.resizeTo(browser.g_nWindowWidth,browser.g_nWindowHeight),browser.IE)browser.g_nSizeInterval=setInterval(CheckSize,500)}else browser.ResizeFullScreen()};
browser.CheckSize=function(){var a=browser.GetContentWidth(),b=browser.GetContentHeight(),c=0,d=0;browser.g_nIntervalCount++;if(a!=browser.g_nWidth||b!=browser.g_nHeight)c=browser.g_nWindowWidth-a,d=browser.g_nWindowHeight-b,browser.g_nWindowWidth=browser.g_nWidth+c,browser.g_nWindowHeight=browser.g_nHeight+d,top.window.resizeTo(browser.g_nWindowWidth,browser.g_nWindowHeight),clearInterval(browser.g_nSizeInterval);4<browser.g_nIntervalCount&&clearInterval(browser.g_nSizeInterval)};
browser.GetContentWidth=function(){var a=0;return a=browser.IE||browser.Safari3?document.body.clientWidth:Frame.getWindowSize().width};browser.GetContentHeight=function(){var a=0;return a=browser.IE||browser.Safari3?document.body.clientHeight:Frame.getWindowSize().height};browser.GetXPos=function(){var a=0;return a=browser.IE?window.screenLeft:window.screenX};browser.GetYPos=function(){var a=0;return a=browser.IE?window.screenTop:window.screenY};var ActionLink=function(){this.actions=[];this.navLinks=[]};ActionLink.prototype=new Element;ActionLink.prototype.innerType="ActionLink";ActionLink.prototype.objectType="ActionLink";ActionLink.prototype.loadFromXML=function(a,b){this.parentElement=b;var c=this;this.id=$(a).attr("id");$(a).children("actions").children().each(function(a,b){var f=new TimelineAction(c.parentElement);f.loadFromXML(b,c);c.actions.push(f)})};
ActionLink.prototype.runActions=function(){var a=this,b=!0;$.each(this.actions,function(c,d){b&&(b=d.performAction(a,!1,!1,!1))})};ActionLink.prototype.notifySelected=function(){player.frame.slideList.markSelectedVisited(this.id)};function CustomStyleSheet(){this.rules=[];this.ruleLookup={};this.sheet=null}CustomStyleSheet.prototype.add=function(a,b,c){if(this.ruleLookup[a])this.ruleLookup[a].add(b,c);else{var d=new StyleRule(a);d.add(b,c);this.ruleLookup[a]=d;this.rules.push(d)}};CustomStyleSheet.prototype.build=function(){if(!this.sheet)this.sheet=document.createElement("style"),document.body.appendChild(this.sheet);var a="";$.each(this.rules,function(b,c){a+=c.toString()+"\r\n\r\n"});this.sheet.innerHTML=a};function StyleRule(a){this.selector=a;this.attributes=[]}StyleRule.prototype.add=function(a,b){this.attributes.push({name:a,value:b})};StyleRule.prototype.toString=function(){var a=this.selector+"\r\n{\r\n";$.each(this.attributes,function(b,c){a+="\t"+c.name+": "+c.value+";\r\n"});return a+="}\r\n\r\n"};var MouseEvents={hideables:[],canHide:!0};MouseEvents.addHideable=function(a,b,c){MouseEvents.hideables.push({selector:a,exclude:b,callback:c})};MouseEvents.suppressPendingHide=function(){MouseEvents.canHide=!1;setTimeout(function(){MouseEvents.canHide=!0},200)};MouseEvents.processHideables=function(a){MouseEvents.canHide&&$.each(MouseEvents.hideables,function(b,c){(!a||!(c.exclude&&0<$(a.target).closest(c.exclude).length))&&$.each($(c.selector),function(a,b){c.callback($(b))})})};
MouseEvents.init=function(){var a=function(a){return null!=a.dropArea},b=function(a){return(a.hasEvent("onpress")||a.hasEvent("onrelease")||a.hasEvent("onlink")||a.hasEvent("onlinkrelease")||a.isDragItem||a.containsDragPath)&&!a.hasEvent("onrollover",!1)};player.allowRightClick||$(window).bind("contextmenu",function(){return!1});var c=player.isMobile?"touchstart":"mousedown",d=player.isMobile?"touchend":"mouseup",e=player.isMobile?"touchmove":"mousemove";$(window).bind(c,function(a){player.lastEvent=
a;player.lastMouseDownTime=new Date;if(player.currentSlide()){swipe.parseEventCoords(a);var b=swipe.getSlideCoords(player.currentSlide());player.currentSlide().deepEachReverse(function(a,c){var d=!1;c.button&&(d=c.button.testOver(b.x,b.y));!MouseEvents.isObstructedByModalLayer(c)&&!player.modalInterstitial&&!d&&!c.isDisabled&&null!=c.isPointActive&&c.hasEvent("onclickoutside")&&(!c.testOver(b.x,b.y)||!c.isPointActive(b.x,b.y)||c.isPointObscured(b.x,b.y))&&c.handleEvent("onclickoutside",null,null,
!1,!1,!0)},function(a){return a.visible||"ShuffleGroup"==a.innerType});return!0}});player.isMobile&&!player.isAndroid?$(window).bind("touchend",function(a){setTimeout(function(){MouseEvents.processHideables(a)},200)}):$(window).bind("click",function(a){MouseEvents.processHideables(a)});var f=function(a){do if(-1<a.className.indexOf("toptab")||-1<a.className.indexOf("controlbar-button"))return!0;while(a=a.parentElement);return!1};$(document.body).bind(c,function(a){player.lastEvent=a;player.lastMouseDownTime=
new Date;if(player.currentSlide()&&player.currentSlide().ref&&!f(a.target)){swipe.parseEventCoords(a);var b=swipe.getSlideCoords(player.currentSlide());swipe.noteDownCoords();var c=!1;player.currentSlide().deepEachReverse(function(d,e){var f=e.slide?e.slide:"Slide"==e.innerType?e:player.currentSlide();if(!c&&!MouseEvents.isObstructedByModalLayer(e)&&!player.modalInterstitial&&!e.isDisabled&&e.visible&&(e.hasEvent("onpress")||e.hasEvent("onrelease")||e.hasEvent("onlink")||e.isDragItem||player.canChangeMonitoringItem||
e.containsDragPath)&&f.testOver(b.x,b.y)&&e.isPointActive(b.x,b.y)&&!e.isPointObscured(b.x,b.y)){e.isDragItem?(e.mousedown(a),c=!0):e.hasEvent("onpress")&&(e.handleEvent("onpress",null,null,!1,!1,!0),c=!0);if(e.containsDragPath)for(d in e.children)e.children[d].hasDragPath&&e.children[d].mousedown(a);e.hasEvent("onrelease")&&e.ref&&(e.ref.addClass("hasmousedown"),c=!0);$.each(e.children,function(a,b){b.hasEvent("onrelease")&&b.ref&&b.ref.addClass("hasmousedown")});player.canChangeMonitoringItem&&
playerDiagnostics.updateItemInfo(e)}!player.isAndroid&&e.clickFocus&&e.testOver(b.x,b.y)&&!e.isPointObscured(b.x,b.y)&&(c=!0,setTimeout(function(){e.input&&e.input.get&&e.input.get(0)?e.input.get(0).focus():e.select&&e.select.get&&e.select.get(0)&&e.select.get(0).focus()},0))},function(a){return a.visible||"ShuffleGroup"==a.innerType})}});$(document.body).bind(d,function(b){player.lastEvent=b;player.lastMouseUpTime=new Date;var c=swipe.hasMoved();if(player.currentSlide()&&player.currentSlide().ref){swipe.parseEventCoords(b);
var d=swipe.getSlideCoords(player.currentSlide()),e=!1;player.currentSlide().deepEachReverse(function(b,f){var g=f.slide?f.slide:"Slide"==f.innerType?f:player.currentSlide();if(!e&&g.testOver(d.x,d.y)&&!MouseEvents.isObstructedByModalLayer(f)&&!player.modalInterstitial&&!f.isDisabled&&f.visible&&(f.hasEvent("onrelease")||f.hasEvent("onlinkrelease"))&&(!c||f.ref&&f.ref.hasClass("hasmousedown"))&&f.isPointActive(d.x,d.y)&&!f.isPointObscured(d.x,d.y,null,a))f.hasEvent("onlinkrelease")&&$.each(f.links,
function(a,b){e=e||b.handleIfOver("onlinkrelease",d,!1)}),!e&&f.hasEvent("onrelease")&&(e=!0,f.handleEvent("onrelease",null,null,!1,!1,!0)),f.ref&&f.ref.removeClass("hasmousedown"),e=!0;if(player.isMobile&&f.isMouseOver&&f.hasEvent("onrollout"))f.isMouseOver=!1,f.handleEvent("onrollout",null,null,!1,!1,!1)},function(a){return a.visible||"ShuffleGroup"==a.innerType});!e&&player.currentSlide().testOver(d.x,d.y)&&(!player.currentFramedSlide||!player.currentFramedSlide.testOver(d.x,d.y))&&player.currentSlide().handleEventDeep("onclickoutsideobjects",
null,null,!0);$(".hasmousedown").removeClass("hasmousedown")}});player.isAndroid&&$(document.body).bind("click",function(a){swipe.parseEventCoords(a);var b=swipe.getSlideCoords(player.currentSlide());player.currentSlide().deepEachReverse(function(c,d){d.clickFocus&&d.testOver(b.x,b.y)&&!d.isPointObscured(b.x,b.y)&&(d.input&&d.input.get&&d.input.get(0)?d.input.get(0).focus():d.select&&d.select.get&&d.select.get(0)&&d.select.get(0).focus(),a.stopPropagation())})});$(window).bind(d,function(a){player.lastEvent=
a;player.lastMouseUpTime=new Date;if(!player.currentSlide())return!0;swipe.parseEventCoords(a);var b=swipe.getSlideCoords(player.currentSlide());player.currentSlide().deepEachReverse(function(a,c){var d=!1;c.button&&(d=c.button.testOver(b.x,b.y));!MouseEvents.isObstructedByModalLayer(c)&&!player.modalInterstitial&&!d&&!c.isDisabled&&null!=c.isPointActive&&c.hasEvent("onreleaseoutside")&&(!c.testOver(b.x,b.y)||!c.isPointActive(b.x,b.y)||c.isPointObscured(b.x,b.y))&&c.handleEvent("onreleaseoutside",
null,null,!1,!1,!0)},function(a){return a.visible||"ShuffleGroup"==a.innerType});return!0});$(".menu_container").bind("mouseup",function(a){DragItem.handleMouseUp(a);bwDragPathItem.handleMouseUp(a);return!1});player.handleDeferredMove=function(){var c=player.deferredMoveEvent;player.deferredMoveEvent=null;player.lastEvent=c;if(player.currentSlide()&&player.currentSlide().ref){swipe.parseEventCoords(c);var d=swipe.getSlideCoords(player.currentSlide());if(player.followMouseCursor){if(!player.mouseFollowDiv)player.mouseFollowDiv=
$("<div class='mousecursorfollow'></div>");player.currentSlide().ref.append(player.mouseFollowDiv);player.mouseFollowDiv.css("left",d.x);player.mouseFollowDiv.css("top",d.y-5)}var e=!1,f=!1,m=function(a){a.isMouseOver=!1;if(a.hasEvent("onrollout"))player.currentSlide().currentOver=null,a.handleEvent("onrollout",null,null,!1,!1,!1);e=!0;a.hasEvent("onlinkrelease")&&$.each(a.links,function(a,b){b.handleIfOut("onrollout",d)})};player.currentSlide().deepEachReverse(function(c,e){var g=e.slide?e.slide:
"Slide"==e.innerType?e:player.currentSlide();e.isMouseOver&&!player.modalInterstitial&&!e.isDisabled&&e.isPointActive&&0==e.dragX&&0==e.dragY&&(e.hasEvent("onrollout")||e.hasEvent("onpress")||e.hasEvent("onrelease")||e.hasEvent("ondoubleclick",!0)||e.hasEvent("onlinkrelease",!1)||e.isDragItem)&&(!g.testOver(d.x,d.y)||!e.isPointActive(d.x,d.y)||e.isPointObscured(d.x,d.y,null,b,!0))&&m(e);if((!e.isMouseOver||e.hasEvent("onlinkrelease",!0)||e.usehandcursor)&&!MouseEvents.isObstructedByModalLayer(e)&&
!player.modalInterstitial&&(e.hasEvent("onrollover",!1)||e.hasEvent("onpress",!1)||e.hasEvent("onrelease",!1)||e.hasEvent("ondoubleclick",!0)||e.hasEvent("onlinkrelease",!1)||e.isDragItem)&&!e.isDisabled&&e.isPointActive&&e.isPointActive(d.x,d.y)&&!e.isPointObscured(d.x,d.y,null,a)){if(e.hasEvent("onrollover")&&!e.isMouseOver){if(player.currentSlide().currentOver&&(g=player.currentSlide().currentOver,g.isMouseOver&&!g.isDisabled&&g.isPointActive&&0==g.dragX&&0==g.dragY&&(g.hasEvent("onrollout")||
g.hasEvent("onpress")||g.hasEvent("onrelease")||g.hasEvent("ondoubleclick",!0)||g.hasEvent("onlinkrelease",!1)||g.isDragItem)&&(!g.isPointActive(d.x,d.y)||g.isPointObscured(d.x,d.y,null,a,!0))))m(g),g.isMouseOver=!1;player.currentSlide().currentOver=e;e.handleEvent("onrollover",null,null,!1,!1,!1)}e.isMouseOver=!0;if(e.hasEvent("onlinkrelease")){var j=!1;$.each(e.links,function(a,b){b.handleIfOver("onrollover",d,!0)&&(j=!0);b.handleIfOut("onrollout",d)});j&&(f=!0)}else if(e.usehandcursor&&(e.hasEvent("onpress",
!1)||e.hasEvent("onrelease",!1)||e.hasEvent("ondoubleclick",!0)||e.hasEvent("onlinkrelease",!1)||e.isDragItem))f=!0}},function(a){return a.visible||"ShuffleGroup"==a.innerType});f?$(document.body).addClass("pointercursor"):e&&$(document.body).removeClass("pointercursor")}};$(document.body).bind(e,function(a){player.deferredMoveEvent=a})};
MouseEvents.isObstructedByModalLayer=function(a){return!player.modalLayer||player.modalLayer==a.layer||player.currentWindowSlide&&player.modalLayer.slide!=player.currentWindowSlide?!1:!0};MouseEvents.getItemAtCursor=function(a){var b=null;player.currentSlide().deepEachReverse(function(c,d){!b&&!MouseEvents.isObstructedByModalLayer(d)&&!d.isDisabled&&d.visible&&d.isPointActive(a.x,a.y)&&!d.isPointObscured(a.x,a.y)&&(b=d)});return b};
MouseEvents.getMousePoint=function(a){var b=0,c=0;a.originalEvent.touches?0<a.originalEvent.touches.length?(b=a.originalEvent.touches[0].pageX,c=a.originalEvent.touches[0].pageY):(b=a.originalEvent.changedTouches[0].pageX,c=a.originalEvent.changedTouches[0].pageY):(b=a.pageX,c=a.pageY);return new Point(b,c)};MouseEvents.convertStyleToPoint=function(a){var b=new Point,a=a.split(" "),c=a[0].indexOf("px");b.x=0<=c?Number(a[0].substr(0,c)):0;c=a[1].indexOf("px");b.y=0<=c?Number(a[1].substr(0,c)):0;return b};
MouseEvents.convertStyleToMatrix=function(a){var b=new MatrixTransform;if(0==a.indexOf("matrix")&&(a=a.substring(7,a.length-1),a=a.split(","),6==a.length))for(var c=0;c<a.length;c++)b.m[c]=Number(a[c]);return b};
MouseEvents.getObjectPosition=function(a,b){var c=null;b||(b=window.getComputedStyle(a,null));if("absolute"==b.getPropertyValue("position")&&$(a).hasClass("item"))c=MouseEvents.convertStyleToPoint(b.getPropertyValue("left")+", "+b.getPropertyValue("top"));else{var c=new Point,d=$(a).offset();if(a.parentNode&&a.parentNode!=document){var e=$(a.parentNode).offset();c.x=d.left-e.left;c.y=d.top-e.top}else c.x=d.left,c.y=d.top;if((!player.currentWindow||!player.currentWindow.onBody)&&player.scaleWithTransform)c.x/=
player.frameScale,c.y/=player.frameScale}return c};
MouseEvents.getMatrix=function(a){var b=new MatrixTransform,c=window.getComputedStyle(a,null),d=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("-moz-transform")||c.getPropertyValue("-ms-transform")||c.getPropertyValue("-o-transform")||c.getPropertyValue("transform"),e=c.getPropertyValue("-webkit-transform-origin")||c.getPropertyValue("-moz-transform-origin")||c.getPropertyValue("-ms-transform-origin")||c.getPropertyValue("-o-transform-origin")||c.getPropertyValue("transform-origin"),
f=Number(c.getPropertyValue("zoom"));isNaN(f)&&(f=1);d=MouseEvents.convertStyleToMatrix(d);a=MouseEvents.getObjectPosition(a,c);b.center=MouseEvents.convertStyleToPoint(e);b.multiply(d);b.scale(f,f);e=b.getScale();a.x*=e.x;a.y*=e.y;a=b.unTransformPoint(a.x,a.y);b.translate(a.x,a.y);return b};
MouseEvents.globalToLocal=function(a,b){for(var c=a,d=new Point(b.x,b.y),e=[],f=null;c&&c!=document;)(f=MouseEvents.getMatrix(c))&&e.push(f),c=c.parentNode;for(c=e.length-1;0<=c;c--)f=e[c],d.x-=f.center.x,d.y-=f.center.y,d=f.unTransformPoint(d.x,d.y),d.x+=f.center.x,d.y+=f.center.y;return d};
MouseEvents.localToGlobal=function(a,b){for(var c=a,d=new Point(b.x,b.y),e=[],f=null;c&&c!=document;)(f=MouseEvents.getMatrix(c))&&e.push(f),c=c.parentNode;for(c=0;c<e.length;c++)f=e[c],d.x-=f.center.x,d.y-=f.center.y,d=f.transformPoint(d.x,d.y),d.x+=f.center.x,d.y+=f.center.y;return d};var playerDiagnostics={};
playerDiagnostics.init=function(){$.each(location.search.split("&"),function(a,b){var c=unescape(b.replace("?","")).split("=");switch(c[0].toLowerCase()){case "controls":player.showControls=!0;player.swipeMode="none";player.animations="all";break;case "seek":setTimeout(function(){player.frame.options.forceseekbar=!0;player.frame.options.seekbar=!0;player.frame.set_frame_layout()},400);break;case "anim":player.animations=c[1];break;case "animations":playerDiagnostics.setupAnimationMonitor();break;
case "page":player.paging=c[1];break;case "zoom":player.tapZoomEnabled=!0;break;case "lockzoom":player.lockzoom=!player.lockzoom;break;case "scale":player.scaleToFit=!player.scaleToFit;break;case "swipe":player.swipeMode=c[1];break;case "rightclick":player.allowRightClick=!player.allowRightClick;break;case "menu":player.forceMenu=!0;break;case "jiggle":player.useSwipeJiggle=!0;break;case "simplezoom":player.useSimpleZoom=!0;break;case "framecount":player.showFrameCount=!0;break;case "heartbeat":setInterval(function(){$(".framewrap").hide();
player.uselessOffsetHeight=$(".framewrap").get(0).offsetHeight;$(".framewrap").show()},c[1]||1E3);break;case "noimg":player.noImg=!0;break;case "bak":player.backOnly=!0;break;case "simplify":player.simplifySlides=!1;break;case "preload":player.preload=!0;break;case "nopreload":player.neverPreload=!0;break;case "canvasdebug":player.canvasDebug=!0;break;case "ppfudge":window.ppFudge=parseFloat(c[1]);break;case "nocanvas":player.useCanvas=!1;player.renderVectorShapes=!1;player.renderVectorsAsSVG=!1;
break;case "safecanvas":player.useSafeCanvas=!0;break;case "basiccanvas":ppArt=ppArtBasic;break;case "oldnav":player.simplenav=!1;break;case "compact":player.useCompactResume=!player.useCompactResume;break;case "svg":player.useCanvas=!0;player.renderVectorShapes=!0;player.renderVectorsAsSVG=!0;break;case "logging":window.EventLogger.logging=!window.EventLogger.logging;break;case "console":console.suppress=!console.suppress;break;case "trace":trace.suppress=!trace.suppress;break;case "noconsole":console.suppress=
!0;break;case "datestamp":var d="Build "+window.buildNumber+": "+window.buildDate,e=$("<div class='datestamp'>"+d+"<div>");e.click(function(){alert(d)});$(document.body).append(e);break;case "decode":Audio.decodeOnLoad=!Audio.decodeOnLoad;break;case "mobileaudio":player.simulateMobileAudio=!0;break;case "silent":Audio.setSilentMode();break;case "media":player.showMediaMonitor=!0;setInterval(playerDiagnostics.updateMediaMonitor,500);break;case "refstore":player.showRefStoreMonitor=!0;setInterval(playerDiagnostics.updateRefStoreMonitor,
500);break;case "medialist":var f=$("<div class='medialist'></div>");$(document.body).append(f);setTimeout(function(){story.xml.find("video").find("videodata").each(function(a,b){f.append("<a href='"+player.basepath+$(b).attr("url")+"' target='_blank'>"+$(b).attr("url")+"</a><br>")})},2E3);break;case "timelines":playerDiagnostics.setupTimelineMonitor();break;case "resources":playerDiagnostics.setupResourceList();break;case "monitor":player.showInstrumentation=!0;break;case "follow":player.followMouseCursor=
!0;break;case "transform":player.scaleWithTransform=!player.scaleWithTransform;break;case "info":player.showItemInfo=!0;player.canChangeMonitoringItem=!0;player.originalMonitoringItemID=c[1];setInterval(playerDiagnostics.updateItemInfo,1E3);setTimeout(function(){var a=story.findDescendantById(c[1]);a&&playerDiagnostics.updateItemInfo(a)},1E3);$(".framewrap").addClass("info");break;case "placeholder":player.usePlaceholderVideo=!0;break;case "novideo":player.noVideo=!0;break;case "noaudiocache":player.noAudioCache=
!0;break;case "purgevideo":player.purgeVideo=!0;break;case "filter":console.filter=c[1];break;case "scrolldebug":player.scrollDebug=c[1];break;case "vectordebug":player.showVectorDebug=!0;break;case "showbitmask":player.showBitmask=!0;break;case "overlap":player.showDebugOverlap=!0;BitMask.showDebug=!0;break;case "persist":player.showDebugOverlapPersistent=!0;break;case "overlapdebug":player.showDebugOverlap=!0;BitMask.showDebug=!0;BitMask.debugOnly=!0;break;case "matrixdebug":player.showMatrixDebug=
!0;break;case "maskdebug":player.drawMaskDebugShapes=!0;break;case "maskimage":player.useMaskImage=!0;break;case "maskcanvas":player.useMaskCanvas=!0;break;case "backcanvas":player.useBackgroundCanvasWorkaround=!0;break;case "dumpcanvas":player.dumpCanvas=!0;player.canvasCommandLog=[];break;case "linkareas":player.showLinkAreas=!0;break;case "maximize":player.canMaximize=!0;player.maximized=!0;break;case "stresstest":playerDiagnostics.setupStressTest();break;case "navtest":setTimeout(function(){player.frame.debugTopNav()},
1E3);break;case "nointervals":player.nointervals=!0;break;case "noframe":player.noframe=!0;break;case "noframecolor":player.noframecolor=!0;case "vectorimage":player.suppressVectorImage=!player.suppressVectorImage;break;case "bgcolor":globals.strBgColor="#"+c[1];$(document.body).css("background","#"+c[1]);break;case "slidescale":player.forceSlideScale=parseFloat(c[1]);break;case "resumedata":player.overrideResumeData=c[1];break;case "suppresscapture":player.suppressCaptureAnimations=!player.suppressCaptureAnimations;
break;case "active":player.useActiveTimeline=!player.useActiveTimeline;break;case "iosplayer":player.simulateIOSPlayer=!player.simulateIOSPlayer;break;case "logactivity":player.logActivity=!player.logActivity}})};
playerDiagnostics.setupStressTest=function(){var a=$("<a style='position:absolute;left:0px;top:10px;z-index:10000;background-color:#fff'>stress single</a>");a.click(function(){var b=0,d=player.currentSlide(),e=d.container,f=function(){setTimeout(function(){d.destroyRef();setTimeout(function(){d.createRef(e);f()},50)},50);b++;a.html(b)};f()});$(document.body).append(a);var b=$("<a style='position:absolute;left:0px;top:50px;z-index:10000;background-color:#fff'>stress cycle</a>");b.click(function(){var a=
0,d=function(){setTimeout(function(){player.showSlideIndex((player.slideIndex+1)%story.allSlides.length,null,!0,function(){d()})},1E3);a++;b.html(a)};d()});$(document.body).append(b)};
playerDiagnostics.updateMediaMonitor=function(){if(player.showMediaMonitor){if(!player.mediaMonitor)player.mediaMonitor=$("<div class='monitor'>hey</div>"),$(document.body).append(player.mediaMonitor);player.mediaMonitor.empty();$.each(story.allSlides,function(a,b){player.mediaMonitor.append("<h2>"+b.title+"</h2>");var c=$("<ul></ul>");$.each(b.resources,function(a,b){if(("audio"==b.item.type||"video"==b.item.type)&&b.item.ref){var f=$("<li>"+b.prepared+", "+b.item.ref.get(0).networkState+", "+b.item.ref.get(0).readyState+
", "+b.item.ref.get(0).paused+", "+b.item.ref.get(0).ended+", "+b.item.ref.get(0).error+", "+b.item.getCurrentTime()+", "+b.src+"</li>");!b.item.ref.get(0).paused&&!b.item.ref.get(0).ended&&f.css("background-color","yellow");b.item.getFullObjref()==player.nextPreparedClipID&&f.css("color","green");player.currentClip&&b.item.ref&&player.currentClip==b.item.ref.get(0)&&f.css("text-decoration","underline");c.append(f)}});player.mediaMonitor.append(c)})}};
playerDiagnostics.updateRefStoreMonitor=function(){if(player.showRefStoreMonitor){if(!player.refStoreMonitor)player.refStoreMonitor=$("<div class='monitor left'>hey</div>"),$(document.body).append(player.refStoreMonitor);player.refStoreMonitor.empty();player.refStoreMonitor.append("<h2>RefStore</h2>");var a=$("<ul></ul>");$.each(Video.refStore,function(b,c){var d=$("<li>"+b+", "+c.get(0).networkState+", "+c.get(0).readyState+", "+c.get(0).paused+", "+c.get(0).ended+", "+c.get(0).error+", "+c.get(0).currentTime+
"</li>");!c.get(0).paused&&!c.get(0).ended&&d.css("background-color","yellow");b==player.nextPreparedClipID&&d.css("color","green");a.append(d)});player.refStoreMonitor.append(a)}};
playerDiagnostics.setupTimelineMonitor=function(){var a=$("<ul class='timerlist'></ul>"),b=function(b,d,e){b=$("<li class='t"+b+"'>"+b+": <b>"+d+"</b> ("+e+")</li>");a.append(b)};$(document.body).append(a);setInterval(function(){a.empty();b("active",player.activeTimeline.currentTime,player.activeTimeline.id);b("player",player.currentTime,"");b("slide",player.currentSlide().currentTime,player.currentSlide().id);player.currentFramedSlide&&b("slideFrame",player.currentFramedSlide.currentTime,player.currentFramedSlide.id);
player.currentWindowSlide&&b("window",player.currentWindowSlide.currentTime,player.currentWindowSlide.id);b("animation",player.getAnimationTime(),"");var c=function(a){a&&a.deepEach(function(a,c){"Layer"==c.innerType&&b("layer",c.currentTime,c.id)})};c(player.currentSlide());c(player.currentWindowSlide);c(player.currentFramedSlide)},100)};
playerDiagnostics.setupResourceList=function(){var a=$("<ul class='resourcelist'></ul>");$(document.body).append(a);setInterval(function(){a.empty();var b=$("<li class='ttotal'>total: <b>"+Resource.TotalPixels+"</b> ("+Resource.LoadedImageCount+")</li>");a.append(b)},100)};
playerDiagnostics.setupAnimationMonitor=function(){var a=$("<ul class='animationlist'></ul>");$(document.body).append(a);setInterval(function(){a.empty();$.each(player.currentAnimations,function(b,c){var d=c.uniqueID,d=$("<li class='t"+d+"'>"+d+": <b>"+c.ms+"</b> ("+c.startTime+")</li>");a.append(d)})},100)};
playerDiagnostics.updateItemInfo=function(a){if(player.showItemInfo){if(!player.itemInfoMonitor)player.itemInfoMonitor=$("<div class='monitor'></div>"),$(document.body).append(player.itemInfoMonitor);if(player.canChangeMonitoringItem&&a)player.monitoringItem=a||player.monitoringItem,player.canChangeMonitoringItem=!1;a=player.monitoringItem;player.itemInfoMonitor.empty();if(a){$(".item").removeClass("monitoring");a.ref&&a.ref.addClass("monitoring");var b=$("<h2>"+a.id+"</h2>");b.bind("click",function(){alert(a.id)});
player.itemInfoMonitor.append(b);player.itemInfoMonitor.append($("<h3>"+a.innerType+" (visible:"+a.visible+")</h3>"));player.itemInfoMonitor.append($("<p>x: "+a.x+" y: "+a.y+" w: "+a.width+" h: "+a.height+" z: "+a.depth+" xoff: "+a.xoffset+" yoff: "+a.yoffset+" dragX: "+a.dragX+" dragY: "+a.dragY+" ox: "+a.originalX+" oy: "+a.originalY+" sx: "+a.shuffleX+" sy: "+a.shuffleY+" vis: "+a.visible+" r: "+a.rotation+" </p>"));b=$("<a>toggle&nbsp;</a>");b.click(function(){a.visible?a.hide():a.show()});player.itemInfoMonitor.append(b);
b=$("<a>&nbsp;render</a>");b.click(function(){var a=$('<canvas class="content" width="600" height="600"></canvas>');a.css("position","absolute");a.css("left","0");a.css("top","0");$(document.body).append(a);a=a.get(0).getContext("2d");a.fillStyle="blue";a.fillRect(0,0,200,200)});player.itemInfoMonitor.append(b);a.content&&player.itemInfoMonitor.append($("<span>"+a.content.src+"</span>"));b=function(a,b){if(a){var c=$("<table></table>");$.each(a,function(a,d){var e=d;b&&(e="function"==typeof b?b(a,
d):d[b]);e=$("<tr><td>"+a+":</td><td>"+e+"</td></tr>");c.append(e)});player.itemInfoMonitor.append(c)}};player.itemInfoMonitor.append("<p/><a href='javascript:void(null);' onclick='player.monitoringItem=null;player.canChangeMonitoringItem=true;playerDiagnostics.updateItemInfo();'>change</a>");player.monitoringItem.parent&&player.itemInfoMonitor.append("(<a href='javascript:void(null);' onclick='player.monitoringItem=player.monitoringItem.parent;playerDiagnostics.updateItemInfo();'>parent</a>)");player.itemInfoMonitor.append("<p/><a href='javascript:void(null);' onclick='player.monitoringItem=null;player.canChangeMonitoringItem=true;playerDiagnostics.updateItemInfo(player.currentSlide());'>slide</a>");
player.itemInfoMonitor.append("<p/><a href='javascript:void(null);' onclick='player.monitoringItem=story.findDescendantById(player.originalMonitoringItemID);playerDiagnostics.updateItemInfo();'>sniff</a>");var c=$("<a href='javascript:void(null);'>log</a>");c.click(function(){console.log(a)});player.itemInfoMonitor.append("<p/>");player.itemInfoMonitor.append(c);c=$("<a href='javascript:void(null);'>resumeData</a>");c.click(function(){console.log(a.GetResumeData())});player.itemInfoMonitor.append("<p/>");
player.itemInfoMonitor.append(c);b(a.variables);b(a.children,function(a,b){return"<a href='javascript:void(null);' onclick='player.monitoringItem=player.monitoringItem.children[\""+b.id+"\"];playerDiagnostics.updateItemInfo();'>_"+b.innerType+"_</a>"});b(a.events,"trigger");b(a.states);b(a.actionGroups);player.logActivity?b(a.log):a.content?(player.itemInfoMonitor.append($("<span onclick='alert(this.innerHTML)'>"+a.content.path+"</span><br/>")),a.content.src&&a.content.src!=Element.PixelSrc?player.itemInfoMonitor.append($("<img src='"+
a.content.src+"' style='opacity:0.8;border:solid 1px green'>")):player.itemInfoMonitor.append($("<span>NO IMAGE</span>")),a.canvas&&a.canvas.toDataURL&&0==location.href.indexOf("http")&&(b=a.canvas.toDataURL("image/png"),player.itemInfoMonitor.append($("<img src='"+b+"' style='opacity:0.8;border:solid 1px yellow'>")))):player.itemInfoMonitor.append($("NO CONTENT"));if(a.bitMask&&player.showDebugOverlap){var d=function(a){var b=$("<canvas></canvas>");b.attr("width",a.width);b.attr("height",a.height);
b.css("position","relative");player.itemInfoMonitor.append(b);a.drawDebug(b.get(0))};d(a.bitMask);a.stateMasks&&$.each(a.stateMasks,function(a,b){d(b)})}else player.itemInfoMonitor.append($("NO BITMASK"))}else player.itemInfoMonitor.append($("<h2>select an item to monitor</h2>"))}};var player={slideIndex:0,currentTime:0,animationTime:1E7,interval:null,showingInterstitial:!0,ready:!1,fontready:!1,playing:!1,paused:!0,blocked:!1,playall:!1,autoplay:!0,autoplaySlides:!0,loopable:!1,simplenav:!0,visible:!0,mediaCount:0,loadedMediaCount:0,deferredLoadingIndex:0,width:1,height:1,frameScale:1,aspectRatio:720/540,windowZoomModifier:1,transitionSeconds:0.4,maxTransitionSeconds:1.2,clipVolume:1,progressBar:null,zoomed:!1,basepath:"",currentAnimations:{},computedMasks:{},bitmasks:{},framedSlides:{},
webAudioClips:{},animations:"pan",showControls:!1,slideList:null,fileList:null,swipeMode:"follow",useCanvas:!0,useCompactResume:!0,simplifySlides:!0,suppressCaptureAnimations:!1,hasUserScript:!1,startTime:new Date,useActiveTimeline:!0,simulateIOSPlayer:!1,suppressVectorImage:!0,logActivity:!1,frameCount:0,loadFromScript:!0,playing:!0,fontlib:null,textlib:null,history:[],windowStack:[],renderQueue:[],showQueue:[],actionQueue:[],actionQueuePaused:!1,blockQueue:[],blockableMediaList:{},blocked:!1,pausedListFromBlur:[],
pausedListFromWindow:[],listSlidesViewed:{},listSlidesViewedComplete:{},completeSlidesViewed:0,currentSlidesViewed:0,totalViewSlides:0,allowTouchMove:!1,scaleWithTransform:!1,purgeVideo:!1,lastPaused:!1,pauseUpdated:!1},g_oFontLib;player.TICK_DURATION=30;player.isIOS=-1<navigator.userAgent.indexOf("AppleWebKit/")&&-1<navigator.userAgent.indexOf("Mobile/");player.isIPhone=/iP(hone|od)/.test(navigator.platform);player.isMobileFrame=!1;player.isWebKit=-1<navigator.userAgent.indexOf("AppleWebKit/");
player.canAnimate=-1<navigator.userAgent.indexOf("AppleWebKit/");player.isIE=-1<navigator.userAgent.indexOf("MSIE ");player.isIE8=player.isIE&&-1<navigator.appVersion.indexOf("MSIE 8");player.isIE9=player.isIE&&-1<navigator.appVersion.indexOf("MSIE 9");player.isFF=-1<navigator.userAgent.indexOf("Firefox/");player.isChrome=-1<navigator.userAgent.indexOf("Chrome/");player.isMac=-1<navigator.userAgent.indexOf("Macintosh;");
player.isMacSafari=-1<navigator.userAgent.indexOf("Safari")&&-1<navigator.userAgent.indexOf("Mac")&&-1==navigator.userAgent.indexOf("Chrome");player.isAndroid=-1<navigator.userAgent.indexOf("Android");player.iOSMajorVersion=0;if(player.isIOS){var iosVersionSplitter=/OS (\d+)_/ig;if(iosVersionSplitter.test(navigator.userAgent))player.iOSMajorVersion=parseInt(navigator.userAgent.split(iosVersionSplitter)[1])}player.isMobile=player.isIOS||player.isAndroid;
if(player.isIOS)player.isIOS6=-1<navigator.appVersion.indexOf("OS 6"),player.isIOS7=-1<navigator.appVersion.indexOf("OS 7"),player.isIOS8=-1<navigator.appVersion.indexOf("OS 8"),player.isIOS9=-1<navigator.appVersion.indexOf("OS 9"),player.isIOSlt8=player.isIOS6||player.isIOS7,player.isIOSlt9=player.isIOSlt8||player.isIOS8;if(!player.isChrome)player.scaleWithTransform=!0;player.isCrossDomainFrame=!1;try{player.isCrossDomainFrame=void 0==top.location.href}catch(e$$62){player.isCrossDomainFrame=!0}
if(self!=top&&!player.isCrossDomainFrame){var meta=$('<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0"/>');try{top.document.getElementsByTagName("head")[0].appendChild(meta.get(0))}catch(e$$63){player.isCrossDomainFrame=!0}}if(-1<navigator.userAgent.indexOf("Mac")||player.isMobile){var sheet=document.createElement("style");document.head.appendChild(sheet);sheet.innerHTML="::-webkit-scrollbar-thumb {border-radius: 4px;background-color: rgba(0,0,0,.5);-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);}\r\n::-webkit-scrollbar {-webkit-appearance: none;width: 7px;}\r\n"}
player.flushActionQueue=function(){for(var a=!0;0<player.actionQueue.length&&a&&!player.actionQueuePaused;)a=player.actionQueue.shift(),a=a.target.runAction(a.actionXML)};window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();player.getAnimationTime=function(){return player.animationTime};
player.getIOSversion=function(){if(/iP(hone|od|ad)/.test(navigator.platform)){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(a[1]||7,10),parseInt(a[2]||0,10),parseInt(a[3]||0,10)]}return[7,0,0]};Element.prototype.getAnimationTime=function(){return this.currentTime};
player.updateControls=function(){var a=!player.timelineManager.getIsActiveTimelinePlaying()||player.timelineManager.getIsActiveTimelineComplete();if(player.lastPaused!=a||!player.pauseUpdated)player.lastPaused=a,player.pauseUpdated=!0,a?(player.controlPause.hide(),player.controlPlay.show(),player.showControls&&$("#controls").show(),$(document.body).removeClass("paused")):(player.controlPause.show(),player.controlPlay.hide())};
player.timeFormat=function(a){var b=(Math.floor(a/1E3)%60+100+"").substr(1,2),c=Math.floor(a/1E3/60),d="";0>a&&(b=(Math.floor(a/1E3)%60-100+"").substr(2,2),c=Math.ceil(a/1E3/60),d="-");return d+Math.abs(c)+":"+b};
player.updateControlTime=function(){var a=player.timelineManager.getActiveTimelineSlide();if(a){if(a.window==player){var b=ProgressBar.getCurrentProgressBar();if(b)b.index=player.timelineManager.getActiveTimelineCurrentTime(),b.count=player.timelineManager.getActiveTimelineDuration(),b.update()}0<player.controlTimeElapsed.length&&player.controlTimeElapsed.text(player.timeFormat(a.starttime+a.timeline.getCurrentTime()));0<player.controlTimeRemaining.length&&player.controlTimeRemaining.text(player.timeFormat(a.timeline.getCurrentTime()-
a.timeline.duration))}};player.showSlideID=function(a,b,c){a=story.parseObjref(a).target;if(a==player.currentSlide())return!1;if("Scene"==a.innerType&&(a=story.parseObjref(a.startingslide).target,a==player.currentSlide()))return player.restart(),!1;if("SlideDraw"==a.innerType)a.showFirst();else{if(isNaN(a.slideIndex))return!1;player.showSlideIndex(a.slideIndex,null,b,c)}return!0};player.showLoadingSpinner=function(){player.loadingSpinnerVisible=!0;player.loadingSpinner.show();Frame.resizeSpinners()};
player.hideLoadingSpinner=function(){player.loadingSpinnerVisible=!1;player.loadingSpinner.hide()};
player.showSlideIndex=function(a,b,c,d){var e=story.allSlides[a],f=TimelineAction.actparams.cancelled;TimelineAction.actparams._ActTargetSlideId=e.getFullObjref(!0);TimelineAction.actparams._ActTargetWindow=e.variables.WindowId;TimelineAction.actparams._ActTargetSlideNavIndex=e.navindex;TimelineAction.actparams.cancelled=!1;player.currentSlide().handleEvent("onbeforeslidejump",null,null,!1,!0);TimelineAction.actparams.cancelled?TimelineAction.actparams.cancelled=f:(TimelineAction.actparams.cancelled=
f,e.loadContentFromXML(),e.window=player,e.blockAndLoad(function(){DragItem.cancelDrag();$(document.body).removeClass("pointercursor");player.currentSlide().restorePlayerControls();player.hideLoadingSpinner();player.currentWindow=null;DragItem.cancelDrag();var e=player.currentSlide().slideIndex;if(!(a==e&&player.hasShownFirstSlide)){var f=player.currentSlide();f.saveIfNecessary();f.handleTransitionOut();if(c&&-1==player.currentSlide().parent.id.indexOf("MsgScene"))player.currentWindow?player.currentWindow.history.push(e):
(player.hasAdvanced=!0,player.history.push(e));player.setSlideIndex(a,b);if(player.onSelectSlide)player.onSelectSlide(story.allSlides[a]);player.isMobileFrame&&($("#slideframe").css("-webkit-box-shadow","0 0 30px rgba(0,0,0,0.35)"),$("#slideframe").css("-moz-box-shadow","0 0 30px rgba(0,0,0,0.35)"),$("#slideframe").css("-ms-box-shadow","0 0 30px rgba(0,0,0,0.35)"),$("#slideframe").css("box-shadow","0 0 30px rgba(0,0,0,0.35)"));player.saveSceneIfNecessary();setTimeout(function(){player.hasShownFirstSlide=
!0},1E3);story.saveToLocalStorage()}d&&d()}))};player.saveSceneIfNecessary=function(){var a=!1,b=player.currentSlide().parent;if("Scene"==b.innerType)for(var c in b.children){if("SlideDraw"==b.children[c].innerType){a=!0;break}}else a=!0,b=b.parent;if(a&&b.getResumeData)b.compactResumeData=b.getResumeData()};
player.showPreviousSlide=function(a){for(var b=player.currentWindow?player.currentWindow.history:player.history,c=null,d=null;0<b.length&&!c;){var d=b.pop(),e=story.allSlides[d];if(!a||a(e))e!=player.currentSlide()&&(c=e)}0==b.length&&null==c&&null!=d&&b.push(d);if(!c)return!0;player.currentWindow?player.currentWindow.showSlide(c,!1):player.showSlideIndex(c.slideIndex,null,!1);return!1};
player.setSlideIndex=function(a,b){player.zoomed&&player.tapZoom();MouseEvents.processHideables();player.unblock();player.timelineManager.pauseAllTimelines();if(!isNaN(a)){var c=player.currentSlide();player.previousSlide=c;player.slideIndex=a;player.timelineManager.setActiveTimeline(player.currentSlide().timeline);if(player.currentSlide())player.currentSlide().resetInteractions(),player.updateViewCount(player.currentSlide()),player.frame.slideList.markVisited(player.currentSlide().getFullObjref(!0)),
player.currentSlide().show(player.autoplaySlides,b,function(a){a||c.slideIndex==player.currentSlide().slideIndex?player.currentSlide().resetCurrentAnimations():(c.reduce(),player.hideInactiveSlides(),c.unloadContent())}),c.handleEvent("ontransitionout",null,null,!1,!0),c.deepEach(function(a,b){b.handleEvent&&b.handleEvent("ontransitionout",null,null,!1,!0)}),c.variables.WindowId="_frame",player.currentSlide().variables.WindowId="_frame";$(".item").css("-webkit-animation-name","");$(".item").css("-webkit-animation-duration",
"0s");player.frame.setSlide(player.currentSlide().getNavPack(),Frame.WINDOW_FRAME)}};
player.updateViewCount=function(a){a.variables.Visited=!0;a.viewedCurrent=!0;this.listSlidesViewed[a.getFullObjref()]=!0;this.listSlidesViewedComplete[a.slideIndex]=!0;if(a.trackviews){var b={},c=0,d;for(d in this.listSlidesViewed){var e=story.parseObjref(d).target;e.trackviews&&null==b[e.viewgroupid]&&(b[e.viewgroupid]=!0,c++)}this.currentSlidesViewed=c;var c=0,b={},f;for(f in this.listSlidesViewedComplete)e=story.allSlides[f],null!=e&&e.trackviews&&null==b[e.viewgroupid]&&(b[e.viewgroupid]=!0,c++);
this.completeSlidesViewed=c;player.lmsManager.handleSlideViewed(a)}};player.restoreViewedState=function(a){a.variables.Visited=!0;this.listSlidesViewed[a.getFullObjref()]=!0;this.listSlidesViewedComplete[a.slideIndex]=!0};player.calculateTotalViewSlides=function(){for(var a={},b=this.totalViewSlides=0;b<story.allSlides.length;b++){var c=story.allSlides[b];c.trackviews&&(""!=c.viewgroupid?null==a[c.viewgroupid]&&(a[c.viewgroupid]=!0,this.totalViewSlides++):this.totalViewSlides++)}};
player.hideInactiveSlides=function(a){var b=player.currentSlide();$.each(story.allSlides,function(a,d){var e=d.offsetParent&&d.offsetParent.slide==b;if(d.slideIndex!=b.slideIndex&&!e&&(!player.currentWindow||d.window&&d.window!=player))d.hide(),d.unloadContent()});a&&a()};player.currentSlide=function(){return 0==story.allSlides.length?null:player.currentWindow?player.currentWindowSlide:story.allSlides[player.slideIndex]};player.currentZoom=function(){return player.zoom};
player.elapsedTime=function(){return new Date-player.startTime};player.addToRenderQueue=function(a){0>this.renderQueue.indexOf(a)&&(this.renderQueue.push(a),player.scheduleShowQueueFlush())};player.addToShowQueue=function(a){0>this.showQueue.indexOf(a)&&(this.showQueue.push(a),player.scheduleShowQueueFlush())};player.removeFromShowQueue=function(a){a=this.showQueue.indexOf(a);0<=a&&this.showQueue.splice(a,1)};
player.scheduleShowQueueFlush=function(){this.renderTimer?this.renderTimer.style.opacity="1"==this.renderTimer.style.opacity?".9":"1":player.flushShowQueues()};
player.flushShowQueues=function(){if(0<player.renderQueue.length||0<player.showQueue.length){for(var a=[],b=0;b<player.showQueue.length;b++){var c=player.showQueue[b];0>player.renderQueue.indexOf(c)?c.ref&&c.ref.show():a.push(c)}for(b=0;b<player.renderQueue.length;b++)player.renderQueue[b].renderOnUpdate();player.renderQueue=[];player.showQueue=a;0<a.length&&player.scheduleShowQueueFlush()}};player.addToBlockableMedia=function(a){player.blockableMediaList[a.getFullObjref()]=a};
player.removeFromBlockableMedia=function(a){delete player.blockableMediaList[a.getFullObjref()]};
player.block=function(a){0>player.blockQueue.indexOf(a)&&player.blockQueue.push(a);if(!player.blocked){player.blocked=!0;for(key in player.blockableMediaList)player.blockableMediaList[key].pauseOnBlock();var b=Frame.getWindowSize(!1);if(!player.blocknotice)player.blocknotice=$('<div class="blocked"></div>'),$(".blocked").css("left",Math.floor(b.width/2)-50),$(".blocked").css("top",Math.floor(b.height/2)-50),$(document.body).append(player.blocknotice);player.blockNoticeTimeout=setTimeout(function(){player.blocked&&
(player.blocknotice.show(),$(".blocked").css("left",Math.floor(b.width/2)-50),$(".blocked").css("top",Math.floor(b.height/2)-50))},500)}};player.unblock=function(){if(player.blocked){for(var a=!1,b=0;b<player.blockQueue.length&&!(a=player.blockQueue[b].blocking);b++);if(!a)$(".blocked").hide(),clearTimeout(player.blockNoticeTimeout),player.blockNoticeTimeout=null,clearTimeout(player.blockedTimeout),player.blocked=!1,player.blockQueue=[],player.restartMediaOnUnblock()}};
player.restartMediaOnUnblock=function(){if(!player.blocked)for(key in player.blockableMediaList)player.blockableMediaList[key].actionOnUnblocked()};player.restart=function(){var a=player.timelineManager.getActiveTimelineOwner();a&&a.enablereplay&&!a.resume&&(player.timelineManager.pauseAllTimelines(),"Slide"==a.innerType?a.replaySlide():"Layer"==a.innerType&&(a.timeline.seekTimeline(0),a.timeline.playTimeline()))};
player.initLoadQueue=function(){player.slideLoadQueue=[];player.slideLoadQueue.processing=!0;player.slideLoadQueueExhausted=!1;for(var a=0;a<story.allSlides.length;a++)player.slideLoadQueue.push(a);player.slideLoadQueue.promote=function(a){a=player.slideLoadQueue.indexOf(a);if(0<a)for(a=player.slideLoadQueue.splice(a,player.slideLoadQueue.length-a);a.length;)player.slideLoadQueue.unshift(a.pop());player.slideLoadQueue.restart()};player.slideLoadQueue.restart=function(){if(player.slideLoadQueueExhausted||
!player.slideLoadQueue.processing)player.slideLoadQueue.processing=!0,player.slideLoadQueueExhausted=!1,player.loadResourcesForNextSlide()};player.slideLoadQueue.promote(story.startingSlideIndex)};player.loadResourcesForNextSlide=function(){slideIndex=player.slideLoadQueue.shift();void 0!=slideIndex?player.loadResources(slideIndex):player.slideLoadQueueExhausted=!0};player.loadResources=function(a){0>a||a>story.allSlides.length||player.loadResourcesForSlide(story.allSlides[a])};
player.loadResourcesForSlide=function(a){player.slideLoadQueue.processing=!0;var b=0,c=function(){var c=a.resources.length,e=0;$.each(a.resources,function(f,g){player.isIOS&&(e=player.simplifySlides&&g.item.canSimplify||g.item.deferLoading?e+10:e+100);setTimeout(function(){g.load(f,function(){if(++b>=c&&(a.ready=!0,slideIndex==story.startingSlideIndex))player.ready=!0},!0)},e)})};player.simplifySlides?a.simplify(c):c();a.firstVideoAssetSrc&&(c=Video.getSrcFromStoreReference(a.firstVideoAssetSrc),
Video.addToRefStore(a.firstVideoAssetSrc,c));if(0==a.resources.length){a.ready=!0;if(slideIndex==story.startingSlideIndex||!story.startingSlideIndex)player.ready=!0;player.loadResourcesForNextSlide()}};player.unloadResources=function(){$.each(story.allSlides,function(a,b){(a<player.slideIndex-1||a>player.slideIndex+1)&&$.each(b.resources,function(a,b){b.unload()})})};
player.onLoadedData=function(){player.loadedMediaCount++;player.loadedMediaCount==player.mediaCount&&($("#slideframe").css("opacity","1.0"),player.showSlideID(story.startingslide))};player.reorient=function(a){player.frame.reorient(a)};player.maximize=function(a){a&&!player.maximized?(player.width/=2,player.height/=2,player.reorient(!0)):!a&&player.maximized&&(player.width*=2,player.height*=2,player.reorient(!0));player.maximized=a};
player.revealPreInterstitial=function(){SlideDraw.populateDraws();$("#slideframe").css("opacity","1.0");player.showSlideID(story.startingslide,!1,function(){player.unblock()});player.reorient(!0);player.showControls&&$("#controls").show();player.revealedFirstSlide=!0};
player.revealPostInterstitial=function(){if(player.reorientLaunchInterval)clearInterval(player.reorientLaunchInterval),player.reorientLaunchInterval=null;$("#slideframe").css("opacity","1.0");$(".launch_interstitial").remove();player.revealedFirstSlide||(SlideDraw.populateDraws(),player.showSlideID(story.startingslide,!1,player.play));player.reorient(!0);player.showControls&&$("#controls").show();setTimeout(function(){player.showingInterstitial=!1},500);$(".interstitial").hide();$(".frameInterstitial").hide();
player.playButton.hide();!player.isMobile&&player.isChrome&&player.forceRepaint();clearInterval(player.win7kick);Video.iOSPrepare&&Video.iOSPrepare();Audio.iOSPrepare&&Audio.iOSPrepare()};player.showInterstitial=function(){player.showIOSLaunch()};player.addDiagnosticButton=function(a,b){var c=$('<div class="diagnosticbutton">'+a+"</div>");c.click(b);$("#topbar").append(c)};
player.sniffParameters=function(){$.each(location.search.split("&"),function(a,b){var c=unescape(b.replace("?","")).split("=");switch(c[0].toLowerCase()){case "name":player.storyName=c[1];player.basepath="UserData/Upload/"+c[1]+"/";break;case "usexml":player.loadFromScript=!1;globals.strContentFolder="story_content";break;case "contentfolder":globals.strContentFolder=c[1];break;case "lms":player.useLMS=!0;break;case "ao":globals.bAOSupport=!0;window.g_bAOSupport=!0;player.useAO=!0;player.forceAO=
!0;break;case "tincan":globals.bTinCan=!0,window.g_bTinCan=!0,player.useTinCan=!0}})};player.loadFonts=function(a){player.fontlib=new ppFontLib(player.basepath,$(a).find("bwContent").attr("iosfonts"));g_oFontLib=player.fontlib;player.fontlib.CreateFonts(function(){player.fontready=!0})};player.parseFrameData=function(a){player.frame.loadFromXML($(a));player.frame.slideList.refresh();player.frame.initOrientation()};
player.loadFrame=function(){if(player.frameData)player.parseFrameData(player.frameData);else if(player.loadFromScript){player.parseDataOnLoad=!0;var a=$("<script><\/script>");a.attr("src",player.basepath+globals.strContentFolder+"/frame.js");$(document.body).append(a);setTimeout(function(){if(!player.createdFrameData)player.loadFromScript=!1,player.loadFrame(),$(document.body).append($("<div class='framefailed'></div>"))},5E3)}else a="?random="+Math.random(),$.ajax({url:player.basepath+globals.strContentFolder+
"/frame.xml"+a,dataType:"xml",success:function(a){player.parseFrameData(a)},error:function(){frame.ready=!0}})};player.loadUserScript=function(){$.ajax({url:player.basepath+globals.strContentFolder+"/user.js",dataType:"script",success:function(){},error:function(){return!1}})};player.loadMasks=function(){if(player.maskData)player.parseMaskData(player.maskData);else if(player.loadFromScript)player.parseDataOnLoad=!0};
player.parseMaskData=function(a){player.bitmasks={};$(a).find("maskdata").each(function(a,c){var d=$(c).attr("i"),e=$(c).attr("m");player.bitmasks[d]=e})};
player.load=function(a){player.parseStoryData=function(b){if("string"==typeof b){var b=b.replace(/[\u000a\u000b\u000c\u000d\u0085\u2028\u2029]/g,""),b=b.replace(/&#x[0-8bcef];/ig,""),d;-1<location.search.indexOf("dumpxml=1")&&console.log(b);window.ActiveXObject?(d=new ActiveXObject("Microsoft.XMLDOM"),d.loadXML(b)):d=(new DOMParser).parseFromString(b,"text/xml");b=d}player.courseId=$(b).children("bwContent").attr("courseid");player.lmsManager.initTinCan();if($(b).find("fontlib")&&0>location.search.indexOf("nocanvas"))player.useCanvas=
!0,player.renderVectorShapes=!0,player.renderVectorsAsSVG=!1;story.loadFromXML($(b));if(!globals.strContentFolder||"__CONTENTFOLDER__"==globals.strContentFolder)if(d=$(b).children("bwContent").children("display").attr("framedata"))globals.strContentFolder=d.replace("/frame.xml","");player.loadFrame();player.loadMasks();player.initLoadQueue();player.loadResourcesForNextSlide();player.loadFonts($(b));if(!window.ExecuteScript)window.ExecuteScript=function(){},player.hasUserScript=0<$(story.xml).find("exe_javascript").length,
player.hasUserScript&&player.loadUserScript();if(window&&window.lms_DoFSCommand)window.hasLMS=!0,window.lmsAPI=parent;var e=setInterval(function(){console.suppress=!1;if(player.ready&&player.frame.ready&&player.fontready&&0==story.pendingSceneCount&&player.lmsManager.isReady()){window.globals.bLMS&&window.Start&&window.Start();var d=player.lmsManager.initResume();player.hideLoadingSpinner();window.clearInterval(e);player.showControls&&$("#controls").show();if(!player.frame.defaultLayoutName){var g=
$(b).find("set_frame_layout").first().attr("name");if(g)player.frame.defaultLayoutName=g}player.frame.set_frame_layout();player.frame.updateLayout();player.frame.set_frame_layout();var g=player.hasLMS&&story.resumeLMS||player.lmsManager.hasAO&&player.aoResumeData&&story.resumeLMS||player.lmsManager.hasTinCan&&player.tinCanResumeData&&story.resumeLMS||!player.hasLMS&&!player.lmsManager.hasAO&&!player.lmsManager.hasTinCan&&story.resumeFlash,h="";player.overrideResumeData?h=player.overrideResumeData:
story.resumeLMS&&(player.lmsManager.hasAO||player.lmsManager.hasTinCan||player.lmsManager.hasLMS)?h=player.lmsManager.hasAO&&player.aoResumeData?player.aoResumeData:player.lmsManager.hasTinCan&&player.tinCanResumeData?player.tinCanResumeData:d:story.resumeFlash&&(h=localStorageAlias[story.resumeID]);if((player.resumeData=h)&&g&&!story.resumePrompt){if(player.overrideResumeData)h=player.overrideResumeData;if(player.useCompactResume)try{resumeSuccess=story.updateFromCompactData(h)}catch(j){}else try{story.updateFromData(JSON.parse(h))}catch(l){}player.isMobile&&
player.showInterstitial()}h&&story.resumePrompt?(d=story.parseObjref(story.resumeWindow).target,g=story.parseObjref(story.resumeSlideID).target,player.isMobileFrame?(h=new ResumePrompt,h.loadFromXML(d.xml),h.createRef(),story.children[d.id]=h,h.showSlide(g)):d.showSlide(g),$(".interstitial").hide(),$(".frameInterstitial").hide(),$("#slideframe").css("opacity","1.0"),$("#control-progress").hide(),player.reorient(!0)):player.isMobile?player.showInterstitial():setTimeout(function(){player.simulateIOSPlayer?
player.showInterstitial():player.revealPostInterstitial()},1);a&&a();player.automation.notifyAutomationReady()}},100)};if(player.storyData)player.parseStoryData(player.storyData);else if(player.loadFromScript){player.parseDataOnLoad=!0;var b=$("<script><\/script>");b.attr("src",player.basepath+"mobile/data.js");$(document.body).append(b);setTimeout(function(){if(!player.createdStoryData)$(document.body).append($("<div class='datafailed'></div>")),player.loadFromScript=!1,player.load()},5E3)}else $.ajax({url:player.basepath+
globals.strContentFolder+"/data.xml",dataType:"xml",success:function(a){player.parseStoryData(a)},error:function(a,b){alert("Error loading "+player.basepath+globals.strContentFolder+"/data.xml: "+b)}})};
player.tapZoom=function(a){var b=player.currentSlide().ref;if(player.zoomed)b.css("-webkit-transition-property","none"),b.css("-webkit-transition-duration","0s"),b.css("zoom",1),b.css("-webkit-transform",player.lastSlideTransform),b.css("width","720px"),b.css("height","540px"),setTimeout(function(){b.css("-webkit-transition-property","-webkit-transform");b.css("-webkit-transition-duration","0.4s");b.css("-webkit-transform-origin","top left");b.css("-webkit-transform","translate3d(0px,0px,0px) scale(1.0)")},
0);else{if(!a)return;var c=b.offset(),d=$("#slideframe").css("zoom"),e=(a.originalEvent.changedTouches[0].pageY-c.top)/d,f=parseInt((a.originalEvent.changedTouches[0].pageX-c.left)/d/2),g=parseInt(e/2),a="scale(2.0) translate3d(-"+f+"px,-"+g+"px,0px) ";b.css("-webkit-transition-property","-webkit-transform");b.css("-webkit-transition-duration","0.4s");b.css("-webkit-transform-origin","top left");b.css("-webkit-transform",a);b.css("width","1440px");b.css("height","1080px");player.lastSlideTransform=
a;setTimeout(function(){player.zoomed&&(b.css("-webkit-transition-property","none"),b.css("-webkit-transition-duration","0s"),b.css("zoom",2),b.css("-webkit-transform","translate3d(-"+f+"px,-"+g+"px,0px)"))},400)}player.zoomed=!player.zoomed};var story,tq,windowSize=Frame.getWindowSize(!1);Frame.resizeSpinners();
$(document).bind("ready",function(){player.g_nStartTime=(new Date).getTime();if(window.WebKitMutationObserver)player.renderTimer=document.createElement("DIV"),player.renderTimer.id="renderer",player.renderTimer.style.position="absolute",player.renderTimer.style.visibility="hidden",document.body.appendChild(player.renderTimer),player.renderTimer.observer=new WebKitMutationObserver(function(){player.flushShowQueues()}),player.renderTimer.observer.observe(player.renderTimer,{attributes:!0,subtree:!1}),
player.renderTimer.style.opacity="1";player.automation=new AutomationInterface;player.timelineManager=new TimelineManager;player.iosVersion=player.getIOSversion();player.iPhoneiOS7Greater=7<=player.iosVersion[0]&&player.isIPhone;player.loadingSpinner=$("#loadingSpinner");player.playButton=$("#playButton");player.controlPause=$(".controlbar-button").find(".pausebtn");player.controlPlay=$(".controlbar-button").find(".playbtn");player.controlPause.hide();player.controlPlay.show();player.controlTimeElapsed=
$(".time_elapsed");player.controlTimeRemaining=$(".time_remaining");player.container=$("#slidecontainer");story=new Storyline(player.container);player.frame=new Frame;player.showControls=!0;player.swipeMode="none";player.animations="all";player.simplifySlides=!1;player.lockzoom=!1;player.startTime=new Date;player.sniffParameters();playerDiagnostics.init();player.lmsManager=new LMSManager;player.lmsManager.init();player.initIOS&&player.initIOS();player.load();if("follow"!=player.swipeMode){var a=!1,
b=function(){!a&&!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&(player.currentSlide(),!player.currentWindow&&!player.showingInterstitial&&story.handleEvent("onobjectevent","submit_pressed",null,!1,!1,!0))},c=function(){!a&&!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","next_pressed",null,!1,!1,!0)},d=function(){!a&&!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","prev_pressed",null,!1,!1,!0)},
e=function(){!a&&!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","submitall_pressed",null,!1,!1,!0)},f=function(){!a&&!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&story.handleEvent("onobjectevent","finish_pressed",null,!1,!1,!0)};if(player.isIOS){var g=function(b){!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&(a=!1,1<b.originalEvent.touches.length&&(a=!0))};$(".submit-slide").parent().bind("touchstart",g);$(".label.next").parent().bind("touchstart",
g);$(".label.prev").parent().bind("touchstart",g);$(".submitall").parent().bind("touchstart",g);$(".finish-slide").parent().bind("touchstart",g);$(".submit-slide").parent().bind("touchend",b);$(".submitall").parent().bind("touchend",e);$(".finish-slide").parent().bind("touchend",f);$(".label.next").parent().bind("touchend",function(a){!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&(player.currentSlide().hasSimpleNavigation&&player.timelineManager.pauseAllTimelines(),c(a))});$(".label.prev").parent().bind("touchend",
function(a){!$(this).hasClass("disabled")&&!$(this).hasClass("locked")&&(player.currentSlide().hasSimpleNavigation&&player.timelineManager.pauseAllTimelines(),d(a))})}else $(".submit-slide").parent().bind("click",b),$(".label.next").parent().bind("click",c),$(".label.prev").parent().bind("click",d),$(".submitall").parent().bind("click",e),$(".finish-slide").parent().bind("click",f);$("#control-menu").bind("click",function(){player.frame.slideList.toggle()});$(".button,.controlbar-button").bind("mousedown touchstart",
function(){$(this).addClass("pressed")});$(".button,.controlbar-button").bind("mouseup mouseout touchend",function(){$(this).removeClass("pressed")})}b="click";player.isMobile&&(b="touchend");$("#control-pauseplay .playbtn").bind(b,function(){player.timelineManager.playActiveTimeline()});$("#control-pauseplay .pausebtn").bind(b,function(){player.timelineManager.pauseActiveTimeline()});$("#control-progress > div.progress-bar-button.restart").bind(b,function(){player.restart()});player.volumeSlider=
new VolumeSlider($("#control-volume"));player.volumeSlider.onDragUpdate=function(a){$("audio,video").each(function(b,c){c.volume=Math.min(a*player.clipVolume,1)});Audio.setMasterVolume&&Audio.setMasterVolume(a);VolumeSlider.updateVolumeIcon(a)};$(document.body).bind("touchstart",function(a){if(player.scrollDebug){var b=a.originalEvent.touches;if(!player.touchDivs)player.touchDivs=[];for(var c=0;c<b.length;c++){var d;player.touchDivs[c]?d=player.touchDivs[c]:(d=$("<div class='touchdiv'></div>"),d.css("left",
50*c),$(document.body).append(d),player.touchDivs[c]=d);window!=top?d.css("background-color","red"):d.css("background-color","green");setTimeout(function(){d.hide()},1E3);d.show()}}if(a&&a.originalEvent&&a.originalEvent.touches&&1<=a.originalEvent.touches.length)player.touchStart={left:a.originalEvent.touches[0].pageX,top:a.originalEvent.touches[0].pageY},player.touchFlickDirection=null});$(document.body).bind("touchmove",function(a){var b=a.originalEvent.touches;if(player.scrollDebug){if(!player.touchDivs)player.touchDivs=
[];for(var c=0;c<b.length;c++){var d=player.touchDivs[c];d.css("background-color","orange");setTimeout(function(){d.hide()},1E3);d.show()}}if(2<b.length)return!1;if("video"==a.target.nodeName.toLowerCase()&&a.target.hasAttribute("controls"))return!0;var e=c=!1,f=!1,b=a.target;for(player.scrollDebug&&0!=$(a.target).closest(".slidelist,.toptab").length&&$(".touchdiv").css("background-color","mediumorchid");!c&&b&&b!=document.body;){c=$(b).hasClass("scrollarea")||"auto"==$(b).css("overflow-y");f="TEXTAREA"==
$(b).prop("tagName");if(e=(bwDragPathItem.cargo||DragItem.cargo)&&$(b).hasClass("dragitem"))return player.scrollDebug&&$(".touchdiv").css("background-color","blue"),!0;if(f)return player.scrollDebug&&$(".touchdiv").css("background-color","black"),!0;if(c&&player.touchStart){c=parseInt(a.originalEvent.touches[0].pageX-player.touchStart.left);a=parseInt(a.originalEvent.touches[0].pageY-player.touchStart.top);if(!player.touchFlickDirection)player.touchFlickDirection=Math.abs(c)>Math.abs(a)?"horizontal":
"vertical";return"horizontal"==player.touchFlickDirection||0>=b.scrollTop&&0<a||b.scrollTop>=b.scrollHeight-b.offsetHeight&&0>a?($(".touchdiv").css("background-color","cyan"),!1):!0}b=b.parentNode}(player.isFramedOffset||player.hasNavOutsideFrame)&&$(".touchdiv").css("background-color","purple");return player.isFramedOffset||player.hasNavOutsideFrame});$(window).bind("scroll",function(){return player.isFramedOffset||player.hasNavOutsideFrame});$(window).unbind("keydown");$(window).bind("keydown",
function(a){var b=player.currentSlide();if(b){var c=a.keyCode,d=String.fromCharCode(a.keyCode);if(90<a.keyCode||!/\w/.test(d))c=-1;story.properties.LastKeyCode=c;story.properties.LastKeyCodeString=d;setTimeout(function(){if(player.modalLayer&&player.modalLayer.visible)b=player.modalLayer;b.handleEvent("onkeypress",a,null,!1,!0,!0);b.handleEvent("onanykeypress",a,null,!1,!0,!0);b.deepEach(function(b,c){c.handleEvent&&(c.handleEvent("onkeypress",a,null,!1,!0,!0),c.handleEvent("onanykeypress",a,null,
!1,!0,!0))})},0)}if(13==a.keyCode)return!1;if(a.ctrlKey&&a.shiftKey)switch(a.keyCode){case 49:player.forceRepaint();break;case 50:player.currentSlide().forceRepaint();break;case 51:player.hasAdvanced=!0,story.saveToLocalStorage(),console.log(localStorageAlias[story.resumeID])}return!0});MouseEvents.init();player.progressBar=new ProgressBar(null,$("#progressbar"),!0);player.progressBar.onDragUpdate=function(a){if(player.timelineManager.getActiveTimelineOwner().enableseek){var b=player.timelineManager.getActiveTimelineDuration();
player.timelineManager.seekActiveTimeline(b*a)}};player.lastOrientation=-1;!player.nointervals&&player.isMobile&&setInterval(function(){player.frame.reorient()},100);player.frame.reorient(!0);player.isMobile||($(window).bind("resize",function(){player.reorient(!0)}),$(document.body).bind("dragstart",function(a){a.preventDefault()}));$(window).bind("selectstart",function(){return!1});var h=function(){player.pausedFromBlur=player.timelineManager.getIsAnyTimelinePlaying();player.pausedListFromBlur=player.timelineManager.pauseAllTimelines()},
j=function(){player.pausedFromBlur&&player.timelineManager.retoreAllPausedTimelines(player.pausedListFromBlur);player.pausedFromBlur=!1;player.pausedListFromBlur=[]};player.isIOS&&8>player.iOSMajorVersion?(window.addEventListener("pagehide",h,!1),window.addEventListener("pageshow",j,!1)):document.addEventListener("visibilitychange",function(){"hidden"==document.visibilityState?h():"visible"==document.visibilityState&&j()},!1);player.win7kick=null;if(player.isChrome){var l=0;player.win7kick=setInterval(function(){player.forceRepaint();
5<l++&&clearInterval(player.win7kick)},1E3)}});player.forceRepaint=function(){$(".framewrap").hide();player.uselessOffsetHeight=$(".framewrap").get(0).offsetHeight;$(".framewrap").show()};player.initGlobals=function(){$(document.body).css("background-color",globals.strBgColor);player.scaleToFit="noscale"!=globals.strScale};player.restrictUnsupportedBrowsers=function(){};
window.CreateData=function(a,b){b=b||"storyData";if("string"==typeof a){a=a.replace(/[\u000a\u000b\u000c\u000d\u0085\u2028\u2029]/g,"");a=a.replace(/&#x[0-8bcef];/ig,"");-1<location.search.indexOf("dumpxml=1")&&console.log(a);var c;window.ActiveXObject?(c=new ActiveXObject("Microsoft.XMLDOM"),c.loadXML(a)):c=(new DOMParser).parseFromString(a,"text/xml");a=c}player[b]=a;if(player.parseDataOnLoad&&"storyData"==b)player.createdStoryData=!0,player.parseStoryData(player.storyData)};
window.CreateFrameData=function(a){player.createdFrameData=!0;CreateData(a,"frameData");player.parseDataOnLoad&&player.parseFrameData(player.frameData)};window.CreateMaskData=function(a){player.createdMaskData=!0;CreateData(a,"maskData");player.parseDataOnLoad&&player.parseMaskData(player.maskData)};window.GetPlayer=function(){return player};player.GetVar=function(a){return story.extractVariable(a)};player.SetVar=function(a,b){story.setVariable(a,b)};window.player=player;window.$=$;window.story=story;
var IE6=!1;window.IE6=!1;window.IE6=!1;if(!window.g_bWarnOnCommitFail){var g_bWarnOnCommitFail=!1;window.g_bWarnOnCommitFail=!1;window.g_bWarnOnCommitFail=!1}window.localStorageAlias=window.localStorage;try{window.localStorageTest=window.localStorage.test}catch(e$$66){window.localStorageAlias={},window.localStorageAlias.removeItem=function(){}};player.meta={title:"",description:"",thumburl:"",totalaudio:0,totalvideo:0};player.initIOS=function(){};player.loadMetaData=function(){$.ajax({url:player.basepath+"meta.xml",dataType:"xml",success:function(a){player.parseMetaData(a)},error:function(){}})};
player.parseMetaData=function(a){a=$(a).children("meta").children("project");player.meta.title=a.attr("title");player.meta.thumburl=a.attr("thumburl");player.meta.description=a.children("description").text();player.meta.totalaudio=parseInt(a.attr("totalaudio"));player.meta.totalvideo=parseInt(a.attr("totalvideo"));player.populateIOSLaunch&&player.populateIOSLaunch()};
if(player.isMobile||-1<location.search.indexOf("iosplayer=1")){var isDesktop=-1<location.search.indexOf("iosplayer=1");player.initIOS=function(){player.loadMetaData()};player.prepLaunchButton=function(){var a=document.createElement("canvas");a.width=400;a.height=400;var b=a.getContext("2d");b.translate(200,200);b.beginPath();b.arc(0,0,198,0,2*Math.PI);b.fillStyle="#ddd";b.fill();var c=b.createLinearGradient(0,-200,0,200);c.addColorStop(0,"#444");c.addColorStop(1,"#000");b.beginPath();b.arc(0,0,193,
0,2*Math.PI);b.fillStyle=c;b.fill();b.save();b.beginPath();b.moveTo(140,0);b.rotate(2*Math.PI/3);b.lineTo(140,0);b.rotate(2*Math.PI/3);b.lineTo(140,0);b.closePath();b.fillStyle="#bbb";b.fill();b.restore();a=a.toDataURL();$(".launch_interstitial>a").css("background-image","url("+a+")")};player.showIOSLaunch=function(){if(!player.launch){player.launch=$('<div class="launch_interstitial"><a></a></div>');$(document.body).prepend(player.launch);player.prepLaunchButton();player.launch.show();var a=isDesktop?
"mousedown":"touchstart";player.isIOS&&!player.isIOSlt9&&(a="touchend");player.launch.bind(a,function(a){Video.iOSPrepare&&Video.iOSPrepare();Audio.iOSPrepare&&Audio.iOSPrepare();setTimeout(function(){player.revealPostInterstitial(!0)},0);Frame.requestFullScreen&&Frame.requestFullScreen();a.stopPropagation()});player.populateIOSLaunch();var b=Frame.getWindowSize(!1);if(500>b.width||player.isIPhone){var c=player.launch.find(".screenshot"),d=player.launch.find("h1"),e=player.launch.find(".container"),
f=function(){var a=Frame.getDeviceOrientation(),f=Frame.isPortrait();f?c.insertAfter(d):e.append(c);if(a!=player.lastLaunchOrientation||b.width!=player.lastLaunchWidth||b.height!=player.lastLaunchHeight)player.lastLaunchOrientation=a,player.lastLaunchWidth=b.width,player.lastLaunchHeight=b.height,a=1/player.launch.css("zoom"),f?(e.css("width",(b.width-100)*a+"px"),e.css("height",(b.height-100)*a+"px"),c.insertAfter(d)):(e.css("width",(b.width-80)*a+"px"),e.css("height",(b.height-80)*a+"px"),e.css("margin",
"40px"),e.append(c))};player.reorientLaunchInterval=setInterval(function(){f()},100);window.addEventListener("orientationchange",f);f()}player.frame.updateFrameLayout()}};player.populateIOSLaunch=function(){player.launch&&(player.launch.find("h1").text(player.meta.title),player.launch.find("p").first().text(player.meta.description),player.launch.find("img").first().attr("src",player.basepath+player.meta.thumburl))}};player.isFramed=top!=self;player.isFramedOffset=!1;player.hasNavOutsideFrame=!1;if(player.isFramed){var myFrame=Frame.findCurrentFrame();if(myFrame)player.isFramedOffset=0<myFrame.offsetWidth||0<myFrame.offsetHeight}
if(player.isMobile||-1<location.search.indexOf("iosorient=1"))player.scaleWithTransform=!0,Frame.requestFullScreen=function(){var a=document.documentElement,b=a.requestFullScreen||a.webkitRequestFullScreen||a.mozRequestFullScreen;if(b){b.call(a);var c=window.innerHeight;setInterval(function(){if(window.innerHeight!=c){var a=Frame.isPortrait();player.frame.initOrientation(a,!a);player.frame.reorient(!0)}c=window.innerHeight},300);return!0}return!1},player.iosFrameTop=0,player.iosFrameLeft=0,Frame.prototype.initOrientation=
function(a,b){var c=Frame.isPortrait();window.scrollTo(player.iosFrameTop,player.iosFrameLeft);if(self!=top&&!player.isCrossDomainFrame)if(c&&$(document.body).addClass("portrait"),player.hasNavOutsideFrame=window.innerHeight!=top.window.innerHeight||window.innerWidth!=top.window.innerWidth,player.hasNavOutsideFrame){player.scaleToFit=!0;var d=document.createElement("meta");d.setAttribute("id","viewport");d.setAttribute("name","viewport");d.setAttribute("content","width=device-width, user-scalable=yes");
document.getElementsByTagName("head")[0].appendChild(d);player.getMyFrame=function(){var a=top.document.getElementsByTagName("iframe"),b=window.frameElement;if(!b){for(var c=0;c<a.length;c++)-1<a[c].src.indexOf("index_lms_html5")&&(b=a[c]);!b&&0<a.length&&(b=a[0])}return b};player.walkToTop=function(a,b){var c=a,d=self;do{do b(c);while(c=c.offsetParent||c.parentNode||c.frameElement);c=d=d.parent}while(d!=top);return a};player.updateFrameOffset=function(){var a=player.getMyFrame();if(a){var b=parseInt(a.style.left),
c=parseInt(a.style.top);if(isNaN(b)||isNaN(c))c=b=0;player.walkToTop(a,function(a){b+=a.offsetLeft||0;c+=a.offsetTop||0});player.iosFrameTop=c;player.iosFrameLeft=b}return a};player.popMyFrame=function(){var a=player.updateFrameOffset();if(!player.hasPoppedOut)player.hasPoppedOut=!0,a.style.position="absolute",a.style.left=player.iosFrameLeft+"px",a.style.top=player.iosFrameTop+"px",setTimeout(function(){console.log("scrolling",player.iosFrameLeft,player.iosFrameTop,a.style.left,a.style.top);player.updateFrameOffset();
top.window.scrollTo(player.iosFrameLeft,player.iosFrameTop);console.log("scrolled",player.iosFrameLeft,player.iosFrameTop,a.style.left,a.style.top)},1E3),console.log("popping",player.iosFrameLeft,player.iosFrameTop,a.style.left,a.style.top),setTimeout(function(){top.document.body.appendChild(a);console.log("popped",player.iosFrameLeft,player.iosFrameTop,a.style.left,a.style.top)},0),top.window.scrollTo(player.iosFrameLeft,player.iosFrameTop);return a};player.fitToFrameContainer=function(){var a=function(a){return a.innerWidth||
a.clientWidth||a.style&&!isNaN(parseInt(a.style.width))&&parseInt(a.style.width)||a.width||0},b=function(a){return a.innerHeight||a.clientHeight||a.style&&!isNaN(parseInt(a.style.height))&&parseInt(a.style.height)||a.height||0},c=player.getMyFrame(),d=a(c),e=b(c);player.walkToTop(c,function(c){var f=a(c),c=b(c);f&&c&&(d=Math.min(d,f),e=Math.min(e,c))});window.innerWidth=d;window.innerHeight=e;player.frame.updateFrameLayout()};player.fitToFrameContainer()}else top.window.scrollTo(player.iosFrameLeft,
player.iosFrameTop);else if(player.isCrossDomainFrame&&player.isIOS&&!player.isIOSlt8)player.hasNavOutsideFrame=!0,player.frame.updateFrameLayout();window.scrollTo(0,0);if(!player.hasNavOutsideFrame){var d=Frame.getWindowSize(!0),e=d.width,f=d.height,g=c?f:e,h=c?e:f,d=c?e:f,e=c?f:e,j=story.frameWidth-2,l=story.frameHeight-2;this.containerWidth=j;this.containerHeight=l;$(".framewrap").css("width",j);$(".framewrap").css("height",l);var m=window.screen.width,k=window.screen.height;if(!player.isAndroid&&
!c)m=window.screen.height,k=window.screen.width;f=k-f;c?(e=k-f,d=m,h=m-f,g=k):(h=k-f,g=m,e=m-f,d=k);f=g/h;m=j/l;c=1;if(!a)this.landscapeWidth=g,this.landscapeHeight=h,c=m>f?g/j:h/l,this.aspectRatio=j/l,f=parseInt((h-l*c)/2-1),0>f&&(f=0),m=parseInt((g-j*c)/2-1),0>m&&(m=0),this.containerLeftLandscape=m,this.containerTopLandscape=f,m="top:"+f+"px!important; left:"+m+"px!important;",f=0.5*Math.min(h,g),g=".framewrap{-webkit-transform-origin:top left;-webkit-transform:translate3d(0px,0px,0px) scale("+
c+");width:"+j+"px;height:"+l+"px;"+m+".interstitial{height:"+h+"px;width:"+g+"px;}}"+("div.launch_interstitial>a{width:"+f+"px;height:"+f+"px;margin-left:"+-f/2+"px;margin-top:"+-f/2+"px;"),player.landscapeFrameScale=c,player.frameLandscapeStyleSheet=document.createElement("style"),player.frameLandscapeStyleSheet.media=player.isIOS?"only screen and (max-device-width: 1024px) and (orientation:landscape)":"only screen and (orientation:landscape)",player.frameLandscapeStyleSheet.innerHTML=g,document.body.appendChild(player.frameLandscapeStyleSheet);
if(!b&&(this.portraitWidth=d,this.portraitHeight=e,c=1,c=j/l>d/e?d/j:e/l,f=parseInt((e-l*c)/2-1),0>f&&(f=0),m=parseInt((d-j*c)/2-1),0>m&&(m=0),this.containerLeftPortrait=m,this.containerTopPortrait=f,g="top:"+f+"px!important; left:"+m+"px!important;",f=0.5*Math.min(e,d),d=".framewrap{-webkit-transform-origin:top left;-moz-transform-origin:top left;-ms-transform-origin:top left;-webkit-transform:translate3d(0px,0px,0px) scale("+c+");-moz-transform:translate3d(0px,0px,0px) scale("+c+");-ms-transform:translate(0px,0px) scale("+
c+");width:"+j+"px;height:"+l+"px;"+g+".interstitial{height:"+e+"px;width:"+d+"px;}}"+("div.launch_interstitial>a{width:"+f+"px;height:"+f+"px;margin-left:"+-f/2+"px;margin-top:"+-f/2+"px;"),player.rotatePortraitStyleSheet=document.createElement("style"),player.rotatePortraitStyleSheet.media=player.isIOS?"only screen and (max-device-width: 1024px) and (orientation:portrait)":"only screen and (orientation:portrait)",player.rotatePortraitStyleSheet.innerHTML=d,document.body.appendChild(player.rotatePortraitStyleSheet),
player.portraitFrameScale=c,self!=top))d=d.replace("framewrap","portrait .framewrap").replace("interstitial","portrait .interstitial"),player.rotatePortraitFramedStyleSheet=document.createElement("style"),player.rotatePortraitFramedStyleSheet.innerHTML=d,document.body.appendChild(player.rotatePortraitFramedStyleSheet);setTimeout(function(){player.currentSlide()&&player.currentSlide().ref&&player.currentSlide().fitToContainer()},0)}},Frame.prototype.reInitIfNecessary=function(){if(!player.hasNavOutsideFrame){var a=
Frame.isPortrait(),b=window.innerHeight,c,d,e;player.isCrossDomainFrame||(b=Math.min(window.innerHeight,top.window.innerHeight));var f=window.screen.width,g=window.screen.height;if(!player.isAndroid&&!a)f=window.screen.height,g=window.screen.width;var h=g-b;a?(e=g-h,d=f,c=f-h,b=g):(c=g-h,b=f,e=f-h,d=g);a&&(this.portraitWidth!=d||this.portraitHeight!=e)&&player.frame.initOrientation(!0,!1);!a&&(this.landscapeWidth!=b||this.landscapeHeight!=c)&&player.frame.initOrientation(!1,!0)}},Frame.prototype.reorient=
function(a){player.hasNavOutsideFrame&&player.fitToFrameContainer&&player.fitToFrameContainer();Frame.resizeSpinners();if(1!=player.width){var b=Frame.getDeviceOrientation();if(a||b!=player.lastOrientation&&!player.frame.reorientTimeout){player.frame.reorientTimeout=setTimeout(function(){clearTimeout(player.frame.reorientTimeout);player.frame.reorientTimeout=null;player.frame.reInitIfNecessary()},300);window.scrollTo(0,0);if(!player.isCrossDomainFrame&&(player.hasPoppedOut||!player.hasNavOutsideFrame))player.updateFrameOffset&&
player.updateFrameOffset(),top.window.scrollTo(player.iosFrameLeft,player.iosFrameTop);!player.hasNavOutsideFrame&&player.portraitFrameScale&&!isNaN(player.portraitFrameScale)&&player.landscapeFrameScale&&!isNaN(player.landscapeFrameScale)?Frame.isPortrait()?(player.frameScale=player.portraitFrameScale,player.frame.containerLeft=player.frame.containerLeftPortrait,player.frame.containerTop=player.frame.containerTopPortrait,$(document.body).addClass("portrait")):(player.frameScale=player.landscapeFrameScale,
player.frame.containerLeft=player.frame.containerLeftLandscape,player.frame.containerTop=player.frame.containerTopLandscape,$(document.body).removeClass("portrait")):$(document.body).removeClass("portrait");player.currentZoomImage&&(player.currentZoomImage.zoomedImage.css("-webkit-transition-property",""),player.currentZoomImage.zoomedImage.css("-webkit-transition-duration","0"),player.currentZoomImage.zoomedImage.css("-moz-transition-property",""),player.currentZoomImage.zoomedImage.css("-moz-transition-duration",
"0"),player.currentZoomImage.zoomedImage.css("-ms-transition-property",""),player.currentZoomImage.zoomedImage.css("-ms-transition-duration","0"),player.currentZoomImage.setZoomedCSS(player.currentZoomImage.zoomedImage));player.lastOrientation=b}$.each(story.children,function(a,b){"Window"==b.innerType&&b.resize()})}};if(-1<location.search.indexOf("iosmarker=1"))player.isMobileMarkers=!0;
if(player.isMobile||player.isMobileMarkers)ExpandingLabel.prototype.loadDesktopFromXML=ExpandingLabel.prototype.loadFromXML,ExpandingLabel.prototype.loadFromXML=function(a,b,c){this.loadDesktopFromXML(a,b,c);if(!this.hasContent)a=this.parent,b=$('<onrelease><actions><bringtofront><value type="string" value="_this" /></bringtofront><object_action command="togglecontent"><objref type="string" value="'+this.id+'" /></object_action></actions></onrelease>').get(0),c=new StoryEvent(a),c.loadFromXML(b),
a.events.push(c)},ExpandingLabel.prototype.togglecontent=function(){this.setVisible(!this.visible);this.variables.Expanded=this.visible.toString();this.visible?($(".above").removeClass("above"),$(".showing").removeClass("showing"),this.hideOthers(),this.showContent=!0,this.render(null,!0,this.width,this.expandedHeight),this.show(),this.ref.addClass("above showing"),this.button&&this.button.ref&&this.button.ref.addClass("above showing"),this.bringtofront(),this.button&&this.button.bringtofront(),this.handleEvent("onobjectevent",
"contentin",null,!1,!1,!0),this.handleEvent("onobjectevent","contentincomplete",null,!1,!1,!0)):(this.hide(),$(".above").removeClass("above"),this.handleEvent("onobjectevent","contentout",null,!1,!1,!0),this.handleEvent("onobjectevent","contentoutcomplete",null,!1,!1,!0))},ExpandingLabel.prototype.hidecomplete=function(){this.variables.Expanded="false";this.hide();$(".above").removeClass("above")},ExpandingLabel.prototype.showtitle=function(){},ExpandingLabel.prototype.hidetitle=function(){};player.forceBitMaskTesting=-1<location.search.indexOf("&pixel=");player.isLocalFileSystem="file:"==window.location.protocol&&!player.isMobile;player.usePixelTesting=(player.isMobile||!player.isLocalFileSystem)&&!player.forceBitMaskTesting;
if(player.usePixelTesting)VectorShape.prototype.isPointActive=function(a,b){if(!this.visible)return!1;if(!this.vectorHot)return this.isHotContextPointActive(a,b);var c=this.getCanvasPoint(a,b);return!this.testOver(a,b)||0>c.x||0>c.y||c.x>=this.canvas.width||c.y>=this.canvas.height||this.nearestScrollAreaAncestor&&this.nearestScrollAreaAncestor.hasScrollBars()&&this.nearestScrollAreaAncestor.matrix.unTransformPoint(a,b).x+18>this.nearestScrollAreaAncestor.width||!this.isPointWithinMaskShape(a,b)?!1:
0!=this.context.getImageData(c.x,c.y,1,1).data[3]},StageItem.prototype.testOverlap=function(a){if(0<$(".modalfence:visible").length)return!1;var b=this;if("ItemGroup"==a.innerType||"StateGroup"==a.innerType){var c=!1;$.each(a.children,function(a,d){c=c||b.testOverlap(d)});return c}if("ItemGroup"==b.innerType||"StateGroup"==b.innerType)return c=!1,$.each(b.children,function(d,e){e.testOverlap&&(e.setElementProperty("dragX",b.dragX,!0),e.setElementProperty("dragY",b.dragY,!0),c=c||e.testOverlap(a))}),
c;var d=this.getAABB(),e=a.getAABB(),c=!0;if(d.right<e.left||d.left>e.right||d.bottom<e.top||d.top>e.bottom)c=!1;return this.isRotated||1!=this.slide.scale?c&&this.testRotatedOverlap(a):c&&this.testPixelOverlap&&a.testPixelOverlap?this.testPixelOverlapLowMem(a):c},VectorShape.prototype.testPixelOverlap=function(a){if(player.showDebugOverlap){if(!player.testCanvas)player.testCanvas=$("<canvas id='test' width='1000' height='1000' style='position:absolute;z-index:200;left:0px;top:0px;'></canvas>"),$("#slideframe").append(player.testCanvas),
player.testContext=player.testCanvas.get(0).getContext("2d"),player.testContext.fillStyle="rgba(255,255,0,0.5)";player.testCanvas.show();clearTimeout(player.testCanvasClear);player.testCanvasClear=setTimeout(function(){player.testCanvas.hide()},1E3)}var b=this.slideX()+this.dragX,c=this.slideY()+this.dragY,d=0,e=0,f=0,g=0;a.slideX()>b?(d=a.slideX(),e=b+this.width):(d=b,e=a.slideX()+a.width);a.slideY()>c?(f=a.slideY(),g=c+this.height):(f=c,g=a.slideY()+a.height);b=e-d;c=g-f;if(!(0>=b||0>=c)){if(player.showDebugOverlap&&
(!console.filter||this.id==console.filter||a.id==console.filter))player.testContext.fillStyle="rgba(255,255,0,0.5)",player.testContext.clearRect(0,0,1E3,1E3),player.testContext.fillRect(d,f,b,c);for(var c=this.getCanvasPoint(d,f),c=this.context.getImageData(c.x,c.y,e-d,g-f).data,h=a.getCanvasPoint(d,f),e=a.context.getImageData(h.x,h.y,e-d,g-f).data,g=0;g<c.length-4;g+=256)if(0!=c[g+3]&&0!=e[g+3]){var h=d+g/4%b,j=f+Math.floor(g/4/b),l=a.isPointObscured(h,j,this,function(a){return a.dropArea});if(player.showDebugOverlap&&
(!console.filter||this.id==console.filter||a.id==console.filter))l?(player.testContext.fillStyle="rgba(255,0,0,0.9)",player.testContext.fillRect(h-1,j-1,2,2)):(player.testContext.fillStyle="rgba(0,255,0,0.9)",player.testContext.fillRect(h-2,j-2,4,4));if(!l)return!0}return!1}},VectorShape.prototype.testPixelOverlapLowMem=function(a){var b=this.slideX()+this.dragX,c=this.slideY()+this.dragY,d=0,e=0,f=0,g=0,d=Math.max(a.slideX(),b),e=Math.min(a.slideX()+a.width,b+this.width),f=Math.max(a.slideY(),c),
g=Math.min(a.slideY()+a.height,c+this.height),b=e-d,e=g-f;if(!(0>=b||0>=e)){for(var g=this.getCanvasPoint(d,f),c=a.getCanvasPoint(d,f),e=b*e,h=Math.max(Math.min(parseInt(e/256),64),1),j=0;j<e;j+=h){var l=j%b,m=~~(j/b);if(0!=this.context.getImageData(g.x+l,g.y+m,1,1).data[3]&&0!=a.context.getImageData(c.x+l,c.y+m,1,1).data[3]&&!a.isPointObscured(d+l,f+m,this,function(a){return a.dropArea}))return!0}return!1}};if(-1<location.search.indexOf("iosscroll=1"))player.isMobileScroll=!0;if(!window.AudioContext&&window.webkitAudioContext)window.AudioContext=window.webkitAudioContext;if(window.AudioContext&&!player.isLocalFileSystem&&-1==location.search.indexOf("nowebaudio=1"))try{var createAlias=function(a,b,c){a[b]||(a[b]=a[c])};player.audioContext=new webkitAudioContext;player.hasWebAudio=!0;createAlias(player.audioContext,"createGain","createGainNode");createAlias(player.audioContext,"createDelay","createDelayNode");createAlias(player.audioContext,"createScriptProcessor","createJavaScriptNode")}catch(e$$68){}
if(player.audioContext)Audio.masterVolume=0.8,Audio.playbackStates={UNSCHEDULED:0,SCHEDULED:1,PLAYING:2,FINISHED:3},Audio.decodeOnLoad=!1,Audio.iOSPrepare=function(){var a=player.audioContext.createOscillator();a.type=0;var b=player.audioContext.createGain();a.connect(b);b.connect(player.audioContext.destination);b.gain.value=0;a.start?a.start(0):a.noteOn(0);try{a.stop?a.stop(0):a.noteOff(0)}catch(c){}},Audio.setMasterVolume=function(a){Audio.masterVolume=a;$.each(player.webAudioClips,function(a,
c){if(c.volume)c.volume.gain.value=Audio.masterVolume*player.clipVolume})},Audio.prototype.setVolume=function(a){if(this.volume)this.volume.gain.value=a},Audio.prototype.createRef=function(){if(this.loadStarted)return!1;this.loadClip();player.webAudioClips[this.getFullObjref()]=this;this.currentTime=0;return!0},Audio.prototype.destroyRef=function(){clearTimeout(this.decodeTimeout);delete player.webAudioClips[this.getFullObjref()];this.loadRequest=this.audioData=null;this.audioLoaded=this.decodeOnLoad=
this.loadStarted=!1;this.releaseBuffer();this.destroyBaseRef()},Audio.prototype.loadClip=function(){if(!this.destroyed){var a=this;if(!a.loadStarted){a.source=null;var b=a.content.src;player.noAudioCache&&(b+="?rand="+Math.random());var c=new XMLHttpRequest;c.open("GET",b,!0);c.responseType="arraybuffer";c.onload=function(){if(400>c.status||player.isIE&&1223==c.status)a.audioData=c.response,a.loadRequest=null,a.loadStarted=!1,a.audioLoaded=!0,(Audio.decodeOnLoad||a.decodeOnLoad)&&a.queueDecode()};
c.onerror=function(){a.setSilent()};c.onreadystatechange=function(){4==c.readyState&&400<=c.status&&!(player.isIE&&1223==c.status)&&a.setSilent()};c.onabort=function(){a.setSilent()};c.send();this.loadRequest=c;this.loadStarted=!0}}},Audio.prototype.queueDecode=function(){var a=this;this.audioLoaded?Audio.currentlyDecoding||Slide.currentlyIntegrating?this.decodeTimeout=setTimeout(function(){a.queueDecode()},100):a.decode():(this.decodeOnLoad=!0,this.loadClip())},Audio.prototype.decode=function(){if(!this.decoding&&
!this.decoded&&!this.destroyed){var a=this;this.decoding=Audio.currentlyDecoding=!0;player.audioContext.decodeAudioData(a.audioData,function(b){if(a.decoding&&!a.decoded)a.decoding=!1,Audio.currentlyDecoding=!1,a.releaseOnDecode?(a.releaseOnDecode=!1,a.releaseBuffer()):(a.decoded=!0,a.buffer=b),a.unblockIfBlocked()},function(){a.failedLoad=!0;a.unblockIfBlocked();Audio.currentlyDecoding=!1;a.decoding=!1;a.releaseBuffer()})}},Audio.prototype.releaseBuffer=function(){this.pauseClip();if(player.isMobile||
player.simulateMobileAudio)this.decoding?this.releaseOnDecode=!0:(this.completeInterval&&window.clearInterval(this.completeInterval),this.completeInterval=null,this.source&&this.source.disconnect&&this.source.disconnect(),this.volume&&this.volume.disconnect&&this.volume.disconnect(),this.buffer=null,this.bufferSet=!1,this.source=this.volume=null,this.decoded=!1)},Audio.prototype.reset=function(a){this.resetMedia(a);if(!a)this.pauseClip(),window.clearInterval(this.completeInterval),clearTimeout(this.decodeTimeout),
this.currentTime=0,this.decodeOnLoad=!1},Audio.prototype.readyOrLoad=function(){if(this.decoded)return!0;this.queueDecode();return!1},Audio.prototype.playClip=function(){if(this.syncToTimeline&&this.syncTargetTimeline&&0<=this.triggerTime)this.currentTime=(this.syncTargetTimeline.getCurrentTime()-this.triggerTime)/1E3;else if(this.playState==Media.playState.COMPLETE)this.currentTime=0;if(0>this.currentTime||1E3*this.currentTime>=this.content.duration||!this.decoded&&1E3*this.currentTime>=this.content.duration-
Math.min(200,0.1*this.content.duration))return this.pauseClip(),!1;if(!this.playClipBase())return!1;if(this.source){this.source.onended=null;try{this.source.stop?this.source.stop(0):this.source.noteOff(0)}catch(a){}this.source.disconnect();this.source=null}this.source=player.audioContext.createBufferSource();this.source.buffer=this.buffer;this.volume=player.audioContext.createGain();this.source.connect(this.volume);this.volume.connect(player.audioContext.destination);this.volume.gain.value=Audio.masterVolume*
player.clipVolume;this.contextStartTime=this.source.context.currentTime;this.currentTimeAtStart=this.currentTime;var b=this;this.source.onended=function(){b.audioComplete()};if(isNaN(this.currentTime)||1E3*this.currentTime<player.TICK_DURATION)this.currentTime=0;this.source.start?this.source.start(0,this.currentTime,this.content.duration/1E3-this.currentTime):0==this.currentTime?this.source.noteOn(0):this.source.noteGrainOn(0,this.currentTime,this.content.duration/1E3-this.currentTime);this.completeInterval&&
window.clearInterval(this.completeInterval);b=this;this.completeInterval=window.setInterval(function(){b.source.playbackState==Audio.playbackStates.FINISHED&&b.audioComplete()},player.TICK_DURATION);return!0},Audio.prototype.audioComplete=function(){if(this.playState==Media.playState.PLAYING)window.clearInterval(this.completeInterval),this.playState=Media.playState.COMPLETE,this.handleEvent("onmediacomplete"),this.releaseBuffer()},Audio.prototype.pauseClip=function(){this.pauseSimple();this.pauseClipBase()},
Audio.prototype.pauseSimple=function(){if(this.source){this.currentTime=this.getCurrentTime();this.source.onended=null;try{this.source.stop?this.source.stop(0):this.source.noteOff(0)}catch(a){}this.source.disconnect();this.source=null}window.clearInterval(this.completeInterval)},Audio.prototype.getCurrentTime=function(){if(this.source&&this.source.context&&!isNaN(this.source.context.currentTime)){var a=this.source.context.currentTime-this.contextStartTime+this.currentTimeAtStart;return isNaN(a)?0:
a}return this.currentTime},Audio.prototype.setCurrentTime=function(a){this.currentTime=a};
