
// attention, le nbre d'argument peut être variable..
//arguments supplémentaires  : Winscrollbar='yes', Winwidth=600, Winheight=500, Menu (ie adresse/localisation/resize) = 'no'

function OpenWind(name) { 
					
	var winscrollbar = 'yes';
	var winwidth = 600;
	var winheight = 500;
	var winmenu = 'no';

	if (OpenWind.arguments[0] == null) return;
	
	if (OpenWind.arguments[1] != null) {
		winscrollbar = OpenWind.arguments[1];
		
		if (OpenWind.arguments[2] != null) {
			winwidth = OpenWind.arguments[2];

			if (OpenWind.arguments[3] != null) {
				winheight = OpenWind.arguments[3];

				if (OpenWind.arguments[4] != null) {
					winmenu = OpenWind.arguments[4];
				}
			}
		}
	}

	OpenPopUp2('CtrlWindow', winscrollbar, winwidth, winheight, winmenu, name);
}


// ouverture d'une fenêtre complète
function OpenFullWind(name) {
	OpenPopUp2('CtrlWindow', 'yes', 600, 500, 'yes', name);
}

/* cette fonction est déjà implémentée dans lib/lib.js : non elle a uniquement 5 argts !!!! */
var bool_OpenPopUp = 0;

function OpenPopUp2(wintype, winscrollbar, winwidth, winheight, winmenu, str) {


	if (bool_OpenPopUp == 1) {
		if (OpenWin.closed == true)		bool_OpenPopUp = 0;
		else {
			OpenWin.close();
			bool_OpenPopUp = 0;
		}
	}


	if (bool_OpenPopUp == 0) { 

		var winprop = 'toolbar='+winmenu+',menubar='+winmenu+',location='+winmenu+',resizable='+winmenu+',left=300,top=300,z-lock=yes,alwaysRaised=yes,scrollbars='+winscrollbar+',width='+winwidth+',height='+winheight+'';

		OpenWin = window.open(str, wintype, winprop);
		OpenWin.focus();
		bool_OpenPopUp = 1;
	}
	
	}
