
	function verif_max_jocker(maxi,nb)
{
	var test = 0;
	for (i=0;i<11;i++)
	{
		if (eval('document.form.jocker_'+i))
		{
			if (eval('document.form.jocker_'+i+'.checked')==true) test++;
		}	
	}
	if (test>maxi) 
	{
		eval ('document.form.jocker_'+nb+'.checked=false');
		alert("Vous n'avez pas assez de jockers !");
	}
}

function verificationPronos()
{
	var test = 0;
	for (i=0;i<11;i++)
	{
		if (eval('document.form.nb_buts_equipe1_'+i))
		{
			if (eval('document.form.nb_buts_equipe1_'+i+'.value')=="") test++;
		}
		if (eval('document.form.nb_buts_equipe2_'+i))
		{
			if (eval('document.form.nb_buts_equipe2_'+i+'.value')=="") test++;
		}
	}
	
	if (test!=0) alert('Un des champs est vide !');
  else document.form.submit();
}

// Handle hint tooltip boxes onmouseover
var offsetfromcursorX = 12;
var offsetfromcursorY = 10; 
var offsetdivfrompointerX = 10; 
var offsetdivfrompointerY = 14;

document.write('<div id="hinttooltip"></div>')
document.write('<img id="hintpointer" src="/web/images/ballon.png" border="0" width="0">')

var ie = document.all;
var ns6 = document.getElementById && !document.all;
var enabletip=false;

if (ie||ns6)
  var tipobj=document.getElementById("hinttooltip");
  var pointerobj=document.getElementById("hintpointer");

