
var TopCapaM=135;
var LeftCapaM=0;

var LeftMenuM="0"
var TopMenuM="99"
var WidthMenuM="150"
var HeighMenM="367"
var HeightMenuM="367"

var inicioscrollM=134;
var TopScroollM=361;
var TopScrooll1M=394;
var inicioizquierdaM=inicioscrollM;
var inicioderechaM=inicioscrollM;

//Updated: Added left and top variables.
sLeftM= LeftMenuM //The left placement of the menu
sTopM=String(parseInt(TopMenuM)) //The top placement of the menu

//The height of the menu
sMenuheightM=HeightMenuM

//Width of the arrows
sArrowwidthM=0

//Scroll speed: (in milliseconds, change this one and the next variable to change the speed)
sScrollspeedM=45

//Pixels to scroll per timeout.
sScrollPxM=10


//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	//added
	this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1
	this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1
	this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0; 
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac)
	return this
}
bw=new checkBrowser()

/**************************************************************************
Variables to set.
***************************************************************************/

/**************************************************************************
Scrolling functions
***************************************************************************/
var timM=0
var noScrollM=true
function mLeftM(){
		if(!noScrollM && oMenuM.x<sArrowwidthM){
		oMenuM.moveBy(sScrollPxM,0)
		timM=setTimeout("mLeftM()",sScrollspeedM)
	}
}

function mUpM(){
		if(!noScrollM && oMenuM.y<sArrowwidthM){
		oMenuM.moveBy(0,sScrollPxM)
		timM=setTimeout("mUpM()",sScrollspeedM)
	}
}

function mDowM(){
	var pp=parseInt(oMenuM.scrollWidth)
	pp-=parseInt(HeighMenM)
	if(pp<400)
		pp=400;
	if(!noScrollM && oMenuM.y>-pp){
		oMenuM.moveBy(0,-sScrollPxM)
		timM=setTimeout("mDowM()",sScrollspeedM)
	}
}

function noMoveM(){clearTimeout(timM); noScrollM=true}
/**************************************************************************
Object part
***************************************************************************/
function makeObj(obj,nest,menu){
	nest=(!nest) ? '':'document.'+nest+'.'										
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;		
	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;		
	//this.scrollWidth=bw.ns4?this.css.document.width:this.evnt.offsetWidth
	this.scrollWidth=bw.ns4?this.css.document.height:this.evnt.offsetHeight
	
	this.x=(bw.ns4 || bw.ns5)? this.css.left:this.css.pixelLeft;
	this.y=(bw.ns4 || bw.ns5)? this.css.top:this.css.pixelTop;		
	this.moveBy=b_moveBy; this.moveIt=b_moveIt;	this.showIt=b_showIt;this.clipTo=b_clipTo;
	return this
}
function b_moveBy(x,y){this.x=this.x+x; this.y=this.y+y; this.css.left=this.x; this.css.top=this.y}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
function b_clipTo(t,r,b,l){
	if(bw.ns4){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l
	}else this.css.clip="rect("+t+","+r+","+b+","+l+")";
}
function b_showIt(){this.css.visibility="visible"}
/**************************************************************************
Object part end
***************************************************************************/

/**************************************************************************
Init function. Set the placements of the objects here.
***************************************************************************/

function sideInitM()
{
		
	pageWidthM=WidthMenuM;
	oBgM=new makeObj('divBgM')
	oMenuM=new makeObj('divMenuM','divBgM',1)

	oArrowRightM=new makeObj('divArrowRightM')
	oArrowLeftM=new makeObj('divArrowLeftM')
	
	//Placement
	oBgM.moveIt(LeftCapaM,TopCapaM) //Main div, holds all the other divs.
	oMenuM.moveIt(sArrowwidthM,10)
	oArrowRightM.moveIt(inicioderechaM,TopScrooll1M)
	oArrowLeftM.moveIt(inicioizquierdaM,TopScroollM)
	//setting the width and the visible area of the links.
	if(bw.dom || bw.ie4){ oBgM.css.height=HeighMenM;oBgM.css.width=pageWidthM; oBgM.css.overflow="hidden" }
	oBgM.clipTo(0,pageWidthM,sMenuheightM,0)
	
}


