// Librairie Javascript - Fonctions de manipulations de fenetres
//
// Derniere modification effectuée le:			25/09/2001
//

// Cette fonction ouvre un popup adapte a une image

function OpenPicture() {

	var newWindow;

	newWindow = window.open(strURL);
	newWindow.focus();

	return 0;

}

//-------------------------------------------------------------------
// Cette fonction ouvre une fenetre et met le focus dessus
//-------------------------------------------------------------------

function OpenPopup(strURL, intWidth, intHeight) {

	var newWindow;
	var strWidth;
	var strHeight;
	var strOptions;

	strWidth = "width=" + intWidth;
	strHeight = "height=" + intHeight;
	strLeft = "left=" + (screen.width - intWidth) / 2;
	strTop = "top=" + (screen.height - intHeight) / 2;
	strOptions = strWidth + ", " + strHeight + ", " + strLeft + ", " + strTop + ", scrollbars=1, resizable=0, menubar=0, fullscreen=0";
	newWindow = window.open(strURL, "infopop", strOptions);
	newWindow.focus();
	return false;

}

function openwindow(strURL, intOptions) {
	window.open(strURL);
	return 0;
}

//-------------------------------------------------------------------
// Objet PopupWindow
//-------------------------------------------------------------------
// Description:
//   [desc]
// Proprietes:
//  Name
//  Width
//  Height
//   Caption
//   Scrollbars
//   Resizable
//   Maximize
//   Minimize
//   Menubar
//   Status
//   Fullscreen
//   Location
//   Toolbar
// Methodes:
//   Open()
//-------------------------------------------------------------------

function PopupWindow(strName, intWidth, intHeight) {

	// Verification des parametres optionnels
	if (strName == undefined) {
		this.Name = "";
	} else {
		this.Name = strName;
	}
	if (intWidth == undefined) {
		this.Width = 200;
	} else {
		this.Width = intWidth;
	}
	if (intHeight == undefined) {
		this.Height = 100;
	} else {
		this.Height = intHeight;
	}
	// Initialisation des proprietes
	this.Top = 30;
	this.Left = 30;
	this.Caption = "";
	this.Scrollbars = 1;
	this.Resizable = 0;
	this.Maximize = 0;
	this.Minimize = 0;
	this.Menubar =  0;
	this.Status = 0;
	this.Fullscreen = 0;
	this.Location = 0;
	this.Toolbar = 1;
	this.Open = PopupWindowOpen;
	this.MoveTo = PopupWindowMove;
	return this;
}

//-------------------------------------------------------------------
// Methode PopupWindow.Open(strURL)
//-------------------------------------------------------------------

function PopupWindowOpen(strURL) {

	var strOptions = "";

	strOptions = strOptions + 'width=' + this.Width + ",";
	strOptions = strOptions + 'height=' + this.Height + ",";
	strOptions = strOptions + 'top=' + this.Top + ",";
	strOptions = strOptions + 'left=' + this.Left + ",";
	strOptions = strOptions + 'scrollbars=' + NumInBool(this.Scrollbars) + ",";
	strOptions = strOptions + 'resizable=' + NumInBool(this.Resizable) + ",";
	strOptions = strOptions + 'maximize=' + NumInBool(this.Maximize) + ",";
	strOptions = strOptions + 'minimize=' + NumInBool(this.Minimize) + ","
	strOptions = strOptions + 'menubar=' + NumInBool(this.Menubar) + ",";
	strOptions = strOptions + 'toolbar=' + NumInBool(this.Toolbar) + ",";
	strOptions = strOptions + 'fullscreen=' + NumInBool(this.Fullscreen) + ",";
	strOptions = strOptions + 'location=' + NumInBool(this.Location) + ",";
	strOptions = strOptions + 'status=' + NumInBool(this.Status);
	window.open(strURL, this.Name, strOptions);
}

//-------------------------------------------------------------------
// Methode PopupWindow.Move(lngCoordX, lngCoordY)
//-------------------------------------------------------------------

function PopupWindowMove(lngCoordX, lngCoordY) {

	// alert("MOVE THE WINDOW, DAMMIT%^@(&)@(#$&");
}