/***********************  people  ***************************/
var ss_timeout = 500;
function loadPeople(idPeople , url){
	hidePeople();
	new Ajax.Request(
		url+'equipe/people_ajax.php?people='+idPeople,
	    {
	        onSuccess: function(transport) {
	            showPeople(transport.responseText);
	        }
	    }
	);
}

function showPeople(content_html){
	code_html = unescape(content_html); 
	var elem = $('right');
	if(elem.getStyle('opacity') <= 0.1){
		$('right').innerHTML = code_html;
		var height_right = $('right').getHeight();
		if(height_right  < $('content_text_left').getHeight()+100){
			height_right = $('content_text_left').getHeight()+100
		}
		new Effect.Morph('left', {
		  style:'height:'+height_right+'px', // CSS Properties
		  duration: 0.3 // Core Effect properties
		});
		new Effect.Opacity(elem, { from: 0.01, to: 1.0, duration: 0.3 });
	}else{	
		code_html = escape(content_html);
		setTimeout("showPeople('"+code_html+"')", ss_timeout);
	}	
}

function hidePeople(){
	var elem = $('right');
	new Effect.Opacity(elem, { from: 1.0, to: 0.01, duration: 0.3 });
}

function initSystemPeople(){
	var height_right = $('right').getHeight();
	
	$('right').setStyle({
		  position:'absolute'
	});
}
/*******************************************************************/
/*********************** laoding img *******************************/
function displayLogo(){
	new Effect.Appear('logo', { duration: 0.5 , delay : 0.5 });
}
function preLoadImg(){
	var imagesPrechargees=new Array();
	var directory = "http://www.acore.lu/img/layout/";
	var mesImagesSources=['background_recrutement.jpg','background_outsourcing.jpg','background_conseilhr.jpg','background_contact.jpg','background_equipe.jpg','background_jobs.jpg','background_home.jpg','background_news.jpg'];
	for(var i=0;i<mesImagesSources.length;i++){
		imagesPrechargees[i]=new Array();
		imagesPrechargees[i].src= directory+mesImagesSources[i];
		var image = "<img src='"+directory+mesImagesSources[i]+"' />";
		$('cache_img').insert(image);
	}	
}
/*******************************************************************/
window.onload = function() {
	if($('details')){initSystemPeople();} 
	displayLogo();
	setTimeout("preLoadImg()",1000);
}

window.onresize = function() {}
