function verifyCompatibleBrowser() {
	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; 
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
	return this 
} 
	
	
	
	function ConstructObject(obj,nest)
	{ 	//alert(obj)
		bw = new verifyCompatibleBrowser() 
		nest=(!nest) ? '':'document.'+nest+'.' 
		//alert(nest)
		this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
		this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
				
		this.scrollheight=bw.ns4?this.css.document.height:this.el.offsetHeight 
		//this.scrollwidth=bw.ns4?this.css.document.width:this.el.offsetWidth
		this.clipheight=bw.ns4?this.css.clip.height:this.el.offsetHeight
 		//this.clipwidth=bw.ns4?this.css.clip.width:this.el.offsetWidth
		
		this.up=MoveAreaUp;this.down=MoveAreaDown; 
		this.MoveArea=MoveArea; this.x; this.y;
		this.obj = obj + "Object" 
		eval(this.obj + "=this") 
		return this 
	} 
	
	function MoveArea(x,y)
	{	
		this.x=x;this.y=y 
		this.css.left=this.x 
		this.css.top=this.y 
	} 
	 
	function MoveAreaDown(move)
	{ 
		if(this.y>-this.scrollheight+objContainer.clipheight){ 
		this.MoveArea(0,this.y-move) 
		mueve_bola(move);
		if(loop) setTimeout(this.obj+".down("+move+")",speed) 
		} 
	} 
	
	function MoveAreaUp(move)
	{ 
		if(this.y<0){ 
		this.MoveArea(0,this.y-move) 
		mueve_bola(move);
		if(loop) setTimeout(this.obj+".up("+move+")",speed) 
		} 
	} 

var desplazamiento=false
	
	function DesplazaAreaIzq(objCon, med, oscroll, obarra, opivote)
	{ 

	var ind=med;
	var posleft=parseInt(eval(objCon+".css.left"));
	
		if(ind<=posleft){
		
			desplazamiento=true
			posleft-=3
			eval(objCon+".MoveArea("+posleft+",parseInt("+objCon+".css.top))")
			
			if (obarra!=null && opivote!=null) setTimeout("DesplazaAreaIzq('"+objCon+"', "+med+" , '"+ oscroll+"' , '"+ obarra+"' , '"+ opivote+"')",10)
			else setTimeout("DesplazaAreaIzq('"+objCon+"', "+med+" , null , null , null)",10)	
			
		}else
			{
			desplazamiento=false;
				  		
	  		if (bw.dom) obj= eval(objCon+'.el.parentElement')
	  		if (bw.ns5)  obj= eval(objCon+'.el.parentNode')
	  		if (bw.ns4) obj= eval(objCon+'.el.parentLayer')
	  		
	  		if (obarra!=null && opivote!=null) movescroll(obj, objCon, obarra, opivote)
			}
	
	} 
	
	function movescroll(objCon, oscroll, obarra, opivote)
	{
				
				//objCon.document.height=268
				var tamano=bw.ns4?objCon.document.height:objCon.style.height
				if(tamano==0) tamano=objCon.clip.height; 
				
				if (eval('parseInt('+oscroll+'.scrollheight)')>eval('parseInt(tamano)'))
				{
	  				eval(obarra+".css.visibility='visible'")
	  				eval(opivote+".css.visibility='visible'")
	  				if (document.layers){
						top.frames["contenido"].document.divDownControl.visibility='visible'
						top.frames["contenido"].document.divUpControl.visibility='visible'
					}else {
			
						if(typeof top.contenido!='undefined'){
							top.contenido.document.getElementById('divDownControl').style.visibility='visible'
							top.contenido.document.getElementById('divUpControl').style.visibility='visible'
						}else{
						
							document.getElementById('divDownControl').style.visibility='visible'
							document.getElementById('divUpControl').style.visibility='visible'
							}
						}		

	  			}else{
	  				eval(obarra+".css.visibility='hidden'")
	  				eval(opivote+".css.visibility='hidden'")
	  				}
	  			//}
	  		
	}
	
	
	function DesplazaAreaDch(objCon, med, oscroll, obarra, opivote)
	{ 
	
	var ind=med;
	var posleft=parseInt(eval(objCon+".css.left"));
	
		if(ind>=posleft){
			desplazamiento=true
			posleft+=3
			eval(objCon+".MoveArea("+posleft+",parseInt("+objCon+".css.top))")

			if (oscroll!=null && obarra!=null && opivote!=null) setTimeout("DesplazaAreaDch('"+objCon+"', "+med+" , '"+ oscroll+"' , '"+ obarra+"' , '"+ opivote+"')",10)
			else setTimeout("DesplazaAreaDch('"+objCon+"', "+med+" , null , null , null)",10)	
		}else
			{
	  		desplazamiento=false;	
	  		if (bw.dom) obj= eval(objCon+'.el.parentElement')
	  		if (bw.n5)  obj= eval(objCon+'.el.parentNode')
	  		if (bw.ns4) obj= eval(objCon+'.el.parentLayer')
	  		if (obarra!=null && opivote!=null) movescroll(obj, objCon, obarra, opivote)
	  		
			}

	} 
	
	
	function DesplazaAreaAbajo(objCon, med, oscroll, obarra, opivote)
	{ 
	
	var ind=med;
	var postop=parseInt(eval(objCon+".css.top"));
	
		if(ind>postop){
			postop+=5
			
			eval(objCon+".MoveArea(parseInt("+objCon+".css.left),"+postop+")")

	
			if (oscroll!=null && obarra!=null && opivote!=null) setTimeout("DesplazaAreaAbajo('"+objCon+"', "+med+" , '"+ oscroll+"' , '"+ obarra+"' , '"+ opivote+"')",10)
			else setTimeout("DesplazaAreaAbajo('"+objCon+"', "+med+" , null , null , null)",10)
		}else
			{
			if (oscroll!=null && obarra!=null && opivote!=null)
				{
				if (eval('parseInt('+oscroll+'.scrollheight)')>eval('parseInt('+objCon+'.clipheight)'))
	  				{
	  				eval(obarra+".css.visibility='visible'")
	  				eval(opivote+".css.visibility='visible'")
	  				divDownControl.style.visibility='visible'
	  				divUpControl.style.visibility='visible'
	  				}
	  			}
			}
	} 
	
	 
	//esta funcion mueve la bolita del scroll arriba y abajo 

	function mueve_bola(vel)
	{
		pivote.css.top=correccion_alto+parseInt(pivote.topInicial) + pivote.factor*objScroller.y;
	}
	 
	 
	function PerformScroll(speed)
	{
		if(initialised){
			loop=true; 
			if(speed>0) objScroller.down(speed) 
			else objScroller.up(speed) 
		} 
	} 
	 
	function CeaseScroll()
	{ 
		loop=false 
		if(timer) clearTimeout(timer) 
	} 
	
	
	// end absolutely positioned scrollable area object scripts
	
	function recalcularAltura(){
		objScroller.scrollheight=bw.ns4?objScroller.css.document.height:objScroller.el.offsetHeight;
		objContainer.clipheight=bw.ns4?objContainer.css.clip.height:objContainer.el.offsetHeight;		
		pivote.factor = alto_barra/(-objScroller.scrollheight+objContainer.clipheight);
	}
	
	function carga_ns4()
	  {
	  carga();
	  var cap=makeObj("bola")
	  cap.top=alto_pelota;
	  pivote.topInicial = barraFlech.css.top;
	  }
	function carga_no_ns4()
	  {
	  
	  carga();
	  var cap=makeObj("bola")
	  cap.top=alto_pelota;
//	  window.onresize();
	  }
	function carga()
	  {
		//if(bw.ns4||bw.ns5){recolocaclientes();}
		InitialiseScrollableArea();
	
	  }

	
