// fonction popup
var isIE  = false;
var isNS  = false;
if (document.all) isIE = true;
else if (document.layers) isNS = true;
var bVer = parseInt(navigator.appVersion);

var newWin=null;
function ouvrir(loc, name, width, height) {
        var _params = "width="+width+",height="+height+",location=no,resizable=yes,status=no,scrollbars=no";

        // position
        _left = 0;
        _top = 0;
        if (isIE) _params += ",top=" + _top + ",left=" + _left;
        else if (isNS) _params += ",screenX=" + _left + ",screenY=" + _top;
		else _params += ",top=" + _top + ",left=" + _left;

		// popup
        newWin = window.open(loc, name, _params);
		// focus
        if ((newWin!=null) && !(isIE && (bVer<5))) newWin.focus();
}

function ouvrirRef(url) {
	ouvrir(url, "vichycom", screen.width-9, screen.height-24-28);
}

function centrer(loc, name, width, height, sizeable,scrollbars) {

        var _params = "width="+width+",height="+height+",resizable="+ ((sizeable)?"yes":"no") +",status=no,scrollbars="+ ((scrollbars)?"yes":"no") +"";

        // position
        if (bVer >= 4) {
				if (screen.height <= 768) {
					_left = 0;
					_top = 0;
				}
				else {
					_left = ( (screen.width-width) >>1 );
					_top = ( (screen.height-28-height) >>1 );
				}
        } else {
                 _left = 0;
                 _top = 0;
        }
        if (isIE) _params += ",top=" + _top + ",left=" + _left;
        else if (isNS) _params += ",screenX=" + _left + ",screenY=" + _top;
		else _params += ",top=" + _top + ",left=" + _left;

		// popup
        newWin = window.open(loc, name, _params);
		// focus
        if ((newWin!=null) && !(isIE && (bVer<5))) newWin.focus();
}


// ajouter aux favoris
function favoris() {
	if (document.all) {
		window.external.AddFavorite(location.href, document.title);
	}
	else {
		alert('Vous pouvez faire CTRL + D pour ajouter cette page dans vos signets, ou favoris.');
	}
}
