window.addEvent("load",function(){        if($('loader')){           new Fx.Morph($('slidehidden'), {duration:500, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity': 0});           var loader = new clrzMachinegun({                        elt:'loading',                        fps:2,                        length:3600            });            loader.Play();            Cookie.write("oranginaload","1",{path:"/"});        }    });    window.addEvent("domready",function(){        var myImage = new Asset.image('/wp-content/themes/orangina/images/loader/loading1.jpg');        if($('loader')){            new Fx.Morph($('loader'), {duration:1000, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity': 1});            $(document.body).setStyle('overflow', 'hidden');            chargementloader.periodical(2200);        }    });    function chargementloader(){        var chargement = new Fx.Morph($$('#txtchargement img')[0], {duration:1100, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity': 1});        chargement.start({'opacity': 0.4}).chain(function(){chargement.start({'opacity': 1});});    }/*window.addEvent("load",function(){var a=new Fx.Morph($("loader"),{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"0"})});*/window.addEvent("domready",function(){if($("list-prints")){makeScrollbar($("list-prints"),$("scrollbar1"),$("handle1"),$("handle2"),$("handle3"))}if($("bloc-actu")){makeScrollbar($("bloc-actu"),$("scrollbar2"),$("handle2"),$("handle1"),$("handle3"))}if($("galery-fe")){makeScrollbar($("galery-fe"),$("scrollbar2"),$("handle2"),$("handle1"),$("handle3"))}if($("txt-single")){makeScrollbar($("txt-single"),$("scrollbar1"),$("handle1"),$("handle2"),$("handle3"))}if($("content-related")){makeScrollbar($("content-related"),$("scrollbar1"),$("handle1"),$("handle2"),$("handle3"))}if($("bloc-page")){makeScrollbar($("bloc-page"),$("scrollbar2"),$("handle2"),$("handle1"),$("handle3"))}if($("list-pubs")){makeScrollbar($("list-pubs"),$("scrollbar2-1"),$("handle2-1"),$("handle1-1"),$("handle3-1"))}if($("bloc-fe")){galeryFe()}if($("bloc-prints")){galeryPrints()}if($("navi-left")){currentsNavi()}if($("video-home")){videoChoice();var d=[];var c=[];var b=[];$$(".player .item-info").each(function(k,j){d[j]=new Fx.Morph(k,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:"0"})});$$(".player .item-qualite").each(function(k,j){c[j]=new Fx.Morph(k,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:"0"})});$$(".player .item-mail").each(function(k,j){b[j]=new Fx.Morph(k,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"0"})})}if($("bouteilles")){productsHover()}initImageZoom();if($("mask-background")){backgroundSize()}if($("background-images")){backgroundSize2()}$$(".swfheader").each(function(k,j){var l=new Swiff(k.title,{width:850,height:317,container:$(k.id),params:{wmode:"transparent",bgcolor:"#ff3300"}})});if($("header")){var a=new clrzSlider({perpage:1,setpage:0,layout:"horizontal",container:"mask-slider-header",items:"#mask-slider-header div.item-slider-header",contentslider:"box-slider-header",srolling:false,autostart:true,duration:600,onZgoto:function(k){$$(".list-slider-buttons li a").removeClass("active");$$(".list-slider-buttons li a")[this.setpage].addClass("active");if($("headslide-"+this.setpage)){var j=new Swiff($("headslide-"+this.setpage).title,{width:850,height:317,container:$($("headslide-"+this.setpage).id),params:{wmode:"transparent",bgcolor:"#ff3300"}})}}});$$(".list-slider-buttons li a").each(function(k,j){k.addEvent("click",function(l){a.zgoto(j);l.stop()})})}    var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;    var tabhabi = [];        $$('.bgfan').each(function(element,i){            tabhabi[i] = new Fx.Morph(element, {duration:1000, wait:false,transition:Fx.Transitions.Expo.easeOut}).set({'opacity': 0});        });        if(tabhabi.length>0){            if(Cookie.read("background2")){                if(ie7)                    tabhabi[Cookie.read("background2")].set({'opacity': 1});                else                    tabhabi[Cookie.read("background2")].start({'opacity': 1});            }            else{                if(ie7)                    tabhabi[0].set({'opacity': 1});                else                    tabhabi[0].start({'opacity': 1});            }        }    if($("mask-slide-home")){var g=0;if($chk(Cookie.read("background2"))){g=Cookie.read("background2")}else{var i=Cookie.write("background2","0",{path:"/"});g=0}        var h=new clrzSlider({perpage:1,setpage:g,layout:"horizontal",container:"mask-slide-home",items:"#mask-slide-home div.item-slide-home",contentslider:"box-slide-home",srolling:false,duration:1500,btnprev:"#prev-slide-home",btnnext:"#next-slide-home",            onZgoto:function(j){                if(Cookie.read("background2")){                    if(ie7)                        tabhabi[Cookie.read("background2")].set({'opacity': 0});                    else                        tabhabi[Cookie.read("background2")].start({'opacity': 0});                }                Cookie.dispose("background2");                if(ie7)                    tabhabi[this.setpage].set({'opacity': 1});                else                    tabhabi[this.setpage].start({'opacity': 1});                                var k=Cookie.write("background2",this.setpage,{path:"/"})            }});        var f=new clrzSlider({perpage:1,setpage:g,layout:"horizontal",container:"mask-background",items:"#mask-background div.item-background",contentslider:"box-background",srolling:false,duration:600,btnprev:"#prev-slide-home",btnnext:"#next-slide-home"})}if($("content-single")){naviEgalement()}InputValue("s")});function InputValue(b){if(!$(b)){return}var a=$(b).get("value");$(b).addEvents({focus:function(){if(a==this.get("value")){this.setProperty("value","")}},blur:function(){if(this.get("value")==""){this.setProperty("value",a)}}})}function backgroundSize(){var c=[];var f=screen.width;var g=screen.height;var d=0;$$(".item-background").each(function(j,h){if(f<=1327&&g<=1026){c[h]=new Fx.Morph(j,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#"+j.id+" img")[0].src+'") no-repeat right top '})}else{if(f<=1280&&g<=1024){c[h]=new Fx.Morph(j,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#"+j.id+" img")[4].src+'") no-repeat right top '})}else{if(f<=1024&&g<=768){c[h]=new Fx.Morph(j,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#"+j.id+" img")[2].src+'") no-repeat right top '})}else{if(f<=800&&g<=600){c[h]=new Fx.Morph(j,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#"+j.id+" img")[3].src+'") no-repeat right top '})}else{c[h]=new Fx.Morph(j,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#"+j.id+" img")[1].src+'") no-repeat right top '})}}}}d++});var a=screen.width*d;var b=a/d;$("mask-background").style.width=screen.width;$("box-background").style.width=a;$$(".item-background").each(function(j,h){c[h].set({width:b})})}function backgroundSize2(){var a=screen.width;var c=screen.height;var b="";if(a<=1327&&c<=1026){b=new Fx.Morph($("background-images"),{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#background-images img")[0].src+'") no-repeat center top !important'})}else{if(a<=1280&&c<=1024){b=new Fx.Morph($("background-images"),{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#background-images img")[4].src+'") no-repeat center top !important'})}else{if(a<=1024&&c<=768){b=new Fx.Morph($("background-images"),{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#background-images img")[2].src+'") no-repeat center top !important'})}else{if(a<=800&&c<=600){b=new Fx.Morph($("background-images"),{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#background-images img")[3].src+'") no-repeat center top !important'})}else{b=new Fx.Morph($("background-images"),{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({background:'url("'+$$("#background-images img")[1].src+'") no-repeat center top !important'})}}}}$("background-images").style.width=screen.width}function naviEgalement(){var a=new Fx.Morph($("bloc-similaire"),{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({"background-position":"67px 50px"});$$(".item-egalement").each(function(c,b){c.addEvent("mouseover",function(f){var d=(b*82)+50;a.start({"background-position":"58px "+d+"px"})});c.addEvent("mouseout",function(d){a.start({"background-position":"67px 50px"})})})}function makeScrollbar(g,j,f,c,d,a,h){var i=(a?(g.getScrollSize().x-g.getSize().x):(g.getScrollSize().y-g.getSize().y));var b=new Slider(j,f,{steps:i,mode:(a?"horizontal":"vertical"),onChange:function(l){var k=(a?l:0);var m=(a?0:l);g.scrollTo(k,m)}}).set(0);if(!(h)){$$(g,j).addEvent("mousewheel",function(l){l=new Event(l).stop();var k=b.step-l.wheel*30;b.set(k)})}if(c){$$(c).addEvent("click",function(l){l=new Event(l).stop();var k=b.step-30;b.set(k)})}if(c){$$(d).addEvent("click",function(l){l=new Event(l).stop();var k=b.step+30;b.set(k)})}}function galeryFe(){var a=[];$$(".item-fe").each(function(c,b){a[b]=new Fx.Morph(c,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:0,"z-index":1})});a[0].set({opacity:1,"z-index":10});$$(".item-galery").each(function(c,b){c.addEvent("click",function(d){$$(".item-fe").each(function(g,f){a[f].start({opacity:0,"z-index":1})});a[b].start({opacity:1,"z-index":10});d.stop()})})}function galeryPrints(){var a=[];$$(".top-print img").each(function(c,b){a[b]=new Fx.Morph(c,{duration:1000,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:0,"z-index":1})});a[0].set({opacity:1,"z-index":10});$$(".list-prints li").each(function(c,b){c.addEvent("click",function(d){$$(".top-print img").each(function(g,f){a[f].start({opacity:0,"z-index":1})});a[b].start({opacity:1,"z-index":10});d.stop()})})}function productsHover(){var c=[];var b=[];var d=[];var f=[];var a=[];$$(".back-content-bouteille").each(function(h,g){c[g]=new Fx.Morph(h,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:0,"z-index":5})});$$(".content-bouteille").each(function(h,g){b[g]=new Fx.Morph(h,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:0,"z-index":6});h.addEvent("mouseleave",function(i){f.set({"z-index":1,opacity:0});d[g].set({"z-index":5});c[g].set({"z-index":22,opacity:0});b[g].set({"z-index":23,opacity:0})})});f=new Fx.Morph($("background-opacity"),{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:0,"z-index":1});$$(".item-bouteille").each(function(h,g){a[g]=new Fx.Morph(h,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:1})});$$(".link-bouteille").each(function(h,g){d[g]=new Fx.Morph(h,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({"z-index":5});h.addEvent("click",function(i){f.set({"z-index":20,opacity:1});d[g].set({"z-index":23});c[g].set({"z-index":22,opacity:1});b[g].set({"z-index":25,opacity:1});i.stop()})})}function hasClass(b,a){return b.className.match(new RegExp("(\\s|^)"+a+"(\\s|$)"))}function currentsNavi(){var a=[];$$(".naviabsolute li").each(function(c,b){a[b]=new Fx.Morph(c,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({"background-position":"left top"})});$$(".naviabsolute li a").each(function(c,b){c.addEvent("mouseover",function(d){a[b].set({"background-position":"left bottom"})});c.addEvent("mouseout",function(d){if(!hasClass(c,"current")){a[b].set({"background-position":"left top"})}})})}function loadFlash(b,d,c){var a=(c?(true):(false));var f=new Swiff("/wp-content/themes/orangina/flash/player.swf",{id:"orangina",container:d,width:775,height:510,params:{wmode:"transparent",bgcolor:"#ffffff",allowscriptaccess:"always",allowfullscreen:"true"},vars:{file:b,title:"Orangina",autostart:a,controlbar:"bottom",skin:"/wp-content/themes/orangina/flash/stylish.swf",repeat:"no"}});return f}function videoChoice(){$$(".item-related").each(function(b,a){b.addEvent("click",function(c){$$(".player .item-info").removeClass("current-info");$$(".player .item-qualite").removeClass("current-qualite");$$(".player .item-mail").removeClass("current-mail");$$(".player .item-info")[a].addClass("current-info");$$(".player .item-qualite")[a].addClass("current-qualite");$$(".player .item-mail")[a].addClass("current-mail");$$(".player .fermeclassinfo").removeClass("close-info");$$(".player .fermeclassqualite").removeClass("close-qualite");$$(".player .fermeclassmail").removeClass("close-mail");$$(".player .fermeclassinfo")[a].addClass("close-info");$$(".player .fermeclassqualite")[a].addClass("close-qualite");$$(".player .fermeclassmail")[a].addClass("close-mail");$("video-home").setAttribute("rel",$$(".img-bloc img")[a].alt);loadFlash($("video-home").getProperty("rel"),$("video-home"),true);c.stop()})});loadFlash($("video-home").getProperty("rel"),$("video-home"))}function playerReady(a){player=document.getElementById(a.id)}function getVideoInfo(){$("orangina").sendEvent("PLAY","false");var b=[];$$(".player .item-qualite").each(function(f,d){b[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:"0"})});var a=[];$$(".player .item-mail").each(function(f,d){a[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"0"})});var c=[];$$(".player .current-info").each(function(f,d){c[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"1"})});$$(".player .close-info").each(function(f,d){f.addEvent("click",function(g){c[d].start({opacity:"0"});$("orangina").sendEvent("PLAY","false");g.stop()})})}function getVideoQualite(){$("orangina").sendEvent("PLAY","false");var c=[];$$(".player .item-info").each(function(f,d){c[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:"0"})});var a=[];$$(".player .item-mail").each(function(f,d){a[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"0"})});var b=[];$$(".player .current-qualite").each(function(f,d){b[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"1"})});$$(".player .close-qualite").each(function(f,d){f.addEvent("click",function(g){b[d].start({opacity:"0"});$("orangina").sendEvent("PLAY","false");g.stop()})});$$(".chg-quality").each(function(f,d){f.addEvent("click",function(g){$$(".player .current-qualite").each(function(h,j){b[j]=new Fx.Morph(h,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"0"})});$("video-home").setAttribute("rel",f.rel);loadFlash($("video-home").getProperty("rel"),$("video-home"),true);g.stop()})})}function getVideoMail(){$("orangina").sendEvent("PLAY","false");var c=[];$$(".player .item-info").each(function(f,d){c[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).set({opacity:"0"})});var b=[];$$(".player .item-qualite").each(function(f,d){b[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"0"})});var a=[];$$(".player .current-mail").each(function(f,d){a[d]=new Fx.Morph(f,{duration:400,wait:false,transition:Fx.Transitions.Expo.easeOut}).start({opacity:"1"})});$$(".player .close-mail").each(function(f,d){f.addEvent("click",function(g){a[d].start({opacity:"0"});$("orangina").sendEvent("PLAY","false");g.stop()})});$$(".current-mail form").each(function(f,d){f.addEvent("submit",function(g){var i=$$(".current-mail .form-mail")[0].id.split("form-mail")[1];var h=$("divmessage"+i);if($("pseudo"+i)){l_input=$("pseudo"+i);l_value=l_input.value.replace(/^\s+|\s+$/g,"");if(l_value==""){h.innerHTML="<b>Veuillez indiquer votre pseudo.</b><br />";l_input.focus(g);e=new Event(g).stop();return false}}if($("mailfrom"+i)){l_input=$("mailfrom"+i);l_value=l_input.value.replace(/^\s+|\s+$/g,"");if(l_value==""){h.innerHTML="<b>Veuillez indiquer votre mail.</b><br />";l_input.focus();e=new Event(g).stop();return false}else{if(!(/^[^@]+[@][^@]+[.][^@]+$/).test(l_value)){h.innerHTML="<b>Votre mail n'a pas une forme correct.</b><br />";l_input.focus();e=new Event(g).stop();return false}}}if($("mailto"+i)){l_input=$("mailto"+i);l_value=l_input.value.replace(/^\s+|\s+$/g,"");if(l_value==""){h.innerHTML="<b>Veuillez indiquer un mail de destinataire.</b><br />";l_input.focus();e=new Event(g).stop();return false}else{if(!(/^[^@]+[@][^@]+[.][^@]+$/).test(l_value)){h.innerHTML="<b>Le mail destinataire n'a pas une forme correct.</b><br />";l_input.focus();e=new Event(g).stop();return false}}}if($("sujet"+i)){l_input=$("sujet"+i);l_value=l_input.value.replace(/^\s+|\s+$/g,"");if(l_value==""){h.innerHTML="<b>Veuillez indiquer un sujet.</b><br />";l_input.focus(g);e=new Event(g).stop();return false}}if($("message"+i)){l_input=$("message"+i);l_value=l_input.value.replace(/^\s+|\s+$/g,"");if(l_value==""){h.innerHTML="<b>Veuillez indiquer un message.</b><br />";l_input.focus(g);e=new Event(g).stop();return false}}window.open(f.action+"?to_mail="+$("mailto"+i).value+"&from_mail="+$("mailfrom"+i).value+"&pseudo="+$("pseudo"+i).value+"&sujet="+$("sujet"+i).value+"&message="+$("message"+i).value+"");h.innerHTML="<b>Mail envoyé avec succès !</b><br />";$("mailfrom"+i).value="";$("mailto"+i).value="";$("pseudo"+i).value="";$("message"+i).value="";$("sujet"+i).value="";g.stop()})})}function getFacebookPartage(){$("orangina").sendEvent("PLAY","false");window.open("http://www.facebook.com/share.php?u="+$$(".current-info h3")[0].title+"&t="+$$(".current-info h2")[0].title+"")}function getTwitterPartage(){$("orangina").sendEvent("PLAY","false");window.open("http://twitter.com/home?status="+$$(".current-info h2")[0].title+" - "+$$(".current-info h3")[0].title+"")};