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.ie=(this.ie5 || this.ie4);
    this.ns=(this.ns5 || this.ns4);
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+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.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetWidth 
    this.clipWidth=bw.ns4?this.css.clip.width:this.el.offsetWidth 
    this.left=MoveAreaLeft;this.right=MoveAreaRight; 
    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){ 
	if(bw.ie){
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
	}else{ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
    }
} 
 
function MoveAreaDown(move,i){ 
	if(this.y>-this.scrollHeight+objContainer[i].clipHeight){ 
		this.MoveArea(0,this.y-move) 
		if(loop[i]) setTimeout(this.obj+".down("+move+","+i+")",speed) 
	} 
} 
function MoveAreaUp(move,i){ 
	if(this.y<0){ 
		this.MoveArea(0,this.y-move) 
		if(loop[i]) setTimeout(this.obj+".up("+move+","+i+")",speed) 
	} 
} 
function MoveAreaLeft(move,i){
	if(this.x>-this.scrollWidth+objContainer[i].clipWidth){ 
		this.MoveArea(this.x-move,0) 
		if(loop[i]) setTimeout(this.obj+".left("+move+","+i+")",speed) 
	} 
} 
function MoveAreaRight(move,i){ 
	if(this.x<0){ 
		this.MoveArea(this.x-move,0) 
		if(loop[i]) setTimeout(this.obj+".right("+move+","+i+")",speed) 
	} 
} 
 
function PerformScroll(speedAux,i){ 
    max=objScroller[i].clipWidth/1400.;
    pix=pixMax*max*speedAux;
	if(initialised[i]){ 
		initialised[i]=false;
		loop[i]=true; 
		if(speedAux>0) objScroller[i].down(pix,i) 
		else objScroller[i].up(pix,i) 
	} 
} 

function PerformScrollh(speedAux,i){ 
    max=objScroller[i].clipHeight/1000.;
    pix=pixMax*max*speedAux*1.5;
	if(initialised[i]){ 
		initialised[i]=false;
		loop[i]=true; 
		if(speedAux>0) objScroller[i].left(pix,i) 
		else objScroller[i].right(pix,i) 
	} 
} 
 
function CeaseScroll(i){ 
    loop[i]=false 
    if(timer[i]) clearTimeout(timer[i]) 
    initialised[i]=true;
} 
var initialised=new Array(); 
var bw;
var speed, pixMax;
var loop=new Array(), timer=new Array();
var objScroller=new Array();
var objContainer=new Array();
function InitialiseScrollableArea(div1,div2,i){
	bw=new verifyCompatibleBrowser() 
	pixMax=35
	speed=50
    objContainer[i]=new ConstructObject(div1) 
    objScroller[i]=new ConstructObject(div2,div1) 
    objScroller[i].MoveArea(0,0) 
    objContainer[i].css.visibility='visible';
    initialised[i]=true;
}
