function showhidetab(spanid)
{
var span_id = document.getElementById(spanid);
//	alert(span_id+" "+spanid);
if (span_id.style.display != '') {
span_id.style.display='';
} else {
span_id.style.display='none';
}
}

function ChangeClass(spanid, type)
{
if(type=='id')
span_id = document.getElementById(spanid);
else
span_id = spanid;

if (span_id.className == 'leftsubnavhadericonbg') {
span_id.className='leftsubnavhadericonbg1';
} else {
span_id.className='leftsubnavhadericonbg';
}
}

function login_check()
{

if(document.frm_login.email.value=='')
{
	alert('Entrez votre adresse email ');
	document.frm_login.email.focus();
	return false;
}
else if(document.frm_login.email.value!='')
{
	if(!validateEmail(document.frm_login.email.value))
	{
		alert('Entrez une adresse email valide.');
		document.frm_login.email.focus();
		return false;
	}	
}
if(document.frm_login.password.value=='')
{
alert('Entrez votre mot de passe');
document.frm_login.password.focus();
return false;
}
return true;
}

function validateEmail(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
var splitted = email.match("^(.+)@(.+)$");
if(splitted == null) return false;
if(splitted[1] != null )
{
var regexp_user=/^\"?[\w-_\.]*\"?$/;
if(splitted[1].match(regexp_user) == null) return false;
}
if(splitted[2] != null)
{
var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
if(splitted[2].match(regexp_domain) == null) 
{
var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
if(splitted[2].match(regexp_ip) == null) return false;
}// if
return true;
}
return false;
}
function checksearch()
{
var obj = document.getElementById('searchtxt');
var txt = obj.value;
if(txt == '')
{
alert('Le texte de recherche ne doit pas être vide.');
obj.focus();
return false;
}
else
{
window.location.href="/search.php?searchtxt="+txt;
}
return true;
}




