OB_Top=0;									//position from top (px)
OB_Left=0;									//position from left (px)
OB_Margin=10;								//top and bottom margins between icons and borders
OB_Width=132;								//bar width
OB_Height=document.body.offsetHeight;		//bar height
if (OB_Height<150)
	OB_Height=150;
OB_SlideSpeed=2.6;							//speed during slide movement
OB_BackgroundColor="#e7e7e7";				//background color of the bar
OB_ItemsSpacing=18;							//space between two items (icons and text)
OB_BorderWidth=0;							//border width
OB_BorderStyle="ridge";						//border style
OB_BorderColor='gold';    				//border color
OB_IconsWidth=26;							//icons width
OB_IconsHeight=26;							//icons height
OB_ButtonFontFamily="±¼¸²Ã¼";				//font family of button characters
OB_ButtonFontSize=9;						//font size    "         "       "  
OB_ButtonWidth=132;
OB_ButtonFontColor="black";					//font color   "         "       "     
OB_ButtonHeight=23;							//button height
OB_ButtonColor='#DFDFDF';
OB_LabelFontFamily="±¼¸²Ã¼";					//font family of text labels
OB_LabelFontSize=9;							//font size    "   "   "   "
OB_LabelFontColor="black";					//font color   "   "   "   "
OB_LabelMargin=3;							//margin between labels and icons
OB_UpArrow="images/arrowup.gif";			//arrow for slide up	
OB_DownArrow="images/arrowdown.gif";		//arrow for slide up
OB_ArrowWidth=16;							//arrow width
OB_ArrowHeight=16;							//arrow height
OB_ArrowSlideSpeed=8;						//speed for items scrolling

/*
OB_Top=0;									//position from top (px)
OB_Left=0;									//position from left (px)
//OB_TOPbg=24;								//top background full height
OB_TOPbg=0;								//top background full height
OB_Margin=10;								//top and bottom margins between icons and borders
OB_Width=132;								//bar width
//OB_Height=document.body.offsetHeight-100;		//bar height
OB_Height=document.body.offsetHeight;		//bar height
if (OB_Height<200)
	OB_Height=200;
OB_SlideSpeed=3;							//speed during slide movement
OB_BackgroundColor="#f7f7f7";				//background color of the bar
OB_ItemsSpacing=0;							//space between two items (icons and text)
OB_BorderWidth=0;							//border width
OB_BorderStyle="ridge";						//border style
OB_BorderColor='gold';    					//border color
OB_IconsWidth=24;							//icons width
OB_IconsHeight=24;							//icons height
OB_ButtonFontFamily="±¼¸²Ã¼";				//font family of button characters
OB_ButtonFontSize=9;						//font size    "         "       "  
OB_ButtonWidth=132;
OB_ButtonFontColor="black";					//font color   "         "       "     
OB_ButtonHeight=23;							//button height
OB_ButtonColor='#DFDFDF';
OB_LabelFontFamily="±¼¸²Ã¼";					//font family of text labels
OB_LabelFontSize=9;							//font size    "   "   "   "
OB_LabelFontColor="black";					//font color   "   "   "   "
OB_LabelMargin=3;							//margin between labels and icons
OB_UpArrow="images/arrowup.gif";			//arrow for slide up	
OB_DownArrow="images/arrowdown.gif";		//arrow for slide up
OB_ArrowWidth=16;							//arrow width
OB_ArrowHeight=16;							//arrow height
OB_ArrowSlideSpeed=8;						//speed for items scrolling
*/

resizingcnt=0;
var ver = navigator.appVersion;
ver = ver.substring(22,25);

function menuresize(){
	if(ver == 5.5 || ver > 5.5){
		resizingcnt=0;
	}
	if (resizingcnt==0){
		resizingcnt=1;
		if (document.body.offsetHeight>150){
			mslcnt=OutlookLikeBar.upcount;
			//OB_Height=document.body.offsetHeight-100;
			OB_Height=document.body.offsetHeight;
			
			//if (OB_Height<200)
			//	OB_Height = document.body.offsetHeight-20;
			//document.all["OutlookLikeBarBottom"].style.top=OB_Height;
			document.all["OutlookLikeBar"].style.height = OB_Height;
			document.all["OutlookLikeBar"].style.clip = "rect(0 "+OB_Width+" "+OB_Height+" 0)";

			j=1;
			while(eval("window.OutBarFolder"+j))
				j++;
			i=j-1;
			while(i>0){
				Folder=eval("OutBarFolder"+i)
				if(i==1){
					document.all["OB_Button1"].style.top = 0;
					document.all["OB_Folder1"].style.top = OB_ButtonHeight;
				}	
				else{
					if (document.all["OB_Button"+i].position=="UP"){
						document.all["OB_Button"+i].style.top = (i-1)*OB_ButtonHeight;
						document.all["OB_Folder"+i].style.top =(i)*OB_ButtonHeight+OB_LabelMargin;
					}
					else{
						document.all["OB_Button"+i].style.top = (OB_Height-(j-i)*OB_ButtonHeight-OB_BorderWidth*2);
						document.all["OB_Folder"+i].style.top = (OB_Height-(j-i)*OB_ButtonHeight-OB_BorderWidth*2)+OB_ButtonHeight;
					}
				}		
				i--;
			}
			document.all["OB_Folder"+OutlookLikeBar.currentFolder].style.clip = "rect(0 0 0 0)";
			OutlookLikeBar.visibleAreaHeight=OB_Height-2*OB_BorderWidth-(j-1)*OB_ButtonHeight;			

		    filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
	
			step=Math.floor(OutlookLikeBar.slideStep);
	
			var clipString=document.all["OB_Folder"+OutlookLikeBar.currentFolder].style.clip;
			var clip=clipString.match(filter);
	//	OutlookLikeBar.ClipFolder(OutlookLikeBar.currentFolder,parseInt(clip[1]),OutlookLikeBar.visibleAreaWidth,(parseInt(clip[3])-step),0);
			OutlookLikeBar.ClipFolder(OutlookLikeBar.currentFolder,parseInt(clip[1]),OutlookLikeBar.visibleAreaWidth,OutlookLikeBar.visibleAreaHeight,0);
			ResSetArrows();			
			OutlookLikeBar.upcount = 0;
		}
	}
	else
		resizingcnt=0;
}

