(function(jQuery){jQuery.fx.step.clip=function(fx){if(fx.state==0){var cRE=/rect\(([0-9]{1,})(px|em)[,\s]+([0-9]{1,})(px|em)[,\s]+([0-9]{1,})(px|em)[,\s]+([0-9]{1,})(px|em)\)/;var $elem=$(fx.elem),clipTest=getClip(fx.elem),clip=cRE.test(clipTest)?clipTest:'rect(0px '+$elem.width()+'px '+$elem.height()+'px 0px)';fx.start=cRE.exec(clip.replace(/,/g," "));try{fx.end=cRE.exec(fx.end.replace(/,/g,''));}catch(e){return false;}}
var sarr=new Array(),earr=new Array(),spos=fx.start.length,epos=fx.end.length,emOffset=fx.start[ss+1]=='em'?(parseInt($(fx.elem).css('fontSize'))*1.333*parseInt(fx.start[ss])):1;for(var ss=1;ss<spos;ss+=2){sarr.push(parseInt(emOffset*fx.start[ss]));}
for(var es=1;es<epos;es+=2){earr.push(parseInt(emOffset*fx.end[es]));}
fx.elem.style.clip='rect('+parseInt((fx.pos*(earr[0]-sarr[0]))+sarr[0])+'px '+parseInt((fx.pos*(earr[1]-sarr[1]))+sarr[1])+'px '+parseInt((fx.pos*(earr[2]-sarr[2]))+sarr[2])+'px '+parseInt((fx.pos*(earr[3]-sarr[3]))+sarr[3])+'px)';}})(jQuery);function getClip(elem){var $elem=$(elem),domEl=$elem.get(0),ret=$elem.css('clip');if(!ret&&domEl.currentStyle)
{ret='rect('+domEl.currentStyle.clipTop+', '+domEl.currentStyle.clipRight+', '+domEl.currentStyle.clipBottom+', '+domEl.currentStyle.clipLeft+')'}
return ret;}
jQuery.fn.vibrate=function(distance,repetition,duration){var i=0;var o=distance/distance;while(i<repetition){$(this).animate({marginLeft:Math.round(Math.random()*distance)-((distance+1)/2)+'px',marginTop:Math.round(Math.random()*distance)-((distance+1)/2)+'px'},duration);i++;if(i==repetition){$(this).animate({marginLeft:0,marginTop:0},duration);}}}
$(document).ready(function(){$('.wineBox').mouseover(function(){if($(".mini",this).is(':animated')==false){$(".mini",this).vibrate(3,4,40)};});$('.wineBox a .mini').click(function(){window.location.hash=$(this).parent().attr('href');});$('.wineBox').click(function(){$("a",this).fancybox({'padding':0,'overlayOpacity':0.5,'overlayColor':'#545655','scrolling':'no','titleShow':false,'speedIn':800,'speedOut':800,'transitionIn':'fade','transitionOut':'fade'}).trigger('click');});var bottleClosed='clip:rect(0px 30px 95px 0px)';var bottleOpen='rect(0px 175px 95px 0px)';if(location.hash){var obj=location.hash.substr(1);$("a[href="+obj+"]").fancybox({'padding':0,'overlayOpacity':0.5,'overlayColor':'#545655','scrolling':'no','titleShow':false,'speedIn':1400,'speedOut':800,'transitionIn':'fade','transitionOut':'fade'}).trigger('click');}
$(".wineBox a").fancybox({'padding':0,'overlayOpacity':0.5,'overlayColor':'#545655','scrolling':'no','titleShow':false,'speedIn':800,'speedOut':800,'transitionIn':'fade','transitionOut':'fade'})
$('#tabs li a').click(function(){$('#tabs li').removeClass('active');$('#tabsLower li').removeClass('active');var className=$(this).attr('class');$("a[class='"+className+"']").parent().addClass('active');});$('#tabsLower li a').click(function(){$('#tabs li').removeClass('active');$('#tabsLower li').removeClass('active');var className=$(this).attr('class');$("a[class='"+className+"']").parent().addClass('active');});$(".parPropriete").click(function(){if($("#content").height()!=470){$("#content").stop().animate({'height':'470px'},1500);$("#content").css('background-image','none').queue(function(){$(this).css({"background-image":'url(skin/'+bgcarte+')'});$(this).dequeue();});$("#saintLouansRouge").stop().animate({'clip':bottleClosed},"slow").animate({'left':'40px','top':'225px'},"slow");$("#saintLouansBlanc").stop().animate({'clip':bottleClosed},"slow").animate({'left':'75px','top':'225px'},"slow");$("#grilleRouge").stop().animate({'clip':bottleClosed},"slow").animate({'left':'278px','top':'155px'},"slow");$("#grilleRose").stop().animate({'clip':bottleClosed},"slow").animate({'left':'313px','top':'155px'},"slow");$("#cuveeChenin").stop().animate({'clip':bottleClosed},"slow").animate({'left':'478px','top':'190px'},"slow");$("#marieJustine").stop().animate({'clip':bottleClosed},"slow").animate({'left':'508px','top':'190px'},"slow");$("#vieillesVignes").stop().animate({'clip':bottleClosed},"slow").animate({'left':'635px','top':'300px'},"slow");$("#perriere").stop().animate({'clip':bottleClosed},"slow").animate({'left':'667px','top':'300px'},"slow");$("#roncee").stop().animate({'clip':bottleClosed},"slow").animate({'left':'800px','top':'213px'},"slow");$("#marronniers").stop().animate({'clip':bottleClosed},"slow").animate({'left':'770px','top':'213px'},"slow");$('#domaines').css('display','block');setTimeout(function(){$("#tabs").after(animCode);},1550);}
return false;});$(".parPrix").click(function(){if($("#content").height()!=912){$('#showAnim').remove();$('#domaines').css('display','none');$("#content").stop().animate({'height':'912px'},1500);$("#content").css('background-image','none').queue(function(){$(this).css({"background-image":'url(skin/'+bgprix+')'});$(this).dequeue();});$("#saintLouansRouge").stop().delay(500).animate({'left':'135px','top':'80px'},"slow").animate({'clip':bottleOpen},"slow");$("#saintLouansBlanc").stop().delay(500).animate({'left':'135px','top':'340px'},"slow").animate({'clip':bottleOpen},"slow");$("#grilleRouge").stop().delay(500).animate({'left':'135px','top':'185px'},"slow").animate({'clip':bottleOpen},"slow");$("#grilleRose").stop().delay(500).animate({'left':'395px','top':'600px'},"slow").animate({'clip':bottleOpen},"slow");$("#cuveeChenin").stop().delay(500).animate({'left':'395px','top':'705px'},"slow").animate({'clip':bottleOpen},"slow");$("#marieJustine").stop().delay(500).animate({'left':'660px','top':'810px'},"slow").animate({'clip':bottleOpen},"slow");$("#perriere").stop().delay(500).animate({'left':'660px','top':'705px'},"slow").animate({'clip':bottleOpen},"slow");$("#vieillesVignes").stop().delay(500).animate({'left':'395px','top':'440px'},"slow").animate({'clip':bottleOpen},"slow");$("#roncee").stop().delay(500).animate({'left':'660px','top':'600px'},"slow").animate({'clip':bottleOpen},"slow");$("#marronniers").stop().delay(500).animate({'left':'395px','top':'340px'},"slow").animate({'clip':bottleOpen},"slow");}
return false;});$(".parCouleur").click(function(){if($("#content").height()!=648){$('#showAnim').remove();$('#domaines').css('display','none');$("#content").stop().animate({'height':'648px'},1500);$("#content").css('background-image','none').queue(function(){$(this).css({"background-image":'url(skin/'+bgcolor+')'});$(this).dequeue();});$("#saintLouansRouge").stop().delay(500).animate({'left':'17px','top':'80px'},"slow").animate({'clip':bottleOpen},"slow");$("#saintLouansBlanc").stop().delay(500).animate({'left':'17px','top':'515px'},"slow").animate({'clip':bottleOpen},"slow");$("#grilleRouge").stop().delay(500).animate({'left':'210px','top':'80px'},"slow").animate({'clip':bottleOpen},"slow");$("#grilleRose").stop().delay(500).animate({'left':'210px','top':'365px'},"slow").animate({'clip':bottleOpen},"slow");$("#cuveeChenin").stop().delay(500).animate({'left':'750px','top':'515px'},"slow").animate({'clip':bottleOpen},"slow");$("#marieJustine").stop().delay(500).animate({'left':'750px','top':'365px'},"slow").animate({'clip':bottleOpen},"slow");$("#perriere").stop().delay(500).animate({'left':'585px','top':'210px'},"slow").animate({'clip':bottleOpen},"slow");$("#vieillesVignes").stop().delay(500).animate({'left':'585px','top':'80px'},"slow").animate({'clip':bottleOpen},"slow");$("#roncee").stop().delay(500).animate({'left':'405px','top':'210px'},"slow").animate({'clip':bottleOpen},"slow");$("#marronniers").stop().delay(500).animate({'left':'405px','top':'80px'},"slow").animate({'clip':bottleOpen},"slow");}
return false;});$('#tabs').after(animCode);});var animCode='<div id="showAnim"><a href="animation.swf" onclick="showAnim(); return false;">Animation Chinon</a></div>';function animation_DoFSCommand(command,args){$('#showAnim').remove();$('#tabs').after(animCode);}
function showAnim(){$('#showAnim a').media({attrs:{name:'animation',id:'animation'},flashvars:{language:'fr'},bgColor:'transparent',width:937,height:451});$('#showAnim div div').remove();}
