/*
Copyright (c) 2000-2012, musictheory.net, LLC.  All 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 materials provided with the distribution.
    * Neither the name of musictheory.net, LLC nor the names of its 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 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MUSICTHEORY.NET, LLC BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-----------------------------------------------------------------------------
Additional credits:
    * Includes swfobject <http://code.google.com/p/swfobject/>, MIT license
    * Some functions based on prototype.js <http://www.prototypejs.org/>, MIT license
    * Feature-detection logic based on Modernizr <http://www.modernizr.com>, MIT license
    * JSON parsing based on json.org's json2.js <http://www.json.org/json2.js>, Public Domain


*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;
if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;
X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);
ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0
}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);
if(ad){ab=ad.GetVariable("$version");if(ab){X=true;
ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]
}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}
}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()
}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)
}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);
f()}});if(O==top){(function(){if(J){return
}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);
return}f()})()}}if(M.wk){(function(){if(J){return
}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);
return}f()})()}s(f)}}();function f(){if(J){return
}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));
Z.parentNode.removeChild(Z)}catch(aa){return
}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()
}}function K(X){if(J){X()}else{U[U.length]=X
}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)
}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)
}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)
}else{if(typeof O.onload=="function"){var X=O.onload;
O.onload=function(){X();Y()}}else{O.onload=Y
}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];
var aa=C(r);aa.setAttribute("width","1");
aa.setAttribute("height","1");aa.setAttribute("style","visibility: hidden");
aa.setAttribute("type",q);var Z=X.appendChild(aa);
if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");
if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]
}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);
return}}X=aa?aa.parentElement:null;if(X){X.removeChild(aa)
}Z=null;H()})()}else{H()}}function H(){var ag=o.length;
if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;
var ab=o[af].callbackFn;var aa={success:false,id:Y};
if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);
if(ab){aa.success=true;aa.ref=z(Y);ab(aa)
}}else{if(o[af].expressInstall&&A()){var ai={};
ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";
ai.height=ae.getAttribute("height")||"0";
if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")
}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")
}var ah={};var X=ae.getElementsByTagName("param");
var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")
}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);
if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;
aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;
var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y
}else{var Z=Y.getElementsByTagName(r)[0];
if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)
}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};
var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);
Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"
}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"
}j.title=j.title.slice(0,47)+" - Flash Player Installation";
var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+encodeURI(O.location).toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;
if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac
}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");
X+="SWFObjectNew";Y.setAttribute("id",X);
ae.parentNode.insertBefore(Y,ae);ae.style.display="none";
(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)
}else{setTimeout(arguments.callee,10)}})()
}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");
Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);
Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)
}else{setTimeout(arguments.callee,10)}})()
}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");
if(M.win&&M.ie){aa.innerHTML=ab.innerHTML
}else{var Y=ab.getElementsByTagName(r)[0];
if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;
for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))
}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);
if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y
}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]
}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'
}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'
}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'
}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";
N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);
Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])
}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])
}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])
}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X
}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);
aa.setAttribute("value",Y);Z.appendChild(aa)
}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";
(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)
}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);
if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null
}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;
try{X=j.getElementById(Z)}catch(Y){}return X
}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);
I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");
X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;
X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false
}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return
}var aa=j.getElementsByTagName("head")[0];
if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";
if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");
Z.setAttribute("type","text/css");Z.setAttribute("media",X);
n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]
}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)
}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))
}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";
if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)
}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;
return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y
}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;
for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])
}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])
}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null
}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};
Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;
Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})
}}},getObjectById:function(X){if(M.w3){return z(X)
}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};
if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);
K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]
}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};
if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]
}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]
}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);
if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an
}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);
return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)
}}},switchOffAutoHideShow:function(){m=false
},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}
},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)
}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)
}},removeSWF:function(X){if(M.w3){y(X)}},disableDetection:function(){T=false
},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)
}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;
if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)
}var Y=Z.split("&");for(var X=0;X<Y.length;
X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))
}}}return""},expressInstallCallback:function(){if(a){var X=c(R);
if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);
if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)
}}a=false}}}}();if(typeof Array.isArray=="undefined"){Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"
}}if(typeof Date.now=="undefined"){Date.now=function(){return new Date().getTime()
}}if(typeof Function.prototype.bind=="undefined"){Function.prototype.bind=function(a){var b=this;
return function(){return b.apply(a,arguments)
}}}if(!this.JSON){this.JSON={}}if(!this.JSON.parse){this.JSON.parse=function(text){var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return eval("("+text+")")
}return null}}var Util=Util||{};Util._LocalizableStrings={};
Util.applyCubicInOutEasing=function(a){if(a<=0.5){return(4*Math.pow(a,3))
}else{return(4*Math.pow(a-1,3)+1)}};Util.applyTemplate=function(f,d){var b=f.split("%");
for(var c=1;c<b.length;c++){var e=b[c];if(e.length==0){continue
}var a=parseInt(e.charAt(0));if(a==0||a>d.length){continue
}b[c]=d[a-1]+e.slice(1)}return b.join("")
};Util.clearAnimation=function(b){if(b){clearInterval(b)
}};Util.endsWith=function(a,b){var c=a.length-b.length;
return c>=0&&a.lastIndexOf(b)===c};Util.getLocalizedString=function(a,b){if(Util._LocalizableStrings&&Util._LocalizableStrings[a]){return Util._LocalizableStrings[a]
}else{return b?b:a}};Util._interpretString=function(a){return a==null?"":String(a)
};Util.gsub=function(e,d,c){var a="",b;if(typeof(d)==="string"){d=RegExp.escape(d)
}if(!(d.length||d.source)){a=c("");return a+e.split("").join(a)+a
}while(e.length>0){if(b=e.match(d)){a+=e.slice(0,b.index);
a+=Util._interpretString(c(b));e=e.slice(b.index+b[0].length)
}else{a+=e,e=""}}return a};Util.installIECompatibility=function(){var b=("abbr,article,aside,audio,canvas,datalist,details,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video").split(",");
for(var a=0;a<b.length;a++){document.createElement(b[a])
}};Util.isEqual=function(b,a){if(b&&b.isEqual&&a&&a.isEqual){return b.isEqual(a)
}else{if((typeof(b)==typeof([]))&&(typeof(a)==typeof([]))){if(b.length==a.length){for(var c=0,d=b.length;
c<d;c++){if(!Util.isEqual(b[c],a[c])){return false
}}return true}else{return false}}else{return(b==a)
}}};Util.log=function(a){if(window.StaticRenderer&&window.StaticRenderer.log_){window.StaticRenderer.log_(a)
}else{if(window.console&&window.console.log){window.console.log(a)
}else{try{console.log(a)}catch(b){}}}};Util.setLocalizedStrings=function(a){Util._LocalizableStrings=a
};Util.identity=function(a){return a};Util.setAnimation=function(d,c){var a=Date.now(),b=0;
b=setInterval(function(){var e=Date.now()-a,f=(e/c);
if(f>=1){f=1;clearInterval(b)}d(f,e)},1);
return b};Util.startsWith=function(a,b){return a.indexOf(b)===0
};Util.trim=function(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")
};var Browser=Browser||{};Browser._detectCSS=function(){var c=Dom.createElement("cssDetector"),b=["borderImage","webkitBorderImage","MozBorderImage","mozBorderImage"];
Dom.writeAttribute(c,"style","display:none;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#000000), to(#000000));background: -moz-linear-gradient(0, #000000, #000000);opacity:.5;border-image:url(m.png) 1 1 stretch;-webkit-transition: opacity 1s linear;-webkit-border-image:url(m.png) 1 1 stretch;-moz-border-image:url(m.png) 1 1 stretch;");
Browser._supportsCSSAnimations=(!!c.style.webkitTransition);
Browser._supportsCSSGradients=(c.style.background.indexOf("-gradient")>=0);
Browser._supportsCSSOpacity=(c.style.opacity=="0.5");
Browser._supportsCSSBorderImages=false;for(var a in b){if(c.style[b[a]]!==undefined){Browser._supportsCSSBorderImages=true;
break}}Browser._detectCSS=Util.identity;Dom.remove(c)
};Browser._detectUA=function(){var a=navigator.userAgent,b=/WebKit/.test(a),c=b&&/Apple.*Mobile.*Safari/.test(a);
Browser._isWebKit=b;Browser._isApplePad=(c&&/iPad.*Apple.*Safari/.test(a))||(/iPad.*AppleWebKit/.test(a)),Browser._isApplePhone=(c&&/(iPhone|iPod).*Apple.*Safari/.test(a))||(/(iPhone|iPod).*AppleWebKit/.test(a)),Browser._isWebOS=b&&!c&&/webOS.*WebKit/.test(a),Browser._isDesktopSafari=b&&!c&&/Safari/.test(a),Browser._isGecko=(a.indexOf("Gecko")>-1)&&!b,Browser._isIE7=/MSIE 7\./.test(a),Browser._isIE8=/MSIE 8\./.test(a),Browser._isMobileWebKit=c||Browser._isWebOS||Browser._isApplePad||Browser._isApplePhone;
Browser._detectUA=Util.identity};Browser.isApplePad=function(){Browser._detectUA();
return Browser._isApplePad};Browser.isApplePhone=function(){Browser._detectUA();
return Browser._isApplePhone};Browser.isMobileWebKit=function(){Browser._detectUA();
return Browser._isMobileWebKit};Browser.isDesktopSafari=function(){Browser._detectUA();
return Browser._isDesktopSafari};Browser.isGecko=function(){Browser._detectUA();
return Browser._isGecko};Browser.isWebKit=function(){Browser._detectUA();
return Browser._isWebKit};Browser.isIE7=function(){Browser._detectUA();
return Browser._isIE7};Browser.isIE8=function(){Browser._detectUA();
return Browser._isIE8};Browser.addDeviceClassNameToBody=function(){var a=document.body;
if(Browser.isMobileWebKit()){if(Browser.isApplePhone()){Dom.addClassName(a,"apple-iphone")
}else{if(Browser.isApplePad()){Dom.addClassName(a,"apple-ipad")
}}Dom.addClassName(a,"mobile-webkit")}else{if(Browser.isWebKit()){Dom.addClassName(a,"desktop-webkit")
}}if(Browser.isWebKit()){Dom.addClassName(a,"webkit")
}};swfobject.addDomLoadEvent(Browser.addDeviceClassNameToBody);
Browser.setViewport=function(a){if(!Browser._viewport){Browser._viewport=Dom.createElement("meta",{name:"viewport"});
Dom.appendChild(document.getElementsByTagName("head")[0],Browser._viewport)
}Dom.writeAttribute(Browser._viewport,"content",a)
};Browser.useNativeResolution=function(a){function b(){var c=a?",minimum-scale=1.0,maximum-scale=1.0":"";
if(window.orientation%180==0){Browser.setViewport("width=device-width"+c);
Dom.removeClassName(document.body,"orientation-landscape");
Dom.addClassName(document.body,"orientation-portrait")
}else{Browser.setViewport("width=device-height"+c);
Dom.addClassName(document.body,"orientation-landscape");
Dom.removeClassName(document.body,"orientation-portrait")
}}if(Browser.isApplePad()){window.onorientationchange=b;
b()}};Browser.prefersTouchEvents=function(){var a=navigator.userAgent;
var c=/(iPad|iPhone|iPod).*Apple.*Safari/.test(a);
if(!c){var b=a.match(/Android\s+([0-9.]+)/);
c=!!b&&(parseFloat(b[1])>=1.5)}if(c){c=("ontouchstart" in document.documentElement)
}Browser.prefersTouchEvents=function(){return c
};return c};Browser.supportsCSSOpacity=function(){Browser._detectCSS();
return Browser._supportsCSSOpacity};Browser.supportsCSSAnimations=function(){Browser._detectCSS();
return Browser._supportsCSSAnimations};Browser.supportsCSSGradients=function(){Browser._detectCSS();
return Browser._supportsCSSGradients};Browser.supportsCSSBorderImages=function(){Browser._detectCSS();
return Browser._supportsCSSBorderImages};
Browser.supportsLocalStorage=function(){return window.localStorage&&localStorage.setItem&&localStorage.getItem
};Browser.supportsSVG=function(){return document&&document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")
};var Common=Common||{};Common.shouldSuppressDonateText=function(){var a=(new UserDefaults("donate-suppress")).readKey("donate-suppress",false);
Common.shouldSuppressDonateText=function(){return a
};return a};Common.setDonateSuppress=function(a){(new UserDefaults("donate-suppress")).write({"donate-suppress":a})
};Common.openURL=function(b,a){setTimeout(function(){window.top.location=b
},50)};Common.viewTenutoSite=function(){Common.trackPageView("/.goal/to-tenuto-site");
Common.openURL("http://www.tenutoapp.com/");
return false};Common.viewTenutoOnAppStore=function(){Common.trackPageView("/.goal/to-app-store");
Common.openURL("http://itunes.apple.com/app/tenuto/id459313476?mt=8");
return false};Common.viewLessonsOnAppStore=function(){Common.trackPageView("/.goal/to-app-store");
Common.openURL("http://itunes.apple.com/app/theory-lessons/id493157418?mt=8");
return false};Common.viewAppStore=function(){Common.trackPageView("/.goal/to-app-store");
Common.openURL("itms://itunes.apple.com/artist/musictheory.net/id459313479");
return false};Common.createDonateElement=function(g){var h=(g=="lesson"),e=Dom.createTextNode("If this "+g+" "+(h?"helped":"helps")+" you, please consider "),d=Dom.createTextNode("purchasing our iPhone apps"),b=Dom.createTextNode(", or "),a=Dom.createTextNode("donating"),k=Dom.createTextNode(".  Thanks! :)"),c=Dom.createElement("div"),j=Dom.createElement("div",{},d),i=Dom.createElement("div",{},a);
if(h){c.style.fontSize="12px";c.style.color="#808080"
}else{Dom.appendChild(document.body,c);if(Browser.isMobileWebKit()){c.style.paddingTop="46px"
}else{c.style.position="fixed";c.style.bottom="0px";
c.style.backgroundColor="#E9EDF1";c.style.borderTop="1px solid #97A5B9"
}c.style.width="100%";c.style.height="23px";
c.style.lineHeight="23px";c.style.fontSize="12px";
c.style.color="#515C66";c.style.textAlign="center"
}function f(l,m){l.style.display="inline";
l.style.color="#3E444C";l.style.fontWeight="bold";
l.style.textDecoration="none";l.style.cursor="pointer";
l.onclick=m}Dom.appendChildren(c,[e,j,b,i]);
if(!h){Dom.appendChild(c,k)}f(j,function(){Common.trackPageView("/.goal/app-store-plea-click");
(new UserDefaults("donate-click-time")).write({"donate-click-time":Date.now()});
Common.viewAppStore()});f(i,function(){Common.trackPageView("/.goal/donate-plea-click");
(new UserDefaults("donate-click-time")).write({"donate-click-time":Date.now()});
Common.openURL("/donate")});Common.trackPageView("/.goal/donate-plea-view",true);
return c};Common.isStaticRenderer=function(){return !!window.StaticRenderer
};Common.saveStaticContent=function(){window.StaticRenderer&&window.StaticRenderer.save&&window.StaticRenderer.save()
};var _gaq;Common.installTracker=function(){_gaq=_gaq||[];
_gaq.push(["_setAccount","UA-5397012-1"]);
_gaq.push(["_trackPageview"]);_gaq.push(["_setDomainName","none"]);
var a=document.createElement("script");a.type="text/javascript";
a.async=true;a.src="http://www.google-analytics.com/ga.js";
(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)
};Common.trackPageView=function(a,c){if(_gaq&&c){_gaq.push(["_trackPageview",a])
}else{if(window._gat){var b=window._gat._getTrackerByName();
if(b&&b._trackPageview){b._trackPageview(a)
}}}};Common.markNoBounce=function(a){if(_gaq){if(!a){a="markNoBounce()"
}_gaq.push(["_trackEvent","NoBounce",a]);
Common.markNoBounce=Util.identity}};Common.popUpPiano=function(){window.open("/piano","PopUpPiano","width=829,height=237,menubar=0,location=0,toolbar=0,status=0,resizable=0,scrollbars=0")
};var Dom=Dom||{};Dom._classNameRegExp=function(a){return new RegExp("(^|\\s)"+a+"(\\s|$)")
};Dom.addClassName=function(a,b){if(!Dom.hasClassName(a,b)){a.className+=(a.className?" ":"")+b
}};Dom.appendChild=function(a,c){try{a.appendChild(c)
}catch(b){throw ("Dom.appendChild("+a+", "+c+"): "+b)
}};Dom.appendChildren=function(c,b){for(var a=0;
a<b.length;a++){c.appendChild(b[a])}};Dom.createElement=function(b,a){var e=document.createElement(b);
for(var d in a){Dom.writeAttribute(e,d,a[d])
}for(var c=2;c<arguments.length;c++){Dom.appendChild(e,arguments[c])
}return e};Dom.createVectorImage=function(d,b,c,a,e){if(Browser.supportsSVG()){if(Browser.isWebKit()&&!Browser.isMobileWebKit()){return Dom.createElement("img",{src:d,"class":b,width:c,height:a})
}}return e};Dom.createTextNode=function(a){return document.createTextNode(a)
};Dom.getElementById=function(a){if(!a){return null
}else{if(typeof(a)===typeof("")){return document.getElementById(a)
}else{return a}}};var $=Dom.getElementById;
Dom.getElementsByTagName=function(b,a){return b.getElementsByTagName(a)
};Dom.hasClassName=function(a,b){return(a&&a.className&&a.className.length>0&&(a.className==b||Dom._classNameRegExp(b).test(a.className)))
};Dom.getStyle=function(b,c){var d=b.style[c];
if(!d||d=="auto"){if(b.currentStyle){d=b.currentStyle[c]
}else{if(document.defaultView){var a=document.defaultView.getComputedStyle(b,null);
d=a?a[c]:null}}}return d=="auto"?null:d};
Dom.getDimensions=function(c){var g=Dom.getStyle(c,"display");
if(g!="none"&&g!=null){return[c.offsetWidth,c.offsetHeight]
}var b=c.style;var f=b.visibility;var d=b.position;
var a=b.display;b.visibility="hidden";if(d!="fixed"){b.position="absolute"
}b.display="block";var h=c.clientWidth;var e=c.clientHeight;
b.display=a;b.position=d;b.visibility=f;return[h,e]
};Dom.getCumulativeOffset=function(a){var c=0,b=0;
do{c+=a.offsetLeft||0;b+=a.offsetTop||0;a=a.offsetParent
}while(a);return[c,b]};Dom.getChildElements=function(d){var e=d.childNodes;
var a=[];for(var c=0;c<e.length;c++){var b=e[c];
if(b.nodeType==1){a.push(b)}}return a};Dom.getTargetOfEvent=function(b){var a=b.target||b.srcElement;
if(a&&a.nodeType==3){a=a.parentNode}return a
};Dom.getMouseCoordinatesOfEvent=function(a){if(a.pageX||a.pageY){return[a.pageX,a.pageY]
}else{if(a.clientX||a.clientY){return[a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a.clientY+document.body.scrollTop+document.documentElement.scrollTop]
}else{return[0,0]}}};Dom.prependChild=function(a,c){var b=a.firstChild;
if(b){a.insertBefore(c,b)}else{a.appendChild(c)
}};Dom.observe=function(a,b,c){var d=function(e){c(e||window.event)
};a["on"+b]=d};Dom.observeLoad=function(a){swfobject.addDomLoadEvent(a)
};Dom.readAttribute=function(b,a){if(a=="class"){return b.className
}else{if(a=="style"){return b.style.cssText
}else{return b.getAttribute(a)}}};Dom.remove=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)
};Dom.removeAllChildren=function(a){while(a.childNodes.length){a.removeChild(a.childNodes[0])
}};Dom.removeClassName=function(b,c){if(!b){return
}var a=b.className.replace(Dom._classNameRegExp(c)," ");
b.className=Util.trim(a)};Dom._setFilterAlpha=function(a,d){if(d>=1||d===""){if(a.style.removeAttribute){a.style.removeAttribute("filter")
}}if(d<0.00001){d=0}var b=a.style,c=b.display;
b.display="none";b.filter="alpha(opacity="+Math.floor(d*100)+")";
b.display=c};Dom._setOpacity=function(a,b){a.style.opacity=b
};Dom.setOpacity=function(a,c){var b=(Browser.supportsCSSOpacity()?Dom._setOpacity:Dom._setFilterAlpha);
Dom.setOpacity=b;b(a,c)};Dom.setDisplayed=function(a,c){var b=a.style;
if(c){if(b.removeProperty){b.removeProperty("display")
}else{b.display=""}}else{b.display="none"
}};Dom.setVisible=function(b,a){if(a===undefined||a===null){b.style.visibility=""
}else{b.style.visibility=a?"visible":"hidden"
}};Dom.stopEvent=function(a){if(a){if(a.stopPropagation){a.stopPropagation()
}if(a.preventDefault){a.preventDefault()}a.cancelBubble=true;
a.returnValue=false}};Dom.unobserve=function(c,d){var b=document.getElementById("moo2");
c["on"+d]=null};Dom.update=function(b,c,a){if(a){b.innerHTML=c
}else{if(b.textContent!==undefined){b.textContent=c
}else{if(b.innerText!==undefined){b.innerText=c
}}}return b};Dom.writeAttribute=function(b,a,c){if(a=="class"){b.className=c
}else{if(a=="style"){b.style.cssText=c}else{b.setAttribute(a,c)
}}};var Aria=Aria||{};Aria._id=0;Aria._getIdForElement=function(a){var b=Dom.readAttribute(a,"id");
if(!b){b="aria_"+Aria._id++;Dom.writeAttribute(a,"id",b)
}return b};Aria._addRelationship=function(g,d,f){var b=Aria._getIdForElement(g),a=[],c,e;
if(!Array.isArray(f)){f=[f]}for(c=0,e=f.length;
c<e;c++){a.push(Aria._getIdForElement(f[c]))
}Dom.writeAttribute(g,d,a.join(" "))};Aria._setBoolean=function(b,a,c){Dom.writeAttribute(b,a,c?"true":"false")
};Aria.role=function(a,b){Dom.writeAttribute(a,"role",b)
};Aria.labelledBy=function(b,a){Aria._addRelationship(b,"aria-labelledby",a)
};Aria.owns=function(b,a){Aria._addRelationship(b,"aria-owns",a)
};Aria.setChecked=function(a,b){Aria._setBoolean(a,"aria-checked",b)
};Aria.setEnabled=function(a,b){Aria._setBoolean(a,"aria-disabled",!b)
};var Fader=Fader||{};Fader._fadeInOrOutImmediate=function(c,f,g,h){var d;
for(var a=0,b=c.length;a<b;a++){d=c[a];Dom.setVisible(d,!g);
Dom.setOpacity(d,1)}if(h){h()}};Fader._fadeInOrOutCSS=function(f,g,h,j){function e(){for(var a=0,b=f.length;
a<b;a++){var c=f[a];c.style.opacity=(h?"1":"0");
Dom.setVisible(c,true)}setTimeout(d,0)}function d(){for(var a=0,b=f.length;
a<b;a++){f[a].style.webkitTransition="opacity "+g+"ms ease-in-out"
}setTimeout(i,0)}function i(){for(var a=0,b=f.length;
a<b;a++){f[a].style.opacity=(h?"0":"1")}if(j){setTimeout(j,g+1)
}}setTimeout(function(){for(var a=0,b=f.length;
a<b;a++){var c=f[a];Dom.setVisible(c,!h);
c.style.opacity="";c.style.webkitTransition=""
}},g);e()};Fader._fadeInOrOutJS=function(a,f,k,j){var d=Date.now(),c=0,b=a.length,g;
if(!k){for(g=0;g<b;g++){var h=a[g];Dom.setOpacity(h,0);
Dom.setVisible(h,true)}}return Util.setAnimation(function(l){if(l>=1){if(k){for(g=0;
g<b;g++){var i=a[g];Dom.setVisible(i,false);
Dom.setOpacity(i,1)}}else{for(g=0;g<b;g++){Dom.setOpacity(a[g],1)
}}if(j){j()}}else{if(k){l=1-l}for(g=0;g<b;
g++){Dom.setOpacity(a[g],l)}}},f)};Fader.abort=function(a){if(a){Util.clearAnimation(a)
}};Fader.fadeIn=function(a,b,d){var c=0;if(b==0){Fader._fadeInOrOutImmediate(a,b,false,d)
}else{if(Browser.supportsCSSAnimations()){Fader._fadeInOrOutCSS(a,b,false,d)
}else{c=Fader._fadeInOrOutJS(a,b,false,d)
}}return c};Fader.fadeOut=function(a,b,d){var c=0;
if(b==0){Fader._fadeInOrOutImmediate(a,b,true,d)
}else{if(Browser.supportsCSSAnimations()){Fader._fadeInOrOutCSS(a,b,true,d)
}else{c=Fader._fadeInOrOutJS(a,b,true,d)}}return c
};Point=function(a,b){this.x=a;this.y=b};
Point.prototype.clone=function(){return new Size(this.x,this.y)
};Size=function(b,a){this.width=b;this.height=a
};Size.prototype.clone=function(){return new Size(this.width,this.height)
};Rect=function(b,d,c,a){this.origin=new Point(b,d);
this.size=new Size(c,a)};Rect.prototype.clone=function(){return new Rect(this.origin.x,this.origin.y,this.size.width,this.size.height)
};Range=function(b,a){this._lowest=(b>a)?a:b;
this._highest=(b>a)?b:a};Range.prototype.getArray=function(){var a=[];
for(var b=this._lowest;b<=this._highest;b++){a.push(b)
}return a};Range.prototype.getHighestNumber=function(){return this._highest
};Range.prototype.getLowestNumber=function(){return this._lowest
};Range.prototype.include=function(a){return(a>=this._lowest&&a<=this._highest)
};Range.prototype.fix=function(b,a,c){if((this._highest-this._lowest)<c){this._highest=this._lowest+c;
if(this._highest>a){this._highest=a;this._lowest=this._highest-c
}}};var Clickable=Clickable||{};Clickable.install=function(b,d,a){Clickable._Initialize();
var c=a?a:{};c.activate=d;c.element=b;if(c.stop===undefined){c.stop=true
}if(Browser.prefersTouchEvents()){Dom.observe(b,"touchstart",Clickable._handleTouchStart.bind(c));
Dom.observe(b,"touchend",Clickable._handleTouchEnd.bind(c));
Dom.observe(b,"touchcancel",Clickable._handleTouchCancel.bind(c))
}else{Dom.observe(b,"mousedown",Clickable._handleMouseDown.bind(c));
Dom.observe(b,"mouseup",Clickable._handleMouseUp.bind(c));
Dom.observe(b,"mouseover",Clickable._handleMouseOver.bind(c));
Dom.observe(b,"mouseout",Clickable._handleMouseOut.bind(c));
Dom.observe(b,"click",Clickable._handleClick.bind(c));
if(c.doubleClick){Dom.observe(b,"dblclick",Clickable._handleDoubleClick.bind(c))
}}};Clickable.setDisablePanning=function(a){Clickable._disablePanning=a
};Clickable._Initialize=function(){var a=function(b){var d=Clickable._currentContext;
if(d){if(d.up){d.up(b,d.element,d.tag)}delete (Clickable._currentContext)
}};if(Browser.prefersTouchEvents()){document.body.addEventListener("touchstart",a,false);
document.body.addEventListener("touchend",a,false)
}else{Dom.observe(document.body,"mouseup",a);
Dom.observe(document.body,"mousedown",a)}Clickable._Initialize=Util.identity
};Clickable._handleTouchStart=function(b){if(b.targetTouches.length!=1){return false
}if(this.down){this.down(b,this.element,this.tag)
}this.didMoveTooFar=false;this.startX=b.targetTouches[0].clientX;
this.startY=b.targetTouches[0].clientY;this._handleTouchMove=Clickable._handleTouchMove.bind(this);
this._handleTouchEnd=Clickable._handleTouchEnd.bind(this);
var c=Dom.getCumulativeOffset(this.element),a=Dom.getDimensions(this.element);
this.minX=c[0];this.minY=c[1];this.maxX=c[0]+a[0];
this.maxY=c[1]+a[1];this.element.addEventListener("touchmove",this._handleTouchMove,false);
if(Clickable._disablePanning){Dom.stopEvent(b)
}};Clickable._handleTouchMove=function(c){if(c.targetTouches.length!=1){return false
}var b=c.targetTouches[0].clientX,a=c.targetTouches[0].clientY;
if(b<this.minX||b>this.maxX||a<this.minY||a>this.maxY){this.didMoveTooFar=true;
if(this.up){this.up(c,this.element,this.tag)
}}};Clickable._handleTouchEnd=function(a){if(a.targetTouches.length>0){return false
}if(!this.didMoveTooFar){if(this.activate){this.activate(a,this.element,this.tag)
}if(this.up){this.up(a,this.element,this.tag)
}}delete (Clickable._currentContext);if(this.stop){Dom.stopEvent(a)
}this.element.removeEventListener("touchmove",this._handleTouchMove,false);
return false};Clickable._handleTouchCancel=function(a){this.didMoveTooFar=true;
Clickable._handleTouchEnd(a)};Clickable._handleMouseDown=function(a){if(this.down){this.down(a,this.element,this.tag)
}Clickable._currentContext=this;if(this.stop){Dom.stopEvent(a)
}};Clickable._handleMouseUp=function(a){if(this.up){this.up(a,this.element,this.tag)
}delete (Clickable._currentContext);if(this.stop){Dom.stopEvent(a)
}};Clickable._handleMouseOver=function(a){if(Clickable._currentContext==this){if(this.down){this.down(a,this.element,this.tag)
}if(this.stop){Dom.stopEvent(a)}}if(this.over){this.over(a,this.element,this.tag)
}};Clickable._handleMouseOut=function(a){if(Clickable._currentContext==this){if(this.up){this.up(a,this.element,this._tag)
}if(this.stop){Dom.stopEvent(a)}if(this.out){this.out(a,this.element,this.tag)
}}};Clickable._handleClick=function(a){if(this.activate){this.activate(a,this.element,this.tag)
}delete (Clickable._currentContext);if(this.stop){Dom.stopEvent(a)
}};Clickable._handleDoubleClick=function(a){if(this.doubleClick){this.doubleClick(a,this.element,this.tag)
}};Highlighter=function(a,b){this._parent=a;
this._elements=b;this._setVisible(false)};
Highlighter.prototype._setVisible=function(c){for(var a=0,b=this._elements.length;
a<b;a++){Dom.setVisible(this._elements[a],c?null:false)
}};Highlighter.prototype._setHighlightColor=function(a){Dom.removeClassName(this._parent,"Highlighter-color-.*?");
if(a){Dom.addClassName(this._parent,"Highlighter-color-"+a)
}};Highlighter.prototype.removeHighlight=function(){if(this._isHighlighted){if(this._flashAnimation){this._flashAnimation.abort()
}this._setVisible(false);this._setHighlightColor(null);
this._isHighlighted=false}};Highlighter.prototype.highlight=function(a){this._setHighlightColor(a);
Fader.abort(this._fade);this._setVisible(true);
this._isHighlighted=true};Highlighter.prototype.flash=function(a){this._setHighlightColor(a);
this._setVisible(true);this._fade=Fader.fadeOut(this._elements,250)
};Timer=function(c,b,a){this._callback=c;
this._previous=0;this._delay=b;if(!!a){this._previous=a
}this.start()};Timer.prototype.reset=function(){var a=this._interval;
this.stop();this._previous=0;if(a){this.start()
}};Timer.prototype.start=function(){if(!this._interval){this._start=Date.now();
this._interval=setInterval(this._callback,this._delay)
}};Timer.prototype.stop=function(){if(this._interval){this._previous=this.getElapsed();
clearInterval(this._interval);delete (this._interval)
}};Timer.prototype.getElapsed=function(){return(Date.now()-this._start)+this._previous
};UserDefaults=function(a){this._domain=a
};UserDefaults.prototype.remove=function(a){try{if(window.localStorage&&localStorage.removeItem){localStorage.removeItem(this._domain)
}}catch(b){}};UserDefaults.prototype.readKey=function(b,a){var c=this.read()[b];
return(c!==undefined)?c:a};UserDefaults.prototype.write=function(c,f){try{if(window.JSON&&window.localStorage&&JSON.stringify&&localStorage.removeItem&&localStorage.setItem){if(f){var a=this.read(),b;
for(b in c){a[b]=c[b]}c=a}localStorage.removeItem(this._domain);
localStorage.setItem(this._domain,JSON.stringify(c))
}}catch(d){}};UserDefaults.prototype.read=function(f){try{if(window.JSON&&window.localStorage&&JSON.parse&&localStorage.getItem){var d=localStorage.getItem(this._domain),c,a;
if(d){c=JSON.parse(d)}if(c){if(typeof(c)!=typeof({})){throw ("UserDefaults: root type not an object")
}for(a in f){if(c[a]==undefined){c[a]=f[a]
}if(typeof(c[a])!=typeof(f[a])){throw ("UserDefaults: type mismatch for key '"+a+"', resetting to defaults")
}}return c}}}catch(b){Util.log(b)}return f?f:{}
};Button=function(d,e,b,c){if(!c){c={}}this._domElement=$(d);
this._callback=e;this._role=(c&&c.role)?c.role:"button";
this._isEnabled=true;this._tag=b;var a={down:this._handleDown.bind(this),up:this._handleUp.bind(this)};
if(Browser.isIE7()||Browser.isIE8()){a.doubleClick=this._handleIEDoubleClick.bind(this);
this._domElement.onselectstart=function(){return false
}}Clickable.install(this._domElement,this.click.bind(this),a);
this._useVector=Browser.supportsCSSGradients()&&!Browser.isApplePad();
this._readClassHierarchy(d.className);this._buildInterior();
Aria.role(this._domElement,this._role);this.reset()
};Button.prototype.setTag=function(a){this._tag=a
};Button.prototype.getTag=function(){return this._tag
};Button.prototype.setEnabled=function(a){Aria.setEnabled(this._domElement,a);
this._isEnabled=a;this._writeClassHierarchy();
if(this._useCloak&&this._cloakElement){Dom.setOpacity(this._cloakElement,a?0:0.5)
}};Button.prototype.isEnabled=function(){return this._isEnabled
};Button.prototype.setVisible=function(a){Dom.setVisible(this._domElement,a)
};Button.prototype._setState=function(a){if(this._classState!=a){this._classState=a;
this._writeClassHierarchy()}};Button.prototype.select=function(){if(this._role=="radio"){Aria.setChecked(this._domElement,true)
}this._setState("selected");this._isSelected=true
};Button.prototype.reset=function(){if(this._role=="radio"){Aria.setChecked(this._domElement,false)
}this._setState("normal");Dom.removeClassName(this._domElement,"Button-red");
this._isSelected=false;this._highlighter.removeHighlight();
this._isRed=false};Button.prototype.goGhost=function(){this.setEnabled(false);
Dom.remove(this._backgroundParent);this._highlighter.highlight("ghost")
};Button.prototype._buildInterior=function(){var a=[],f,c,e;
if(this._useCloak){a.push((this._cloakElement=Dom.createElement("div",{"class":"Button-cloak"})))
}if(this._useVector){if(this._leftCap=="curved"){this._additionalClasses+=" Button-vector-left-curved"
}if(this._rightCap=="curved"){this._additionalClasses+=" Button-vector-right-curved"
}if(this._rightCap=="square"){this._additionalClasses+=" Button-vector-right-square"
}a.push(Dom.createElement("div",{"class":"Button-vector-outline"}));
this._backgroundParent=Dom.createElement("div",{"class":"Button-vector-background"});
a.push(this._backgroundParent);var d=Dom.createElement("div",{"class":"Button-vector-highlight"});
this._highlighter=new Highlighter(d,[d]);
a.push(d)}else{var g=(this._leftCap=="pill"?" Button-image-background-middle-pill":""),d,b,i,h;
this._backgroundParent=Dom.createElement("div",{"class":"Button-image-div Button-image-backgrounds"},Dom.createElement("div",{"class":"Button-image-div Button-image-background-left-"+this._leftCap}),Dom.createElement("div",{"class":"Button-image-div Button-image-background-middle"+g}),Dom.createElement("div",{"class":"Button-image-div Button-image-background-right-"+this._rightCap}));
a.push(this._backgroundParent);d=Dom.createElement("div",{"class":"Button-image-div Button-image-highlights"},(b=Dom.createElement("div",{"class":"Button-image-div Button-image-highlight-left-"+this._leftCap})),(i=Dom.createElement("div",{"class":"Button-image-div Button-image-highlight-middle"})),(h=Dom.createElement("div",{"class":"Button-image-div Button-image-highlight-right-"+this._rightCap})));
this._highlighter=new Highlighter(d,[b,i,h]);
a.push(d)}a.push(Dom.createElement("div",{"class":"Button-content-container"},(f=Dom.createElement("div",{"class":"Button-content"}))));
c=this._domElement.firstChild,e;while(c){e=c.nextSibling;
Dom.appendChild(f,c);c=e}Dom.appendChildren(this._domElement,a)
};Button.prototype._readClassHierarchy=function(d){var a=[],f=d.split(/\s+/),c=false;
this._classType="rounded";this._leftCap="curved";
this._rightCap="curved";for(var e=0;e<f.length;
e++){var b=f[e];if(b=="Button-segmented-first"){this._rightCap="square"
}else{if(b=="Button-segmented-middle"){this._leftCap="square";
this._rightCap="square"}else{if(b=="Button-segmented-last"){this._leftCap="square"
}else{if(b=="Button-pill"){a.push(b);c=true
}else{if(b=="Button-sub"){this._isSubButton=true
}else{if(b=="Button-cloaked"){this._useCloak=true
}else{if(b!="Button"){a.push(b)}}}}}}}}if(c){this._leftCap="pill";
this._rightCap="pill"}this._additionalClasses=a.join(" ")
};Button.prototype._writeClassHierarchy=function(a){var b="-"+this._classState;
classes=[(this._isSubButton?"Button-sub":"Button"),"Button"+b];
if(this._additionalClasses.length){classes.push(this._additionalClasses)
}if(this._isRed){classes.push("Button-red")
}if(!this._isEnabled){classes.push("Button-disabled")
}this._domElement.className=classes.join(" ")
};Button.prototype._handleDown=function(){if(this._isEnabled&&!this._isSelected){this._setState("pressed")
}};Button.prototype._handleUp=function(){if(!this._isSelected){this._setState("normal")
}};Button.prototype._handleIEDoubleClick=function(){if(this._isEnabled){this._setState("pressed");
this.click();setTimeout(function(){if(this._isEnabled){this._setState("normal")
}}.bind(this),100)}};Button.prototype.click=function(){if(this._isEnabled&&this._callback){this._callback(this)
}};Button.prototype.imitateUserClick=function(){if(this._isSelected){return
}if(this._isEnabled){this._setState("pressed")
}setTimeout(function(){if(this._isEnabled){this._setState("normal")
}this.click()}.bind(this),100)};Button.prototype._updateTooltips=function(){var b="",a="\n";
if(Browser.isGecko()){a="  \u2014  "}if(this._tooltip){b+=this._tooltip
}if(this._tooltip&&this._keytip){b+=a}if(this._keytip){b+="Keyboard: "+this._keytip
}Dom.writeAttribute(this._domElement,"title",b)
};Button.prototype.setTooltip=function(a){this._tooltip=a;
this._updateTooltips()};Button.prototype.setKeytip=function(a){this._keytip=a;
this._updateTooltips()};Button.prototype.getTooltip=function(){return this._tooltip
};Button.prototype.highlightRed=function(){this._isRed=true;
this._highlighter.highlight("red");this._writeClassHierarchy()
};Button.prototype.highlightGreen=function(){this._highlighter.highlight("green")
};Button.prototype.flashGreen=function(){this._highlighter.flash("green")
};Button.prototype.flashRed=function(){this._highlighter.flash("red")
};GlyphSetter=function(b,a,c){if(!GlyphSetter._Instances){GlyphSetter._Instances=[]
}GlyphSetter._Instances.push(this);GlyphSetter._Initialize();
if(!b&&!Browser.isMobileWebKit()){GlyphSetter._SetupResizer()
}this._glyphsToResize=[];this._vectorSize=""+a;
this._useImage=Browser.isWebKit();if(b){if(c){this.resize=this._resizeVectorAccidentals
}else{this.resize=Util.identity}this._createAccidental=this._createVectorAccidental
}else{this.resize=this._resizeRasterAccidentals;
this._createAccidental=this._createRasterAccidental
}};GlyphSetter._Initialize=function(){GlyphSetter._Initialize=Util.identity;
GlyphSetter._AccidentalID=0;if(Common.isStaticRenderer()){GlyphSetter.prototype._convertNoteNames=Util.identity;
GlyphSetter.prototype._convertLoneAccidentals=Util.identity;
GlyphSetter.prototype._convertAnalysisSymbols=function(a){return a.split("h").join("\u00f8")
}}GlyphSetter._SpeechMap={bb:"-double-flat",b:"-flat","#":"-sharp",x:"-double-sharp"};
GlyphSetter._VectorMap={"18":{bb:["doubleflat",11,18,"/v2c/c04e813fa111fe34dac33c13a0095c6e630a1e90/v2/images/doubleflat_18.svg"],b:["flat",6,18,"/v2c/52bee42426dec329a0da355e8e26677ee7e32972/v2/images/flat_18.svg"],"#":["sharp",6,18,"/v2c/cb1a35ea5c7e6ec578b54b394ef42dcdf34e80d8/v2/images/sharp_18.svg"],x:["doublesharp",8,8,"/v2c/12bbe02e40640b47acbd4490df526cbb1ad6f68a/v2/images/doublesharp_18.svg"]},"24":{bb:["doubleflat",14,24,"/v2c/ef76db55f0b8281e90fc622e703a3278a4179e4c/v2/images/doubleflat_24.svg"],b:["flat",8,24,"/v2c/98879e3a865c802de298836385c5009c006fc470/v2/images/flat_24.svg"],"#":["sharp",7,24,"/v2c/cfb405e42e9e5b020fb806a18a67f8df49f859b4/v2/images/sharp_24.svg"],x:["doublesharp",11,11,"/v2c/61c0b15672bd4b4d9015f5b09b68674f833e4096/v2/images/doublesharp_24.svg"]},"32":{bb:["doubleflat",21,30,"/v2c/91e96e95abe23df73d81c3cfa43f520dbce14d17/v2/images/doubleflat_32.svg"],b:["flat",11,30,"/v2c/ce1dbf67468306a88c945eabecf6ed95c1058725/v2/images/flat_32.svg"],"#":["sharp",12,32,"/v2c/e995e8b7dbf315c4554a9ae7040854f84eaab043/v2/images/sharp_32.svg"],x:["doublesharp",15,15,"/v2c/4bb2bb73fb570c19b2bc1e20102e7adbb7838a64/v2/images/doublesharp_32.svg"]}}
};GlyphSetter._SetupResizer=function(){GlyphSetter._SetupResizer=Util.identity;
Dom.appendChild(document.body,Dom.createElement("div",{style:"position: absolute; top: -1000px"},Dom.createElement("iframe",{id:"_GlyphSetterResizeDetector",style:"width: 1em; height: 1em",src:"/v2c/1627aa6758e80e452e3f99994849c1678c5e3ce1/v2/support/resizer.html"})));
var a=function(){var c,d,b;for(c=0,d=GlyphSetter._Instances.length;
c<d;c++){b=GlyphSetter._Instances[c];b.resize.call(b)
}};GlyphSetter.onHandleTextResize=a};GlyphSetter.prototype._createVectorAccidental=function(b,a){var d=GlyphSetter._VectorMap[this._vectorSize];
if(!d){return b}var c=d[b];if(!c){return b
}this._glyphsToResize.push(a);if(this._useImage){return'<span class="glyph-text">'+GlyphSetter._SpeechMap[b]+'</span><img id="glyph-toresize-'+a+'" class="glyph-svg-accidental glyph-svg-accidental-'+c[0]+"-"+this._vectorSize+'" src="'+c[3]+'" width="'+c[1]+'" height="'+c[2]+'">'
}else{return'<span class="glyph-text">'+GlyphSetter._SpeechMap[b]+'</span><object id="glyph-toresize-'+a+'" class="glyph-svg-accidental glyph-svg-accidental-'+c[0]+"-"+this._vectorSize+'" data="'+c[3]+'" width="'+c[1]+'" height="'+c[2]+'" type="image/svg+xml"></object>'
}};GlyphSetter.prototype._createRasterAccidental=function(b,a){var c={bb:"glyph-double-flat",b:"glyph-flat",n:"glyph-natural","#":"glyph-sharp",x:"glyph-double-sharp"}[b];
if(!c){return b}this._glyphsToResize.push(a);
return'<span class="glyph-accidental '+c+'"><span class="glyph-text">'+b+'</span><span id="glyph-toresize-'+a+'" class="glyph-image glyph-size-0"></span></span>'
};GlyphSetter.prototype._convertNoteNames=function(a){return Util.gsub(a,/^_?([A-Ha-h])([b#xn]*)$/,function(c){var b='<span class="glyph-note">';
if(c[2]){if(c[2]&&(c[2].length>2)){b+='<span style="color: red" class="glyph-name">'+c[1]+""+c[2]+"</span>"
}else{GlyphSetter._AccidentalID++;b+='<span id="glyph-control-'+GlyphSetter._AccidentalID+'" class="glyph-name glyph-has-accidental-suffix">'+c[1]+"</span>"+this._createAccidental(c[2],GlyphSetter._AccidentalID)
}}else{b+='<span class="glyph-name">'+c[1]+"</span>"
}return(b+"</span>")}.bind(this))};GlyphSetter.prototype._convertAnalysisSymbols=function(a){return Util.gsub(a,/^([b#xn]*)([IViv]+|N|Gr|It|Fr|Sw)([+oh]?)([2-7]?)([2-7]?)$/,function(f){var b='<span class="glyph-analysis">',e=f[1],d=f[2],h=f[3],g=f[4],c=f[5];
var i="";if(d.toUpperCase()==d){i+=" glyph-name-uppercase"
}else{if(d.toLowerCase()==d){i+=" glyph-name-lowercase"
}}if(f[1]){GlyphSetter._AccidentalID++;b+=this._createAccidental(e,GlyphSetter._AccidentalID);
if(Util.endsWith(e,"b")&&Util.startsWith(d,"V")){i+=" glyph-kern-b-V"
}else{i+=" glyph-has-accidental-prefix"}b+='<span id="glyph-control-'+GlyphSetter._AccidentalID+'" class="glyph-name '+i+'">'+d+"</span>"
}else{b+='<span class="glyph-name '+i+'">'+d+"</span>"
}if(h){if(h=="h"){h="\u00f8"}b+='<span class="glyph-chord-symbol">'+h+"</span>"
}if(g||c){b+='<span class="glyph-chord-segment">';
if(g){b+='<span class="glyph-chord-upper">'+g+"</span>"
}if(c){b+='<span class="glyph-chord-lower">'+c+"</span>"
}b+="</span>"}return(b+"</span>")}.bind(this))
};GlyphSetter.prototype._convertLoneAccidentals=function(a){return Util.gsub(a,/^([b#xn]+)$/,function(c){var b='<span class="glyph-lone-accidental">';
GlyphSetter._AccidentalID++;b+='<span id="glyph-control-'+GlyphSetter._AccidentalID+'" class="glyph-lone-accidental-control">&nbsp;</span>'+this._createAccidental(c[1],GlyphSetter._AccidentalID)+"&nbsp;</span>";
return(b+"</span>")}.bind(this))};GlyphSetter.prototype.createElement=function(a){var c="";
a=Util.gsub(a,/<>/,function(d){return(d[0]=="<")?"&lt;":"&gt;"
});a=Util.gsub(a,/''(.*?)''/,function(e){var d=e[1];
return(d.length>0)?"&ldquo;"+d+"&rdquo;":"''"
});a=Util.gsub(a,/\*(.*?)\*/,function(e){var d=e[1];
return(d.length>0)?"<b>"+d+"</b>":"*"});a=Util.gsub(a,/_(.*?)_/,function(e){var d=e[1];
return(d.length>0)?"<i>"+d+"</i>":"_"});a=Util.gsub(a,/\-(\-\-|\-|\>)/,function(e){var d=e[1];
if(d=="--"){return"&mdash;"}else{if(d=="-"){return"&ndash;"
}else{if(d==">"){return"&rarr;"}else{return"-"
}}}});a=Util.gsub(a,/\{(.*?)\}/,function(e){var d=e[1];
d=this._convertLoneAccidentals(d);d=this._convertNoteNames(d);
d=this._convertAnalysisSymbols(d);return d
}.bind(this));var b=Dom.createElement("span");
b.innerHTML=a;return b};GlyphSetter.prototype._resizeVectorAccidentals=function(){var a,b,d,c;
for(a=0,b=this._glyphsToResize.length;a<b;
a++){d=$("glyph-toresize-"+this._glyphsToResize[a]);
c=Dom.getCumulativeOffset(d);if((c[0]%2)==1){Dom.addClassName(d,"glyph-svg-nudge-width")
}}};GlyphSetter.prototype._resizeRasterAccidentals=function(){var c,e,d,a,b,f;
if(this._glyphsToResize.length){for(c=0,e=this._glyphsToResize.length;
c<e;c++){f=$("glyph-control-"+this._glyphsToResize[c]);
if(f){break}}if(f){a=Dom.getDimensions(f)[1];
if(a<=14){b=1}else{if(a<=16){b=2}else{if(a<=18){b=3
}else{if(a<=22){b=4}else{b=5}}}}}}for(c=0;
c<this._glyphsToResize.length;c++){d=$("glyph-toresize-"+this._glyphsToResize[c]);
if(!d){this._glyphsToResize.splice(c--,1);
continue}Dom.removeClassName(d,"glyph-size-[0-9]+");
Dom.addClassName(d,"glyph-size-"+b)}};NavBar=function(e,b,d){if(!e){Dom.prependChild(document.body,(e=Dom.createElement("nav")))
}this._domElement=$(e);this._leftDiv=Dom.createElement("div",{"class":"NavBar-left"});
this._rightDiv=Dom.createElement("div",{"class":"NavBar-right"});
this._leftSegmentDivs=[];this._leftSegmentURLs=[];
this._leftArrowDivs=[];this._selectedSegment=NavBar.NoSelection;
Dom.addClassName(document.body,"NavBar-body");
Dom.addClassName(this._domElement,"NavBar");
if(!Browser.supportsCSSGradients()){Dom.addClassName(this._domElement,"NavBar-background-image")
}Dom.appendChild(this._domElement,this._leftDiv);
Dom.appendChild(this._domElement,this._rightDiv);
var c=Dom.createElement("span",{"class":"NavBar-home"});
this.addCrumb(c,"/");var a=Dom.createElement("span",{"class":"NavBar-piano"});
this._pianoSegment=this._createSegment(a,true,NavBar.PianoTag);
Dom.prependChild(this._rightDiv,this._pianoSegment)
};NavBar.NoSelection=-1;NavBar.SettingsTag=-2;
NavBar.PianoTag=-3;NavBar.prototype.alignElementToTop=function(a){Dom.addClassName(a,"NavBar-top")
};NavBar.prototype._updateSelection=function(){var c,d,f;
function g(e){Dom.removeClassName(e,"NavBar-state-(.*?)");
Dom.removeClassName(e,"NavBar-background-image")
}function b(h,j,i){var e="NavBar-state-"+(j?"down":"up")+"-"+(i?"down":"up");
Dom.addClassName(f,"NavBar-background-image");
Dom.addClassName(f,e)}function a(h,e){Dom.addClassName(f,"NavBar-state-"+(e?"down":"up"))
}d=this._leftArrowDivs.length;for(c=0;c<d;
c++){f=this._leftArrowDivs[c];g(f);b(f,c==this._selectedSegment,c==(this._selectedSegment-1))
}d=this._leftSegmentDivs.length;for(c=0;c<d;
c++){f=this._leftSegmentDivs[c];g(f);a(f,c==this._selectedSegment)
}f=this._settingsSegment;if(f){g(f);a(f,this._selectedSegment==NavBar.SettingsTag)
}f=this._pianoSegment;if(f){g(f);a(f,this._selectedSegment==NavBar.PianoTag)
}};NavBar.prototype._createSegment=function(e,c,b){var d=Dom.createElement("span",{"class":"NavBar-segment"});
if(c){Dom.addClassName(d,"NavBar-clickable");
Clickable.install(d,this._handleSegmentClick.bind(this),{tag:b,up:this._handleSegmentUp.bind(this),down:this._handleSegmentDown.bind(this)})
}var a=Dom.createElement("span",{"class":"NavBar-contents"});
if(typeof(e)==typeof("")){Dom.update(a,e)
}else{Dom.appendChild(a,e)}Dom.appendChild(d,a);
return d};NavBar.prototype._handleSegmentClick=function(c,b,a){if(a==NavBar.SettingsTag){this._settingsAction()
}else{if(a==NavBar.PianoTag){Common.popUpPiano()
}else{window.location=this._leftSegmentURLs[a]
}}};NavBar.prototype._handleSegmentDown=function(c,b,a){this._selectedSegment=a;
this._updateSelection()};NavBar.prototype._handleSegmentUp=function(b,a){this._selectedSegment=NavBar.NoSelection;
this._updateSelection()};NavBar.prototype.addCrumb=function(c,a){if(this._leftSegmentDivs.length>0){var d;
Dom.appendChild(this._leftDiv,Dom.createElement("span",{"class":"NavBar-arrow-container"},(d=Dom.createElement("span",{"class":"NavBar-arrow"}))));
this._leftArrowDivs.push(d)}var b=this._createSegment(c,!!a,this._leftSegmentDivs.length);
Dom.appendChild(this._leftDiv,b);this._leftSegmentDivs.push(b);
this._leftSegmentURLs.push(a);this._updateSelection()
};NavBar.prototype.getRightActionCenterOffset=function(){var b=Dom.getDimensions(this._settingsSegment)[0];
var a=Dom.getDimensions(this._pianoSegment)[0];
return a+(b/2)};NavBar.prototype.getRightInfoElement=function(){if(!this._rightInfoSegment){this._rightInfoSegment=this._createSegment("",false);
Dom.prependChild(this._rightDiv,this._rightInfoSegment);
Dom.addClassName(this._rightInfoSegment,"NavBar-right-info")
}return this._rightInfoSegment.getElementsByTagName("span")[0]
};NavBar.prototype.setSettingsAction=function(b){if(!this._settingsSegment){var a=Dom.createElement("span",{"class":"NavBar-gear"});
this._settingsSegment=this._createSegment(a,true,NavBar.SettingsTag);
Dom.prependChild(this._rightDiv,this._settingsSegment);
this._updateSelection()}this._settingsAction=b
};Note=function(b,c,a){this._letter=b;this._quality=c;
this._octave=a};Note.getTonicNoteForKeySignature=function(d,c,b){if((d<-7)||(d>7)){d=0
}var a=[54,24,64,35,5,45,15,55,25,65,36,6,46,16,56,4,44,14,54,24,64,35,5,45,15,55,25,65,36,6][(c?22:7)+d];
return Note.newNoteWithTag_octave(a,b)};Note.newNoteWithLetter_quality_octave=function(b,c,a){return(new Note()).initWithLetter_quality_octave(b,c,a)
};Note.newNoteWithTag_octave=function(a,b){return(new Note()).initWithTag_octave(a,b)
};Note.newNoteWithMIDIValue=function(a){return(new Note()).initWithMIDIValue(a)
};Note.newNoteWithClef_staffPosition_quality=function(b,a,c){return(new Note()).initWithClef_staffPosition_quality(b,a,c)
};Note.diatonicNoteWithClef_staffPosition_keySignature=function(c,a,b){return(new Note()).initWithClef_staffPosition_quality(c,a,-100,b)
};Note.prototype.initWithLetter_quality_octave=function(b,c,a){this._letter=b;
this._quality=c;this._octave=a;return this
};Note.prototype.initWithTag_octave=function(a,b){var c=Math.floor(a/10),d=(a%10)-5;
return this.initWithLetter_quality_octave(c,d,b)
};Note.prototype.initWithMIDIValue=function(b){var c=Math.floor(b/12)-1,a=[5,6,15,16,25,35,36,45,46,55,56,65][b%12];
return this.initWithTag_octave(a,c)};Note.prototype.initWithClef_staffPosition_quality=function(e,b,g,f){var d=e+b,c=d%7,a=Math.floor(d/7);
if(g==-100&&(f!==undefined)){g=Note._getAccidentalTypeForKeySignature(c,0,f);
if(g==0){g=(f<0)?-1:1}}if(g===undefined||g==-100){g=0
}return this.initWithLetter_quality_octave(c,g,a)
};Note.prototype.initDiatonicNoteWithClef_staffPosition_keySignature=function(c,a,b){return this.initWithClef_staffPosition_quality(c,a,-100,b)
};Note._getMIDIValue=function(b,d,a){var c=[12,14,16,17,19,21,23][b];
c+=(a*12);c+=d;return c};Note._getAccidentalTypeForKeySignature=function(a,c,b){if(c==0){c=-100
}if(b<0){if([6,4,2,7,5,3,1][a]<=(b*=-1)){if(c==-1){c=-100
}else{if(c==-100){c=0}}}}else{if(b>0){if([2,4,6,1,3,5,7][a]<=b){if(c==1){c=-100
}else{if(c==-100){c=0}}}}}return c};Note.prototype.getLetterDescription=function(){var a=["C","D","E","F","G","A","B"][this._letter];
var c=this._quality;if(c>=-2&&c<=2){a+=["bb","b","","#","x"][c- -2]
}else{if(c<-2){for(var b=0;b>c;b--){a+="b"
}}else{if(c>2){for(var b=0;b<c;b++){a+="#"
}}}}return a};Note.prototype.toString=function(){return(this.getLetterDescription()+this._octave.toString())
};Note.prototype.isEqual=function(a){return this._letter==a._letter&&this._octave==a._octave&&this._quality==a._quality
};Note.prototype.applyInterval=function(b,d){var f=(d||(d===undefined))?1:-1,e=this._letter+(f*b.getDiatonicDelta()),c=this._octave,h=Math.floor(e/7),a,g;
c+=h;if(e<0){e+=(-1*h*7)}e=e%7;a=Note._getMIDIValue(e,0,c);
g=this.getMIDIValue()+(f*b.getChromaticDelta())-a;
return Note.newNoteWithLetter_quality_octave(e,g,c)
};Note.prototype.applyIntervals=function(c,d,g){var f=(d||(d===undefined))?1:-1,a=[this],b,e;
for(b=0,e=c.length;b<e;b++){a.push(this.applyInterval(c[b]))
}if(g&&(typeof g=="number")){while(g>0){if(a[0]){a[0]._octave+=f;
a.push(a.shift())}else{break}g--}}return a
};Note.prototype.getStaffPositionForClef=function(a){return((this._octave*7)+this._letter)-a
};Note.prototype.getAccidentalTypeForKeySignature=function(a){return Note._getAccidentalTypeForKeySignature(this._letter,this._quality,a)
};Note.prototype.getMIDIValue=function(){return Note._getMIDIValue(this._letter,this._quality,this._octave)
};Note.prototype.getLetter=function(){return this._letter
};Note.prototype.setOctave=function(a){this._octave=a
};Note.prototype.getOctave=function(){return this._octave
};Note.prototype.getQuality=function(){return this._quality
};Note.prototype.getTag=function(){return(this._letter*10)+5+this._quality
};Interval=function(){};Interval._isPerfectType=function(b){var a=b%7;
return(a==1||a==4||a==5)};Interval.newIntervalWithTag=function(a){return(new Interval()).initWithTag(a)
};Interval.newIntervalWithQuality_type=function(b,a){return(new Interval()).initWithQuality_type(b,a)
};Interval.prototype.initWithTag=function(a){var b=Math.floor(a/10),c=Math.floor(a%10)-5;
if(Interval._isPerfectType(b)&&(c<0)){c--
}return this.initWithQuality_type(c,b)};Interval.prototype.initWithQuality_type=function(e,d){var c=(d-1),b=0,a=Interval._isPerfectType(d);
b+=[0,2,4,5,7,9,11][c%7];b+=(12*Math.floor(c/7));
b+=e;if(e<=-2&&a){b++}this._quality=e;this._type=d;
this._diatonicDelta=c;this._chromaticDelta=b;
return this};Interval.prototype.isEqual=function(a){return this._diatonicDelta==a._diatonicDelta&&this._chromaticDelta==a._chromaticDelta
};Interval.prototype.getQuality=function(){return this._quality
};Interval.prototype.getType=function(){return this._type
};Interval.prototype.getDiatonicDelta=function(){return this._diatonicDelta
};Interval.prototype.getChromaticDelta=function(){return this._chromaticDelta
};Chord=function(){};Chord.newChordWithTag=function(a){return(new Chord).initWithTag(a)
};Chord.prototype.initWithTag=function(a){var c=[];
function b(e,d){c.push(Interval.newIntervalWithQuality_type(e,d))
}switch(a){case 0:b(0,3);b(0,5);break;case 1:b(-1,3);
b(0,5);break;case 2:b(-1,3);b(-2,5);break;
case 3:b(0,3);b(1,5);break;case 4:b(0,3);
b(0,5);b(-1,7);break;case 5:b(0,3);b(0,5);
b(0,7);break;case 6:b(-1,3);b(0,5);b(-1,7);
break;case 7:b(-1,3);b(-2,5);b(-2,7);break;
case 8:b(-1,3);b(-2,5);b(-1,7);break;case 9:b(0,3);
b(0,5);b(1,6);break;case 10:b(0,3);b(1,6);
break;case 11:b(0,3);b(1,4);b(1,6);break;
case 12:b(0,3);b(2,4);b(1,6);break;case 13:b(-1,3);
b(-1,6);break;case 14:b(-1,3);b(0,5);b(0,7);
break;case 15:b(0,3);b(1,5);b(-1,7);break;
case 16:b(0,3);b(1,5);b(0,7);break}this._tag=a;
this._intervals=c;return this};Chord.prototype.getIntervals=function(){return this._intervals
};Chord.prototype.getTag=function(){return this._tag
};Scale=function(){};Scale.newScaleWithTag=function(a){return(new Scale()).initWithTag(a)
};Scale.prototype.initWithTag=function(a){var c=[];
var b=function(e,d){c.push(Interval.newIntervalWithQuality_type(e,d))
};switch(a){case 4:case 0:b(0,2);b(0,3);b(0,4);
b(0,5);b(0,6);b(0,7);break;case 9:case 1:b(0,2);
b(-1,3);b(0,4);b(0,5);b(-1,6);b(-1,7);break;
case 2:b(0,2);b(-1,3);b(0,4);b(0,5);b(-1,6);
b(0,7);break;case 3:b(0,2);b(-1,3);b(0,4);
b(0,5);b(0,6);b(0,7);break;case 5:b(0,2);
b(-1,3);b(0,4);b(0,5);b(0,6);b(-1,7);break;
case 6:b(-1,2);b(-1,3);b(0,4);b(0,5);b(-1,6);
b(-1,7);break;case 7:b(0,2);b(0,3);b(1,4);
b(0,5);b(0,6);b(0,7);break;case 8:b(0,2);
b(0,3);b(0,4);b(0,5);b(0,6);b(-1,7);break;
case 10:b(-1,2);b(-1,3);b(0,4);b(-2,5);b(-1,6);
b(-1,7);break;case 11:b(0,2);b(0,3);b(0,5);
b(0,6);break;case 12:b(-1,3);b(0,4);b(1,4);
b(0,5);b(-1,7);break;case 13:b(0,2);b(0,3);
b(1,4);b(1,5);b(1,6);break;case 14:b(-1,2);
b(0,2);b(-1,3);b(0,3);b(0,4);b(-2,5);b(0,5);
b(-1,6);b(0,6);b(-1,7);b(0,7);break}this._tag=a;
this._intervals=c;return this};Scale.prototype.getIntervals=function(){return this._intervals
};Scale.prototype.getTag=function(){return this._tag
};AnalysisSymbol=function(){};AnalysisSymbol.newSymbolWithTag=function(a){return(new AnalysisSymbol()).initWithTag(a)
};AnalysisSymbol.prototype.initWithTag=function(a){var b=[[15,0],[25,1],[35,1],[45,0],[55,0],[65,1],[75,2],[65,4],[75,4],[15,4],[25,4],[35,4],[16,7],[26,7],[35,7],[46,7],[56,7],[16,8],[26,8],[35,8],[46,8],[56,8],[15,1],[25,2],[34,0],[45,1],[55,1],[64,0],[74,0],[25,8],[75,7],[74,4],[15,4],[25,4],[34,4],[45,4],[25,7],[35,7],[46,7],[55,7],[65,7],[25,8],[35,8],[46,8],[55,8],[65,8],[45,13],[64,9],[64,10],[64,11],[64,12],[0,0],[0,0],[0,0],[0,0],[26,7],[66,7],[35,0],[34,0],[34,1],[65,0],[64,0],[64,1],[34,1],[35,1],[35,0],[64,1],[65,1],[65,0]][a];
if(b){this._intervalFromTonic=Interval.newIntervalWithTag(b[0]);
this._chord=Chord.newChordWithTag(b[1])}return this
};AnalysisSymbol.prototype.getIntervalFromTonic=function(){return this._intervalFromTonic
};AnalysisSymbol.prototype.getChord=function(){return this._chord
};
