// JavaScript Document

function randomHeaderImg() {
	rand = Math.floor(Math.random()*5);
	document.getElementById("header_mid").style.background = "url(images/header_img"+rand+".jpg)";
	}

 function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }


// configure here:
var preload = new Array('notre_equipe.png', 'produits.png', 'services.png', 'chroniques_financieres.png', 'videos.png', 'questions_et_opinions.png', 'nous_joindre.png', 'notre_equipe_over.png', 'produits_over.png', 'services_over.png', 'chroniques_financieres_over.png', 'videos_over.png', 'questions_et_opinions_over.png', 'nous_joindre_over.png', 'header_img0.jpg', 'header_img1.jpg', 'header_img2.jpg', 'header_img3.jpg', 'header_img4.jpg');

var loader = new Array();
for(var i = 0; i < preload.length; i++){
   loader[i] = new Image();
   loader[i].src = preload[i];
}


function btOver(Objet){
source = document.getElementById(Objet).src;
source = source.replace('.png', '_over.png');
document.getElementById(Objet).src = source;

}

function btOut(Objet){
source = document.getElementById(Objet).src;
source = source.replace('_over.png', '.png');
document.getElementById(Objet).src = source;
} 

function hideall() {
	document.getElementById('intro').style.display = "none";
	document.getElementById('fonds_mutuels').style.display = "none";
	document.getElementById('fonds_distincts').style.display = "none";
	document.getElementById('depot_a_terme').style.display = "none";
	document.getElementById('obligations').style.display = "none";
	document.getElementById('compte_epargne').style.display = "none";
	document.getElementById('reee').style.display = "none";
	document.getElementById('reei').style.display = "none";
	document.getElementById('celi').style.display = "none";
	document.getElementById('rri').style.display = "none";
	document.getElementById('reer').style.display = "none";
	document.getElementById('feer').style.display = "none";
	document.getElementById('cri').style.display = "none";
	document.getElementById('frv').style.display = "none";
	document.getElementById('rentes_de_retraite').style.display = "none";
	document.getElementById('reer_collectif').style.display = "none";

	document.getElementById('assurance_vie').style.display = "none";
	document.getElementById('assurance_salaire').style.display = "none";
	document.getElementById('assurance_maladies_graves').style.display = "none";
	document.getElementById('assurance_soins').style.display = "none";
	document.getElementById('assurance_hypothecaire').style.display = "none";
	document.getElementById('assurance_commerciale').style.display = "none";

	jQuery('#li_fonds_mutuels').attr("class","produits_elem");
	jQuery('#li_fonds_distincts').attr("class","produits_elem");
	jQuery('#li_depot_a_terme').attr("class","produits_elem");
	jQuery('#li_obligations').attr("class","produits_elem");
	jQuery('#li_compte_epargne').attr("class","produits_elem");
	
	jQuery('#li_reee').attr("class","produits_elem");
	jQuery('#li_reei').attr("class","produits_elem");
	jQuery('#li_celi').attr("class","produits_elem");
	jQuery('#li_rri').attr("class","produits_elem");
	jQuery('#li_reer').attr("class","produits_elem");
	jQuery('#li_feer').attr("class","produits_elem");
	
	jQuery('#li_assurance_vie').attr("class","produits_elem");
	jQuery('#li_assurance_salaire').attr("class","produits_elem");
	jQuery('#li_assurance_maladies_graves').attr("class","produits_elem");
	jQuery('#li_assurance_soins').attr("class","produits_elem");
	jQuery('#li_assurance_hypothecaire').attr("class","produits_elem");
	jQuery('#li_assurance_commerciale').attr("class","produits_elem");

	jQuery('#li_cri').attr("class","produits_elem");
	jQuery('#li_frv').attr("class","produits_elem");
	jQuery('#li_rentes_de_retraite').attr("class","produits_elem");
	jQuery('#li_reer_collectif').attr("class","produits_elem");
	}
	
function hideallservices() {
	document.getElementById('intro').style.display = "none";
	document.getElementById('planif_finan_personnelle').style.display = "none";
	document.getElementById('planif_retraitre').style.display = "none";
	document.getElementById('planif_successorale').style.display = "none";
	document.getElementById('analyse_polices').style.display = "none";
	document.getElementById('analyse_portefeuille').style.display = "none";

	jQuery('#li_planif_finan_personnelle').attr("class","produits_elem");
	jQuery('#li_planif_retraitre').attr("class","produits_elem");
	jQuery('#li_planif_successorale').attr("class","produits_elem");
	jQuery('#li_analyse_polices').attr("class","produits_elem");
	jQuery('#li_analyse_portefeuille').attr("class","produits_elem");
}
	

function show(rubrique, li_id) {
	document.getElementById(rubrique).style.display = "block";
	jQuery(li_id).attr("class","produits_elem_active");	
	}
	
	
function hideallsondage() {
	document.getElementById('sondage').style.display = "none";
	document.getElementById('resultat').style.display = "none";
	document.getElementById('commentaires').style.display = "none";
	
	document.getElementById('sondage').src = "tab_sondage.jpg";
	document.getElementById('resultat').src = "tab_resultat.jpg";
	document.getElementById('commentaires').src = "tab_commentaires.jpg";
	

}
	
function showSondage(rubrique, tab_id) {
	document.getElementById(rubrique).style.display = "block";
	if (tab_id == "tab_sondage") {
		document.getElementById(tab_id).src = "images/tab_sondage_inactive.jpg";
		document.getElementById("tab_resultat").src = "images/tab_resultat.jpg";
		document.getElementById("tab_commentaires").src = "images/tab_commentaires.jpg";
		}
	if (tab_id == "tab_resultat") {
		document.getElementById("tab_sondage").src = "images/tab_sondage.jpg";
		document.getElementById(tab_id).src = "images/tab_resultat_inactive.jpg";
		document.getElementById("tab_commentaires").src = "images/tab_commentaires.jpg";
		}
	if (tab_id == "tab_commentaires") {
		document.getElementById("tab_sondage").src = "images/tab_sondage.jpg";
		document.getElementById("tab_resultat").src = "images/tab_resultat.jpg";
		document.getElementById(tab_id).src = "images/tab_commentaires_inactive.jpg";
		}
	}





    

