var nbbh=2;
var gg_ad_width=468;
var gg_ad_height=60;
var gg_ad_format='468x60_as';
var box_width='100%';
var box_width_min=300;
var width_side=280;
var urlfav="http://www.annuaire-mairie.fr";
var titlefav='Annuaire-Mairie.fr : Villes et Mairies';
var x=0,y=0;
if( typeof(window.innerWidth)=='number' ) {
x=window.innerWidth;
y=window.innerHeight;
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
x=document.documentElement.clientWidth;
y=document.documentElement.clientHeight;
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
x=document.body.clientWidth;
y=document.body.clientHeight;
}
if(x>1000) nbbh=3;
if(x>1200) {
gg_ad_width=728;
gg_ad_height=90;
gg_ad_format='728x90_as';
}
if((x-width_side)/4>=box_width_min) box_width='25%';
else if((x-width_side)/3>=box_width_min) box_width='33.3%';
else if((x-width_side)/2>=box_width_min) box_width='50%';
function load_add_bb() { document.write('<'+'script type=\"text/javascript\" src=\"http://www.blogbang.com/demo/js/blogbang_ad.php?id=d93b0368c3&amp;n='+nbbh+'&amp;p=L&amp;o=H&amp;w=190&amp;bg=ffffff&amp;c=ffffff\"></'+'script>'); }
function load_box() { var boxd=''; if(box_width!='33.3%') boxd=' #index .box_divers{ width:100%; } ';  document.write('<'+'style type=\"text/css\">#index .box{ width:'+box_width+'; }'+boxd+'</'+'style>'); }
function d(t,id) { if(document.getElementById(id)) document.getElementById(id).innerHTML=t; }
function f(fichier) {
if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else return(false);
xhr_object.open("POST", fichier, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}
function w() {
var data=null;
var xhr_object=null;
if(window.XMLHttpRequest) xhr_object=new XMLHttpRequest();
else if(window.ActiveXObject) xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
else return(false);
xhr_object.open("POST",'/js/js.php?m=w',true);
xhr_object.onreadystatechange = function() {
if(xhr_object.readyState==4) {
if(xhr_object.status==200) d(xhr_object.responseText,'wiki');
else alert('problem...');
}
else d('<div class="load"></div>','wiki');
}
xhr_object.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xhr_object.send(data);
}
var tfs=new Array('xx-small','x-small','small','medium','large','x-large','xx-large');
var sz=3;
function fs(n) {
sz += n;
if(sz<0) sz=0;
if(sz>6) sz=6;
var test=/div_/;
var divs = document.getElementsByTagName('div');
for(var i=0; i<divs.length; i++)
{
if(test.test(divs[i].id)) divs[i].style.fontSize = tfs[sz];
}
return false;
}
function s_pai(id){
var s=f('/js/js.php?m=s_pai&id='+id+'&t='+radio_value(document.form_pub.t)+'&d='+radio_value(document.form_pub.d));
return s;
}
function ban_right(){
document.write(f('/js/js.php?m=ban_right'));
}
function radio_value(r){
for(var i=0;i<r.length;i++){ if(r[i].checked) return r[i].value; }
}
function addfav(){
if(document.all) window.external.AddFavorite(urlfav,titlefav);
else if (window.sidebar) window.sidebar.addPanel(titlefav,urlfav,"");
else alert("Désolé, mais votre navigateur ne supporte pas cette fonction.");
}
function get_hit_parade(){
document.write('<a href="http://www.hit-parade.com/hp.asp?site=p535692"><img src="http://logp.hit-parade.com/logohp1.gif?site=p535692" alt="Hit-Parade"/></a>');
}
function ajaxfunc(t,id){
d(f('/js/js.php?m='+t),id);
}