var texte="Saisissez vos mot-clés";var first=true;function rollover(img_id,img_src)
{if(document.getElementById(img_id)!=null)
document.getElementById(img_id).src=img_src;}
function prechargimg(){var doc=document;if(doc.images){if(!doc.precharg)doc.precharg=new Array();var i,j=doc.precharg.length,x=prechargimg.arguments;for(i=0;i<x.length;i++)
if(x[i].indexOf("#")!=0){doc.precharg[j]=new Image;doc.precharg[j++].src=x[i];}}}
function searchagenda(ville){var request='idvillepb='+ville;var typerech=document.getElementById('thema');if(typerech.value!=0)
request+="&thema="+typerech.value;var quand=document.getElementById('_date_link').value;if(quand!=0){if(quand=="DAT")
request+="&quand="+document.getElementById('date').value;else
request+="&quand="+quand;}
var ou=document.getElementById('ou').value;if(ou!=0){if(ou.charAt(0)=='S')
request+="&idsalle="+ou.substring(1,100);else
request+="&ou="+ou;}
var quoi=document.getElementById('quoi').value;if(quoi!=0){if(quoi.charAt(0)=='F')
request+="&idagenda="+quoi.substring(1,10);else
request+="&quoi="+quoi;}
var qui=document.getElementById('qui').value;if(qui==texte)
qui='';if(qui!='')
request+="&qui="+qui;var option=document.getElementById('option');if(option.checked)
request+="&option=1";document.location.href="index2.php?page=agenda/agenda.php&"+request;}
function submitenter(ville,e)
{alert('teset');var keycode;if(window.event)keycode=window.event.keyCode;else if(e)keycode=e.which;else return true;if(keycode==13)
{searchagenda(ville);return false;}
else
return true;}
function changeSelect(item,val){var obj=document.getElementById(item);for(i=0;i<obj.length;i++)
if(obj[i].value==val)
{obj.selectedIndex=i;break;}}
function pickerHandler(e){if(first==false){var cal=DatePicker.findCalendarElement('date');cal.style.display='none';}
first=false;}
function checkThenHide(e){if(!e)
e=window.event;if(e){var s=""+e.target;if(s.indexOf("Body",0)>=0){DatePicker.cancel('date');}}}
function onquandchange(obj){if(obj.value=='DAT'){DatePicker.toggleDatePicker('date');}}
function closePicker(){var popup=document.getElementById('_date_calendar');}
function onquanddown(obj){if(obj.value=='DAT'){DatePicker.cancel('date');}}
function changemenu(obj,menu){if(obj.value!=""){var popup=document.getElementById(menu);popup[popup.length-1].value=obj.value;}}
function focusmotcles(obj,on){if(on==true){if(obj.value==texte)
obj.value="";}
else{if(obj.value=="")
obj.value=texte;}}
function setquoi(nom,val){var themedrop=document.getElementById('quoi');themedrop.innerHTML=nom;themedrop.name=val;var dropdown=document.getElementById("dropdown");dropdown.style.visibility="hidden";}
function showquoi(){var dropdown=document.getElementById("dropdown");dropdown.style.visibility="visible";}
function radiosondage(elem){for(i=1;i<=5;i++){}}
function showhideediv(name){var mydiv=document.getElementById(name);var showgif=document.getElementById('showgif');if(mydiv.style.display=='none'){mydiv.style.display='block';}
else{mydiv.style.display='none';}}
function openlink(pubid){link+="pub.php?";link+="idpub="+pubid;window.open(link,"","toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,fulscreen=yes")}
function showpub(catpub,thema,update,idvillepb,divid){var xmlhttp=null;if(window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();else if(window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
var date=new Date();xmlhttp.open('GET','pub.php?pub='+catpub+'&thema='+thema+'&update='+update+'&idvillepb='+idvillepb+'&date='+date,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(divid!=null)
if(document.getElementById(divid)!=null)
document.getElementById(divid).innerHTML=xmlhttp.responseText;}}
xmlhttp.send(null);}
function decode_utf8(s){for(var a,b,i=-1,l=(s=s.split("")).length,o=String.fromCharCode,c="charCodeAt";++i<l;((a=s[i][c](0))&0x80)&&(s[i]=(a&0xfc)==0xc0&&((b=s[i+1][c](0))&0xc0)==0x80?o(((a&0x03)<<6)+(b&0x3f)):o(128),s[++i]=""));return s.join("");}
function encode_utf8(s){for(var c,i=-1,l=(s=s.split("")).length,o=String.fromCharCode;++i<l;s[i]=(c=s[i].charCodeAt(0))>=127?o(0xc0|(c>>>6))+o(0x80|(c&0x3f)):s[i]);return s.join("");}
function updaterecherche(theme,ville){var xmlhttp=null;if(window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();else if(window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
var date=new Date();xmlhttp.open('GET','recherche.php?idvillepb='+ville+'&thema='+theme+'&date='+date,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById('recherche').innerHTML=(xmlhttp.responseText);}}
xmlhttp.send(null);}
