$(document).ready(function() {

   $('#validatepage').load('web_services_validator.php');
   rotation();
   rotation2(); 
   
});


function rotation() {

	$('#pack a').css({opacity: 0.0});
	$('#pack a:first').css({opacity: 1.0}); 
	$('#pack .texte').css({opacity: 0.7}); 
	$('#pack .texte').css({width: $('#pack a').find('img').css('width')});
	$('#pack .contenu').html($('#pack a:first').find('span').text()).animate({opacity: 1.5}, 400);
	$('.news').hide();
	setInterval('photo()',10000);

}

function rotation2() {

	$('#pack2 a').css({opacity: 0.0}); $('#pack2 a:first').css({opacity: 1.0}); $('#pack2 .texte').css({opacity: 0.7}); $('#pack2 .texte').css({width: $('#pack2 a').find('img').css('width')});
	$('#pack2 .contenu').html($('#pack2 a:first').find('span').attr('class')).animate({opacity: 1.5}, 400);
	setInterval('photo2()',8000);

}


function photo() {

	var current = ($('#pack a.show')?  $('#pack a.show') : $('#pack a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('texte'))? $('#pack a:first') :current.next()) : $('#pack a:first'));
	var texte = next.find('span').text();
	
 	 next.css({opacity: 0.0})
 	.addClass('show')
 	.animate({opacity: 1.0}, 1000);
 	 current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
	$('#pack .texte').animate({opacity: 0.7},70 ).animate({height: '70px'},500 );

	$('#pack .contenu').html(texte);


}

function photo2() {

	var current = ($('#pack2 a.shows')?  $('#pack2 a.shows') : $('#pack2 a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('texte'))? $('#pack2 a:first') :current.next()) : $('#pack2 a:first'));
	var texte = next.find('span').attr('class') ;

	next.css({opacity: 0.0})
	.addClass('shows')
	.animate({opacity: 1.0}, 1000);
	current.animate({opacity: 0.0}, 1000)
	.removeClass('shows');

	$('#pack2 .texte').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });
	$('#pack2 .texte').animate({opacity: 0.7},70 ).animate({height: '70px'},500 );

	$('#pack2 .contenu').html(texte);

}


function onglet(ongletid) 
{
	TabstatusOnglet = new Array('activeitem','nonactiveitem');
	TabId = new Array('a0','a1','a2','a3');
	statusOnglet = new String()
	nbreonglets = new Number(TabId.length);
	
	
	for (compteur=0; compteur<nbreonglets; compteur++)
	{
		statusOnglet = "item" + TabId[compteur];
		
		if ( TabId[compteur] != ongletid ) 
		{
			document.getElementById(TabId[compteur]).className = TabstatusOnglet[1];
			document.getElementById(statusOnglet).className = 'inactif';
		} 
		else 
		{
			document.getElementById(TabId[compteur]).className = TabstatusOnglet[0];
			document.getElementById(statusOnglet).className = 'actif';
		}
	}	
}

function newwindow(fichier) {
  ff=window.open(fichier,"popup",
               "resizable=yes, width=760,height=500,left=200,top=200,scrollbars=yes,menubar=yes,location=yes,status=yes,directories=yes,toolbar=1NonNonNonNonNonNonNon'") }


function windownobar(fichier) {
  ff=window.open(fichier,"popup",
               "resizable=no, width=760,height=500,left=200,top=200,scrollbars=yes,menubar=no,location=no,status=no,directories=no") }

