function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function afficheDate(){
	document.write (CalculDate ());
}

function CalculDate () {
	var Months= new initArrayDate("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","ao&ucirc;t","septembre","octobre","novembre","d&eacute;cembre");
	var Days  = new initArrayDate("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche");
	var today = new Date();
	years = (today.getYear() < 100)?today.getYear()+2000:today.getYear();
	return (Days[today.getDay()]+" "+today.getDate()+" "+Months[today.getMonth()]);
}

function initArrayDate () {
	for(i=0;i<initArrayDate.arguments.length; i++) this[i] = initArrayDate.arguments[i];
}


function Envoyer(f)
{
	if (verifMail(f.mail) == true)
	{	
		f.submit();
	}
	else
	{
		alert("Votre E-mail, Merci");
	}	
}

function verifMail(EMAIL)
{
	var a=EMAIL.value;
	var test="" + a;
	for(var k = 0; k < test.length;k++)
	{
		var c = test.substring(k,k+1);
		if(c == "@")
		{		
			for(var i = 0; i < test.length;i++)
			{	
				var d = test.substring(i,i+1);
				if(d == ".")
				{
					return true;
				}
			}
			return false
		}
	}
	return false;
}

function writeTopTV()
{
	document.write('<body bgcolor="#FFFFFF" text="#000000"  background="images/nav/fond.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="scrollnews(0)">'
					+'<table width="792" height="113" border="0" cellpadding="0" cellspacing="0" background= "images/sirap/bandeau/tv/' + parseInt(Math.random()*7) +'.jpg">'
					+'<tr><td width="179" height="113" valign="top"><img src="images/sirap/homelink.gif" width="175" height="100" border="0" border="0" usemap="#Map">'); 
}

function writeTop()
{
	document.write( '<body bgcolor="#FFFFFF" text="#000000"  background="images/nav/fond.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'
					+'<table width="792" height="113" border="0" cellpadding="0" cellspacing="0" background= "images/sirap/bandeau/' + parseInt(Math.random()*8) +'.jpg">'
					+ '<tr><td width="179" height="113" valign="top"><img src="images/sirap/homelink.gif" width="175" height="110" border="0" border="0" usemap="#Map"></td>');
}

function writeTopAlert()
{
	document.write( '<body bgcolor="#FFFFFF" text="#000000"  background="images/nav/fond.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload=testpopup()>'
					+'<table width="792" height="113" border="0" cellpadding="0" cellspacing="0" background= "images/sirap/bandeau/' + parseInt(Math.random()*8) +'.jpg">'
					+ '<tr><td width="179" height="113" valign="top"><img src="images/sirap/homelink.gif" width="175" height="110" border="0" border="0" usemap="#Map"></td>');
}

function testpopup(){
	if(ua.indexOf('MSIE')>-1){
		var w=window.open("../blank.htm","popup","width=50,height=50,left=3000,top=3000");
		if(w){w.close();wo=1;}else if(navigator.userAgent.indexOf("SV1")<=0)alert("ATTENTION !\r\n\r\nLes applications telles que Google Toolbar, Norton Security installent des\r\nanti pop-up qui peuvent alterer l'exécution de TopoNet.\r\n\Merci de déscativer votre filtre anti pop-up pour utiliser pleinement TopoNet.");
	}else wo=1;
}

function writeTopMap()
{
document.write('<map name="Map">'
			    +'<area shape="poly" coords="0,0,51,0,140,17,134,35,118,54,89,72,50,84,23,88,7,88,0,89" href="http://www.sirap.fr">'
				+'</map>');
}



/*
function writeScrollMenu()
{/*
 	document.write('<table height="50" border="0" cellpadding="5" cellspacing="0">'
					  +'<tr>'
						+'<td width="191"> <form name="form1" method="post" action="">'
							+'<div align="center"><span>'
							 +'<select name="select2" onChange="MM_jumpMenu('+"'"+'parent'+"'"+',this,1)" class="contenu-little">'
								+'<option value="default.htm" selected>Accueil</option>'
								+'<option value="produits.htm">Produits</option>'
								+'<option value="services.htm">Services</option>'
								+'<option value="book.htm">Exp&eacute;riences</option>'
								+'<option value="references.htm">Références</option>'
								+'<option value="presse.htm">Presse</option>'
								+'<option value="infosociete.htm">Société</option>'
								+'<option value="esp-clients.asp">Espace Clients</option>'
								+'<option value="partenaires.htm">Partenaires</option>'
								+'<option value="http://extranet.sirap.fr">Extranet</option>'
								+'<option value="contact.htm">Contact</option>'
								+'<option value="sitemap.htm">Plan du site</option>'
							  +'</select>'
							  +'</span> </div>'
						  +'</form></td>'
					  +'</tr>'
					+'</table>');
}
/**/

function afficheVignette(cheminVignette,cheminMaxi)
{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour agrandir"></A>');
}
	
function afficheMaxi(chemin)
{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>SIRAP</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageS onLoad="window.resizeTo(document.imageS.width+20,document.imageS.height+60)"></CENTER><table border="0" align="center"><tr><td><a href="javascript:window.close();">Fermer la fenêtre</a></td></tr></table></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}
	
function popup(page,w,h) 
{
 	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
 	window.open(page,'SIRAP','resizable=yes, location=no, width=' + w + ', height= ' + h + ', menubar=no, status=no, scrollbars=yes, menubar=no'); 
}

function popupkill(page,w,h,t,l) 
{
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'SIRAP','width=' + w + ',height=' + h + ',top=' + t + ',left=' + l + ',toolbar=false,scrollbars=false');	
	//rebours(10);  // Commence le compte à rebours en secondes
}


function writeLayerVoeux()
{
	document.write('<div id="LayerVoeux" style="position:absolute; width:425%; height:221%px; z-index:2; left: -500px; top: 50px; visibility: hidden; overflow: visible; opacity: 0.1">'
				    +'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
    				+'<tr><td><img src="http://www.sirap.fr/images/Divers/Voeux 2011/' + parseInt(Math.random()*9) +'.jpg" ></td></tr>'
					+ '</table></div>');

}