var dcha=true;
var contador=0;

	function desplazamenu(objCon, medizq,meddch)
	{
		if (contador==4) 
		{
		contador=0
		return false;
		}
		var pos=parseInt(eval(objCon+".css.left"));
		if (medizq==pos) 
			{
			dcha=true 
			contador++
			}
		if (meddch==pos) 
			{
			dcha=false 
			contador++
			}
			
		if((medizq<pos)&&(dcha!=true)) var ind=medizq; 
		if((medizq>pos)&&(dcha==true)) var ind=meddch;
		if(ind<pos){ 
			pos-=5
		}else{
			pos+=5
		}

		eval(objCon+".MoveArea("+pos+",parseInt("+objCon+".css.top))")
		setTimeout("desplazamenu('"+objCon+"', "+medizq+", "+meddch+")",10)	
	}  
	
//var desaplazando=false
var ObjDefaut

function CompEvent(ObjMenu)
{
if (desplazamiento==false){
	if(typeof tempo!="undefined") clearTimeout(tempo);
	moverecuadro(ObjMenu);
		
}
else {

	tempo=setTimeout('CompEvent("'+ObjMenu+'")',10)
	status='eo'
}
}

function moverecuadro(ObjMenu)
{	
	//objcuadromenu.css.visibility='visible'
	
	if (document.layers) 
	{
		var medtop=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".left)")
	}
	else{var medtop=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.left)")}
	
	if(parseInt(objcuadromenu.css.left)<medtop) DesplazaAreaDch('objcuadromenu',medtop-5);
	else DesplazaAreaIzq('objcuadromenu',medtop);
	
		if (document.layers){
		
			if (bw.ns4){
//			for(i in objcuadromenu.css.document) alert(i)
		
				objcuadromenu.css.document.width=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".document.width)+10");
				objcuadromenu.css.document.height=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".document.height)");
//			alert(objcuadromenu.css.document.width)
			}else{
				objcuadromenu.css.width=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".width)+10");
				objcuadromenu.css.height=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".height)");
			}	
		}else{
		objcuadromenu.css.width=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.width)+10")
		objcuadromenu.css.height=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.height)")
	}
		
}

function recuadro(ObjMenu)
{
objcuadromenu.css.visibility='visible'
ObjDefaut=ObjMenu

if (document.layers) 
	{
	if (bw.ns4){
		objcuadromenu.css.top=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".document.top)");
		objcuadromenu.css.left=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".document.left)-2");
		objcuadromenu.css.width=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".document.width)+10");
		objcuadromenu.css.height=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".document.height)");
		}else{
		objcuadromenu.css.top=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".top)");
		objcuadromenu.css.left=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".left)-2");
		objcuadromenu.css.width=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".width)+10");
		objcuadromenu.css.height=eval("parseInt(top.frames['contenido'].document."+ObjMenu+".height)");
		}
	}else{
	objcuadromenu.css.top=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.top)")
	objcuadromenu.css.left=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.left)-2")
	objcuadromenu.css.width=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.width)+10")
	objcuadromenu.css.height=eval("parseInt(top.contenido.document.getElementById('"+ObjMenu+"').style.height)")
	}



}