// JavaScript Document

var dom = document.getElementById; var ie = document.all;
function capEv(event,method){this[event] = method;};function relEv(event){	this[event] = null;};function getYs(e){ return ie ? event.clientY : e.pageY;}
function getEl(nm){var el = dom ? document.getElementById(nm) : ie ? document.all[nm] : false;el.getTop = function(){return parseInt(el.offsetTop) || 0}; el.setTop = function(y){el.style.top = y+"px"};el.getHeight = function(){return el.offsetHeight}; el.getClipHeight = function(){return el.offsetHeight};	el.capEv = capEv; el.relEv = relEv;	return el;}
document.capEv = capEv; document.relEv = relEv;
sObj = function(s, uObj, dObj, hObj, cObj){
	this.s = s;	var self = this; this.uObj = getEl(uObj); this.dObj = getEl(dObj); this.hObj = getEl(hObj); this.cObj = getEl(cObj,hObj);
	this.obj = cObj+"Object"; eval(this.obj+"=this"); this.tL = this.tH-this.dH; this.tB = this.tT+this.tL; this.hH = this.hObj.getClipHeight(); this.cH = this.cObj.getHeight(); this.cL = this.cH-this.hH; this.sL = this.tL/this.cL; this.sT = null;
	this.uObj.capEv("onmousedown", function(){self.scroll(self.s);return false});
	this.uObj.capEv("onmouseup", function(){self.stSc()}); 	this.uObj.capEv("onmouseout", function(){self.stSc()});	this.dObj.capEv("onmousedown", function(){self.scroll(-self.s);return false}); this.dObj.capEv("onmouseup", function(){self.stSc()});
	this.dObj.capEv("onmouseout", function(){self.stSc()});
}
sObj.prototype.sDg = function(e){this.dSM = getYs(e); var self = this; document.capEv("onmousemove", function(e){self.drag(e)}); document.capEv("onmouseup", function(){self.stD()});}
sObj.prototype.stD = function(){document.relEv("onmousemove"); document.relEv("onmouseup");}
sObj.prototype.drag = function(e){var curM = getYs(e); var mDiff = curM-this.dSM;var dD = this.dSO+mDiff; var dM = (dD<this.tT) ? this.tT : (dD>this.tB) ? this.tB : dD; var cM = -(dM-this.tT)*(1/this.sL);this.cObj.setTop(cM);}
sObj.prototype.scroll = function(s){var cM = this.cObj.getTop()+s; var dM = this.tT-Math.round(this.cObj.getTop()*(this.tL/this.cL));	if(cM > 0)	cM = 0; else if(cM < -this.cL) cM = -this.cL;if(dM < this.tT)	dM = this.tT; else if(dM > this.tB) dM = this.tB;this.cObj.setTop(cM); 	this.sT = window.setTimeout(this.obj+".scroll("+s+")",25);}
sObj.prototype.stSc = function(){if(this.sT) window.clearTimeout(this.sT); this.sT = null;}
sObj.prototype.sJmp = function(e){	var curM = getYs(e); var dD = curM-(this.dH/2);var dM = (dD<this.tT) ? this.tT : (dD>this.tB) ? this.tB : dD;var cM = -(dM-this.tT)*(1/this.sL); this.cObj.setTop(cM);}

window.onload = function(){scroller1 = new sObj (15,"up","down","tex1scroll","contenttex1scroll");scroller2 = new sObj (15,"up2","down2","tex2scroll","contenttex2scroll");scroller3 = new sObj (15,"up3","down3","tex3scroll","contenttex3scroll");};