function coche(div)
{if($(div).checked==true){$(div).checked=false;}else{$(div).checked=true;}}
var tab_rech_1=new Array('td_rech_vid','td_rech_tof','td_rech_zik','td_rech_news','td_rech_blog','td_rech_ci');function js_cherche_direct(valeur,id)
{var longueur=tab_rech_1.length;for(var i=0;i<=longueur;i++)
{try{$(tab_rech_1[i]).removeClassName('selected');}catch(e){};$(id).addClassName('selected');}
$('sel_typ_rech').value=valeur;$('achercher').focus();}
function getXhr()
{var xhr=null;if(window.XMLHttpRequest)
{xhr=new XMLHttpRequest();}
else if(window.ActiveXObject)
{try
{xhr=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xhr=new ActiveXObject("Microsoft.XMLHTTP");}}
else
{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");xhr=false;}
return xhr}
function nodeCleaner(n){if(!n.data.replace(/\s/g,''))n.parentNode.removeChild(n);}
function cleanXML(docElement){var node=docElement.getElementsByTagName('*');for(i=0;i<node.length;i++){a=node[i].previousSibling;if(a&&a.nodeType==3)nodeCleaner(a);b=node[i].nextSibling;if(b&&b.nodeType==3)nodeCleaner(b);}
return docElement;}
function refreshActu(rubrique,indice)
{chargement('actualite_'+rubrique);var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('actualite_'+rubrique).innerHTML=xhr.responseText;}}
xhr.open("GET","html/news.php?rubrique="+rubrique+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function rss_news(indice)
{if($('container_actu').innerHTML=='')
{act_news(indice);}}
function act_news(indice)
{chargement('container_actu');var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('container_actu').innerHTML=xhr.responseText;}}
xhr.open("GET","html/lesFlux.php?indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function refreshNews()
{act_news(0);}
function chargement(id_div)
{try{var mot_chargement=$('chargement').innerHTML;$(id_div).innerHTML='<p><img src="images/loader.gif" /> '+mot_chargement+' <img src="images/loader.gif" /></p>';}catch(e){alert(id_div)}}
function afficheActu(rubrique,indice)
{if($('actualite_'+rubrique).innerHTML=='')
{chargement('actualite_'+rubrique);var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('actualite_'+rubrique).innerHTML=xhr.responseText;}}
xhr.open("GET","html/news.php?rubrique="+rubrique+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function refreshActu(rubrique,indice)
{chargement('actualite_'+rubrique);var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('actualite_'+rubrique).innerHTML=xhr.responseText;}}
xhr.open("GET","html/news.php?rubrique="+rubrique+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
document.body.onmousemove=laSouris;var Mouse_X;var Mouse_Y;function laSouris(e)
{var DocRef;if(e){Mouse_X=e.pageX;Mouse_Y=e.pageY;}
else{Mouse_X=event.clientX;Mouse_Y=event.clientY;if(document.documentElement&&document.documentElement.clientWidth){DocRef=document.documentElement;}else{DocRef=document.body;}
Mouse_X+=DocRef.scrollLeft;Mouse_Y+=DocRef.scrollTop;}}
function aff_partage(id,typ)
{try{var mon_X=0;var mon_Y=0
if(Mouse_X+480>screen.availWidth){mon_X=Mouse_X-480}else{mon_X=Mouse_X}
if(Mouse_Y+320>screen.availHeight){mon_Y=Mouse_Y-320}else{mon_Y=Mouse_Y}
$('partage').style.top=mon_Y+"px";$('partage').style.left=mon_X+"px";}catch(e){}
modale();chargement('cont_partage');$('partage').style.display='block';var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{reponse=xhr.responseText;$('cont_partage').innerHTML=reponse;}}
xhr.open("GET","html/partage.php?id="+id+"&typ="+typ,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function modale(){$('wrapper').addClassName('opaque');}
function fermeModale(){$('wrapper').removeClassName('opaque');}
function afficheContact()
{if($('actualite_contacts').innerHTML==''){contactsNews('message',0);}}
function contactsNews(typ,indice)
{chargement('actualite_contacts');var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('actualite_contacts').innerHTML=xhr.responseText;}}
xhr.open("GET","contacts_news.php?typ="+typ+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function statsAnnonces()
{if($('res_browsing').style.display=='none'){Effect.BlindDown('res_browsing');}
affPartAnnonces();chargement('panel_infos');$('panel_infos').innerHTML+=' <span class="lien bleu" onclick="statsAnnonces();">'+$('actualiser').innerHTML+'</span>';var xhr=getXhr()
xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{$('panel_infos').innerHTML=xhr.responseText;}}catch(e){}}
xhr.open("GET","panel/annonce.php?dta");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function affPartAnnonces()
{$('panel_infos_annonces').style.display="none";$('panel_infos').style.display="block";}
function masquePartAnnonces()
{$('panel_infos').style.display="none";$('panel_infos_annonces').style.display="block";}
function annonces_de_typ(typ,indice)
{if($('res_browsing').style.display=='none'){Effect.BlindDown('res_browsing');}
masquePartAnnonces();chargement('panel_infos_annonces');var xhr=getXhr()
xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{$('panel_infos_annonces').innerHTML=xhr.responseText;}}catch(e){}}
xhr.open("GET","panel/annonce.php?typ="+typ+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function suisConnecte()
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{reponse=cleanXML(xhr.responseXML.documentElement);try
{est_connecte=reponse.getElementsByTagName("connecte")[0].firstChild.nodeValue;if(est_connecte==1){return 1;}
else
{var msg=reponse.getElementsByTagName("msg")[0].firstChild.nodeValue;if(confirm(msg)){focus_connection();}
return 0;}}catch(e){return 0;}}}catch(e){}}
xhr.open("GET","html/connecte.php?connecte");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function favoris(typ,id)
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{reponse=cleanXML(xhr.responseXML.documentElement);try
{est_connecte=reponse.getElementsByTagName("connecte")[0].firstChild.nodeValue;if(est_connecte==1)
{var xhr1=getXhr();xhr1.onreadystatechange=function()
{try
{if(xhr1.readyState==4&&xhr1.status==200)
{reponse=cleanXML(xhr1.responseXML.documentElement);try
{var msg=reponse.getElementsByTagName("msg")[0].firstChild.nodeValue;alert(msg);}catch(e){}}}catch(e){}}
xhr1.open("GET","html/signaler.php?favoris="+id+"&typ="+typ);xhr1.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr1.send(null);}
else
{var msg=reponse.getElementsByTagName("msg")[0].firstChild.nodeValue;if(confirm(msg))
{focus_connection();}}}catch(e){return 0;}}}catch(e){}}
xhr.open("GET","html/connecte.php?connecte");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function abus(typ,id)
{var win=new Window('fen_pop_abus',{maximizable:false,minimizable:false,width:400,height:300,draggable:false,resizable:false});win.setAjaxContent("pop/pop_signaler_abus.php?dta&typ="+typ+"&id="+id);win.setDestroyOnClose();win.showCenter();win.show(true);}
function chargeSignalerAbus(req)
{try{var reponse=req.xhRequest.responseText;$('pop_signaler_abus').innerHTML=reponse;}catch(e){}}
function enr_abus()
{var erreur=false;if($('txt_area_s_abus').value=='')
{erreur=true;$('span_erreur_msg_s_abus').className='span_erreur_infobulle'}
if($('input_captcha_s_abus').value=='')
{erreur=true;$('span_erreur_capcha_s_abus').className='span_erreur_infobulle'}
if(erreur==false)
{var id=$('id_article_abus').value;var typ=$('typ_abus').value;var desc=$('txt_area_s_abus').value;var cap=$('input_captcha_s_abus').value;var xhr1=getXhr();xhr1.onreadystatechange=function()
{try
{if(xhr1.readyState==4&&xhr1.status==200)
{reponse=cleanXML(xhr1.responseXML.documentElement);try
{document.images.cap_s_abus.src='capcha/image5.php?id='+Math.round(Math.random(0)*1000)+1;erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;if(erreur==0)
{reset_sign_abus();alert(reponse.getElementsByTagName("msg")[0].firstChild.nodeValue);}
else if(erreur==1)
{var chps=reponse.getElementsByTagName("chp");count=chps.length;for(i=0;i<count;i++)
{try{var nom=chps[i].firstChild.nodeValue;$(nom).className='span_erreur_infobulle';}catch(e){}}}}catch(e){}}}catch(e){}}
xhr1.open("GET","html/signaler.php?enregistrer="+id+"&typ="+typ+"&desc="+desc+"&cap="+cap);xhr1.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr1.send(null);}}
function reset_sign_abus()
{$('txt_area_s_abus').value='';$('input_captcha_s_abus').value=''
$('span_erreur_msg_s_abus').className='cache';$('span_erreur_capcha_s_abus').className='cache';$('txt_area_s_abus').focus();}
function efface_fav(nom_div,typ,id)
{var confirmation=$('sup_fav').innerHTML;if(confirm(confirmation))
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{reponse=cleanXML(xhr.responseXML.documentElement);try
{master_det_der('mes_favoris');}catch(e){}}}catch(e){}}
xhr.open("GET","html/signaler.php?supprimer_id="+id+"&typ="+typ);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function entree(event)
{if(($('login').value!='')&&($('pass').value!=''))
{if(!event&&window.event){event=window.event;}
if(event.keyCode==13)
{valide_connexion();}}}
function entree1(event)
{if(($('login1').value)!=''&&($('pass1').value!=''))
{if(!event&&window.event){event=window.event;}
if(event.keyCode==13)
{viepe_connexion1();}}}
function lance_recherche_dir()
{if($('res_recherche').style.display=='none'){Effect.BlindDown('res_recherche');}
if(trim($('achercher').value)!='')
{chargement('zone_resultats');var achercher=$F('achercher');var sel_typ_rech=$F('sel_typ_rech');var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('zone_resultats').innerHTML=xhr.responseText;}}
xhr.open("POST","html/recherche_multi_direct.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("achercher="+achercher+"&sel_typ_rech="+sel_typ_rech);}}
function plus_de_videos()
{if($('ext_video').style.display=='none'){Effect.BlindDown('ext_video');}
chargement('zone_resultats_videos');if(window.lance_recherche_videos)
{lance_recherche_videos();}
else
{var oScript=document.createElement("script");oScript.src="javascript/dyn_plus_de_vids.js";document.body.appendChild(oScript);}}
function plus_de_photos()
{if($('ext_photo').style.display=='none'){Effect.BlindDown('ext_photo');}
chargement('zone_resultats_photos');if(window.lance_recherche_photos)
{lance_recherche_photos();}
else
{var oScript=document.createElement("script");oScript.src="javascript/dyn_plus_de_tofs.js";document.body.appendChild(oScript);}}
function plus_de_news(rubrique)
{$('actualite_'+rubrique).innerHTML='';if($('ext_'+rubrique).style.display=='none'){Effect.BlindDown('ext_'+rubrique);}
afficheActu(rubrique,0);}
function trim(chaine)
{return chaine.replace(/^\s+/g,'').replace(/\s+$/g,'')}
function lance_recherche_page(cat,indice)
{if($('res_recherche').style.display=='none'){Effect.BlindDown('res_recherche');}
if(trim($('achercher').value)!='')
{chargement('zone_resultats');var achercher=$F('achercher');var sel_typ_rech=cat;var indice=indice;var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('zone_resultats').innerHTML=xhr.responseText;}}
xhr.open("POST","html/recherche_multi_direct.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("achercher="+achercher+"&sel_typ_rech="+sel_typ_rech+"&indice="+indice);}}
function parcourir_categorie(cat,rubrique,indice)
{affiche_zone_resultats();var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('zone_resultats').innerHTML=xhr.responseText;}}
xhr.open("GET","html/parc_rubrique.php?rubrique="+rubrique+"&cat="+cat+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
var couleur='#EDF2F7';function ent_par_ville(id,indice)
{affResultats_parc_ci();chargement('cont_resultats_parc_ci');var ville=$F('sel_ville_recherche');var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('cont_resultats_parc_ci').innerHTML=xhr.responseText;}}
xhr.open("GET","html/recherche_multi.php?ville="+ville+"&id="+id+"&indice="+indice);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function affiche_rubriques(cat)
{affiche_zone_resultats();var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('zone_resultats').innerHTML=xhr.responseText;}}
xhr.open("GET","html/rubriques.php?dta="+cat);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function affResultats_parc_ci()
{$('parc_ci').style.display='none';$('resultats_parc_ci').style.display='block';}
function masqueResultats_parc_ci()
{try
{$('resultats_parc_ci').style.display='none';$('parc_ci').style.display='block';}
catch(e){}}
function info_checkbox()
{var info=$('checkbox_login').innerHTML;affiche('info');}
function masque_info_checkbox()
{masque();}
function valide_connexion()
{try{$('btn_valide_connexion').addClassName('input_desactive');}catch(e){}
viepe_connexion();}
function viepe_connexion()
{try{$('btn_valide_connexion').addClassName('input_desactive');}catch(e){}
var login=$F('login');var pass=$F('pass');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;if(erreur==0)
{$('bloc_connecte').innerHTML=reponse.getElementsByTagName("message")[0].firstChild.nodeValue;$('login').value='';$('pass').value='';afficheDeconn();contactsNews('message',0);}
else
{alert(reponse.getElementsByTagName("message")[0].firstChild.nodeValue);}}
catch(e){alert(e);}
try{$('btn_valide_connexion').removeClassName('input_desactive');}catch(e){}}}
xhr.open("POST","suser/login_page.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("login="+login+"&pass="+pass);}
function viepe_connexion1()
{try{$('btn_valide_connexion1').addClassName('input_desactive');}catch(e){}
var login=$F('login1');var pass=$F('pass1');var ouvrir=$('ouvrir').innerHTML;var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;if(erreur==0)
{pop_login.hide();$('bloc_connecte').innerHTML=reponse.getElementsByTagName("message")[0].firstChild.nodeValue;$('login1').value='';$('pass1').value='';afficheDeconn();contactsNews('message',0);try
{a_ouvrir=reponse.getElementsByTagName("ouvrir")[0].firstChild.nodeValue;if(a_ouvrir!='')
{master_det_der(a_ouvrir);}}catch(e){alert(e);}}
else
{alert(reponse.getElementsByTagName("message")[0].firstChild.nodeValue);}}
catch(e){alert(e);}
try{$('btn_valide_connexion1').removeClassName('input_desactive');}catch(e){}}}
xhr.open("POST","suser/login_page.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("login="+login+"&pass="+pass+"&ouvrir="+ouvrir);}
function afficheDeconn()
{$('bloc_login').style.display='none';$('bloc_connecte').style.display='block';}
function masqueDeconn()
{$('bloc_connecte').style.display='none';$('bloc_login').style.display='block';}
function deconnexion()
{var confirmation=$('fermer_session').innerHTML;if(confirm(confirmation))
{var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;if(erreur==0)
{masqueDeconn();$('bloc_connecte').innerHTML='';$('actualite_contacts').innerHTML='';}}
catch(e){alert(e);}}}
xhr.open("GET","html/deconnexion.php?deconnexion=1");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
var Window=Class.create();Window.keepMultiModalWindow=false;Window.hasEffectLib=(typeof Effect!='undefined');Window.resizeEffectDuration=0.4;Window.prototype={initialize:function(){var id;var optionIndex=0;if(arguments.length>0){if(typeof arguments[0]=="string"){id=arguments[0];optionIndex=1;}
else
id=arguments[0]?arguments[0].id:null;}
if(!id)
id="window_"+new Date().getTime();if($(id))
alert("Window "+id+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");this.options=Object.extend({className:"dialog",blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:"&nbsp;",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[optionIndex]||{});if(this.options.blurClassName)
this.options.focusClassName=this.options.className;if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined")
this.options.top=this._round(Math.random()*500,this.options.gridY);if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined")
this.options.left=this._round(Math.random()*500,this.options.gridX);if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear)
this.options.showEffectOptions.to=this.options.opacity;}
if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear)
this.options.showEffectOptions.to=this.options.opacity;if(this.options.hideEffect==Effect.Fade)
this.options.hideEffectOptions.from=this.options.opacity;}
if(this.options.hideEffect==Element.hide)
this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose)this.destroy();}.bind(this)
if(this.options.parent!=document.body)
this.options.parent=$(this.options.parent);this.element=this._createWindow(id);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var that=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(element){element.observe("mousedown",that.eventMouseDown);element.addClassName("top_draggable");});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(element){element.observe("mousedown",that.eventMouseDown);element.addClassName("bottom_draggable");});}
if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown);}
this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+'px'});this.useLeft=true;}
else{this.element.setStyle({right:parseFloat(this.options.right)+'px'});this.useLeft=false;}
if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+'px'});this.useTop=true;}
else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+'px'});this.useTop=false;}
this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex)
this.setZIndex(this.options.zIndex)
if(this.options.destroyOnClose)
this.setDestroyOnClose(true);this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height)
this.setSize(this.options.width,this.options.height);this.setTitle(this.options.title)
Windows.register(this);},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var content=this.getContent();var originalContent=null;for(var i=0;i<content.childNodes.length;i++){originalContent=content.childNodes[i];if(originalContent.nodeType==1)
break;originalContent=null;}
if(originalContent)
this._oldParent.appendChild(originalContent);this._oldParent=null;}
if(this.sizer)
Event.stopObserving(this.sizer,"mousedown",this.eventMouseDown);if(this.options.url)
this.content.src=null
if(this.iefix)
Element.remove(this.iefix);Element.remove(this.element);Windows.unregister(this);},setCloseCallback:function(callback){this.options.closeCallback=callback;},getContent:function(){return this.content;},setContent:function(id,autoresize,autoposition){var element=$(id);if(null==element)throw"Unable to find element '"+id+"' in DOM";this._oldParent=element.parentNode;var d=null;var p=null;if(autoresize)
d=Element.getDimensions(element);if(autoposition)
p=Position.cumulativeOffset(element);var content=this.getContent();this.setHTMLContent("");content=this.getContent();content.appendChild(element);element.show();if(autoresize)
this.setSize(d.width,d.height);if(autoposition)
this.setLocation(p[1]-this.heightN,p[0]-this.widthW);},setHTMLContent:function(html){if(this.options.url){this.content.src=null;this.options.url=null;var content="<div id=\""+this.getId()+"_content\" class=\""+this.options.className+"_content\"> </div>";$(this.getId()+"_table_content").innerHTML=content;this.content=$(this.element.id+"_content");}
this.getContent().innerHTML=html;},setAjaxContent:function(url,options,showCentered,showModal){this.showFunction=showCentered?"showCenter":"show";this.showModal=showModal||false;options=options||{};this.setHTMLContent("");this.onComplete=options.onComplete;if(!this._onCompleteHandler)
this._onCompleteHandler=this._setAjaxContent.bind(this);options.onComplete=this._onCompleteHandler;new Ajax.Request(url,options);options.onComplete=this.onComplete;},_setAjaxContent:function(originalRequest){Element.update(this.getContent(),originalRequest.responseText);if(this.onComplete)
this.onComplete(originalRequest);this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(url){if(this.options.url)
this.content.src=null;this.options.url=url;var content="<iframe frameborder='0' name='"+this.getId()+"_content'  id='"+this.getId()+"_content' src='"+url+"' width='"+this.width+"' height='"+this.height+"'> </iframe>";$(this.getId()+"_table_content").innerHTML=content;this.content=$(this.element.id+"_content");},getURL:function(){return this.options.url?this.options.url:null;},refresh:function(){if(this.options.url)
$(this.element.getAttribute('id')+'_content').src=this.options.url;},setCookie:function(name,expires,path,domain,secure){name=name||this.element.id;this.cookie=[name,expires,path,domain,secure];var value=WindowUtilities.getCookie(name)
if(value){var values=value.split(',');var x=values[0].split(':');var y=values[1].split(':');var w=parseFloat(values[2]),h=parseFloat(values[3]);var mini=values[4];var maxi=values[5];this.setSize(w,h);if(mini=="true")
this.doMinimize=true;else if(maxi=="true")
this.doMaximize=true;this.useLeft=x[0]=="l";this.useTop=y[0]=="t";this.element.setStyle(this.useLeft?{left:x[1]}:{right:x[1]});this.element.setStyle(this.useTop?{top:y[1]}:{bottom:y[1]});}},getId:function(){return this.element.id;},setDestroyOnClose:function(){this.options.destroyOnClose=true;},setConstraint:function(bool,padding){this.constraint=bool;this.constraintPad=Object.extend(this.constraintPad,padding||{});if(this.useTop&&this.useLeft)
this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left));},_initDrag:function(event){if(Event.element(event)==this.sizer&&this.isMinimized())
return;if(Event.element(event)!=this.sizer&&this.isMaximized())
return;if(Prototype.Browser.IE&&this.heightN==0)
this._getWindowBorderSize();this.pointer=[this._round(Event.pointerX(event),this.options.gridX),this._round(Event.pointerY(event),this.options.gridY)];if(this.options.wiredDrag)
this.currentDrag=this._createWiredElement();else
this.currentDrag=this.element;if(Event.element(event)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle('bottom'));this.rightOrg=parseFloat(this.element.getStyle('right'));this._notify("onStartResize");}
else{this.doResize=false;var closeButton=$(this.getId()+'_close');if(closeButton&&Position.within(closeButton,this.pointer[0],this.pointer[1])){this.currentDrag=null;return;}
this.toFront();if(!this.options.draggable)
return;this._notify("onStartMove");}
Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen('__invisible__','__invisible__',this.overlayOpacity);document.body.ondrag=function(){return false;};document.body.onselectstart=function(){return false;};this.currentDrag.show();Event.stop(event);},_round:function(val,round){return round==1?val:val=Math.floor(val/round)*round;},_updateDrag:function(event){var pointer=[this._round(Event.pointerX(event),this.options.gridX),this._round(Event.pointerY(event),this.options.gridY)];var dx=pointer[0]-this.pointer[0];var dy=pointer[1]-this.pointer[1];if(this.doResize){var w=this.widthOrg+dx;var h=this.heightOrg+dy;dx=this.width-this.widthOrg
dy=this.height-this.heightOrg
if(this.useLeft)
w=this._updateWidthConstraint(w)
else
this.currentDrag.setStyle({right:(this.rightOrg-dx)+'px'});if(this.useTop)
h=this._updateHeightConstraint(h)
else
this.currentDrag.setStyle({bottom:(this.bottomOrg-dy)+'px'});this.setSize(w,h);this._notify("onResize");}
else{this.pointer=pointer;if(this.useLeft){var left=parseFloat(this.currentDrag.getStyle('left'))+dx;var newLeft=this._updateLeftConstraint(left);this.pointer[0]+=newLeft-left;this.currentDrag.setStyle({left:newLeft+'px'});}
else
this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle('right'))-dx+'px'});if(this.useTop){var top=parseFloat(this.currentDrag.getStyle('top'))+dy;var newTop=this._updateTopConstraint(top);this.pointer[1]+=newTop-top;this.currentDrag.setStyle({top:newTop+'px'});}
else
this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle('bottom'))-dy+'px'});this._notify("onMove");}
if(this.iefix)
this._fixIEOverlapping();this._removeStoreLocation();Event.stop(event);},_endDrag:function(event){WindowUtilities.enableScreen('__invisible__');if(this.doResize)
this._notify("onEndResize");else
this._notify("onEndMove");Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(event);this._hideWiredElement();this._saveCookie()
document.body.ondrag=null;document.body.onselectstart=null;},_updateLeftConstraint:function(left){if(this.constraint&&this.useLeft&&this.useTop){var width=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(left<this.constraintPad.left)
left=this.constraintPad.left;if(left+this.width+this.widthE+this.widthW>width-this.constraintPad.right)
left=width-this.constraintPad.right-this.width-this.widthE-this.widthW;}
return left;},_updateTopConstraint:function(top){if(this.constraint&&this.useLeft&&this.useTop){var height=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var h=this.height+this.heightN+this.heightS;if(top<this.constraintPad.top)
top=this.constraintPad.top;if(top+h>height-this.constraintPad.bottom)
top=height-this.constraintPad.bottom-h;}
return top;},_updateWidthConstraint:function(w){if(this.constraint&&this.useLeft&&this.useTop){var width=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var left=parseFloat(this.element.getStyle("left"));if(left+w+this.widthE+this.widthW>width-this.constraintPad.right)
w=width-this.constraintPad.right-left-this.widthE-this.widthW;}
return w;},_updateHeightConstraint:function(h){if(this.constraint&&this.useLeft&&this.useTop){var height=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var top=parseFloat(this.element.getStyle("top"));if(top+h+this.heightN+this.heightS>height-this.constraintPad.bottom)
h=height-this.constraintPad.bottom-top-this.heightN-this.heightS;}
return h;},_createWindow:function(id){var className=this.options.className;var win=document.createElement("div");win.setAttribute('id',id);win.className="dialog";var content;if(this.options.url)
content="<iframe frameborder=\"0\" name=\""+id+"_content\"  id=\""+id+"_content\" src=\""+this.options.url+"\"> </iframe>";else
content="<div id=\""+id+"_content\" class=\""+className+"_content\"> </div>";var closeDiv=this.options.closable?"<div class='"+className+"_close' id='"+id+"_close' onclick='Windows.close(\""+id+"\", event)'> </div>":"";var minDiv=this.options.minimizable?"<div class='"+className+"_minimize' id='"+id+"_minimize' onclick='Windows.minimize(\""+id+"\", event)'> </div>":"";var maxDiv=this.options.maximizable?"<div class='"+className+"_maximize' id='"+id+"_maximize' onclick='Windows.maximize(\""+id+"\", event)'> </div>":"";var seAttributes=this.options.resizable?"class='"+className+"_sizer' id='"+id+"_sizer'":"class='"+className+"_se'";var blank="../themes/default/blank.gif";win.innerHTML=closeDiv+minDiv+maxDiv+"\
      <table id='"+id+"_row1' class=\"top table_window\">\
        <tr>\
          <td class='"+className+"_nw'></td>\
          <td class='"+className+"_n'><div id='"+id+"_top' class='"+className+"_title title_window'>"+this.options.title+"</div></td>\
          <td class='"+className+"_ne'></td>\
        </tr>\
      </table>\
      <table id='"+id+"_row2' class=\"mid table_window\">\
        <tr>\
          <td class='"+className+"_w'></td>\
            <td id='"+id+"_table_content' class='"+className+"_content' valign='top'>"+content+"</td>\
          <td class='"+className+"_e'></td>\
        </tr>\
      </table>\
        <table id='"+id+"_row3' class=\"bot table_window\">\
        <tr>\
          <td class='"+className+"_sw'></td>\
            <td class='"+className+"_s'><div id='"+id+"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\
            <td "+seAttributes+"></td>\
        </tr>\
      </table>\
    ";Element.hide(win);this.options.parent.insertBefore(win,this.options.parent.firstChild);Event.observe($(id+"_content"),"load",this.options.onload);return win;},changeClassName:function(newClassName){var className=this.options.className;var id=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(value){this._toggleClassName($(id+value),className+value,newClassName+value)}.bind(this));this._toggleClassName($(id+"_top"),className+"_title",newClassName+"_title");$$("#"+id+" td").each(function(td){td.className=td.className.sub(className,newClassName);});this.options.className=newClassName;},_toggleClassName:function(element,oldClassName,newClassName){if(element){element.removeClassName(oldClassName);element.addClassName(newClassName);}},setLocation:function(top,left){top=this._updateTopConstraint(top);left=this._updateLeftConstraint(left);var e=this.currentDrag||this.element;e.setStyle({top:top+'px'});e.setStyle({left:left+'px'});this.useLeft=true;this.useTop=true;},getLocation:function(){var location={};if(this.useTop)
location=Object.extend(location,{top:this.element.getStyle("top")});else
location=Object.extend(location,{bottom:this.element.getStyle("bottom")});if(this.useLeft)
location=Object.extend(location,{left:this.element.getStyle("left")});else
location=Object.extend(location,{right:this.element.getStyle("right")});return location;},getSize:function(){return{width:this.width,height:this.height};},setSize:function(width,height,useEffect){width=parseFloat(width);height=parseFloat(height);if(!this.minimized&&width<this.options.minWidth)
width=this.options.minWidth;if(!this.minimized&&height<this.options.minHeight)
height=this.options.minHeight;if(this.options.maxHeight&&height>this.options.maxHeight)
height=this.options.maxHeight;if(this.options.maxWidth&&width>this.options.maxWidth)
width=this.options.maxWidth;if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&useEffect){new Effect.ResizeWindow(this,null,null,width,height,{duration:Window.resizeEffectDuration});}else{this.width=width;this.height=height;var e=this.currentDrag?this.currentDrag:this.element;e.setStyle({width:width+this.widthW+this.widthE+"px"})
e.setStyle({height:height+this.heightN+this.heightS+"px"})
if(!this.currentDrag||this.currentDrag==this.element){var content=$(this.element.id+'_content');content.setStyle({height:height+'px'});content.setStyle({width:width+'px'});}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true);},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true);},toFront:function(){if(this.element.style.zIndex<Windows.maxZIndex)
this.setZIndex(Windows.maxZIndex+1);if(this.iefix)
this._fixIEOverlapping();},getBounds:function(insideOnly){if(!this.width||!this.height||!this.visible)
this.computeBounds();var w=this.width;var h=this.height;if(!insideOnly){w+=this.widthW+this.widthE;h+=this.heightN+this.heightS;}
var bounds=Object.extend(this.getLocation(),{width:w+"px",height:h+"px"});return bounds;},computeBounds:function(){if(!this.width||!this.height){var size=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0,this.options.className)
if(this.height)
this.width=size+5
else
this.height=size+5}
this.setSize(this.width,this.height);if(this.centered)
this._center(this.centerTop,this.centerLeft);},show:function(modal){this.visible=true;if(modal){if(typeof this.overlayOpacity=="undefined"){var that=this;setTimeout(function(){that.show(modal)},10);return;}
Windows.addModalWindow(this);this.modal=true;this.setZIndex(Windows.maxZIndex+1);Windows.unsetOverflow(this);}
else
if(!this.element.style.zIndex)
this.setZIndex(Windows.maxZIndex+1);if(this.oldStyle)
this.getContent().setStyle({overflow:this.oldStyle});this.computeBounds();this._notify("onBeforeShow");if(this.options.showEffect!=Element.show&&this.options.showEffectOptions)
this.options.showEffect(this.element,this.options.showEffectOptions);else
this.options.showEffect(this.element);this._checkIEOverlapping();WindowUtilities.focusedWindow=this
this._notify("onShow");},showCenter:function(modal,top,left){this.centered=true;this.centerTop=top;this.centerLeft=left;this.show(modal);},isVisible:function(){return this.visible;},_center:function(top,left){var windowScroll=WindowUtilities.getWindowScroll(this.options.parent);var pageSize=WindowUtilities.getPageSize(this.options.parent);if(typeof top=="undefined")
top=(pageSize.windowHeight-(this.height+this.heightN+this.heightS))/2;top+=windowScroll.top
if(typeof left=="undefined")
left=(pageSize.windowWidth-(this.width+this.widthW+this.widthE))/2;left+=windowScroll.left
this.setLocation(top,left);this.toFront();},_recenter:function(event){if(this.centered){var pageSize=WindowUtilities.getPageSize(this.options.parent);var windowScroll=WindowUtilities.getWindowScroll(this.options.parent);if(this.pageSize&&this.pageSize.windowWidth==pageSize.windowWidth&&this.pageSize.windowHeight==pageSize.windowHeight&&this.windowScroll.left==windowScroll.left&&this.windowScroll.top==windowScroll.top)
return;this.pageSize=pageSize;this.windowScroll=windowScroll;if($('overlay_modal'))
$('overlay_modal').setStyle({height:(pageSize.pageHeight+'px')});if(this.options.recenterAuto)
this._center(this.centerTop,this.centerLeft);}},hide:function(){this.visible=false;if(this.modal){Windows.removeModalWindow(this);Windows.resetOverflow();}
this.oldStyle=this.getContent().getStyle('overflow')||"auto"
this.getContent().setStyle({overflow:"hidden"});this.options.hideEffect(this.element,this.options.hideEffectOptions);if(this.iefix)
this.iefix.hide();if(!this.doNotNotifyHide)
this._notify("onHide");},close:function(){if(this.visible){if(this.options.closeCallback&&!this.options.closeCallback(this))
return;if(this.options.destroyOnClose){var destroyFunc=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var func=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){func();destroyFunc()}}
else
this.options.hideEffectOptions.afterFinish=function(){destroyFunc()}}
Windows.updateFocusedWindow();this.doNotNotifyHide=true;this.hide();this.doNotNotifyHide=false;this._notify("onClose");}},minimize:function(){if(this.resizing)
return;var r2=$(this.getId()+"_row2");if(!this.minimized){this.minimized=true;var dh=r2.getDimensions().height;this.r2Height=dh;var h=this.element.getHeight()-dh;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,null,null,null,this.height-dh,{duration:Window.resizeEffectDuration});}else{this.height-=dh;this.element.setStyle({height:h+"px"});r2.hide();}
if(!this.useTop){var bottom=parseFloat(this.element.getStyle('bottom'));this.element.setStyle({bottom:(bottom+dh)+'px'});}}
else{this.minimized=false;var dh=this.r2Height;this.r2Height=null;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,null,null,null,this.height+dh,{duration:Window.resizeEffectDuration});}
else{var h=this.element.getHeight()+dh;this.height+=dh;this.element.setStyle({height:h+"px"})
r2.show();}
if(!this.useTop){var bottom=parseFloat(this.element.getStyle('bottom'));this.element.setStyle({bottom:(bottom-dh)+'px'});}
this.toFront();}
this._notify("onMinimize");this._saveCookie()},maximize:function(){if(this.isMinimized()||this.resizing)
return;if(Prototype.Browser.IE&&this.heightN==0)
this._getWindowBorderSize();if(this.storedLocation!=null){this._restoreLocation();if(this.iefix)
this.iefix.hide();}
else{this._storeLocation();Windows.unsetOverflow(this);var windowScroll=WindowUtilities.getWindowScroll(this.options.parent);var pageSize=WindowUtilities.getPageSize(this.options.parent);var left=windowScroll.left;var top=windowScroll.top;if(this.options.parent!=document.body){windowScroll={top:0,left:0,bottom:0,right:0};var dim=this.options.parent.getDimensions();pageSize.windowWidth=dim.width;pageSize.windowHeight=dim.height;top=0;left=0;}
if(this.constraint){pageSize.windowWidth-=Math.max(0,this.constraintPad.left)+Math.max(0,this.constraintPad.right);pageSize.windowHeight-=Math.max(0,this.constraintPad.top)+Math.max(0,this.constraintPad.bottom);left+=Math.max(0,this.constraintPad.left);top+=Math.max(0,this.constraintPad.top);}
var width=pageSize.windowWidth-this.widthW-this.widthE;var height=pageSize.windowHeight-this.heightN-this.heightS;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,top,left,width,height,{duration:Window.resizeEffectDuration});}
else{this.setSize(width,height);this.element.setStyle(this.useLeft?{left:left}:{right:left});this.element.setStyle(this.useTop?{top:top}:{bottom:top});}
this.toFront();if(this.iefix)
this._fixIEOverlapping();}
this._notify("onMaximize");this._saveCookie()},isMinimized:function(){return this.minimized;},isMaximized:function(){return(this.storedLocation!=null);},setOpacity:function(opacity){if(Element.setOpacity)
Element.setOpacity(this.element,opacity);},setZIndex:function(zindex){this.element.setStyle({zIndex:zindex});Windows.updateZindex(zindex,this);},setTitle:function(newTitle){if(!newTitle||newTitle=="")
newTitle="&nbsp;";Element.update(this.element.id+'_top',newTitle);},getTitle:function(){return $(this.element.id+'_top').innerHTML;},setStatusBar:function(element){var statusBar=$(this.getId()+"_bottom");if(typeof(element)=="object"){if(this.bottombar.firstChild)
this.bottombar.replaceChild(element,this.bottombar.firstChild);else
this.bottombar.appendChild(element);}
else
this.bottombar.innerHTML=element;},_checkIEOverlapping:function(){if(!this.iefix&&(navigator.appVersion.indexOf('MSIE')>0)&&(navigator.userAgent.indexOf('Opera')<0)&&(this.element.getStyle('position')=='absolute')){new Insertion.After(this.element.id,'<iframe id="'+this.element.id+'_iefix" '+'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" '+'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.element.id+'_iefix');}
if(this.iefix)
setTimeout(this._fixIEOverlapping.bind(this),50);},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show();},_getWindowBorderSize:function(event){var div=this._createHiddenDiv(this.options.className+"_n")
this.heightN=Element.getDimensions(div).height;div.parentNode.removeChild(div)
var div=this._createHiddenDiv(this.options.className+"_s")
this.heightS=Element.getDimensions(div).height;div.parentNode.removeChild(div)
var div=this._createHiddenDiv(this.options.className+"_e")
this.widthE=Element.getDimensions(div).width;div.parentNode.removeChild(div)
var div=this._createHiddenDiv(this.options.className+"_w")
this.widthW=Element.getDimensions(div).width;div.parentNode.removeChild(div);var div=document.createElement("div");div.className="overlay_"+this.options.className;document.body.appendChild(div);var that=this;setTimeout(function(){that.overlayOpacity=($(div).getStyle("opacity"));div.parentNode.removeChild(div);},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height;}
if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420)
this.setSize(this.width,this.height);if(this.doMaximize)
this.maximize();if(this.doMinimize)
this.minimize();},_createHiddenDiv:function(className){var objBody=document.body;var win=document.createElement("div");win.setAttribute('id',this.element.id+"_tmp");win.className=className;win.style.display='none';win.innerHTML='';objBody.insertBefore(win,objBody.firstChild);return win;},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle('top'),bottom:this.element.getStyle('bottom'),left:this.element.getStyle('left'),right:this.element.getStyle('right'),width:this.width,height:this.height};}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow)
new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration});else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height);}
Windows.resetOverflow();this._removeStoreLocation();}},_removeStoreLocation:function(){this.storedLocation=null;},_saveCookie:function(){if(this.cookie){var value="";if(this.useLeft)
value+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle('left'))
else
value+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle('right'))
if(this.useTop)
value+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle('top'))
else
value+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle('bottom'))
value+=","+(this.storedLocation?this.storedLocation.width:this.width);value+=","+(this.storedLocation?this.storedLocation.height:this.height);value+=","+this.isMinimized();value+=","+this.isMaximized();WindowUtilities.setCookie(value,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE)
this._getWindowBorderSize();var div=document.createElement("div");div.className="wired_frame "+this.options.className+"_wired_frame";div.style.position='absolute';this.options.parent.insertBefore(div,this.options.parent.firstChild);this.wiredElement=$(div);}
if(this.useLeft)
this.wiredElement.setStyle({left:this.element.getStyle('left')});else
this.wiredElement.setStyle({right:this.element.getStyle('right')});if(this.useTop)
this.wiredElement.setStyle({top:this.element.getStyle('top')});else
this.wiredElement.setStyle({bottom:this.element.getStyle('bottom')});var dim=this.element.getDimensions();this.wiredElement.setStyle({width:dim.width+"px",height:dim.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement;},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag)
return;if(this.currentDrag==this.element)
this.currentDrag=null;else{if(this.useLeft)
this.element.setStyle({left:this.currentDrag.getStyle('left')});else
this.element.setStyle({right:this.currentDrag.getStyle('right')});if(this.useTop)
this.element.setStyle({top:this.currentDrag.getStyle('top')});else
this.element.setStyle({bottom:this.currentDrag.getStyle('bottom')});this.currentDrag.hide();this.currentDrag=null;if(this.doResize)
this.setSize(this.width,this.height);}},_notify:function(eventName){if(this.options[eventName])
this.options[eventName](this);else
Windows.notify(eventName,this);}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(observer){this.removeObserver(observer);this.observers.push(observer);},removeObserver:function(observer){this.observers=this.observers.reject(function(o){return o==observer});},notify:function(eventName,win){this.observers.each(function(o){if(o[eventName])o[eventName](eventName,win);});},getWindow:function(id){return this.windows.detect(function(d){return d.getId()==id});},getFocusedWindow:function(){return this.focusedWindow;},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null;},register:function(win){this.windows.push(win);},addModalWindow:function(win){if(this.modalWindows.length==0){WindowUtilities.disableScreen(win.options.className,'overlay_modal',win.overlayOpacity,win.getId(),win.options.parent);}
else{if(Window.keepMultiModalWindow){$('overlay_modal').style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId());}
else
this.modalWindows.last().element.hide();WindowUtilities._showSelect(win.getId());}
this.modalWindows.push(win);},removeModalWindow:function(win){this.modalWindows.pop();if(this.modalWindows.length==0)
WindowUtilities.enableScreen();else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId());}
else
this.modalWindows.last().element.show();}},register:function(win){this.windows.push(win);},unregister:function(win){this.windows=this.windows.reject(function(d){return d==win});},closeAll:function(){this.windows.each(function(w){Windows.close(w.getId())});},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(win){if(win)win.close()});},minimize:function(id,event){var win=this.getWindow(id)
if(win&&win.visible)
win.minimize();Event.stop(event);},maximize:function(id,event){var win=this.getWindow(id)
if(win&&win.visible)
win.maximize();Event.stop(event);},close:function(id,event){var win=this.getWindow(id);if(win)
win.close();if(event)
Event.stop(event);},blur:function(id){var win=this.getWindow(id);if(!win)
return;if(win.options.blurClassName)
win.changeClassName(win.options.blurClassName);if(this.focusedWindow==win)
this.focusedWindow=null;win._notify("onBlur");},focus:function(id){var win=this.getWindow(id);if(!win)
return;if(this.focusedWindow)
this.blur(this.focusedWindow.getId())
if(win.options.focusClassName)
win.changeClassName(win.options.focusClassName);this.focusedWindow=win;win._notify("onFocus");},unsetOverflow:function(except){this.windows.each(function(d){d.oldOverflow=d.getContent().getStyle("overflow")||"auto";d.getContent().setStyle({overflow:"hidden"})});if(except&&except.oldOverflow)
except.getContent().setStyle({overflow:except.oldOverflow});},resetOverflow:function(){this.windows.each(function(d){if(d.oldOverflow)d.getContent().setStyle({overflow:d.oldOverflow})});},updateZindex:function(zindex,win){if(zindex>this.maxZIndex){this.maxZIndex=zindex;if(this.focusedWindow)
this.blur(this.focusedWindow.getId())}
this.focusedWindow=win;if(this.focusedWindow)
this.focus(this.focusedWindow.getId())}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.confirm);return}
content=content||"";parameters=parameters||{};var okLabel=parameters.okLabel?parameters.okLabel:"Ok";var cancelLabel=parameters.cancelLabel?parameters.cancelLabel:"Cancel";parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var okButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" ok_button'"
var cancelButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" cancel_button'"
var content="\
      <div class='"+parameters.className+"_message'>"+content+"</div>\
        <div class='"+parameters.className+"_buttons'>\
          <input type='button' value='"+okLabel+"' onclick='Dialog.okCallback()' "+okButtonClass+"/>\
          <input type='button' value='"+cancelLabel+"' onclick='Dialog.cancelCallback()' "+cancelButtonClass+"/>\
        </div>\
    ";return this._openDialog(content,parameters)},alert:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.alert);return}
