var initPosY; var controlsInited=false; top.editFinishedLoading = false; var floatShim; function initEventHandlers(){ addEvent(document, 'mousedown', onMouseDown, true); addEvent(window, 'resizeend', setControls, true); addEvent(window, 'scroll', setControls, false); } function onMouseDown(e){ if(!top.currentSelObj) return; if (!e) e = window.event; if (e.srcElement) { if(e.srcElement.id && e.srcElement.id!='editCtrls'){ return; } } else { if (e.target.id && e.target.id.substring(0,2) == 'ph') { return; } } var cf = top.document.getElementById('contentFrame'); if (!cf) { cf = window.parent.document.getElementById('contentFrame'); } if (!cf) { cf = document.getElementById('contentFrame'); } if (cf) { cf.contentWindow.blur(); } } function setControls(){ if(!top.editFinishedLoading) return; if(!controlsInited){ var roleUp = document.getElementById('controlRoleUp'); roleUp.style.zIndex = 10; floatShim = new iframeShim(roleUp); initPosY= getObjY(roleUp); floatShim.setStyle('position', 'relative'); controlsInited=true; return; } var sTop = getScrollTop(); if(initPosY < sTop){ floatShim.setStyle('top', (sTop - initPosY) + 'px'); } else if(floatShim.getStyle('position') =='relative'){ floatShim.setStyle('top', 0 + 'px'); } } function turnOnBorder(obj){ obj.style.borderWidth ='1' obj.style.borderColor ='#0000ff' obj.style.borderStyle='dashed' }