function ietruebody()
 {
   return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function showtooltip(thetext, thewidth, thecolor)
 {
    if (ns6||ie)
    {
       if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px";
       if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor;
       tipobj.innerHTML=thetext;
       enabletip=true;
       return false;
    }
}

function positiontip(e)
 {
    if (enabletip)
      {
         var nondefaultpos=false;
         var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
         var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;

         var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20;
         var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20;

         var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX;
         var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY;

         var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000;

   if (rightedge<tipobj.offsetWidth)
       {
          tipobj.style.left=curX-tipobj.offsetWidth+"px";
          nondefaultpos=true;
      }
      else if (curX<leftedge)
          tipobj.style.left="5px";
     else
     {
          tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px";
          pointerobj.style.left=curX+offsetfromcursorX+"px";
}

if (bottomedge<tipobj.offsetHeight)
    {
       tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px";
       nondefaultpos=true;
   }
   else
   {
       tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px";
       pointerobj.style.top=curY+offsetfromcursorY+"px";
}
tipobj.style.visibility="visible";
if (!nondefaultpos)
    pointerobj.style.visibility="visible";
else
    pointerobj.style.visibility="hidden";
 }
}
function hidetooltip()
  {
     if (ns6||ie)
         {
            enabletip=false;
            tipobj.style.visibility="hidden";
            pointerobj.style.visibility="hidden";
            tipobj.style.left="-1000px";
            tipobj.style.backgroundColor='';
            tipobj.style.width='';
  }
}
document.onmousemove=positiontip
//--------------------------------------------------------//
	
/***********************************************
* Carousel Slideshow II- By Harry Armadillo (http://www.codingforums.com/showthread.php?t=58814)
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
* Please keep this notice intact
***********************************************/

function carousel(params){
  if(!(params.width>0 && isFinite(params.width)))params.width=100;
  if(!(params.height>0 && isFinite(params.height)))params.height=100;
  if(!(params.sides>2 && isFinite(params.sides)))params.sides=4;
  if(!(params.steps>0 && params.steps<100 && isFinite(params.steps)))params.steps=20;
  if(!(params.speed>0 && isFinite(params.speed)))params.speed=8;
  if(!(params.image_border_width>=0 && isFinite(params.image_border_width)))params.image_border_width=0;
  if(isFinite(params.id)||!params.id)params.id='bad_id_given_'+Math.random();
  
  var cdiv=document.getElementById(params.id.replace(/[^a-zA-Z0-9]+/g,'_'))
  cdiv.style.width=params.width+'px';
  cdiv.style.height=params.height+'px';
  cdiv.style.border=params.border;
  cdiv.style.position='relative';
  cdiv.style.overflow='hidden';
  cdiv.title=params.id;
    
  var counter=0,spinning=true,interval=Math.floor(60000/params.sides/params.steps/params.speed)-5;
  interval=isNaN(interval)?200:interval;
  var img_position=[],images=[],img_dimension=[];
  var img_index=params.images.length+1,img_index_cap=2*params.images.length;
  var faces=Math.ceil(params.sides/2), dimension, direction, targ, attr, faraway;

  function init(){
    if(params.direction=="left" || params.direction=="right"){
      direction=params.direction;
      dimension="width";
      }
    else if(params.direction=="top" || params.direction=="bottom"){
      direction=params.direction;
      dimension="height";
      }
    else {
      direction="left";
      dimension="width";
      }      
    faraway=(direction=="left"||direction=="top")?'-20000px':'20000px';
    cdiv.style[dimension]=params[dimension]/(params.size_mode=='image'?Math.sin(Math.PI/params.sides):1)+'px';
    var img=new Image();
    img.style.position='absolute';
    img.style[direction]=faraway;
    img.style.width=params.width-2*params.image_border_width+'px';
    img.style.height=params.height-2*params.image_border_width+'px';
    img.style.border=(params.image_border_width||0)+'px solid '+params.image_border_color;
  
    for(var i=0;i<params.images.length;i++){
      images[i]=img.cloneNode(true);
      images[i].src=params.images[i];
      if(params.links && params.links[i] && params.links[i]!=''){
        targ=params.lnk_targets && params.lnk_targets[i]||params.lnk_base||'new';
        images[i].onclick=new Function("affichepage('/web/index.php/myequipe/"+params.titles[i]+"',0)");
		images[i].style.cursor=document.all?'hand':'pointer';
      }

      if(params.titles && params.titles[i] && params.titles[i]!='')
        images[i].title=params.titles[i];
      if(document.all)
        images[i].alt=images[i].title;
      images[i+params.images.length]=images[i];
      if(params.images.length==faces)
        images[i+2*params.images.length]=images[i];
      cdiv.appendChild(images[i]);
      }
  
    var face_size=params.size_mode=='image'?params[dimension]:params[dimension]*Math.sin(Math.PI/params.sides);
    var face_offset=params[dimension]*Math.cos(Math.PI/params.sides)/(params.size_mode=='image'?Math.sin(Math.PI/params.sides):1)/2-.5;
    var pi_piece=2*Math.PI/params.steps/params.sides;
    for(i=0;i<=params.steps*faces;i++){
      img_dimension[i]=face_size*Math.sin(pi_piece*i);
      img_position[i]=(i<params.steps*params.sides/2)?Math.floor(params[dimension]/2/(params.size_mode=='image'?Math.sin(Math.PI/params.sides):1)-face_offset*Math.cos(pi_piece*i)-img_dimension[i]/2)+'px':faraway;
      img_dimension[i]=img_dimension[i]-2*params.image_border_width>1?Math.ceil(img_dimension[i])-2*params.image_border_width+'px':'1px';
      }
    }
  init();

  cdiv.rotate = function(){   
    setTimeout('if (document.getElementById("'+cdiv.id+'")) document.getElementById("'+cdiv.id+'").rotate()',interval);
    if(!spinning) return;
    if(++counter>=params.steps){
      counter=0;
      if(++img_index>=img_index_cap)
        img_index=params.images.length;
      }
    images[img_index-faces].style[direction]=faraway;
    for(var i=faces-1;i>=0;i--){
      images[img_index-i].style[direction]=img_position[counter+i*params.steps];
      images[img_index-i].style[dimension]=img_dimension[counter+i*params.steps];
      }
    }
  cdiv.onmouseover=function(){
    spinning=false;
    }
  cdiv.onmouseout=function(){
    spinning=true;
    }
  //setTimeout('document.getElementById("'+cdiv.id+'").rotate()',1);
  document.getElementById(cdiv.id).rotate();
  }