/* cbe_clip.js $Revision: 0.11 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ CrossBrowserElement.prototype.autoClip = function(cp, cmd, increment, endListener, dt, dr, db, dl) { if (arguments.length <= 4) { if (this.clipping) return; else this.clipping = true; if (increment) this.clipSpeed = increment; else if (!this.clipSpeed) this.clipSpeed = 10; var unclip = true, w = this.width(), h = this.height(), xcs = Math.abs(this.clipSpeed), ycs = xcs; // Get x and y speeds that are proportional to the element's width and height if (h > w) ycs *= (h/w); else if(w > h) xcs *= (w/h); // Setup clip parameters and initial clip position if (cmd.toLowerCase() == 'clip') { xcs *= -1; ycs *= -1; unclip = false; this.clip(0, w, h, 0); } if (endListener) this.onclipend = endListener; switch(cp.toLowerCase()) { case 'n': dt = -ycs; dr = 0; db = 0; dl = 0; if (unclip) {this.clip(h, w, h, 0);} break; case 'ne': dt = -ycs; dr = xcs; db = 0; dl = 0; if (unclip) {this.clip(h, 0, h, 0);} break; case 'e': dt = 0; dr = xcs; db = 0; dl = 0; if (unclip) {this.clip(0, 0, h, 0);} break; case 'se': dt = 0; dr = xcs; db = ycs; dl = 0; if (unclip) {this.clip(0, 0, 0, 0);} break; case 's': dt = 0; dr = 0; db = ycs; dl = 0; if (unclip) {this.clip(0, w, 0, 0);} break; case 'sw': dt = 0; dr = 0; db = ycs; dl = -xcs; if (unclip) {this.clip(0, w, 0, w);} break; case 'w': dt = 0; dr = 0; db = 0; dl = -xcs; if (unclip) {this.clip(0, w, h, w);} break; case 'nw': dt = -ycs; dr = 0; db = 0; dl = -xcs; if (unclip) {this.clip(h, w, h, w);} break; case 'cen': case 'center': dt = -ycs; dr = xcs; db = ycs; dl = -xcs; if (unclip) {this.clip(h/2, w/2, h/2, w/2);} break; } } // end if if (this.clipBy(dt, dr, db, dl)) { setTimeout("cbeAll["+this.index+"].autoClip("+null+","+null+","+null+","+null+","+dt+","+dr+","+db+","+dl+")", this.timeout); } else { this.clipping = false; var listener = this.onclipend; if (listener) { this.onclipend = null; cbeEval(listener, this); } } } CrossBrowserElement.prototype.scrollBy = function(dx, dy) { var ct = this.clipTop(), cr = this.clipRight(), cb = this.clipBottom(), cl = this.clipLeft(), w = this.width(), h = this.height(); // Don't scroll beyond the edge of the element if (cl + dx < 0) dx = -cl; else if (cr + dx > w) dx = w - cr; if (ct + dy < 0) dy = -ct; else if (cb + dy > h) dy = h - cb; // Clip and move to simulate scrolling this.clip(ct + dy, cr + dx, cb + dy, cl + dx); this.moveBy(-dx, -dy); } CrossBrowserElement.prototype.clipBy = function(dt, dr, db, dl) { var ct = this.clipTop(); var cr = this.clipRight(); var cb = this.clipBottom(); var cl = this.clipLeft(); var w = this.width(); var h = this.height(); // Don't clip beyond the existing width and height of the element and don't let top/bottom and left/right coords cross. // Top if (ct + dt < 0) { ct = 0; dt = 0; } else if (ct + dt > cb) { ct = cb; dt = 0; } // Right if (cr + dr < cl) { cr = cl; dr = 0; } else if (cr + dr > w) { cr = w; dr = 0; } // Bottom if (cb + db < ct) { cb = ct; db = 0; } else if (cb + db > h) { cb = h; db = 0; } // Left if (cl + dl < 0) { cl = 0; dl = 0; } else if (cl + dl > cr) { cl = cr; dl = 0; } this.clip(ct + dt, cr + dr, cb + db, cl + dl); if (dt || dr || db || dl) return true; else return false; } CrossBrowserElement.prototype.clipArray = function() { if (this.ele.style) { var re = /\(|px,?\s?\)?|\s|,|\)/; return this.ele.style.clip.split(re); } else return null; } CrossBrowserElement.prototype.clipTop = function() { var v = 0, a = this.clipArray(); if (a) v = parseInt(a[1]); else if (this.ele.clip) v = this.ele.clip.top; return v; } CrossBrowserElement.prototype.clipRight = function() { var v = this.width(), a = this.clipArray(); if (a) v = parseInt(a[2]); else if (this.ele.clip) v = this.ele.clip.right; return v; } CrossBrowserElement.prototype.clipBottom = function() { var v = this.height(), a = this.clipArray(); if (a) v = parseInt(a[3]); else if (this.ele.clip) v = this.ele.clip.bottom; return v; } CrossBrowserElement.prototype.clipLeft = function() { var v = 0, a = this.clipArray(); if (a) v = parseInt(a[4]); else if (this.ele.clip) v = this.ele.clip.left; return v; } CrossBrowserElement.prototype.clipWidth = function() { var v = this.width(), a = this.clipArray(); if (a) v = parseInt(a[2]) - parseInt(a[4]); else if (this.ele.clip) v = this.ele.clip.width; return v; } CrossBrowserElement.prototype.clipHeight = function() { var v = this.height(), a = this.clipArray(); if (a) v = parseInt(a[3]) - parseInt(a[1]); else if (this.ele.clip) v = this.ele.clip.height; return v; } CrossBrowserElement.prototype.timeout = 35; var cbeClipJsLoaded = true; // End cbe_clip.js // **************************************************************************** /* cbe_core.js $Revision: 0.22 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ var cbeVersion="4.19", cbeDocumentId='idDocument', cbeWindowId='idWindow', cbeAll=new Array(); window.onload=function(){cbeInitialize("DIV", "SPAN"); if (window.windowOnload) window.windowOnload();} window.onunload=function(){if(window.windowOnunload){window.windowOnunload();}if(window.cbeDebugObj){window.cbeDebugObj=null;}for(var i=0; i=thisX + iClipLeft && iLeft <=thisX + this.width() - iClipRight && iTop >=thisY + iClipTop && iTop <=thisY + this.height() - iClipBottom );} function _cbeMoveTo(x_cr, y_mar, outside, xEndL){if (isFinite(x_cr)){this.left(x_cr); this.top(y_mar);}else{this.cardinalPosition(x_cr, y_mar, outside); this.left(this.x); this.top(this.y);}if (xEndL) cbeEval(xEndL, this);} function _cbeMoveBy(uDX, uDY, xEndL){if (uDX){this.left(this.left() + uDX);} if (uDY){this.top(this.top() + uDY);} if (xEndL){cbeEval(xEndL, this);}} function _domLeft(iX){if (arguments.length){this.ele.style.left=iX + "px";} else{iX=parseInt(this.ele.style.left); if (isNaN(iX)) iX=0;}return iX;} function _ieLeft(iX){if (arguments.length){this.ele.style.pixelLeft=iX;} else{iX=this.ele.style.pixelLeft;} return iX;} function _nnLeft(iX){if (arguments.length){this.ele.left=iX;} else{iX=this.ele.left;} return iX;} function _domTop(iY){if (arguments.length){this.ele.style.top=iY + "px";} else{iY=parseInt(this.ele.style.top); if (isNaN(iY)) iY=0;}return iY;} function _ieTop(iY){if (arguments.length){this.ele.style.pixelTop=iY;} else{iY=this.ele.style.pixelTop;} return iY;} function _nnTop(iY){if (arguments.length){this.ele.top=iY;} else{iY=this.ele.top;} return iY;} function _nnOffsetLeft(){var ol=this.ele.pageX - this.parentElement.pageX; if (isNaN(ol)){ol=this.ele.pageX;} return ol;} function _nnOffsetTop(){var ot=this.ele.pageY - this.parentElement.pageY; if (isNaN(ot)){ot=this.ele.pageY;} return ot;} function _ieOffsetLeft(){var x=this.ele.offsetLeft, parent=this.ele.offsetParent; while(parent && !parent.cbe){x +=parent.offsetLeft; parent=parent.offsetParent;}return x;} function _ieOffsetTop(){var y=this.ele.offsetTop, parent=this.ele.offsetParent; while(parent && !parent.cbe){y +=parent.offsetTop; parent=parent.offsetParent;}return y;} function _nnPageX(){return this.ele.pageX;} function _nnPageY(){return this.ele.pageY;} function _cbePageX(){var x=this.offsetLeft(), parent=this.parentNode; if (parent){while(parent.index > 1){x +=parent.offsetLeft(); parent=parent.parentNode;}} return x;} function _cbePageY(){var y=this.offsetTop(), parent=this.parentNode; if (parent){while(parent.index > 1){y +=parent.offsetTop(); parent=parent.parentNode;}} return y;} function _cbeSizeTo(uW, uH){this.width(uW); this.height(uH);} function _cbeSizeBy(iDW, iDH){this.width(this.width() + iDW); this.height(this.height() + iDH);} function _cbeResizeTo(uW, uH, xEndListener){this.sizeTo(uW, uH); this.clip('auto'); cbeEval(xEndListener, this);} function _cbeResizeBy(iDW, iDH, xEndListener){this.sizeBy(iDW, iDH); this.clip('auto'); cbeEval(xEndListener, this);} function _domWidth(uW){if (arguments.length){uW=Math.round(uW); _domSetWidth(this.ele, uW);}return this.ele.offsetWidth;} function _ieWidth(uW){if (arguments.length){uW=Math.round(uW); this.ele.style.pixelWidth=uW;}return this.ele.style.pixelWidth;} function _nnWidth(uW){if (arguments.length){this.w=Math.round(uW); this.ele.clip.right=this.w;}return this.w;} function _domHeight(uH){if (arguments.length){uH=Math.round(uH); _domSetHeight(this.ele, uH);}return this.ele.offsetHeight;} function _ieHeight(uH){if (arguments.length){uH=Math.round(uH); this.ele.style.pixelHeight=uH;}return this.ele.style.pixelHeight;} function _nnHeight(uH){if (arguments.length){this.h=Math.round(uH); this.ele.clip.bottom=this.h;}return this.h;} function _domSetWidth(ele,uW){ if (uW < 0) return; var pl=0,pr=0,bl=0,br=0; if (_def(document.defaultView) && _def(document.defaultView.getComputedStyle)){// gecko and standard pl=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("padding-left")); pr=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("padding-right")); bl=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("border-left-width")); br=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("border-right-width")); } else if (_def(ele.currentStyle, document.compatMode)){ if (document.compatMode=="CSS1Compat"){// ie6up in css1compat mode pl=parseInt(ele.currentStyle.paddingLeft); pr=parseInt(ele.currentStyle.paddingRight); bl=parseInt(ele.currentStyle.borderLeftWidth); br=parseInt(ele.currentStyle.borderRightWidth); } } if (isNaN(pl)) pl=0; if (isNaN(pr)) pr=0; if (isNaN(bl)) bl=0; if (isNaN(br)) br=0; var cssW=uW-(pl+pr+bl+br); if (isNaN(cssW) || cssW < 0) return; ele.style.width=cssW + "px"; } function _domSetHeight(ele,uH){ if (uH < 0) return; var pt=0,pb=0,bt=0,bb=0; if (_def(document.defaultView) && _def(document.defaultView.getComputedStyle)){ pt=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("padding-top")); pb=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("padding-bottom")); bt=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("border-top-width")); bb=parseInt(document.defaultView.getComputedStyle(ele, "").getPropertyValue("border-bottom-width")); } else if (_def(ele.currentStyle, document.compatMode)){ if (document.compatMode=="CSS1Compat"){ pt=parseInt(ele.currentStyle.paddingTop); pb=parseInt(ele.currentStyle.paddingBottom); bt=parseInt(ele.currentStyle.borderTopWidth); bb=parseInt(ele.currentStyle.borderBottomWidth); } } if (isNaN(pt)) pt=0; if (isNaN(pb)) pb=0; if (isNaN(bt)) bt=0; if (isNaN(bb)) bb=0; var cssH=uH-(pt+pb+bt+bb); if (isNaN(cssH) || cssH < 0) return; ele.style.height=cssH + "px"; } function _cbeScrollLeft(){return this.ele.scrollLeft;} function _cbeScrollTop(){return this.ele.scrollTop;} function _cbeShow(){this.visibility(1);} function _cbeHide(){this.visibility(0);} function _domVisibility(vis){if (arguments.length){if (vis){this.ele.style.visibility='inherit';} else{this.ele.style.visibility='hidden';}}else return (this.ele.style.visibility=='visible' || this.ele.style.visibility=='inherit' || this.ele.style.visibility=='');} function _nnVisibility(vis){if (arguments.length){if (vis){this.ele.visibility='inherit';} else{this.ele.visibility='hide';}}else return (this.ele.visibility=='show' || this.ele.visibility=='inherit' || this.ele.visibility=='');} function _domZIndex(uZ){if (arguments.length){this.ele.style.zIndex=uZ;} else{uZ=parseInt(this.ele.style.zIndex); if (isNaN(uZ)) uZ=0;}return uZ;} function _nnZIndex(uZ){if (arguments.length) this.ele.zIndex=uZ; return this.ele.zIndex;} function _domBackground(sColor, sImage){if (arguments.length){if (!sColor){sColor='transparent';} this.ele.style.backgroundColor=sColor; if (arguments.length==2){this.ele.style.backgroundImage="url(" + sImage + ")";}}else return this.ele.style.backgroundColor;} function _nnBackground(sColor, sImage){if (arguments.length){if (sColor=='transparent'){sColor=null;} this.ele.bgColor=sColor; if (arguments.length==2){this.ele.background.src=sImage || null;}}else{var bg=this.ele.bgColor; if (window.cbeUtilJsLoaded){bg=cbeHexString(bg,6,'#');} return bg;}} function _domColor(newColor){if (arguments.length){this.ele.style.color=newColor;}else return this.ele.style.color;} function _domClip(iTop, iRight, iBottom, iLeft){if (arguments.length==4){var clipRect="rect(" + iTop + "px " + iRight + "px " + iBottom + "px " + iLeft + "px" + ")"; this.ele.style.clip=clipRect;}else{this.clip(0, this.ele.offsetWidth, this.ele.offsetHeight, 0);}} function _nnClip(iTop, iRight, iBottom, iLeft){if (arguments.length==4){this.ele.clip.top=iTop; this.ele.clip.right=iRight; this.ele.clip.bottom=iBottom; this.ele.clip.left=iLeft;}else{this.clip(0, this.width(), this.height(), 0);}} function _ieInnerHtml(sHtml){if (arguments.length){this.ele.innerHTML=sHtml;}else return this.ele.innerHTML;} function _nnInnerHtml(sHtml){if (arguments.length){if (sHtml==""){sHtml=" ";} this.ele.document.open(); this.ele.document.write(sHtml); this.ele.document.close();}else return "";} CrossBrowserElement.prototype.cardinalPosition=function(cp, margin, outside){ if (typeof(cp) !='string'){window.status='cardinalPosition() error: cp=' + cp + ', id=' + this.id; return;} var x=this.left(), y=this.top(), w=this.width(), h=this.height(); var pw=this.parentNode.width(), ph=this.parentNode.height(); var sx=this.parentNode.scrollLeft(), sy=this.parentNode.scrollTop(); var right=sx + pw, bottom=sy + ph; var cenLeft=sx + Math.floor((pw-w)/2), cenTop=sy + Math.floor((ph-h)/2); if (!margin) margin=0; else{ if (outside) margin=-margin; sx +=margin; sy +=margin; right -=margin; bottom -=margin; } switch (cp.toLowerCase()){ case 'n': x=cenLeft; if (outside) y=sy - h; else y=sy; break; case 'ne': if (outside){x=right; y=sy - h;}else{x=right - w; y=sy;}break; case 'e': y=cenTop; if (outside) x=right; else x=right - w; break; case 'se': if (outside){x=right; y=bottom;}else{x=right - w; y=bottom - h}break; case 's': x=cenLeft; if (outside) y=sy - h; else y=bottom - h; break; case 'sw': if (outside){x=sx - w; y=bottom;}else{x=sx; y=bottom - h;}break; case 'w': y=cenTop; if (outside) x=sx - w; else x=sx; break; case 'nw': if (outside){x=sx - w; y=sy - h;}else{x=sx; y=sy;}break; case 'cen': case 'center': x=cenLeft; y=cenTop; break; case 'cenh': x=cenLeft; break; case 'cenv': y=cenTop; break; } this.x=x; this.y=y; } function cbeInnerWidth(){ var w=0; if (is.opera5or6){w=window.innerWidth;} else if (is.ie && document.documentElement && document.documentElement.clientWidth) w=document.documentElement.clientWidth; // ie6 compat mode else if (document.body && document.body.clientWidth) w=document.body.clientWidth; // ie4up and gecko else if (_def(window.innerWidth,window.innerHeight,document.height)){// nn4 w=window.innerWidth; if (document.height > window.innerHeight) w -=16; } return w; } function cbeInnerHeight(){ var h=0; if (is.opera5or6){h=window.innerHeight;} else if (is.ie && document.documentElement && document.documentElement.clientHeight) h=document.documentElement.clientHeight; else if (document.body && document.body.clientHeight) h=document.body.clientHeight; else if (_def(window.innerWidth,window.innerHeight,document.width)){ h=window.innerHeight; if (document.width > window.innerWidth) h -=16; } return h; } function cbePageXOffset(){ var offset=0; if (_def(window.pageXOffset)) offset=window.pageXOffset; // gecko, nn4, opera else if (document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft; // ie6 compat mode else if (document.body && _def(document.body.scrollLeft)) offset=document.body.scrollLeft; // ie4up return offset; } function cbePageYOffset(){ var offset=0; if (_def(window.pageYOffset)) offset=window.pageYOffset; else if (document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop; else if (document.body && _def(document.body.scrollTop)) offset=document.body.scrollTop; return offset; } function cbeEval(exp, arg1, arg2, arg3, arg4, arg5, arg6){ if (typeof(exp)=="function") exp(arg1, arg2, arg3, arg4, arg5, arg6); else if (typeof(exp)=="object" && typeof(arg1)=="function") { exp._cbeEval_ = arg1; exp._cbeEval_(arg2, arg3, arg4, arg5, arg6); } else if (typeof(exp)=="string") eval(exp); } function ClientSnifferJr(){ this.ua=navigator.userAgent.toLowerCase(); this.major=parseInt(navigator.appVersion); this.minor=parseFloat(navigator.appVersion); if (document.addEventListener && document.removeEventListener) this.dom2events=true; if (document.getElementById) this.dom1getbyid=true; if (window.opera){ this.opera=true; this.opera5=(this.ua.indexOf("opera 5") !=-1 || this.ua.indexOf("opera/5") !=-1); this.opera6=(this.ua.indexOf("opera 6") !=-1 || this.ua.indexOf("opera/6") !=-1); this.opera5or6=this.opera5 || this.opera6; this.opera7=(this.ua.indexOf("opera 7") !=-1 || this.ua.indexOf("opera/7") !=-1); return; } this.konq=this.ua.indexOf('konqueror') !=-1; this.ie=this.ua.indexOf('msie') !=-1; if (this.ie){ this.ie3=this.major < 4; this.ie4=(this.major==4 && this.ua.indexOf('msie 5')==-1 && this.ua.indexOf('msie 6')==-1 && this.ua.indexOf('msie 7')==-1); this.ie4up=this.major >=4; this.ie5=(this.major==4 && this.ua.indexOf('msie 5.0') !=-1); this.ie5up=!this.ie3 && !this.ie4; this.ie6=(this.major==4 && this.ua.indexOf('msie 6.0') !=-1); this.ie6up=(!this.ie3 && !this.ie4 && !this.ie5 && this.ua.indexOf("msie 5.5")==-1); return; } this.hotjava=this.ua.indexOf('hotjava') !=-1; this.webtv=this.ua.indexOf('webtv') !=-1; this.aol=this.ua.indexOf('aol') !=-1; if (this.hotjava || this.webtv || this.aol) return; // Gecko, NN4, and NS6 this.gecko=this.ua.indexOf('gecko') !=-1; this.nav=(this.ua.indexOf('mozilla') !=-1 && this.ua.indexOf('spoofer')==-1 && this.ua.indexOf('compatible')==-1); if (this.nav){ this.nav4=this.major==4; this.nav4up=this.major >=4; this.nav5up=this.major >=5; this.nav6=this.major==5; this.nav6up=this.nav5up; } } window.is=new ClientSnifferJr(); // End cbe_core.js // **************************************************************************** /* cbe_debug.js $Revision: 0.11 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ var cbeIDE=new Object(), cbeDebugObj=new Object(), cbeRefWin=null, cbeRefWinName='cbeRefWin', cbeDebugWin=null, cbeDebugWinName='cbeDebugWindow', cbeDebugSelected=null, cbeMMSL = false; function cbeMouseMoveStatus() { if (cbeMMSL) { document.cbe.removeEventListener('mouseMove', cbeMMStatusListener, false); cbeMMSL = false; } else { if (window.opera) window.defaultStatus=""; document.cbe.addEventListener('mouseMove', cbeMMStatusListener, false); cbeMMSL = true; } } function cbeMMStatusListener(e) { if (e.cbeTarget) window.status = 'MOUSE:' + ' X: ' + e.pageX + ' Y: ' + e.pageY + ' OBJECT:' + ' ID: ' + e.cbeTarget.id + ' P: ' + e.cbeTarget.parentNode.id + ' L: ' + e.cbeTarget.left() + ' T: ' + e.cbeTarget.top() + ' X: ' + e.cbeTarget.pageX() + ' Y: ' + e.cbeTarget.pageY() + ' Z: ' + e.cbeTarget.zIndex() + ' W: ' + e.cbeTarget.width() + ' H: ' + e.cbeTarget.height() + ' B: ' + e.cbeTarget.background(); } function cbeMUListener(e) { cbeDebugSetSelected(e.cbeTarget.id); } function cbeDebugSetSelected(id) { if (cbeDebugWin) if (cbeDebugWin.closed) cbeDebugWindow(); if (id == window.cbeWindowId) cbeDebugSelected = window.cbe; else if (id == window.cbeDocumentId) cbeDebugSelected = document.cbe; else cbeDebugSelected = cbeGetElementById(id).cbe; if (!cbeDebugSelected) cbeDebugSelected = window.cbe; } function cbeDebugWindow(sBaseUrl) { if (cbeDebugWin) { cbeDebugWin.close(); cbeDebugWin = null; document.cbe.removeEventListener('mouseUp', cbeMUListener, false); return; } cbeIDEInit(); if (!sBaseUrl) { sBaseUrl = window.cbeBasePath ? cbeBasePath : ""; } cbeDebugSetSelected(window.cbeWindowId); var features = "width="+cbeIDE.dw+",height="+cbeIDE.dh+",scrollbars=1,resizable=1"; if (document.layers) features += ",screenx="+cbeIDE.dx+",screeny="+cbeIDE.dy; else features += ",left="+cbeIDE.dx+",top="+cbeIDE.dy; window.cbeDebugWin = window.open(sBaseUrl + "cbe_debug.html", cbeDebugWinName, features); cbeDebugWin.resizeTo(cbeIDE.dw, cbeIDE.dh); cbeDebugWin.moveTo(cbeIDE.dx,cbeIDE.dy); document.cbe.addEventListener('mouseUp', cbeMUListener, false); cbeDebugObj.cmdLine = ""; cbeDebugUpdate(); } function cbeRefWindow(sBaseUrl) { if (window.cbeRefWin) { cbeRefWin.close(); cbeRefWin = null; return; } cbeIDEInit(); if (!sBaseUrl) { sBaseUrl = window.cbeBasePath ? cbeBasePath : ""; } var features = "width="+cbeIDE.rw+",height="+cbeIDE.rh+",scrollbars=1,resizable=1"; if (document.layers) features += ",screenx="+cbeIDE.rx+",screeny="+cbeIDE.ry; else features += ",left="+cbeIDE.rx+",top="+cbeIDE.ry; window.cbeRefWin = window.open(sBaseUrl + "cbe_reference.html", cbeRefWinName, features); cbeRefWin.resizeTo(cbeIDE.rw, cbeIDE.rh); cbeRefWin.moveTo(cbeIDE.rx, cbeIDE.ry); } function cbeTileWindows() { cbeIDEInit(); cbeDebugWindow(); if (!cbeDebugWin) {cbeDebugWindow();} window.resizeTo(cbeIDE.aw, cbeIDE.ah); window.moveTo(cbeIDE.ax, cbeIDE.ay); } function cbeIDEInit() { cbeIDE.dx = 0; cbeIDE.dy = 0; cbeIDE.dw = 200; cbeIDE.dh = screen.availHeight - 10; // Debug Window cbeIDE.rh = Math.round(screen.availHeight / 2); cbeIDE.rw = screen.availWidth - cbeIDE.dw; cbeIDE.rx = 0; cbeIDE.ry = cbeIDE.rh - 10; // Reference Window cbeIDE.ax = cbeIDE.dw; cbeIDE.ay = 0; cbeIDE.aw = screen.availWidth - cbeIDE.dw - 10; cbeIDE.ah = screen.availHeight - 10; // Application Window } function cbeDebugUpdate() { if (cbeDebugWin) { if (!cbeDebugWin.closed) setTimeout("cbeDebugUpdate()", 750); } if (cbeDebugObj.cmdLine.length) { var tmp = cbeDebugObj.cmdLine; cbeDebugObj.cmdLine = ""; eval(tmp); } cbeDebugObj.id = cbeDebugSelected.id; cbeDebugObj.left = cbeDebugSelected.left(); cbeDebugObj.top = cbeDebugSelected.top(); cbeDebugObj.zIndex = cbeDebugSelected.zIndex(); cbeDebugObj.pageX = cbeDebugSelected.pageX(); cbeDebugObj.pageY = cbeDebugSelected.pageY(); cbeDebugObj.offsetLeft = cbeDebugSelected.offsetLeft(); cbeDebugObj.offsetTop = cbeDebugSelected.offsetTop(); cbeDebugObj.scrollLeft = cbeDebugSelected.scrollLeft(); cbeDebugObj.scrollTop = cbeDebugSelected.scrollTop(); cbeDebugObj.width = cbeDebugSelected.width(); cbeDebugObj.height = cbeDebugSelected.height(); cbeDebugObj.visibility = cbeDebugSelected.visibility(); cbeDebugObj.color = cbeDebugSelected.color(); cbeDebugObj.background = cbeDebugSelected.background(); cbeDebugObj.childNodes = cbeDebugSelected.childNodes; cbeDebugObj.firstChild = cbeDebugSelected.firstChild ? cbeDebugSelected.firstChild.id : null; cbeDebugObj.lastChild = cbeDebugSelected.lastChild ? cbeDebugSelected.lastChild.id : null; cbeDebugObj.parentNode = cbeDebugSelected.parentNode ? cbeDebugSelected.parentNode.id : null; cbeDebugObj.previousSibling = cbeDebugSelected.previousSibling ? cbeDebugSelected.previousSibling.id : null; cbeDebugObj.nextSibling = cbeDebugSelected.nextSibling ? cbeDebugSelected.nextSibling.id : null; } function cbeDebugMsg(sMsg) { if (cbeDebugWin) { if (!cbeDebugWin.closed) { cbeDebugWin.setMsg(sMsg); } } } function cbeShowProps(obj, obj_name, showValues) { var i = null, win = null, result = "", objType = "", objValue = " "; if (!obj) { alert("obj is null"); return; } if (!obj_name) { if (obj.nodeName) obj_name = obj.nodeName; else obj_name = "this"; } result = "Property Viewer\n" +"\n" +"\n" +"
\n" +"\n" +"
\n" +"

" + obj_name + " Properties:

\n" +"\n"; for (i in obj) { objType = typeof(obj[i]); if (showValues) { if (objType.indexOf('string') != -1 && obj[i] == "") objValue = " "; else if (objType.indexOf('object') != -1) objValue = "..."; else if (objType.indexOf('function') != -1) objValue = "..."; else if (i.indexOf('HTML') != -1) objValue = "..."; else if (i.indexOf('erText') != -1) objValue = "..."; else if (i.indexOf('domain') != -1) objValue = "..."; else {objValue = obj[i];} } result += "\n"; } result += "
PropertyTypeValue
" + obj_name + "." + i + "" + objType + "" + objValue + "

" +"
\n" +"\n" +"
\n" +""; var features = "width=600,height=440,scrollbars=1,resizable=1"; if (document.layers) features += ",screenX=0,screenY=0"; else features += ",left=0,top=0"; win = window.open("", "PropertyViewerWindow", features); win.document.write(result); win.document.close(); return false; } function cbeShowParentChain(child) { var s = "", parent = child; while (parent) { s += "id: " + (parent.id || "null") + " tag: " + (parent.tagName || parent.nodeName || "null") + "\n"; parent = cbeGetParentElement(parent); } alert(s); } var cbeDebugJsLoaded = true; // End cbe_debug.js // **************************************************************************** /* cbe_event.js $Revision: 0.15 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ function cbeELReg(eventType, eventListener, eventCapture, listenerObject) { // event listener registration object constructor this.type = eventType; this.listener = eventListener; this.capture = eventCapture; this.obj = listenerObject; } function CrossBrowserEvent(e) { // Object constructor // from DOM2 Interface Event this.type = ""; this.target = null; this.currentTarget = null; this.eventPhase = 0; this.bubbles = true; this.cancelable = true; this.timeStamp = 0; this.AT_TARGET = 1; this.BUBBLING_PHASE = 2; this.CAPTURING_PHASE = 3; // eventPhase masks // from DOM2 Interface MouseEvent : UIEvent this.screenX = 0; this.screenY = 0; this.clientX = 0; this.clientY = 0; this.ctrlKey = false; this.shiftKey = false; this.altKey = false; this.metaKey = false; this.button = 3; // 3 == undefined this.relatedTarget = null; this.LEFT = 0; this.MIDDLE = 1; this.RIGHT = 2; // button masks // from IE4 Object Model this.keyCode = 0; this.offsetX = 0; this.offsetY = 0; // from NN4 Object Model this.pageX = 0; this.pageY = 0; // CBE this.stopPropagationFlag = false; this.preventDefaultFlag = false; this.cbeTarget = window.cbe; this.cbeCurrentTarget = window.cbe; if (!e) return; if (e.type) { this.type = e.type; } if (e.target) { this.target = e.target; } else if (e.srcElement) { this.target = e.srcElement; } if (e.currentTarget) { this.currentTarget = e.currentTarget; } else if (e.toElement) { this.currentTarget = e.toElement; } if (e.eventPhase) { this.eventPhase = e.eventPhase; } if (e.bubbles) { this.bubbles = e.bubbles; } if (e.cancelable) { this.cancelable = e.cancelable; } if (e.timeStamp) { this.timeStamp = e.timeStamp; } if (e.screenX) { this.screenX = e.screenX; } if (e.screenY) { this.screenY = e.screenY; } if (is.opera5or6) { this.clientX = e.clientX - document.cbe.scrollLeft(); } else if (e.clientX) { this.clientX = e.clientX; } else if (e.pageX) { this.clientX = e.pageX - document.cbe.scrollLeft(); } if (is.opera5or6) { this.clientY = e.clientY - document.cbe.scrollLeft(); } else if (e.clientY) { this.clientY = e.clientY; } else if (e.pageY) { this.clientY = e.pageY - document.cbe.scrollLeft(); } if (is.opera5or6) { this.ctrlKey = e.type=='mousemove' ? e.shiftKey : e.ctrlKey; } else if (_def(e.ctrlKey)) { this.ctrlKey = e.ctrlKey; } else if (_def(e.modifiers) && window.Event) { this.ctrlKey = (e.modifiers & window.Event.CONTROL_MASK) != 0; } if (is.opera5or6) { this.shiftKey = e.type=='mousemove' ? e.ctrlKey : e.shiftKey; } else if (_def(e.shiftKey)) { this.shiftKey = e.shiftKey; } else if (_def(e.modifiers) && window.Event) { this.shiftKey = (e.modifiers & Event.SHIFT_MASK) != 0; } if (e.altKey) { this.altKey = e.altKey; } else if (_def(e.modifiers) && window.Event) { this.altKey = (e.modifiers & Event.ALT_MASK) != 0; } if (e.metaKey) { this.metaKey = e.metaKey; } // button (?) if (is.ie) { if (this.type.indexOf('mouse') != -1) { if (e.button == 1) this.button = this.LEFT; else if (e.button == 4) this.button = this.MIDDLE; else if (e.button == 2) this.button = this.RIGHT; } else if (this.type == 'click') this.button = this.LEFT; else this.button = 4; // non-mouse event } else if (_def(e.button)) { // standard if (this.type.indexOf('mouse') != -1) { this.button = e.button; if (this.button < 0 || this.button > 2) {this.button = 3;} } else if (this.type == 'click') this.button = this.LEFT; else this.button = 4; // non-mouse event } else if (_def(e.which)) { if (document.layers) { // nn4 if (this.type.indexOf('mouse') != -1) { this.button = e.which - 1; if (this.button < 0 || this.button > 2) {this.button = 3;} } else if (this.type == 'click') this.button = this.LEFT; else this.button = 4; // non-mouse event } else { // opera5or6 if ((e.type == 'click' && e.which == 0) || ((e.type == 'mousedown' || e.type == 'mouseup') && e.which == 1)) {this.button = this.LEFT;} } } if (e.relatedTarget) { this.relatedTarget = e.relatedTarget; } else if (e.fromElement) { this.relatedTarget = e.fromElement; } // ? may need to be toElement in some cases ? if (_def(e.which)) { this.keyCode = e.which; } else if (_def(e.keyCode)) { this.keyCode = e.keyCode; } var calcOfs = false; if (_def(e.layerX,e.layerY)) { this.offsetX = e.layerX; this.offsetY = e.layerY; } else calcOfs = true; // calculate it below if (is.opera5or6) { this.pageX = e.clientX; this.pageY = e.clientY; } else if (_def(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; } else { this.pageX = this.clientX + document.cbe.scrollLeft(); this.pageY = this.clientY + document.cbe.scrollTop(); } // Find the CBE event target if (document.layers) { this.cbeTarget = cbeGetNodeFromPoint(this.pageX, this.pageY); // NN4 note: mouseout works only if mouseover and mouseout are both added to the same object if (this.type == 'mouseover') cbeMOT = this.cbeTarget; else if (this.type == 'mouseout') this.cbeTarget = cbeMOT || document.cbe; } else { var target = this.target; while (!target.cbe) {target = cbeGetParentElement(target);} this.cbeTarget = target.cbe; } this.cbeCurrentTarget = this.cbeTarget; if (calcOfs) { this.offsetX = this.pageX - this.cbeTarget.pageX(); this.offsetY = this.pageY - this.cbeTarget.pageY(); } } CrossBrowserElement.prototype.addEventListener = function(eventType, eventListener, useCapture, listenerObject) { if (!useCapture) useCapture = false; eventType = eventType.toLowerCase(); if ( (eventType.indexOf('mouse') != -1) || eventType == 'click' || (eventType.indexOf('key') != -1) /* || (eventType.indexOf('resize') != -1 && !is.nav4 && !is.opera) || (eventType.indexOf('scroll') != -1 && !is.nav && !is.opera) */ ) { var add=true; for (var i=0; i < this.listeners.length; ++i) { if (eventType == this.listeners[i].type) {add=false; break;} } if (add) { cbeNativeAddEventListener(this.ele, eventType, cbePropagateEvent, false); } this.listeners[this.listeners.length] = new cbeELReg(eventType, eventListener, useCapture, listenerObject); return; } switch(eventType) { case 'slidestart': this.onslidestart = eventListener; return; case 'slide': this.onslide = eventListener; return; case 'slideend': this.onslideend = eventListener; return; case 'dragstart': this.ondragstart = eventListener; return; case 'drag': this.ondragCapture = useCapture; this.ondrag = eventListener; this.addEventListener('mousedown', cbeDragStartEvent, useCapture); return; case 'dragend': this.ondragend = eventListener; return; case 'dragresize': if (window.cbeUtilJsLoaded) cbeAddDragResizeListener(this); return; case 'scroll': if (is.nav || is.opera) { window.cbeOldScrollTop = cbePageYOffset(); window.cbeOnScrollListener = eventListener; cbeScrollEvent(); return; } break; case 'resize': if (is.nav4 || is.opera) { window.cbeOldWidth = cbeInnerWidth(); window.cbeOldHeight = cbeInnerHeight(); window.cbeOnResizeListener = eventListener; cbeResizeEvent(); return; } break; } // end switch cbeNativeAddEventListener(this.ele, eventType, eventListener, useCapture); } function cbeNativeAddEventListener(ele, eventType, eventListener, useCapture) { if (!useCapture) useCapture = false; eventType = eventType.toLowerCase(); var eh = "ele.on" + eventType + "=eventListener"; if (ele.addEventListener) { ele.addEventListener(eventType, eventListener, useCapture); } else if (ele.captureEvents) { // if (useCapture || (eventType.indexOf('mousemove')!=-1)) // ??? ele.captureEvents(eval("Event." + eventType.toUpperCase())); eval(eh); } else { eval(eh); } } function cbeNativeRemoveEventListener(ele, eventType, eventListener, useCapture) { if (!useCapture) useCapture = false; eventType = eventType.toLowerCase(); var eh = "ele.on" + eventType + "=null"; if (ele.removeEventListener) { ele.removeEventListener(eventType, eventListener, useCapture); } else if (ele.releaseEvents) { // if (useCapture || (eventType.indexOf('mousemove')!=-1)) // ??? ele.releaseEvents(eval("Event." + eventType.toUpperCase())); eval(eh); } else { eval(eh); } } CrossBrowserElement.prototype.removeEventListener = function(eventType, eventListener, useCapture) { eventType = eventType.toLowerCase(); if (!useCapture) useCapture = false; if ((eventType.indexOf('mouse') != -1) || eventType == 'click' || (eventType.indexOf('key') != -1)) { var i; for (i = 0; i < this.listeners.length; ++i) { if (this.listeners[i].type == eventType && this.listeners[i].listener == eventListener && this.listeners[i].capture == useCapture) { if (this.listeners.splice) this.listeners.splice(i, 1); else this.listeners[i].type = "*"; break; } } var remove=true; for (i = 0; i < this.listeners.length; ++i) { if (eventType == this.listeners[i].type) { remove = false; break; } } if (remove) cbeNativeRemoveEventListener(this.ele, eventType, cbePropagateEvent, false); return; } switch(eventType) { case 'slidestart': this.onslidestart = null; return; case 'slide': this.onslide = null; return; case 'slideend': this.onslideend = null; return; case 'dragstart': this.ondragstart = null; return; case 'drag': this.removeEventListener('mousedown', cbeDragStartEvent, this.ondragCapture); this.ondrag = null; return; case 'dragend': this.ondragend = null; return; case 'dragresize': if (window.cbeUtilJsLoaded) cbeRemoveDragResizeListener(this); return; case 'scroll': if (is.nav || is.opera) { window.cbeOnScrollListener = null; return; } break; case 'resize': if (is.nav4 || is.opera) { window.cbeOnResizeListener = null; return; } break; } // end switch cbeNativeRemoveEventListener(this.ele, eventType, eventListener, useCapture); } CrossBrowserEvent.prototype.stopPropagation = function() { this.stopPropagationFlag = true; } CrossBrowserEvent.prototype.preventDefault = function() { this.preventDefaultFlag = true; } CrossBrowserElement.prototype.dispatchEvent= function(e) { var dispatch; e.cbeCurrentTarget = this; for (var i=0; i < this.listeners.length; ++i) { dispatch = false; if (e.type == this.listeners[i].type) { if (e.eventPhase == e.CAPTURING_PHASE) { if (this.listeners[i].capture) dispatch = true; } else if (!this.listeners[i].capture) dispatch = true; } if (dispatch) { if (this.listeners[i].obj) cbeEval(this.listeners[i].obj, this.listeners[i].listener, e); else cbeEval(this.listeners[i].listener, e); } } } function cbePropagateEvent(evt) { var i=0, e=null, a=new Array(); if (evt) e = new CrossBrowserEvent(evt); else if (window.event) e = new CrossBrowserEvent(window.event); else return; // Create an array of EventTargets, following the parent chain up (does not include cbeTarget) var node = e.cbeTarget.parentNode; while(node) { a[i++] = node; node = node.parentNode; } // The capturing phase e.eventPhase = e.CAPTURING_PHASE; for (i = a.length-1; i>=0; --i) { a[i].dispatchEvent(e); if (e.stopPropagationFlag) break; } // The at-target phase if (!e.stopPropagationFlag) { e.eventPhase = e.AT_TARGET; e.cbeTarget.dispatchEvent(e); // The bubbling phase if (!e.stopPropagationFlag && e.bubbles) { e.eventPhase = e.BUBBLING_PHASE; for (i = 0; i < a.length; ++i) { a[i].dispatchEvent(e); if (e.stopPropagationFlag) break; } } } // Don't allow native bubbling if (is.ie) window.event.cancelBubble = true; else if (is.gecko) evt.stopPropagation(); // Allow listener to cancel default action if (e.cancelable && e.preventDefaultFlag) { if (is.gecko || is.opera) evt.preventDefault(); return false; } else return true; } function cbeGetNodeFromPoint(x, y) { var hn /* highNode */, hz=0 /* highZ */, cn /* currentNode */, cz /* currentZ */; hn = document.cbe; while (hn.firstChild && hz >= 0) { hz = -1; cn = hn.firstChild; while (cn) { if (cn.contains(x, y)) { cz = cn.zIndex(); if (cz >= hz) { hn = cn; hz = cz; } } cn = cn.nextSibling; } } return hn; } function cbeScrollEvent() { if (!window.cbeOnScrollListener) { return; } if (cbePageYOffset() != window.cbeOldScrollTop) { cbeEval(window.cbeOnScrollListener); window.cbeOldScrollTop = cbePageYOffset(); } setTimeout("cbeScrollEvent()", 250); } function cbeResizeEvent() { if (!window.cbeOnResizeListener) { return; } var dw = window.cbeOldWidth - cbeInnerWidth(); var dh = window.cbeOldHeight - cbeInnerHeight(); if (dw != 0 || dh != 0) { if (window.cbeOnResizeListener) cbeEval(window.cbeOnResizeListener, dw, dh); window.cbeOldWidth = cbeInnerWidth(); window.cbeOldHeight = cbeInnerHeight(); } setTimeout("cbeResizeEvent()", 250); } function cbeDefaultResizeListener() { if (is.opera) location.replace(location.href); else history.go(0); } var cbeDragObj, cbeDragTarget, cbeDragPhase; function cbeDragStartEvent(e) { if (is.opera) { var tn = e.target.tagName.toLowerCase(); if (tn == 'a') return; } else if (is.nav4) { if (e.target.href) return; } cbeDragObj = e.cbeCurrentTarget; cbeDragTarget = e.cbeTarget; if (cbeDragTarget.id == cbeDragObj.id) cbeDragPhase = e.AT_TARGET; else if (cbeDragObj.ondragCapture) cbeDragPhase = e.CAPTURING_PHASE; else cbeDragPhase = e.BUBBLING_PHASE; if (cbeDragObj) { if (cbeDragObj.ondragstart) { e.type = 'dragstart'; cbeEval(cbeDragObj.ondragstart, e); e.type = 'mousedown'; } cbeDragObj.x = e.pageX; cbeDragObj.y = e.pageY; document.cbe.addEventListener('mousemove', cbeDragEvent, cbeDragObj.ondragCapture); document.cbe.addEventListener('mouseup', cbeDragEndEvent, false); } e.stopPropagation(); e.preventDefault(); } function cbeDragEndEvent(e) { document.cbe.removeEventListener('mousemove', cbeDragEvent, cbeDragObj.ondragCapture); document.cbe.removeEventListener('mouseup', cbeDragEndEvent, false); if (cbeDragObj.ondragend) { e.type = 'dragend'; e.cbeCurrentTarget = cbeDragObj; e.cbeTarget = cbeDragTarget; cbeEval(cbeDragObj.ondragend, e); e.type = 'mouseup'; } //e.stopPropagation(); e.preventDefault(); } function cbeDragEvent(e) { if (cbeDragObj) { e.dx = e.pageX - cbeDragObj.x; e.dy = e.pageY - cbeDragObj.y; cbeDragObj.x = e.pageX; cbeDragObj.y = e.pageY; e.type = 'drag'; e.cbeTarget = cbeDragTarget; e.cbeCurrentTarget = cbeDragObj; e.eventPhase = cbeDragPhase; if (cbeDragObj.ondrag) cbeEval(cbeDragObj.ondrag, e); else cbeDragObj.moveBy(e.dx,e.dy); e.type = 'mousemove'; } //e.stopPropagation(); e.preventDefault(); } var cbeEventPhase = new Array('', 'AT_TARGET', 'BUBBLING_PHASE', 'CAPTURING_PHASE'); var cbeButton = new Array('LEFT', 'MIDDLE', 'RIGHT', 'undefined', 'non-mouse event'); CrossBrowserElement.prototype.ondragstart = null; CrossBrowserElement.prototype.ondrag = null; CrossBrowserElement.prototype.ondragend = null; var cbeEventJsLoaded = true; // End cbe_event.js // **************************************************************************** /* cbe_slide.js $Revision: 0.12 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ CrossBrowserElement.prototype.slideBy = function(dX, dY, totalTime, endListener) { var targetX, targetY; dX = parseInt(dX); dY = parseInt(dY); targetX = this.left() + dX; targetY = this.top() + dY; this.slideTo(targetX, targetY, totalTime, endListener) } CrossBrowserElement.prototype.slideTo = function(x, y, totalTime, endListener) { if (this.onslidestart) cbeEval(this.onslidestart, this); this.xTarget = parseInt(x); this.yTarget = parseInt(y); this.slideTime = parseInt(totalTime); if (isNaN(this.xTarget)) { var outside=false; if (isNaN(this.yTarget)) { y = 0; outside = true; } this.cardinalPosition(x, y, outside); this.xTarget = this.x; this.yTarget = this.y; } if (endListener && window.cbeEventJsLoaded) { this.autoRemoveListener = true; this.addEventListener('slideend', endListener); } this.stop = false; this.yA = this.yTarget - this.top(); this.xA = this.xTarget - this.left(); // A = distance this.B = Math.PI / (2 * this.slideTime); // B = period this.yD = this.top(); this.xD = this.left(); // D = initial position if (this.slideRate == cbeSlideRateLinear) { this.B = 1/this.slideTime; } else if (this.slideRate == cbeSlideRateCosine) { this.yA = -this.yA; this.xA = -this.xA; this.yD = this.yTarget; this.xD = this.xTarget; } var d = new Date(); this.C = d.getTime(); if (!this.moving) this.slide(); } CrossBrowserElement.prototype.slide = function() { var now, s, t, newY, newX; now = new Date(); t = now.getTime() - this.C; if (this.stop) { this.moving = false; } else if (t < this.slideTime) { setTimeout("window.cbeAll["+this.index+"].slide()", this.timeout); if (this.slideRate == cbeSlideRateLinear) s = this.B * t; else if (this.slideRate == cbeSlideRateSine) s = Math.sin(this.B * t); else s = Math.cos(this.B * t); // this.slideRate == cbeSlideRateCosine newX = Math.round(this.xA * s + this.xD); newY = Math.round(this.yA * s + this.yD); if (this.onslide) cbeEval(this.onslide, this, newX, newY, t); this.moveTo(newX, newY); this.moving = true; } else { this.moveTo(this.xTarget, this.yTarget); this.moving = false; if (this.onslideend) { var tmp = this.onslideend; if (this.autoRemoveListener && window.cbeEventJsLoaded) { this.autoRemoveListener = false; this.removeEventListener('slideend'); } cbeEval(tmp, this); } } } CrossBrowserElement.prototype.ellipse = function(xRadius, yRadius, radiusInc, totalTime, startAngle, stopAngle, endListener) { if (this.onslidestart) cbeEval(this.onslidestart, this); this.stop = false; this.xA = parseInt(xRadius); this.yA = parseInt(yRadius); this.radiusInc = parseInt(radiusInc); this.slideTime = parseInt(totalTime); startAngle = cbeRadians(parseFloat(startAngle)); stopAngle = cbeRadians(parseFloat(stopAngle)); if (endListener && window.cbeEventJsLoaded) { this.autoRemoveListener = true; this.addEventListener('slideend', endListener); } var startTime = (startAngle * this.slideTime) / (stopAngle - startAngle); this.stopTime = this.slideTime + startTime; this.B = (stopAngle - startAngle) / this.slideTime; this.xD = this.left() - Math.round(this.xA * Math.cos(this.B * startTime)); // center point this.yD = this.top() - Math.round(this.yA * Math.sin(this.B * startTime)); this.xTarget = Math.round(this.xA * Math.cos(this.B * this.stopTime) + this.xD); // end point this.yTarget = Math.round(this.yA * Math.sin(this.B * this.stopTime) + this.yD); var d = new Date(); this.C = d.getTime() - startTime; if (!this.moving) this.ellipse1(); } CrossBrowserElement.prototype.ellipse1 = function() { var now, t, newY, newX; now = new Date(); t = now.getTime() - this.C; if (this.stop) { this.moving = false; } else if (t < this.stopTime) { setTimeout("window.cbeAll["+this.index+"].ellipse1()", this.timeout); if (this.radiusInc) { this.xA += this.radiusInc; this.yA += this.radiusInc; } newX = Math.round(this.xA * Math.cos(this.B * t) + this.xD); newY = Math.round(this.yA * Math.sin(this.B * t) + this.yD); if (this.onslide) cbeEval(this.onslide, this, newX, newY, t); this.moveTo(newX, newY); this.moving = true; } else { if (this.radiusInc) { this.xTarget = Math.round(this.xA * Math.cos(this.B * this.slideTime) + this.xD); this.yTarget = Math.round(this.yA * Math.sin(this.B * this.slideTime) + this.yD); } this.moveTo(this.xTarget, this.yTarget); this.moving = false; if (this.onslideend) { var tmp = this.onslideend; if (this.autoRemoveListener && window.cbeEventJsLoaded) { this.autoRemoveListener = false; this.removeEventListener('slideend'); } cbeEval(tmp, this); } } } CrossBrowserElement.prototype.stopSlide = function() { this.stop = true; } CrossBrowserElement.prototype.startSequence = function(uIndex) { if (!this.moving) { if (!uIndex) this.seqIndex = 0; else this.seqIndex = uIndex; this.addEventListener('slideEnd', cbeSlideSequence); cbeSlideSequence(this); } } CrossBrowserElement.prototype.stopSequence = function() { this.stop=true; this.removeEventListener('slideEnd', cbeSlideSequence); } function cbeSlideSequence(cbe) { var pw = cbe.parentNode.width(), ph = cbe.parentNode.height(), w = cbe.width(), h = cbe.height(); if (cbe.seqIndex >= cbe.sequence.length) cbe.seqIndex = 0; eval('cbe.'+cbe.sequence[cbe.seqIndex++]); } var cbeSlideRateLinear=0, cbeSlideRateSine=1, cbeSlideRateCosine=2; CrossBrowserElement.prototype.slideRate = cbeSlideRateSine; CrossBrowserElement.prototype.seqIndex = 0; CrossBrowserElement.prototype.radiusInc = 0; CrossBrowserElement.prototype.t = 0; CrossBrowserElement.prototype.xTarget = 0; CrossBrowserElement.prototype.yTarget = 0; CrossBrowserElement.prototype.slideTime = 1000; CrossBrowserElement.prototype.xA = 0; CrossBrowserElement.prototype.yA = 0; CrossBrowserElement.prototype.xD = 0; CrossBrowserElement.prototype.yD = 0; CrossBrowserElement.prototype.B = 0; CrossBrowserElement.prototype.C = 0; CrossBrowserElement.prototype.moving = false; CrossBrowserElement.prototype.stop = true; CrossBrowserElement.prototype.timeout = 35; CrossBrowserElement.prototype.autoRemoveListener = false; CrossBrowserElement.prototype.onslidestart = null; CrossBrowserElement.prototype.onslide = null; CrossBrowserElement.prototype.onslideend = null; var cbeSlideJsLoaded = true; // End cbe_slide.js // **************************************************************************** /* cbe_slide2.js $Revision: 0.11 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ CrossBrowserElement.prototype.slideCornerBy = function(corner, dX, dY, totalTime, endListener) { var targetX, targetY; dX = parseInt(dX); dY = parseInt(dY); switch(corner.toLowerCase()) { case 'nw': targetX = this.left() + dX; targetY = this.top() + dY; break; case 'sw': targetX = this.left() + dX; targetY = this.top() + this.height() + dY; break; case 'ne': targetX = this.left() + this.width() + dX; targetY = this.top() + dY; break; case 'se': targetX = this.left() + this.width() + dX; targetY = this.top() + this.height() + dY; break; default: alert("CBE: Invalid corner"); return; } this.slideCornerTo(corner, targetX, targetY, totalTime, endListener) } CrossBrowserElement.prototype.slideCornerTo = function(corner, targetX, targetY, totalTime, endListener) { if (this.onslidestart) cbeEval(this.onslidestart, this); this.xTarget = parseInt(targetX); this.yTarget = parseInt(targetY); this.slideTime = parseInt(totalTime); this.corner = corner.toLowerCase(); if (endListener) { this.autoRemoveListener = true; this.addEventListener('slideend', endListener); } this.stop = false; switch(this.corner) { case 'nw': this.xA = this.xTarget - this.left(); this.yA = this.yTarget - this.top(); this.xD = this.left(); this.yD = this.top(); break; case 'sw': this.xA = this.xTarget - this.left(); this.yA = this.yTarget - (this.top() + this.height()); this.xD = this.left(); this.yD = this.top() + this.height(); break; case 'ne': this.xA = this.xTarget - (this.left() + this.width()); this.yA = this.yTarget - this.top(); this.xD = this.left() + this.width(); this.yD = this.top(); break; case 'se': this.xA = this.xTarget - (this.left() + this.width()); this.yA = this.yTarget - (this.top() + this.height()); this.xD = this.left() + this.width(); this.yD = this.top() + this.height(); break; default: alert("CBE: Invalid corner"); return; } this.B = Math.PI / ( 2 * this.slideTime ); var d = new Date( ) this.C = d.getTime(); if (!this.moving) this.slideCorner(); } CrossBrowserElement.prototype.slideCorner = function() { var now, seX, seY; now = new Date(); t = now.getTime() - this.C; if (this.stop) { this.moving = false; this.stop = false; return; } else if (t < this.slideTime) { setTimeout("window.cbeAll["+this.index+"].slideCorner()", this.timeout); s = Math.sin( this.B * t ); newX = Math.round(this.xA * s + this.xD); newY = Math.round(this.yA * s + this.yD); if (this.onslide) cbeEval(this.onslide, this, newX, newY, t); } else { newX = this.xTarget; newY = this.yTarget; } seX = this.left() + this.width(); seY = this.top() + this.height(); switch(this.corner) { case 'nw': this.moveTo(newX, newY); this.sizeTo(seX - this.left(), seY - this.top()); break; case 'sw': if (this.xTarget != this.left()) { this.left(newX); this.width(seX - this.left()); } this.height(newY - this.top()); break; case 'ne': this.width(newX - this.left()); if (this.yTarget != this.top()) { this.top(newY); this.height(seY - this.top()); } break; case 'se': this.width(newX - this.left()); this.height(newY - this.top()); break; default: this.stop = true; } this.clip('auto'); this.moving = true; if (t >= this.slideTime) { this.moving = false; if (this.onslideend) { var tmp = this.onslideend; if (this.autoRemoveListener) { this.autoRemoveListener = false; this.removeEventListener('slideend'); } cbeEval(tmp, this); } } } CrossBrowserElement.prototype.parametricEquation = function(exprX, exprY, totalTime, endListener) { if (this.onslidestart) cbeEval(this.onslidestart, this); this.t = 0; this.stop = false; this.exprX = exprX; this.exprY = exprY; if (endListener && window.cbeEventJsLoaded) { this.autoRemoveListener = true; this.addEventListener('slideend', endListener); } this.slideTime = parseInt(totalTime); var d = new Date( ) this.C = d.getTime(); if (!this.moving) this.parametricEquation1(); } CrossBrowserElement.prototype.parametricEquation1 = function() { var now = new Date(); var et = now.getTime() - this.C; this.t += this.tStep; t = this.t; if (this.stop) { this.moving = false; } else if (!this.slideTime || et < this.slideTime) { setTimeout("window.cbeAll["+this.index+"].parametricEquation1()", this.timeout); var centerX = (this.parentNode.width()/2)-(this.width()/2); var centerY = (this.parentNode.height()/2)-(this.height()/2); this.xTarget = Math.round((eval(this.exprX) * centerX) + centerX) + this.parentNode.scrollLeft(); this.yTarget = Math.round((eval(this.exprY) * centerY) + centerY) + this.parentNode.scrollTop(); if (this.onslide) cbeEval(this.onslide, this, this.xTarget, this.yTarget, et); this.moveTo(this.xTarget, this.yTarget); this.moving = true; } else { this.moving = false; if (this.onslideend) { var tmp = this.onslideend; if (this.autoRemoveListener && window.cbeEventJsLoaded) { this.autoRemoveListener = false; this.removeEventListener('slideend'); } cbeEval(tmp, this); } } } var cbeSlideRateLinear=0, cbeSlideRateSine=1, cbeSlideRateCosine=2; CrossBrowserElement.prototype.slideRate = cbeSlideRateSine; CrossBrowserElement.prototype.tStep = .008; CrossBrowserElement.prototype.exprX = ""; CrossBrowserElement.prototype.exprY = ""; CrossBrowserElement.prototype.corner = ""; CrossBrowserElement.prototype.xTarget = 0; CrossBrowserElement.prototype.yTarget = 0; CrossBrowserElement.prototype.slideTime = 1000; CrossBrowserElement.prototype.xA = 0; CrossBrowserElement.prototype.yA = 0; CrossBrowserElement.prototype.xD = 0; CrossBrowserElement.prototype.yD = 0; CrossBrowserElement.prototype.B = 0; CrossBrowserElement.prototype.C = 0; CrossBrowserElement.prototype.moving = false; CrossBrowserElement.prototype.stop = true; CrossBrowserElement.prototype.timeout = 35; CrossBrowserElement.prototype.autoRemoveListener = false; CrossBrowserElement.prototype.onslidestart = null; CrossBrowserElement.prototype.onslide = null; CrossBrowserElement.prototype.onslideend = null; var cbeSlide2JsLoaded = true; // End cbe_slide2.js // **************************************************************************** /* cbe_util.js $Revision: 0.14 $ * CBE v4.19, Cross-Browser DHTML API from Cross-Browser.com * Copyright (c) 2002 Michael Foster (mike@cross-browser.com) * Distributed under the terms of the GNU LGPL from gnu.org */ // visit function returns: 0 == stop, 1 == continue, 2 == skip subtree function cbeTraverseTree(order, startNode, visitFunction, data) { cbeTraversePreOrder(startNode, 0, 0, visitFunction, data); } function cbeTraversePreOrder(node, level, branch, vFn, data) { var ret = vFn(node,level,branch,data); if (!ret) return 0; if (ret == 1 && node.firstChild) { var child = node.firstChild; while (child) { if (!level) ++branch; if (!cbeTraversePreOrder(child,level+1,branch,vFn,data)) return 1; child = child.nextSibling; } } return 1; } var cbeImageCount=0; var cbeImageObj = new Array(); var cbeImageName = new Array(); function cbeNewImage(imgName, imgUrl, imgWidth, imgHeight) { var imgObj; if (arguments.length == 4) imgObj = new Image(imgWidth,imgHeight); else imgObj = new Image(); imgObj.src = imgUrl; imgObj.id = imgObj.name = imgName; cbeImageObj[cbeImageCount] = imgObj; cbeImageName[cbeImageCount++] = imgName; return imgObj; } function cbeSetImage(tagImg, preloadedImg) { var t, p; if (typeof(tagImg)=='string') t = cbeGetImageByName(tagImg); else t = tagImg; if (typeof(preloadedImg)=='string') p = cbeGetImageByName(preloadedImg); else p = preloadedImg; t.src = p.src; } function cbeGetImageByName(imgName) { var i, j; if (document.images[imgName]) return document.images[imgName]; if (is.nav4) { for (i = 0; i < cbeAll.length; i++) { if (cbeAll[i].ele.document) { for (j = 0; j < cbeAll[i].ele.document.images.length; j++) { if (imgName == cbeAll[i].ele.document.images[j].name) return cbeAll[i].ele.document.images[j]; } } } } for (i = 0; i < cbeImageName.length; i++) { if (cbeImageName[i] == imgName) return cbeImageObj[i]; } return null; } function cbeGetFormByName(frmName) { var i, j; if (document.forms[frmName]) return document.forms[frmName]; if (is.nav4) { for (i = 0; i < cbeAll.length; i++) { if (cbeAll[i].ele.document) { for (j = 0; j < cbeAll[i].ele.document.forms.length; j++) { if (frmName == cbeAll[i].ele.document.forms[j].name) return cbeAll[i].ele.document.forms[j]; } } } } return null; } // cookie implementations based on code from Netscape Javascript Guide function cbeSetCookie(name, value, expire, path) { document.cookie = name + "=" + escape(value) + ((!expire) ? "" : ("; expires=" + expire.toGMTString())) + "; path=/"; } function cbeGetCookie(name) { var value=null, search=name+"="; if (document.cookie.length > 0) { var offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; var end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; value = unescape(document.cookie.substring(offset, end)); } } return value; } function cbeGetURLArguments() { var idx = location.href.indexOf('?'); var params = new Array(); if (idx != -1) { var pairs = location.href.substring(idx+1, location.href.length).split('&'); for (var i=0; i (e.cbeCurrentTarget.width() - 20) && e.offsetY > (e.cbeCurrentTarget.height() - 20)) { e.cbeCurrentTarget.isResizing = true; } else e.cbeCurrentTarget.isResizing = false; } function cbeDragResizeListener(e) { if (e.cbeCurrentTarget.isResizing) e.cbeCurrentTarget.resizeBy(e.dx, e.dy); else e.cbeCurrentTarget.moveBy(e.dx, e.dy); } var cbeUtilJsLoaded = true; // End cbe_util.js // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // skyBuilders code begins var aNavInitObj, aNavInitNp, sNavInitLength; var aScrollInit, sScrollInitLength; var aPortalElementInit, sPortalElementInitLength; var sNumCBE, sSkyFooterTop, oSkyFooter; var sOnLoadCommand, sFooterOnLoadCommand; var myUndefined; var sSkyFooterId; // alert("sPageID = "); // if (sSkyPageID == myUndefined) { // } sSkyFooterId = ""; sOnLoadCommand = ""; sFooterOnLoadCommand = ""; sNavInitLength = 0; aNavInitObj = new Array(); aNavInitNp = new Array(); sScrollInitLength = 0; aScrollInit = new Array(); sPortalElementInitLength = 0; aPortalElementInit = new Array(); function skyDyn_mLoadURL(sId, sNewURL) { var o, oC; var sWidth, sHeight; sContainerId = sId; sObjectId = "if" + sId; if (is.ie4) { eval("document.getElementById('" + sContainerId + "').document.all." + sObjectId + ".src = sNewURL;"); } else if ((is.ie5up) || (is.gecko)) { o = document.getElementById(sObjectId); o.src = sNewURL; oC = o.parentNode; o.width = oC.cbe.width(); o.height = oC.cbe.height(); oC.cbe.clip(0, oC.cbe.width(), oC.cbe.height(), 0); } else if (is.nav4) { // was: eval("document." + sContainerId + ".src = sNewURL;"); // eval("document.getElementById('" + sObjectId + "').src = sNewURL;"); // eval("alert(" + sObjectId + ");"); document.getElementById(sObjectId).src = sNewURL; } } function skyDyn_createElement (oElement) { // Create this element as a child of document skyDyn_createElementAsChildOf(oElement, document); } function skyDyn_createElementAsChildOf (oElement, oParent) { var oCBEDiv, sSourceText, aSourceText, sNumHeadline, oHeadline, oPrevHeadline; var oCBEIFrame; // possibly toggle out is nav4 for LAYER? oCBEDiv = document.cbe.createElement("DIV"); // alert("oElement.sID = " + oElement.sId); if (oCBEDiv) { switch (oElement.sInherits) { case "builder": oCBEDiv.id = oElement.sId; oParent.cbe.appendChild(oCBEDiv); // for two-way addressability oElement.oCBE = oCBEDiv; oCBEDiv.cbe.oSkyElement = oElement; oCBEDiv.cbe.hide(); oCBEDiv.cbe.moveTo(oElement.sLeft, oElement.sTop); if (!(oElement.sWidth == "")) { oCBEDiv.cbe.sizeTo(oElement.sWidth, oElement.sHeight); } if (is.nav4) { oCBEDiv.fontSize = oElement.sFontSize + "px"; oCBEDiv.fontFamily = oElement.sFontFamily; oCBEDiv.fontWeight = oElement.sFontWeight; // is padding set in style? - yes! // default it to 2 oCBEDiv.padding = "2px"; // how about alignment? oCBEDiv.textAlign = oElement.sAlign; if (oElement.sBorder == "1") { // set the border size and color - how? // oElement.sBorderWidth // oElement.sBorderColor oCBEDiv.borderStyle = "solid"; oCBEDiv.borderTopWidth = oElement.sBorderWidth; oCBEDiv.borderLeftWidth = oElement.sBorderWidth; oCBEDiv.borderBottomWidth = oElement.sBorderWidth; oCBEDiv.borderRightWidth = oElement.sBorderWidth; oCBEDiv.borderColor = oElement.sBorderColor; } } else { oCBEDiv.style.fontSize = oElement.sFontSize + "pt"; oCBEDiv.style.fontFamily = oElement.sFontFamily; oCBEDiv.style.fontWeight = oElement.sFontWeight; // is padding set in style? - yes! // default it to 2 oCBEDiv.style.padding = "2px"; // how about alignment? oCBEDiv.style.textAlign = oElement.sAlign; if (oElement.sBorder == "1") { // set the border size and color - how? // oElement.sBorderWidth // oElement.sBorderColor oCBEDiv.style.borderStyle = "solid"; oCBEDiv.style.borderTopWidth = oElement.sBorderWidth; oCBEDiv.style.borderLeftWidth = oElement.sBorderWidth; oCBEDiv.style.borderBottomWidth = oElement.sBorderWidth; oCBEDiv.style.borderRightWidth = oElement.sBorderWidth; oCBEDiv.style.borderColor = oElement.sBorderColor; } } // vertical alignment works differently oCBEDiv.cbe.verticalAlign = oElement.sVAlign; oCBEDiv.cbe.color(oElement.sColor); oCBEDiv.cbe.background(oElement.sBGColor); // moved down: oCBEDiv.cbe.clip(0, oElement.sScrollWidth, oElement.sScrollHeight, 0); if (oElement.sContent == "") { // alert(oCBEDiv.id); // different under nav4? - no IFrame object if (is.nav4) { oCBEIFrame = document.cbe.createElement("LAYER"); } else { oCBEIFrame = document.cbe.createElement("IFRAME"); } oCBEIFrame.id = "if" + oElement.sId; if (is.nav4) { } else { if (oCBEIFrame.cbe) { oCBEIFrame.cbe.hide(); } } if (!(oElement.sWidth == "")) { if (oCBEIFrame.cbe) { oCBEIFrame.cbe.sizeTo(oElement.sWidth - 3, oElement.sHeight - 3); } } // set the iframe border to nothing oCBEIFrame.frameBorder = 0; oCBEDiv.cbe.appendChild(oCBEIFrame); // alert("before skyDyn_mLoadURL"); skyDyn_mLoadURL(oElement.sId, oElement.sURL); // alert("after skyDyn_mLoadURL"); } else { if (oElement.sContent != " ") { oCBEDiv.cbe.innerHtml(oElement.sContent); } } // now define the functions/behaviors for this object oCBEDiv.mOnMouseOver = oElement.mOnMouseOver; oCBEDiv.cbe.addEventListener('mouseover', oCBEDiv.mOnMouseOver); oCBEDiv.mOnMouseOut = oElement.mOnMouseOut; oCBEDiv.cbe.addEventListener('mouseout', oCBEDiv.mOnMouseOut); oCBEDiv.mOnClick = oElement.mOnClick; oCBEDiv.cbe.addEventListener('click', oCBEDiv.mOnClick); if (oCBEDiv.id == "BackChannel") { // alert("BackChannel content = " + oElement.sContent); } if (oElement.sVisibility == "visible") { oCBEDiv.cbe.show(); if (oElement.sContent == "") { oCBEIFrame.cbe.show(); // document.getElementById("if" + oElement.sId).cbe.show(); } } if ((oElement.sVisibility == "hidden") && (oElement.sContent == "")) { // document.getElementById("if" + oElement.sId).cbe.hide(); } break; case "scroll": oCBEDiv.id = oElement.sScrollId; oParent.cbe.appendChild(oCBEDiv); /* font-size:10pt; font-family:helvetica,arial,sans-serif; font-weight: normal; overflow:hidden; visibility:hidden; */ // oCBEDiv.cbe.resizeTo(oElement.sScrollWidth, oElement.sScrollHeight); // some trouble with the source // oCBEDiv.cbe.innerHtml("test"); // alert(oElement.sSource); // oCBEDiv.cbe.innerHtml(oElement.sSource); // oCBEDiv.cbe.innerHtml(eval("document.getElementById('" + oElement.sScrollId + "Source').cbe.innerHtml()") + ""); // alert(oCBEDiv.cbe.innerHtml()); // instead make each headline into a div sSourceText = eval("document.getElementById('" + oElement.sScrollId + "Source').cbe.innerHtml()") // alert(sSourceText); sSourceText = sSourceText.replace(/P>/g, "p>"); // alert(sSourceText); sSourceText = sSourceText.substr(0, sSourceText.lastIndexOf("