content=content||"";parameters=parameters||{};var okLabel=parameters.okLabel?parameters.okLabel:"Ok";parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var okButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" ok_button'"
var content="\
      <div class='"+parameters.className+"_message'>"+content+"</div>\
        <div class='"+parameters.className+"_buttons'>\
          <input type='button' value='"+okLabel+"' onclick='Dialog.okCallback()' "+okButtonClass+"/>\
        </div>";return this._openDialog(content,parameters)},info:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.info);return}
content=content||"";parameters=parameters||{};parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var content="<div id='modal_dialog_message' class='"+parameters.className+"_message'>"+content+"</div>";if(parameters.showProgress)
content+="<div id='modal_dialog_progress' class='"+parameters.className+"_progress'>  </div>";parameters.ok=null;parameters.cancel=null;return this._openDialog(content,parameters)},setInfoMessage:function(message){$('modal_dialog_message').update(message);},closeInfo:function(){Windows.close(this.dialogId);},_openDialog:function(content,parameters){var className=parameters.className;if(!parameters.height&&!parameters.width){parameters.width=WindowUtilities.getPageSize(parameters.options.parent||document.body).pageWidth/2;}
if(parameters.id)
this.dialogId=parameters.id;else{var t=new Date();this.dialogId='modal_dialog_'+t.getTime();parameters.id=this.dialogId;}
if(!parameters.height||!parameters.width){var size=WindowUtilities._computeSize(content,this.dialogId,parameters.width,parameters.height,5,className)
if(parameters.height)
parameters.width=size+5
else
parameters.height=size+5}
parameters.effectOptions=parameters.effectOptions;parameters.resizable=parameters.resizable||false;parameters.minimizable=parameters.minimizable||false;parameters.maximizable=parameters.maximizable||false;parameters.draggable=parameters.draggable||false;parameters.closable=parameters.closable||false;var win=new Window(parameters);win.getContent().innerHTML=content;win.showCenter(true,parameters.top,parameters.left);win.setDestroyOnClose();win.cancelCallback=parameters.onCancel||parameters.cancel;win.okCallback=parameters.onOk||parameters.ok;return win;},_getAjaxContent:function(originalRequest){Dialog.callFunc(originalRequest.responseText,Dialog.parameters)},_runAjaxRequest:function(message,parameters,callFunc){if(message.options==null)
message.options={}
Dialog.onCompleteFunc=message.options.onComplete;Dialog.parameters=parameters;Dialog.callFunc=callFunc;message.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(message.url,message.options);},okCallback:function(){var win=Windows.focusedWindow;if(!win.okCallback||win.okCallback(win)){$$("#"+win.getId()+" input").each(function(element){element.onclick=null;})
win.close();}},cancelCallback:function(){var win=Windows.focusedWindow;$$("#"+win.getId()+" input").each(function(element){element.onclick=null})
win.close();if(win.cancelCallback)
win.cancelCallback(win);}}
if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1]);}
var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;parent=parent||document.body;if(parent!=document.body){T=parent.scrollTop;L=parent.scrollLeft;W=parent.scrollWidth;H=parent.scrollHeight;}
else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}
if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight}}}
return{top:T,left:L,width:W,height:H};},getPageSize:function(parent){parent=parent||document.body;var windowWidth,windowHeight;var pageHeight,pageWidth;if(parent!=document.body){windowWidth=parent.getWidth();windowHeight=parent.getHeight();pageWidth=parent.scrollWidth;pageHeight=parent.scrollHeight;}
else{var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}}
return{pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:windowWidth,windowHeight:windowHeight};},disableScreen:function(className,overlayId,overlayOpacity,contentId,parent){WindowUtilities.initLightbox(overlayId,className,function(){this._disableScreen(className,overlayId,overlayOpacity,contentId)}.bind(this),parent||document.body);},_disableScreen:function(className,overlayId,overlayOpacity,contentId){var objOverlay=$(overlayId);var pageSize=WindowUtilities.getPageSize(objOverlay.parentNode);if(contentId&&Prototype.Browser.IE){WindowUtilities._hideSelect();WindowUtilities._showSelect(contentId);}
objOverlay.style.height=(pageSize.pageHeight+'px');objOverlay.style.display='none';if(overlayId=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayShowEffectOptions){objOverlay.overlayOpacity=overlayOpacity;new Effect.Appear(objOverlay,Object.extend({from:0,to:overlayOpacity},Windows.overlayShowEffectOptions));}
else
objOverlay.style.display="block";},enableScreen:function(id){id=id||'overlay_modal';var objOverlay=$(id);if(objOverlay){if(id=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayHideEffectOptions)
new Effect.Fade(objOverlay,Object.extend({from:objOverlay.overlayOpacity,to:0},Windows.overlayHideEffectOptions));else{objOverlay.style.display='none';objOverlay.parentNode.removeChild(objOverlay);}
if(id!="__invisible__")
WindowUtilities._showSelect();}},_hideSelect:function(id){if(Prototype.Browser.IE){id=id==null?"":"#"+id+" ";$$(id+'select').each(function(element){if(!WindowUtilities.isDefined(element.oldVisibility)){element.oldVisibility=element.style.visibility?element.style.visibility:"visible";element.style.visibility="hidden";}});}},_showSelect:function(id){if(Prototype.Browser.IE){id=id==null?"":"#"+id+" ";$$(id+'select').each(function(element){if(WindowUtilities.isDefined(element.oldVisibility)){try{element.style.visibility=element.oldVisibility;}catch(e){element.style.visibility="visible";}
element.oldVisibility=null;}
else{if(element.style.visibility)
element.style.visibility="visible";}});}},isDefined:function(object){return typeof(object)!="undefined"&&object!=null;},initLightbox:function(id,className,doneHandler,parent){if($(id)){Element.setStyle(id,{zIndex:Windows.maxZIndex+1});Windows.maxZIndex++;doneHandler();}
else{var objOverlay=document.createElement("div");objOverlay.setAttribute('id',id);objOverlay.className="overlay_"+className
objOverlay.style.display='none';objOverlay.style.position='absolute';objOverlay.style.top='0';objOverlay.style.left='0';objOverlay.style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex++;objOverlay.style.width='100%';parent.insertBefore(objOverlay,parent.firstChild);if(Prototype.Browser.WebKit&&id=="overlay_modal"){setTimeout(function(){doneHandler()},10);}
else
doneHandler();}},setCookie:function(value,parameters){document.cookie=parameters[0]+"="+escape(value)+
((parameters[1])?"; expires="+parameters[1].toGMTString():"")+
((parameters[2])?"; path="+parameters[2]:"")+
((parameters[3])?"; domain="+parameters[3]:"")+
((parameters[4])?"; secure":"");},getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));},_computeSize:function(content,id,width,height,margin,className){var objBody=document.body;var tmpObj=document.createElement("div");tmpObj.setAttribute('id',id);tmpObj.className=className+"_content";if(height)
tmpObj.style.height=height+"px"
else
tmpObj.style.width=width+"px"
tmpObj.style.position='absolute';tmpObj.style.top='0';tmpObj.style.left='0';tmpObj.style.display='none';tmpObj.innerHTML=content;objBody.insertBefore(tmpObj,objBody.firstChild);var size;if(height)
size=$(tmpObj).getDimensions().width+margin;else
size=$(tmpObj).getDimensions().height+margin;objBody.removeChild(tmpObj);return size;}}
function master_det_der(cible)
{$('ouvrir').innerHTML=cible;var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{reponse=cleanXML(xhr.responseXML.documentElement);try
{est_connecte=reponse.getElementsByTagName("connecte")[0].firstChild.nodeValue;try{ouvrir=reponse.getElementsByTagName("ouvrir")[0].firstChild.nodeValue;}catch(e){ouvrir='';}
if(est_connecte==1)
{ouvre_zone(cible);}
else
{ouvre_login(cible);}}catch(e){}}}catch(e){}}
xhr.open("GET","html/connecte.php?connecte&ouvrir="+cible);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function ouvre_zone(cible)
{if(cible=='messagerie'){if(window.contenu_message)
{charge_la_messagerie();}
else
{var oScript=document.createElement("script");oScript.src="javascript/dyn_mail.js";document.body.appendChild(oScript);}}
else if(cible=='mes_contacts'){if(window.ts_ct)
{ts_ct(0);}
else
{var oScript=document.createElement("script");oScript.src="javascript/dyn_contact.js";document.body.appendChild(oScript);}}
else if(cible=='mes_evnms'){if(window.invitationEvnm)
{mes_evnm(0);}
else
{var oScript=document.createElement("script");oScript.src="javascript/dyn_evenement.js";document.body.appendChild(oScript);}}
else if(cible=='invitations'){if(window.mes_invitations)
{mes_invitations(0);}
else
{var oScript=document.createElement("script");oScript.src="javascript/dyn_invitation.js";document.body.appendChild(oScript);}}
else
{if($('modal_window_id_'+cible+'_content'))
{chargement('modal_window_id_'+cible+'_content');var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{$('modal_window_id_'+cible+'_content').innerHTML=xhr.responseText;}}catch(e){}}
xhr.open("GET","html/"+cible+".php?dta");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
else
{var win=new Window('modal_window_id_'+cible,{maximizable:false,minimizable:false,overlayShowEffectOptions:null,width:600,height:400,draggable:false,resizable:false});win.setAjaxContent("html/"+cible+".php?dta");win.setDestroyOnClose();win.showCenter();win.show(true);}}}
var pop_login=new Window('pop_login',{maximizable:false,minimizable:false,width:600,height:400,draggable:false,resizable:false});function ouvre_login(cible)
{if($('pop_login_content'))
{if(trim($('pop_login_content').innerHTML)!='')
{pop_login.showCenter();pop_login.show(true);}
else
{pop_login.setAjaxContent("pop/pop_login.php?dta");pop_login.showCenter();pop_login.show(true);}}
else
{pop_login.setAjaxContent("pop/pop_login.php?dta");pop_login.showCenter();pop_login.show(true);}}
function traite_mes_favoris(req)
{var reponse=req.xhRequest.responseText;$('corps_mdd_fav').innerHTML=reponse;}
function traite_mon_profil(req)
{var reponse=req.xhRequest.responseText;$('mon_profil').innerHTML=reponse;}
function traite_mon_cv(req)
{var reponse=req.xhRequest.responseText;$('mon_cv').innerHTML=reponse;}
function traite_mes_projets(req)
{var reponse=req.xhRequest.responseText;$('mes_projets').innerHTML=reponse;}
function traite_mes_photos(req)
{var reponse=req.xhRequest.responseText;$('mes_photos').innerHTML=reponse;new Draggable('myImgUpload');}
function traite_mes_videos(req)
{try{var reponse=req.xhRequest.responseText;$('mes_videos').innerHTML=reponse;new Draggable('vidUpload');}catch(e){alert(e);}}
function traite_mes_annonces(req)
{var reponse=req.xhRequest.responseText;$('mes_annonces').innerHTML=reponse;new Draggable('imgUpload');}
function traite_inv_recues(req)
{var reponse=req.xhRequest.responseText;$('invitations').innerHTML=reponse;}
function deroule_menu_mdd(cible)
{$('men_der_mdd'+cible).style.overflow='visible';}
function cache_menu_mdd(cible)
{$('men_der_mdd'+cible).style.overflow='hidden';}
function mes_favoris(typ_fav)
{chargement('modal_window_id_mes_favoris_content');var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{$('modal_window_id_mes_favoris_content').innerHTML=xhr.responseText;}}catch(e){}}
xhr.open("GET","html/get_info.php?"+typ_fav+"=1");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function pop_projets()
{var win=new Window('fen_projet',{maximizable:false,minimizable:false,width:600,height:400,draggable:false,resizable:false});win.setAjaxContent("pop/pop_projet.php?dta");win.setDestroyOnClose();win.showCenter();win.show(true);}
function reset_frm_proj()
{try
{$('nom_du_projet').disabled=false;$('nom_du_projet').value='';$('description_proj').value='';$('besoins_proj').value='';$('planification_proj').value='';$('cout_du_projet').value='';$('ville_proj').value='';$('maj_proj').value='';}catch(e){}}
function pop_annonces()
{var win=new Window('fen_pop_ann',{maximizable:false,minimizable:false,width:400,height:220,draggable:false,resizable:false});win.setAjaxContent("pop/pop_annonces.php?dta");win.setDestroyOnClose();win.showCenter();win.show(true);}
function pop_modif_annonce(id)
{var win=new Window('fen_mod_ann',{maximizable:false,minimizable:false,width:400,height:220,draggable:false,resizable:false});win.setAjaxContent("pop/pop_annonces.php?dta&modif="+id);win.setDestroyOnClose();win.showCenter();win.show(true);}
function pop_sup_annonce(id)
{if(confirm($('conf_sup_ann').innerHTML))
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{master_det_der('annonces');}}catch(e){}}
xhr.open("GET","html/gestionAnnonce.php?supprime="+id);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function pop_sup_video(id)
{if(confirm($('conf_sup_vid').innerHTML))
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{master_det_der('videos');}}catch(e){}}
xhr.open("GET","html/gestionVideos.php?supprime="+id);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function pop_sup_photo(id)
{if(confirm($('conf_sup_tof').innerHTML))
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{master_det_der('photos');}}catch(e){}}
xhr.open("GET","html/gestionPhotos.php?supprime="+id);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function reset_frm_annonces()
{try
{$('div_erreur').innerHTML='';$('div_erreur').style.display='none';$('nom_annonce').value='';$('cout_annonce').value='';$('description_annonce').value='';$('maj_annonce').value='';}catch(e){}
try
{$('planification_proj').value='';$('cout_du_projet').value='';$('ville_proj').value='';}catch(e){}}
function chargePhoto(req)
{try{var reponse=req.xhRequest.responseText;$('pop_mod_photo').innerHTML=reponse;}catch(e){}}
function afficheUploadImage()
{$('imgUpload').className='imgUpload';}
function ajoute_image_produit(id)
{fenetreTiers('imgUpload',400,0)
$('id_item').value=id;$('type_item').value='produit';}
function ajoute_video()
{var win=new Window('fen_pop_vid',{maximizable:false,minimizable:false,width:400,draggable:false,resizable:false});win.setAjaxContent("pop/pop_vid.php?dta");win.setDestroyOnClose();win.showCenter();win.show(true);}
function ajoute_tof()
{var win=new Window('fen_pop_tof',{maximizable:false,minimizable:false,width:400,height:350,draggable:false,resizable:false});win.setAjaxContent("pop/pop_tof.php?dta");win.setDestroyOnClose();win.showCenter();win.show(true);}
function valide_img_up()
{chargement('img_up_callback');}
function valide_my_img_up()
{chargement('my_img_up_callback');}
var timer_check_upload;function valide_vid_up()
{chargement('vid_up_callback');check_video_upload=true;timer_check_upload=setTimeout(getProgress,1000);}
function getProgress()
{var req=Spry.Utils.loadURL("GET","/html/check_upload.php?check_upload",true,writeProgress);}
function writeProgress(req)
{try{var reponse=req.xhRequest.responseText;$('progression').innerHTML=reponse;}
catch(e){}}
function supprime_image(id_image,type_image)
{var mot_ajouter=$('mot_ajouter').innerHTML;var buffer='';var confirmation_suppression=$('confirmation_suppression').innerHTML;if(confirm(confirmation_suppression))
{var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{reponse=xhr.responseText;if(reponse==1)
{if(type_image==1)
{buffer='<div><img src="images/NoImage.gif" /></div>';buffer+='<div><span class="lien bleu" name="mot_ajouter" onclick="ajoute_image_produit('+id_image+');">'+mot_ajouter+'</span></div>';var zone_image='photo_produit__'+id_image;$(zone_image).innerHTML=buffer;}}}}
xhr.open("POST","html/supprimer_image.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send('id_image='+id_image+'&type_image='+type_image);}}
function ferme_img_up()
{$('imgUpload').style.display='none';$('img_up_callback').innerHTML='';}
function ferme_my_img_up()
{$('myImgUpload').style.display='none';$('my_img_up_callback').innerHTML='';}
function ferme_vid_up()
{$('vidUpload').style.display='none';$('vid_up_callback').innerHTML='';clearTimeout(timer_check_upload);}
function message_upload(reponse)
{if(reponse.indexOf(',')>0)
{var mot_supprimer=$('mot_supprimer').innerHTML;var mot_changer=$('mot_changer').innerHTML;try
{var myArrayList=reponse.split(',');var message=myArrayList[0];var balise=myArrayList[1];var id=myArrayList[2];var image=myArrayList[3];var type_item=myArrayList[4];var buffer='';if(type_item=='produit')
{buffer='<div><img src="'+image+'" /></div>';buffer+='<div><span class="lien bleu" name="mot_changer" onclick="ajoute_image_produit('+id+');">'+mot_changer+'</span></div>';buffer+='<div><span class="lien bleu" name="mot_supprimer" onclick="supprime_image('+id+',1);">'+mot_supprimer+'</span></div>';}
$('img_up_callback').innerHTML=message;$(balise).innerHTML=buffer;}
catch(e){}}
else
{$('img_up_callback').innerHTML=reponse;}}
function message_upload_vid(reponse)
{$('vid_up_callback').innerHTML=reponse;master_det_der('videos');}
function message_upload_mes_tofs(reponse)
{if(reponse.indexOf(',')>0)
{try
{var myArrayList=reponse.split(',');var message=myArrayList[0];var rien=myArrayList[1];$('my_img_up_callback').innerHTML=message;master_det_der('photos');}
catch(e){}}
else
{$('my_img_up_callback').innerHTML=reponse;}}
function fermePopup(id_popup)
{fermeModale();$(id_popup).style.display='none';try{$('div_erreur').className='cache';}catch(e){}}
function fermeGrp(id_popup)
{fermeModale();$(id_popup).style.display='none';}
function soumetAnnonce()
{$('div_erreur').style.display='none';chargement_btn_i('valid_annonce');var nom_annonce=$F('nom_annonce');var cout_annonce=$F('cout_annonce');var description_annonce=$F('description_annonce');var categorie_annonce=$F('categorie_annonce');var maj_annonce=$F('maj_annonce');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;try
{if(erreur==0)
{master_det_der('annonces');$('div_erreur').innerHTML=reponse.getElementsByTagName("msg")[0].firstChild.nodeValue;$('div_erreur').className='succes';$('div_erreur').style.display='block';}
else
{$('div_erreur').innerHTML=reponse.getElementsByTagName("msg")[0].firstChild.nodeValue;$('div_erreur').className='erreur';$('div_erreur').style.display='block';}}catch(e){alert(e);}
fin_chargement_btn_i('valid_annonce');}
catch(e){alert(e);}
try{$('btn_valide_connexion').removeClassName('input_desactive');}catch(e){}}}
xhr.open("POST","html/gestionAnnonce.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send('nom_annonce='+nom_annonce+'&cout_annonce='+cout_annonce+'&description_annonce='+description_annonce+'&categorie_annonce='+categorie_annonce+'&maj_annonce='+maj_annonce);}
function soumetProjet()
{chargement_btn_i('btn_valid_proj');var nom_du_projet=$F('nom_du_projet');var description_proj=$F('description_proj');var besoins_proj=$F('besoins_proj');var planification_proj=$F('planification_proj');var cout_du_projet=$F('cout_du_projet');var pays_proj=$F('pays_proj');var ville_proj=$F('ville_proj');var domaine_proj=$F('domaine_proj');var maj_proj=$F('maj_proj');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;try
{alert(reponse.getElementsByTagName("msg")[0].firstChild.nodeValue);if(erreur==0)
{master_det_der('projets');}}catch(e){}
fin_chargement_btn_i('btn_valid_proj');}
catch(e){alert(e);}}}
xhr.open("POST","html/gestionProjet.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send('nom_du_projet='+nom_du_projet+'&description_proj='+description_proj+'&besoins_proj='+besoins_proj+'&planification_proj='+planification_proj+'&cout_du_projet='+cout_du_projet+'&pays_proj='+pays_proj+'&ville_proj='+ville_proj+'&domaine_proj='+domaine_proj+'&maj_proj='+maj_proj);}
function modifieProjet(id)
{var win=new Window('fen_mod_poj',{maximizable:false,minimizable:false,width:600,height:400,draggable:false,resizable:false});win.setAjaxContent("pop/pop_projet.php?dta&maj_proj="+id);win.setDestroyOnClose();win.showCenter();win.show(true);}
function supprimeProjet(id)
{var confirmation=$('conf_proj_sup').innerHTML;if(confirm(confirmation))
{var xhr=getXhr();xhr.onreadystatechange=function()
{try
{if(xhr.readyState==4&&xhr.status==200)
{master_det_der('projets');}}catch(e){}}
xhr.open("GET","html/gestionProjet.php?supprime="+id);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function ouvre_le_cv()
{var win=new Window('fen_cv',{maximizable:false,minimizable:false,width:600,height:400,draggable:false,resizable:false});win.setAjaxContent("pop/pop_cv.php?dta");win.setDestroyOnClose();win.showCenter();win.show(true);}
function soumetCV()
{chargement('btn_submit_cv');var tel_fix_cv=$F('tel_fix_cv');var bigo_cv=$F('bigo_cv');var pays_cv=$F('pays_cv');var niveau_cv=$F('niveau_cv');var cat_pro_cv=$F('cat_pro_cv');var formations_cv=$F('formations_cv');var diplomes_cv=$F('diplomes_cv');var competences_tec_cv=$F('competences_tec_cv');var exp_pro_cv=$F('exp_pro_cv');var langues_cv=$F('langues_cv');var divers_cv=$F('divers_cv');var lettre_de_motivation_cv=$F('lettre_de_motivation_cv');var valid_cv=$F('valid_cv');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;alert(reponse.getElementsByTagName("msg")[0].firstChild.nodeValue);if(erreur==0)
{$('zone_cv_en_ligne').innerHTML=reponse.getElementsByTagName("contenu")[0].firstChild.nodeValue;}}catch(e){alert(e);}
$('btn_submit_cv').disabled=false;$('btn_submit_cv').innerHTML=$('enr').innerHTML;}}
xhr.open("POST","html/gestion_cv.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send('tel_fix_cv='+tel_fix_cv+'&bigo_cv='+bigo_cv+'&pays_cv='+pays_cv+'&niveau_cv='+niveau_cv+'&cat_pro_cv='+cat_pro_cv+'&formations_cv='+formations_cv+'&diplomes_cv='+diplomes_cv+'&competences_tec_cv='+competences_tec_cv+'&exp_pro_cv='+exp_pro_cv+'&langues_cv='+langues_cv+'&divers_cv='+divers_cv+'&lettre_de_motivation_cv='+lettre_de_motivation_cv+'&valid_cv='+valid_cv);}
function fermeFenetre(id_popup){$(id_popup).style.display="none";switch_to('les_zones');}
function supprime_mon_cv_enligne()
{var confirmation=$('conf_sup_cv_enl').innerHTML;if(confirm(confirmation))
{chargement_btn_i('btn_suppr_cv_enl');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;try
{fin_chargement_btn_i('btn_suppr_cv_enl','supprime_mon_cv_enligne');alert(reponse.getElementsByTagName("msg")[0].firstChild.nodeValue);if(erreur==0)
{$('zone_cv_en_ligne').innerHTML=reponse.getElementsByTagName("contenu")[0].firstChild.nodeValue;}}catch(e){}}}
xhr.open("GET","html/gestion_cv.php?supprime");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function supprime_cv_document()
{var confirmation=$('conf_sup_cv_enl').innerHTML;if(confirm(confirmation))
{chargement_btn_i('btn_suppr_cv_doc');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;fin_chargement_btn_i('btn_suppr_cv_doc','supprime_cv_document');alert(reponse.getElementsByTagName("msg")[0].firstChild.nodeValue);$('zone_cv_document_existe_pas').style.display='block';$('zone_cv_document_existe').style.display='none';}
catch(e){alert(e);}}}
xhr.open("GET","html/gestion_cv.php?supprime_document");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}}
function message_up_cv(reponse)
{$('cv_up_callback').innerHTML='';if(reponse.indexOf(',')>0)
{try
{var myArrayList=reponse.split(',');var erreur=myArrayList[0];var msg=myArrayList[1];if(erreur==0)
{alert(msg);$('zone_cv_document_existe_pas').style.display='none';$('zone_cv_document_existe').style.display='block';}
else
{alert(msg);}}
catch(e){}}}
function pop_mod_photo(id)
{var win=new Window('fen_mod_tof',{maximizable:false,minimizable:false,width:400,height:120,draggable:false,resizable:false});win.setAjaxContent("pop/pop_mod_photo.php?dta&modif="+id);win.setDestroyOnClose();win.showCenter();win.show(true);}
function modification_photo()
{if(confirm($('confirmation_modification').innerHTML))
{$('div_erreur_tof').style.display='none';chargement_btn_i('mod_photo');var description_mod_tof=$F('description_mod_tof');var typ_mod_tof=$F('typ_mod_tof');var id_mod_tof=$F('id_mod_tof');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;if(erreur==0)
{master_det_der('photos');}
else if(erreur==1)
{$('div_erreur_tof').innerHTML=reponse.getElementsByTagName("msg")[0].firstChild.nodeValue();$('div_erreur_tof').className='erreur';$('div_erreur_tof').style.display='block';}}catch(e){alert(e);}
fin_chargement_btn_i('mod_photo');}}
xhr.open("POST","html/gestionPhotos.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send('description_mod_tof='+description_mod_tof+'&typ_mod_tof='+typ_mod_tof+'&id_mod_tof='+id_mod_tof);}}
function envoi_mail_js()
{var destinataires=$('champ_destinataire_message').value;var sujet=$('champ_sujet_message').value;var message_envoye=$('champ_message_envoye').value;var pb=false;if(destinataires=='')
{$('pb_destinataire_message').className='erreur';pb=true;}
else
{$('pb_destinataire_message').className='cache';}
if(message_envoye=='')
{$('pb_text_message').className='erreur';pb=true;}
else
{$('pb_text_message').className='cache';}
if(pb==false)
{chargement_btn_i('champ_valide_message');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{fin_chargement_btn_i('champ_valide_message');if(xhr.responseText=='ok')
{document.forms.form_envoi_message.reset();try
{$('pb_destinataire_message').className='cache';$('pb_text_message').className='cache';}catch(e){}}
else
{var reponse=xhr.responseText;var myArrayList=reponse.split(',');if(myArrayList.length>1)
{for(var i=0;i<myArrayList.length;i++)
{if(myArrayList[i]!='')
{if(myArrayList[i]==1){$('pb_destinataire_message').className='erreur';}
if(myArrayList[i]==2){$('pb_text_message').className='erreur';}}}}
else
{if(reponse==1){$('pb_destinataire_message').className='erreur';}
if(reponse==2){$('pb_text_message').className='erreur';}}}}}
xhr.open("POST","html/envoi_message.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("listedestinataire="+destinataires+"&sujet="+sujet+"&message="+message_envoye+"&envoi_message=1");}}
function chargement_btn_i(id_btn)
{var mot_chargement=$('chargement').innerHTML;$(id_btn).disabled=true;$(id_btn).onClick=function(){}
$(id_btn).addClassName('no_background');$('ms_'+id_btn).style.display='none';$('span_'+id_btn).innerHTML='<img src="images/loader.gif" /> '+mot_chargement+' <img src="images/loader.gif" />';}
function fin_chargement_btn_i(id_btn,fct)
{$(id_btn).disabled=false;$(id_btn).onClick=fct
$(id_btn).removeClassName('no_background');$('span_'+id_btn).innerHTML='';$('ms_'+id_btn).style.display='block';}
function get_nc()
{if($('res_browsing').style.display=='none'){Effect.BlindDown('res_browsing');}
affPartAnnonces();chargement('panel_infos');$('panel_infos').innerHTML+=' <span class="lien bleu" onclick="get_nc();">'+$('actualiser').innerHTML+'</span>';var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('panel_infos').innerHTML=xhr.responseText;}}
xhr.open("GET","html/sidebar.php?nc");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function get_apropos()
{if($('res_browsing').style.display=='none'){Effect.BlindDown('res_browsing');}
affPartAnnonces();chargement('panel_infos');$('panel_infos').innerHTML+=' <span class="lien bleu" onclick="get_apropos();">'+$('actualiser').innerHTML+'</span>';var xhr=getXhr()
xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('panel_infos').innerHTML=xhr.responseText;}}
xhr.open("GET","html/apropos.php?dta");xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(null);}
function contact_ns()
{$('err_ns_contacter').innerHTML='';$('err_ns_contacter').style.display="none";var txt=$('txt_nc').value;var nom=$('nom_nc').value;var tel=$('tel_nc').value;var mail=$('mail_nc').value;var sel=$('sel_nc');var cat=sel.options[sel.selectedIndex].value;var cap=$('cap_nc').value;$('btn_form_contact').disabled=false;chargement('chargement_ns_ct');var xhr=getXhr();xhr.onreadystatechange=function()
{if(xhr.readyState==4&&xhr.status==200)
{$('btn_form_contact').disabled=false;$('chargement_ns_ct').innerHTML='';document.images.captcha_nc.src='capcha/capcha_ns_contacter.php?id='+Math.round(Math.random(0)*1000)+1;try
{reponse=cleanXML(xhr.responseXML.documentElement);erreur=reponse.getElementsByTagName("erreur")[0].firstChild.nodeValue;if(erreur==0)
{alert(reponse.getElementsByTagName("msg")[0].firstChild.nodeValue);RAZ_contact_ns();}
else
{$('cap_nc').value='';var titre=reponse.getElementsByTagName("titre")[0].firstChild.nodeValue
var buffer='<p>'+titre+'</p>';buffer+='<hr />';buffer+='<ul class="err_ul">';var messages=reponse.getElementsByTagName("msg");longueur=messages.length;for(i=0;i<longueur;i++)
{try{var msg=messages[i].firstChild.nodeValue;buffer+='<li>'+msg+'</li>';}catch(e){}}
buffer+='</ul>';$('err_ns_contacter').innerHTML=buffer;$('err_ns_contacter').style.display="block";}}
catch(e){}}}
xhr.open("POST","html/ns_contacter.php",true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send("txt="+txt+"&nom="+nom+"&tel="+tel+"&amail="+mail+"&cat="+cat+"&cap="+cap);}
var myGlobalHandlers={onCreate:function()
{$('charge').style.display='block';},onComplete:function()
{if(Ajax.activeRequestCount==0){$('charge').style.display='none';}}};Ajax.Responders.register(myGlobalHandlers);
