// Detection du systeme
var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;	// Detecting IE

function showSaison(id){
	document.location = id + "_ete.html";
}

function showPDF(id){
	window.open("html/lien_pdf.html?destination=" + id);
}

// POP-UP WINDOW GENERATOR FUNCTION 1.1
var winCount=0;
function popup(page,how,winWidth,winHeight,scrolls,winID,menu){
	// Initialization Block
		var how, winWidth, winHeight, scrolls, winID, menu;
		var isMac = (navigator.platform.indexOf("Mac") != -1) ? true : false;	// Detecting Mac OS
		if (winID == "undefined" || winID == null) {
			winCount++;	// Auto-increment winID
			var winID = "popup" + winCount;
		}
		if (scrolls == null) scrolls=0;	// Scroll specification is optional
		if (winWidth == null || isNaN(winWidth)) winWidth=760;	// Default window size
		if (winHeight == null || isNaN(winHeight)) winHeight=485;
		winWidth = parseInt(winWidth);
		winHeight = parseInt(winHeight);
		if (menu == null) menu = 0;
		if (scrolls) winWidth += 17;
	// Generate fullscreen window
		if (how == "fs") {
			if (isIE && !isMac)	// IE for PC supports fullscreen mode
				window.open(page,winID,'fullscreen=yes');
			else
				window.open(page,winID,"width=" + screen.width + ",height=" + screen.availHeight + ",location=0,toolbar=0,directories=0,status=0,menubar=" + menu + ",scrollbars="+scrolls+", resizable=0,top=0,left=0");

	// Generate default centered window
		} else {
			if (isIE) winLeft=( ((document.body.clientWidth - winWidth) / 2) + (isNaN(window.screenLeft) ? 10 : window.screenLeft) - 3);
				else winLeft=( (((window.innerWidth - 20) - winWidth) / 2) + window.screenX + 3);
			if (isIE) winTop=( ((document.body.clientHeight - winHeight) / 2) + (isNaN(window.screenTop) ? 10 : window.screenTop) - 13);
				else winTop=( ((window.innerHeight - winHeight) / 2) + window.screenY + (window.outerHeight - window.innerHeight - 40) - 8);
			window.open(page,winID,"width=" + winWidth + ",height=" + winHeight + ",location=0,toolbar=0,directories=0,status=0,menubar=" + menu + ",scrollbars=" + scrolls + ", resizable=0,top=" + winTop + ",left=" + winLeft);
		}
}

function popImage(image,w,h,txt){
// Generating a centered pop-up for image
	winCount++;
	winW = w + 20;
	winH = h + 70;
	
	if (isIE) winL=( ((document.body.clientWidth - winW) / 2) + (isNaN(window.screenLeft) ? 10 : window.screenLeft));	// IE code X
		else winL=( (((window.innerWidth - 20) - winW) / 2) + window.screenX);		// Nav code X
	if (isIE) winT=( (((document.body.clientHeight - 125) - winH) / 2) + window.screenTop - 10);	// IE code Y
		else winT=( (((window.innerHeight - 125) - winH) / 2) + window.screenY + (window.outerHeight - window.innerHeight - 40));	// Nav code Y
	
	winName = "zoom" + winCount;
	options = "width=" + winW + ",height=" + winH + ",location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0, resizable=0,top=" + winT + ",left=" + winL;

	zoomWin = window.open ('',winName,options);
	
	// Ecriture du fichier
	zoomWin.document.write('<html><head><title>Il parle avec les loups.com - Album photo</title></head><body bgcolor="#2D4C00" topmargin="0" rightmargin="0" leftmargin="0" bottommargin="0" marginheight="0" marginwidth="0">');
	zoomWin.document.write('<link rel="STYLESHEET" type="text/css" href="../../general.css">');
	zoomWin.document.write('<table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0><tr><td align="center" valign="middle">');
	zoomWin.document.write('<img src="' + image + '" alt="" width="' + w + '" height="' + h + '" border="0"><br>');
	zoomWin.document.write('<table cellpadding=0 cellspacing=0 border=0 height=50><tr><td width=10><img src="images/spacer.gif" alt="" width="10" height="1" border="0"></td><td align="center" valign="middle">' + txt + '</td><td width=10><img src="images/spacer.gif" alt="" width="10" height="1" border="0"></td></tr></table></td></tr></table></body></html>');
}

function retour(forced){
	// Fonction de retour 'intelligent'
	if(window.history.length <= 0 && !forced)
		window.self.close();
	else
		window.setInterval("window.self.close()", 100); // si l'history n'est pas vide mais qu'il n'y a plus d'entrées précédentes
		window.history.back();
}
