function conteneur(nUrl,nAncre,nIdSite, nNode) {
this.monUrl = nUrl;
this.monAncre = nAncre;
this.monIdSite = nIdSite;
this.monNode = nNode;
}
var tab_Ancre = new Array(new conteneur(	"/", 	"", 	"1", 	"0") , 
new conteneur(	"/mre/se_documenter/", 	"se_documenter", 	"1", 	"1005") , 
new conteneur(	"/mre/GABARIT/", 	"GABARIT", 	"1", 	"1002") , 
new conteneur(	"/mre/visiter/", 	"visiter", 	"1", 	"1003") , 
new conteneur(	"/mre/participer/", 	"participer", 	"1", 	"1004") , 
new conteneur(	"/mre/devenir_ecocitoyen/", 	"devenir_ecocitoyen", 	"1", 	"1006") , 
new conteneur(	"/mre/les_associations_de_la_maison/", 	"les_associations_de_la_maison", 	"1", 	"1007") , 
new conteneur(	"/mre/presentation/", 	"presentation", 	"1", 	"1008") , 
new conteneur(	"/mre/infos_pratiques/", 	"infos_pratiques", 	"1", 	"1009") , 
new conteneur(	"/mre/nos_partenaires/", 	"nos_partenaires", 	"1", 	"1010") , 
new conteneur(	"/mre/espace_presse/", 	"espace_presse", 	"1", 	"1011") , 
new conteneur(	"/mre/contact/", 	"contact", 	"1", 	"1012") , 
new conteneur(	"/mre/presentation/qui_sommes-nous/", 	"qui_sommes-nous", 	"1", 	"1013") , 
new conteneur(	"/mre/presentation/historique/", 	"historique", 	"1", 	"1014") , 
new conteneur(	"/mre/presentation/nos_missions/", 	"nos_missions", 	"1", 	"1015") , 
new conteneur(	"/mre/presentation/les_projets_en_cours/", 	"les_projets_en_cours", 	"1", 	"1016") , 
new conteneur(	"/mre/newsletter/", 	"newsletter", 	"1", 	"1017") , 
new conteneur(	"/mre/formulaire/", 	"formulaire", 	"1", 	"1018") );
function parseUrl1(data) {
var e=/^((http|ftp):\/)?\/?([^:\/\s]+)(\/#([\w\-]+))?$/;
var e2=/^((http|ftp):\/)?\/?([^:\/\s]+)(\/\?id=\d+)(#([\w\-]+))?$/;
var e3=/^((http|ftp):\/)?\/?([^:\/\s]+)(\/#([\w\-^\/]+))\/([\w\-]+)?$/;
if (data.match(e)) {
	return  {url: RegExp['$&'],
			protocol: RegExp.$2,
			host:RegExp.$3,
			path:RegExp.$4,
			  ancre:RegExp.$5,
			file:RegExp.$6,
			hash:RegExp.$7};
}
else  if (data.match(e2)) {
	return  {url: RegExp['$&'],
			protocol: RegExp.$2,
			host:RegExp.$3,
			path:RegExp.$4,
			  path3:RegExp.$5,
			ancre:RegExp.$6,
			hash:RegExp.$7};
}
else  if (data.match(e3)) {
	return  {url: RegExp['$&'],
			protocol: RegExp.$2,
			host:RegExp.$3,
			path:RegExp.$4,
			  path3:RegExp.$5,
			ancre:RegExp.$6,
			hash:RegExp.$7};
}
else {
return  {url:"", protocol:"",host:"",path:"",file:"",hash:""};
}
}
function test_ancre(){
var sUrl = String(window.top.document.location.href);  
var thisUrl = String(this.document.location.href);  
var Url_reg = "";
Url_reg = parseUrl1(sUrl); 
var hostName = Url_reg["host"] 
var nameAncre = Url_reg["ancre"] 
if(nameAncre  != "" && nameAncre  != undefined && thisUrl.indexOf("home.php") > 0){
var  iAncre = -1;
for (var i in tab_Ancre){
	if (tab_Ancre[i].monNode == nameAncre) {
		iAncre = i
	}
}
	if (iAncre == -1) {
for (var i in tab_Ancre){
	if (tab_Ancre[i].monAncre == nameAncre) {
		iAncre = i
	}
}
}
	if (iAncre != -1) {
items = thisUrl.split("/")
;var currentSite = items[4] 
;if (tab_Ancre[iAncre].monUrl.indexOf(currentSite) > 0) { 
	var baseURL = 'http://'+hostName+'/content'+tab_Ancre[iAncre].monUrl;
 
if (window.top.document.getElementById('iframediv') !=null) { 
	if (window.parent.document.location.href == document.location.href){
		//  
return false; 
	}
	else { 
		if (document.location.href != baseURL) {
			//this.document.location.href = baseURL;
			return baseURL; 
		}
	else { 
			return false; 
		} 
	} 

} 
	} else {window.top.document.location.href = 'http://'+hostName+'/?id='+tab_Ancre[iAncre].monIdSite+'#'+nameAncre;
return false; 
	}
	}
}
}

