

/* Scroll Text and Slide Image javascript */
 
ArrowWidth = 20
 
//speed=75
speed=50
txtPXScroll=10
txtextraScroll =3
pxToScroll = 3
txtScrollOriginal = txtPXScroll

imgPXScroll=10
imgextraScroll =10
imgextraScroll =10
imgScrollOriginal = imgPXScroll
 
var loop, timer 
 
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.clipWidth=bw.ns4?this.css.clip.width:this.el.offsetWidth; 
	this.scrollWidth = bw.ns4?this.css.document.width:this.el.offsetWidth;
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.left=MoveAreaLeft;this.right=MoveAreaRight; 
    this.MoveArea=MoveArea; this.x; this.y; 
	this.clipTo = b_clipTo;
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 

function MoveArea(x,y){ 
    if (x!=null) {this.x=x;this.css.left=this.x }
    if (y!=null) {this.y=y;this.css.top=this.y }
     
} 
 
function MoveAreaDown(){ 
	if(this.y>-this.scrollHeight+txtContainer.clipHeight){ 
    this.MoveArea(null,this.y-txtPXScroll) 
    if(loop) setTimeout(this.obj+".down()",speed) 
	} 
} 

function MoveAreaUp(){ 
	if(this.y<0){ 
    this.MoveArea(null,this.y+txtPXScroll) 
    if(loop) setTimeout(this.obj+".up()",speed) 
	} 
} 

function MoveAreaLeft(){ 
	if(this.x<0){ 
    this.MoveArea(this.x+imgPXScroll,null) 
    if(loop) setTimeout(this.obj+".left()",speed) 
	} 
} 

function MoveAreaRight(){ 
	if(this.x>-this.scrollWidth+imgContainer.clipWidth - (ArrowWidth*2)){ 
    this.MoveArea(this.x-imgPXScroll,null) 
    if(loop) setTimeout(this.obj+".right()",speed) 
	} 
} 

function b_clipTo(t,r,b,l){
	if(bw.ns4){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l;}
	else this.css.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";
}

 
function PerformScrollUp() {
	if(initialised){ loop=true; txtScroller.up();} 
}

function PerformScrollDown() {
	if(initialised){loop=true; txtScroller.down();} 
}

function PerformScrollLeft() {
	if(initialised){ loop=true; imgScroller.left();} 
}

function PerformScrollRight() {
	if(initialised){loop=true; imgScroller.right();} 
}

function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer)
	txtPXScroll = txtScrollOriginal;
	imgPXScroll = imgScrollOriginal;
}


 
var initialised; 
function InitialiseScrollableArea(){ 
	// texte
    txtContainer=new ConstructObject('text_bg') 
    txtScroller=new ConstructObject('text_desc','text_bg') 
    txtScroller.MoveArea(0,0) 
	if (!bw.ns4) txtContainer.css.overflow = "hidden";
	if (bw.ns6) txtScroller.css.position = "relative";

    txtContainer.css.visibility='visible' 

	// image
    imgContainer=new ConstructObject('img_bg') 
    imgScroller=new ConstructObject('img_menu','img_bg') 
    imgScroller.MoveArea(0,0) 
	if (!bw.ns4) imgContainer.css.overflow = "hidden";
	if (bw.ns6) imgScroller.css.position = "relative";
	//imgContainer.clipTo(0,0,10,0)
    imgContainer.css.visibility='visible' 
	
    initialised=true;
	
	 
} 
// end absolutely positioned scrollable area object scripts 


function showBorder(p_img)
{
	if(!p_img) return;
	obj = 'img_' + p_img;
	nest= 'img_menu';
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
	this.css.border = '1px solid black'
}

function removeBorder(p_img)
{
	if (!p_img) return;
	obj = 'img_' + p_img;
	nest= 'img_menu';
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
	this.css.border='1px solid #E8C9F6';
}
