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