
function verifiermail(mail) {
      if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
         return true
      } else {
         return false
      }
   }

function validation_register_1() {

    if (document.forms['register_1'].nom.value == "") {
    		alert("Enter your name");
    	        return false;
    };
    if (document.forms['register_1'].company.value == "") {
    		alert("Enter your company name");
    	        return false;
    };
    if (document.forms['register_1'].email.value == "") {
    		alert("Enter your email");
    	        return false;
    };
    
    mailatester = document.forms['register_1'].email.value;
    if ((mailatester.indexOf("@")>=0)&&(mailatester.indexOf(".")>=0)) {
             
          } else {
    		alert("Your email has an error");
    		return false;
      };
      

    
    if (document.forms['register_1'].password.value == "") {
    		alert("Enter your password");
    	        return false;
    };    
 return true;
}

function validation_connection() {

    if (document.forms['connection'].email.value == "") {
    		alert("Enter your email");
    	        return false;
    };
    if (document.forms['connection'].password.value == "") {
    		alert("Enter your password");
    	        return false;
    };    
 return true;
}

function validation_register() {


    if (document.forms['register'].name.value == "") {
    		alert("Enter your Last Name");
    	        return false;
    };

    if (document.forms['register'].company.value == "") {
    		alert("Enter your Company Name");
    	        return false;
    };

    if (document.forms['register'].country.value == "") {
    		alert("Enter your Country");
    	        return false;
    };
    if (document.forms['register'].email.value == "") {
          	alert("Enter your E-Mail");
          	return false;
    };
    if (document.forms['register'].confirm_email.value == "") {
          	alert("Enter your E-Mail Confirmation");
          	return false;
    };
    
    if (document.forms['register'].email.value != document.forms['register'].confirm_email.value) {
          	alert("Your email does not match");
          	return false;
    };    

    if (document.forms['register'].password.value == "") {
    		alert("Enter your password");
    	        return false;
    };        
    if (document.forms['register'].password_confirm.value == "") {
    		alert("Confirm your password");
    	        return false;
    };        
    if (document.forms['register'].password_confirm.value != document.forms['register'].password.value) {
    		alert("Your password does not match");
    	        return false;
    };        
    if (document.forms['register'].security.value == "") {
    		alert("Enter the security code");
    	        return false;
    };        
 return true;
}

function validation_billing_register() {


    if (document.forms['billing_register'].name.value == "") {
    		alert("Enter your Last Name");
    	        return false;
    };
    if (document.forms['billing_register'].company.value == "") {
    		alert("Enter your Company Name");
    	        return false;
    };
    if (document.forms['billing_register'].country.value == "") {
    		alert("Enter your Country");
    	        return false;
    };
    if (document.forms['billing_register'].email.value == "") {
          	alert("Enter your E-Mail");
          	return false;
    };
    if (document.forms['billing_register'].confirm_email.value == "") {
          	alert("Enter your E-Mail Confirmation");
          	return false;
    };
    
    if (document.forms['billing_register'].email.value != document.forms['billing_register'].confirm_email.value) {
          	alert("Your email does not match");
          	return false;
    };    
    if (document.forms['billing_register'].password.value == "") {
    		alert("Enter your password");
    	        return false;
    };        
    if (document.forms['billing_register'].password_confirm.value == "") {
    		alert("Confirm your password");
    	        return false;
    };        
    if (document.forms['billing_register'].password_confirm.value != document.forms['billing_register'].password.value) {
    		alert("Your password does not match");
    	        return false;
    };        
    if (document.forms['billing_register'].security.value == "") {
    		alert("Enter the security code");
    	        return false;
    };        
 return true;
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=720,height=600,screenX=150,screenY=150,top=150,left=150')
}
function popupWindowMail(url) {
  window.open(url,'pertepass','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=420,height=480,screenX=150,screenY=150,top=150,left=150')
}
function get_offset(elem, pos)
{
    var offset = 0;
    while(elem) {
        offset += elem[pos];
        elem = elem.offsetParent
    }
    return offset
}

function get_full_position(id)
{
    var d = document.getElementById(id);
    var offsets = new Object;
    offsets.top = get_offset(d, "offsetTop");
    offsets.left = get_offset(d, "offsetLeft");
    offsets.width = d.clientWidth;
    offsets.height = d.clientHeight;
    var hauteur = offsets.height;
    var hauteur2 = hauteur-90;
    document.getElementById("colonne_gauche").style.height = hauteur+"px";
    document.getElementById("talon").style.top = hauteur2+"px";
    return offsets;
}






function hover(obj){
  if(document.all){
    UL = obj.getElementsByTagName('ul');
    if(UL.length > 0){
      sousMenu = UL[0].style;
      if(sousMenu.display == 'none' || sousMenu.display == ''){
        sousMenu.display = 'block';
      }else{
        sousMenu.display = 'none';
      }
    }
  }
}

function setHover(){
  LI = document.getElementById('menu').getElementsByTagName('li');
  nLI = LI.length;
  for(x=0; x < nLI; x++){
    LI[x].onmouseover = function(){
      hover(this);
    }
    LI[x].onmouseout = function(){
      hover(this);
    }
  }
}

	function Visible(elem)
	{
		// Quel est l'état actuel ?
		etat = document.getElementById(elem).style.visibility;

		if(etat == "hidden")
		{
			document.getElementById(elem).style.visibility="visible";
		}
	}

	function Hidden(elem)
	{
		// Quel est l'état actuel ?
		etat = document.getElementById(elem).style.visibility;

		if(etat == "visible")
		{
			document.getElementById(elem).style.visibility="hidden";
		}
	}

				function GetId(id)
				{
				return document.getElementById(id);
				}
				var i=false; // La variable i nous dit si la bulle est visible ou non

				function move(e) {
				  if(i) {  // Si la bulle est visible, on calcul en temps reel sa position ideale
				    if (navigator.appName!="Microsoft Internet Explorer") { // Si on est pas sous IE
				    GetId("curseur").style.left=e.pageX + 5+"px";
				    GetId("curseur").style.top=e.pageY + 10+"px";
				    }
				    else { // Modif proposé par TeDeum, merci à lui
				    if(document.documentElement.clientWidth>0) {
				        GetId("curseur").style.left=20+event.x+document.documentElement.scrollLeft+"px";
				        GetId("curseur").style.top=10+event.y+document.documentElement.scrollTop+"px";
				    }
				    else {
				        GetId("curseur").style.left=20+event.x+document.body.scrollLeft+"px";
				        GetId("curseur").style.top=10+event.y+document.body.scrollTop+"px";
				    }
				    }
				  }
				}

				function montre(text) {
				  if(i==false) {
				  GetId("curseur").style.visibility="visible"; // Si il est cacher (la verif n'est qu'une securité) on le rend visible.
				  GetId("curseur").innerHTML = text; // Cette fonction est a améliorer, il parait qu'elle n'est pas valide (mais elle marche)
				  i=true;
				  }
				}
				function cache() {
				if(i==true) {
				GetId("curseur").style.visibility="hidden"; // Si la bulle etais visible on la cache
				i=false;
				}
				}
				document.onmousemove=move; // des que la souris bouge, on appelle la fonction move pour mettre a jour la position de la bulle.

