
pa0 = new Image(); pa0.src = RACINE + "pics/bt_pelagos_0.gif";
pa1 = new Image(); pa1.src = RACINE + "pics/bt_pelagos_1.gif";
pb0 = new Image(); pb0.src = RACINE + "pics/bt_botanique_0.gif";
pb1 = new Image(); pb1.src = RACINE + "pics/bt_botanique_1.gif";
pc0 = new Image(); pc0.src = RACINE + "pics/bt_documentation_0.gif";
pc1 = new Image(); pc1.src = RACINE + "pics/bt_documentation_1.gif";
pd0 = new Image(); pd0.src = RACINE + "pics/bt_bonus_0.gif";
pd1 = new Image(); pd1.src = RACINE + "pics/bt_bonus_1.gif";
pe0 = new Image(); pe0.src = RACINE + "pics/bt_partenaires_0.gif";
pe1 = new Image(); pe1.src = RACINE + "pics/bt_partenaires_1.gif";
pf0 = new Image(); pf0.src = RACINE + "pics/bt_contact_0.gif";
pf1 = new Image(); pf1.src = RACINE + "pics/bt_contact_1.gif";

b00 = new Image(); b00.src = RACINE + "pics/bt_actualites_0.gif";
b01 = new Image(); b01.src = RACINE + "pics/bt_actualites_0b.gif";
b10 = new Image(); b10.src = RACINE + "pics/bt_visite_0.gif";
b11 = new Image(); b11.src = RACINE + "pics/bt_visite_0b.gif";
b20 = new Image(); b20.src = RACINE + "pics/bt_securite_0.gif";
b21 = new Image(); b21.src = RACINE + "pics/bt_securite_0b.gif";
b30 = new Image(); b30.src = RACINE + "pics/bt_marcher_0.gif";
b31 = new Image(); b31.src = RACINE + "pics/bt_marcher_0b.gif";
b40 = new Image(); b40.src = RACINE + "pics/bt_patrimoine_0.gif";
b41 = new Image(); b41.src = RACINE + "pics/bt_patrimoine_0b.gif";
b50 = new Image(); b50.src = RACINE + "pics/bt_histoire_0.gif";
b51 = new Image(); b51.src = RACINE + "pics/bt_histoire_0b.gif";


function update_params(obj){
	var url = self.document.location.href +'';
	id = obj.options[obj.selectedIndex].value;
	url = BuildUrl(url, obj.name, id);
	self.document.location.href = url;
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*
Redirige vers la page triée par [champ] dans l'ordre courant 
Ordre Inverse si ce champ etait deja l'objet du tri 
*/

// Retourne l'url [Qstr] en attribuant [val] à [champ]
function BuildUrl(Qstr, champ, val){
	if(typeof(param = GetVal(champ, Qstr)) != 'boolean'){
		return Qstr.replace(champ+'='+param, champ+'='+val);
	}
	else{
		var sep = '?';

		if(Qstr.indexOf(sep) == Qstr.length-1){
			sep = '';
		}

		if(Qstr.indexOf(sep)>-1 && sep != ''){
			sep = '&';
		}
	return Qstr+=sep+champ+'='+val;
	}
}


/*
Retourne la valeur de [val] passé en GET
False si la variable n'existe pas
*/
function GetVal(val){
	args = GetVal.arguments;
	if(args.length > 1){
		var Turl = args[1];
	}
	else{
		var Turl = window.location+'';
	}
	var deb = Turl.indexOf('&'+val+'=');
	if(deb == -1){
		var deb = Turl.indexOf('?'+val+'=');
	}


	var fin = 0;
	if(deb > -1)	{
		var sub1 = Turl.substring(deb+1,Turl.length+1)
		fin	 = sub1.indexOf('&');
		if (fin == -1)	fin = sub1.length+1;
		sub2 = sub1.substring(0,fin)
		return sub2.replace(val+'=','');
	}
	else {
		return false;
	}
}

function rov(obj, val){
	act = (val == 1)? 0 : 1;
	var img = MM_findObj('img_'+ obj.id);
	img.src = img.src.replace(act, val);
}


function selnav(obj){
	var url = self.document.location.href + '';
	var th = obj.options[obj.selectedIndex].value;


	if(th == 1){ url = 'terre.asp';}
	if(th == 2){url = 'mer.asp';}

	url = BuildUrl(url, 'th', th);

	self.document.location.href = url;
}




function submit_telech(){
	if(document.forms[0].ct_societe.value == '' || document.forms[0].ct_adresse.value == '' || document.forms[0].ct_cp.value == '' || document.forms[0].ct_ville.value == ''){
		alert('Veuillez remplir tous les champs');
	}
	else{
		document.forms[0].submit();
	}
}


function change_annee_ao(oSel){
	var annee = oSel.options[oSel.selectedIndex].value;
	var url = self.document.location.href + '';
	url = BuildUrl(url, 'annee', annee);
	self.document.location.href = url;
	return false;
}

