<!--
var myHeight = 0;
var myidsec = 0;
var myrootnav = 0;
var centerMethod = 2; // 1: automatic/onresize   2: static/onreload

function getGoodHeight() {
	myHeight = 0;
	if( document.documentElement && document.documentElement.clientHeight ) {
	  myHeight = document.documentElement.clientHeight;
	} else if( document.body && document.body.clientHeight ) {
	  myHeight = document.body.clientHeight;
	}
	myHeight = myHeight-605; myHeight = myHeight/2;
}

function doVerticalCenter() {
	if (centerMethod==1) {
		getGoodHeight();
		document.getElementById('mainContent').style.top=myHeight+'px';
	}
}

function init_ld() {
	if (centerMethod==1) {
		document.getElementById('mainContent').style.top='0px';
	}
}

function flashMediaElt(swf_path, swf_width, swf_height, is_transparent) {
	document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" WIDTH=\""+swf_width+"\" HEIGHT=\""+swf_height+"\" id=\"flashMedia\">\n");
	document.write("\t<PARAM NAME=\"movie\" VALUE=\""+swf_path+"\">\n");
	document.write("\t<PARAM NAME=\"menu\" VALUE=\"false\">\n");
	document.write("\t<PARAM NAME=\"quality\" VALUE=\"high\">\n");
	if (is_transparent == 1) { document.write("\t<PARAM NAME=\"wmode\" VALUE=\"transparent\">\n"); }
	document.write("\t<EMBED src=\""+swf_path+"\" menu=\"false\" quality=\"high\" ");
	if (is_transparent == 1) { document.write(" wmode=\"transparent\" "); }
	document.write("WIDTH=\""+swf_width+"\" HEIGHT=\""+swf_height+"\" NAME=\"flashMedia\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>\n");
	document.write("</OBJECT>\n");
}

function do_scrollLogo(p) {
	flashMediaElt('css_swf/logo_animbd2b.swf?param='+p,420,45,1);
}

function doPopup(targetURL,w,h,wname,sb) {
	var options = 'top=100,left=100,screenX=100,screenY=100,width='+w+',height='+h+',location=no,toolbar=no,directory=no,copyhistory=no,resizable=no,scrollbars='+sb;
	popLinkWin = window.open(targetURL,wname,options);
	popLinkWin.focus();
	return popLinkWin;
}

function enableItems(id_start) {
	if (document.getElementById) {
		if (document.getElementById('m'+id_start)) {
			document.getElementById('m'+id_start).className='mON';
			if (document.getElementById('m'+id_start).parentNode) {
				if (document.getElementById('m'+id_start).parentNode.className=='sm') {
					document.getElementById('m'+id_start).parentNode.style.display='block';
					var num = document.getElementById('m'+id_start).parentNode.id.substr(5);
					if (document.getElementById('m'+num)) {
						document.getElementById('m'+num).className='mON';
					}
				}
			}
			if (document.getElementById('smenu'+id_start)) {
				document.getElementById('smenu'+id_start).style.display='block';
			}
		}
	}
}

function r_show_rollover(idSection) {
	if (document.getElementById('vRollOver')) {
		document.getElementById('vRollOver').innerHTML = '<img src="/css_img/'+parseInt(idSection)+'/v_btn.gif" border="0" alt="" />';
		// hardcoded left positions according to all /css_img/*/local.css files
		var lpos = 0;
		if (parseInt(idSection) == 2) { lpos = 129; }			// QUI SOMMES NOUS
		if (parseInt(idSection) == 3) { lpos = 301; }			// NOTRE ACTUALITE
		if (parseInt(idSection) == 4) { lpos = 443; }			// NOS MISSIONS
		if (parseInt(idSection) == 12) { lpos = 573; }		// JE SOUTIENS LES SAUVETEURS EN MER
		if (parseInt(idSection) == 13) { lpos = 839; }		// ENTREPRISES
		if (lpos>0) {
			document.getElementById('vRollOver').style.left=lpos+'px';
			document.getElementById('vRollOver').style.display='block';
		} else {
			hide_rollover();
		}
	}
}

