
function ouvreFenetre(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=0}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Défilement 4 directions multiple
function Defilant(id, pos_init, pos_min, pos_max, delta, direction) {
	this.id          = id;
	this.element     = document.getElementById(id);
	this.pos_init    = pos_init;
	this.pos_min     = pos_min;
	this.pos_max     = pos_max;
	this.pos_current = pos_init;
	this.delta       = delta;
	this.direction   = direction;
}
       
Defilant.prototype.defile = function() {
	if (!this.element) {
		this.element = document.getElementById(this.id);
	}
	if (this.element) {
		if(this.direction == 'vertical'){
			if(this.pos_current < (this.pos_min - this.element.offsetHeight) ){
				this.pos_current = this.pos_init;
			} else if (this.pos_current > this.pos_max ) {
				this.pos_current = this.pos_init - this.element.offsetHeight;
			} else {
				this.pos_current += this.delta;
			}
			this.element.style.top = this.pos_current+"px";
		} else if(this.direction == 'horizontal') {
			if(this.pos_current < (this.pos_min - this.element.offsetWidth) ){
				this.pos_current = this.pos_init;
			} else if (this.pos_current > this.pos_max ) {
				this.pos_current = this.pos_init - this.element.offsetWidth;
			} else {
				this.pos_current += this.delta;
			}
			this.element.style.left = this.pos_current+"px";
		}
	}
}
