// --------------------------------------------------------------------------- // this script is copyright (c) 2001 by Michael Wallner! // http://www.wallner-software.com // mailto:dhtml@wallner-software.com // // you may use this script on web pages of your own // you must not remove this copyright note! // // This script featured on Dynamic Drive (http://www.dynamicdrive.com) // Visit http://www.dynamicdrive.com for full source to this script and more // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // Outlook like navigation bar version 1.2 // // supported browsers: IE4, IE5, NS4, NS6, MOZ, OP5 // needed script files: crossbrowser.js // // History: // 1.0: initial version // 1.1: no Reload in IE and NS6 // 1.2: no Reload in OP5 if width is not changed // --------------------------------------------------------------------------- //add one button to a panel //einen Button zu einem Panel hinzufügen //img: image name - Name der Bilddatei //label: button caption - Beschriftung des Buttons //action: javascript on MouseUp event - Javascript beim onMouseUp event function b_addButton(img, label, action) { this.img[this.img.length]=img; this.lbl[this.lbl.length]=label; this.act[this.act.length]=action; this.sta[this.sta.length]=0; return this } //reset all panel buttons (ns4, op5) //alle Panel Buttons zurücksetzten (ns4, op5) function b_clear() { var i for (i=0;i") l.write("") l.write(""); l.write(this.lbl[nr]+"

"); l.close(); this.sta[nr]=1; } function b_mOut_ns4(nr) { l=this.obj.layers[0].layers[nr].document; l.open(); l.write("
") l.write("") l.write(""); l.write(this.lbl[nr]+"

"); l.close(); this.sta[nr]=0; } function b_mDown_ns4(nr) { l=this.obj.layers[0].layers[nr].document; l.open(); l.write("
") l.write("") l.write(""); l.write(this.lbl[nr]+"

"); l.close(); this.sta[nr]=1; } //test if scroll buttons should be visible //teste ob Scroll-Buttons sichtbar sein sollen function b_testScroll_ns4() { var i var j var k i=this.obj.clip.bottom; j=this.obj.layers[0].clip.bottom; k=parseInt(this.obj.layers[0].top); if (k==38) this.obj.layers[2].visibility='hide'; else this.obj.layers[2].visibility='show'; if ((j+k)0) setTimeout(this.v+'.up('+nr+');',10); else this.testScroll(); } //scroll the panel content down //scrolle den Panel Inhalt nach Unten function b_down_ns4(nr) { this.ftop = this.ftop + 5; if (this.ftop>=38) { this.ftop=38; nr=0; } this.obj.layers[0].top=this.ftop; nr-- if (nr>0) setTimeout(this.v+'.down('+nr+');',10); else this.testScroll(); } //---------------------------------------------------------------------------- // Panel functions for Opera5 //---------------------------------------------------------------------------- //show one panelbutton layer and hide the others two //zeige einen Panel Button Layer und verstecke die anderen beiden function b_mOver_op5(nr) { var obj0=getObj(this.name+'_b'+nr+'0') var obj1=getObj(this.name+'_b'+nr+'1') var obj2=getObj(this.name+'_b'+nr+'2') this.clear(); obj1.style.visibility="VISIBLE"; obj0.style.visibility="HIDDEN"; obj2.style.visibility="HIDDEN"; this.sta[nr]=1; } function b_mOut_op5(nr) { var obj0=getObj(this.name+'_b'+nr+'0') var obj1=getObj(this.name+'_b'+nr+'1') var obj2=getObj(this.name+'_b'+nr+'2') obj2.style.visibility="visible"; obj0.style.visibility="hidden"; obj1.style.visibility="hidden"; this.sta[nr]=1; } function b_mDown_op5(nr) { var obj0=getObj(this.name+'_b'+nr+'0') var obj1=getObj(this.name+'_b'+nr+'1') var obj2=getObj(this.name+'_b'+nr+'2') obj0.style.visibility="visible"; obj1.style.visibility="hidden"; obj2.style.visibility="hidden"; this.sta[nr]=1; } // --------------------------------------------------------------------------- // Panel functions for ie4, ie5, ns5, op5 // --------------------------------------------------------------------------- //test if scroll buttons should be visible //teste ob Scroll-Buttons sichtbar sein sollen function b_testScroll() { if (bt.op5) { var i=parseInt(this.obj.style.pixelHeight); var j=parseInt(this.objf.style.pixelHeight); } else { var i=parseInt(this.obj.style.height); var j=parseInt(this.objf.style.height); } var k=parseInt(this.objf.style.top); if (k==38) this.objm1.style.visibility='hidden'; else this.objm1.style.visibility='visible'; if ((j+k)0) setTimeout(this.v+'.up('+nr+');',10); else this.testScroll(); } //scroll the panel content down //scrolle den Panel Inhalt nach Unten function b_down(nr) { this.ftop = this.ftop + 5; if (this.ftop>=38) { this.ftop=38; nr=0; } this.objf.style.top=this.ftop; nr-- if (nr>0) setTimeout(this.v+'.down('+nr+');',10); else this.testScroll(); } // --------------------------------------------------------------------------- // Panel object // --------------------------------------------------------------------------- //create one panel function createPanel(name,caption) { this.name=name; // panel layer ID this.ftop=38; // actual panel scroll position this.obj=null; // panel layer object this.objc=null; // caption layer object this.objf=null; // panel field layer object this.objm1=null; // scroll button up this.objm2=null; // scroll button down this.caption=caption; // panel caption this.img=new Array(); // button images this.lbl=new Array(); // button labels this.act=new Array(); // button actions this.sta=new Array(); // button status (internal) this.addButton=b_addButton; // add one button to panel this.clear=b_clear; // reset all buttons if (bt.ns4) { // functions for ns4 this.mOver=b_mOver_ns4; // handles mouseOver event this.mOut=b_mOut_ns4; // handles mouseOut & mouseUp event this.mDown=b_mDown_ns4; // handles mouseDown event this.testScroll=b_testScroll_ns4; // test if scroll buttons visible this.up=b_up_ns4; // scroll panel buttons up this.down=b_down_ns4; // scroll panel buttons down } if (bt.op5) { // functions for op5 this.mOver=b_mOver_op5; // handles mouseOver event this.mOut=b_mOut_op5; // handles mouseOut & mouseUp event this.mDown=b_mDown_op5; // handles mouseDown event } if (!bt.ns4) { // functions for all browsers but ns4 this.testScroll=b_testScroll; // test if scroll buttons should be visible this.up=b_up; // scroll panel buttons up this.down=b_down; // scroll panel buttons down } this.v = this.name + "var"; // global var of 'this' eval(this.v + "=this"); return this } //add one panel to the outlookbar function b_addPanel(panel) { panel.name=this.name+'_panel'+this.panels.length this.panels[this.panels.length] = panel; } //write style sheets //schreibe die Style sheets function b_writeStyle() { document.write(''); } // Draw the Outlook Bar function b_draw() { var i; var j; var t=0; var h; var c=0; this.writeStyle(); if (bt.ns5 || bt.op5) c=6; //two times border width if (bt.ns4) { //draw OutlookBar for ns4 //OutlookBar layer.. document.write(''); //one layer for every panel... for (i=0;i'); //one layer to host the panel buttons document.write(''); mtop=0 //one layer for every button for (j=0;j
'); document.write(""); document.write(""); document.write(this.panels[i].lbl[j]+"

