$(document).ready(function(){

 $(document).pngFix();

 //clear input fields on focus
 $(".clearinput").focus(function(){
  if ($(this).val() == this.defaultValue){
   $(this).val("");
  }
 });
 $(".clearinput").blur(function(){
  if ($(this).val() == ""){
   $(this).val(this.defaultValue);
  }
 });

 if($("a#example2").length){
  $("a#example2").fancybox({
				'overlayShow'	: true,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'overlayColor'	: '#000000'
			});
 }

 // if the mouse hover the image
 style = 'easeOutQuart';
 $('.photo').hover(
  function() {
   //display heading and caption
   $(this).children('div:first').stop(false,true).animate({top:0},{duration:200, easing: style});
   $(this).children('div:last').stop(false,true).animate({bottom:0},{duration:200, easing: style});
  },

  function() {
   //hide heading and caption
   $(this).children('div:first').stop(false,true).animate({top:-50},{duration:200, easing: style});
   $(this).children('div:last').stop(false,true).animate({bottom:-50},{duration:200, easing: style});
  }
 );

 if($("a[rel=fotogroup]").length){
  $("a[rel=fotogroup]").fancybox({
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'titlePosition' : 'over',
				'overlayColor'	: '#222222',
				'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
 }

 if($("a[rel=fotogroup2]").length){
  $("a[rel=fotogroup2]").fancybox({
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'titlePosition' : 'over',
				'overlayColor'	: '#222222',
				'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
 }


 $(".showpresse").click(function(event){
  event.preventDefault();
    $(".content_container:not(#presse)").slideUp();
  $("#presse").slideToggle("slow");
 });
  $(".showcontent").click(function(event){
  event.preventDefault();
    $(".content_container:not(#content)").slideUp();
  $("#content").slideToggle("slow");
 });

});
