/*
	JS pour Barreau du Quebec
	Fonctions generales
	
	Simon - egzakt.com
	2007-08-14
*/

// Fonction d'ouverture de fenetre popup centree
// Simon - egzakt.com
// 2004-10-28
//
function egz_openwindow(lien,cible,w,h) {
	var _win;
	_win = window.open(lien,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;
}

// Fonction d'ouverture de fenetre popup centree
// Simon - egzakt.com
// MAJ 2007-08-15
//
function egz_openwindow_param(lien,cible,param,gauche) {
	var _win, w, h;
	w = param.split(",")[0].split("=")[1];
	h = param.split(",")[1].split("=")[1];
	_win = window.open(lien,cible,param);
	if (gauche) {
		_win.moveTo(100,100);
	} else {
		_win.moveTo((screen.width - w)/2,(screen.height - h)/2);
	}
	_win.focus();

	return false;
}
function egz_openwindow_param_gauche(lien,cible,param) {
	return egz_openwindow_param(lien,cible,param,true);
}

function openwindow_params(lien,cible,param) {
	var _win, w, h;
	w = param.split(",")[0].split("=")[1];
	h = param.split(",")[1].split("=")[1];
	_win = window.open(lien,cible,param);
	
	_win.moveTo((screen.width - w)/2,(screen.height - h)/2);
	
	_win.focus();

	return false;
}


//Fonction d'initialisation de formulaire 
//avec la soumission automatique
//et desactivation du bouton ergonomique
function axon_form_submit(id_form, id_submit) {
	var form = document.getElementById(id_form);
	if(form != null && form.submit != null){
		document.getElementById(id_submit).style.display = 'none';
	}
}

// Fonction originale du Barreau d'ouverture de fenetre (Utilisabilite)
function NewWindow(mypage, myname, w, h, winl, wint, scroll, resize, location, menu, status, toolbar) {
	var winl = (screen.width - w) / 4;
	var wint = (screen.height - h) / 4;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+',location='+location+',menubar='+menu+',status='+status+',toolbar='+toolbar+''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


/*
 * Affichage d'un contenu suivant
 * @copyright	egzakt.com
 * @package		BAQ-008
 * @author 		Emilie
 */
function bloc_deroulant(objet) {
	objet.next().slideToggle();
	objet.toggleClass("selected");	
	return false;
}

/*
 * Affichage des archives
 * @copyright	egzakt.com
 * @package		BAQ-008
 * @author 		Emilie
 */
function publications_archives(objet) {
	objet.next().children(".publications_archives").slideToggle();
	return false;
}
/*
 * Acces Rapide
 * @copyright	egzakt.com
 * @package		BAQ-008
 * @author 		Simon
 */
var quickoff = false;
function hide_acces_rapide() {
	if (quickoff) {
		$("#acces_rapide_contenu").hide();
		quickoff = false;
	}
}