"); document.write(''); mtop=mtop+this.buttonspace; } document.write(''); //one layer for the panels caption document.write(''); document.write(''); document.write(''+this.panels[i].caption); document.write(''); //two layers for scroll-up -down buttons document.write(''); document.write(''); document.write(''); } document.write(''); } else { //draw Outlook bar for all browsers but ns4 //OutlookBar layer.. document.write('
'); h=this.height-((this.panels.length-1)*28) //one layer for every panel... for (i=0;i') t=t+28; //one layer to host the panel buttons document.write('
') mtop=0 //one (ie4, ie5, ns5) or three layers (op5) for every button for (j=0;j'); document.write('
'+this.panels[i].lbl[j]+'
'); document.write(''); document.write('
'); document.write('
'+this.panels[i].lbl[j]+'
'); } else { document.write('
'); document.write('
'); document.write(this.panels[i].lbl[j]+'
'); } mtop=mtop+this.buttonspace; } document.write('
'); //one layer for the panels caption if not op5! if (!bt.op5) { document.write('') } //two layers for scroll-up -down buttons document.write(''); document.write(''); document.write('') } //Opera bug (Clip!) //op5 doesn't support layer clipping! so use top layers for panel caption //and two top layers with background-color like page color to hide //panel content outside of the outlookbar. //op5 unterstützt kein Clip bei Layers! darum erzeugen wir drei top level //layers für die Panel Überschrift und zwei top Layers mit der gleichen //Hintergrundfarbe wie die HTML Seite um den Panel Inhalt außerhalb des //Outlook Bars zu verdecken! if (bt.op5) { //one layers for panel captions if op5 for (i=0;i'); document.write(''+this.panels[i].caption); document.write('') } //two layers to hide 'nonvisible' part of panel //(op5 doesn't support clipping!) //document.write('
'); //document.write('
'); } document.write(''); } for (i=0;inr) { this.panels[i].obj.top=this.height-((l-i)*28)-1; } else { this.panels[i].obj.top=i*28; } } } // --------------------------------------------------------------------------- // outlookbar function for ie4, ie5, ns5, op5 // --------------------------------------------------------------------------- function b_showPanel(nr) { var i var l var o document.cookie=nr; this.aktPanel=nr; l = this.panels.length; for (i=0;inr) { this.panels[i].obj.style.top=this.height-((l-i)*28); //Opera doesn't support clip:rect()! //so hide non visible panels //and move panel caption if (bt.op5) { this.panels[i].objf.style.visibility='hidden'; this.panels[i].objc.style.top=this.height-((l-i)*28); } } else { this.panels[i].obj.style.top=i*28; //Opera doesn't support clip:rect()! //so show visible panel //and move panel caption if (bt.op5) { this.panels[i].objf.style.visibility='visible'; this.panels[i].objc.style.top=i*28; } } } } //resize the Outlook Like Bar //IE4/5 & NS6 -> resize all layers (width & height) //op5 -> resize only height - reload on width change //ns4 -> reload on any change! // //if you change the width of a layer (style="text-align:center;") then //the content will not be moved! function b_resize(x,y,width,height) { var o var i var j var h var c=(bt.ns5)?6:0; if (bt.ns4) location.reload(); else { if (bt.op5 && (width!=this.width)) if (location.href.indexOf('?')!=-1) location.href=location.href.replace(/\?./,"?"+this.aktPanel) else location.href= location.href+'?'+this.aktPanel; else { this.xpos=x; this.yPos=y; this.width=width this.height=height o=getObj(this.name); o.style.left=x; o.style.top=y; o.style.width=width; o.style.height=height; o.style.clip='rect(0px '+this.width+'px '+this.height+'px 0px)'; h=this.height-((this.panels.length-1)*28) for (i=0; i