// JavaScript Document

							
/*SLIDE MENU DOWN FIRST ATTEMPT
	$('#menu li').click(
		function () {
			$('ul', this).slideDown(300);
		}, 
		function () {
			$('ul', this).slideUp(300);			
		}
	);
*/


/*
$('div.closeMenuFix').css({'visibility' : 'visible'});
$('div.closeMenuFix').css({'visibility' : 'hidden'});
*/


$('a#logoTitle').mouseenter(function(e) {
$(this).children('.hoverState').fadeIn(200).css({'display':'block'});
		
	}).mouseleave(function(e) {
		$(this).children('.hoverState').fadeOut(200);
});



//SLIDE MENU DOWN
$('.menu li').click(function () {
	$('ul', this).slideToggle('medium');	
	$('.menuTitle', this).toggleClass('selected');	
});

$('#topMenu').click(function () {
	$('.miniMenu ul').slideUp('medium');
	$('#hiddenPanel').animate({ 'left': '100%' }, 'slow');
	$('span.button').removeClass('selected');
});

$('.miniMenu').click(function () {
	$('#topMenu ul').slideUp('medium');	
});

$('.miniMenu li a').click(function () {
	$('.miniMenu ul').slideUp('medium');	
});

$('a#getSocial span.button').click(function () {
	$('.menuTitle').removeClass('selected');
	$('.miniMenu ul').slideUp('medium');
	$('#topMenu ul').slideUp('medium');	
	
});


// Hide the menu when someone clicks outside - uses jquery.ba-outside-events.min.js
// not working on iOS YET!
$(document).ready(function(){	
		$("#topMenu").bind( "clickoutside", function(event){
				$('#topMenu ul').slideUp('medium');
				$('.menuTitle', this).removeClass('selected');	
		});
		$(".miniMenu").bind( "clickoutside", function(event){
				$('.miniMenu ul').slideUp('medium');
				$('.menuTitle', this).removeClass('selected');	
		});
});

	




//HIDE FOCUS - ALL BROWSERS! NOT-ACCESSIBLE!
$('a').live('mousedown', function(e) { 
			e.target.blur(); 
			e.target.hideFocus = true; 
			e.target.style.outline = 'none' 
			}).live('mouseout', function(e) { 
			e.target.blur(); 
			e.target.hideFocus = false; 
			e.target.style.outline = null; 
});


//SCROLL TO TOP
   $('a.top').click(function () {
		$('html, body').animate( { scrollTop: 0 }, '0.0005' );
    });



  //MASONRY
    $(function(){
	 $('#masonryWrap').masonry({
        columnWidth: 10, 
        animate: true, 
        animationOptions: {
          duration: 400,
          // easing: 'linear',
          specialEasing: { top: 'linear'},
          queue: false
        }
      });


//SCALE THE PANELS
//SIZE SMALL thumbnail preview 
$(".sizeSmall a.scaler").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '200px',
			'height' : '104px'
		}, 100);
	} 
	, function() {
	$(this).css({'z-index' : '0'});
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '120px',
			'height' : '84px'
		}, 200);
});

//SIZE 1 tiny thumbnail preview 
$(".sizeTiny a.scaler").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).addClass("hover").stop(true)
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '123px',
			'height' : '90px'
		}, 100);
	} 
	, function() {
	$(this).css({'z-index' : '0'});
	$(this).removeClass("hover").stop(true)
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '113px',
			'height' : '80px'
		}, 200);
});



//SIZE 1 thumbnail preview 
$(".size1 a.scaler").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).addClass("hover").stop(true)
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '260px',
			'height' : '188px'
		}, 100);
	} 
	, function() {
	$(this).css({'z-index' : '0'});
	$(this).removeClass("hover").stop(true)
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '250px',
			'height' : '178px'
		}, 200);
});


$(".size1deep a.scaler").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '260px',
			'height' : '376px'
		}, 100);
	} 
	, function() {
	$(this).css({'z-index' : '0'});
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '250px',
			'height' : '366px'
		}, 200);
});


