/*
 * Tous les scripts communs pour le site supersortie.com
 * les 3/4 c'est fait avec jquery 
 * Version     : 1.1
 * Last-update : 31/07/2009 à 13:37:22
 * File size   : 58.97 Ko 
 * min size    : 35.45 Ko 
*/

function d_(id){return document.getElementById(id);}
jQuery.preloadImages=function(){for(var i=0;i<arguments.length;i++){jQuery("<img>").attr("src",arguments[i]);}}
function ifrCloseMe(){var ifnode=document.getElementById("ifrdatepicker");var parentn=ifnode.parentNode;if(ifnode){parentn.removeChild(ifnode);}}
function dfDefil(pid){var objDiv=document.getElementById(pid);objDiv.scrollTop=objDiv.scrollHeight;if(vIE){objDiv.scrollTop=(2*objDiv.scrollHeight);}}
Array.prototype.in_array=function(p_val){for(var i=0,l=this.length;i<l;i++){if(this[i]==p_val){return true;}}
return false;}
function fixIE6flicker(fix){try{document.execCommand("BackgroundImageCache",false,fix);}catch(err){}}
var V2moveh;function dfH2move(){if(!V2moveh){V2moveh=d_(eldefileH);}
if(V2moveh){if(Vhpos<(-V2moveh.offsetWidth)){Vhpos=Vstartposh;}else{Vhpos+=-1;}
V2moveh.style.left=Vhpos+"px";}}
function dfpopup(page,pname,conftext,vWH){if(!conftext){conftext='Si vous choisisez ok, cela vas ouvrir une fenetre "pop-up" avec l\'historique du chat';}
if(confirm(conftext)){if(!vWH){vWH='width=800,height=500'}
window.open(page,pname,vWH+",location=no,status=no,toolbar=no,scrollbars=yes,resize=yes");}}
var objectToDrag;var ecartX,ecartY;var curX,curY;function coords(e){if(document.all){curX=event.clientX;curY=event.clientY;}else if(document.getElementById){curX=e.clientX;curY=e.clientY;}}
function beginDrag(p_obj,e){isDragging=true;objectToDrag=p_obj;coords(e);ecartX=curX-parseInt(objectToDrag.style.left);ecartY=curY-parseInt(objectToDrag.style.top);}
function drag(e){var newPosX;var newPosY;if(isDragging==true){coords(e);newPosX=curX-ecartX;newPosY=curY-ecartY;objectToDrag.style.left=newPosX+'px';objectToDrag.style.top=newPosY+'px';if(d_('tipsombre')){d_('tipsombre').style.display='none';}}}
function endDrag(pcible){isDragging=false;pcible.focus();}
$(document).ready(function(){potitle='Drag & drop, la croix pour fermer (ou touche echap au clavier).';isDragging=false;if($('a.poper, a.poperh').length>0){var vpoptext='<div id="popunder_cont">';vpoptext+='<div id="poignee_pop" class="totip" title="'+potitle+'">...</div>';vpoptext+='<a id="close_pop" title="fermer le pop-up">X</a></div>';$('body').append(vpoptext).bind('mousemove',function(event){drag(event);});$('#popunder_cont').append('<div id="txtview"></div>').css({top:'5px',left:'5px'});$('#poignee_pop').bind('mousedown',function(event){beginDrag(d_('popunder_cont'),event);}).bind('mouseup',function(event){endDrag(this);});$('#close_pop').bind('click',function(){$('#popunder_cont').hide('slow');});$(document).keydown(function(e){if(e.which==27){$('#popunder_cont').hide('slow');return false;}});$('a.poper').bind('click',function(){var vcont=this.href;var vtt=(this.title==''&&vText!='')?vText:this.title;$('#popunder_cont').css({top:'15px',left:'15px'}).show('slow');$("#poignee_pop").show('slow').html(vtt);$("#txtview").load(vcont);return false;});$("a.poperh").bind('click',function(){vts=$(this).attr('href');var vth=((!vText)?this.title:vText);if(vth!=''){$("#poignee_pop").show('slow').html(vth);}else{$("#poignee_pop").hide();}
$("#txtview").empty().prepend($(vts).html()).css({height:'auto',maxHeight:'200px',width:'464px'});$('#popunder_cont').css({top:'300px',left:'150px',marginLeft:'25%',height:'auto',maxHeight:'240px',width:'480px'}).show('slow');return false;});}
if($('a.poperi').length>0){var vpopimg='<div id="popunder_img">';vpopimg+='<div id="poignee_img" class="totip" title="'+potitle+'">';vpopimg+='...</div><a id="close_img" title="fermer le pop-up">X</a></div>';$('a.poperi').bind('click',function(e){var oImg=new Image();oImg.src=this.href;oImg.id='popimg';oImg.style.display='block';var vti=(this.title==''&&vText!='')?vText:this.title;if($('#popunder_img').length==0){$('body').append(vpopimg).bind('mousemove',function(event){drag(event);});$('#popunder_img').append('<div id="imgview"></div>').css({top:(e.pageY+30),left:(e.pageX-(oImg.width/2)),height:((vIE)?parseInt(oImg.height+24):'auto'),width:((vIE)?oImg.width:'auto')}).show('slow');$('#poignee_img').bind('mousedown',function(event){beginDrag(d_('popunder_img'),event);}).bind('mouseup',function(event){endDrag(this);}).show(500).css('width',((oImg.width>0)?oImg.width+'px':'100%')).html(vti);$('#popimg').bind('mousedown',function(event){return false});$('#close_img').bind('click',function(){$('#popunder_img').remove();});$("#imgview").html(oImg).css({width:'auto',height:'auto'});$(document).keydown(function(e){if(e.which==27){$('#popunder_img').remove();return false;}});}else{$('#popunder_img').remove();}
return false;});}});function dftips(p_elements){var vPc=d_('tipsombre');var vPct=d_('tips');vText=null;$(p_elements).not('.notip').mouseover(function(e){vText=((this.getAttribute('title'))?this.getAttribute('title'):this.getAttribute('alt'));this.setAttribute('alt','');this.setAttribute('title','');if(vText=='null'||vText=='undefined'){vText='';}
if(vText){vText=vText.replace(/\\n/g,'<br />');vPct.innerHTML=vText;vPc.style.left=(e.pageX+25)+'px';vPc.style.top=(e.pageY+25)+'px';vPc.style.display='block';}}).mouseout(function(){vPc.style.display='none';this.setAttribute('title',vText);});}
function fdAreaTip(p_elements){$(p_elements).mouseover(function(e){var strref=$(this).attr('id');var idStrref=strref.replace(/(dpt-)/g,'');strref=aTipTitle[idStrref];$('#subtipo').css({left:((e.pageX-60)+'px'),top:((e.pageY-80)+'px')}).show();$('#areatip').html(strref).show();}).mouseout(function(){$('#subtipo').hide();});}
function dfCookie(){this.PCook=function(Pname,Pvalue,Pseconds){if(typeof(Pseconds)!='undefined'){var Vvdate=new Date();Vvdate.setTime(Vvdate.getTime()+(Pseconds*1000));var Vvexpires="; expires="+Vvdate.toGMTString();}else{var Vvexpires="";}
document.cookie=Pname+"="+Pvalue+Vvexpires+"; path=/; ";}
this.GCook=function(Pname){Pname=Pname+"=";var Vvcook_array=document.cookie.split(';'),i=0;while(i<Vvcook_array.length){var Vvc=Vvcook_array[i];while(Vvc.charAt(0)==' '){Vvc=Vvc.substring(1,Vvc.length);}
if(Vvc.indexOf(Pname)==0){return Vvc.substring(Pname.length,Vvc.length);}
i++}
return null;}
this.DCook=function(Pname){this.PCook(Pname,"",-1);}}
function buildCal(m,y,cM,cH,cDW,cD,brdr,sDay,action,defil){if(defil==null){defil=true;}
var mn=['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'];var dim=[31,0,31,30,31,30,31,31,30,31,30,31];if(sDay<1||sDay>7){sDay=1;}
var oD=new Date(y,m-1,1);oD.od=oD.getDay()+1;var tmpod=oD.od-sDay;if(tmpod<0){tmpod=7+tmpod;}
oD.od=tmpod+1;var wkstr='DLMMJVS'.substr(sDay-1,'DLMMJVS'.length)+'DLMMJVS'.substr(0,sDay-1);var todaydate=new Date;var scanfortoday=(y==todaydate.getFullYear()&&m==todaydate.getMonth()+1)?todaydate.getDate():0;dim[1]=oD.getFullYear()%100!=0&&oD.getFullYear()%4==0||oD.getFullYear()%400==0?29:28;var t='<div class="'+cM+'">';t+='<table class="'+cM+'" cellpadding="0" cellspacing="0" border="'+brdr+'">';t+='<thead><tr><th colspan="4" class="'+cH+'">';t+=((defil)?'<a id="moism" onclick="adjM(0);" title="mois précédent" class="notip">«</a>':'');t+='<span>'+mn[m-1]+'</span>';t+=((defil)?'<a id="moisp" onclick="adjM(1);" title="mois suivant" class="notip">»</a>':' ');t+='</th><th colspan="3" class="'+cH+'">';t+=((defil)?'<a id="anneem" onclick="adjY(0);" title="année précédente" class="notip">«</a>':' ');t+='<span>'+y+'</span>';t+=((defil)?'<a id="annep" onclick="adjY(1);" title="année suivante" class="notip">»</a>':'');t+='</th></tr></thead><tbody><tr>';if(defil){for(s=0;s<7;s++){if(s<=4){t+='<td class="'+cDW+'">'+wkstr.substr(s,1)+'</td>';}else{t+='<td class="'+cDW+'_we">'+wkstr.substr(s,1)+'</td>';}}
t+='</tr><tr>';}
for(i=1;i<=42;i++){var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))?'<a'+((action!='')?' onclick="'+action+'('+(i-oD.od+1)+','+m+','+y+')':(i-oD.od+1))+'">'+(i-oD.od+1)+'</a>':'&nbsp;';if((i-oD.od+1==scanfortoday)&&(x!='&nbsp;')){x='<span id="today">'+x+'</span>';}
if((i%7==0)||((i-6)%7==0)){t+='<td class="'+cD+'_we">'+x+'</td>';}else{t+='<td class="'+cD+'">'+x+'</td>';}
if(i%7==0&&i<36){t+="</tr><tr>";}}
t+="</tr></tbody></table></div>";return t;}
var mnth=new Date().getMonth()+1;var year=new Date().getFullYear();var strtD=1;function adjM(I){if(I){mnth=(mnth==12)?1:mnth+1;}
else{mnth=(mnth==1)?12:mnth-1;}
UpdtCal(divcalcont);}
function adjY(I){if(I==1){year=(year==2037)?1902:year+1;}
else{year=(year==1902)?2037:year-1;}
UpdtCal(divcalcont);}
function UpdtCal(cible){var el=document.getElementById(cible);var html=buildCal(mnth,year,"cal_main","month","daysofweek","days",0,2,'dzGotoCal');el.innerHTML=html;}
function zfill(n){return(n.toString().length<2)?"0"+n:""+n;}
function updateField(mm,dd,yy){document.getElementById(Ccible).value=zfill(mm)+'/'+zfill(dd)+'/'+yy;}
function popUpdateF(mm,dd,yy){window.opener.document.getElementById(Ccible).value=zfill(mm)+'/'+zfill(dd)+'/'+yy;window.close();}
function dzGotoCal(dd,mm,yy){if(GOTO_URL==false){var url=window.location+'';if(url.indexOf(dp_cible)==-1){url+=((url.lastIndexOf('?')==-1)?'?':'&');url+=dp_cible+zfill(dd)+'-'+zfill(mm)+'-'+yy;}else{regex=new RegExp(dp_cible+'[0-9]+\-[0-9]+\-[0-9]+',"g");url=url.replace(regex,dp_cible+zfill(dd)+'-'+zfill(mm)+'-'+yy);}}else{var url=GOTO_URL+dp_cible+zfill(dd)+'-'+zfill(mm)+'-'+yy;}
window.location.replace(url);}
jQuery.fn.resizer=function(idcls){return this.each(function(){var v_resized=jQuery(this);v_resized.wrap(jQuery('<table class="Cresizer" cellpadding="0" cellspacing="0"><tr><td class="tdwraped"></td></tr><tr><td id="'+idcls+'" class="Cresizer"></td></tr></table>'));jQuery('#'+idcls).bind('mousedown',function(v_hispos){var v_w=v_resized.width();var v_x=v_hispos.clientX;var v_h=v_resized.height();var v_y=v_hispos.clientY;var moveHandler1=function(v_hispos){v_resized.height(Math.max(20,v_hispos.clientY+v_h-v_y));v_resized.focus();return false;};var upHandler1=function(v_hispos){jQuery('html').unbind('mousemove',moveHandler1).unbind('mouseup',upHandler1);v_resized.focus();};jQuery('html').bind('mousemove',moveHandler1).bind('mouseup',upHandler1);});});}
var mnobj=null;function dfShowobj(){if(mnobj){mnobj.find('ul').fadeIn('fast');mnobj=null;}}
function dfHideobj(){if(mnobj){mnobj.find('ul').fadeOut('fast');}}
$(document).ready(function(){$('ul.menutop > li').hover(function(){if(mnobj){mnobj.find('ul').fadeOut('fast');mnobj=null;}
$(this).find('ul').fadeIn('fast');},function(){mnobj=$(this);dfHideobj();});});(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type))fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid))return(q=query)&&false;});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;$.livequery.run(q.id);return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type))fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped)$.livequery.stop(query.id);});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2)fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type)this.elements.unbind(this.type,this.fn);else if(this.fn2)this.elements.each(function(i,el){query.fn2.apply(el);});this.elements=[];this.stopped=true;},run:function(){if(this.stopped)return;var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0)$.each(oEls,function(i,el){if($.inArray(el,els)<0)$.event.remove(el,query.type,query.fn);});}else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0)$.each(oEls,function(i,el){if($.inArray(el,els)<0)query.fn2.apply(el);});}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--)$.livequery.queries[$.livequery.queue.shift()].run();}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n])return;var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;}});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0)$.livequery.queue.push(id);}else
$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0)$.livequery.queue.push(id);});if($.livequery.timeout)clearTimeout($.livequery.timeout);$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined)$.livequery.queries[id].stop();else
$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}});$.livequery.registerPlugin('append','prepend','after','before','wrap','attr','removeAttr','addClass','removeClass','toggleClass','empty','remove');$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector)r.context=a.context,r.selector=a.selector;if(typeof a=='string')r.context=c||document,r.selector=a;return r;};$.prototype.init.prototype=$.prototype;})(jQuery);(function($){$.fn.editable=function(target,options){var settings={target:target,name:'value',id:'id',type:'text',width:'auto',height:'auto',event:'click',onblur:'cancel',loadtype:'GET',loadtext:'Loading...',placeholder:'Click to edit',loaddata:{},submitdata:{}};if(options){$.extend(settings,options);}
var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types['defaults'].buttons;var content=$.editable.types[settings.type].content||$.editable.types['defaults'].content;var element=$.editable.types[settings.type].element||$.editable.types['defaults'].element;var reset=$.editable.types[settings.type].reset||$.editable.types['defaults'].reset;var callback=settings.callback||function(){};if(!$.isFunction($(this)[settings.event])){$.fn[settings.event]=function(fn){return fn?this.bind(settings.event,fn):this.trigger(settings.event);}}
$(this).attr('title',settings.tooltip);settings.autowidth='auto'==settings.width;settings.autoheight='auto'==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();if(!$.trim($(this).html())){$(this).html(settings.placeholder);}
$(this)[settings.event](function(e){if(self.editing){return;}
if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight;}else{if(settings.width!='none'){settings.width=settings.autowidth?$(self).width():settings.width;}
if(settings.height!='none'){settings.height=settings.autoheight?$(self).height():settings.height;}}
if($(this).html().toLowerCase().replace(/;/,'')==settings.placeholder.toLowerCase().replace(/;/,'')){$(this).html('');}
self.editing=true;self.revert=$(self).html();$(self).html('');var form=$('<form/>');if(settings.cssclass){if('inherit'==settings.cssclass){form.attr('class',$(self).attr('class'));}else{form.attr('class',settings.cssclass);}}
if(settings.style){if('inherit'==settings.style){form.attr('style',$(self).attr('style'));form.css('display',$(self).css('display'));}else{form.attr('style',settings.style);}}
var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self]);},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]));}else{$.extend(loaddata,settings.loaddata);}
$.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false;}});}else if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings]);}}else{input_content=self.revert;}
content.apply(form,[input_content,settings,self]);input.attr('name',settings.name);buttons.apply(form,[settings,self]);$(self).append(form);plugin.apply(form,[settings,self]);$(':input:visible:enabled:first',form).focus();if(settings.select){input.select();}
input.keydown(function(e){if(e.keyCode==27){e.preventDefault();reset.apply(form,[settings,self]);}});var t;if('cancel'==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self]);},500);});}else if('submit'==settings.onblur){input.blur(function(e){form.submit();});}else if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings]);});}else{input.blur(function(e){});}
form.submit(function(e){if(t){clearTimeout(t);}
e.preventDefault();if(false!==submit.apply(form,[settings,self])){if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}}else{var submitdata={};submitdata[settings.name]=input.val();submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]));}else{$.extend(submitdata,settings.submitdata);}
if('PUT'==settings.method){submitdata['_method']='put';}
$(self).html(settings.indicator);$.post(settings.target,submitdata,function(str){$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}});}}
return false;});});this.reset=function(){$(self).html(self.revert);self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder);}}});};$.editable={types:{defaults:{element:function(settings,original){var input=$('<input type="hidden">');$(this).append(input);return(input);},content:function(string,settings,original){$(':input:first',this).val(string);},reset:function(settings,original){original.reset();},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){if(submit.attr("type")!="submit"){form.submit();}});}else{var submit=$('<button type="submit">');submit.html(settings.submit);}
$(this).append(submit);}
if(settings.cancel){if(settings.cancel.match(/>$/)){var cancel=$(settings.cancel);}else{var cancel=$('<button type="cancel">');cancel.html(settings.cancel);}
$(this).append(cancel);$(cancel).click(function(event){if($.isFunction($.editable.types[settings.type].reset)){var reset=$.editable.types[settings.type].reset;}else{var reset=$.editable.types['defaults'].reset;}
reset.apply(form,[settings,original]);return false;});}}},text:{element:function(settings,original){var input=$('<input>');if(settings.width!='none'){input.width(settings.width);}
if(settings.height!='none'){input.height(settings.height);}
input.attr('autocomplete','off');$(this).append(input);return(input);}},textarea:{element:function(settings,original){var textarea=$('<textarea>');if(settings.rows){textarea.attr('rows',settings.rows);}else{textarea.height(settings.height);}
if(settings.cols){textarea.attr('cols',settings.cols);}else{textarea.width(settings.width);}
$(this).append(textarea);return(textarea);}},select:{element:function(settings,original){var select=$('<select>');$(this).append(select);return(select);},content:function(string,settings,original){if(String==string.constructor){eval('var json = '+string);for(var key in json){if(!json.hasOwnProperty(key)){continue;}
if('selected'==key){continue;}
var option=$('<option>').val(key).append(json[key]);$('select',this).append(option);}}
$('select',this).children().each(function(){if($(this).val()==json['selected']||$(this).text()==original.revert){$(this).attr('selected','selected');};});}}},addInputType:function(name,input){$.editable.types[name]=input;}};})(jQuery);;(function(d){d.fn.toggleCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=!this.checked}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.checkCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=true}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.unCheckCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=false}).filter(":not(:checked)");c=e});if(!b){c=this}return c};d.radioCheckboxGroup=function(e,a){a=a||"*";var b="input[type=checkbox]";if(e){b+="[name="+e+"]"}var c=d(b).filter(a);c.click(function(){c.not(this).each(function(){this.checked=false}).end()})}})(jQuery);$(document).ready(function(){if(document.getElementById('intro_bgl')){imgovdir=PATH+'INDEXFILE/deptimg/rouge';$('area').bind('mouseover',function(){$('#main_map').attr('src',imgovdir+'/'+$(this).attr('id')+'.png').fadeOut('slow');}).bind('mouseout',function(){$('#main_map').attr('src',PATH+'INDEXFILE/mapfr_bg/map10x10trans.png').fadeIn('slow');});$('#list_dpt span').css('cursor','pointer').hover(function(){$(this).css({background:'#000000',color:'#FFFFCC !important'});},function(){$(this).css({background:'#CC0000',color:'#000000'});});$('#list_dpt dt').bind('click',function(){$('#list_dpt dd:visible').hide('normal');$(this).next('dd:hidden').show('slow');});fdAreaTip("area");}});var DZ_DEBUG=false;var divcalcont='jscalendrier';var GOTO_URL=false;var dp_cible='date=';var Vloading='<p id="txt_patientez" class="txt_patientez">Traitement en cours'
+' &nbsp;&nbsp;<img src="'+ImgPath+'loader.gif" width="15" height="15" /></p>';var Cookz=new dfCookie();var vIE=jQuery.browser.msie;if(vIE){var vIE6;var ua=navigator.userAgent.toLowerCase();vIE6=((parseFloat(ua.substring(ua.indexOf('msie ')+5))==6)?true:false);}
var eldefileH='txt_hscroll';$(document).ready(function(){$.preloadImages(ImgPath+'loader.gif',ImgPath+'indicator.gif');if(jQuery.browser.mozilla){$('a.datepicker').css({display:'inline',padding:'1px 10px 1px 10px'});}
$('input[@readonly],input[@disabled]').addClass('ch_readonly');$('input:submit').blur();$('input:checkbox').not('.nojs').addClass('checkboxmrg');$('form a.poperh').html('&nbsp;');if(vIE6){$('.boutons').hover(function(){$(this).addClass('.boutons_ov')},function(){$(this).removeClass('.boutons_ov')});}
$('q').prepend('<span class="quotedL">&#147;</span>').append('<span class="quotedR">&#148;</span>');$('#mhspacer table tr:even, .listev table tr:even').not('.theadrow,.nojs').css({backgroundColor:'#E8E8E8'});$('#mhspacer table tr, .listev table tr, #formMpChekall tr').not('.theadrow,.nojs,.whatday').hover(function(){$(this).addClass('rowOver');},function(){$(this).removeClass('rowOver');});$('input.champ_act').not('input[@readonly]').bind('focus',function(){$(this).removeClass('champ_actBLU').addClass('champ_actFOC');}).bind('blur',function(){$(this).removeClass('champ_actFOC').addClass('champ_actBLU');});});$(document).ready(function(){$('.tgNextDiv').toggle(function(){$(this).blur().next('div').show('slow');},function(){$(this).blur().next('div').hide('fast');}).css({cursor:'pointer',paddingBottom:'4px'});$('.modultitleCol').not('.ktip').attr('title','Cliquez pour afficher/masquer').click(function(){var SwCible=$(this).next('div');if(SwCible.is(':visible')){SwCible.hide();if(SwCible.attr('id')){Cookz.PCook('spst['+SwCible.attr('id')+']','y',(365*60*60));}}else if(SwCible.is(':hidden')){SwCible.show('slow');if(SwCible.attr('id')){Cookz.DCook('spst['+SwCible.attr('id')+']');}}});$('#colMenu').click(function(){$('#userMenu:visible').fadeOut('slow');Cookz.PCook('spst[userMenu]','y',(365*60*60));});$('#expMenu').click(function(){$('#userMenu:hidden').fadeIn('slow');Cookz.DCook('spst[userMenu]');});$("form").not("#fshootbox1, #fconnex").bind('submit',function(){$('#notify').css('display','none');$('#controles').after(Vloading).css('display','none');});$("#smbincrip").bind('submit',function(){var nb2place=1;nb2place=((d_('is2').checked==true)?2:1);nb2place=((d_('childNb').value!=0||d_('childNb').value!='')?parseInt(d_('childNb').value)+parseInt(nb2place):nb2place);return confirm('Vous inscrire pour :'+nb2place+' place(s) ?\n Vous ne pourrez pas modifer votre choix uterieurement,\n a moins de vous desisncrire/re-inscrire');});$("form.needconf").bind('submit',function(){return confirm('Sur de vous ?');});$("a.evlk").hover(function(){$(this).attr('title','').next('div.evlkTof').css({position:'absolute',zIndex:'1500',marginTop:'20px'}).show('normal');},function(){$(this).next('div.evlkTof').hide('fast');});$('a.infotip').hover(function(){$(this).next('.maintip:hidden').show().css('z-index','2000');},function(){$(this).next('.maintip:visible').hide();});$("#controles input:submit").not('#sbmevent').click(function(){ok=true;$(".req").each(function(){this.value=$.trim(this.value);if(this.value==''){ok=false;$(this).addClass('champ_Req').bind('focus',function(){$(this).removeClass('champ_Req').bind('blur',function(){$(this).addClass('champ_actBLU');});});}});if(ok==false){alert('Vous avez oubliez de remplir un champ (mit en evidence)');return false;};});$('#explform .pgaff_cont').not('.pgaff_cont:first').hide();$('#top_onglet.jstbw li:first a').addClass('pcurrent');$('#top_onglet.jstbw li a').bind('click',function(){$('#top_onglet.jstbw li a').not(this).removeClass('pcurrent');$(this).addClass('pcurrent');this.blur();var Vcible='sect'+$(this).parent().attr('value');if(d_(Vcible).style.display!='block'){$('#explform .pgaff_cont:visible').fadeOut(5,function(){$('#'+Vcible).fadeIn(1200).css('display','block');});}
return false;});var vUrl=window.document.location.href;vCur=vUrl.substring(vUrl.lastIndexOf('#'));if(vCur.lastIndexOf('#')!=-1){$('#top_onglet li a[@href*='+vCur+']').addClass('pcurrent');}else{$('#top_onglet li:first a').addClass('pcurrent');}
$('#infUpdtmail').click(function(){$(this).blur();});$('#usChangeVille').toggle(function(){$('#pSelInfville').fadeIn('slow');},function(){$('#pSelInfville').fadeOut();});$('#SelInfville').bind('change',function(){$('#infUpdtville').attr('checked',true);});$('#oldmail').bind('focus',function(){$('#infUpdtmail').attr('checked',true);if(d_('infUpdtmail').checked){$('#MailOption').show();}else{$('#MailOption').hide();}});if($('#mpMultiList').length==1){$('#checkAll').bind('click',function(){$('#Postform').checkCheckboxes();});$('#checkNo').bind('click',function(){$('#Postform').unCheckCheckboxes();});$('#checkInv').bind('click',function(){$('#Postform').toggleCheckboxes();});}
if($('#formMpChekall').length==1){$('#checkInv').bind('click',function(){$('#formMpChekall').toggleCheckboxes();});}
$('#ShowAllCts').bind('click',function(){if($(this).html()!='Par pages (60)'){if(confirm('Vraiment afficher tous vos contacts ? maximum 300 membres seront listés a la fois, (ca peut prendre un certain temps)')){window.location.replace('http://www.supersortie.com/espace_perso/?us=messagerie&ma=nouveau&dest=multi&pgc=1&nbpp=300#a2');}}else{window.location.replace('http://www.supersortie.com/espace_perso/?us=messagerie&ma=nouveau&dest=multi&pgc=1&nbpp=60#a2');}});$('.supppost').click(function(){return confirm('Sur de vouloir supprimer ?');});$('.supsujet').click(function(){return confirm('Sur de vouloir supprimer ce sujet ainsi que toutes les reponses ?');});$('#selSwVille').toggle(function(){var vdcible=$(this).next('div:hidden');vdcible.load(RPATH+'/TEMPLATES/sps-ov/change.ville.php',function(){$(vdcible).show('slow');});return false;},function(){$(this).next('div:visible').hide('fast');return false;});if(d_(eldefileH)&&d_('chkdefil').checked!=true){$('#stopdefil1').toggle(function(){clearInterval(timerH);d_('chkdefil').checked=true;},function(){timerH=setInterval("dfH2move()",vSpeeddefil);d_('chkdefil').checked=false;});Vstartposh=Vhpos=300;var vSpeeddefil=30;timerH=setInterval("dfH2move()",vSpeeddefil);}
$('#contact').resizer('ctf');$('#message').resizer('messre');if($(".totip").length>0){$("body").append('<div id="tipsombre"><div id="tips"> ... </div></div>');dftips("a, .totip, input.boutons, button, .modultitleCol");}});var timerListCon=false;function listcorefresh(pvsec){if(timerListCon){$('#listco').load(RPATH+'/ajx.listconn.php',function(){});}
timerListCon=setTimeout("listcorefresh("+pvsec+");",(1000*pvsec));}
function dfCheckMp(){var vsec=60*5;var mcible=RPATH+'/espace_perso/mp/dz.checkmp.php';$.get(mcible,{},function(rdat){if(rdat>0){if($('#notnbs').length==0){$('li#mpnot').css('background-position','-80px -20px').children('a').append('<b id="notnbs">('+rdat+')</b>');}else{$('#notnbs').html('('+rdat+')');}}});setTimeout("dfCheckMp();",(1000*vsec));}
function shootrefresh(pvsec){if($('#cel1').is(':visible')){$('#shootloader').show();$.ajax({type:"GET",url:$('#fshootbox1').attr('action'),success:function(retour){$('#shootloader').fadeOut(2500,function(){$("#shoutbox").empty().append(retour);dfDefil('shoutbox');});}});setTimeout('shootrefresh('+pvsec+');',(1000*pvsec));}}
$(document).ready(function(){$('a.jqrmp').bind('click',function(){var nobold=$(this);var mpqs=this.href.substring((this.href.indexOf('?',0)),(this.href.lastIndexOf('#')));mpqs=RPATH+'/espace_perso/mp/ajax.readmp.php'+mpqs;window.scrollTo(0,($('#sect1').height()*1.2));$('#ajxload').html('<img id="mploader" src="'+ImgPath+'indicator.gif" width="16" height="16" style="display:block;margin:8px auto;" />').load(mpqs,function(){$('mploader').hide();nobold.css('font-weight','normal');});return false;});if($("li#mpnot").length==1){dfCheckMp();listcorefresh(90);}
$('a.infotip').livequery(function(){$(this).hover(function(){$(this).next('.maintip:hidden').show().css('z-index','2000');},function(){$(this).next('.maintip:visible').hide();});},function(){$(this).unbind('mouseover').unbind('mouseout');});if($('#shoutbox').length==1){$('#Mainshoutbox').show('slow',function(){shootrefresh(60);$("#shoutboxCtn").show('slow',function(){$('#fshootbox1').bind('submit',function(){if($('#shootest').val()!=''&&$('#shootnom').val()!=''){sbmfs=$(this).serialize();$('#shootest').val('');$.ajax({type:'POST',data:sbmfs,url:$(this).attr('action'),success:function(cretour){$('#shoutbox').empty().append(cretour);dfDefil('shoutbox');}});}else{$('#shootest').css({background:'#FFFF99',border:'1px dashed #990000'});alert('alors rien à dire ?!');}
return false;});});});}});$(document).ready(function(){if($('#formadd_event').length==1){$('#picknNPlace').change(function(){$('#cNbPlace').val(this.value).focus();});$('#dpicker_opt').hide();if($('#isautre:checked').length==1){$('#sel_theme').attr('disabled',false);}else{$('#sel_theme').attr('disabled',true);}
$('#lieux_ev').attr('disabled',true).addClass('ch_readonly');$("#lieucont input:radio").each(function(){$(this).bind('click',function(){var tmp=this.value;if(this.checked==true){$('#sel_theme option[@value='+tmp+'], #partTheme2 option[@value='+tmp+']').attr('selected',true);}});});$('.noselect').bind('click',function(){var nxtChkB=$(this).next(':input:radio');nxtChkB.click();$('#sel_theme, #lieux_ev').attr('disabled',true).addClass('ch_readonly');$('#sel_lieu1').hide();$('#ctLieuPart:hidden, #sel_lieu2').show('slow');$('#partTheme option[@value='+nxtChkB.value+']').attr('selected',true);});$('#actsel').bind('click',function(){$(this).next(':input:radio').click();$('#lieux_ev, #sel_theme').removeAttr('disabled').removeClass('ch_readonly');$('#sel_lieu2').hide();$('#lieux_ev').removeAttr('disabled').removeAttr('readonly');});$('#sel_theme').change(function(){$('#partTheme option[@value='+this.value+']').attr('selected',true);});$('#partTheme').change(function(){d_('isautre').checked=true;$('#og_'+this.value+' option:first').attr('selected',true);$('#sel_theme option[@value='+this.value+']').attr('selected',true);});var vClieu='';$('#partTheme2').change(function(){if(this.value=='3'){d_('isbar').checked=true;}else if(this.value=='2'){d_('isclub').checked=true;}else if(this.value=='4'){d_('isresto').checked=true;}else{d_('isautre').checked=true;$('#sel_theme option:first').attr('selected',true);}
$('#og_'+this.value+' option:first').attr('selected',true);});$('#partLieux2, #partLieux1').change(function(){vClieu=this.value;if(vClieu!=''){$('#lieux_ev').val(aJsData[vClieu][0]).removeAttr('disabled').removeClass('ch_readonly');$('#addr_event').val(aJsData[vClieu][1]+"\n"+aJsData[vClieu][2]+"    "+aJsData[vClieu][3]);}else{$('#lieux_ev, #lieux_evH').val('');$('#addr_event').val('');}});$('#add_part').click(function(){dfpopup(this.href,'ajouter_un_lieu','Ajouter un nouvel endroit ?','width=600,height=460');return false;}).css('text-decoration','underline');$('#swsel_lieu1').click(function(){if($('#isautre').attr('checked')==true){$('#ctLieuPart ,#sel_lieu1').show('slow');}});$('#SelDynDate1').change(function(){if(this.value=='d'&&$('#dpicker_opt:hidden').length>0){$('#dpicker_opt:hidden').fadeIn('slow');}else if(this.value!='d'&&$('#dpicker_opt:visible').length>0){$('#dpicker_opt').fadeOut();}});$('#chkIsfree').click(function(){if(d_('chkIsfree').checked){$('#fieIsfree').val('0').attr('disabled',true).addClass('ch_readonly');}else{$('#fieIsfree').attr('disabled',false).val('').removeClass('ch_readonly');}});$('a.datepicker').bind('click',function(){var vcible=$(this).siblings('.champ_date').attr('id');var tqs=$('#'+vcible).val().split('/');if((vcible=='')||(tqs.length!=3)||(isNaN(tqs[0])||tqs[0].length!=2)||(isNaN(tqs[1])||tqs[1].length!=2)||(isNaN(tqs[2])||tqs[2].length!=4)){$('#'+vcible).css({border:'1px dashed #FF0000',background:'#FFCC99'});alert('date invalide, vérifiez votre saisie svp');return false;}
var qs='?chc='+vcible+'&d='+tqs[0]+'&m='+tqs[1]+'&y='+tqs[2];DPICKERPOP='<iframe id="ifrdatepicker" src="'+this.href+qs+'" width="190" height="152" '
+'marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="position:absolute;border:1px outset #000000" '
+'></iframe>';if(d_('ifrdatepicker')){$('#ifrdatepicker').attr('src',this.href+qs);return false;}
$(this).after(DPICKERPOP);return false;});$('#is_child').change(function(){if(this.value>$('#maxgroup').val()||this.value==10){$('#maxgroup option[@value='+this.value+']').attr('selected',true);}
if(this.value!=1){$('#is_multinsc').attr('checked',true);}});$('#maxgroup').change(function(){$('#is_multinsc').attr('checked',true);});$("#formadd_event").unbind('submit').submit(function(){ok=false;if(d_('isbar').checked==true||d_('isclub').checked==true||d_('isresto').checked==true){$('#lieux_ev, #sel_theme').removeAttr('disabled').removeClass('ch_readonly').attr('readonly',true);ok=true;}else if(d_('isautre').checked==true){ok=true;}else{ok=false;}
var aDateEv=$('#date_ev').val();if(aDateEv.match(/^\d{1,2}\/\d{1,2}\/\d{4,4}$/)==null){ok=false;$('#date_ev').addClass('champ_Req').bind('focus',function(){$(this).removeClass('champ_Req').bind('blur',function(){$(this).addClass('champ_actBLU');});});}
$(".req").each(function(){this.value=$.trim(this.value);if(this.value==''){ok=false;$(this).addClass('champ_Req').bind('focus',function(){$(this).removeClass('champ_Req').bind('blur',function(){$(this).addClass('champ_actBLU');});});}});if(ok==false){$('.asError').remove();$('#formadd_event fieldset:eq(1)').after('<p class="asError erreur">Vous avez oubliez de remplir un champ, de choisir une option, ou une valeur renseigné est invalide <br />( mit en evidence en rouge)</p>');return false;}else{$('#notify').css('display','none');$('#controles').after(Vloading).css('display','none');return true;}});var vUrl=window.document.location.href+'';if(vCur.lastIndexOf('ea=editer')!=-1){$('#lieucont input:checked').fadeIn(5,function(){this.click();});}}});
