var loop, timer 
var initialised; 


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 
	} 


bw=new verifyCompatibleBrowser() 
 
function ConstructObject(obj,nest,speed){ 
		//obj : <div contenedor>
		//nest: <div contenido>
		//speed: velocidad
        nest=((!nest)||(nest==null)) ? '':'document.'+nest+'.' 
        this.speed=((!speed)||(speed==null)) ? 0:speed;
        this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
    	this.css=bw.dom? this.el.style:bw.ie4? this.el.style:bw.ns4?this.el:0;         
        this.Width=bw.dom?this.el.offsetWidth:bw.ie4?this.el.offsetWidth:bw.ns4?eval(nest+'document.'+obj+'.clip.width'):0;
        this.Height=bw.dom?this.el.offsetHeight:bw.ie4?this.el.offsetHeight:bw.ns4?eval(nest+'document.'+obj+'.clip.height'):0;
        this.MoveArea=MoveArea; 
        this.x=0;
        this.y=0; 
   		this.left=MoveAreaLeft;
        this.right=MoveAreaRight; 
		this.up=MoveAreaUp;
        this.down=MoveAreaDown; 
		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 MoveAreaLeft(limit,move){ 
		
		if(this.x>-this.Width+limit){ 
			this.MoveArea(this.x-move,0) 
    		if(loop) 
				setTimeout(this.obj+".left("+limit+","+move+")",this.speed) 
		} 
	} 


function MoveAreaRight(move){ 

		if(this.x<0){ 
			this.MoveArea(this.x-move,0) 
    	if(loop) 
			setTimeout(this.obj+".right("+move+")",this.speed) 
		} 
	} 

function PerformScrollHorizontal(objContenido,limit,speed){ 
		if(initialised){ 
			loop=true; 
			if(speed>0)  
				objContenido.left(limit,speed)
			else 
				objContenido.right(speed)
		} 
	}  

function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",this.speed) 
	} 
} 

function MoveAreaDown(limit,move){ 
		//alert(this.y);
		//alert(this.Height);
		//alert(limit);


		if(this.y>-this.Height+limit){ 
    	this.MoveArea(0,this.y-move) 
    		if(loop) setTimeout(this.obj+".down("+limit+","+move+")",this.speed)
		} 
} 

function PerformScrollVertical(objContenido,limit,speed){ 
	
		loop=true; 
		if(speed>0) 
			objContenido.down(limit,speed)			 			
		else
			objContenido.up(speed) 			
} 

function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

