// ==============================================================// HANDLES SCROLLER/S// Modified from Aaron Boodman http://webapp.youngpup.net/?request=/components/ypSimpleScroll.xml// mixed ypSimpleScroll with dom-drag script and allowed multiple scrolelrs through array instances// (c)2004 Sergi Meseguer (http://zigotica.com/), 04/2004:// ==============================================================var theHandle = []; var theRoot = []; var theThumb = []; var theScroll = []; var thumbTravel = []; var ratio = [];function instantiateScroller(count, id, left, top, width, height, speed){	if(document.getElementById) {		theScroll[count] = new ypSimpleScroll(id, left, top, width, height, speed);	}}//RAFAfunction roll(boton,cual){			ruta=document.getElementById(boton).src;			if (cual==1){				document.getElementById(boton).src=ruta.replace("2.gif","1.gif");			}else{				document.getElementById(boton).src=ruta.replace("1.gif","2.gif");			}			}////////function createDragger(count, handler, root, thumb, minX, maxX, minY, maxY){		var buttons = '<div class="up" id="up'+count+'"><a href="#" onmouseover="theScroll['+count+'].scrollNorth(\''+count+'\');roll(\'up\',2);" onmouseout="theScroll['+count+'].endScroll();roll(\'up\',1);" onclick="return false;"><img src="up1.gif" width="12" height="12" id="up"></a></div><div class="dn"  id="dn'+count+'""><a href="#" onmouseover="theScroll['+count+'].scrollSouth(\''+count+'\');roll(\'dn\',2);" onmouseout="theScroll['+count+'].endScroll();roll(\'dn\',1);" onclick="return false;"><img src="dn1.gif" width="12" height="12" id="dn"></a></div><div class="thumb" id="'+thumb+'" style="left: 135px; top: 12px;"><a href="#" ><img src="thumb1.gif" width="12" height="12" id="scroll"></a></div>';		document.getElementById(root).innerHTML = buttons + document.getElementById(root).innerHTML;		theRoot[count]   = document.getElementById(root);		theThumb[count]  = document.getElementById(thumb);		var thisup = document.getElementById("up"+count);		var thisdn = document.getElementById("dn"+count);		//Con los -5 regulamos la cercania de la barra de desplazamiento a el cuadro que abre		theThumb[count].style.left = parseInt(minX+(40)) + "px";		thisup.style.left = parseInt(minX+(40)) + "px";		thisdn.style.left = parseInt(minX+(40)) + "px";		theThumb[count].style.border =0;		theThumb[count].style.top = parseInt(minY) + "px";		thisup.style.top = 0 + "px";		thisdn.style.top = parseInt(minY+maxY+(20)) + "px";		//thisdn.style.top = 15 + "px";		theScroll[count].load();		//Drag.init(theHandle[count], theRoot[count]); //not draggable on screen		//Con los -5 regulamos la cercania de la barra de desplazamiento a el cuadro que abre		Drag.init(theThumb[count], null, minX+(40), maxX+(40), minY, maxY+(20));				// the number of pixels the thumb can travel vertically (max - min)		thumbTravel[count] = (theThumb[count].maxY) - theThumb[count].minY;		// the ratio between scroller movement and thumbMovement		ratio[count] = theScroll[count].scrollH / thumbTravel[count];		theThumb[count].onDrag = function(x, y) {			theScroll[count].jumpTo(null, Math.round((y - theThumb[count].minY) * ratio[count]));		}		theThumb[count].onDragStart = function(){			roll('scroll',2);		}		theThumb[count].onDragEnd = function(){						roll('scroll',1);		}}	// INITIALIZER:// ==============================================================// ala Simon Willison http://simon.incutio.com/archive/2004/05/26/addLoadEventfunction addLoadEvent(fn) {      var old = window.onload;      if (typeof window.onload != 'function') {         window.onload = fn;      }      else {         window.onload = function() {         old();         fn();         }      }   }addLoadEvent(function(){		if(theScroll.length>0) {		for(var i=0;i<theScroll.length;i++){			createDragger(i, "handle"+i, "root"+i, "thumb"+i, theScroll[i].clipW, theScroll[i].clipW, 12, theScroll[i].clipH-26);		}	}}) 