function r_hide_rollover() {
	if (document.getElementById('vRollOver')) {
		document.getElementById('vRollOver').style.display='none';
		document.getElementById('vRollOver').style.left='0px';
		document.getElementById('vRollOver').innerHTML = '';
	}
}

function show_rollover(idSection) { // hack for MSIE not refreshing correctly
	if (navigator.userAgent.indexOf("MSIE")!=-1) {
		setTimeout("r_show_rollover("+idSection+")",0);
	} else {
		r_show_rollover(idSection);
	}
}
function hide_rollover() { // hack for MSIE not refreshing correctly
	if (navigator.userAgent.indexOf("MSIE")!=-1) {
		setTimeout("r_hide_rollover()",0);
	} else {
		r_hide_rollover();
	}
}


function r_mod_imgsrc(imgID,newSRC) {
	document.getElementById(imgID).src = newSRC;
}

function mod_imgsrc(imgID,newSRC) { // hack for MSIE not refreshing correctly
	if (navigator.userAgent.indexOf("MSIE")!=-1) {
		setTimeout("r_mod_imgsrc('"+imgID+"','"+newSRC+"')",0);
	} else {
		r_mod_imgsrc(imgID,newSRC);
	}
}


function adherer() {
	location.href='snsm_adhf87f.html?f=PARTICULIERS';
}

function contact() {
	doPopup('snsm_contact.html',657,550,'CONTACT','no');
}

function contact_direct(id_contact) {
	doPopup('snsm_contact37cf.html?da='+parseInt(id_contact),657,550,'CONTACT','no');
}

function chiffres_cle() {
	doPopup('lit_page8ddf.html?id=45',657,550,'CHIFFRES_CLES','no');
}

function english_version() {
	doPopup('lit_page1fc1.html?id=46',657,550,'ENGLISH','no');
}

function mot_du_president() {
	doPopup('directrice.php',657,550,'DIRECTRICE','no');
}

function eq_showitem(pageID) {
	var da_HTML = '';
	if (document.getElementById('e'+pageID).innerHTML && document.getElementById('a'+pageID).innerHTML) {
		da_HTML = '<font class="boxtitre">'+document.getElementById('e'+pageID).innerHTML+'</font><br />\n';
		da_HTML = da_HTML+document.getElementById('a'+pageID).innerHTML;
	}
	document.getElementById('zoneaccroche').innerHTML = da_HTML;
}

function mentions_legales() {
	doPopup('mention_legales.php',657,550,'MENTIONSLEGALES','no');
}

var picto="";
var imgwin;
function ImageZoom(picture,opt_legend){
	if (opt_legend == null) { opt_legend = '<!-- (c) Copyright 2008 - SNSM //-->'; }
	picto = picture;
	var wi=200;
	var hi=200;
	var titre="Zoom";
	var stats="toolbar=no,location=no,directories=no,status=no,menubar=no," ;
	stats += "resizable=yes,width=" + wi + ",height="+hi ;
	imgwin = window.open ("",titre,stats);
	window.setTimeout("makepage(\""+picto+"\",\""+opt_legend+"\")",100) ;
}

