//ANIMATIONS FLASH
//function CreateFlash(id, chemin, width, height, vars){	
//	document.observe('dom:loaded', function() {  
//    //id : id de l'element dans lequel on va ecrire le flash    
//    var d = document.getElementById(id);
//    var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">' +
//    '<param name="movie" value="' + chemin + '" />' +
//    '<param name="quality" value="high" />' +
//    '<param name="wmode" value="transparent" />' +
//    '<param name="flashvars" value="' + vars + '">' +
//    '<embed src="' + chemin + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="' + vars + '" width="' + width + '" height="' + height + '"></embed></object>'
//    d.innerHTML = flash
//    });
//}

function CreateFlash(id, chemin, width, height, vars){
    //id : id de l'element dans lequel on va ecrire le flash
    var d = document.getElementById(id);
    var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">' +
    '<param name="movie" value="' + chemin + '" />' +
    '<param name="quality" value="high" />' +
	'<param name="wmode" value="transparent" />' +
    '<param name="flashvars" value="' + vars + '">' +
    '<embed src="' + chemin + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="' + vars + '" width="' + width + '" height="' + height + '"></embed></object>'
	d.innerHTML = flash

}

// formulaires
function FocusChamps(element)       	{element.className = 'champfocus';}
function changeClass(element, c)    	{element.className = c;}
function BlurChamps(element)        	{element.className = 'champcontact';}

function VerifChamps(c)
{
	if (!c.value)
	{
		c.className = 'champerreur';
		return false;
  }
	else
	{
		c.className = 'champcontact';
		return true;
	}
}

function VerifMail(c)
{
	if (!c.value)
	{
		c.className = 'champerreur';
		return false;
	}
	else if (c.value.search(/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/) == -1)
	{
		c.className = 'champerreur';
		return false;
	}
	else
	{
		c.className = 'champcontact';
		return true;
	}
}

//Tirette
var isUsed = false;
function slideDownUp(element) {
  isUsed = true;
  var el = $(element);
  if (el.style.display == 'none') {
    Effect.BlindDown(el); return false;
  } else {
    Effect.BlindUp(el); return false;
  }
  setTimeOut('isUsed=false', 1000);
}
nbp=1
function ajoutParticipant(bt){
    nbp = nbp+1
    if (nbp == 4) {
        bt.hide();
    }
    $('tailles' + nbp + '_0').checked = true
    Effect.Appear($('participant' + nbp));
    for (var y = 2; y < 5; y++) {
        $('del'+y).hide()
    }
    $('del' + nbp).show()
    
}
function supprParticipant(){
    //bt.hide();
    $('participant' + nbp).fade();
    var inp = $('participant' + nbp).select('input')
    for (var i = 0; i < inp.length; i++) {
        inp[i].setValue('')
    }
    nbp = nbp - 1
    for (var y = 2; y < 5; y++) {
        $('del' + y).hide()
    }
    if (nbp != 1) {
        $('del' + nbp).show()
    }
    if (nbp == 3) {
        Effect.Appear($('bt'));
    }
    
}

function changeRessource(idx, a) {
  if (idx == 1) {
    $('div1').show();
    $('div2').hide();
    $('change1').addClassName('selected');
    $('change2').removeClassName('selected');

  }
  else if (idx == 2) {
    $('div1').hide();
    $('div2').show();
    $('change1').removeClassName('selected');
    $('change2').addClassName('selected');
  }
}


var cpt = 0;
var ht_client = 0;

function defilVerticalNB(c1,c2) {
var ht_container = $(c2).clientHeight

if (cpt == 0){
    ht_client = $(c1).clientHeight;
    cpt = cpt + 1;
    }
else{
    ht_client = ht_client - (ht_container * cpt);
    if (ht_client > 0) {cpt = cpt + 1;}
    }
if (ht_client > 0)
    {
    //ht_client = ht_client - ht_container;
    /*if (ht_client < ht_container)
        {//$('NB').src = 'none';
         $('PB').src = 'images/carousel/top.gif';
        }*/
    //$('PB').src = 'images/carousel/top.gif';    
    new Effect.Move(c1, { x: 0, y: -ht_container }); 
    return false;
    }
}

function defilVerticalPB(c1,c2) {
var ht_container = $(c2).clientHeight

if (cpt > 0){
    ht_client = ht_client + (ht_container * cpt);
    cpt = cpt - 1;
    if (cpt == 0){ht_client = ht_client + ht_container}
    }
else{
    ht_client = 0;
    cpt = 0 ;
    }
    
if (ht_client > 0)
    {
    /*if (ht_client == $(c1).clientHeight)
        {//$('PB').src = 'none';
         $('NB').src = 'images/carousel/bas.gif';
        }*/
    //$('NB').src = 'images/carousel/bas.gif';
    new Effect.Move(c1, { x: 0, y: ht_container }); 
    return false;
    }
}


///// Effet d'apparition / disparition
function bascule(c) {
Effect.toggle('detail'+c,'blind');
return false
}
