/***************************************
* *
* OUTLOOK-LIKE BAR *
* *
* Written by *
* Massimo Guccione *
* Multimedia Lab *
* Intersiel S.p.A. (W)1999 *
* *
* Important: to use this script don't *
* remove these comments *
* *
* *
* Version 1.0Beta Freeware (MSIE only) *
* *
* mail : m.guccione@telcal.it *
* obyone@antares.it *
* please report for bugs *
* *
* for both Netscape and MSIE version *
* contact me! (freeware of course) *
****************************************/
document.write("
");
var OutlookLikeBar=new OutBar(OB_Width,OB_Height,j-1,OB_ButtonHeight,OB_BorderWidth,OB_SlideSpeed,OB_IconsHeight+OB_LabelFontSize+OB_LabelMargin+OB_ItemsSpacing,OB_ArrowSlideSpeed);
window.status="Outlook-Like Bar successful created!";
document.all["OutlookLikeBar"].style.visibility="visible";
function MakeItems(Folder,zorder,top)
{
var items=0;
var folderWidth=(OB_Width-OB_BorderWidth*2);
while(Folder[items+1])
items+=4;
items/=4;
document.write("");
for(var i=1;i
");
document.write("");
document.write(" ");
document.write("");
document.write(Folder[i+1]);
document.write("
");
}
document.write("");
}
//***************************
//* Outlook-Like Bar Object *
//***************************
function OutBar(width,height,items,buttonHeight,borderWidth,slideSpeed,slideArrowValue,ArrowSlideSpeed)
{
this.currentFolder=1;
this.currentItem=null;
this.slideCount=0;
this.slideStep=1;
this.slideArrowValue=slideArrowValue;
this.slideSpeed=slideSpeed;
this.borderWidth=borderWidth;
this.width=width;
this.visibleAreaHeight=height-2*borderWidth-items*buttonHeight;
this.visibleAreaWidth=width;
this.FolderClicked=FolderClicked;
this.SlideFolders=SlideFolders;
this.ItemClicked=ItemClicked;
this.ItemSelected=ItemSelected;
this.OverItems=OverItems;
this.OutItems=OutItems;
this.OverArrow=OverArrow;
this.OutArrow=OutArrow;
this.ArrowClicked=ArrowClicked;
this.ArrowSelected=ArrowSelected;
this.ArrowSlideSpeed=ArrowSlideSpeed;
this.SlideItems=SlideItems;
this.SlideItemsAction=SlideItemsAction;
this.Start=Start;
this.ClipFolder=ClipFolder;
this.SetArrows=SetArrows;
this.HideArrows=HideArrows;
this.sliding=false;
this.items=items;
this.started=false;
this.Start();
}
function FolderClicked(folder)
{
if(this.sliding)
return;
if(folder==this.currentFolder)
return;
this.sliding=true;
this.slideCount=this.visibleAreaHeight;
this.slideStep=1;
this.countStep=0;
this.HideArrows();
this.SlideFolders(folder,document.all["OB_Button"+folder].position=="DOWN");
}
function SlideFolders(folder,down)
{
var step;
if(down)
{
this.slideCount-=Math.floor(this.slideStep);
if(this.slideCount<0)
this.slideStep+=this.slideCount;
step=Math.floor(this.slideStep);
for(var i=2;i<=folder;i++)
if(document.all["OB_Button"+i].position=="DOWN")
{
document.all["OB_Button"+i].style.pixelTop-=step;
document.all["OB_Folder"+i].style.pixelTop-=step;
}
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString=document.all["OB_Folder"+folder].style.clip;
var clip=clipString.match(filter);
this.ClipFolder(folder,parseInt(clip[1]),this.visibleAreaWidth,(parseInt(clip[3])+step),0);
var clipString=document.all["OB_Folder"+this.currentFolder].style.clip;
var clip=clipString.match(filter);
this.ClipFolder(this.currentFolder,parseInt(clip[1]),this.visibleAreaWidth,(parseInt(clip[3])-step),0);
this.slideStep*=this.slideSpeed;
if(this.slideCount>0)
setTimeout("OutlookLikeBar.SlideFolders("+folder+",true)",20);
else
{
for(var k=2;k<=folder;k++)
document.all["OB_Button"+k].position="UP";
this.currentFolder=folder;
this.SetArrows();
this.sliding=false;
}
}
else
{
this.slideCount-=Math.floor(this.slideStep);
if(this.slideCount<0)
this.slideStep+=this.slideCount;
step=Math.floor(this.slideStep);
for(var i=folder+1;i<=this.items;i++)
if(document.all["OB_Button"+i].position=="UP")
{
document.all["OB_Button"+i].style.pixelTop+=step;
document.all["OB_Folder"+i].style.pixelTop+=step;
}
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString=document.all["OB_Folder"+folder].style.clip;
var clip=clipString.match(filter);
this.ClipFolder(folder,parseInt(clip[1]),this.visibleAreaWidth,(parseInt(clip[3])+step),0);
var clipString=document.all["OB_Folder"+this.currentFolder].style.clip;
var clip=clipString.match(filter);
this.ClipFolder(this.currentFolder,parseInt(clip[1]),this.visibleAreaWidth,(parseInt(clip[3])-step),0);
this.slideStep*=this.slideSpeed;
if(this.slideCount>0)
setTimeout("OutlookLikeBar.SlideFolders("+folder+",false)",20);
else
{
for(var k=folder+1;k<=this.items;k++)
document.all["OB_Button"+k].position="DOWN";
this.currentFolder=folder;
this.SetArrows();
this.sliding=false;
}
}
}
function ItemClicked(item)
{
if(this.sliding)
return;
item.style.border="2 inset #ffffff";
}
function ItemSelected(item)
{
if(this.sliding)
return;
item.style.border="1 outset #ffffff";
if(item.link.indexOf("javascript")!=-1)
eval(item.link)
else
eval(item.targetFrame+".location='"+item.link+"'");
}
function OverItems(item)
{
if(this.sliding)
return;
item.style.border="1 outset #ffffff";
}
function OutItems(item)
{
if(this.sliding)
return;
item.style.border="0 none black";
}
function ArrowClicked(arrow)
{
if(this.sliding)
return;
arrow.style.border="1 inset #ffffff";
}
function ArrowSelected(arrow)
{
if(this.sliding)
return;
arrow.style.border="0 none black";
this.SlideItems(arrow.id=="OB_SlideUp");
}
function OverArrow(arrow)
{
if(this.sliding)
return;
arrow.style.border="1 outset #ffffff";
}
function OutArrow(arrow)
{
if(this.sliding)
return;
arrow.style.border="0 none black";
}
function ClipFolder(folder,top,right,bottom,left)
{
document.all["OB_Folder"+folder].style.clip=clip='rect('+top+' '+right+' '+bottom+' '+left+')';
}
function Start()
{
if(!this.started)
{
this.ClipFolder(1,0,this.visibleAreaWidth,this.visibleAreaHeight,0);
this.SetArrows();
}
}
function SetArrows()
{
document.all["OB_SlideUp"].style.pixelTop=document.all["OB_Button"+this.currentFolder].style.pixelTop+document.all["OB_Button"+this.currentFolder].style.pixelHeight+20;
document.all["OB_SlideUp"].style.pixelLeft=this.width-document.all["OB_SlideUp"].width-this.borderWidth-10;
document.all["OB_SlideDown"].style.pixelTop=document.all["OB_Button"+this.currentFolder].style.pixelTop+document.all["OB_Button"+this.currentFolder].style.pixelHeight+this.visibleAreaHeight-document.all["OB_SlideDown"].height-20;
document.all["OB_SlideDown"].style.pixelLeft=this.width-document.all["OB_SlideDown"].width-this.borderWidth-10;
var folder=document.all["OB_Folder"+this.currentFolder].style;
var startTop=document.all["OB_Button"+this.currentFolder].style.pixelTop+document.all["OB_Button"+this.currentFolder].style.pixelHeight;
if(folder.pixelTopthis.visibleAreaHeight)
document.all["OB_SlideUp"].style.visibility="visible";
else
document.all["OB_SlideUp"].style.visibility="hidden";
}
function HideArrows()
{
document.all["OB_SlideUp"].style.visibility="hidden";
document.all["OB_SlideDown"].style.visibility="hidden";
}
function SlideItems(up)
{
this.sliding=true;
this.slideCount=Math.floor(this.slideArrowValue/this.ArrowSlideSpeed);
up ? this.SlideItemsAction(-this.ArrowSlideSpeed) : this.SlideItemsAction(this.ArrowSlideSpeed);
}
function SlideItemsAction(value)
{
document.all["OB_Folder"+this.currentFolder].style.pixelTop+=value;
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString=document.all["OB_Folder"+this.currentFolder].style.clip;
var clip=clipString.match(filter);
this.ClipFolder(this.currentFolder,(parseInt(clip[1])-value),parseInt(clip[2]),(parseInt(clip[3])-value),parseInt(clip[4]));
this.slideCount--;
if(this.slideCount>0)
setTimeout("OutlookLikeBar.SlideItemsAction("+value+")",20);
else
{
if(Math.abs(value)*this.ArrowSlideSpeed!=this.slideArrowValue)
{
document.all["OB_Folder"+this.currentFolder].style.pixelTop+=(value/Math.abs(value)*(this.slideArrowValue%this.ArrowSlideSpeed));
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString=document.all["OB_Folder"+this.currentFolder].style.clip;
var clip=clipString.match(filter);
this.ClipFolder(this.currentFolder,(parseInt(clip[1])-(value/Math.abs(value)*(this.slideArrowValue%this.ArrowSlideSpeed))),parseInt(clip[2]),(parseInt(clip[3])-(value/Math.abs(value)*(this.slideArrowValue%this.ArrowSlideSpeed))),parseInt(clip[4]));
}
this.SetArrows();
this.sliding=false;
}
}