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, 450, 400, 40, 10, 'yes');
}

function open_glossaire(a_ancre) {
	return openWindow('../popup_glossaire/Glossaire03.htm#' + a_ancre, 'Glossaire', 270, 270, 40, 10, 'yes');
}

function open_glossaireDP(a_ancre, a_cssDir, a_common) {
	var l_url = '../../popup_glossaire/Glossaire03.htm';
	if (!a_common) {
		// page spécifique
		l_url = '../' + l_url;
	}
	if (a_cssDir) {
		l_url += '?dir=../popup_dp/' + a_cssDir;
	}
	l_url += '#' + a_ancre;
	return openWindow(l_url, '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 zoomInHorizDP(a_id, a_imgDir, a_common) {
	var l_url = '../_zoom/zoom.htm?id=' + a_id + '&img=' + a_imgDir;
	if (!a_common) {
		// page spécifique
		l_url = '../' + l_url;
	}
	return openWindow(l_url, 'Zoom' + a_id, 400, 400, 40, 10, 'no');
}

function zoomInHorizSpec(a_id) {
	return openWindow('../popup_zoom/zoom' + a_id + '.htm', 'Zoom' + a_id, 600, 460, 40, 10, 'no');
}

function zoomInHorizSpecDP(a_id, a_imgDir, a_common) {
	var l_url = '../_zoom/zoom' + a_id + '.htm';
	if (!a_common) {
		// page spécifique
		l_url = '../' + l_url;
	}
	return openWindow(l_url, 'Zoom' + a_id, 400, 400, 40, 10, 'no');
}

function zoomInVertSpec(a_id) {
	return openWindow('../popup_zoom/zoom' + a_id + '.htm', 'Zoom' + a_id, 325, 560, 40, 10, 'no');
}

function zoomInVertSpecDP(a_id, a_imgDir, a_common) {
	var l_url = '../_zoom/zoom' + a_id + '.htm';
	if (!a_common) {
		// page spécifique
		l_url = '../' + l_url;
	}
	return openWindow(l_url, 'Zoom' + a_id, 325, 560, 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 zoomInVertDP(a_id, a_imgDir, a_common) {
	var l_url = '../_zoom/zoomV.htm?id=' + a_id + '&img=' + a_imgDir;
	if (!a_common) {
		// page spécifique
		l_url = '../' + l_url;
	}
	return openWindow(l_url, '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 maquetteDP(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');
}

function popupHome() {
	//return openWindow('../root/popupHome.htm', 'evHome', 250, 305, 0, 0, 'no');
}

function expo(a_url, a_num, a_width, a_height) {
	return openWindow(a_url, 'Expo' + a_num, (a_width | 645), (a_height | 395), 40, 10, 'no');
}

function dp(a_url, a_num, a_width, a_height, a_scroll) {
	if (und(a_height)){
		a_height = 395;
	}
	return openWindow(a_url, 'dp' + a_num, (a_width | 645), a_height, 50, 20, '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;
}

function minisite(a_id, a_url) {
	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=no, ' + 	//barre de statut
					'resizable=no, ' +	//redimensionnement
					'width=780, ' +
					'height=600, ' +
					'screenX=0, ' +		//position horizontale (NS, ne fonctionne pas sur IE)
					'screenY=0, ' +
					'scrollbars=no';	//ascenseurs
	var l_url = '../popup_expos/' + a_id + '/root/index.htm';
	if (a_url) {
		l_url += '?url=' + a_url;
	}
	var theWindow = window.open(l_url, 'Expo_' + a_id, l_props); 
	if (theWindow) {
		theWindow.focus();
	} else {
		alert("Attention, votre navigateur bloque l'ouverture de fenêtres pop-up");
	}
	return theWindow;
}

function minisiteLang(a_lang) {
	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=no, ' + 	//barre de statut
					'resizable=no, ' +	//redimensionnement
					'width=700, ' +
					'height=580, ' +
					'screenX=0, ' +		//position horizontale (NS, ne fonctionne pas sur IE)
					'screenY=0, ' +
					'scrollbars=no';	//ascenseurs
	var l_url = '../popup_aidevisite/index.htm?lang=' + a_lang;
	var theWindow = window.open(l_url, 'Visite_' + a_lang, l_props); 
	if (theWindow) {
		theWindow.focus();
	} else {
		alert("Attention, votre navigateur bloque l'ouverture de fenêtres pop-up");
	}
	return theWindow;
}

