/* Easy Agile */
	
	var a = 1;
	var i = 1;
	var v = 0;	
jQuery(window).load(function(){
	var w = jQuery('#agile img:first-child').css('width');
	var h = jQuery('#agile img:first-child').css('height');
	if(jQuery('#agile img').attr('title')!=""){
		jQuery('#agile').append('<p id="agile-description"></p>');
	}
	jQuery('#agile img').each(function(){
		jQuery(this).attr('id', i);
		jQuery('#agile-navigation').append('<a class="'+i+'" href="javascript:controll('+i+');">'+i+'</a>  ');
		i++;
	});
	//change(1);
	repeat(a);
});
function controll(c){
	change(c);
	a = c;
	v = 1;
}
function change(o){
	jQuery('a').each(function(){
		jQuery(this).removeClass('selected');
	});
	jQuery('a.'+o ).addClass('selected');
	
	jQuery('#agile img').each(function(){
		jQuery(this).fadeOut(200);
	});
	jQuery('#'+o).fadeIn(1000);
	
	var alt = jQuery('#'+o).attr('title');
	jQuery('#agile p').text(alt);
	jQuery('#agile p').fadeIn(1000);
	
}
function repeat(a){
	if(v==0){
		change(a);
		if(a == (i-1)){ a = 1; } else { a++; }
	}
	setTimeout("repeat("+a+")", 5000);
	v = 0;
}


