var m_EkTbTimeout_AjaxToolBar=null;var m_EkTbAutomaticOutsideBorder_AjaxToolBar=true;var m_EkTbOutsideBorder_AjaxToolBar=true;var m_EkTbMenuOffDelay_AjaxToolBar=500;var m_EkTbMenuBorderWidth_AjaxToolBar=3;var m_EkTbStopAtRoot=0;var m_EkTbStopAtCss=1;var m_EkTbStopAtOffset=2;var m_EkTbLastObj;var m_bEkTbReady;if(m_bEkTbReady!==true){m_bEkTbReady=false}function GetPreviewURL(){var a=self.location.href;var b=a.split('?');if(b.length>1){a=a+"&cmsMode=Preview"}else{a=a+"?cmsMode=Preview"}return a}function addEkTbLoadEvent(){var a=window.onload;window.onload=function(){if(typeof a=='function'){a()}setTimeout("m_bEkTbReady = true;",500)}}if(typeof $ektron!=='undefined'){$ektron().ready(function(){m_bEkTbReady=true})}addEkTbLoadEvent();function EkTbWebMenuPopUpWindow(a,b,d,c,f,h){a=a.replace(/&amp;amp;/g,"&").replace(/&amp;/g,"&");if(!m_bEkTbReady)return false;if(d>screen.width){d=screen.width}if(c>screen.height){c=screen.height}var j='toolbar=0,location=0,directories=0,status='+h+',menubar=0,scrollbars='+f+',resizable='+h+',width='+d+',height='+c;var i=window.open(a,b,j);return i}function EkTbFade(a,b,d,c,f,h,j){if(!m_bEkTbReady)return false;var i=document.getElementById(j);if(f==0){if(!document.all){i.style.MozOpacity=(a/100)}else{i.filters.alpha.opacity=(a)}if(((a>=0)&&(d<0))||((a<99)&&(d>0))){a+=d;if(a>99){a=99}setTimeout("EkTbFade("+a+","+b+","+d+","+c+","+f+",'"+h+"','"+j+"')",b)}else{d=(0-d);a+=d;if(h.toLowerCase()=="cycle"){setTimeout("EkTbFade("+a+","+b+","+d+","+c+","+f+",'"+h+"','"+j+"')",c)}}}else{var g=f;f=0;setTimeout("EkTbFade("+a+","+b+","+d+","+c+","+f+",'"+h+"','"+j+"')",g)}}var m_isMac=false;var m_isMacInit=false;function IsPlatformMac(){if(m_isMacInit){return(m_isMac)}else{var a;var b=new String(navigator.userAgent);b=b.toLowerCase();a=parseInt(b.indexOf('mac'));m_isMac=(0<=a);m_isMacInit=true;return(m_isMac)}}var m_isSafari=false;var m_isSafariInit=false;function IsBrowserSafari(){if(m_isSafariInit){return(m_isSafari)}else{var a;var b=new String(navigator.userAgent);b=b.toLowerCase();a=parseInt(b.indexOf('safari'));m_isSafari=(0<=a);m_isSafariInit=true;return(m_isSafari)}}function EkTbRollOver(a,b){if(!m_bEkTbReady)return false;var d=0;var c=0;var f=0;var h=0;var j=0;var i=0;var g=(b.id).split("_");var m=true;var l=true;var k=3;var n=null;var o=null;if(m_EkTbLastObj&&(m_EkTbLastObj!=b)){EkTbOffNow(m_EkTbLastObj.id)}m_EkTbLastObj=b;eval("localTimeout = m_EkTbTimeout_"+g[1]+";");if(n!=null){n=clearTimeout(n);eval("m_EkTbTimeout_"+g[1]+" = localTimeout;")}if(IsPlatformMac()){o=xBrowserReturnObjById("EkTbOuterElmt_"+g[1]);if(o!=null){i=o.offsetHeight}else{i=b.offsetHeight}}else{i=b.offsetHeight}h=EkTbFindParentPositionLeft(b,(m_EkTbStopAtRoot),true);j=b.offsetWidth;c=EkTbFindParentPositionTop(b,(m_EkTbStopAtRoot),true);eval("automaticBorder = m_EkTbAutomaticOutsideBorder_"+g[1]+";");eval("outsideBorder = m_EkTbOutsideBorder_"+g[1]+";");eval("menuBorderWidth = m_EkTbMenuBorderWidth_"+g[1]+";");if(l==true){if(((h-k)<0)&&(m)){f=0}else{f=h-k}if(((c-k)<0)&&(m)){d=0}else{d=c-k}if(((((f+j)==document.body.clientWidth)&&((h-k)<0))||(((f+j+k)==document.body.clientWidth)&&((h-k)>=0)))&&(m)){j=(document.body.clientWidth-f)}else{j+=(k*2)}if(((((d+i)==document.body.clientHeight)&&((c-k)<0))||(((d+i+k)==document.body.clientHeight)&&((c-k)>=0)))&&(m)){i=(document.body.clientHeight-d)}else{i+=(k*2)}}else{f=h;d=c}if(IsPlatformMac()){if(IsBrowserSafari){f+=4;d+=6}else{f+=4;d+=14}}if(g[1]!="AjaxToolBar"&&document.getElementById("EkTbLeftBar_"+g[1]).parentNode!=document.body){var p=document.body;var q=document.getElementById("EkTbLeftBar_"+g[1]);q.parentNode.removeChild(q);var v=p.appendChild(q);var r=document.getElementById("EkTbRightBar_"+g[1]);r.parentNode.removeChild(r);var w=p.appendChild(r);var s=document.getElementById("EkTbTopBar_"+g[1]);s.parentNode.removeChild(s);var x=p.appendChild(s);var t=document.getElementById("EkTbBottomBar_"+g[1]);t.parentNode.removeChild(t);var y=p.appendChild(t);var u=document.getElementById("EkTbToolbar_"+g[1]);u.parentNode.removeChild(u);var z=p.appendChild(u)}document.getElementById("EkTbLeftBar_"+g[1]).style.top=d+"px";document.getElementById("EkTbLeftBar_"+g[1]).style.left=f+"px";document.getElementById("EkTbLeftBar_"+g[1]).style.width=k+"px";document.getElementById("EkTbLeftBar_"+g[1]).style.height=i+"px";document.getElementById("EkTbRightBar_"+g[1]).style.top=d+"px";document.getElementById("EkTbRightBar_"+g[1]).style.left=((f+j)-k)+"px";document.getElementById("EkTbRightBar_"+g[1]).style.width=k+"px";document.getElementById("EkTbRightBar_"+g[1]).style.height=i+"px";document.getElementById("EkTbTopBar_"+g[1]).style.top=d+"px";document.getElementById("EkTbTopBar_"+g[1]).style.left=f+"px";document.getElementById("EkTbTopBar_"+g[1]).style.width=j+"px";document.getElementById("EkTbTopBar_"+g[1]).style.height=k+"px";document.getElementById("EkTbBottomBar_"+g[1]).style.top=((d+i)-k)+"px";document.getElementById("EkTbBottomBar_"+g[1]).style.left=f+"px";document.getElementById("EkTbBottomBar_"+g[1]).style.width=j+"px";document.getElementById("EkTbBottomBar_"+g[1]).style.height=k+"px";document.getElementById("EkTbLeftBar_"+g[1]).style.display="";document.getElementById("EkTbRightBar_"+g[1]).style.display="";document.getElementById("EkTbTopBar_"+g[1]).style.display="";document.getElementById("EkTbBottomBar_"+g[1]).style.display=""}function EkTbRollOut(a,b){if(!m_bEkTbReady)return false;var d="";var c="";if(document.all){d=a.toElement;c=a.srcElement}else{d=a.relatedTarget;c=a.target}if((c.id!=b.id)&&(!EkTbIsChild(c,b))){return}if((d==null)||(!((EkTbIsChild(d,b))||(b.id==d.id)))){var f=b.id.split("_");eval("m_EkTbTimeout_"+f[1]+" = setTimeout(\"EkTbOff('"+b.id+"')\", m_EkTbMenuOffDelay_"+f[1]+")")}}function EkTbOff(a){if(!m_bEkTbReady)return false;try{var b=a.split("_");if(eval("m_EkTbTimeout_"+b[1]+" != null")){eval("m_EkTbTimeout_"+b[1]+" = null");document.getElementById("EkTbLeftBar_"+b[1]).style.display="none";document.getElementById("EkTbRightBar_"+b[1]).style.display="none";document.getElementById("EkTbTopBar_"+b[1]).style.display="none";document.getElementById("EkTbBottomBar_"+b[1]).style.display="none";document.getElementById("EkTbToolbar_"+b[1]).style.display="none"}}catch(e){}}function EkTbOffNow(a){if(!m_bEkTbReady)return false;try{var b=a.split("_");if(eval("m_EkTbTimeout_"+b[1]+" != null")){eval("m_EkTbTimeout_"+b[1]+" = null")}document.getElementById("EkTbLeftBar_"+b[1]).style.display="none";document.getElementById("EkTbRightBar_"+b[1]).style.display="none";document.getElementById("EkTbTopBar_"+b[1]).style.display="none";document.getElementById("EkTbBottomBar_"+b[1]).style.display="none";document.getElementById("EkTbToolbar_"+b[1]).style.display="none"}catch(e){}}function EkTbCancelOff(a){if(!m_bEkTbReady)return false;var b=a.id.split("_");var d=eval("m_EkTbTimeout_"+b[1]);if(d!=null){clearTimeout(d);eval("m_EkTbTimeout_"+b[1]+" = null;")}}function EkTbFindParentPositionLeft(a,b,d){if(!m_bEkTbReady)return false;var c=0;if(a.offsetParent){while(a&&(null!=a.offsetLeft)){if((b!=m_EkTbStopAtRoot)&&(EkTbIsStopTag(a,b))){break}if(d||(a.style&&a.style.position&&a.style.position&&('relative'!=a.style.position.toLowerCase())&&('absolute'!=a.style.position.toLowerCase()))){c+=a.offsetLeft}a=a.offsetParent}}else if(a.x){c+=a.x}return(c)}function EkTbFindParentPositionTop(a,b,d){if(!m_bEkTbReady)return false;var c=0;if(a.offsetParent){while(a&&(null!=a.offsetTop)){if((b!=m_EkTbStopAtRoot)&&(EkTbIsStopTag(a,b))){break}if(d||(a.style&&a.style.position&&a.style.position&&('relative'!=a.style.position.toLowerCase())&&('absolute'!=a.style.position.toLowerCase()))){c+=a.offsetTop}a=a.offsetParent}}else if(a.x){curleft+=a.x}return(c)}function EkTbGetScrollTop(){if(EkTbIsInQuirksMode()){return(document.body.scrollTop)}else{return(document.documentElement.scrollTop)}}function EkTbGetScrollLeft(){if(EkTbIsInQuirksMode()){return(document.body.scrollLeft)}else{return(document.documentElement.scrollLeft)}}function EkTbIsInQuirksMode(){return(0==document.documentElement.clientHeight)}function EkTbFindTopDifference(a,b){if(!m_bEkTbReady)return false;var d=0;if(a!=b){d+=a.offsetTop;if(a.offsetParent){while((a.offsetParent)&&(a!=b)){d+=a.offsetTop;a=a.offsetParent}}}return(d)}function EkTbFindLeftDifference(a,b){if(!m_bEkTbReady)return false;var d=0;if(a!=b){d+=a.offsetLeft;if(a.offsetParent){while((a.offsetParent)&&(a!=b)){d+=a.offsetLeft;a=a.offsetParent}}}return(d)}function EkTbIsChild(a,b){if(!m_bEkTbReady)return false;var d=false;var c="";if(a){if((typeof a.id=='string')&&(((a.id).indexOf("EkTbToolbar_")>-1)||((a.id).indexOf("EkTbLeftBar_")>-1)||((a.id).indexOf("EkTbRightBar_")>-1)||((a.id).indexOf("EkTbTopBar_")>-1)||((a.id).indexOf("EkTbBottomBar_")>-1))){d=true}else{if(a.parentNode){while(a.parentNode){a=a.parentNode;if((b.id).indexOf("EkTb")>-1){c=(b.id).split("_")}else{c=new Array;c[0]="";c[1]=""}if((a==b)||(a==document.getElementById("EkTbToolbar_"+c[1]))||(a==document.getElementById("EkTbLeftBar_"+c[1]))||(a==document.getElementById("EkTbRightBar_"+c[1]))||(a==document.getElementById("EkTbTopBar_"+c[1]))||(a==document.getElementById("EkTbBottomBar_"+c[1]))){d=true;break}}}}}return(d)}function EkTbIsStopTag(a,b){if(!m_bEkTbReady)return false;var d=false;if((((a.style.position).toLowerCase()=="relative")&&(b&m_EkTbStopAtCss))||(((a.style.position).toLowerCase()=="absolute")&&(b&m_EkTbStopAtOffset))){if(!document.all){if((a.tagName).toLowerCase()!="table"){d=true}}else{d=true}}return(d)}function EkTbMacShowToolbar(a,b){if(!m_bEkTbReady)return false;var d=true;if(navigator.userAgent.indexOf("Mac")>-1){if(a.shiftKey){d=EkTbShowToolbar(a,b)}}return(d)}function EkTbShowToolbar(a,b){if(!m_bEkTbReady)return false;var d=true;var c="";var f="";var h=0;var j=0;if(document.all){c=a.toElement;f=a.srcElement;if(a.y==event.clientY){j=(a.y+(EkTbFindParentPositionTop(f,m_EkTbStopAtRoot,false)-EkTbFindParentPositionTop(f,m_EkTbStopAtCss,false)+EkTbGetScrollTop()));h=(a.x+(EkTbFindParentPositionLeft(f,m_EkTbStopAtRoot,false)-EkTbFindParentPositionLeft(f,m_EkTbStopAtCss,false)+EkTbGetScrollLeft()))}else{j=(event.clientY+EkTbFindParentPositionTop(f,m_EkTbStopAtRoot)-EkTbFindParentPositionTop(f,m_EkTbStopAtCss)+EkTbGetScrollTop());if(event.screenX!=a.clientX){h=(event.clientX+(a.x+(EkTbFindParentPositionLeft(f,m_EkTbStopAtRoot,false)-EkTbFindParentPositionLeft(f,m_EkTbStopAtCss,false)+EkTbGetScrollLeft())))-a.x}else{h=(event.screenX)}}}else{c=a.relatedTarget;f=a.target;j=a.pageY;h=a.pageX}if(!a.ctrlKey){var i=b.id.split("_");var g=(EkTbFindParentPositionLeft(document.getElementById("EkTbBase_"+i[1]),(m_EkTbStopAtRoot),true)+document.getElementById("EkTbBase_"+i[1]).offsetWidth);if(h>g){h=g}document.getElementById("EkTbToolbar_"+i[1]).style.top=((j))+"px";document.getElementById("EkTbToolbar_"+i[1]).style.left=((h))+"px";document.getElementById("EkTbToolbar_"+i[1]).style.display="";d=false}return(d)}function EkTbStopBubble(a,b){a.cancelBubble=true}function xBrowserReturnObjById(a){if(document.getElementById){var b=document.getElementById(a)}else if(document.all){var b=document.all[a]}else if(document.layers){var b=document.layers[a]}return b}if(typeof $ektron!=='undefined'){Ektron.EditorsMenu={bindEvents:function(){$ektron().listen("mouseover","a.EktronEditorsMenuMarker",function(a){Ektron.EditorsMenu.show(this,a,true)});$ektron().listen("keypress","a.EktronEditorsMenuMarker",function(a){if(a.keyCode===13)Ektron.EditorsMenu.show(this,a,false)});$ektron().listen("mouseout","a",function(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){var d=setTimeout(function(){Ektron.EditorsMenu.hide(b)},Ektron.EditorsMenu.timeoutDuration);b.attr("timeoutId",d)}});$ektron().listen("mouseover","a",function(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){clearTimeout(b.attr("timeoutId"));b.removeAttr("timeoutId")}});$ektron().listen("blur","a",function(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){var d=setTimeout(function(){Ektron.EditorsMenu.hide(b)},Ektron.EditorsMenu.timeoutDuration);b.attr("timeoutId",d)}});$ektron().listen("focus","a",function(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){clearTimeout(b.attr("timeoutId"));b.removeAttr("timeoutId")}})},show:function(a,b,d){var c=$ektron(a).next();if(c.css("display")==="none"&&c.hasClass("cloned")===false){var f=true;if(c.parent().find('iframe').length>0)f=false;if(c.parent().find('object').length>0)f=false;if(c.parent().find('embed').length>0)f=false;if(f===false){c.attr("class","EktronEditorsMenu EktronEditorsMenuNotLayered");c.css("display","block")}else{c.addClass("cloned");c=c.clone(true);c.attr("cloneid",c.attr("id"));c.removeAttr("id");c.prependTo("body");var h=99998;c.siblings("ul.EktronEditorsMenu").each(function(){c.siblings("ul.EktronEditorsMenu").length;if(h<=parseInt($ektron(this).css("z-index"))){h=parseInt($ektron(this).css("z-index"))+1}});c.css("z-index",String(h));Ektron.EditorsMenu.setPosition(c);c.slideDown(function(){if(d===false){c.find("li:first a:first").focus()}})}c.attr("timeoutId",j);if(d===true){var j=setTimeout(function(){Ektron.EditorsMenu.hide(c)},Ektron.EditorsMenu.timeoutDuration);c.attr("timeoutId",j)}}},hide:function(b){b.slideUp("fast",function(){if(b.hasClass("cloned")===true){var a=$ektron("#"+b.attr("cloneid"));a.removeClass("cloned");a.removeAttr("timeoutId");b.remove()}else{b.removeClass("EktronEditorsMenuNotLayered")}})},setPosition:function(a){var b=$ektron("#"+a.attr("cloneid")).prev();var d=b.offset();var c=d.top;var f=d.left+b.width();var h=d.top+b.height();var j=d.left;var i=c;var g=j;var m=a.clone().prependTo("body");m.css("left","-1000px");m.css("display","block");var l=m.height();var k=m.width();m.remove();var n=$ektron("body");var o=n.height();var p=n.width();if((l>o)||(l<(o-h))){i=h}else{if((l>c)&&(l>(o-h))){i=h}else{i=c-l}}if((k>p)||(k<(p-f))){g=f}else{if((k<p)&&(k>j)){g=f}else{g=j}}a.css("top",i);a.css("left",g);if($ektron.browser.msie){if($ektron.browser.version<7){a.find("li").css("position","relative")}a.find("a").css("word-wrap","normal")}},timeoutDuration:1500};(function(i){i.fn.indexer=function(a){return this[0]&&k(this[0],a)||null};i.indexer=function(a){return k(document,a)};var g=i.event,m=g.special,l=i.listen=function(d,c,f,h){if(typeof c!='object'){h=f;f=c;c=document}o(d.split(/\s+/),function(a){a=l.fixes[a]||a;var b=k(c,a)||k(c,a,new n(a,c));b.append(f,h);b.start()})},k=function(a,b,d){return i.data(a,b+'.indexer',d)};i.extend(l,{regex:/^((?:\w*?|\*))(?:([#.])([\w-]+))?$/,fixes:{focus:'focusin',blur:'focusout'},cache:function(a){this.caching=a}});i.each(l.fixes,function(b,d){m[d]={setup:function(){if(i.browser.msie)return false;this.addEventListener(b,m[d].handler,true)},teardown:function(){if(i.browser.msie)return false;this.removeEventListener(b,m[d].handler,true)},handler:function(a){arguments[0]=a=g.fix(a);a.type=d;return g.handle.apply(this,arguments)}}});i.fn.listen=function(a,b,d){return this.each(function(){l(a,this,b,d)})};function n(a,b){i.extend(this,{ids:{},tags:{},listener:b,event:a});this.id=n.instances.push(this)};n.instances=[];n.prototype={constructor:n,handle:function(a){var b=a.stopPropagation;a.stopPropagation=function(){a.stopped=true;b.apply(this,arguments)};k(this,a.type).parse(a);a.stopPropagation=b;b=a.data=null},on:false,bubbles:false,start:function(){if(!this.on){g.add(this.listener,this.event,this.handle);this.on=true}},stop:function(){if(this.on){g.remove(this.listener,this.event,this.handle);this.on=false}},cache:function(a,b){return i.data(a,'listenCache_'+this.id,b)},parse:function(d){var c=d.data||d.target,f=arguments,h;if(!l.caching||!(h=this.cache(c))){h=[];if(c.id&&this.ids[c.id])p(h,this.ids[c.id]);o([c.nodeName,'*'],function(a){var b=this.tags[a];if(b)o((c.className+' *').split(' '),function(klass){if(klass&&b[klass])p(h,b[klass])})},this);if(l.caching)this.cache(c,h)}if(h[0]){o(h,function(a){if(a.apply(c,f)===false){d.preventDefault();d.stopPropagation()}})}if(!d.stopped&&(c=c.parentNode)&&(c.nodeName=='A'||this.bubbles&&c!=this.listener)){d.data=c;this.parse(d)}h=f=c=null},append:function(h,j){o(h.split(/\s*,\s*/),function(a){var b=l.regex.exec(a);if(!b)throw'$.listen > "'+a+'" is not a supported selector.';var d=b[2]=='#'&&b[3],c=b[1].toUpperCase()||'*',f=b[3]||'*';if(d)(this.ids[d]||(this.ids[d]=[])).push(j);else if(c){c=this.tags[c]=this.tags[c]||{};(c[f]||(c[f]=[])).push(j)}},this)}};function o(a,b,d){for(var c=0,f=a.length;c<f;c++)b.call(d,a[c],c)};function p(a,b){a.push.apply(a,b);return a};i(window).unload(function(){if(typeof n=='function')o(n.instances,function(idxer){idxer.stop();i.removeData(idxer.listener,idxer.event+'.indexer');idxer.ids=idxer.names=idxer.listener=null})})})($ektron);$ektron().ready(function(){Ektron.EditorsMenu.bindEvents()})}

