function popup(page,w,h) 
{
 // ouvre une fenetre sans barre d'etat, ni d'ascenceur
 window.open(page,'popup','resizable=yes, location=no, width=' + w + ', height= ' + h + ', menubar=no, status=no, scrollbars=yes, menubar=no'); 
}

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();
	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 EnvoyerNewsLetter(f)
{
	if (verifMail(f.Mail) == true)
	{
		f.submit();
	}
	else
	{
		alert("Merci d'indiquer votre E-mail");
	}	
}

function EnvoyerQuestionnaire(f)
{
	if((""+f.Societe.value).length == 0)
	{
			alert("Merci d'indiquer le nom de votre société");		
	}
	else
	{
		if((""+f.Fonction.value).length == 0)
		{
				alert("Merci d'indiquer votre fonction");		
		}
		else
		{
			if((""+f.Nom.value).length == 0)
			{
					alert("Merci d'indiquer votre nom");		
			}
			else
			{
				if (verifMail(f.Mail) == true)
				{
					f.secondpart.disabled=false;
					f.submit();
				}
				else
				{
					alert("Merci d'indiquer votre E-mail");
				}	
			}
		}
	}
}

function verifMail(EMAIL)
{
	var dot = ".";
	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 == dot)
				{
					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" background-repeat="repeat-y">'
					+'<table width="792" height="113" border="0" cellpadding="0" cellspacing="0" background= "images/sirap/bandeau/tv/' + parseInt(Math.random()*22) +'.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" background-repeat="repeat-y">'
					+'<table width="792" height="113" border="0" cellpadding="0" cellspacing="0" background= "images/sirap/bandeau/' + parseInt(Math.random()*21) +'.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 writeTopjSIRAP()
{
	document.write('<body bgcolor="#FFFFFF" text="#000000"  background="images/nav/fond.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background-repeat: "repeat-y">'
					+'<table width="792" height="113" border="0" cellpadding="0" cellspacing="0" background= "images/sirap/bandeau/JS2005/' + parseInt(Math.random()*4) +'.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 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 writeLicFlotImg()
{
	document.write('<tr><td <div align="center"><img src="images/Divers/715/' + parseInt(Math.random()*18) +'.gif"  border="0"></div></td></tr>');
}


/*
function writeLayerVoeux()
{
	document.write('<div id="LayerVoeux" style="position:absolute; width:402px; height:209px; z-index:1; left: -402px; top: 162px; visibility: visible; overflow: visible;">'
				    +'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
    				+'<tr><td><img src="images/Divers/Voeux/' + parseInt(Math.random()*4) +'.jpg" ></td></tr>'
					+ '</table></div>');

}
*/


function writeLayerVoeux()
{
	document.write('<div id="LayerVoeux" style="position:absolute; width:425%; height:221%px; z-index:1; 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 2010/' + parseInt(Math.random()*8) +'.jpg" ></td></tr>'
					+ '</table></div>');

}


function writeWallPaper()
{
	/*
	
	parseInt(Math.random()*5)
	
	var tabmois = new Array("Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre");
	today = new Date;
	mois = today.getMonth();
	year = today.getYear();
	
	alert($.browser.msi)
	
	if($.browser.msie && year >= 2008 || $.browser.mozilla && year >= 108)
	{	
	*/	
	
	var tabmois = new Array("Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre");
	mois = today.getMonth();
	
	document.write('<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">'+
        '<tr><td valign="top" class="header-beige">T&eacute;l&eacute;chargement</td></tr><tr><td>&nbsp;</td></tr>'+
        '<tr><td><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">'+
        '<tr><td class="contenu-big-black"><span class="contenu">D&eacute;couvrez chaque mois, un nouveau fond d\'&eacute;cran  aux couleurs de SIRAP...</span></td>'+ 
		'</tr></table></td></tr><tr><td>&nbsp;</td></tr>'+
        '<tr><td>'+
		'<a href="images/Divers/Cal/SIRAP-'+ tabmois[mois] +'.jpg" target="_blank">'+
		'<img src="images/Divers/Cal/SIRAP-'+ tabmois[mois] +'-p.jpg" alt="Clic-droit puis Enregistrer la cible sous ..." border="0">'+
		'</td></tr></table>');			
	//}	
}


function writeWallPaper2008()
{
	/*
	var tabmois = new Array("Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre");
	today = new Date;
	mois = today.getMonth();
	year = today.getYear();*/
	
	document.write('<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">'+
        '<tr><td valign="top" class="header-beige">T&eacute;l&eacute;chargement</td></tr><tr><td>&nbsp;</td></tr>'+
        '<tr><td>&nbsp;</td></tr>'+
        '<tr><td>'+
		'<a href="images/Divers/Cal/2008/SIRAP-2008.jpg" target="_blank">'+
		'<img src="images/Divers/Cal/2008/SIRAP-2008-p.jpg" alt="Clic-droit puis Enregistrer la cible sous ..." border="0">'+
		'</td></tr></table>');			
}

/*function writeLayers717()
{
	document.write('<div id="LayerSortie717" style="position:absolute; width:380px; height:240px; z-index:1; left: 50px; top: 80px; visibility: hidden; overflow: visible;">'
					+'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
					+'<tr><td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
					+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="380"'
					+'height="228" title="Editop 7.17">'
					+'<param name="movie" value="images/nav/717.swf">'
					+'<param name="quality" value="high">'
					+' <embed src="images/nav/717.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"'
					+'type="application/x-shockwave-flash" width="380" height="228"></embed></object></td>'
					+'<td valign="top"><img src="images/nav/FormCloseOn.gif" alt="Fermer" width="16" height="16" align="top"'
					+'onClick="MM_showHideLayers("LayerSortie717","","hide")"></td></tr></table></div>'
					+'<div id="Layerlogo717" style="position:absolute; width:150; height:120; z-index:1; left: 0px; top: 0px;>'
					+'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
    				+'<tr><td><img src="images/nav/logo717.png"></td></tr></table></div>');			
}*/

function writeLayers718()
{
	document.write('<div id="Layerlogo717" style="position:absolute; width:150; height:120; z-index:1; left: 0px; top: 0px;>'
					+'<table width="100%" border="0" cellpadding="0" cellspacing="0">'
    				+'<tr><td><img src="images/nav/logo718.gif"></td></tr></table></div>');			
}

function pop()
{
    var myAs = document.getElementsByTagName('a');
    for (var a = 0; a < myAs.length; ++a) {
				// Si le lien a une classe de type pop
        if (myAs[a].className == 'pop') {
						// on extrait l'id de la popup à partir du href
            var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));
						// si la popup existe on l'affiche (display block)
            if (pop) {       
                pop.style.display = 'none';
                myAs[a].onclick = function() {
                    thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
                    thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';
                    return false;
                };
								// on efface la popup en cliquant dessus
                pop.onclick = function()
                {
                    this.style.display = 'none';
                };
            }
        }
    }
}



/**
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
}
 

/*

Script Voeux


<script language="JavaScript" type="text/JavaScript">
<!-- 
//writeLayerVoeux();
-->
</script>

<script language="JavaScript" type="text/JavaScript">

Maintenant = new Date;
TempMaintenant = Maintenant.getTime();
noel = new Date(2006, 11, 11);
Tempnewnoel = noel.getTime();
newYear = new Date(2006, 11, 28);
TempnewYear = newYear.getTime();

newYear = new Date(2007, 0, 01);
TempnewYear = newYear.getTime();

//newyear = new Date(2007, 0, 01);
//Tempyear = newyear.getTime();
stopshow = new Date(2007, 1, 01);
Tempstopshow = stopshow.getTime();
stopSplash = new Date(2007, 0, 15);
TempstopSplash = stopSplash.getTime();

//affichage des logo de fin d'année

if(TempMaintenant > Tempnewnoel && TempMaintenant < Tempstopshow)
{
	if(TempMaintenant < TempnewYear)
	{
		document.write('<td width="128"><div id="Layerv" style="position:absolute; width:115px; height:100px; z-index:1; left: 0; top: 92;"><img src="images/sirap/Sirap-voeux.gif"></div><div id="Layer1" style="position:absolute; width:174px; height:107px; z-index:1; left: 0; top: 0;"><img src="images/nav/logo-fêtes.gif" width="174" height="111"></div></td>')
	}
	else if (TempMaintenant > TempnewYear)
	{
		document.write('<td width="128"><div id="Layerv" style="position:absolute; width:115px; height:100px; z-index:1; left: 0; top: 92;"><img src="images/sirap/Sirap-voeux.gif"></div><div id="Layer1" style="position:absolute; width:174px; height:107px; z-index:1; left: 0; top: 0;"><img src="images/nav/logo-voeux.gif" width="174" height="111"></div></td>')
		
		if(TempMaintenant > TempnewYear && TempMaintenant < TempstopSplash) 
		{
			rebours(2);
			rebours(5);
		}
	}
}
else 
{
	document.write('<td width="128">&nbsp;<div id="Layer1" style="position:absolute; width:110px; height:58px; z-index:1; left: 2; top: 92;"><img src="images/sirap/sig.gif"></div></td>')
}
 </script>
 



 //Si pas scrip voeux ->
 
 <script language="JavaScript" type="text/JavaScript">

document.write('<td width="128">&nbsp;<div id="Layer1" style="position:absolute; width:110px; height:58px; z-index:1; left: 2; top: 92;"><img src="images/sirap/sig.gif"></div></td>')

</script>
 
 
 
 
 
 
Script Voeux 7.18
 
 <script language="JavaScript" type="text/JavaScript">

var ns4 = document.layers
var ie4 = document.all
var ns6ie5 = document.getElementById&&!document.all

var show = 0;
var movebyl = 10;
var movebyr = 10;

function moveRight()
{
	var left;
	
 	if(ie4)
	{
		eval("LayerSortie718").style.left = parseInt(eval("LayerSortie718").style.left) + movebyr;	
		left = parseInt(eval("LayerSortie718").style.left);
	}		
	
	else if(ns4)
	{
		document.eval("LayerSortie718").left = parseInt(document.eval("LayerSortie718").left) + movebyr;
		left = parseInt(document.eval("LayerSortie718").left);
	}
	else if(ns6ie5) 
	{
		document.getElementById("LayerSortie718").style.left = parseInt(document.getElementById("LayerSortie718").style.left) + movebyr;  
		left = parseInt(document.getElementById("LayerSortie718").style.left);
	}
	if (left < 133)
	{
		setTimeout('moveRight()', 5); 
	}
}

function moveLeft()
{
	var left;
	var moveby = 5;
	
 	if(ie4)
	{
		eval("LayerSortie718").style.left = parseInt(eval("LayerSortie718").style.left) - movebyl;	
		left = parseInt(eval("LayerSortie718").style.left);
	}		
	
	else if(ns4)
	{
		document.eval("LayerSortie718").left = parseInt(document.eval("LayerSortie718").left) - movebyl;
		left = parseInt(document.eval("LayerSortie718").left);
	}
	else if(ns6ie5) 
	{
		document.getElementById("LayerSortie718").style.left = parseInt(document.getElementById("LayerSortie718").style.left) - movebyl;
		left = parseInt(document.getElementById("LayerSortie718").style.left);
	}
	if (left > -400)
	{
		setTimeout('moveLeft()', 5); 
	}
	else
	{
		if(ie4)
		{
			eval("LayerSortie718").style.visibility ='hidden';
		}		
		
		else if(ns4)
		{
			document.eval("LayerSortie718").visibility = 'hidden';
		}
		else if(ns6ie5) 
		{
			document.getElementById("LayerSortie718").style.visibility = 'hidden';
		}
	}
}

function Affiche_Cache(nObjet) 
{
	 if(ie4)
	 { // Internet explorer
		
			if (eval(nObjet).id == "LayerSortie718")
			{
				//alert("- LayerSortie717 -");
				//alert(eval(nObjet).style.visibility);
				
				if (eval(nObjet).style.visibility == 'hidden' && show == 0)
				{
					eval(nObjet).style.visibility = 'visible';
					setTimeout('moveRight()',5);
					show = 1;
				} 
				else
				{
					setTimeout('moveLeft()',5);
				}		
			}
			else
			{
				eval(nObjet).visibility = (eval(nObjet).visibility=='visible'?'hidden':'visible');
			}
	 }
	 
	 else if(ns4)
	 { // Netscape 4.x
	 
			if (document.eval(nObjet).id == "LayerSortie718")
			{
				if (document.eval(nObjet).visibility == 'hidden' && show == 0)
				{
					document.eval(nObjet).visibility = 'visible';				
					setTimeout('moveRight()',5);
					show = 1;
				} 
				else
				{
					document.eval(nObjet).visibility = 'hidden';
				}
			} 
			else
			{
				document.eval(nObjet).visibility =  (document.eval(nObjet).visibility=='show'?'hidden':'show');
			}
	 }
	 
	 else if(ns6ie5) 
	 { // Netscape 6 (mozilla)
	 
		if (document.getElementById)
		{
			if (document.getElementById(nObjet).id == "LayerSortie718")
			{
				if (document.getElementById(nObjet).style.visibility == 'hidden' && show == 0)
				{
					document.getElementById(nObjet).style.visibility = 'visible';
					setTimeout('moveRight()',5);
					show = 1;
				} 
				else
				{
					document.getElementById(nObjet).style.visibility = 'hidden';
				}
			} 
			else
			{
				document.getElementById(nObjet).style.visibility = (document.getElementById(nObjet).style.visibility =='visible'?'hidden':'visible');
			}
		}
	 } 
} 
 
 
 
 </script>
 
 

 
 
 <script language="JavaScript" type="text/JavaScript">

Maintenant = new Date;
TempMaintenant = Maintenant.getTime();
sortie718 = new Date(2007, 3, 10);
Tempnew718 = sortie718.getTime();
//newYear = new Date(2006, 11, 28);
//TempnewYear = newYear.getTime();

//newYear = new Date(2007, 0, 01);
//TempnewYear = newYear.getTime();

//newyear = new Date(2007, 0, 01);
//Tempyear = newyear.getTime();
stopshow = new Date(2007, 4, 20);
Tempstopshow = stopshow.getTime();

//Sortie 717

if(TempMaintenant > Tempnew718 && TempMaintenant < Tempstopshow)
{	
	writeLayers718();
	rebours718(2);
	rebours718(35);
}

</script>
 
 
*/