/****************************************************************************/
/*         _____________________________  _______________________           */
/*                          __         / / _                                */
/*           ___ _  __ __  / /  __  ()/ // /  _\_ ____  __ _____            */
/*          / -_/ \/ / _ \/ /_/ _ \/ / // _.\/ -_/ _  \/ // / -_            */
/*          \__/_//_/ .__/___/\___/_/_//_//_/\__/\__. /\_,_/\__/            */
/*         ________/_/_____________________________/_/___________           */
/*                                                                          */
/* Titre     : GIPA 2009                                                    */
/* Auteur    : Prudhon David                                                */
/* Version   : 30062009                                                     */
/*                                                                          */
/****************************************************************************/
function verification()
{
	var gipa2004 = document.gipa.im2004.value;
	var gipa2008 = document.gipa.im2008.value;
	
	if ((gipa2004 == ''))
	{
		alert ("Veuillez saisir votre indice majoré\nde décembre 2004");
		document.gipa.im2004.focus();
		return false;
	}
	else if(isNaN(gipa2004))
	{
		alert("La valeur saisie n'est pas un nombre !")
		document.gipa.im2004.focus();
		document.gipa.im2004.select();
		return false;
    	}
	else if ((gipa2004.length < 3))
	{
	        alert("La valeur saisie n'est pas correcte");
	        document.gipa.im2004.focus();
	        document.gipa.im2004.select();
	        return false;
        }
        else if ((gipa2004.length > 4))
	{
	        alert("La valeur saisie n'est pas correcte");
	        document.gipa.im2004.focus();
	        document.gipa.im2004.select();
	        return false;
        }

	else if ((gipa2008 == ''))
	{
		alert ("Veuillez saisir votre indice majoré\nde décembre 2008");
		document.gipa.im2008.focus();
		return false;
	}
	else if ((gipa2008.length < 3))
	{
	        alert("La valeur saisie n'est pas correcte");
	        document.gipa.im2008.focus();
	        document.gipa.im2008.select();
	        return false;
        }
        else if ((gipa2008.length > 4))
	{
	        alert("La valeur saisie n'est pas correcte");
	        document.gipa.im2008.focus();
	        document.gipa.im2008.select();
	        return false;
        }
	
     	
    	else
	{
		document.gipa.submit();
		return true;
	}
}
