//!!!!!!!!!!!ATENTION : les fonctions pour la barre d'actions marchent pour les liens de type :  
// 1)http://www.barreau.qc.ca/envoi/index-hull.html?url2=   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// 2)http://www.barreau.qc.ca/commentaires/index-hull.html?url2=   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
var lien = window.location.href;

function getSection() {	
	var nomSection = "" ;	
	var sections = new Array( "hull", "gaspesie", "laurentides", "abitibi", "bedford", "cotenord", "longueuil" );
	
	var posSection = -1; 
        for ( i=0;i<7;i++ ){
               	posSection = lien.indexOf(sections[i]); 
               	if ( posSection > -1 ) { 
			nomSection = sections[i];
		}
        }
	  	 
  	return nomSection;
}


// Fonction d'ouverture de fenetre popup centree
function bu020_openwindow(typeWindow,cible,w,h) {
	var _win;		
	var nomSection = getSection();
	var lienLong = 'http://www.barreau.qc.ca/' + typeWindow + '/index-' + nomSection + '.html?url2=' + lien;
		
	_win = window.open(lienLong ,cible,'width=' + w + ',height=' + h + ',top=' + (screen.height - 400)/2 + 'left='+ (screen.width - 400)/2);
	_win.moveTo((screen.width - w)/2,(screen.height - h)/2);
	_win.focus();

	return _win;
}


function bloc_deroulant(objet) {
	objet.next().slideToggle("normal");
	objet.toggleClass("selected");
	objet.parent().toggleClass("bloc_deroulant_selected");
	return false;
}

$(function() {
	$(".zone_deroulante").hide();
	
	$("a.lien_deroulant").click(
		function(){
			return bloc_deroulant($(this));
		}
	);
});

function setTitre( title ){ 
	var nomSection = getSection();	
	var section = "Barreau de ";
	
	switch ( nomSection ){
	     case "hull":
		  section += "Hull";
		  break;
	     case "gaspesie":
		  section += "Bas St-Laurent-Gaspésie-Îles-de-la-Madeleine";
		  break;
	     case "laurentides":
		  section += "Laurentides-Lanaudière";
		  break;
	     case "abitibi":
		  section += "l\'Abitibi-Témiscamingue";
		  break;
	     case "bedford":
		  section += "Bedford";
		  break;
	     case "cotenord":
		  section += "la Côte-Nord";
		  break;
	     case "longueuil":
		  section += "Longueuil";
		  break;
	}
		
	var newTitle = title + " - " + section;
	document.title = newTitle; 	
	
	//alert(newTitle);
		  	   	
} 

function getSite() {	
  	var nomSection = getSection();	
	var ua = "UA-";
	
	switch ( nomSection ){
	     case "hull":
		  ua += "8048348-1";
		  break;
	     case "gaspesie":
		  ua += "8048309-1";
		  break;
	     case "laurentides":
		  ua += "8048317-1";
		  break;
	     case "abitibi":
		  ua += "8048272-1";
		  break;
	     case "bedford":
		  ua += "8048283-1";
		  break;
	     case "cotenord":
		  ua += "8048300-1";
		  break;
	     case "longueuil":
		  ua += "8048202-1";
		  break;
	}
 
  	return ua;
}

       