//SIZE 2 thumbnail preview 
$(".size2 a.scaler").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '520px',
			'height' : '188px'
		}, 100);
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '510px',
			'height' : '178px'
		}, 200);
});






//SIZE 3 thumbnail preview 
$(".size3 a.scaler").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '520px',
			'height' : '376px'
		}, 100);
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '510px',
			'height' : '366px'
		}, 200);
});

//.parents(':eq(1)')
$(".size1scales a.scaler").hover(function() {
	$(this).parent().css({'z-index' : '9999'});
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '400px',
			'height' : '400px'
		}, 100);
	} 
	, function() {
	$(this).parent().css({'z-index' : '0'});
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '250px',
			'height' : '178px'
		}, 200);
});

$(".size1scales div.scaler").hover(function() {
	$(this).parent().parent().css({'z-index' : '9999', 'position':'absolute'});
	
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '260px',
			'height' : '376px'
		}, 100);
	} 
	, function() {
	$(this).parent().parent().css({'z-index' : '1', 'position':'absolute'});
	
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '250px',
			'height' : '178px'
		}, 200);
});





$(".sizebfscales div.scaler").hover(function() {
	$(this).parent().parent().css({'z-index' : '9999', 'position':'absolute'});
	
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '520px',
			'height' : '376px'
		}, 100);
	} 
	, function() {
	$(this).parent().parent().css({'z-index' : '1', 'position':'absolute'});
	
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '510px',
			'height' : '178px'
		}, 200);
});




$(".sizebf2scales div.scaler").hover(function() {
	$(this).parent().parent().css({'z-index' : '9999', 'position':'absolute'});
	
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '520px',
			'height' : '376px'
		}, 100);
	} 
	, function() {
	$(this).parent().parent().css({'z-index' : '1', 'position':'absolute'});
	
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '250px',
			'height' : '178px'
		}, 200);
});






$(".sizeSmallScales div.scaler").hover(function() {
	$(this).parent().parent().css({'z-index' : '9999', 'position':'absolute'});;
	$(this).addClass("hover").stop()
		.animate({
			'z-index' : '10',
			'top' : '-5px',
			'left' : '-5px',
			'width' : '260px',
			'height' : '188px'
		}, 100);
	} 
	, function() {
	$(this).parent().parent().css({'z-index' : '1', 'position':'absolute'});
	$(this).removeClass("hover").stop()
		.animate({
			'z-index' : '0',
			'top' : '0',
			'left' : '0',
			'width' : '120px',
			'height' : '84px'
		}, 200);
});
/*FADE IN - FADE OUT*/
	$('.box .contentWrap').mouseenter(function(e) {
		 //$(this).children('a').children('img').animate({ height: '332', left: '-20', top: '-20', width: '500'}, 100);
		$(this).children().children('.fadeOutArea').fadeOut(200);
		$(this).children().children('.fadeInArea').fadeIn(200);
		
	}).mouseleave(function(e) {
	   //$(this).children('a').children('img').animate({ height: '299', left: '0', top: '0', width: '450'}, 100);
		$(this).children().children('.fadeOutArea').fadeIn(200);
		$(this).children().children('.fadeInArea').fadeOut(200);
	});
	
	$('.box .contentWrap').mouseenter(function(e) {
		$(this).children().children('.footerPanel').fadeIn(200);
		
	}).mouseleave(function(e) {
	   	$(this).children().children('.footerPanel').fadeOut(200);
	});

$(window).resize(function() {
						  
						  
						  
						 //var VariableHeightDiv = $('#masonryWrap').height();
						  
						  //alert(VariableHeightDiv);
						 
						  
						  //$('#hiddenPanelWrap .hiddenContent').css('height' : '100px');
						  
						  
							
});


/* FOOTER */
         $("span.button").toggle(
      function() {
	  		
          $('#hiddenPanel').animate({ 'left': '30%'}, 'slow');
		  $('span.button').addClass('selected');
		 },
      function() {
          $('#hiddenPanel').animate({ 'left': '100%' }, 'slow');
		  $('span.button').removeClass('selected');
      });



}); 


