function fav()
{
	URL = location.href
	result=prompt("Favorite:","Give a name")
	if (result==null||result=="Give a name") result="";
	else result=result+" - ";
	Nom = result+"MAWA";
	window.external.addfavorite(URL, Nom)
}
function timespinning()
{
	tabMonth=Array("January","February","March","April","May","June","July","August","September","October","November","December");
	var timeNow = new Date();
	H=timeNow.getHours();
	if (H<10) H="0"+H;
	i=timeNow.getMinutes();
	if (i<10) i="0"+i;
	s=timeNow.getSeconds();
	if (s<10) s="0"+s;
	hourMALI.innerHTML=timeNow.getDate()+" "+tabMonth[timeNow.getMonth()]+" "+timeNow.getYear()+"<br>"+H+":"+i+":"+s;
	setTimeout("timespinning();",1000);
}
function checkEmail(nomform,nomchamp,valchamp)
{
       if (valchamp)
       {
           var place = valchamp.indexOf("@",1);
           var point = valchamp.indexOf(".",place+1);
           var domaine = valchamp.substring(place+1,point);
           var extdomaine = valchamp.substring(point+1,valchamp.length)
		   if ((place>-1) && (valchamp.length>2) && (point>1) && (domaine.length>1) && (extdomaine.length>1)) erreur = 0;
           else
           {
               erreur = 1;
               msg = "This e-mail has not a validate format.\nPlease, correct it.";
           }
           if (erreur == 1)
           {
               alert(msg+"\n"+valchamp);
               document.forms[nomform].elements[nomchamp].focus();
           }
       }
}
function checkForm(formDatas,formName,sendFormVal)
{
	msg="";
	var pos="";
	for (i=0;i<listRequire.length;i++)
	{
		element=listRequire[i];
		if (document.forms[formName].elements[element].value=="") {if (pos=="") {pos=i;}msg +="\n"+listRequire[i+1];}
		i++;
	}
	if (msg!="")
	{
		msg="The following fields are required :"+msg;
		alert(msg);
		document.forms[formName].elements[listRequire[pos]].focus();
	}
	else
	{
		//document.forms[formName].elements['sendForm'].value=sendFormVal
		document.forms[formName].submit();
	}
}
function launch(URL,w,h)
{
	if (w=="") w=1000;
	if (h=="") h=1000;
	window.open(URL,"_blank","top=50,left=50,resizable=0,toolbar=0,width="+w+",height="+h+",scrollbars=1")
}
function checkVide(formname,chp,val)
{
	if (document.forms[formname].elements[chp].value=="")
	{
		alert("This field is mandatory");
		document.forms[formname].elements[chp].focus();
	}
	
}