//ouvre une fenêtre et la positionne en premier plan
var popup_url='';

function open_url(lien){
	if(popup_url)
		  {
			if(!popup_url.closed) popup_url.close();//popup_url.focus();
		  }
		  popup_url = open(lien, 'popup_url', '');
}

function PopupImage(img) { 
	titre="Agrandissement de la photo"; 
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no'); 
	w.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n" );
	w.document.write("<html>\n" );
	w.document.write("<head>\n" );	
	w.document.write("<meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>\n" );	
	w.document.write("<meta http-equiv='content-language' content='fr'>\n" );	
	w.document.write("<meta http-equiv='content-style-type' content='text/css'>\n" );
	w.document.write("<meta http-equiv='content-script-type' content='text/javascript'>\n" );
	w.document.write("<title>"+titre+"</title>\n" );	
	w.document.write("<meta http-equiv='imagetoolbar' content='no'>\n" );	
	w.document.write("<meta name='author' content='Conseil g&eacute;n&eacute;ral des Deux-S&egrave;vres - SIT - Bureau Internet Intranet'>\n" );	
	w.document.write("<meta name='copyright' content='copyright 2006 &copy; SIT - Bureau Internet Intranet'>\n" );
	w.document.write("<script type='text/javascript'>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+20,document.images[0].height+40); window.focus();} else { setTimeout('checksize()',250) } }</script>" ); 
	w.document.write("</head>\n" );
	w.document.write("<body onload='checksize()' onblur='window.close()' onclick='window.close()'>\n" );
	w.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr>\n" );
	w.document.write("<td valign='middle' align='center'><img src='"+img+"' border=0 alt='Clic gauche pour fermer la fen&ecirc;tre'>\n" ); 
	w.document.write("</td>\n" );
	w.document.write("</tr>\n" );
	w.document.write("</table>\n" );
	w.document.write("</body>\n" ); 
	w.document.write("</html>"); 
	w.document.close(); 
	} 

function resizePopUp(titre,image,commentaire,copyright){
	w = window.open('','image','top=50,left=50,width=10,height=10,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,status=no');
	w.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n" );
	w.document.write("<html>\n" );
	w.document.write("<head>\n" );	
	w.document.write("<meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>\n" );	
	w.document.write("<meta http-equiv='content-language' content='fr'>\n" );	
	w.document.write("<meta http-equiv='content-style-type' content='text/css'>\n" );
	w.document.write("<meta http-equiv='content-script-type' content='text/javascript'>\n" );
	w.document.write("<title>"+titre+"</title>\n" );	
	w.document.write("<meta http-equiv='imagetoolbar' content='no'>\n" );	
	w.document.write("<meta name='Description' content='Deux-s&egrave;vres actualit&eacute;s, F&ecirc;te de la science 2006'>\n" );	
	w.document.write("<meta name='author' content='Conseil g&eacute;n&eacute;ral des Deux-S&egrave;vres - SIT - Bureau Internet Intranet'>\n" );	
	w.document.write("<meta name='copyright' content='copyright 2006 &copy; SIT - Bureau Internet Intranet'>\n" );
	w.document.write("<link href='/inc/style_PopUpImg.css' rel='stylesheet' type='text/css' media='screen'>\n" ); 
	w.document.write("<script type='text/javascript'>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+30,document.images[0].height+160); window.focus();} else { setTimeout('checksize()',250) } }</script>" ); 
	w.document.write("</head>\n" );
	w.document.write("<body onload='checksize()' onblur='window.close()' onclick='window.close()'>\n" );
	w.document.write("<h1>"+titre+"</h1>\n" );
	w.document.write("<div class='Commentaire'>"+commentaire+"</div>\n" );
	w.document.write("<div class='Image'><img src='"+image+"' alt='Cliquer pour fermer la fen&ecirc;tre'></div>\n" );
	w.document.write("<div class='Copyright'>"+copyright+"</div>\n" );
	w.document.write("</body>\n" );
	w.document.write("</html>" );
	w.document.close();
	}

