var newwin;

function openphoto(winurl,winx,winy)
{	
	winfeatures = 'width='+winx+',height='+winy+', resizable=no';
	
	if(newwin)
	{	newwin.close(); }   // 2 reason always bring up windows and resize didn't work!
	//This launches a new window and then focuses it if window.focus() is supported.
      newwin = window.open(winurl,'whappaphoto',winfeatures);
	//newwin.resizeTo(winx,winy);

	//delay a bit here because IE4 encounters errors
      //when trying to focus a recently opened window - javascript version > 1.0
      setTimeout('newwin.focus();',250);
}



function checkMsgform()
{
   if((document.forms[0].elements[0].value!="") && (document.forms[0].elements[3].value!=""))
   {
	if (document.forms[0].elements[1].value=="")
	{ return true; }
	if ((document.forms[0].elements[1].value.indexOf("@") > 0) && (document.forms[0].elements[1].value.indexOf(".") > 2))
	{ return true; }
    	alert("Adresse email invalide");
	return false;
   }
   alert("Nom ou message incorrecte");
   return false;
}


function writeContainer()
{
  var winHeight = 0, topmargin = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    winHeight = window.innerHeight;
  } else if( document.documentElement && document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
    winHeight = document.documentElement.clientHeight;
  } else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    winHeight = document.body.clientHeight;
  }
  
  topmargin = Math.floor((winHeight - 685));
  if (topmargin < 0)
  {	topmargin = 0;	}
  
  document.write("<div id=\"marine\" style=\"margin-top:" + topmargin +"px;\">");
}
