// JavaScript Document
window.onload = function(){

    Shadowbox.init();

};

function loadPortail(index) {
//var _SONDAGES = 'sondages';
//var _ACTUALITES = 'actualites';
	var xhr = getXMLHttpRequest();
	var URL = _HTTP_FO+"gene/ajax/gen.ho_portail.php";
	//var htmlCal = document.getElementById('gen_calendar');
		xhr.open("POST",URL,true);
		xhr.onreadystatechange = function() {
			if (xhr.readyState == 4){
				if (document.getElementById) {
					document.getElementById('ho_portail_contenu').innerHTML  = xhr.responseText
					makeScrollbar( $('ho_contenu'), $('scrollbar'), $('handle') );
					

					if(index == "actualites") {
						/*document.getElementById('lien_portail').innerHTML = "Consulter toutes les actualités";
						document.getElementById('lien_portail').href = "http://www.bvaonline.com/bva/actualites/";
						document.getElementById('lien_portail').title = "Consulter toutes les actualités";*/	
						document.getElementById('ho_nav_portail').innerHTML = '<ul><li><a title="'+_SONDAGES+'" onclick="javascript:loadPortail(\'sondages\');">'+_SONDAGES+'</a></li><li class="portail_actif">'+_ACTUALITES+'</li></ul>';					
					} else if(index == "sondages"){
						/*document.getElementById('lien_portail').innerHTML = "Consulter tous les sondages";
						document.getElementById('lien_portail').href = "http://www.bvaonline.com/bva/sondages/";
						document.getElementById('lien_portail').title = "Consulter tous les sondages";*/	
						document.getElementById('ho_nav_portail').innerHTML = '<ul><li class="portail_actif">'+_SONDAGES+'</li><li><a title="'+_ACTUALITES+'" onclick="javascript:loadPortail(\'actualites\');">'+_ACTUALITES+'</a></li></ul>';	
					}
					
					
					
				}
			} else {
				document.getElementById('ho_portail_contenu').innerHTML  = '<img src="'+_HTTP_FO+'gene/image/loading.gif" class="loading" />';
			}
		}
		xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		var data = "flt="+escape(index);
		xhr.send(data);
		//alert(data)
}
