// (c)DATAPERIF 2010-2011

function menu(lng, idx) {
	p = document.location.href; s = p.lastIndexOf("/"); n = p.slice(s+1);
	document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#3C4C9C"><tr>');
	document.write('<td height="120" width="140" align="center" valign="middle" nowrap><a href="index.htm"><img src="../images/logo_planete.jpg" border="0" height="100" alt="Home"></a></td>');
	document.write('<td width="35" nowrap>&nbsp;</td>');
	document.write('<td width="555" align="left" valign="bottom" nowrap>');
	if (lng == "fr") {
		document.write('<a href="index.htm" class="menu');
		if (idx == 1) document.write('select');
		document.write('">Accueil</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="station.htm" class="menu');
		if (idx == 2) document.write('select');
		document.write('">Télédétection</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="eumetcast.htm" class="menu');
		if (idx == 3) document.write('select');
		document.write('">EUMETCast</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="images.htm" class="menu');
		if (idx == 4) document.write('select');
		document.write('">Images</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="contact.htm" class="menu');
		if (idx == 5) document.write('select');
		document.write('">Contact</a>');
	} else {
		document.write('<a href="index.htm" class="menu');
		if (idx == 1) document.write('select');
		document.write('">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="station.htm" class="menu');
		if (idx == 2) document.write('select');
		document.write('">Remote sensing</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="eumetcast.htm" class="menu');
		if (idx == 3) document.write('select');
		document.write('">EUMETCast</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="images.htm" class="menu');
		if (idx == 4) document.write('select');
		document.write('">Pictures</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		document.write('<a href="contact.htm" class="menu');
		if (idx == 5) document.write('select');
		document.write('">Contact</a>');
	}
	document.write('</td><td align="left" valign="bottom">');
	document.write('<a href="../en/' + n + '"><img src="../images/flag_en.gif" border="0" alt="English"></a>&nbsp;&nbsp;');
	document.write('<a href="../fr/' + n + '"><img src="../images/flag_fr.gif" border="0" alt="Français"></a>');
	document.write('</td></tr></table>');
}

function selectlng()
{
	if (navigator.browserLanguage)
		var language = navigator.browserLanguage;
	else
		var language = navigator.language;
	if (language == "fr")
		window.open("fr/index.htm","_self","","true");
	else
		window.open("en/index.htm","_self","","true");
}

function marque()
{
	page = document.location.href;
	if (page.slice(0,7) == "http://")
	{
		document.write('<table><tr><td height=1000 align=center valign=bottom></td></tr></table>');
		document.write('<a href="http://www.xiti.com/xiti.asp?s=131949" target="_new">');
		try {hsr = top.document.referrer;}
		catch(e) {hsr = document.referrer;}
		s = page.lastIndexOf("/"); p = page.lastIndexOf("."); n = page.slice(s+1,s+2).toUpperCase() + page.slice(s+2,p);
		hsh = new Date();
		hsi = '<img width="80" height="15" border="0" alt="" src="http://logv23.xiti.com/bcg.xiti?s=131949&p=' + n + '&hl=' + hsh.getHours() + 'x' + hsh.getMinutes() + 'x' + hsh.getSeconds();
		if (parseFloat(navigator.appVersion)>=4) {Xiti_s=screen; hsi += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;}
		document.writeln(hsi + '&ref=' + hsr.replace(/[<>]/g, '').replace(/&/g, '$') + '" title="Internet Audience"></a>');
	}
}

