
// Fonction d'identification du fureteur DYNAPI, modifiée par Alain Duchesneau
// Copyright (C) 1999 Dan Steinman
// http://www.dansteinman.com/dynapi/

function BrowserCheck() {
	var b = navigator.appName;
	if (b=="Netscape") {
		this.b = "ns";
	} else if (b=="Microsoft Internet Explorer") {
		this.b = "ie"
	} else {
		this.b = b
	}
	this.version = navigator.appVersion;
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4) ? true : false ;
	this.ns4 = (this.b=="ns" && this.v==4) ? true : false ;
	this.ns5 = (this.b=="ns" && this.v==5) ? true : false ;
	this.ie = (this.b=="ie" && this.v>=4) ? true : false ;
	this.ie4 = (this.version.indexOf('MSIE 4')>0) ? true : false ;
	this.ie5 = (this.version.indexOf('MSIE 5')>0) ? true : false ;
	this.ow4 = (this.version.indexOf('OmniWeb')>0) ? true : false ;
//	this.min = (this.ns||this.ie)
}

is = new BrowserCheck();

// Fin de DYNAPI


function SetUpPosition() {
	var DeltaWidth =  (is.ns) ? 0 : 10;
	var hauteur = (is.ns) ? window.innerHeight : document.body.clientHeight;
	var largeur = (is.ns) ? window.innerWidth : document.body.clientWidth;

	// Maximiser la fenêtre:
	if (hauteur < 550 || largeur < 790) {
		//alert("hauteur = "+hauteur+ "\nlargeur = " + largeur)
		window.moveTo(-5,-5);
		window.resizeTo(screen.availWidth + DeltaWidth,screen.availHeight + DeltaWidth);
	}
	
}

function ScrollPourPetitsEcrans(Qui) {
	var newScrollVal;
	var hauteur = (is.ns) ? window.innerHeight : document.body.clientHeight;
	var largeur = (is.ns) ? window.innerWidth : document.body.clientWidth;

	hauteur = (is.ns) ? window.innerHeight : document.body.clientHeight;
	//alert("hauteur = "+hauteur)
	if (hauteur < 550) {
		//document.body.style.padding = "0px";
		if (Qui == "contenu") {
			if (is.ns) {
				window.scrollTo(0,35);
			} else {
				document.body.scrollTop = "35";
			}
		} else {
			if (is.ns) {
				newScrollVal = top.mainFrame.pageYOffset;
				window.scrollTo(0,newScrollVal);
			} else {
				newScrollVal = top.mainFrame.document.body.scrollTop;
				document.body.scrollTop = newScrollVal;
			}
		}
	}
}
