(function(a){var f,h;a.fn.Ribbon=function(j){function k(b){a(".menu li a:first").addClass("active");a(".menu li ul").hide();a(".menu li a:first").parent().children("ul:first").show();a(".menu li a:first").parent().children("ul:first").addClass("submenu");a(".menu li > a").click(function(){l(this)});a(".orbButton").click(function(){m(b.backStage)});a(".orb ul").hide();a(".orb ul ul").hide();a(".orb li ul li ul").show();a(".orb li li ul").each(function(){a(this).prepend('
a(".ribbon-list div ul:visible").parent().offset().top+a(".ribbon-list div ul:visible").parent().height();if(e||g){a(".ribbon-list div ul:visible").each(function(){a(this).fadeOut("fast")});a(".ribbon-list div").css("background-image","")}})});a(".orb li li a").mouseover(function(){i(this)});a(".menu li > a").dblclick(function(){a("ul .submenu").animate({height:"hide"});a("body").animate({paddingTop:a(this).parent().parent().parent().parent().height()});h=true})}function n(){a(".menu li a").removeClass("active");
a(".menu ul").removeClass("submenu");a(".menu li ul").hide()}function l(b){a(".orb ul").fadeOut("fast");a(b).next().css("display");n();a(b).addClass("active");a(b).parent().children("ul:first").addClass("submenu");a(b).parent().children("ul:first").show();a("body").css("padding-top","120px");h=false}function i(b,c){if(!d.backStage)if((a(b).parent().children("ul").css("display")=="none"||a(b).parent().children("ul").length==0)&&a(b).parent().parent().parent().parent().hasClass("orb")){a(".orb li li ul").fadeOut("fast");
a(b).parent().children("ul").length>0&&a(b).parent().children("ul").fadeIn("fast")}if(d.backStage){if(a(b).parent().children("ul").length==0&&a("ul.ribbon-backstage .ribbon-backstage-firstLevel .ribbon-backstage-subMenu:first:hidden").length>0&&a(b).parent().parent().parent().parent().hasClass("orb")){a(".orb li li ul").fadeOut("fast");a(".orb li li > div").fadeOut("fast");a("ul.ribbon-backstage .ribbon-backstage-firstLevel:first .ribbon-backstage-subMenu:first").fadeIn("fast");a("ul.ribbon-backstage .ribbon-backstage-firstLevel:first div").fadeIn("fast")}if(a(b).parent().children("ul").css("display")==
"none"&&a(b).parent().children("ul").length>0&&a(b).parent().parent().parent().parent().hasClass("orb")){a(".orb li li ul").fadeOut("fast");a(".orb li li > div").fadeOut("fast");a(b).parent().children("ul").fadeIn("fast");a(b).parent().children("div").fadeIn("fast")}if(c){a(".orb li li ul").hide();a(".orb li li > div").hide();a(b).parent().children("ul").fadeIn("fast");a(b).parent().children("div").fadeIn("fast")}}}function m(b){if(b){a("ul.ribbon-backstage .ribbon-backstage-firstLevel .ribbon-backstage-subMenu").height(a(window).height()*
0.9);a("ul.ribbon-backstage .ribbon-backstage-firstLevel div.ribbon-backstage-rightColumnWide").height(a(window).height()*0.9).width(a(window).width());a("ul.ribbon-backstage .ribbon-backstage-firstLevel div.ribbon-backstage-rightColumnSmall").parent().children("ul").width(a(window).width()).addClass("ribbon-backstage-leftColumnWide");a("ul.ribbon-backstage .ribbon-backstage-firstLevel div.ribbon-backstage-rightColumnSmall").height(a(window).height()*0.9).width("200px");a("ul.ribbon-backstage .ribbon-backstage-firstLevel div.ribbon-backstage-rightColumnSmall").css("left",
a(window).width()-200).css("line-height","17px");a(".orb ul").animate({opacity:"toggle"},"fast");i(a(".orb li li a:first"),true)}else a(".orb ul").animate({opacity:"toggle"},"fast")}function o(b){b.altKey&&a('div[rel="accesskeyhelper"]').each(function(){a(this).css("top",a(this).parent().offset().top).css("left",a(this).parent().offset().left-20+a(this).parent().width());a(this).show()})}function p(){a('div[rel="accesskeyhelper"]').hide()}var d=a.extend({theme:"windows7",backStage:false},j||{});a(".ribbon a").each(function(){a(this).attr("accesskey")&&
a(this).append(''+a(this).attr("accesskey")+"
")});a("head").append(' " />');f||k(d);a(document).keydown(function(b){o(b)});
a(document).keyup(function(b){p(b)});a(".ribbon").parents().click(function(b){var c=b.pageX