// JavaScript Document
function fullWindow(url) {
var str = "left=0,screenX=0,top=0,screenY=0,scrollbars=yes";
if (window.screen) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
str += ",height=" + ah;
str += ",innerHeight=" + ah;
str += ",width=" + aw;
str += ",innerWidth=" + aw;
}
win=window.open(url, "w", str);
}

  function formatText(el,tagstart,tagend) {
  	if (el.setSelectionRange) {
 		el.value = el.value.substring(0,el.selectionStart) + tagstart + el.value.substring(el.selectionStart,el.selectionEnd) + tagend + el.value.substring(el.selectionEnd,el.value.length)
  	}
  	else {
        var selectedText = document.selection.createRange().text;
        
        if (selectedText != "") {
            var newText = "" + tagstart + "" + selectedText + "" + tagend + "";
            document.selection.createRange().text = newText;
        }
  	}
  }


function form_ajout(thisForm) {
    if(thisForm.nom.value=='') {
         alert('Nom obligatoire');
         thisForm.nom.focus();
		 return false;
    }
    if(thisForm.prenom.value=='') {
         alert('Prénom obligatoire');
         thisForm.prenom.focus();
		 return false;
    }
    if(thisForm.affiliation.value=='') {
         alert('Indiquez l\'affiliation du testeur');
         thisForm.affiliation.focus();
         return false;
    }
    if(thisForm.mail.value=='') {
         alert('Indiquez le mail');
         thisForm.mail.focus();
         return false;
    }
    if(thisForm.nom_produit.value=='') {
         alert('Indiquez le nom du produit !!!');
         thisForm.nom_produit.focus();
         return false;
    }
    if(thisForm.famille.value=='') {
         alert('Indiquez la famille du logiciel');
         thisForm.famille.focus();
         return false;
    }
    if(thisForm.societe.value=='') {
         alert('Indiquez la société');
         thisForm.societe.focus();
         return false;
    }
}
/*
function form_chercheur_modif(thisForm) {
    if(thisForm.nom.value=='') {
         alert('Nom obligatoire');
         thisForm.nom.focus();
		 return false;
    }
    if(thisForm.prenom.value=='') {
         alert('Prénom obligatoire');
         thisForm.prenom.focus();
		 return false;
    }
    if(thisForm.grade.value=='') {
         alert('Indiquez le grade');
         thisForm.grade.focus();
         return false;
    }
     if(thisForm.equipe.value=='' && thisForm.unite.value=='') {
         alert('Sélectionez une équipe ou une unité');
         thisForm.equipe.focus();
         return false;
    }
    if(thisForm.redacteur.value=='') {
         alert('Indiquez votre login (rédacteur)');
         thisForm.redacteur.focus();
         return false;
    }
    if(thisForm.courriel.value=='') {
         alert('Indiquez le mail');
         thisForm.courriel.focus();
         return false;
    }
    if(thisForm.mdp.value != thisForm.mdp2.value) {
         alert('les deux mots de passe ne sont pas identiques');
         thisForm.mdp.focus();
         return false;
    }
	else {
		thisForm.submit();
	}
}
// le même mais en saisie depuis le site (mpd obligatoire)
function form_chercheur2(thisForm) {
    if(thisForm.nom.value=='') {
         alert('Nom obligatoire');
         thisForm.nom.focus();
		 return false;
    }
    if(thisForm.prenom.value=='') {
         alert('Prénom obligatoire');
         thisForm.prenom.focus();
		 return false;
    }
    if(thisForm.grade.value=='') {
         alert('Indiquez le grade');
         thisForm.grade.focus();
         return false;
    }
     if(thisForm.equipe.value=='') {
         alert('Sélectionez une équipe');
         thisForm.equipe.focus();
         return false;
    }
    if(thisForm.courriel.value=='') {
         alert('Indiquez le mail');
         thisForm.courriel.focus();
         return false;
    }
   if(thisForm.redacteur.value=='') {
         alert('Indiquez votre login (rédacteur)');
         thisForm.redacteur.focus();
         return false;
    }
    if(thisForm.mdp.value=='') {
         alert('Indiquez votre votre mot de passe');
         thisForm.mdp.focus();
         return false;
    }
    if(thisForm.mdp.value != thisForm.mdp2.value) {
         alert('les deux mots de passe ne sont pas identiques');
         thisForm.mdp.focus();
         return false;
    }
	else {
		thisForm.submit();
	}
}
function form_etudiant(thisForm) {
    if(thisForm.nom.value=='') {
         alert('Nom obligatoire');
         thisForm.nom.focus();
		 return false;
    }
    if(thisForm.prenom.value=='') {
         alert('Prénom obligatoire');
         thisForm.prenom.focus();
		 return false;
    }
    if(thisForm.grade.value=='') {
         alert('Indiquez le grade');
         thisForm.grade.focus();
         return false;
    }
    if(thisForm.redacteur.value=='') {
         alert('Indiquez votre login (rédacteur)');
         thisForm.redacteur.focus();
         return false;
    }
    if(thisForm.mdp.value != thisForm.mdp2.value) {
         alert('les deux mots de passe ne sont pas identiques');
         thisForm.mdp.focus();
         return false;
    }
	else {
		thisForm.submit();
	}
}
function form_etudiant2(thisForm) {
    if(thisForm.nom.value=='') {
         alert('Nom obligatoire');
         thisForm.nom.focus();
		 return false;
    }
    if(thisForm.prenom.value=='') {
         alert('Prénom obligatoire');
         thisForm.prenom.focus();
		 return false;
    }
    if(thisForm.grade.value=='') {
         alert('Indiquez le grade');
         thisForm.grade.focus();
         return false;
    }
    if(thisForm.redacteur.value=='') {
         alert('Indiquez votre login (rédacteur)');
         thisForm.redacteur.focus();
         return false;
    }
    if(thisForm.mdp.value=='') {
         alert('Indiquez votre votre mot de passe');
         thisForm.mdp.focus();
         return false;
    }
    if(thisForm.mdp.value != thisForm.mdp2.value) {
         alert('les deux mots de passe ne sont pas identiques');
         thisForm.mdp.focus();
         return false;
    }
	else {
		thisForm.submit();
	}
}

function form_equipe(thisForm) {
    if(thisForm.nom.value=='') {
         alert('Nom obligatoire');
         thisForm.nom.focus();
		 return false;
    }
     if(thisForm.code_affec.value=='') {
         alert('Sélectionnez une unité de rattachement');
         thisForm.code_affec.focus();
         return false;
    }
     if(thisForm.chef_eq.value=='') {
         alert('Sélectionnez le nom du responsable');
         thisForm.chef_eq.focus();
         return false;
    }
    if(thisForm.redacteur.value=='') {
         alert('Indiquez votre login (rédacteur)');
         thisForm.redacteur.focus();
         return false;
    }
	else {
		thisForm.submit();
	}
}


function form_ident(thisForm) {
    if(thisForm.user_name.value=='') {
         alert('Saisissez votre indentifiant');
         thisForm.user_name.focus();
		 return false;
    }
    if(thisForm.password.value=='') {
         alert('Saisissez votre mot de passe');
         thisForm.password.focus();
		 return false;
    }
	else {
		thisForm.submit();
	}
}
//Fin de la fonction
*/