")); // alert(sSourceText); sSourceText = sSourceText.replace(/<\/p>/g, ""); aSourceText = sSourceText.split("

"); // alert(aSourceText.length); oCBEDiv.cbe.color("#ffffff"); oCBEDiv.cbe.background("#000000"); // moved down: oCBEDiv.cbe.clip(0, oElement.sScrollWidth, oElement.sScrollHeight, 0); oCBEDiv.cbe.moveTo(oElement.sXPos, oElement.sYPos); // oCBEDiv.cbe.show(); // addEventListener('dragResize'); // oCBEDiv.cbe.zIndex(0); // alert("oCBEDiv.cbe.zIndex() = " + oCBEDiv.cbe.zIndex()); // implement mouseover and out with eventlisteners instead // oCBEDiv.onMouseOver = "alert('mouse'); skyScroll_toggleScrolling('" + oElement.sScrollId + "');" // oCBEDiv.onMouseOut = "skyScroll_toggleScrolling('" + oElement.sScrollId + "');" oCBEDiv.cbe.addEventListener('mouseover', skyScroll_toggleScrolling); oCBEDiv.cbe.addEventListener('mouseout', skyScroll_toggleScrolling); for (sNumHeadline = 0; sNumHeadline < aSourceText.length; sNumHeadline ++) { oHeadline = document.cbe.createElement("DIV"); if (oHeadline) { oHeadline.id = oElement.sScrollId + "headline" + sNumHeadline; // alert("oHeadline.id = " + oHeadline.id); oCBEDiv.cbe.appendChild(oHeadline); oHeadline.cbe.color('#ffffff'); oHeadline.cbe.background('#000000'); // height is a trick - how much text/height? oHeadline.cbe.resizeTo(oElement.sScrollWidth, 10); if (sNumHeadline == 0) { oHeadline.cbe.moveTo(0, 0); } else { oHeadline.cbe.moveTo(0, oPrevHeadline.cbe.top() + oPrevHeadline.cbe.height() + 15); } oHeadline.cbe.show(); // addEventListener('dragResize'); sSkyEndId = "skyEnd" + oElement.sScrollId + "headline" + sNumHeadline; // alert("sSkyEndId = " + sSkyEndId) // alert("aSourceText[sNumHeadline] = " + aSourceText[sNumHeadline]) // was: oHeadline.cbe.innerHtml(aSourceText[sNumHeadline] + "