function resizePopUpSmall(titre,image,commentaire,copyright){
	w = window.open('','image','top=50,left=50,width=10,height=10,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,status=no');
	w.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n" );
	w.document.write("<html>\n" );
	w.document.write("<head>\n" );	
	w.document.write("<meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>\n" );	
	w.document.write("<meta http-equiv='content-language' content='fr'>\n" );	
	w.document.write("<meta http-equiv='content-style-type' content='text/css'>\n" );
	w.document.write("<meta http-equiv='content-script-type' content='text/javascript'>\n" );
	w.document.write("<title>"+titre+"</title>\n" );	
	w.document.write("<meta http-equiv='imagetoolbar' content='no'>\n" );	
	w.document.write("<meta name='Description' content='Deux-s&egrave;vres actualit&eacute;s, F&ecirc;te de la science 2006'>\n" );	
	w.document.write("<meta name='author' content='Conseil g&eacute;n&eacute;ral des Deux-S&egrave;vres - SIT - Bureau Internet Intranet'>\n" );	
	w.document.write("<meta name='copyright' content='copyright 2006 &copy; SIT - Bureau Internet Intranet'>\n" );
	w.document.write("<link href='/inc/style_PopUpImg.css' rel='stylesheet' type='text/css' media='screen'>\n" ); 
	w.document.write("<script type='text/javascript'>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+150,document.images[0].height+260); window.focus();} else { setTimeout('checksize()',250) } }</script>" ); 
	w.document.write("</head>\n" );
	w.document.write("<body onload='checksize()' onblur='window.close()' onclick='window.close()'>\n" );
	w.document.write("<h1>"+titre+"</h1>\n" );
	w.document.write("<div class='Commentaire'>"+commentaire+"</div>\n" );
	w.document.write("<div class='Image'><img src='"+image+"' alt='Cliquer pour fermer la fen&ecirc;tre'></div>\n" );
	w.document.write("<div class='Copyright'>"+copyright+"</div>\n" );
	w.document.write("</body>\n" );
	w.document.write("</html>" );
	w.document.close();
	}


//modifie la couleur du tr au passage de la souris dans le menu
function chgcolor(td,classe){	
	td.className=classe;
}

function backcolor(td,classe){
	cellule=td;
	dernierstyle=td.className;
	td.className=classe;
}

// tooltips : affiche un calque avec message au survol de la souris
// nécessite de placer un calque "toolTipLayer" et initialisé tooltip dans le body
// <div id="toolTipLayer" style="position:absolute; visibility: hidden; padding:2px;text-align:center;"></div>
// <script language="JavaScript" type="text/javascript"><!--initToolTips(); //--> <script>
// appel : javascript:toolTip('message', 'couleurtypo', 'couleurfond');
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = -6;
offsetY = 13;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(title, msg, fg, bg)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#777";
    if(!bg) bg = "#FFFFFF";
    var content =
    '<table border="0" cellspacing="0" cellpadding="2" bgcolor="white"><tr><td>' +
    '<table cellspacing="0" cellpadding="1" style="background-color:' + bg + ';border:1px solid #e9e9e9;">' + // border:1px solid #cccccc;
    '<tr class="altern"><td style="font-family:Verdana, sans-serif;font-size:9;color:#6688A0;font-weight:bold;text-transform: uppercase;">&nbsp\;' + title +'</td></tr>'+ //color:#87A1B3;
	'<tr><td align="left"><font face="sans-serif" color="' + fg +
    '" size="1">&nbsp\;' + msg +
    '&nbsp\;</font></td><tr></table></td></tr></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}

//fonction imrpression:ouvre boite de dialogue d'impression
function impression(){
window.print();
}


//fonction de remplacement d'un caractére
//champ : nom du champ concerné
//txtsearch : texte recherché
//txtreplace : chaine qui remplacera le texte recherché
function remplace(champ, txtsearch, txtreplace){
	chaine = champ.value;
	chainemodif = eval('chaine.replace(/'+txtsearch+'/g,"'+txtreplace+'")');
	champ.value = chainemodif;
}

