<!--
// vérifier un mail
function verifMail(a) {
	testm = false ;
	if ( (a.length > 5) && (a.length < 255) ) {
		for (var j=1 ; j<(a.length) ; j++) {
			if (a.charAt(j)=='@') {
				if (j<(a.length-4)){
					for (var k=j ; k<(a.length-2) ; k++) {
						if (a.charAt(k)=='.') testm = true;
					}
				}
			}
		}
	}
	return testm ;
}
function checkNewsletter(){
	var tmprep = '';
	if (document.formnews.civilite.value == '0')
		tmprep += '\n- Civilité';
	if (document.formnews.nom.value == '')
		tmprep += '\n- Nom';
	if (document.formnews.prenom.value == '')
		tmprep += '\n- Prénom';
	if (document.formnews.organisme.value == '')
		tmprep += '\n- Organisme';
	if (document.formnews.email.value == '' || verifMail(document.formnews.email.value) == false)
		tmprep += '\n- Email';
	if (tmprep != ''){
		message = 'Veuillez compléter ces infos svp :'+tmprep;
		alert(message);
	} else {
		// inscription
		document.formcheckmail.mailcheck.value = document.formnews.email.value;
		document.formcheckmail.submit();
	}
}
function checkDesabonnement(){
	var tmprep = '';
	if (document.formnews.emaildes.value == '' || verifMail(document.formnews.emaildes.value) == false)
		tmprep += '\n- Email';
	if (tmprep != ''){
		message = 'Votre email n\'est pas bon';
		alert(message);
	} else {
		// inscription
		document.formnews.action.value = "delete";
		document.formnews.submit();
	}
}
/** Basculer l'état de visibilité d'un élément

* Note état initial : caché

* @param id string 

*/

function toggle_visibility(id) 

{
	var e=document.getElementById(id).style;
	if((e.display=='none') || (e.display=='')) 

		e.display='block';

	 else 

		e.display='none';

}
function toggle_mediatheque(id,nb,diapo) 

