$(document).ready(function() {
  $('.anime .photo').toggle(showMenu, hideMenu);
  
  initEmailCloacking();
  initLightBoxPhotos();
  
  initBannerChanger();
  initLogoChanger();

  //google maps
  if(typeof pointPlaceInGoogleMap == 'function') {
	  pointPlaceInGoogleMap();
  }
  //materials changer
  if(typeof materialChanger == 'function') {
	  materialChanger();
  }
});


var showMenu = function() {
  var subMenu = $(this).siblings('.sub-menu');
  var description = $(this).siblings('.description');
  
  subMenuWidth = subMenu.width();
  changeTime = 1500;
  
  description.css({'height' : description.height()});
  subMenu.css({'height' : description.height()});
  
  description.hide(changeTime);
  subMenu.show(changeTime);

  $(this).parent().parent().find('.window-mono').each(function() {
	  $(this).addClass('window-color');
  });
  $(this).parent().parent().find('.roller-blind-mono').each(function() {
	  $(this).addClass('roller-blind-color');
  });
  $(this).parent().parent().find('.outside-roller-blind-mono').each(function() {
	  $(this).addClass('outside-roller-blind-color');
  });
};

var hideMenu = function() {
  var subMenu = $(this).siblings('.sub-menu');
  var description = $(this).siblings('.description');
  
  description.css({'height' : subMenu.height()});
  subMenu.css({'height' : subMenu.height()});

  changeTime = 1500;
  
  description.show(changeTime);
  subMenu.hide(changeTime);
  
  $(this).parent().parent().find('.window-mono').each(function() {
	  $(this).removeClass('window-color');
  });
  $(this).parent().parent().find('.roller-blind-mono').each(function() {
	  $(this).removeClass('roller-blind-color');
  });
  $(this).parent().parent().find('.outside-roller-blind-mono').each(function() {
	  $(this).removeClass('outside-roller-blind-color');
  });
};
