	var nbrPays = 0;
	var maxPays = 1;
	window.onload = function() 
	{
		var e = document.getElementsByTagName('INPUT');
		for (var i=0 ; i<e.length ; i++)
		{
			if(e[i].getAttribute('type') == 'checkbox' && e[i].getAttribute('name') == 'Pays[]' && e[i].checked)
			{
				if(e[i].value != 'LU' && e[i].value != 'LI')
				{	
					nbrPays++;
				}
			}
		}
		maxPays = nbrPays;
		if(maxPays == 0) maxPays = 1;
		VerifAndEcho();
	}
	function clickRadioGrp1(radio)
	{
	  if(radio.value == 'one')
	  {
	    if(maxPays > 1)
	    {
        uncheckAll(); 
		  }
	    maxPays = 1;
	  }
	  else if(radio.value == 'three')
	  {
	    if(maxPays > 3)
	    {
        uncheckAll(); 
		  }
	    maxPays = 3;
	  }
	  else
	  {
	    checkAll();
	    maxPays = 20;
	  }
	  VerifAndEcho();
	}
	
	function uncheckAll()
	{
    var e = document.getElementsByTagName('INPUT');
    for (var i=0 ; i<e.length ; i++)
    {
      if(e[i].getAttribute('type') == 'checkbox' && e[i].getAttribute('name') == 'Pays[]')
      {
        e[i].checked = false;
      }
    }
    nbrPays = 0;
	}
	
	function checkAll()
	{
    var e = document.getElementsByTagName('INPUT');
    for (var i=0 ; i<e.length ; i++)
    {
      if(e[i].getAttribute('type') == 'checkbox' && e[i].getAttribute('name') == 'Pays[]')
      {
        e[i].checked = true;
      }
    }
    nbrPays = 0;
	}
	function testCheck(checked)
	{
	  if(maxPays == 20) {
	    checked.checked = true;
	    return;
	   }
		if(checked.value != 'LU' && checked.value != 'LI')
		{
			if(checked.checked)
			{
			  if(maxPays > nbrPays)
			  {
				  nbrPays++;
				}
				else
				{
				  checked.checked = false;
				}
			}	
			else
			{
				  nbrPays--;
          if(nbrPays < 0) nbrPays = 0;
			}
			
		}

	}
function VerifAndEcho()
{
  var price = '0';
  if(maxPays == 1)
  {
    price = priceone;
  }
  else if(maxPays == 3)
  {
    price = pricethree;
  }
  else
  {
    price = priceall;
  }
  if(selectedLang != "en")
  {
    document.getElementById("priceJs").innerHTML = price + ' &euro;';
  }
  else
  {
    document.getElementById("priceJs").innerHTML = price + ' &euro; / ' + (Math.floor(price * eurosToPounds) + 1) + ' &pound;';
  }
  
}
function totalAndEcho()
{
		var total = nbrPays * 70;
		total += 629
		total = Math.min(899,(Math.max(699,total)));
		if (document.getElementById)
    		{
    			document.getElementById("priceJs").innerHTML = total + ' &euro;';
    		}
  		else if (document.all)
    		{
    			document.all["priceJs"].innerHTML = total + ' &euro;';
    		}
}