function makepage(pic,o_legend){
	var espaceW=0;
	var espaceH=52;
	imgwin.document.clear();
	imgwin.document.write("<html>\n");
	imgwin.document.write("<head><title>SNSM :: Zoom</title>\n");
	imgwin.document.write("<s"+"cript language='Java"+"Script' type='text/java"+"script'>\n");
	imgwin.document.write("<!--\n");
	imgwin.document.write("function resizeme() {\n");
	imgwin.document.write("\tvar picheight=document.images['posterpic'].height;\n");
	imgwin.document.write("\tvar picwidth=document.images['posterpic'].width;\n");
	imgwin.document.write("\tthis.window.resizeTo(picwidth+"+parseInt(espaceW)+",picheight+"+parseInt(espaceH+30)+");\n");
	imgwin.document.write("}\n");
	imgwin.document.write("//-->\n");
	imgwin.document.write("<"+"/s"+"cript>\n");
	imgwin.document.write("</head>\n");
	imgwin.document.write("<body style='margin:0;' bgcolor='#000000' text='#ffffff' onload='window.setTimeout(\"resizeme();\",100);'>\n");
	imgwin.document.write("<center>\n");
	imgwin.document.write("<table border=0 cellspacing=0 cellpadding=0><tr><td>\n");
	imgwin.document.write("<a href='javascript:;' title='cliquer pour fermer' onclick='self.close();'>");
	imgwin.document.write("<img name='posterpic' align='absmiddle' src='"+pic+"' border='0' alt='cliquer pour fermer' />");
	imgwin.document.write("</a><br />\n");
	// légende...
	imgwin.document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\"><tr><td style=\"color: #ffffff; font-size: 12px; font-family: arial, helvetica, sans-serif;text-align:center;\">");
	imgwin.document.write(o_legend);
	imgwin.document.write("</td></tr></table>\n");

	imgwin.document.write("</td></tr></table>\n");
	imgwin.document.write("</center>\n");
	imgwin.document.write("</body>\n</html>\n\n");
	imgwin.document.close();
	imgwin.focus();
}

var req = new Object();
var curs = 0; // ID de la station courante
var curd = 0; // NUM du département courant
var nom_dep = ''; var nom_sta = ''; var type_sta = '';
var contenu = ''; var actu_active = 0; var ident_active = 0;
var allowdisabledclinks = 0; // 1: si "actualités" ou "ficher d'identité" n'est pas dispo => lien grisé/inactif
														 // 0: lien toujours actifs (vers page avec texte par défaut si pas de données)


function upd_info_layers() {
	if (req.request.readyState == 4) {
		if (req.request.status == 200) {
			if(req.request.responseText!="") {
				var lignes = req.request.responseText.split("\n");
				for (i=0;i<lignes.length;i++) {
					if (lignes[i].indexOf('@@@') != -1) {
						// premiere ligne, infos standard...
						var infos = lignes[i].split("@@@");
						nom_dep = infos[0];
						curd = parseInt(infos[1]);
						nom_sta = infos[2];
						type_sta = infos[3];
						actu_active = parseInt(infos[4]);
						ident_active = parseInt(infos[5]);
					} else {
						// autres lignes (contenu)
						contenu += lignes[i];
					}
				}
				dc_showwin();
			}
		}
	}
}

function detail_station(nStation) {
	curs = nStation;
	var rnum = Math.floor(Math.random()*1001);
	loadXMLDoc('css_cartes/dc_getInfoa17b.html?rootnav='+myrootnav+'&station='+curs+'&nocache='+rnum,upd_info_layers);
}

function dc_closewin() {
	document.getElementById('zone1').style.visibility='hidden';
	document.getElementById('zone1dcvscroll').innerHTML='&nbsp;';
	document.getElementById('dctitre0').innerHTML='&nbsp;';
	document.getElementById('dcstitre0').innerHTML='&nbsp;';
	document.getElementById('lienactu').innerHTML='&nbsp;';
	document.getElementById('lienident').innerHTML='&nbsp;';
	document.getElementById('zone1').style.display='none';
  nom_dep = ''; nom_sta = ''; type_sta = '';
	contenu = ''; actu_active = 0; ident_active = 0;
	curs = 0; curd = 0; nom_dep = ''; contenu = '';
}