{
	if(diapo != "diapo"){
		for(var i=1;i<=nb;i++){
			var e=document.getElementById("masquer"+id+"_"+i).style;
			if((e.display=='none') || (e.display=='')) {
		
				e.display='block';
			}else{ 
		
				e.display='none';
			}
		}
	}else{
		
		var tab = nb.split("-");
		for(var i=1;i<tab.length;i++){
			var tmp = "masquer"+id+"_"+(Number(tab[i])+1);
			var e=document.getElementById(tmp).style;
			if((e.display=='none') || (e.display=='')) {
		
				e.display='block';
			}else{ 
		
				e.display='none';
			}
		}
		var e=document.getElementById("masquer"+id+"_diapo").style;
			if((e.display=='none') || (e.display=='')) {
		
				e.display='block';
			}else{ 
		
				e.display='none';
			}
	}

}
function rollPart(id){
	var tmp = "";		
	tmp += "<table cellpading=0 cellspacing=10 border=0><tr>";
	switch(id){
		case 1:
			tmp += "";
		break;
		case 2:
			tmp += "<td><img src='../ressources/img/logos/npdc.gif'></td>";
			tmp += "<td>Conseil Régional du Nord-Pas de Calais<br>Hôtel de Région<br>Centre Rihour<br>59555 LILLE cedex<br><a href='http://www.nordpasdecalais.fr' target='_blank'>www.nordpasdecalais.fr</a><br>03.28.82.82.82</td>";
		break;
		case 3:
			tmp += "<td><img src='../ressources/img/logos/picardie.gif'></td>";
			tmp += "<td>Conseil Régional de Picardie<br>1, mail Albert 1er<br>80000 AMIENS<br><a href='http://www.cr-picardie.fr' target='_blank'>www.cr-picardie.fr</a><br>03.22.97.37.37</td>";
		break;
		case 4:
			tmp += "<td><img src='../ressources/img/logos/cg59.gif'></td>";
			tmp += "<td>Conseil Général du Nord<br>Hôtel du Département<br>51, rue Gustave Delory<br>59000 LILLE<br><a href='http://www.cg59.fr' target='_blank'>www.cg59.fr</a><br>03.28.82.82.82</td>";
		break;
		case 5:
			tmp += "<td><img src='../ressources/img/logos/cg62.gif'></td>";
			tmp += "<td>Conseil Général du Pas de Calais<br>Hôtel du Département<br>Rue Ferdinand Buisson<br>62000 ARRAS<br><a href='http://www.cg62.fr' target='_blank'>www.cg62.fr</a><br>03.21.21.62.62</td>";
		break;
		case 6:
			tmp += "<td><img src='../ressources/img/logos/dunkerque.gif'></td>";
			tmp += "<td>Communauté Urbaine de<br> « Dunkerque Grand Littoral »<br>Hôtel Communautaire Pertuis de la Marine<br>BP 5530<br>59386 DUNKERQUE<br><a href='http://www.communaute-urbaine-dunkerque.fr' target='_blank'>www.communaute-urbaine-dunkerque.fr</a><br>03.28.62.70.00</td>";
		break;
		case 7:
			tmp += "<td><img src='../ressources/img/logos/lillemetropole.jpg'></td>";
			tmp += "<td>Communauté Urbaine de<br>« Lille Métropole Communauté Urbaine »<br>1, rue du ballon<br>BP 749<br>59034 LILLE Cedex<br><a href='http://www.cudl-lille.fr' target='_blank'>www.cudl-lille.fr</a><br>03.20.21.20.00</td>";
		break;
		case 8:
			tmp += "<td><img src='../ressources/img/logos/amiens.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de Amiens Métropole<br>Hôtel de Ville<br>BP 2720<br>80000 AMIENS<br><a href='http://www.amiens.fr' target='_blank'>www.amiens.fr</a><br>03.22.97.40.40</td>";
		break;
		case 9:
			tmp += "<td><img src='../ressources/img/logos/artois.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de Artois Comm<br>Hôtel Communautaire<br>100, avenue de Londres<br>BP 548<br>62411 BETHUNE cedex<br><a href='http://www.artoiscomm.fr' target='_blank'>www.artoiscomm.fr</a><br>03.21.61.50.00</td>";
		break;
		case 10:
			tmp += "<td><img src='../ressources/img/logos/douaisis.gif'></td>";
			tmp += "<td>Communauté d’Agglomération<br>du Douaisis<br>Hôtel Communautaire<br>746, rue Jean Perrin<br>BP 300<br>59500 DOUAI<br><a href='http://www.douaisis-agglo.fr' target='_blank'>www.douaisis-agglo.fr</a><br>03.27.99.89.89</td>";
		break;
		case 11:
			tmp += "<td><img src='../ressources/img/logos/henin.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de Hénin-Carvin<br>Hôtel Communautaire<br>242, Bd Schweitzer<br>BP 129<br>62253 HENIN BEAUMONT<br><a href='http://www.agglo-henincarvin.fr' target='_blank'>www.agglo-henincarvin.fr</a><br>03.21.79.13.79</td>";
		break;
		case 12:
			tmp += "<td><img src='../ressources/img/logos/lievin.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de Lens-Liévin<br>Hôtel Communautaire<br>21, rue Marcel Sembat<br>BP 65<br>62300 LENS cedex<br><a href='http://www.agglo-lenslievin.fr' target='_blank'>www.agglo-lenslievin.fr</a><br>03.21.79.07.90</td>";
		break;
		case 13:
			tmp += "<td><img src='../ressources/img/logos/maubeuge.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de<br>Maubeuge Val de Sambre<br>Hôtel Communautaire<br>1, place du Pavillon<br>BP 234<br>59603 MAUBEUGE cedex<br><a href='http://www.amvs.fr' target='_blank'>www.amvs.fr</a><br>03.27.53.01.00</td>";
		break;
		case 14:
			tmp += "<td><img src='../ressources/img/logos/hainaut.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de<br>la Porte du Hainaut<br>Hôtel Communautaire<br>Site minier de Wallers-Aremberg<br>Rue Michel Rondet<br>59135 WALLERS<br><a href='http://www.agglo-porteduhainaut.fr' target='_blank'>www.agglo-porteduhainaut.fr</a><br>03.27.09.05.05</td>";
		break;
		case 15:
			tmp += "<td><img src='../ressources/img/logos/compiegne.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de<br>la Région de Compiègne<br>Place de l'Hotel de Ville<br>BP 10007<br>60321 COMPIEGNE cedex<br><a href='http://www.agglo-compiegne.fr' target='_blank'>www.agglo-compiegne.fr</a><br>03.44.40.76.00</td>";
		break;
		case 16:
			tmp += "<td><img src='../ressources/img/logos/valenciennes.gif'></td>";
			tmp += "<td>Communauté d’Agglomération de<br>Valenciennes Métropole<br>Hôtel Communautaire<br>17, avenue d'Amsterdam<br>59300 VALENCIENNES<br><a href='http://www.valenciennes-metropole.fr' target='_blank'>www.valenciennes-metropole.fr</a><br>03.27.20.02.00</td>";
		break;
		default:
			tmp = "Cliquez sur les partenaires pour de plus amples informations";
		break;
		tmp += "</tr></table>";
	}
	document.getElementById("rollPartenaires").innerHTML = tmp;
}
var mafenetre;
function launchwin(winurl,winname,winWidth,winHeight)
	{
	var ns4 = (document.layers)? true:false;			//NS 4
	var ie4 = (document.all)? true:false;			//IE 4
	var dom = (document.getElementById)? true:false;	//DOM
	var xMax, yMax, xOffset, yOffset;

	if (ie4 || dom)
		{
		xMax = screen.width;
		yMax = screen.height;
		}
	else if (ns4)
		{
		xMax = window.outerWidth;
		yMax = window.outerHeight;
		}
	else
		{
		xMax = 800;
		yMax = 600;
		}
	xOffset = (xMax - winWidth)/2;
	yOffset = (yMax - winHeight)/2;
	mafenetre = window.open(winurl,winname,'width='+winWidth+',height='+winHeight+',screenX='+xOffset+',screenY='+yOffset
+',top='+yOffset+',left='+xOffset+',menubar=no,scrollbars=no,resizable=no,status=no,toolbar=no');
setTimeout('mafenetre.focus();',250);
}
function putMyFlash(themovie, largeur, hauteur, quality,  bgcolor, menu, alignement, noembed,version,allow,wmode) {
	var addToFlash = '';
	//alert(arguments.length);
	if (arguments.length > 11) {
		// il y a des arguments à passer au flash
		for (i=11; i<arguments.length; i+=2) {
			addToFlash += arguments[i] +"="+arguments[i+1]+"&";
		}
		//
		themovie += "?"+addToFlash;
		
	} 
	//alert(themovie);
	var tmpflash = '';
	tmpflash += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+largeur+'" height="'+hauteur+'" align="'+alignement+'">';
	tmpflash += '<param name="movie" 	value="'+themovie+'">';
	tmpflash += '<param name="quality" 	value="'+quality+'">';
	tmpflash += '<param name="bgcolor" 	value="'+bgcolor+'">';
	tmpflash += '<param name="menu" 	value="'+menu+'">';
	tmpflash += '<param name="allowScriptAccess" 	value="'+allow+'">';
	tmpflash += '<param name="wmode" 	value="'+wmode+'">';
	tmpflash += '<embed src="'+themovie+'" width="'+largeur+'" height="'+hauteur+'" align="'+alignement+'" quality="'+quality+'" scale="noscale" menu="'+menu+'" allowScriptAcess="'+allow+'" wmode="'+wmode+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
	tmpflash += '<noembed>'+noembed+'</noembed>';
	tmpflash += '</object>';
	//return tmpflash;
	document.write(tmpflash);
}

var fenpopsimple;
function popupSimple(url,nom,feat) {
	fenpopsimple = window.open(url,nom,feat);
}

function openImg(id,w,h){
	var params = "toolbar=no,menubar=no,width="+w+",height="+h+",left=" + ((screen.width - w)/2) + ",top=" + ((screen.height - h)/2);
	window.open("fr-image.php?id="+id,"doc",params);
}
//-->