// JavaScript Document
window.addEvent('domready', function() {

$('imgForm_00').fade('1');
$('imgForm_01').fade('0');
$('imgForm_02').fade('0');

var current_img = $('imgForm_00');
var morph = new Fx.Morph('zPCouple');


function change_selected(id)
{
current_img.fade('out');
current_img = $('imgForm_0'+id);
current_img.fade('in');

$('idRadio_0'+id).set('checked', 'checked');
$('bgBouton').set('class', 'bgBouton_0'+id);

  if(id != 0){
    
    $('zPCouple').morph('.nonePCouple');
    $('idprenom').set('class', 'noneLabel');
    $('partenaire').set('class', 'noneLabel');
    
  }else{
    $('zPCouple').morph('.PCouple');
    $('idprenom').set('class', 'label');
    $('partenaire').set('class', 'champ');
   
  }

}

$('idRadio_00').set('checked', 'checked');


$('idclick0').addEvent('click', function()
{
change_selected(0);
});

$('idclick1').addEvent('click', function()
{
change_selected(1);
});

$('idclick2').addEvent('click', function()
{
change_selected(2);
});

$('idRadio_00').addEvent('click', function()
{
change_selected(0);
});

$('idRadio_01').addEvent('click', function()
{
change_selected(1);
});

$('idRadio_02').addEvent('click', function()
{
change_selected(2);
});


$('idRadio_00').addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			$('idclick0').morph({
				'opacity': 0.5
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			$('idclick0').morph({
				opacity: 1
			});
		}
	});

$('idclick0').addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.5
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1
			});
		}
	});
$('idRadio_01').addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			$('idclick1').morph({
				'opacity': 0.5
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			$('idclick1').morph({
				opacity: 1
			});
		}
	});
	
$('idclick1').addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.5
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1
			});
		}
	});

$('idRadio_02').addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			$('idclick2').morph({
				'opacity': 0.5
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			$('idclick2').morph({
				opacity: 1
			});
		}
	});
  	
$('idclick2').addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.5
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1
			});
		}
	});
});
