//_______________________ Browser tools
// Class MyBrowser
function MyBrowser(){
	this.OS = navigator.userAgent.indexOf("Win") == -1 ? "Macintosh" : "Windows";
	this.navigator = navigator.appName.indexOf("Netscape") == -1 ? "IE" : "Netscape";
	this.versionNav = parseInt(navigator.appVersion);
}

var mbp = MyBrowser.prototype;
mbp.isIE = function(){			return this.navigator == "IE";}
mbp.isNetscape = function(){	return this.navigator == "Netscape";}
mbp.isWindows = function(){		return this.OS == "Windows";}
mbp.isMac = function(){			return this.OS == "Macintosh";}


//_______________________ Popup
function getNameAuto(){			return "win"+(this.$idAuto++);}
function checkName(winName){
	if(String(this[winName]) != "undefined")	this[winName].close();
	if(String(winName) == "undefined")			winName = this.getNameAuto();
	return winName;
}

function popup(urlDoc, x, y, w, h, winName){
	var winName = checkName(winName);
	var win = this[winName] = window.open(urlDoc, winName, "width="+w+",height="+h+",left="+x+",top="+y);
	win.moveTo(x, y);
	win.resizeTo(w, h);
	win.focus();
}


function centerPopup(urlDoc, w, h, winName){	popup(urlDoc, getCenterX(w), getCenterY(h), w, h, winName);}

function getCenterX(w){				return Math.round((screen.availWidth - w)/2);}
function getCenterY(h){				return Math.round((screen.availHeight - h)/2);}



function fullPopup(urlDoc, winName){
	var winName = checkName(winName);
	var options = "width=100,height=100,left="+this.getCenterX()+",top="+this.getCenterY();
	//if(window.$browser.isIE())	options += ",fullscreen=yes";
	var win = this[winName] = window.open(urlDoc, winName, options);
	win.moveTo(0, 0);
	//alert("fullPopup : " + screen.availWidth + "|"+ screen.availWidth);
	win.resizeTo(screen.availWidth, screen.availHeight);
	win.focus();
}

function fenFullPopup(urlDoc, winName){				fullPopup(urlDoc, winName);}
function fenCenterPopup(urlDoc, w, h, winName){		centerPopup(urlDoc, w, h, winName);}


//____________ constantes
this.$browser = new MyBrowser();
this.$idAuto = 0;

