swfobject.embedSWF("/wp-content/themes/boca/swf/banner.swf", "banner", "720", "88", "6.0.65","expressInstall.swf", null, null, null );

function loadShowRool(file) {
	swfobject.embedSWF("/wp-content/themes/boca/showreel/"+ file, "showreel", "720", "256", "9.0.0","expressInstall.swf", null, null, null );
}


var currentEntry;

jQuery(document).ready(function() {
	jQuery("#body-background").ezBgResize();

	jQuery(".accomondation-menu a").click(function (e) {
		jQuery(".accomondation-menu").animate(
			{width: 'hide', opacity: 0.25}, function()
				{ jQuery("#accomondation-menu-show").fadeIn('slow') }
		);
		e.preventDefault();

		var pressedEntry = '' + jQuery(this).parent().attr('class').split(' ').slice(-1);
			currentEntry = pressedEntry.replace("accom-item-", "accomondation-entry-");

			jQuery("#accomondation-content").fadeOut('slow', function() {
				jQuery('#' + currentEntry).fadeIn('slow');
			});
    });

	jQuery("#accomondation-menu-show").click(function (e) {
		jQuery("#accomondation-menu-show").fadeOut('slow', function()
				{ jQuery(".accomondation-menu").animate({width: 'show', opacity: 1}
				)}
		);
		e.preventDefault();

		jQuery('#' + currentEntry).fadeOut('slow', function() {
			jQuery("#accomondation-content").fadeIn('slow');
		});
    });

	jQuery("#menu li:not(.current_page_item) a").hover(
			  function () {
				  jQuery(this).animate({ backgroundColor: "white", color: "#174a7c" }, 300);
			  }, 
			  function () {
				  jQuery(this).animate({ backgroundColor: "#174a7c", color: "white" }, 300);
			  }
			);

	jQuery('#menu-side li:not(.current_page_item) a').hover(
			  function () {
				  jQuery(this).animate({ backgroundColor:"#8ba5be", color: "#174a7c" }, 300);
			  }, 
			  function () {
				  jQuery(this).animate({ backgroundColor: "#174a7c", color: "#ffffff" }, 300);
			  }
		);
});


jQuery(document).ready(function(){
	  var currentPosition = 0;
	  var className = '.slideshow';
	  var currentPositions = new Array;
	  var slideWidth = 360;
	  var slides;
	  var numberOfSlides = 0;
	  var numberOfSlidesA = new Array;

	  // Remove scrollbar in JS
	  jQuery(className).find('.slidesContainer').css('overflow', 'hidden');
	  jQuery(className).find('.slidesContainer .slide').css('width', '360px');
	  jQuery(className).find('.slidesContainer .slide img').css('width', '360px');

	  jQuery(className).each(function(intIndex){
		  currentPositions[jQuery(this).attr("id")] = 0;
		  slides = jQuery(this).children('.slidesContainer').children('.slide');

		  numberOfSlidesA[jQuery(this).attr("id")] = slides.length;

		  // Wrap all .slides with #slideInner div
		  slides
		  .wrapAll('<div class="slideInner"></div>')
		  // Float left to display horizontally, readjust .slides width
		  .css({
		    'float' : 'left',
		    'width' : slideWidth
		  });

		  // Set #slideInner width equal to total width of all slides
		  jQuery(this).find('.slidesContainer').find(".slideInner").css('width', slideWidth * slides.length);
	
		  // Insert left and right arrow controls in the DOM
		  jQuery(this)
		    .prepend('<span class="control leftControl">Move left</span>')
		    .append('<span class="control rightControl">Move right</span>');

		  // Create event listeners for .controls clicks
		  jQuery(this).find('.control')
		    .bind('click', function(){
		    // Determine new position
		    	var name = jQuery(this).parent().attr("id");

		    	currentPositions[name] = (jQuery(this).attr('class')=='control rightControl')
		    ? currentPositions[name]+1 : currentPositions[name]-1;
	
		      // Hide / show controls
		      manageControls(jQuery(this).parent());

		      // Move slideInner using margin-left
		      jQuery(this).parent().find('.slideInner').animate({
		        'marginLeft' : slideWidth*(-currentPositions[name])
		      });

		    });

		  // Hide left arrow control on first load
		  manageControls(this);
	
			// manageControls: Hides and shows controls depending on currentPosition
			function manageControls(object){
				var position = currentPositions[jQuery(object).attr("id")];
				var number = numberOfSlidesA[jQuery(object).attr("id")];
				var left = jQuery(object).find('.leftControl');
				var right = jQuery(object).find('.rightControl');


				// Hide left arrow if position is first slide
				if(position==0){ left.hide() }
				else{ left.show() }
				// Hide right arrow if position is last slide
				if(position==number-1){ right.hide() }
				else{ right.show() }
			}
		});
});





jQuery(document).ready(function(){
	var className = '#gallery';
	var currentPosition = 0;
	var currentPositions = new Array;
	var slideWidth = 120;
	var slides;
	var numberOfSlides = 0;
	var numberOfSlidesA = new Array;

	  // Remove scrollbar in JS
	jQuery(className).find('.slidesContainer').css('overflow', 'hidden');


	jQuery(className).each(function(intIndex){
		  currentPositions[jQuery(this).attr("id")] = 0;
		  slides = jQuery(this).children('.slidesContainer').children('.slide');

		  numberOfSlidesA[jQuery(this).attr("id")] = slides.length;

		  // Wrap all .slides with #slideInner div
		  slides
		  .wrapAll('<div class="slideInner"></div>')
		  // Float left to display horizontally, readjust .slides width
		  .css({
		    'float' : 'left',
		    'width' : slideWidth
		  });

		  // Set #slideInner width equal to total width of all slides
		  jQuery(this).find('.slidesContainer').find(".slideInner").css('width', slideWidth * slides.length);
	
		  // Insert left and right arrow controls in the DOM
		  jQuery(this)
		    .prepend('<span class="control leftControl">Move left</span>')
		    .append('<span class="control rightControl">Move right</span>');

		  // Create event listeners for .controls clicks
		  jQuery(this).find('.control')
		    .bind('click', function(){
		    // Determine new position
		    	var name = jQuery(this).parent().attr("id");

		    	currentPositions[name] = (jQuery(this).attr('class')=='control rightControl')
		    ? currentPositions[name]+1 : currentPositions[name]-1;
	
		      // Hide / show controls
		      manageControls(jQuery(this).parent());

		      // Move slideInner using margin-left
		      jQuery(this).parent().find('.slideInner').animate({
		        'marginLeft' : slideWidth*(-currentPositions[name])
		      });

		    });

		  // Hide left arrow control on first load
		  manageControls(this);
	
			// manageControls: Hides and shows controls depending on currentPosition
			function manageControls(object){
				var position = currentPositions[jQuery(object).attr("id")];
				var number = numberOfSlidesA[jQuery(object).attr("id")];
				var left = jQuery(object).find('.leftControl');
				var right = jQuery(object).find('.rightControl');


				// Hide left arrow if position is first slide
				if(position==0){ left.hide() }
				else{ left.show() }
				// Hide right arrow if position is last slide
				if(position==number-6){ right.hide() }
				else{ right.show() }
			}
		});

	jQuery('#gallery a').click(function(e)
	{
		jQuery(".pic img").attr("src", this.rel);

		e.preventDefault();
		return false;
	});
});
