function check(mod,url){
	var i = mod.search.value;
	if (i == null || i == ""){
		mod.search.focus();
		mod.search.style.backgroundColor= "#FFFF91";
		return false;
	}
	else{
		mod.method = "post";
		document.mdsearch.action = ( url ? url : "/Search" );
		return true;
	}
}

function accordion_switch(loid) {
	var det = document.getElementById('details' + loid);
	det.style.display = (det.style.display == 'block' ? 'none' : 'block');
	return false;
}

/* Send EMail Friends */
function validate_form(mod,url){
	var sa = mod.sourceAddress.value;
	var da = mod.destAddress.value;
	var expres = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
	
	if (!expres.test(sa) || !expres.test(da)){
		alert("Vous avez indiqu\u00E9 une adresse e-mail invalide.");
		if (!expres.test(sa)){
			mod.sourceAddress.focus();
			mod.sourceAddress.style.backgroundColor= "#FFFF91";
			
		}else{
			mod.destAddress.focus();
			mod.destAddress.style.backgroundColor= "#FFFF91";
		}
		return false;
	}else{
		mod.method = "post";
		document.sendEmail.action = ( url ? url : "/SendStory" );
		return true;
	}
}