function ResSetArrows()
{
	document.all["OB_SlideDown"].style.pixelTop=document.all["OB_Button"+OutlookLikeBar.currentFolder].style.pixelTop+document.all["OB_Button"+OutlookLikeBar.currentFolder].style.pixelHeight+OB_ButtonHeight+30;
	document.all["OB_SlideDown"].style.pixelLeft=OutlookLikeBar.width-document.all["OB_SlideUp"].width-OutlookLikeBar.borderWidth-10;
	document.all["OB_SlideUp"].style.pixelTop=document.all["OB_Button"+OutlookLikeBar.currentFolder].style.pixelTop+document.all["OB_Button"+OutlookLikeBar.currentFolder].style.pixelHeight+OutlookLikeBar.visibleAreaHeight-document.all["OB_SlideDown"].height+15;
	document.all["OB_SlideUp"].style.pixelLeft=OutlookLikeBar.width-document.all["OB_SlideDown"].width-OutlookLikeBar.borderWidth-10;

	var folder=document.all["OB_Folder"+OutlookLikeBar.currentFolder].style;
	var startTop=document.all["OB_Button"+OutlookLikeBar.currentFolder].style.pixelTop+document.all["OB_Button"+OutlookLikeBar.currentFolder].style.pixelHeight+OB_Margin;

	if(folder.pixelTop<startTop)
		document.all["OB_SlideDown"].style.visibility="visible";
	else		
		document.all["OB_SlideDown"].style.visibility="hidden";

	if(folder.pixelHeight-(startTop-folder.pixelTop)-10>OutlookLikeBar.visibleAreaHeight)
		document.all["OB_SlideUp"].style.visibility="visible";
	else		
		document.all["OB_SlideUp"].style.visibility="hidden";
}

function ResSlideItems(up){
	OutlookLikeBar.sliding=true;
	OutlookLikeBar.slideCount=Math.floor(OutlookLikeBar.slideArrowValue/OutlookLikeBar.ArrowSlideSpeed);
	up ? ResSlideItemsAction(-OutlookLikeBar.ArrowSlideSpeed) : ResSlideItemsAction(OutlookLikeBar.ArrowSlideSpeed);
	up ? OutlookLikeBar.upcount++ : OutlookLikeBar.upcount--;
}

function ResSlideItemsAction(value){
	document.all["OB_Folder"+OutlookLikeBar.currentFolder].style.pixelTop+=value;
  filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
  var clipString=document.all["OB_Folder"+OutlookLikeBar.currentFolder].style.clip;
  var clip=clipString.match(filter);
  OutlookLikeBar.ClipFolder(OutlookLikeBar.currentFolder,(parseInt(clip[1])-value),parseInt(clip[2]),(parseInt(clip[3])-value),parseInt(clip[4]));
	OutlookLikeBar.slideCount--;
	if(OutlookLikeBar.slideCount>0)
		setTimeout("ResSlideItemsAction("+value+")",20);
	else
	{
		if(Math.abs(value)*OutlookLikeBar.ArrowSlideSpeed!=OutlookLikeBar.slideArrowValue)		
		{
			document.all["OB_Folder"+OutlookLikeBar.currentFolder].style.pixelTop+=(value/Math.abs(value)*(OutlookLikeBar.slideArrowValue%OutlookLikeBar.ArrowSlideSpeed));
		    filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
			var clipString=document.all["OB_Folder"+OutlookLikeBar.currentFolder].style.clip;
			var clip=clipString.match(filter);
	    OutlookLikeBar.ClipFolder(OutlookLikeBar.currentFolder,(parseInt(clip[1])-(value/Math.abs(value)*(OutlookLikeBar.slideArrowValue%OutlookLikeBar.ArrowSlideSpeed))),parseInt(clip[2]),(parseInt(clip[3])-(value/Math.abs(value)*(OutlookLikeBar.slideArrowValue%OutlookLikeBar.ArrowSlideSpeed))),parseInt(clip[4]));
		}		    
		ResSetArrows();
		OutlookLikeBar.sliding=false;
	}		
}

function MakeItemRefresh(Folder,zorder,top){
//	var items=0;
//	while(Folder[items+1])
//		items+=4;
//	items/=4;
	document.all["OB_Folder"+zorder].style.top = top;
//	document.all["OB_Folder"+zorder].style.clip = "auto"; //"rect(0 0 0 0)";
}
