/* Scroll Text and Slide Image javascript */

// begin absolutely positioned scrollable area object scripts 
 
ArrowHeight = 30
ArrowWidth = 0
 
//speed=75
speed=50
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+imgContainer.clipHeight-(ArrowHeight*2)){ 
    this.MoveArea(null,this.y-imgPXScroll) 
    if(loop) setTimeout(this.obj+".down()",speed) 
	} 
} 

function MoveAreaUp(){ 
	if(this.y<0){ 
    this.MoveArea(null,this.y+imgPXScroll) 
    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){ 
    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(p_menu) {
	if(initialised){ 
		imgScroller = (p_menu == 'H') ? imgHScroller : imgEScroller;
		imgContainer = (p_menu == 'H') ? imgHContainer : imgEContainer;
		loop=true; 
		imgScroller.up();
	} 
}

function PerformScrollDown(p_menu) {
	if(initialised){
		imgScroller = (p_menu == 'H') ? imgHScroller : imgEScroller;
		imgContainer = (p_menu == 'H') ? imgHContainer : imgEContainer;
		loop=true; 
		imgScroller.down();
	} 
}


function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer)
	imgPXScroll = imgScrollOriginal;
}


 
var initialised; 
function InitialiseScrollableArea(){ 
	// Menu Hiver
    imgHContainer=new ConstructObject('img_bg_h') ;
    imgHScroller=new ConstructObject('img_menu_h','img_bg_h') ;
    imgHScroller.MoveArea(0,0) ;
	if (!bw.ns4) imgHContainer.css.overflow = "hidden";
	if (bw.ns6) imgHScroller.css.position = "relative";

    imgHContainer.css.visibility='visible' ;

    imgHFloatBlock=new ConstructObject('float_img_block_h');

	// Menu Ete
    imgEContainer=new ConstructObject('img_bg_e') ;
    imgEScroller=new ConstructObject('img_menu_e','img_bg_e') ;
    imgEScroller.MoveArea(0,0) ;
	if (!bw.ns4) imgEContainer.css.overflow = "hidden";
	if (bw.ns6) imgEScroller.css.position = "relative";

    imgEContainer.css.visibility='visible' ;

    initialised=true;
} 
// end absolutely positioned scrollable area object scripts 


/****  Gestion des Contours lors de du passage de souris ***/

function showBorder(p_img, p_menu)
{
	obj = 'img_' + p_menu + p_img;
	nest= '';
    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, p_menu)
{
	obj = 'img_' + p_menu + p_img;
	nest= '';
    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= (p_menu == 'e') ? '1px solid #48B8C6' : '1px solid #F99223';
}
/****  Fin : Gestion des Contours lors de du passage de souris ***/