function dc_showwin() {
	document.getElementById('zone1').style.display='block';
	document.getElementById('zone1').style.visibility='hidden';
	document.getElementById('zone1dcvscroll').innerHTML=contenu;
	document.getElementById('dctitre0').innerHTML=nom_dep;
	document.getElementById('dcstitre0').innerHTML=nom_sta+' - '+type_sta;
	if (actu_active==1 || allowdisabledclinks==0) {
		document.getElementById('lienactu').innerHTML='<a href="javascript:dc_actu_switchto();" title="Actualit&eacute;s">ACTUALIT&Eacute;S</a>';
	} else {
		document.getElementById('lienactu').innerHTML='ACTUALIT&Eacute;S';
	}
	if (ident_active==1 || allowdisabledclinks==0) {
		document.getElementById('lienident').innerHTML='<a href="javascript:dc_ident_switchto();" title="Fiche d\'Identit&eacute;">FICHE&nbsp;D\'IDENTIT&Eacute;</a>';
	} else {
		document.getElementById('lienident').innerHTML='FICHE&nbsp;D\'IDENTIT&Eacute;';
	}
	document.getElementById('zone1').style.visibility='visible';
}

function dc_ident_switchto() {
	var lhref = location.href;
	if (lhref.indexOf("page=37")!=-1) { // on est dans actu
		lhref = 'lit_page4859.html?page=4&amp;id=39&amp;NP=1'; // carte "les stations de sauvetage / carte de localisation"
	}
	var newurl = '';
	if (lhref.indexOf("#")!=-1) { // si on est deja sur une carte dans "identite", on reste sur la meme
		newurl=lhref.split("#")[0]+'#'+parseInt(curs)+'-'+parseInt(curd);
	} else {
		newurl=lhref+'#'+parseInt(curs)+'-'+parseInt(curd);
	}
	location.href = newurl;
}

function dc_actu_switchto() {
	location.href='lit_page89d1.html?page=37&amp;id=19&amp;NP=1#'+parseInt(curs)+'-'+parseInt(curd);
}

function loadXMLDoc(url,procedure) {
  req.request = null;
  if (window.XMLHttpRequest) {
	  // branch for native XMLHttpRequest object
	  req.request = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    // branch for IE/Windows ActiveX version
    try {
      req.request = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
      req.request = null;
    }
    try {
      req.request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      req.request = null;
    }
  }
  if(req.request) {
    req.request.onreadystatechange = procedure;
    req.request.open("GET", url, true);
    req.request.send(null);
    return true;
  } else {
    // Le navigateur ne supporte pas
    alert('Votre navigateur ne supporte pas AJAX !');
    return false;
  }
}

function chkrec(f) {
	var all_ok = true;
	if (f.rec.value=='') { all_ok = false; }
	if (f.rec.value=='mot(s)-clé(s)') { all_ok = false; }
	if (!all_ok) { alert('Merci de remplir le formulaire de recherche convenablement...'); }
	return all_ok;
}

function do_update_actus_div(zeID) {
	var full = document.getElementById("fullactu_"+zeID);
	var somm = document.getElementById("actusomm_"+zeID);
	full.style.display='block'; full.style.visibility='hidden';
	var full_html = full.innerHTML;
	full.style.visibility='visible'; full.style.display='none';
	// on écrit le sommaire avec son lien spécial pour la fenetre pop-up de l'article complet
	var html = '';
	html += '<a href="javascript:;" style="color:#ffffff;" onclick="show_full_actu('+zeID+')">';
	html += full_html.substr(0,300);
	html += '&nbsp;[...]</a><br /></ul>';
	html += '<div><a href="javascript:;" onclick="show_full_actu('+zeID+')"><b>';
	html += 'Lire la suite';
	html += '</b></a></div>\n';
	somm.innerHTML = html;
}

function show_full_actu(zeID) {
	var zePopup = doPopup('actu_detail_blank98c9.html?zeID='+zeID,657,550,'ACTDET'+zeID,'no');
	zePopup.fill_me(zeID);
}

function upd_class_mouse(mode,itm) {
	if (mode=='on') {
		if (itm.className.indexOf("mON")!=-1) {
			itm.className = 'mON sourisover';
		}
		if (itm.className.indexOf("mOFF")!=-1) {
			itm.className = 'mOFF sourisover';
		}
	}
	if (mode=='off') {
		if (itm.className.indexOf("mON")!=-1) {
			itm.className = 'mON';
		}
		if (itm.className.indexOf("mOFF")!=-1) {
			itm.className = 'mOFF';
		}
	}
}

//-->