Object.extend(Event,(function(){var a={};return{delegate:function(d,c){var g={};if(arguments[3]){g[arguments[2]]=arguments[3]}else{g=Object.extend({},arguments[2])}var e=$(d),f=c,h=e.identify?e.identify():"document";if(!a[h]){a[h]={"$observer":function(n){var m=n.element();if(a[h][n.type]){for(var l=0,k=a[h][n.type].length;l<k;l++){for(var j in a[h][n.type][l]){if(a[h][n.type][l][j][1].match(m)){a[h][n.type][l][j][0](n)
}}}}}}}if(!a[h][f]){a[h][f]=[];e.observe(f,a[h]["$observer"])}for(var b in g){g[b]=[g[b],new Selector(b)]}a[h][f].push(g);return e},stopDelegating:function(f,h){if(f===undefined){for(var b in a){Event.stopDelegating(b=="$document"?document:b)}a={};return true}var l=false;if(Object.isString(arguments[2])){l={};l[arguments[2]]=true}else{if(arguments[2]){l=arguments[2]}}var d=$(f),k=h,b=d.identify?d.identify():"$document";
if(a[b]){if(k&&a[b][k]){for(var g=0,j=a[b][k].length;g<j;g++){if(l){for(var e in l){delete a[b][k][g][e]}}if(!l||$H(a[b][k][g]).any()==false){d.stopObserving(k,a[b]["$observer"]);a[b][k][g]="r"}}a[b][k]=a[b][k].without("r")}else{for(var c in a[b]){if(c!="$observer"){d.stopObserving(c,a[b]["$observer"])}}delete a[b]}}return d}}})());Element.addMethods({delegate:Event.delegate,stopDelegating:Event.stopDelegating});
document.delegate=Event.delegate.curry(document);document.stopDelegating=Event.stopDelegating.curry(document);Event.observe(window,"unload",Event.stopDelegating);document.observe("dom:loaded",initSentimess);function initSentimess(){initTabs();document.delegate("click",{"a.funcMenuOption":toggleFunc})}function initTabs(){var a=$("mainMenuMess").childElements();a.each(function(c,b){c.observe("click",toggleHMenu.bindAsEventListener(this))
});var a=$("functionalitySubmenu").childElements();a.each(function(c,b){c.observe("click",toggleFunc.bindAsEventListener(this))});toggleFunc(null);toggleHMenu(null);navButtons=new Array("SentiNavLeft","SentiNavRight");navButtons.each(function(c,b){$(c).observe("click",progressGuide.bindAsEventListener(this,c,(b==0?-1:1)))});progressGuide(null,"SentiNavRight")}function toggleClasses(a,c,b){a.removeClassName(c);
a.addClassName(b)}function progressGuide(c,b,d){if(c!=null){var a=Event.element(c)}else{a=$(b)}nextToGo=(a.id=="SentiNavRight"?1:-1);steps=$$("#guideSteps div.guideStep");totalSteps=steps.length;visibleSteps=$("guideSteps").getElementsBySelector("div.show");if(visibleSteps.length>1){currentStep=visibleSteps[0];visibleSteps.each(function(e){e.removeClassName("show");e.addClassName("hide")});toggleClasses(currentStep,"hide","show")
}else{if(visibleSteps.length==1){currentStep=visibleSteps[0];toggleClasses(currentStep,"hide","show")}else{currentStep=$("guideSteps").down("div",totalSteps-1);toggleClasses(currentStep,"hide","show")}}currentStepPosition=currentStep.id.sub("guideStep","");nextPosition=parseInt(nextToGo)+parseInt((currentStepPosition==totalSteps&&nextToGo==1?0:(currentStepPosition==1&&nextToGo==-1?totalSteps+1:currentStepPosition)));
nextStep=$("guideStep"+nextPosition);steps.each(function(e){e.removeClassName("show");e.addClassName("hide")});toggleClasses(nextStep,"hide","show");$("guideProgress").setStyle("width: "+100/(totalSteps/nextPosition)+"%")}function toggleFunc(b){if(b!=null){var a=Event.element(b)}else{a=$("functionalitySubmenu").down("a",0)}id=a.up("li").id;$$("#functionalitySubmenu li").each(function(c){c.removeClassName("currentSubTab")
});$$("#functionalityContent div").each(function(c){c.removeClassName("sentimessTabShow");c.addClassName("sentimessTabHide")});$(id).addClassName("currentSubTab");$("func_"+id).removeClassName("sentimessTabHide");$("func_"+id).addClassName("sentimessTabShow")}function toggleHMenu(b){if(b!=null){var a=Event.element(b)}else{a=$("mainMenuMess").down("a",0)}id=a.up("li").id;mainTabs=new Array("functionality","guide");
mainTabs.each(function(c){$(c).removeClassName("currentTab");$(c+"Container").hide()});$(id).addClassName("currentTab");$(id+"Container").show()};