$(document).ready(function(){$('.faq-answer:gt(0)').hide();$('.faq-item').each(function(){$(this).children('.faq-question').click(function(){$(this).next().slideToggle()})});$(function(){$("#mydate").datepicker({showOn:"both",buttonImage:"/assets/images/layout/ico-calendar.png",buttonImageOnly:true,dateFormat:'dd/mm/yy'})});if((typeof my_position_long!=="undefined"&&my_position_long)&&(typeof my_position_lat!=="undefined"&&my_position_lat)){$('#map_canvas').each(initialize)}function initialize(){var latlng=new google.maps.LatLng(my_position_long,my_position_lat);var myOptions={zoom:14,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP,streetViewControl:true};var map=new google.maps.Map(document.getElementById("map_canvas"),myOptions);var image=new google.maps.MarkerImage('/assets/images/gmap/image.png',new google.maps.Size(70,39),new google.maps.Point(0,0),new google.maps.Point(35,39));var shadow=new google.maps.MarkerImage('/assets/images/gmap/shadow.png',new google.maps.Size(94,39),new google.maps.Point(0,0),new google.maps.Point(35,39));var shape={coord:[42,0,42,1,42,2,41,3,41,4,47,5,51,6,55,7,57,8,59,9,61,10,63,11,64,12,65,13,66,14,67,15,68,16,68,17,69,18,69,19,69,20,69,21,69,22,69,23,69,24,68,25,68,26,67,27,67,28,66,29,65,30,63,31,62,32,60,33,58,34,56,35,53,36,49,37,44,38,27,38,28,37,28,36,28,35,29,34,22,33,18,32,14,31,12,30,10,29,8,28,6,27,5,26,4,25,3,24,2,23,1,22,1,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,1,13,1,12,2,11,2,10,3,9,4,8,6,7,7,6,9,5,11,4,13,3,16,2,20,1,25,0,42,0],type:'poly'};var marker=new google.maps.Marker({position:latlng,map:map,icon:image,shadow:shadow,shape:shape})}$('form.my-contact-form input:text, form.my-contact-form textarea').each(toggleLabel).blur(toggleLabel).focus(onFocus).change(toggleLabel);function toggleLabel(){if($(this).val().length>0){$(this).prev().addClass('hide')}else{$(this).prev().removeClass('hide')}}function onFocus(){$(this).prev().addClass('hide')}var Playlist=function(instance,playlist,options){var self=this;this.instance=instance;this.playlist=playlist;this.options=options;this.current=0;this.cssId={jPlayer:"jquery_jplayer_",interface:"jp_interface_",playlist:"jp_playlist_"};this.cssSelector={};$.each(this.cssId,function(entity,id){self.cssSelector[entity]="#"+id+self.instance});if(!this.options.cssSelectorAncestor){this.options.cssSelectorAncestor=this.cssSelector.interface}$(this.cssSelector.jPlayer).jPlayer(this.options);$(this.cssSelector.interface+" .jp-previous").click(function(){self.playlistPrev();$(this).blur();return false});$(this.cssSelector.interface+" .jp-next").click(function(){self.playlistNext();$(this).blur();return false})};Playlist.prototype={displayPlaylist:function(){var self=this;$(this.cssSelector.playlist+" ul").empty();for(i=0;i<this.playlist.length;i++){var listItem=(i===this.playlist.length-1)?"<li class='jp-playlist-last'>":"<li>";listItem+="<a href='#' id='"+this.cssId.playlist+this.instance+"_item_"+i+"' tabindex='1'>"+this.playlist[i].name+"</a>";if(this.playlist[i].free){var first=true;listItem+="<div class='jp-free-media'>(";$.each(this.playlist[i],function(property,value){if($.jPlayer.prototype.format[property]){if(first){first=false}else{listItem+=" | "}listItem+="<a id='"+self.cssId.playlist+self.instance+"_item_"+i+"_"+property+"' href='"+value+"' tabindex='1'>"+property+"</a>"}});listItem+=")</span>"}listItem+="</li>";$(this.cssSelector.playlist+" ul").append(listItem);$(this.cssSelector.playlist+"_item_"+i).data("index",i).click(function(){var index=$(this).data("index");if(self.current!==index){self.playlistChange(index)}else{$(self.cssSelector.jPlayer).jPlayer("play")}$(this).blur();return false});if(this.playlist[i].free){$.each(this.playlist[i],function(property,value){if($.jPlayer.prototype.format[property]){$(self.cssSelector.playlist+"_item_"+i+"_"+property).data("index",i).click(function(){var index=$(this).data("index");$(self.cssSelector.playlist+"_item_"+index).click();$(this).blur();return false})}})}}},playlistInit:function(autoplay){if(autoplay){this.playlistChange(this.current)}else{this.playlistConfig(this.current)}},playlistConfig:function(index){$(this.cssSelector.playlist+"_item_"+this.current).removeClass("jp-playlist-current").parent().removeClass("jp-playlist-current");$(this.cssSelector.playlist+"_item_"+index).addClass("jp-playlist-current").parent().addClass("jp-playlist-current");this.current=index;$(this.cssSelector.jPlayer).jPlayer("setMedia",this.playlist[this.current])},playlistChange:function(index){this.playlistConfig(index);$(this.cssSelector.jPlayer).jPlayer("play")},playlistNext:function(){var index=(this.current+1<this.playlist.length)?this.current+1:0;this.playlistChange(index)},playlistPrev:function(){var index=(this.current-1>=0)?this.current-1:this.playlist.length-1;this.playlistChange(index)}};var audioPlaylist=new Playlist("1",audio_tracks,{ready:function(){audioPlaylist.displayPlaylist();audioPlaylist.playlistInit(false)},ended:function(){audioPlaylist.playlistNext()},play:function(){$(this).jPlayer("pauseOthers")},swfPath:"/assets/flash",supplied:"mp3",preload:'auto'});$("a#promo-video").click(function(){$.fancybox({'autoScale':false,'transitionIn':'none','transitionOut':'none','width':680,'height':495,'href':this.href=this.href.replace(new RegExp("watch\\?v=","i"),'v/')+'&autoplay=1&showinfo=0 ','type':'swf','swf':{'allowfullscreen':'true'}});return false});var no_of_mastheads=$('#masthead-viewport > img').size();if(no_of_mastheads>1){var pager_html='';var links_html='';for(i=1;i<=no_of_mastheads;i++){links_html+='<li>&bull;</li>'}var pager_html='<div id="masthead-pager-widget" class="masthead-pager-widget-left"><ul id="masthead-pager" class="nobullets masthead-pager-widget-middle">'+links_html+'</ul><div class="masthead-pager-widget-right"></div>';$('#masthead-viewport').after(pager_html).cycle({fx:'fade',timeout:5000,delay:2000,pager:'#masthead-pager',pauseOnPagerHover:1,pagerAnchorBuilder:function(idx,slide){return'#masthead-pager li:eq('+idx+')'}})}$(window).load(function(){if(!(navigator.userAgent.match(/iPhone/i))&&!(navigator.userAgent.match(/iPod/i))&&!($.browser.webkit)){if($('.snapshot a img').size()>=1){grayscale($(".snapshot a img"));$(".snapshot a img").hover(function(){grayscale.reset($(this))},function(){grayscale($(this))})}}});$(".snapshot a").fancybox({'titleShow':false});if($('.showcase').size()==1){$('.showcase').removeAttr('id').clone().appendTo('#showcase-viewport');$("#showcase-viewport").cycle({fx:'scrollLeft',speed:'2000',cleartypeNoBg:true,timeout:5000})}else{$("#showcase-viewport").cycle({fx:'scrollLeft',speed:'2000',cleartypeNoBg:true,after:onAfter,timeout:5000})}function onAfter(curr,next,opts){var showcase_link='/showcases/'+$(this).attr('id')+'.html';$('#find-out-more > a').attr('href',showcase_link)}});
