function popup(a, param){
	var url = a.href;
	pop(url, param);
	return false;
}

function pop(url, param){
	popnew = window.open(url, "popnew", param);
  	setTimeout('popnew.focus();', 250);
}

var zepic = new Image();
function pimage(img){
	var url = img.src;
	zepic.alt = "Cliquer pour fermer la fenêtre";
	if(img.alt){
		zepic.alt = img.alt;
	}
	url = url.replace('0.gif', '1.gif');
	url = url.replace('0.jpg', '1.jpg');
	zepic.src = url;
	setTimeout("openimage()", 200);

}
function openimage(){
	pop("", 'width='+zepic.width+',height='+zepic.height+',scrolling=no');

	popnew.document.open();
	popnew.document.write('<html><head><title>Réserve Naturelle Baie de l\'Aiguillon</title><link rel="stylesheet" href="../libs/style.css"/></head>');
	popnew.document.write('<body class="body" rightmargin="0" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0">');
	popnew.document.write('<a href="javascript:self.close();"><img src="'+zepic.src+'" border="0" alt="'+zepic.alt+'"/></a>');
	popnew.document.write('</body></html>');
	popnew.document.close();
}

var image_selected = "";

function getType()
{
	var type= null;
	if (navigator.userAgent.indexOf("Opera")!=-1
		&& document.getElementById) type="OP";

	if (document.all) type="IE";

	if (document.layers) type="NN";

	if (!document.all && document.getElementById) type="MO"; 
	
	return type;
}

function hide_txt(id){
	document.getElementById(id).style.display='none';
}

function hide_img(id){
	if (id == image_selected) return false;
	
	var type = getType();
	
	if( type =="IE" )	
	{
		eval("document.all." + id + ".style.backgroundPosition='0 185px'");
	}
	
	if( type=="NN")
	{
		eval("document." + id + ".style.backgroundPosition='0 185px'");
	}
	
	if (type=="MO" || type=="OP")
	{
		eval("document.getElementById('" + id + "').style.backgroundPosition='0 185px'");
	}
}

function montre_img(id){
	var type = getType();
	if (type=="IE") eval("document.all." + id + ".style.backgroundPosition='0'");
	if (type=="NN") eval("document." + id + ".backgroundPosition='0'");
	if (type=="MO" || type=="OP")
		eval("document.getElementById('" + id + "').style.backgroundPosition='0'");
}

function show( image , text )
{
	image_selected = image;
	for( i=1; i <= 9; i++ )
	{
		hide_txt('txt'+i);
		hide_img('img'+i);
		
	}
	var type = getType();
	if( type =="IE" )
	{
		eval("document.all." + text + ".style.display='block'");
		eval("document.all." + image + ".style.backgroundPosition='0'");
		
	}
	if( type=="NN")
	{
		eval("document." + text + ".display='block'");
		eval("document." + image + ".style.backgroundPosition='0'");
	}
	
	if (type=="MO" || type=="OP")
	{
		eval("document.getElementById('" + text + "').style.display='block'");
		eval("document.getElementById('" + image + "').style.backgroundPosition='0'");
	}
}