/*cached*/
var extend=function(){var extended={};for(var i=0;i<arguments.length;i++){$.extend(extended,arguments[i]);}
return extended;};var Utilities={getParam:function(name){var q=document.location.search;var i=q.indexOf(name+'=');if(i==-1){return null;}
var r=q.substr(i+name.length+1,q.length-i-name.length-1);i=r.indexOf('&');if(i!=-1){r=r.substr(0,i);}
return r.replace(/\+/g,' ');},locationIs:function(name){return(name==document.location.href.substr(document.location.href.length-name.length,name.length));},truncate:function(s,len,addchar){if(s){if(s.length>len-1){return s.substr(0,len)+(addchar!=null?addchar:"…");}}
return s;},mysqlDate:function(timestamp){var regex=/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/;var parts=timestamp.replace(regex,"$1 $2 $3 $4 $5 $6").split(' ');return new Date(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]);},localeDate:function(d){return(d.getDate()+"/"+((parseInt(d.getMonth(),10)+1)<10?"0"+(parseInt(d.getMonth(),10)+1):(parseInt(d.getMonth(),10)+1))+"/"+d.getFullYear());},localeDateAndTime:function(d){return Utilities.localeDate(d)+" "+(d.getHours()+":"+(d.getMinutes()<10?"0"+d.getMinutes():d.getMinutes()));},localeDateAndTimeWithSeconds:function(d){return Utilities.localeDateAndTime(d)+":"+(d.getSeconds()<10?"0"+d.getSeconds():d.getSeconds());},filesize:function(bytes){var size;var unit;if(bytes>=1099511627776){size=bytes/1099511627776;unit=' To';}else if(bytes>=1073741824){size=bytes/1073741824;unit=' Go';}else if(bytes>=1048576){size=bytes/1048576;unit=' Mo';}else if(bytes>=1024){size=bytes/1024;unit=' Ko';}else{size=bytes;unit=' bytes';}
var precision=1;if(size<10){precision=2;}
size=Math.roundWithPrecision(size,precision);if((size%1)==0&&unit!=' bytes'){size=size+'.0';}
return(size+'').replace("\.",",")+unit;},imagesize:function(w,h){var size=Math.roundWithPrecision((w*h)/1000000,1)+" Mpx";return(size+'').replace("\.",",");},price:function(a,currency){if(currency==null){currency="€";}
var amount="";a=parseInt(a,10);if(Math.abs(a)<10){amount="00"+Math.abs(Math.round(a)).toString();}else if(Math.abs(a)<100){amount="0"+Math.abs(Math.round(a)).toString();}else{amount=Math.abs(Math.round(a)).toString();}
if(a<0){amount="- "+amount;}
return currency+" "+amount.substr(0,amount.length-2)+","+amount.substr(amount.length-2,2);},billnumber:function(num){if(num){var n="";var i;for(i=0;i<7-num.toString().length;i++){n+="0";}
return""+n+num;}else{return"";}},ordernumber:function(num){var n="";var i;for(i=0;i<7-num.toString().length;i++){n+="0";}
return"W"+n+num;},getCookie:function(c_name){if(document.cookie.length>0)
{c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}else{}
return"no such cookie";},setForAttributes:function(el){var set=function(i,el){var rnd=Math.random()*10000;$(el).attr("id","for_input"+rnd);$(el).next("label").attr("for","for_input"+rnd);}
$("[type=radio]",el).each(set);$("[type=checkbox]",el).each(set);},isAuth:function(xr){return true;},isOK:function(xr){var XKS=Utilities.getXKSHeader(xr);switch(XKS.status){case 200:return true;}
if($.jGrowl){$.jGrowl((XKS.message!=""?XKS.message:"Erreur inconnue.")+"<br /><br />Status "+XKS.status+".",{theme:'red'});}
return false;},getXKSHeader:function(xr){var header={status:0,message:""};if(xr.getResponseHeader("X-KS")){var couple=xr.getResponseHeader("X-KS").split(' ');header.status=parseInt(couple.shift(),10);header.message=couple.join(' ');}else{alert("Warning: No X-KS header!\nResponse was:\n"+xr.responseText);}
return header;}};Math.roundWithPrecision=function(floatnum,precision){return Math.round(floatnum*Math.pow(10,precision))/Math.pow(10,precision);};var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return[valueL,valueT];},offsetParent:function(element){if(element.offsetParent)return element.offsetParent;if(element==document.body)return element;while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return element;return document.body;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=this.realOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=this.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},page:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!window.opera||element.tagName=='BODY'){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return[valueL,valueT];},clone:function(source,target){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})
source=$(source);var p=Position.page(source);target=$(target);var delta=[0,0];var parent=null;if(Element.getStyle(target,'position')=='absolute'){parent=Position.offsetParent(target);delta=Position.page(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)target.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)target.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)target.style.width=source.offsetWidth+'px';if(options.setHeight)target.style.height=source.offsetHeight+'px';},absolutize:function(element){element=$(element);if(element.style.position=='absolute')return;Position.prepare();var offsets=Position.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';},relativize:function(element){element=$(element);if(element.style.position=='relative')return;Position.prepare();element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;}};jQuery.fn.vibrate=function(conf){var config=jQuery.extend({speed:30,duration:1000,frequency:4000,spread:3,amplitude:8},conf);return this.each(function(){var t=jQuery(this);var amplitude=config.amplitude;var v=1;var vibrate=function(){v=-v;amplitude=amplitude>1?(amplitude-0.3):amplitude;var leftPos=Math.floor(v*amplitude);t.css({position:'relative',left:leftPos+'px'});};var doVibration=function(){var vibrationInterval=setInterval(vibrate,config.speed);var stopVibration=function(){clearInterval(vibrationInterval);t.css({position:'relative'});t.css({left:'0px'});};setTimeout(stopVibration,config.duration);};doVibration();});};var selectOption=function(jqueryEl,value){var selected=null;$("option",jqueryEl).each(function(i,el){if(el.value==value){selected=i;}});if(selected!=null){$(jqueryEl).get(0).selectedIndex=selected;}
return(selected!=null);}
var selectedValue=function(jqueryEl){var selected=null;var first_option=null;$("option",jqueryEl).each(function(i,el){if(first_option==null){first_option=el.value;}
if(el.selected==true){selected=el.value;return false;}});return selected?selected:first_option;}
var selectedLabel=function(jqueryEl){var selected=null;var first_option=null;$("option",jqueryEl).each(function(i,el){if(first_option==null){first_option=$(el).text();}
if(el.selected==true){selected=$(el).text();return false;}});return(selected!==null)?selected:first_option;}
jQuery.fn.selectOption=function(value){return this.each(function(){$("option",this).each(function(i,el){if(el.value==value){el.selected=true;return false;};});});};jQuery.fn.bubble=function(){return $(this).each(function(){var bubble_height=parseInt($(this).next(".bubble").css("height"),10);$(this).hover(function(){Position.prepare();var pos={left:Math.max(8,Position.cumulativeOffset(this)[0]-24),top:Position.cumulativeOffset(this)[1]};$(this).next(".bubble").css({position:'fixed',left:pos.left,top:pos.top-bubble_height-30});$(this).next(".bubble").animate({opacity:"show",top:pos.top-bubble_height-20},"normal");},function(){var pos={left:Math.max(8,Position.cumulativeOffset(this)[0]-24),top:Position.cumulativeOffset(this)[1]};$(this).next(".bubble").animate({opacity:"hide",top:pos.top-bubble_height-30},"fast");});});};removeFromArray=function(ar,from,to){var rest=ar.slice((to||from)+1||ar.length);ar.length=from<0?ar.length+from:from;return ar.push.apply(ar,rest);};function getSWF(movieName){if(navigator.appName.indexOf("Microsoft")!=-1){return window[movieName];}else{return document[movieName];}}
function openwindow(url,options){if(options==null){options="";}
return window.open(url,url,options);}
function htmlspecialchars(ch){ch=ch.replace(/&/g,"&amp;");ch=ch.replace(/\"/g,"&quot;");ch=ch.replace(/\'/g,"&#039;");ch=ch.replace(/</g,"&lt;");ch=ch.replace(/>/g,"&gt;");return ch;}
function log(){if(window.console&&window.console.log){for(var i=0;i<arguments.length;i++){window.console.log(var_dump(arguments[i],0));}}}
function var_dump(e,ind){var indentation="";ind=ind?ind:0;for(var i=0;i<ind*4;i++){indentation+=" ";}
var dump=indentation;if(typeof e=="object"){for(var ee in e){dump+=indentation+ee+": "+var_dump(e[ee],ind+1)+"\n";}}else{dump=indentation+e;}
return dump+"\n";}
$.fn.opacity=function(amount){if(amount>1)amount=1;if(amount<0)amount=0;if($.browser.msie){amount=(parseFloat(amount)*100);this.css('filter','alpha(opacity='+amount+')');}else{this.css('opacity',amount);this.css('-moz-opacity',amount);}
return this;}
var isIE6=function(){return(document.all&&!window.opera&&!window.XMLHttpRequest&&$.browser.msie);}