"); oHeadline.cbe.innerHtml(aSourceText[sNumHeadline]); // oFoot = document.getElementById(sSkyEndId).cbe; // oFoot = eval(sSkyEndId); // was: resizeTo(oElement.sScrollWidth, 40); // alert("oHeadline.id = " + oHeadline.id + "\noFoot.id = " + oFoot.id + "\noHeadline.cbe.top() = " + oHeadline.cbe.top() + "\noFoot.offsetTop = " + oFoot.offsetTop + "\noFoot.offsetTop - oHeadline.cbe.top() = " + (oFoot.offsetTop - oHeadline.cbe.top())); // oHeadline.cbe.resizeTo(oElement.sScrollWidth, oFoot.offsetTop); // alert("oFoot.offsetTop = " + oFoot.offsetTop + "\noHeadline.cbe.ele.scrollHeight = " + oHeadline.cbe.ele.scrollHeight); // alert("oHeadline.cbe.ele.scrollHeight = " + oHeadline.cbe.ele.scrollHeight); // oTagHeadline = eval(oHeadline.id); oCBEHeadline = document.getElementById(oHeadline.id); // alert("oTagHeadline.offsetHeight = " + oTagHeadline.offsetHeight); if (is.nav4) { sHeadlineScrollHeight = oHeadline.ele.document.height; } else { sHeadlineScrollHeight = oHeadline.cbe.ele.scrollHeight; } oHeadline.cbe.resizeTo(oElement.sScrollWidth, sHeadlineScrollHeight); // alert(oHeadline.cbe.height()); // oHeadlineTag = eval(oElement.sScrollId + "headline" + sNumHeadline) // oHeadlineTag.onMouseOver = "alert('mouse'); skyScroll_toggleScrolling('" + oElement.sScrollId + "');" // oHeadlineTag.onMouseOut = "skyScroll_toggleScrolling('" + oElement.sScrollId + "');" oPrevHeadline = oHeadline; } } oCBEDiv.cbe.resizeTo(oElement.sScrollWidth, 1000); oCBEDiv.cbe.clip(0, oElement.sScrollWidth, oElement.sScrollHeight, 0); break; } } } function windowOnload() { var sNavIndex, sScrollIndex, sNumCBE; // initialize the portal skyPortal_portalInit(); // initialize nav panels for (sNavIndex = 0; sNavIndex < sNavInitLength; sNavIndex++) { skyNav_navInit(aNavInitObj[sNavIndex], aNavInitNp[sNavIndex]); } // initialize scrolls for (sScrollIndex = 0; sScrollIndex < sScrollInitLength; sScrollIndex++) { // alert(sScrollIndex); if (aScrollInit[sScrollIndex].sInherits != "") { skyDyn_createElement(aScrollInit[sScrollIndex]); } skyScroll_scrollInit(aScrollInit[sScrollIndex].sName, aScrollInit[sScrollIndex].sScrollX, aScrollInit[sScrollIndex].sScrollY, aScrollInit[sScrollIndex].sScrollXDelta, aScrollInit[sScrollIndex].sScrollYDelta, aScrollInit[sScrollIndex].sScrollWidth, aScrollInit[sScrollIndex].sScrollHeight, aScrollInit[sScrollIndex].sXPos, aScrollInit[sScrollIndex].sYPos, aScrollInit[sScrollIndex].sScrolling, aScrollInit[sScrollIndex].sInherits, aScrollInit[sScrollIndex].sVisibilityDefault); } // alert("sOnLoadCommand = " + sOnLoadCommand); if (sOnLoadCommand != "") { eval(sOnLoadCommand); } // alert("sOnLoadCommand eval complete"); if (is.nav4) { // alert(sSkyFooterId); // if (sSkyFooterId == "") { // alert("does"); // } } // alert(sSkyFooterId); // auto-positioning deprecated // let the user manage it, at least until top property is reliably read if (0) { // cycle through all cbe objects, get the bottom of the bottommost sSkyFooterTop = 0; for (sNumCBE = 0; sNumCBE < cbeAll.length; sNumCBE++) { // alert('id: ' + cbeAll[sNumCBE].id + ' height: ' + cbeAll[sNumCBE].height()); if ((cbeAll[sNumCBE].id != 'idWindow') && (cbeAll[sNumCBE].id != 'idDocument') && (cbeAll[sNumCBE].id.indexOf('skyFooter') == -1)) { // alert('id: ' + cbeAll[sNumCBE].id + ' height: ' + cbeAll[sNumCBE].height()); alert('id: ' + cbeAll[sNumCBE].id + ' top: ' + cbeAll[sNumCBE].top() + ' height: ' + cbeAll[sNumCBE].height()); sElementBottom = cbeAll[sNumCBE].top() + cbeAll[sNumCBE].height(); alert("sElementBottom: " + sElementBottom); if (sElementBottom > sSkyFooterTop) { sSkyFooterTop = sElementBottom; } } } // alert("sSkyFooterTop: " + sSkyFooterTop); // cycle through all cbe objects, find any skyFooter for (sNumCBE = 0; sNumCBE < cbeAll.length; sNumCBE++) { // alert("ele id = " + cbeAll[sNumCBE].id); if (cbeAll[sNumCBE].id.indexOf("skyFooter") >= 0) { sSkyFooterID = cbeAll[sNumCBE].id; // alert("sSkyFooterID = " + sSkyFooterID); oSkyFooter = cbeAll[sNumCBE]; oSkyFooter.ele.style.position = 'absolute'; oSkyFooter.moveTo(0, sSkyFooterTop); // alert("sSkyFooterID = " + sSkyFooterID); } // alert("sSkyFooterID = " + sSkyFooterID); } // alert("sSkyFooterID = " + sSkyFooterId); } // alert("sFooterOnLoadCommand = " + sFooterOnLoadCommand); if (sFooterOnLoadCommand != "") { eval(sFooterOnLoadCommand); } } // convert an object name into a valid object reference function getObject(obj) { var theString = typeof obj; // alert("In getObject, obj = " + obj + "\n typeof obj = " + typeof(obj).toString() + "\n indexOf = " + theString.indexOf("object")); // alert("In getObject, Nav = " + Nav + "\n Moz = " + Moz + "\n IE = " + IE); var theObj; if (theString.indexOf("object") > -1) { theObj = obj; } else { if ((Nav == 4) || (IE > 0)) { theObj = eval("document." + coll + obj + styleObj); } else if ((Nav >= 5) || (Moz > 0)) { theObj = document.getElementById(obj); } } // alert("theObj = " + theObj); return theObj; } // frame/window height function getWindowHeight() { if ((Nav >= 4) || (Moz >= 5)) { return window.innerHeight; } else { return document.body.clientHeight; } } // frame/window width function getWindowWidth() { if ((Nav >= 4) || (Moz >= 5)) { return window.innerWidth; } else { return document.body.clientWidth; } } // Upper case converter - usage onChange="convertToUpper(this)" in INPUT TEXT function convertToUpper(field) { field.value = field.value.toUpperCase(); } // position an object function placeIt() { var obj = eval("document." + coll + "face" + styleObj); if ((Nav >= 4) || (Moz >= 5)) { obj.moveTo(25,15); } else { obj.pixelLeft = 25; obj.pixelTop = 15; } } // position an object at a specific pixel coordinate function shiftTo(obj,x,y) { // alert("obj = " + obj + " x = " + x + " y = " + y); var theObj = getObject(obj); if (Nav == 4) { theObj.moveTo(x,y); } else if (IE > 0) { theObj.pixelLeft = x; theObj.pixelTop = y; } else if ((Nav >= 5) || (Moz > 0)) { theObj.style.left = x + "px"; theObj.style.top = y + "px"; } } // move an object by specific pixel distances function shiftBy(obj,x,y) { var theObj = getObject(obj); if (Nav == 4) { theObj.moveBy(x,y); } else if (IE > 0) { theObj.pixelLeft += x; theObj.pixelTop += y; } else if ((Nav >= 5) || (Moz > 0)) { x = parseInt(theObj.style.left) + x; y = parseInt(theObj.style.top) + y; theObj.style.left = x + "px"; theObj.style.top = y + "px"; } } // set Z order of object function setZIndex(obj, newZIndex) { var theObj = getObject(obj); theObj.zIndex = newZIndex; } // set visibility of object to show/visible function showObj(obj) { var theObj = getObject(obj); if (Nav == 4) { theObj.visibility = "show"; } else if (IE > 0) { theObj.visibility = "visible"; } else if ((Nav >= 5) || (Moz > 0)) { theObj.style.visibility = "visible"; } } // set visibility of object to hide/hidden function hideObj(obj) { var theObj = getObject(obj); if (Nav == 4) { theObj.visibility = "hide"; } else if (IE > 0) { theObj.visibility = "hidden"; } else if ((Nav >= 5) || (Moz > 0)) { theObj.style.visibility = "hidden"; } } // toggle visibility of object function toggleObj(obj) { var theObj = getObject(obj); if ((theObj.visibility == "show") || (theObj.visibility == "visible")) { hideObj(theObj); } else { showObj(theObj); } } // set background color of an object function setBGColor(obj,color) { var theObj = getObject(obj); if ((Nav >= 4) || (Moz >= 5)) { theObj.bgColor = color; } else { theObj.backgroundColor = color; } } // get x position of object // perhaps we should strip off the "px" suffix in this function function getObjectLeft(obj) { var theObj = getObject(obj); if (Nav == 4) { return theObj.left; } else if (IE > 0) { return theObj.pixelLeft; } else if ((Nav >= 5) || (Moz > 0)) { return parseInt(theObj.style.left); } } // get y position of object function getObjectTop(obj) { var theObj = getObject(obj); if (Nav == 4) { return theObj.top; } else if (IE > 0) { return theObj.pixelTop; } else if ((Nav >= 5) || (Moz > 0)) { return parseInt(theObj.style.top); } } // object height // modify for NS4, NS6, Moz, IE cases? function getObjHeight(obj) { // alert("in getObjHeight, isNav = " + isNav); var theObj = getObject(obj); if ((Nav >= 4) || (Moz >= 5)) { return parseInt(theObj.clip.height); } else { return parseInt(theObj.clientHeight); } } // object width // modify for NS4, NS6, Moz, IE cases? function getObjWidth(obj) { var theObj = getObject(obj); if ((Nav >= 4) || (Moz >= 5)) { return theObj.clip.width; } else { return theObj.clientWidth; } } // Navigator 4 resize handler, server vars set in dbinc.html function handleResize() { // document.location.reload() // removed: mGetQueryString('nothing') // document.location.href = "..?"; return false; } var Nav = 0; var IE = 0; var Moz = 0; var coll = ""; var styleObj = ""; // Browser identification // alert("In Browser ID, appVersion = " + parseInt(navigator.appVersion) + " appName = " + navigator.appName); // Mozilla seems to be mistakenly identified as Netscape 5 for some reason if (parseInt(navigator.appVersion) >=4) { if ((navigator.appName == "Mozilla") || (navigator.appName == "Netscape")) { if (navigator.appName == "Netscape") { Nav = parseInt(navigator.appVersion); } else { Moz = parseInt(navigator.appVersion); } } else { if (navigator.appName.indexOf("Microsoft") != -1) { IE = parseInt(navigator.appVersion); coll = "all."; styleObj = ".style"; } } } // trap for Netscape window RESIZE and MOUSEDOWN // also interested in capturing space bar to advance slides in skyPoint if (0 == 1) { if ((Nav >= 4) || (Moz >= 5)) { window.captureEvents(Event.RESIZE | Event.CLICK); document.captureEvents(Event.RESIZE | Event.CLICK); // document.onclick = ""; // window.onresize = handleResize; } } // --------------------------- // begin skyNav section - necessary for nav panel operation var isID; isID = false; if ((is.ie5up) || (is.nav5up) || (is.gecko)) { isID = true; } function skyNav_aNav() { this.o = ""; this.sNumMenus = ""; this.aMenuID = new Array(); this.aSubMenuPanelXAlign = new Array(); this.aSubMenuPanelYAlign = new Array(); this.aNumSubMenus = new Array(); } function skyNav_navInit(oNav, npnoName) { var i, sSubMenuXPos, sSubMenuYPos, npno; var o, sNumMenu; o = oNav.o; if (0 == 1) { // diagnostics var index, cbeList; cbeList = ""; for (index = 0; index < cbeAll.length; index++) { cbeList += cbeAll[index].id + "\n" } // alert(cbeAll.length); // alert(cbeList); for (var i = 0; i < cbeAll.length; i++) { if ( cbeAll[i].id == npnoName ) { // return cbeAll[i].ele; // alert(cbeAll[i].ele.cbe); } } } o.sNumMenus = oNav.sNumMenus; o.sInitialMenuPanelYAdjust = parseInt(o.sMenuPanelYAdjust); o.sInitialMenuPanelXAdjust = parseInt(o.sMenuPanelXAdjust); for (sNumMenu = 0; sNumMenu < oNav.sNumMenus; sNumMenu++) { o.aMenu[sNumMenu] = document.getElementById("divno" + oNav.aMenuID[sNumMenu]).cbe; // alert(o.aMenu[sNumMenu]); if (is.nav4) { // o.aMenu[sNumMenu].sizeTo(o.aMenu[sNumMenu].width(), o.aMenu[sNumMenu].height() + 20); // o.aMenu[sNumMenu].clip(0,o.aMenu[sNumMenu].width(),o.aMenu[sNumMenu].height() + 20,0); // o.aMenu[sNumMenu].moveTo(o.sMenuPanelXAdjust, o.sMenuPanelYAdjust - 9); o.aMenu[sNumMenu].sizeTo(o.aMenu[sNumMenu].width(), o.aMenu[sNumMenu].height()); o.aMenu[sNumMenu].clip(5, o.aMenu[sNumMenu].width(), o.aMenu[sNumMenu].height() - 5, 0); o.aMenu[sNumMenu].moveTo(o.sMenuPanelXAdjust, o.sMenuPanelYAdjust - 5); } else if ((is.nav5up) && (is.gecko)) { // was: o.aMenu[sNumMenu].sizeTo(o.aMenu[sNumMenu].width() - 10, o.aMenu[sNumMenu].height() - 8); o.aMenu[sNumMenu].sizeTo(o.aMenu[sNumMenu].width() - 10, o.aMenu[sNumMenu].height()); o.aMenu[sNumMenu].clip(0, o.aMenu[sNumMenu].width() + 10, o.aMenu[sNumMenu].height() + 8, 0); o.aMenu[sNumMenu].moveTo(o.sMenuPanelXAdjust, o.sMenuPanelYAdjust); } else { o.aMenu[sNumMenu].moveTo(o.sMenuPanelXAdjust, o.sMenuPanelYAdjust); // experimental line - clip not being read in IE6 - try setting clip o.aMenu[sNumMenu].clip(0, o.aMenu[sNumMenu].width(), o.aMenu[sNumMenu].height(), 0); } // alert(o.aMenu[sNumMenu].id); o.aMenu[sNumMenu].show(); o.aSubMenu[sNumMenu] = document.getElementById("npno" + oNav.aMenuID[sNumMenu]).cbe; o.aSubMenu[sNumMenu].zIndex(1); sSubMenuXPos = o.aSubMenuPanelXAdjust[sNumMenu] - 0 + o.aMenu[sNumMenu].left(); switch (oNav.aSubMenuPanelXAlign[sNumMenu]) { case "ll": // sSubMenuXPos += o.aMenu[sNumMenu].left() - 0; break; case "lr": sSubMenuXPos += - o.aSubMenu[sNumMenu].width() - 0; break; case "mm": sSubMenuXPos += (o.aMenu[sNumMenu].width()/2) - (o.aSubMenu[sNumMenu].width()/2) - 0; break; case "rl": sSubMenuXPos += o.aMenu[sNumMenu].width() - 0; break; case "rr": sSubMenuXPos += o.aMenu[sNumMenu].width() - o.aSubMenu[sNumMenu].width() - 0; break; } // aSubMenuPanelXAlign[sNumMenu] sSubMenuYPos = o.aSubMenuPanelYAdjust[sNumMenu] - 0 + o.aMenu[sNumMenu].top(); switch (oNav.aSubMenuPanelYAlign[sNumMenu]) { case "tt": // sSubMenuYPos += o.aMenu[sNumMenu].clipTop() - 0; break; case "tb": sSubMenuYPos += - o.aSubMenu[sNumMenu].height() - 0; break; case "mm": sSubMenuYPos += (o.aMenu[sNumMenu].height()/2) - (o.aSubMenu[sNumMenu].height()/2) - 0; break; case "bt": sSubMenuYPos += o.aMenu[sNumMenu].height() - 0; break; case "bb": sSubMenuYPos += o.aMenu[sNumMenu].height() - o.aSubMenu[sNumMenu].height() - 0; break; } if (is.nav4) { /* o.aSubMenu[sNumMenu].sizeTo(o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height()); o.aSubMenu[sNumMenu].clip(0, o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height(), 0); o.aSubMenu[sNumMenu].moveTo(sSubMenuXPos, sSubMenuYPos); */ o.aSubMenu[sNumMenu].sizeTo(o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height() + 7); o.aSubMenu[sNumMenu].clip(7, o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height() - 7, 0); o.aSubMenu[sNumMenu].moveTo(sSubMenuXPos, sSubMenuYPos - 8); } else if ((is.nav5up) && (is.gecko)) { // o.aSubMenu[sNumMenu].sizeTo(o.aSubMenu[sNumMenu].width() - 10, o.aSubMenu[sNumMenu].height() - 8); // o.aSubMenu[sNumMenu].clip(0, o.aSubMenu[sNumMenu].width() + 10, o.aSubMenu[sNumMenu].height() + 8, 0); // was: o.aSubMenu[sNumMenu].sizeTo(o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height() - 8); o.aSubMenu[sNumMenu].sizeTo(o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height()); o.aSubMenu[sNumMenu].clip(0, o.aSubMenu[sNumMenu].width(), o.aSubMenu[sNumMenu].height() + 8, 0); o.aSubMenu[sNumMenu].moveTo(sSubMenuXPos, sSubMenuYPos - 4); } else { o.aSubMenu[sNumMenu].moveTo(sSubMenuXPos, sSubMenuYPos); } o.aSubMenu[sNumMenu].menuLabel = o.aMenu[sNumMenu]; /* o.sMenuPanelXAdjust += o.aMenu[i].width(); alert(o.sMenuPanelYAdjust); alert(o.aMenu[sNumMenu]); alert(o.aMenu[sNumMenu].width()); alert(o.aMenu[sNumMenu].height()); alert(o.aMenu[sNumMenu].clipTop()); alert(o.aMenu[sNumMenu].clipBottom()); */ if (o.sMenuTemplate == "h") { // horizontal orientation o.sMenuPanelXAdjust += o.aMenu[sNumMenu].width() - 0; if (sNumMenu == oNav.sNumMenus - 1) { o.sMenuPanelYAdjust = o.aMenu[sNumMenu].height() - 0 } } else { // vertical orientation o.sMenuPanelYAdjust += o.aMenu[sNumMenu].height() - 0; } } // sNumMenu npno = document.getElementById(npnoName).cbe; // was: npno.sizeTo(o.aMenu[sNumMenu - 1].width() + 2*o.sMenuPanelXAdjust, parseInt(o.sMenuPanelYAdjust) + 1); if (o.sMenuTemplate == "h") { // horizontal orientation npno.sizeTo(parseInt(o.sMenuPanelXAdjust) + 2*o.sInitialMenuPanelXAdjust, o.aMenu[sNumMenu - 1].height() + 2*o.sInitialMenuPanelYAdjust); npno.clip(0, parseInt(o.sMenuPanelXAdjust) + 2*o.sInitialMenuPanelXAdjust, o.aMenu[sNumMenu - 1].height() + 2*o.sInitialMenuPanelYAdjust, 0); } else { // vertical orientation npno.sizeTo(o.aMenu[sNumMenu - 1].width() + 2*o.sMenuPanelXAdjust, parseInt(o.sMenuPanelYAdjust) + 2*o.sInitialMenuPanelYAdjust); // experiment with clip to fix border alignment - seems to work npno.clip(0, o.aMenu[sNumMenu - 1].width() + 2*o.sMenuPanelXAdjust, parseInt(o.sMenuPanelYAdjust) + 2*o.sInitialMenuPanelYAdjust, 0); } // experiment: npno.moveTo(o.sInitialMenuPanelXAdjust, o.sInitialMenuPanelYAdjust); npno.moveTo(0, 0); npno.show(); for (sNumMenu = 0; sNumMenu < oNav.sNumMenus; sNumMenu++) { o.numSubMenus[sNumMenu] = oNav.aNumSubMenus[sNumMenu] } // alert("o.numSubMenus = " + o.numSubMenus[1]); } function skyNav_subMenuTimedOut(o) { // remove event listeners // alert("removing"); // o.aMenu[o.openedMenu].removeEventListener("mousemove", o.extendTimeout(), true); // o.aSubMenu[o.openedMenu].removeEventListener("mousemove", o.extendTimeout(), true); // alert("removed"); // hide submenu o.aSubMenu[o.openedMenu].hide(); } function skyNav_menuShow(o, npnoName, e, menuIndex) { var oNpno; oNpno = document.getElementById(npnoName).cbe; if ((o.openedMenu != menuIndex) && o.menuOpen) { skyNav_raiseMenus(o, oNpno, o.openedMenu); } // alert("o.openedMenu = " + o.openedMenu); // if (o.openedMenu != 0) { // disable the submenu hide timeout clearTimeout(o.selectedSubMenuTimeout); o.selectedSubMenuTimeout = 0; // remove event listeners // hide the submenu skyNav_subMenuTimedOut(o); // } o.openedMenu = menuIndex; if (o.numSubMenus[o.openedMenu] != 0) { // show the submenu o.aSubMenu[o.openedMenu].show(); // lower menus if necessary if (o.aSubMenuLowerMenus[o.openedMenu] == "1") { if (!o.menuOpen) { // if the submenu overlaps the main menus // o.openedMenu can be in only one serial space, the outer level - this is an error if (!((o.aMenu[o.openedMenu].left() >= (o.aSubMenu[o.openedMenu].left() + o.aSubMenu[o.openedMenu].width() - 0)) || ((o.aMenu[o.openedMenu].left() + o.aMenu[o.openedMenu].width() - 0) <= o.aSubMenu[o.openedMenu].left()))) { // move the main menus out from under skyNav_lowerMenus(o, oNpno, o.openedMenu); } } } else { // submenu is floating, rather than displacing // add event listeners, but only if the timeout is not set if (o.selectedSubMenuTimeout == 0) { // alert("adding"); // o.aMenu[o.openedMenu].addEventListener("mousemove", o.extendTimeout(), true); // o.aSubMenu[o.openedMenu].addEventListener("mousemove", o.extendTimeout(), true); // alert("added"); // start the timeout to hide it at five seconds // this timeout is only extended by mousemove over menu item or submenu o.extendTimeout(1); } } } } function skyNav_menuHighlight(o, e, menuID) { var oNP; if (o.activeMenuID == o.selectedMenuID) { skyNav_changeColor(o.activeMenuID, o.selectedColor, o.selectedBGColor); } else { if ((o.activeMenuID != menuID) && (o.activeMenuID != 0)) { skyNav_changeColor(o.activeMenuID, o.normalColor, o.normalBGColor); } } o.activeMenuID = menuID; skyNav_changeColor(o.activeMenuID, o.highlightColor, o.highlightBGColor); // was: oDiv = document.getElementById("divno" + o.activeMenuID).cbe; // but div doesn't notice when mouse goes out - must be whole panel oNP = document.getElementById(o.sDivId).cbe; oNP.addEventListener("mousemove", o.menuNormal, false); // if (content) { if (0) { oContent = document.getElementById("content").contentWindow; oContent.addEventListener("mousemove", o.menuNormal, false); } } function skyNav_menuHide(o, npno, e) { o.aSubMenu[o.openedMenu].hide(); if (o.aSubMenuLowerMenus[o.openedMenu] == "1") { if (o.menuOpen) { // if the submenu overlaps the main menus if (!((o.aMenu[o.openedMenu].left() >= (o.aSubMenu[o.openedMenu].left() + o.aSubMenu[o.openedMenu].width() - 0)) || ((o.aMenu[o.openedMenu].left() + o.aMenu[o.openedMenu].width() - 0) <= o.aSubMenu[o.openedMenu].left()))) { // move the main menus back up skyNav_raiseMenus(o, npno, o.openedMenu); } } } } function skyNav_lowerMenus(o, oNpno, activeMenu) { var sIndex; // was: o.sMenuPanelYAdjust = o.aMenu[activeMenu].top() + o.aMenu[activeMenu].height() + o.aSubMenu[activeMenu].height(); if (o.sMenuTemplate == "h") { // horizontal orientation o.sMenuPanelXAdjust = o.aMenu[activeMenu].left() + o.aMenu[activeMenu].width() + o.aSubMenuPanelXAdjust[activeMenu] + o.aSubMenu[activeMenu].width() + o.aSubMenuBottomMargin[activeMenu]; // alert(o.sMenuPanelXAdjust); o.sMenuPanelYAdjust = o.aMenu[activeMenu].top(); } else { // vertical orientation o.sMenuPanelXAdjust = o.aMenu[activeMenu].left(); o.sMenuPanelYAdjust = o.aMenu[activeMenu].top() + o.aMenu[activeMenu].height() + o.aSubMenuPanelYAdjust[activeMenu] + o.aSubMenu[activeMenu].height() + o.aSubMenuBottomMargin[activeMenu]; // alert(o.sMenuPanelYAdjust); if ((is.nav5up) && (is.gecko)) { // o.sMenuPanelYAdjust += 6; } } // alert("lowerMenus, o.sMenuPanelXAdjust = " + o.sMenuPanelXAdjust + " o.sMenuPanelYAdjust = " + o.sMenuPanelYAdjust + " " + o.aMenu[activeMenu].top() + " " + o.aMenu[activeMenu].height() + " " + o.aSubMenu[activeMenu].height()); for (sIndex = activeMenu + 1; sIndex < o.menuCount; ++sIndex) { // alert("o.aMenu[sIndex] = " + o.aMenu[sIndex]); o.aMenu[sIndex].moveTo(o.sMenuPanelXAdjust, o.sMenuPanelYAdjust); // o.aMenu[sIndex].show(); // was: o.sMenuPanelYAdjust += o.aMenu[activeMenu].height(); // alert("o.aMenu[activeMenu]" + o.aMenu[activeMenu]); if (o.sMenuTemplate == "h") { // horizontal orientation o.sMenuPanelXAdjust += o.aMenu[activeMenu].width() - 0; } else { // vertical orientation o.sMenuPanelYAdjust += o.aMenu[activeMenu].height() - 0; } } if (o.sMenuTemplate == "h") { // horizontal orientation oNpno.sizeTo(parseInt(o.sMenuPanelXAdjust) + o.sInitialMenuPanelXAdjust, oNpno.height()); oNpno.clip(0, parseInt(o.sMenuPanelXAdjust) + o.sInitialMenuPanelXAdjust, oNpno.height(), 0); } else { // vertical orientation oNpno.sizeTo(oNpno.width(), parseInt(o.sMenuPanelYAdjust) + o.sInitialMenuPanelYAdjust); oNpno.clip(0, oNpno.width(), parseInt(o.sMenuPanelYAdjust) + o.sInitialMenuPanelYAdjust, 0); } o.menuOpen = true; // alert(o.menuOpen); } function skyNav_raiseMenus(o, oNpno, activeMenu) { var sIndex; if (o.sMenuTemplate == "h") { // horizontal orientation o.sMenuPanelXAdjust = o.aMenu[activeMenu].left() + o.aMenu[activeMenu].width(); o.sMenuPanelYAdjust = o.aMenu[activeMenu].top(); } else { // vertical orientation o.sMenuPanelXAdjust = o.aMenu[activeMenu].left(); o.sMenuPanelYAdjust = o.aMenu[activeMenu].top() + o.aMenu[activeMenu].height(); // alert("raiseMenus, o.sMenuPanelXAdjust = " + o.sMenuPanelXAdjust + " o.sMenuPanelYAdjust = " + o.sMenuPanelYAdjust); } for (sIndex = activeMenu + 1; sIndex < o.menuCount; ++sIndex) { o.aMenu[sIndex].moveTo(o.sMenuPanelXAdjust, o.sMenuPanelYAdjust); // o.aMenu[sIndex].show(); if (o.sMenuTemplate == "h") { // horizontal orientation o.sMenuPanelXAdjust += o.aMenu[activeMenu].width(); } else { // vertical orientation o.sMenuPanelYAdjust += o.aMenu[activeMenu].height(); } } if (o.sMenuTemplate == "h") { // horizontal orientation oNpno.sizeTo(parseInt(o.sMenuPanelXAdjust) + o.sInitialMenuPanelXAdjust, oNpno.height()); oNpno.clip(0, parseInt(o.sMenuPanelXAdjust) + o.sInitialMenuPanelXAdjust, oNpno.height(), 0); } else { // vertical orientation oNpno.sizeTo(oNpno.width(), parseInt(o.sMenuPanelYAdjust) + o.sInitialMenuPanelYAdjust); oNpno.clip(0, oNpno.width(), parseInt(o.sMenuPanelYAdjust) + o.sInitialMenuPanelYAdjust, 0); } o.menuOpen = false; } function skyNav_changeBGColors(o, whichColor) { if (0 == 1) { o.menuLabelRule.style.background = whichColor; o.menuBoxRule.style.background = whichColor; o.leftNavRule.style.background = whichColor; } } function skyNav_changeLabelColor(menuID, whichColor) { if (menuID != 0) { if (is.nav4) { } else if (is.ie4) { eval("document.all.ano" + menuID + ".style.color = '" + whichColor + "';"); } else if ((is.ie5up) || (is.nav5up) || (is.gecko)) { document.getElementById("ano" + menuID).style.color = whichColor; } } } function skyNav_changeSubLabelColor(o, whichColor) { if (o.selectedSubMenuID != 0) { if (is.nav4) { } else if (is.ie4) { eval("document.all.ano" + o.selectedSubMenuID + ".style.color = '" + whichColor + "';"); } else if ((is.ie5up) || (is.nav5up) || (is.gecko)) { document.getElementById("ano" + o.selectedSubMenuID).style.color = whichColor; } } } function skyNav_changeBGColor(menuID, whichColor) { if (menuID != 0) { if (is.nav4) { } else if (is.ie4) { eval("document.all.divno" + menuID + ".style.background = '" + whichColor + "';"); } else if ((is.ie5up) || (is.nav5up) || (is.gecko)) { // was: o.aSubMenu[menuLabelNum].menuLabel.background(whichColor); document.getElementById("divno" + menuID).cbe.background(whichColor); } } } function skyNav_changeColor(menuID, whichColor, whichBGColor) { skyNav_changeLabelColor(menuID, whichColor); skyNav_changeBGColor(menuID, whichBGColor); } function skyNav_selectOption(o, menuID) { skyNav_changeColor(o.selectedMenuID, o.normalColor, o.normalBGColor); for (sIndex = 0; sIndex < o.menuCount; ++sIndex) { if ("divno" + menuID == o.aMenuId[sIndex]) { sNumMenu = sIndex; } } // removed color assignment to retain css behavior // until full individual divs at sub and beyond // skyNav_changeSubLabelColor(o, o.aSubMenuNormalColor[sNumMenu]); o.selectedMenuID = menuID; skyNav_changeColor(o.selectedMenuID, o.selectedColor, o.selectedBGColor); o.selectedSubMenuID = 0; } function skyNav_selectSubOption(o, menuID, subMenuID) { skyNav_selectOption(o, menuID); o.selectedSubMenuID = subMenuID; for (sIndex = 0; sIndex < o.menuCount; ++sIndex) { if ("divno" + menuID == o.aMenuId[sIndex]) { sNumMenu = sIndex; } } // removed color assignment to retain css behavior // until full individual divs at sub and beyond // skyNav_changeSubLabelColor(o, o.aSubMenuSelectedColor[sNumMenu]); } function skyNav_sendClick(linkId) { // can't identify links in nav4 if (linkId != "") { if (is.nav4) { } else if (is.ie4) { eval("document.all." + linkId + ".click();"); } else if ((is.ie5up) || (is.nav5up) || (is.gecko)) { document.getElementById(linkId).click(); } } } function skyNav_mNavLink(sMenuID, sContext, sTarget, sLink) { // alert("sLink = " + sLink); // alert("sTarget = " + sTarget); if (sLink != "NoHrefAssigned.html") { if ((sContext == "frames") || (sContext == "")) { switch (sTarget) { case "_top": eval("top.location.href = '" + sLink + "';"); break; case "_blank": setTimeout("window.open('" + sLink + "', '" + sMenuID + "', 'resizable,scrollbars,height=425,width=600,left=133,top=225', true);", 100); break; default: eval("parent." + sTarget + ".location.href = '" + sLink + "';"); break; } } else { // dhtml skyPortal_loadURL(sTarget, sLink); } } } // End skyNav functions **************************************************** // Begin skyScroll functions *********************************************** function skyScroll_aScroll() { this.sInherits = ""; this.sScrollId = ""; this.sSource = ""; this.sName = ""; this.sScrolling = ""; this.sScrollX = ""; this.sScrollY = ""; this.sScrollXDelta = ""; this.sScrollYDelta = ""; this.sScrollWidth = ""; this.sScrollHeight = ""; this.sXPos = ""; this.sYPos = ""; this.sVisibilityDefault = ""; } function skyScroll_scrollInit(sOName, sScrollX, sScrollY, sScrollXDelta, sScrollYDelta, sScrollWidth, sScrollHeight, sXPos, sYPos, sScrolling, sInherits, sVisibilityDefault) { var o; o = document.getElementById(sOName).cbe; o.sInherits = sInherits; o.sXPos = sXPos; o.sYPos = sYPos; o.sScrollWidth = sScrollWidth; o.sScrollHeight = sScrollHeight; o.sVisibilityDefault = sVisibilityDefault; // alert("o.sScrolling = " + o.sScrolling); // o.sizeTo(o.sScrollWidth, 600); o.sOriginalTop = o.top(); // alert("o.sTextHeight = " + o.sTextHeight); // o.sizeTo(o.sScrollWidth, o.sScrollHeight); o.clip(0, o.sScrollWidth, o.sScrollHeight, 0); o.moveTo(o.sXPos, o.sYPos); if (o.sVisibilityDefault != "0") { o.show(); } o.sScrollX = sScrollX; o.sScrollY = sScrollY; o.sScrolling = sScrolling; o.sScrollXDelta = sScrollXDelta; o.sScrollYDelta = sScrollYDelta; setTimeout("skyScroll_scrollUp('" + sOName + "')", 1000); } function skyScroll_toggleScrolling(sParam) { var o, sOId, e; o = document.getElementById(sParam).cbe; if (o == null) { e = sParam; o = e.cbeCurrentTarget; } // alert("o.id = " + o.id); if (o.sScrolling == "0") { o.sScrolling = "1" } else { o.sScrolling = "0" } } function skyScroll_scrollUp(sOName) { var o, sIntervalID; var sXDelta, sYDelta; var oChild, sTail; o = document.getElementById(sOName).cbe; // alert("o = " + o); if (o.sScrolling == "0") { sXDelta = 0; sYDelta = 0; } else { sXDelta = o.sScrollXDelta sYDelta = o.sScrollYDelta } o.sScrollX = o.sScrollX + sXDelta; o.sScrollY = o.sScrollY + sYDelta; if (o.sInherits == "") { // the old functions for moving the whole div o.clip(0 + o.sScrollY, o.sScrollWidth, o.sScrollHeight + o.sScrollY, 0); // was: o.moveBy(-o.sScrollXDelta, -o.sScrollYDelta); // alert("o.top() = " + o.top()); o.moveBy(-sXDelta, -sYDelta); if (is.nav4) { // alert(o.sOriginalTop); // alert(o.top() + o.height() - o.sScrollHeight); } if ((o.top() + o.height() - o.sScrollHeight) <= o.sOriginalTop) { // alert(" o = " + o); o.moveTo(o.sXPos, o.sYPos); o.sScrollX = 0; o.sScrollY = 0; o.clip(0 + o.sScrollY, o.sScrollWidth, o.sScrollHeight + o.sScrollY, 0); } } else { // move all children up by Delta oChild = o.firstChild; sTail = 0; while (oChild != null) { // move this child // alert("oChild = " + oChild); // alert("oChild.id = " + oChild.id); oChild.moveBy(-sXDelta, -sYDelta); // get the position of the tail if (oChild.top() + oChild.height() > sTail) { sTail = oChild.top() + oChild.height(); } // select next child oChild = oChild.nextSibling; } // loop through again - if one is higher than the top of the parent, move it to the tail oChild = o.firstChild; // alert(sTail); while (oChild != null) { if (oChild.top() + oChild.height() < 0) { // move this child to the tail oChild.moveTo(0, sTail + 15); } // select next child oChild = oChild.nextSibling; } } sIntervalID = setTimeout("skyScroll_scrollUp('" + sOName + "')", 600); } // End skyScroll functions ************************************************** // Begin skyPortal functions ************************************************ function skyPortal_aPortalElement() { this.sPEId = ""; this.sPELeft = ""; this.sPETop = ""; this.sPEWidth = ""; this.sPEHeight = ""; this.sPEType = ""; this.sPEURL = ""; } function skyPortal_portalInit() { /* old contents notes contents1.zIndex(0); initialize contents layer loadURL('contents1', 'inlineframe1', '/bobtest.html'); initialize all portal elements using these arrays, which should be generated in portal.html: aPortalElementID aPortalElementLeft aPortalElementTop aPortalElementWidth aPortalElementHeight aPortalElementType aPortalElementURL but this should really be a hash, like so: with (aPortalElement[sNumPortalElement]) { sPEId sPELeft sPETop sPEWidth sPEHeight sPEType sPEURL } */ var oPE, oIF; var sThisWidth, sThisHeight; for (var sNumPortalElement = 0; sNumPortalElement < sPortalElementInitLength; sNumPortalElement++) { oPE = eval("document.getElementById(\"pe" + aPortalElementInit[sNumPortalElement].sPEId + "\").cbe"); oPE.moveTo(aPortalElementInit[sNumPortalElement].sPELeft, aPortalElementInit[sNumPortalElement].sPETop); if ((aPortalElementInit[sNumPortalElement].sPEWidth == "100%") || (aPortalElementInit[sNumPortalElement].sPEHeight)) { if (aPortalElementInit[sNumPortalElement].sPEWidth == "100%") { sThisWidth = document.cbe.width(); } else { sThisWidth = aPortalElementInit[sNumPortalElement].sPEWidth; } if (aPortalElementInit[sNumPortalElement].sPEHeight == "100%") { sThisHeight = document.cbe.height(); } else { sThisHeight = aPortalElementInit[sNumPortalElement].sPEHeight; } oPE.sizeTo(sThisWidth, sThisHeight); // oPE.clip(0, document.body.cbe.width() + 200, aPortalElementInit[sNumPortalElement].sPEHeight, 0); } else { oPE.sizeTo(aPortalElementInit[sNumPortalElement].sPEWidth, aPortalElementInit[sNumPortalElement].sPEHeight); oPE.clip(0, aPortalElementInit[sNumPortalElement].sPEWidth, aPortalElementInit[sNumPortalElement].sPEHeight, 0); } oPE.show(); if (aPortalElementInit[sNumPortalElement].sPEType == "Content") { // was: skyPortal_loadURL("pe" + aPortalElementInit[sNumPortalElement].sPEId, "inlineframe" + aPortalElementInit[sNumPortalElement].sPEId, aPortalElementInit[sNumPortalElement].sPEURL); // to avoid the delay of one load waiting for the previous one to finish, try a setTimeout, to push past each call setTimeout("skyPortal_loadURL(\"" + aPortalElementInit[sNumPortalElement].sPEId + "\", \"" + aPortalElementInit[sNumPortalElement].sPEURL + "\");", 5); } } // alert("test"); // end sNumPortalElement loop } function skyPortal_loadURL(sId, sNewURL) { var o, oC; var sWidth, sHeight; sContainerId = "pe" + sId; sObjectId = "if" + sId; if (sId == "BackChannel") { // alert("sObjectId = " + sObjectId); // alert("sNewURL = " + sNewURL); } // alert(sObjectId); // alert(sNewURL); if (sNewURL != "NoHrefAssigned.html") { if (is.ie4) { eval("document.getElementById('" + sContainerId + "').document.all." + sObjectId + ".src = sNewURL;"); } else if ((is.ie5up) || (is.gecko)) { // alert(sContainerId); // was: document.getElementById(sContainerId).document.getElementById(sObjectId).src = sNewURL; if (sId == "BackChannel") { // alert("document.getElementById(sObjectId) = " + document.getElementById(sObjectId)); } o = document.getElementById(sObjectId); // alert(sObjectId); // alert(o); if (o == null) { // the lone frame/iframe case // try for a plain frame reference // alert(eval("typeof " + sId)); sObjectType = eval("typeof " + sId); // alert(sObjectType); // if (eval(sId)) { if (eval("typeof " + sId) != "undefined") { if (eval(sId + ".location")) { eval(sId + ".location.href = '" + sNewURL + "'"); } } else { // alert("sId = " + sId); o = document.getElementById(sId); // alert("o = " + o); if (o != null) { // alert("o.location = " + o.location); if (o.location) { // single frame o.location.href = sNewURL; } else { // iframe o.src = sNewURL; } } } } else { o.src = sNewURL; // was: oC = document.getElementById(sContainerId) oC = o.parentNode; // alert(oC); // alert(o); // alert(o.width); // alert(oC.cbe.width()); // alert(oC.cbe.height()); o.width = oC.cbe.width(); o.height = oC.cbe.height(); oC.cbe.clip(0, oC.cbe.width(), oC.cbe.height(), 0); // alert(o.width); } } else if (is.nav4) { // this was still in // oC = document.getElementById(sContainerId).cbe; // header = document.getElementById("header").cbe; // nav1 = document.getElementById("nav1").cbe; // layer1 = document.getElementById("layer1").cbe; // oC.show(); // oC.background("#FF0000"); // this was still in - how does the contents frame find its place? // oC.clip(0, getWindowWidth() - nav1.width(), getWindowHeight() - header.height(), 0); // alert(oC.layer1.name); // alert(oC.document.layer1.name); // alert("header.id = " + header.id); // alert("layer1.id = " + layer1.id); // layer1.background("#0000FF"); // layer1.clip(0, getWindowWidth() - nav1.width(), getWindowHeight() - header.height(), 0); // alert("document.layer1 = " + document.layer1); // alert("window.document.layer1 = " + window.document.layer1); // alert("document.layer2.id = " + document.layer2.id) // was: eval("document." + sContainerId + ".src = sNewURL;"); eval("document." + sContainerId + ".src = " + sNewURL + ";"); // oC.innerHtml(inlinelayer1.document.body); // oC.innerHtml("override is now in the box with more contents than just initial"); // oC.innerHtml(""); // // alert('after'); } } } // End skyPortal functions ************************************************** // Begin skyManager functions *********************************************** function skyManager_aFoundation() { this.sId = "foundation"; // this.oMenuModule = ""; // this.oOptionWelcome = ""; // this.oOptionUsers = ""; } function skyManager_aManagerElement(sId, sSelected, sVisibility, sLeft, sTop, sWidth, sHeight, sInherits, sFontSize, sFontFamily, sFontWeight, sBorder, sBorderWidth, sColor, sBGColor, sBorderColor, sHighlightColor, sHighlightBGColor, sHighlightBorderColor, sSelectedColor, sSelectedBGColor, sSelectedBorderColor, sAlign, sVAlign, sContent, sURL, mOnMouseOver, mOnMouseOut, mOnClick, mOnDblClick) { this.sId = sId; this.sSelected = sSelected; this.sVisibility = sVisibility; this.sLeft = sLeft; this.sTop = sTop; this.sWidth = sWidth; this.sHeight = sHeight; this.sInherits = sInherits; this.sFontSize = sFontSize; this.sFontFamily = sFontFamily; this.sFontWeight = sFontWeight; this.sBorder = sBorder; this.sBorderWidth = sBorderWidth; this.sColor = sColor; this.sBGColor = sBGColor; this.sBorderColor = sBorderColor; this.sHighlightColor = sHighlightColor; this.sHighlightBGColor = sHighlightBGColor; this.sHighlightBorderColor = sHighlightBorderColor; this.sSelectedColor = sSelectedColor; this.sSelectedBGColor = sSelectedBGColor; this.sSelectedBorderColor = sSelectedBorderColor; this.sAlign = sAlign; this.sVAlign = sVAlign; this.sContent = sContent; this.sURL = sURL; this.mOnMouseOver = mOnMouseOver; this.mOnMouseOut = mOnMouseOut; this.mOnClick = mOnClick; this.mOnDblClick = mOnDblClick; this.oCBE = ""; this.sCurrentColor = ""; this.sCurrentBGColor = ""; this.sCurrentBorderColor = ""; } function skyManager_mUnlightObject(sParam) { var o, e; if (typeof sParam == "object") { e = sParam; o = e.cbeTarget; } else { // alert(sParam); o = document.getElementById(sParam).cbe; } if (o.oSkyElement.sSelected == "0") { o.color(o.oSkyElement.sColor); o.background(o.oSkyElement.sBGColor); o.ele.style.borderColor = o.oSkyElement.sBorderColor; } else { o.color(o.oSkyElement.sSelectedColor); o.background(o.oSkyElement.sSelectedBGColor); o.ele.style.borderColor = o.oSkyElement.sSelectedBorderColor; } } function skyManager_mHighlightObject(sParam) { var o, e; if (typeof sParam == "object") { e = sParam; o = e.cbeTarget; } else { o = document.getElementById(sParam).cbe; } o.color(o.oSkyElement.sHighlightColor); o.background(o.oSkyElement.sHighlightBGColor); o.ele.style.borderColor = o.oSkyElement.sHighlightBorderColor; } function skyManager_mSelectObject(sObjectID) { var o; o = document.getElementById(sObjectID).cbe; o.oSkyElement.sSelected = "1"; skyManager_mUnlightObject(sObjectID); } function skyManager_mDeselectObject(sObjectID) { var o; o = document.getElementById(sObjectID).cbe; o.oSkyElement.sSelected = "0"; skyManager_mUnlightObject(sObjectID); } function skyManager_mLoadURL(sId, sNewURL) { var o, oC; var sWidth, sHeight; sContainerId = sId; sObjectId = "if" + sId; if (sNewURL != "NoHrefAssigned.html") { if (is.ie4) { eval("document.getElementById('" + sContainerId + "').document.all." + sObjectId + ".src = sNewURL;"); } else if ((is.ie5up) || (is.gecko)) { o = document.getElementById(sObjectId); o.src = sNewURL; oC = o.parentNode; o.width = oC.cbe.width(); o.height = oC.cbe.height(); oC.cbe.clip(0, oC.cbe.width(), oC.cbe.height(), 0); } else if (is.nav4) { eval("document." + sContainerId + ".src = sNewURL;"); } } } // End skyManager functions *************************************************