/***************************************************************************************
 * Generic JavaScript functions used to handle browser windows.
 ***************************************************************************************/


/**
 * Open a new browser window without navigation bar and give it the focus
 *
 * @param url The target url on the server
 * @param options Browser window options (width, height, scrollbars, etc.)
 */
function openNewWindowGeneric(url, options) {
	var nw = window.open(url, '_blank', options);
	nw.focus();
	return false;
}

/**
 * Open a new browser window without navigation bar and give it the focus
 *
 * @param url The target url on the server
 * @param options Browser window options (width, height, scrollbars, etc.)
 */
function openNewWindow(url, options) {
	var nw = window.open('fenetres/modele.php?urlFenetre=' + escape(url), '_blank', options);
	nw.focus();
	return false;
}

/**
 * Open a new browser window without navigation bar and give it the focus
 *
 * @param url The target url on the server
 */
function openNewSubWindow(url) {
	openNewWindow(url, 'top=0, left=0, width=800, height=620, scrollbars=yes, resizable=yes, status');
}


function addToFavorites() {
	if (document.all) {
		window.external.AddFavorite(location.href, document.title);
	}
}

function visualiserImage(urlImage) {
	var i1 = new Image;
	i1.src = urlImage;
	var html = '<html><head><title>Club Voyages Tourbec - Photo</title></head><body scroll="no" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" onBlur="JavaScript:top.close();"><div align="center"><img src="'+urlImage+'" border="0" name="photo" onLoad="JavaScript:window.resizeTo(document.photo.width+40,document.photo.height+60)"></div></body></html>';
	var popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	onBlur="top.close()";
}
