// JavaScript Document
function affiche_email(texte,nom,prestataire)
{
var tg="<";
var arob="@";
if(texte=='') { texte=nom; texte+=arob; texte+=prestataire; }
document.write(tg+"a hr"+"ef=\"mai"+"lto:"+nom);
document.write(arob+prestataire+"?subject=Contact provenant du site de l'IPAMAC\" onclick=\"javascript: pageTracker._trackPageview ('/sortant_mail/"+nom+arob+prestataire+"');\">"+texte+tg+"/a><br />");
}

function js2swf(nomVar,Var){
  window.document.myFlash.SetVariable(nomVar,Var);
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
  navigator.userAgent.indexOf("Windows") 
!= -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub myFlash_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call myFlash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
} 

function viewCouche(lg,parc) {
	var couches="";
	for (i=0; i<document.carto_couches.couche.length; i++) {
		if (document.carto_couches.couche[i].checked) {
			if(i) couches+=";";
			couches+=document.carto_couches.couche[i].value;
		}
		else {
			if(i) couches+=";";
		}
	}
	if(couches!="") {
		ajax("js2swf(\'jsMajCouches\',\'swf/couche.php?id_couche=xhr\')","swf/couches.php?parc="+parc+"&couches="+couches);
	}
}

function ajax(fct,file) {
	var xhr=null;
	if (window.XMLHttpRequest) xhr=new XMLHttpRequest();
	else if (window.ActiveXObject) xhr=new ActiveXObject("Microsoft.XMLHTTP");
	xhr.onreadystatechange=function() {
		if(xhr.readyState==1 && file.substr(0,3)!='swf') eval(fct.replace('xhr','Chargement en cours...'));
		else if(xhr.readyState==4) eval(fct.replace('xhr',xhr.responseText));
	};
	xhr.open("GET",file,true);
	xhr.send(null);
}

function inner(id,txt) {
	document.getElementById(id).innerHTML=txt;
}

function monCarnet(id,lg,action,url) {
	ajax('inner(\'carnetderoute\',\'xhr\');','include/moncarnet.php?lg='+lg+'&id_objet='+id+'&'+action+'&url='+url+'&ajax');
}

function chargerPoints(lg,id_carto) {
	js2swf('jsMajPoints','swf/carto.php?lg='+lg+'&id_carto='+id_carto);
}