// JavaScript Document

//------------------------------------------Mailto anti-spam-----------------------------------*

var a, s, n;
function Crypt(s) {
	r='';
	for(i=0;i<s.length;i++){
		n=s.charCodeAt(i); 
		if (n>=8364) {
			n = 128;
		} 
		r += String.fromCharCode( n - 3 ); 
	}
	return r;
}
a ="pdlowr=";
m='&#64;';
d=unescape(m);
var nom = "contact";
var domaine = "laseratlantique.org";
var aro = nom + d + domaine;
var add = nom + d + "<br/>" + domaine;
function mail() {
	document.write('<a href='+Crypt(a) + aro + '>');
	document.write(add + '</a>');
}
function mail2() {
	document.write('<a href='+Crypt(a) + aro + '>');
	document.write(aro + '</a>');
}

//-------------------------------------Menu------------------------------------------------------


function showmenu(elmnt) {
	document.getElementById(elmnt).style.visibility="visible"
}
function hidemenu(elmnt) {
	document.getElementById(elmnt).style.visibility="hidden"
}



//-- --------------------------------- Vérification du formulaire ------------------------------

function checkrequired(which){
	var pass=true
	if (document.images){
		for (i=0;i<which.length;i++){
			var tempobj=which.elements[i]
			if (tempobj.name.substring(0,8)=="required"){
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
					pass=false
					break
				}
			}
		}
	}
	if (!pass){
		alert("Un ou plusieurs des éléments n\'ont pas été renseignés.\nVeuillez remplir tous les champs!")
		return false
	}
	else
	return true
}

//------------------------------- Affichage calendrier -------------------------------------------------
function afficherPlus(cell,texte){
		cell.innerHTML = texte;
		cell.innerHTML += "<br/><img src='images/page/spacer.gif' width='90' height='1'/>";
}

// ---------------------------- Smiley -----------------------------------------------------------------
function emoticon(text) {
	var txtarea = document.new_mess.message;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}