function validFormSendUrl()
{
    var envois = true;
    var msg = "Veuillez remplir les champs suivants :\n";
    var objF = document.getElementById("sendU");
    
    if (objF.expNom.value == "") 
    {
        envois = false;
        msg += " - votre nom\n";
    }
    
    if (!verifmail(objF.expEmail.value)) 
    {
        envois = false;
        msg += " - votre email\n";
    }
    
    if (objF.destNom.value == "") 
    {
        envois = false;
        msg += " - le nom de votre ami\n";
    }
    
    if (!verifmail(objF.destEmail.value)) 
    {
        envois = false;
        msg += " - l'email de votre ami\n";
    }
    if(envois)
    {
        return true;
    }
    else
    {
        alert (msg);
        return false;
    }
}

function validFormContact()
{
    var envois = true;
    var msg = "Veuillez remplir les champs suivants :\n";
    var objF = document.getElementById("contact");
    
    if (objF.nom.value == "") 
    {
        envois = false;
        msg += " - nom\n";
    }
    if (objF.prenom.value == "") 
    {
        envois = false;
        msg += " - pr\351nom\n";
    }
    if (objF.societe.value == "") 
    {
        envois = false;
        msg += " - soci\351t\351\n";
    }
    if (!verifmail(objF.mail.value)) 
    {
        envois = false;
        msg += " - mail\n";
    }
    if (objF.cp.value == "") 
    {
        envois = false;
        msg += " - cp\n";
    }
    if (objF.message.value == "") 
    {
        envois = false;
        msg += " - message\n";
    }
    
    if(envois)
    {
        return true;
    }
    else
    {
        alert (msg);
        return false;
    }
    
}

function verifmail(email)
{
    var reg = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]­{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i');
	if(reg.test(email))
	{
		return true ;
	}
	else
	{
		return false;
	}
 
}
/*
function sendUrl()
{ 
    url = window.location;
    titre = document.title;
    sujet = "Le-Pixel.net";
    window.location = "mailto:"+prompt('Entrez l\'adresse email de la personne a qui vous désirez recommander ce site','')+"?subject="+sujet+"&body=Je te recommande ce site: "+titre+" "+url;
} 
*/
function sendUrl()
{ 
    set_opacity("container", 25);
    document.getElementById("sendURL").style.visibility = "visible";
} 

function cancelUrlDiv()
{
    document.getElementById("sendURL").style.visibility = "hidden";
    document.getElementById("container").style.opacity = "100";
}

function add_to_favoris()
{
    var titre = "Le-Pixel.net";
    var url = document.location.href;
    if(navigator.appName != 'Microsoft Internet Explorer' )
    {
        window.sidebar.addPanel(titre,url,"");
    }
    else
    {
        window.external.AddFavorite(url,titre);
    }
}

function set_opacity(id, opacity)
{
        el = document.getElementById(id);
        el.style["filter"] = "alpha(opacity="+opacity+")";
        el.style["-moz-opacity"] = opacity/100;
        el.style["-khtml-opacity"] = opacity/100;
        el.style["opacity"] = opacity/100;
        return true;
}

