//------------------------------------------------
//	Fonctions utilisée dans le menu de gauche
//	des communes
//------------------------------------------------
	//------------------------------------------------
	//	Permet de charger les pages affichant les 
	//	listes de communes faisant partit du 
	//	groupement
	//------------------------------------------------
function afficherListe(type,query)
{
	
	switch(type)
	{
		case 'agence':
			url	= repositionnement(document.URL)+"communes/ficheAgence.php?"+query;
		break;
		case 'cc':
			url	= repositionnement(document.URL)+"communes/listeCommunesGroupement.php?"+query;
		break;
		case 'canton':
			url	= repositionnement(document.URL)+"communes/listeCommunesCanton.php?"+query;
		break;
	}
	nw	= window.open('','liste','scrollbars=yes,resizable=yes,width=650,height=400,left=10,top=10');
	document.Infos.target	= 'liste';
	document.Infos.action	= url;
	document.method		= "get";
	document.Infos.submit();
	nw.focus();
}
function afficheCommuneAbonnee(url)
{
	url	= url;
	nw	= window.open('','liensadm','scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,statusbar=yes');
	nw.location.href	= url;
	nw.focus();
}
	//------------------------------------------------
	//	Permet l'affichage des liens
	//	administratifs.
	//------------------------------------------------
function afficheLiensAdm(dept)
{
	url	= repositionnement(document.URL)+"communes/liensAdministratifs.php?dept="+dept;
	nw	= window.open('','liensadm','scrollbars=yes,resizable=yes,width=600,height=500,left=10,top=10');
	nw.location.href	= url;
	nw.focus();
}
function imprimer()
{
	url	= document.URL;
	url	= url.substring(url.indexOf("/dyn"));
	document.Infos.elements["recherche[refPage]"].value	= url;
	
	url	= repositionnement(document.URL)+"communes/imprimer.php";
	nw	= window.open('','imprimer','scrollbars=yes,resizable=yes,width=600,height=500,left=10,top=10');
	document.Infos.target	= 'imprimer';
	document.Infos.action	= url;
	document.method		= "get";
	document.Infos.submit();
	
	nw.focus();
}
function envoyer()
{
	url	= document.URL;
	url	= url.substring(url.indexOf("/dyn"));
	
	//-----------------------------------------------
	//	Permet de vérifier les cas particuliers
	//	afin de modifier l'url.
	//-----------------------------------------------
		//---------------------------------------
		//	Ici c'est dans le cas d'un page de détail 
		//	de la revue de presse
		//---------------------------------------
	if( isDefined(document.Infos.elements["recherche[art_cle]"]) )
	{
		if( url.indexOf("?") == -1 )		url	+= "?";
		if( url.indexOf("art_cle") == -1)	url	+= "&recherche%5Bart_cle%5D="+document.Infos.elements["recherche[art_cle]"].value;
	}
	if( isDefined(document.Infos.elements["recherche[com_inseeCommune]"]) )
	{
		if( url.indexOf("?") == -1 )			url	+= "?";
		if( url.indexOf("com_inseeCommune") == -1)	url	+= "&recherche%5Bcom_inseeCommune%5D="+document.Infos.elements["recherche[com_inseeCommune]"].value;
	}
	if( isDefined(document.Infos.elements["recherche[rp_cleImport]"]) )
	{
		if( url.indexOf("?") == -1 )		url	+= "?";
		if( url.indexOf("rp_cleImport") == -1)	url	+= "&recherche%5Brp_cleImport%5D="+document.Infos.elements["recherche[rp_cleImport]"].value;
	}
		// permet de stocker l'url de la page afin de la transmettre.
	document.Infos.elements["recherche[refPage]"].value	= url;
	url	= repositionnement(document.URL)+"communes/envoyer.php";

	nw	= window.open('','envoyer','scrollbars=yes,resizable=yes,width=700,height=500,left=10,top=10');
	document.Infos.target	= 'envoyer';
	document.Infos.action	= url;
	document.method		= "get";
	document.Infos.submit();
	
	nw.focus();
}
