var oEditorDiv_ = null; var bSourceMode_ = false; function useScrollButtons(oWindowDiv){ if(oWindowDiv==null){ return false; } return isPropertySet(oWindowDiv,'_scrollButtons'); } function openTipsDialog(publishedId){ if(!IsSourceMode()){ window.showModalDialog('/joodit.jsp?pa=175&crumbs=3&id=' + publishedId,'', 'center: Yes; help: No; resizable: No; status: No; scrolling:No; dialogHeight:260px; dialogWidth=400px;'); } } function BrowserCheck() { var b = navigator.appName; if (b=="Netscape") this.b = "ns"; else if (b=="Microsoft Internet Explorer") this.b = "ie"; else this.b = b; this.v = parseInt(navigator.appVersion); this.ns = (this.b=="ns" && this.v>=4); this.ns4 = (this.b=="ns" && this.v==4); this.ns5 = (this.b=="ns" && this.v==5); this.ie = (this.b=="ie" && this.v>=4); this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0); this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0); this.opera = (navigator.userAgent.indexOf('Opera')>0); if (this.ie5) this.v = 5; this.min = (this.ns||this.ie); } is = new BrowserCheck(); function Nothing(){ return false; } function Something(){ return true; } function isLeftButton(e){ if(e==null){ e=event; } return e.button==1 || (is.ns && e.which==1); } function isRightButton(e){ if(e==null){ e=event; } return e.button==2; } function isTopDiv(oDiv){ while(oDiv!=null){ if(oDiv.parentNode!=null && oDiv.parentNode.tagName=='DIV'){ return false; } oDiv = oDiv.parentNode; } return true; } function specialChar(charIs){ xspecialChar = new Array('[',']','(',')','{','}','?') for (var i=0; i iY){ iMaxY = iY; } } return iMaxY; } catch(x){ return GetFrameHeight(); } } function GetVisibleMinY(oObject){ try{ var iMinY = 0; while(oObject.parentNode!=null && oObject.parentNode.tagName=='DIV'){ oObject = oObject.parentNode; var iY = LayerGetAbsoluteY(oObject); if(oObject.currentStyle.overflow != 'visible' && iMinY < iY){ iMinY = iY; } } return iMinY; } catch(x){ return 0; } } function LayerMoveTo(layer,x,y){ if(x!=null){ LayerSetX(layer,x); } if(y!=null){ LayerSetY(layer,y); } } function LayerGetX(layer){ return layer.offsetLeft; } function LayerGetAbsoluteX(layer){ if(layer==null){ return 0; } var iX = LayerGetX(layer); while(layer.parentNode!=null){ layer = layer.parentNode; var iXX = LayerGetX(layer); if(iXX!=null && iXX!=''){ iX += iXX; } } return iX; } function LayerSetX(layer,iValue) { layer.style.left = iValue; } function LayerGetY(layer){ if(layer==null){ return 0; } return layer.offsetTop!=null?layer.offsetTop:0; } function LayerGetAbsoluteY(layer){ if(layer==null){ return 0; } var iY = LayerGetY(layer); while(layer.parentNode!=null){ layer = layer.parentNode; var iYY = LayerGetY(layer); if(iYY!=null && iYY!=''){ iY += iYY; } } return iY; } function LayerSetY(layer,iValue){ layer.style.top = iValue; } function LayerGetH(layer){ try{ return layer.offsetHeight; } catch(x){ return 0; } } function LayerSetH(layer,iValue){ try{ layer.style.height = iValue; } catch(x){ } } function LayerGetW(layer){ if(layer==null){ return 0; } return layer.offsetWidth; } function LayerSetW(layer,iValue){ layer.style.width = iValue; } function LayerShow(layer){ if(layer!=null){ layer.style.visibility = "visible"; } } function LayerHide(layer){ if(layer!=null){ layer.style.visibility = "hidden"; } } function IsVisible(layer){ if(layer!=null){ return (layer.style.visibility == "visible"); } return false; } function IsVisibleSet(layer){ if(layer.style.visibility == ""){ return false; }else { return true; } } function getCurrentStyle(element,styleId){ if(element!=null){ if(document.defaultView){ // Netscape return document.defaultView.getComputedStyle(element,null).getPropertyValue(styleId); } else if(element.currentStyle){ // Explorer return eval('element.currentStyle.' + styleId); } } return null; } function getPadding(element,iename, nename){ if(element!=null){ var value = getCurrentStyle(element,iename); if(value!=null && value!=''){ return parseInt(value); } value = getCurrentStyle(element,nename); if(value!=null && value!=''){ return parseInt(value); } } return 0; } function getPaddingTop(element){ return getPadding(element,'paddingTop','PADDING-TOP'); } function getPaddingBottom(element){ return getPadding(element,'paddingBottom','PADDING-BOTTOM'); } function getPaddingLeft(element){ return getPadding(element,'paddingLeft','PADDING-LEFT'); } function getPaddingRight(element){ return getPadding(element,'paddingRight','PADDING-RIGHT'); } function LayerGetFirstChild(layer,type){ if(layer==null){ return null; } if(type==null){ type = 'div'; } var length = layer.getElementsByTagName(type).length; for(var i=0; i=0; i--){ if(layer.getElementsByTagName(type)[i].parentNode==layer){ return layer.getElementsByTagName(type)[i]; } } return null; } function LayerGetLastChild(layer,type){ if(layer==null){ return null; } if(type==null){ type = 'div'; } var iYValues = new Array(); var iXValues = new Array(); var oLayers = new Array(); var iLayers = 0; var oLayer = null; var length = layer.getElementsByTagName(type).length; for(var i=0; i0){ for(var i=0; iiYValues[j]){ // OBS Check x also iPos++; } } if(iPos==oLayers.length-1){ return oLayers[i]; } } return oLayers[oLayers.length-1]; } return null; } function LayerAddHTML(layer,html){ layer.innerHTML += html; } function LayerAddElement(layer,html){ var oElement = document.createElement(html); if(layer!=null){ layer.appendChild(oElement); } return oElement; } function ObjectClear(oObject){ if(oObject==null){ return; } try{ while(oObject.hasChildNodes()){ var oChild=oObject.children(0); oObject.removeChild(oChild); } } catch(x){ alert("Error ObjectClear();") } oObject.innerHTML = ''; } function checkValue(obj,value,sString,bEqual,alertString){ if(bEqual && value!=sString){ alert(alertString); obj.focus(); return false; } else if(!bEqual && value==sString){ alert(alertString); obj.focus(); return false; } return true; } function isIdUrl(sUrl){ while(sUrl.indexOf(',')>0){ var iIndex = sUrl.indexOf(','); var sId = sUrl.slice(0,iIndex-1); var iIndexNew = sId.indexOf(':'); if(iIndexNew>0){ if(isNaN(sId.slice(0,iIndexNew-1)) || isNaN(sId.slice(iIndexNew+1, sId.length)) ){ return false; } } if(isNaN(sId)){ return false; } sUrl = sUrl.slice(iIndex+1,sUrl.length); } if(sUrl.indexOf('&')>0){ sUrl = sUrl.slice(0,sUrl.indexOf('&')-1); } return !isNaN(sUrl); } function OpenUrlS(sUrl,sTarget){ if(sUrl.length >= 1){ if(isIdUrl(sUrl)){ sUrl = '/joodit.jsp?pa=' + sUrl; } if(sUrl.indexOf("javascript:")==0){ eval(sUrl.slice(11)); } else if(sUrl.indexOf("#")==0){ Something(); } else if( (sTarget.indexOf("blank")>-1) || (sTarget.indexOf("blanc")>-1) ){ //((sUrl.indexOf("http")==0) && (sTarget.length==0)) || window.open(sUrl); } else if(sTarget=="_self"){ document.location = sUrl; } else if(sTarget=="_top"){ top.location = sUrl; } else if((sTarget.length>1) && (sTarget!='contentFrame')){ eval('parent.' + sTarget).location = sUrl; } else{ contentFrame.document.location = sUrl; } } else{ Something(); } } var mDivs; function setLayerProperties(divs){ mDivs = divs; } function isPropertySet(div, value){ if(div==null){ return false; } for(i in mDivs){ if(mDivs[i][0] == div.className){ return mDivs[i][1].indexOf(value)>-1; } } return false; } function getPropertyValue(div, value){ if(div==null){ return null; } for(i in mDivs){ if(mDivs[i][0] == div.className){ return mDivs[i][1]; } } return null; } function loadcontentDiv(oContentDocument,script){ ToReadMode(); var oMainDiv = null; var oContentDiv = null; for(var i=0; i=oMainDiv.getAttribute("loginMode")){ if(oMainDiv.innerHTML!=''){ LayerShow(oMainDiv); } } else{ LayerHide(oMainDiv); } } } } else{ if(isPropertySet(oMainDiv, '_hide')){ LayerHide(oMainDiv); } if(isPropertySet(oMainDiv, '_empty')){ oMainDiv.innerHTML = ''; } } } } if(script!=''){ eval(script); } } function ToReadMode(){ LayerHide(GetObject('editorButtonsLayer')); if(oEditorDiv_!=null){ if(IsSourceMode()){ ToggleEditMode(); } oEditorDiv_.contentEditable = false; oEditorDiv_.className = 'contentDiv'; oEditorDiv_=null; } } function IsSourceMode(){ return bSourceMode_; }