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 b=self.location.href;var a=b.split("?");if(a.length>1){b=b+"&cmsMode=Preview"}else{b=b+"?cmsMode=Preview"}return b}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(f,h,g,d,e,a){var b,c;f=f.replace(/&amp;amp;/g,"&").replace(/&amp;/g,"&");if(!m_bEkTbReady){return false}if(g>screen.width){g=screen.width}if(d>screen.height){d=screen.height}if(g==screen.width&&d==screen.height){b="toolbar=0,location=0,directories=0,status="+a+",menubar=0,scrollbars="+e+",resizable="+a+",width="+screen.width+",height="+screen.height;c=window.open(f,h,b);c.moveTo(0,0);c.resizeTo(screen.availWidth,screen.availHeight)}else{b="toolbar=0,location=0,directories=0,status="+a+",menubar=0,scrollbars="+e+",resizable="+a+",width="+g+",height="+d;c=window.open(f,h,b)}return c}function EkTbFade(i,d,g,b,e,c,h){if(!m_bEkTbReady){return false}var a=document.getElementById(h);if(e==0){if(!document.all){a.style.MozOpacity=(i/100)}else{a.filters.alpha.opacity=(i)}if(((i>=0)&&(g<0))||((i<99)&&(g>0))){i+=g;if(i>99){i=99}setTimeout("EkTbFade("+i+","+d+","+g+","+b+","+e+",'"+c+"','"+h+"')",d)}else{g=(0-g);i+=g;if(c.toLowerCase()=="cycle"){setTimeout("EkTbFade("+i+","+d+","+g+","+b+","+e+",'"+c+"','"+h+"')",b)}}}else{var f=e;e=0;setTimeout("EkTbFade("+i+","+d+","+g+","+b+","+e+",'"+c+"','"+h+"')",f)}}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(b,a,d){if(!m_bEkTbReady){return false}var c=0;if(b.offsetParent){while(b&&(null!=b.offsetLeft)){if((a!=m_EkTbStopAtRoot)&&(EkTbIsStopTag(b,a))){break}if(d||(b.style&&b.style.position&&b.style.position&&("relative"!=b.style.position.toLowerCase())&&("absolute"!=b.style.position.toLowerCase()))){c+=b.offsetLeft}b=b.offsetParent}}else{if(b.x){c+=b.x}}return(c)}function EkTbFindParentPositionTop(b,a,d){if(!m_bEkTbReady){return false}var c=0;if(b.offsetParent){while(b&&(null!=b.offsetTop)){if((a!=m_EkTbStopAtRoot)&&(EkTbIsStopTag(b,a))){break}if(d||(b.style&&b.style.position&&b.style.position&&("relative"!=b.style.position.toLowerCase())&&("absolute"!=b.style.position.toLowerCase()))){c+=b.offsetTop}b=b.offsetParent}}else{if(b.x){curleft+=b.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(b,c){if(!m_bEkTbReady){return false}var a=0;if(b!=c){a+=b.offsetTop;if(b.offsetParent){while((b.offsetParent)&&(b!=c)){a+=b.offsetTop;b=b.offsetParent}}}return(a)}function EkTbFindLeftDifference(b,c){if(!m_bEkTbReady){return false}var a=0;if(b!=c){a+=b.offsetLeft;if(b.offsetParent){while((b.offsetParent)&&(b!=c)){a+=b.offsetLeft;b=b.offsetParent}}}return(a)}function EkTbIsChild(c,d){if(!m_bEkTbReady){return false}var b=false;var a="";if(c){if((typeof c.id=="string")&&(((c.id).indexOf("EkTbToolbar_")>-1)||((c.id).indexOf("EkTbLeftBar_")>-1)||((c.id).indexOf("EkTbRightBar_")>-1)||((c.id).indexOf("EkTbTopBar_")>-1)||((c.id).indexOf("EkTbBottomBar_")>-1))){b=true}else{if(c.parentNode){while(c.parentNode){c=c.parentNode;if((d.id).indexOf("EkTb")>-1){a=(d.id).split("_")}else{a=new Array;a[0]="";a[1]=""}if((c==d)||(c==document.getElementById("EkTbToolbar_"+a[1]))||(c==document.getElementById("EkTbLeftBar_"+a[1]))||(c==document.getElementById("EkTbRightBar_"+a[1]))||(c==document.getElementById("EkTbTopBar_"+a[1]))||(c==document.getElementById("EkTbBottomBar_"+a[1]))){b=true;break}}}}}return(b)}function EkTbIsStopTag(b,a){if(!m_bEkTbReady){return false}var c=false;if((((b.style.position).toLowerCase()=="relative")&&(a&m_EkTbStopAtCss))||(((b.style.position).toLowerCase()=="absolute")&&(a&m_EkTbStopAtOffset))){if(!document.all){if((b.tagName).toLowerCase()!="table"){c=true}}else{c=true}}return(c)}function EkTbMacShowToolbar(a,c){if(!m_bEkTbReady){return false}var b=true;if(navigator.userAgent.indexOf("Mac")>-1){if(a.shiftKey){b=EkTbShowToolbar(a,c)}}return(b)}function EkTbShowToolbar(f,a){if(!m_bEkTbReady){return false}var i=true;var h="";var b="";var c=0;var d=0;if(document.all){h=f.toElement;b=f.srcElement;if(f.y==event.clientY){d=(f.y+(EkTbFindParentPositionTop(b,m_EkTbStopAtRoot,false)-EkTbFindParentPositionTop(b,m_EkTbStopAtCss,false)+EkTbGetScrollTop()));c=(f.x+(EkTbFindParentPositionLeft(b,m_EkTbStopAtRoot,false)-EkTbFindParentPositionLeft(b,m_EkTbStopAtCss,false)+EkTbGetScrollLeft()))}else{d=(event.clientY+EkTbFindParentPositionTop(b,m_EkTbStopAtRoot)-EkTbFindParentPositionTop(b,m_EkTbStopAtCss)+EkTbGetScrollTop());if(event.screenX!=f.clientX){c=(event.clientX+(f.x+(EkTbFindParentPositionLeft(b,m_EkTbStopAtRoot,false)-EkTbFindParentPositionLeft(b,m_EkTbStopAtCss,false)+EkTbGetScrollLeft())))-f.x}else{c=(event.screenX)}}}else{h=f.relatedTarget;b=f.target;d=f.pageY;c=f.pageX}if(!f.ctrlKey){var g=a.id.split("_");var j=(EkTbFindParentPositionLeft(document.getElementById("EkTbBase_"+g[1]),(m_EkTbStopAtRoot),true)+document.getElementById("EkTbBase_"+g[1]).offsetWidth);if(c>j){c=j}document.getElementById("EkTbToolbar_"+g[1]).style.top=((d))+"px";document.getElementById("EkTbToolbar_"+g[1]).style.left=((c))+"px";document.getElementById("EkTbToolbar_"+g[1]).style.display="";i=false}return(i)}function EkTbStopBubble(a,b){a.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(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){var c=setTimeout(function(){Ektron.EditorsMenu.hide(b)},Ektron.EditorsMenu.timeoutDuration);b.attr("timeoutId",c)}});$ektron(document).listen("mouseover","a",function(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){clearTimeout(b.attr("timeoutId"));b.removeAttr("timeoutId")}});$ektron(document).listen("blur","a",function(a){var b=$ektron(this).parent().parent();if(b.hasClass("EktronEditorsMenu")){var c=setTimeout(function(){Ektron.EditorsMenu.hide(b)},Ektron.EditorsMenu.timeoutDuration);b.attr("timeoutId",c)}});$ektron(document).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,d,b){var i=$ektron(a).attr("data-ektron-editorsmenu-id");var f=$ektron("#"+i);if(f.css("display")==="none"&&f.hasClass("cloned")===false){var c=true;if(f.parent().find("iframe").length>0){c=false}if(f.parent().find("object").length>0){c=false}if(f.parent().find("embed").length>0){c=false}if(c===false){f.attr("class","EktronEditorsMenu EktronEditorsMenuNotLayered");f.css("display","block")}else{f.addClass("cloned");f=f.clone(true);f.attr("cloneid",f.attr("id"));f.removeAttr("id");f.prependTo("body");var h=99998;f.siblings("ul.EktronEditorsMenu").each(function(){f.siblings("ul.EktronEditorsMenu").length;if(h<=parseInt($ektron(this).css("z-index"))){h=parseInt($ektron(this).css("z-index"))+1}});f.css("z-index",String(h));Ektron.EditorsMenu.setPosition(f);f.slideDown(function(){if(b===false){f.find("li:first a:first").focus()}})}f.attr("timeoutId",g);if(b===true){var g=setTimeout(function(){Ektron.EditorsMenu.hide(f)},Ektron.EditorsMenu.timeoutDuration);f.attr("timeoutId",g)}}},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(d){var k=$ektron("a[data-ektron-editorsmenu-id='"+d.attr("cloneid")+"']");var m=k.offset();var g=m.top;var a=m.left+k.width();var f=m.top+k.height();var l=m.left;var i=g;var j=l;var h=d.clone().prependTo("body");h.css("left","-1000px");h.css("display","block");var n=h.height();var b=h.width();h.remove();var o=$ektron("body");var e=o.height();var c=o.width();if((n>e)||(n<(e-f))){i=f}else{if((n>g)&&(n>(e-f))){i=f}else{i=g-n}}if((b>c)||(b<(c-a))){j=a}else{if((b<c)&&(b>l)){j=a}else{j=l}}d.css("top",i);d.css("left",j);if($ektron.browser.msie){if($ektron.browser.version<7){d.find("li").css("position","relative")}d.find("a").css("word-wrap","normal")}},timeoutDuration:1500};(function(a){a.fn.indexer=function(i){return this[0]&&b(this[0],i)||null};a.indexer=function(i){return b(document,i)};var g=a.event,h=g.special,e=a.listen=function(k,j,l,i){if(typeof j!="object"){i=l;l=j;j=document}f(k.split(/\s+/),function(n){n=e.fixes[n]||n;var m=b(j,n)||b(j,n,new d(n,j));m.append(l,i);m.start()})},b=function(i,j,k){return a.data(i,j+".indexer",k)};a.extend(e,{regex:/^((?:\w*?|\*))(?:([#.])([\w-]+))?$/,fixes:{focus:"focusin",blur:"focusout"},cache:function(i){this.caching=i}});a.each(e.fixes,function(i,j){h[j]={setup:function(){if(a.browser.msie){return false}this.addEventListener(i,h[j].handler,true)},teardown:function(){if(a.browser.msie){return false}this.removeEventListener(i,h[j].handler,true)},handler:function(k){arguments[0]=k=g.fix(k);k.type=j;return g.handle.apply(this,arguments)}}});a.fn.listen=function(j,k,i){return this.each(function(){e(j,this,k,i)})};function d(i,j){a.extend(this,{ids:{},tags:{},listener:j,event:i});this.id=d.instances.push(this)}d.instances=[];d.prototype={constructor:d,handle:function(i){var j=i.stopPropagation;i.stopPropagation=function(){i.stopped=true;j.apply(this,arguments)};b(this,i.type).parse(i);i.stopPropagation=j;j=i.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(i,j){return a.data(i,"listenCache_"+this.id,j)},parse:function(j){var i=j.data||j.target,l=arguments,k;if(!e.caching||!(k=this.cache(i))){k=[];if(i.id&&this.ids[i.id]){c(k,this.ids[i.id])}f([i.nodeName,"*"],function(m){var n=this.tags[m];if(n){f((i.className+" *").split(" "),function(o){if(o&&n[o]){c(k,n[o])}})}},this);if(e.caching){this.cache(i,k)}}if(k[0]){f(k,function(m){if(m.apply(i,l)===false){j.preventDefault();j.stopPropagation()}})}if(!j.stopped&&(i=i.parentNode)&&(i.nodeName=="A"||this.bubbles&&i!=this.listener)){j.data=i;this.parse(j)}k=l=i=null},append:function(i,j){f(i.split(/\s*,\s*/),function(o){var m=e.regex.exec(o);if(!m){throw'$.listen > "'+o+'" is not a supported selector.'}var n=m[2]=="#"&&m[3],l=m[1].toUpperCase()||"*",k=m[3]||"*";if(n){(this.ids[n]||(this.ids[n]=[])).push(j)}else{if(l){l=this.tags[l]=this.tags[l]||{};(l[k]||(l[k]=[])).push(j)}}},this)}};function f(j,o,m){for(var n=0,k=j.length;n<k;n++){o.call(m,j[n],n)}}function c(j,i){j.push.apply(j,i);return j}a(window).unload(function(){if(typeof d=="function"){f(d.instances,function(i){i.stop();a.removeData(i.listener,i.event+".indexer");i.ids=i.names=i.listener=null})}})})($ektron);Ektron.ready(function(){Ektron.EditorsMenu.bindEvents()})};

