<!--

function description(){
	window.name="cadeaux";
	window.open('/static/services/abo_cadeaux.html','','height=450,width=500,scrollbars=yes')
}
			
function aide(file,x,y){
	window.name="aide";
	var url = "/static/libre/aide/"+file;
	window.open(url,'','height=450,width=500,scrollbars=yes')
}	

function contact(){
	window.name="contact";
	window.open('/contact/contacts.html','','height=450,width=500,scrollbars=yes')
}

function contactarg(arg){
	window.name="contact";
	var url = "/contact/form_contact.html?type_contact="+arg;
	window.open(url,'','height=450,width=500,scrollbars=yes')
}


function descriptif(myURL){
    window.open(myURL, 'descriptif', 'width=350,height=350,scrollbars=yes,resizable=yes');
}

function plan(){
	window.name="plan";
	window.open('/static/services/plan.html','','height=450,width=300,scrollbars=yes,resizable=yes')
}

function imprimer(codedoc){
	var url = "/impression/imprime.html?";
    	url += "did="+codedoc;
    	url += "&displaymatrix=false";

    	var pop = window.open (url,'impression','location=no,toolbar=no,directories=no,menubar=yes,resizable=yes,scrollbars=yes,status=yes,width=600,height=600');
    	pop.focus();
}
	
    
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
    
    
    

//STORE

function sendForm() {
    ok = 1;

    //checks the fields which have not to be null in the form of the store
    if( isNotNull(bill.lastname.value)
          && isNotNull(bill.firstname.value)    
          && isNotNull(bill.email.value)
          && emailValid(bill.email.value)
          && isNotNull(bill.street.value)
          && isNotNull(bill.zipcode.value)
          && isNotNull(bill.city.value) 
          && isNotNull(bill.country.value)){
      ok = 1;
    }
    else {
      ok = 0;
    }
          
    
    if( ok == 1 ) { 
      bill.submit();
    }
    else {
      alert("Impossible de traiter votre demande.\nVérifier les valeurs des champs obligatoires (*)");
    }
  
}
  
 
/**
 * this function checks if the parameter is null or not
 * if null the function returns 0 otherwise 1
 */
function isNotNull(testedValue) {
  if(testedValue != ""){
    return 1;
  }
  else {
    return 0;
  }
}


/**
 * This function checks if an email is valid or not
 * If the email is wrong, return 0 otherwise 1
 */
function emailValid(email) {
    p = email.indexOf('@');
    r = email.indexOf('.');
    if(p < 1 || p == (email.length-1)){
        alert("Adresse email incorrecte");                
        return 0;
    }
    else if(r < 1 || r == (email.length-1)) {
        alert("Adresse email incorrecte"); 
        return 0;
    }
    else {
        return 1;
    }

}

-->
