/************************************************************************
*   
*   G L O B A L  J A V A S C R I P T  F U N C T I O N S
*   
*   Author:  Sarah Bansak
*   Date:    March MMX
*   Web:     http://www.quirkds.com
*   Email:   info@quirkds.com
* 
*************************************************************************/






/*-----------------------------------------------------------------------
Booking Window
------------------------------------------------------------------------*/


$(document).ready(function() {
	$("div.panel_button").click(function(){
		$("div#panel").animate({
			height: "729px",
			width: "826px"
		})
		.animate({
			height: "629px",
			width: "726px"
		}, "fast");
		
		$("div#panel-closed").animate({opacity: 0,}, 100);
		
		$("div.panel_button").toggle();
	
	});	
	
   $("div#hide_button").click(function(){
		$("div#panel").animate({
			height: "66px",
			width: "210px"
		}, "fast");
		
		$("div#panel-closed").delay(800).animate({opacity: 100,}, 1200);
	
   });	
	
});






/*-----------------------------------------------------------------------
Fluid Grid
------------------------------------------------------------------------*/	


 var myFluidGrid = {
	     COLNUMBER : 3, // Minimum column number.
	     COLMARGIN : 20, // Margin (in pixel) between columns/boxes.
	     COLWIDTH : 144, // Fixed width of all columns.
	     doLayout : function() {
	          var self = this;
	          var pointer = 0;
	          var arr = [];
	          var columns = Math.max(this.COLNUMBER, parseInt($('gallery-wrapper').innerWidth() / (this.COLWIDTH + this.COLMARGIN)));
	 
	          $('.gallery-thumb-frame').css('position', 'absolute').css('width', this.COLWIDTH  + 'px');
	          $('.gallery-thumb-frame').each(function() {
	          var tempLeft = (pointer * (self.COLWIDTH + self.COLMARGIN));
	          $(this).css('left', tempLeft + 'px');
	 
	          var tempTop = 0;
	          if (arr[pointer]) { tempTop = arr[pointer]; }
	          $(this).css('top', tempTop + 'px');
	 
	          arr[pointer] = tempTop + $(this).outerHeight() + 2*self.COLMARGIN;
	          pointer++;
	          if (pointer === columns) { pointer = 0; }
	      });
 }
	            };
	            $(window).ready(function() {
	                myFluidGrid.doLayout();
	            }).resize(function() {
	                myFluidGrid.doLayout();
	            });











