$(document).ready(function(){
     $("#more_reviews").hide();
     $("#reviews .more_button").click(function(event){
       $("#more_reviews").slideToggle('slow', function() {
		    // Animation complete.
	  });
       // Stop the link click from doing its normal thing
       event.preventDefault();
    });
	
	/* Tweet Hider */
	$("#more_tweets").hide();
     $("#twitter .more_button").click(function(event){
       $("#more_tweets").slideToggle('slow', function() {
		    // Animation complete.
	  });

       // Stop the link click from doing its normal thing
       event.preventDefault();
    });

	/* Init lightbox */
	$('#ipad_screen a').lightBox(); // Select all links in object with gallery ID

	$('#mc_mv_EMAIL').addClass('defaultText');
	$('#mc_mv_EMAIL').attr('title', 'Enter email here');

	/* Input field default text */
	$('.btn').each(function(){
		var b = $(this);
		var tt = b.text() || b.val();
		if ($(':submit,:button',this)) {
			b = $('<a>').insertAfter(this). addClass(this.className).attr('id',this.id);
			$(this).remove();
		}
		b.text('').css({cursor:'pointer'}). prepend('<i></i>').append($('<span>').
		text(tt).append('<i></i><span></span>'));
	});

  $(".defaultText").focus(function(srcc)
  {
      if ($(this).val() == $(this)[0].title)
      {
          $(this).removeClass("defaultTextActive");
          $(this).val("");
      }
  });

  $(".defaultText").blur(function()
  {
      if ($(this).val() == "")
      {
          $(this).addClass("defaultTextActive");
          $(this).val($(this)[0].title);
      }
  });

  $(".defaultText").blur();

	$("form").submit(function() {
		$(".defaultText").each(function() {
			if($(this).val() == this.title) {
				$(this).val("");
			}
		});
	});
	
	/* Showcase */
	$("#showcase_menu a").click(function() {
		var clicked = $(this);
		var clickedId = $(clicked).attr("id");
	
		$("#showcase_menu a + span").fadeOut('fast', function(){});
		
		$(clicked).siblings().fadeIn('fast', function() {
			//Nothing
		});	
		$("#showcase_menu a").removeClass('selected');
		$(clicked).addClass('selected');
		
		var picId = $(clicked).attr("id");
		showcaseImage(picId);
	});
	
	function showcaseImage(picId){
		var toHide = $("#ipad_screen #" + picId);
		$("#ipad_screen a").fadeOut('fast', function() {});
		$(toHide).fadeIn('fast', function(){});
	};
});

