var defaultProps =
	'dependent=yes,'+ 			//fermeture auto avec fermeture parent (NS, ne fonctionne pas sur IE)
	'directories=no,'+			//barre d'outils
	'location=no,'+				//zone d'adresse
	'menubar=no,'+				//barre de menu
	'focus=yes,'+
	'status=no,';				//barre de statuts
	
function openWindow(a_url, a_name, a_width, a_height, a_left, a_top, a_scroll, a_resize) {
	if (!a_resize) {
		a_resize = 'no';
	}
	var l_props = defaultProps +
					'resizable=' + a_resize + ',' +			//redimensionnement
					'width=' + a_width + ',' +
					'height=' + a_height + ',' +
					'screenX=' + a_left + ',' +				//position horizontale (NS, ne fonctionne pas sur IE)
					'screenY=' + a_top + ',' +
					'scrollbars=' + a_scroll;				//ascenseurs
					
	var theWindow = window.open(a_url, a_name, l_props); 

	if (theWindow) {
		theWindow.focus();
	} else {
		alert("Attention, votre navigateur bloque l'ouverture de fenêtres pop-up");
	}
	return theWindow;
}


function open_notice(a_id) {
	return openWindow('../popup_notices/pop_' + a_id + '.htm', 'Notice' + a_id, 230, 400, 40, 10, 'yes');
}

function open_glossaire(a_ancre) {
	return openWindow('../popup_glossaire/Glossaire03.htm#' + a_ancre, 'Glossaire', 270, 270, 40, 10, 'yes');
}

function zoomInHoriz(a_id) {
	return openWindow('../popup_zoom/zoom.htm?id=' + a_id, 'Zoom' + a_id, 600, 460, 40, 10, 'no');
}

function zoomInHorizSpec(a_id) {
	return openWindow('../popup_zoom/zoom' + a_id + '.htm', 'Zoom' + a_id, 600, 460, 40, 10, 'no');
}

function zoomInVert(a_id) {
	return openWindow('../popup_zoom/zoomV.htm?id=' + a_id, 'Zoom' + a_id,  325, 560, 40, 10, 'no');
}

function zoomInVertSpec(a_id) {
	return openWindow('../popup_zoom/zoom' + a_id + '.htm', 'Zoom' + a_id, 325, 560, 40, 10, 'no');
}

function maquette(a_id) {
	return openWindow('../popup_maquettes/030901_' + a_id + '.htm', 'Maquette' + a_id, 700, 365, 40, 10, 'no');
}

function projet(a_id) {
	return openWindow('../popup_projets/060301_' + a_id + '.htm', 'Projet' + a_id, 700, 365, 40, 10, 'no');
}
//fonction trafiquée par Manu
function expo(a_id, a_num) {
	return openWindow(a_id, 'Expo' + a_num, 645, 395, 40, 10, 'no');
}

function diaporama(a_id, a_index) {
	var l_url = '../popup_diapos/diapo' + a_id + '.htm';
	if (a_index) {
		l_url += '?index=' + a_index;
	}
	return openWindow(l_url, 'Diapo' + a_id, 550, 400, 40, 10, 'no');
}
function couvertures(a_id, a_index) {
	var l_url = '../popup_diapos/diapo' + a_id + '.htm';
	if (a_index) {
		l_url += '?index=' + a_index;
	}
	return openWindow(l_url, 'Diapo' + a_id, 320, 390, 40, 10, 'no');
}

function goodies(a_index) {
	var l_url = '../boutique/container.htm';
	if (a_index) {
		l_url += '?index=' + a_index;
	}
	return openWindow(l_url, 'Boutique', 645, 550, 40, 10, 'no');
}


function extranet() {
	var l_props = 	'dependent=no, ' + 	//fermeture sans fermeture parent (NS, ne fonctionne pas sur IE)
					'directories=no, ' +	//barre d'outils
					'location=no, ' +		//zone d'adresse
					'menubar=no, ' +		//barre de menu
					'focus=yes, ' +
					'status=yes, ' + 	//barre de statuts
					'resizable=yes, ' +	//redimensionnement
					'width=800, ' +
					'height=600, ' +
					'screenX=0, ' +		//position horizontale (NS, ne fonctionne pas sur IE)
					'screenY=0, ' +
					'scrollbars=yes';	//ascenseurs
					
	var theWindow = window.open('../control?_action=show&key=core.utilisateur', 'Extranet', l_props); 
	if (theWindow) {
		theWindow.focus();
	} else {
		alert("Attention, votre navigateur bloque l'ouverture de fenêtres pop-up");
	}
	return theWindow;
}
