$(document).ready(function(){

	//Init lightbox
	$("a[rel^='prettyPhoto']").prettyPhoto({show_title: false, social_tools: '', theme: 'dark_rounded'});
	
	//Smooth scrolling for page anchors
  var scrollEl = $.browser.safari ? 'body' : 'html';
	//Bind to all anchor links
	$('a[href*="#"]').each(function(idx, el){
		$(el).click(function(e){
	    e.preventDefault();
	    var urlExplode = $(this).attr('href').split('#');
	    var anchorOffset = $('a[name="'+urlExplode[1]+'"]').offset().top;
	    $(scrollEl).animate({
	    	scrollTop: anchorOffset
	    }, 'slow');
	  });
	});	
	
	//Expand bottom color bar to fill viewport
	var browserViewport = $(window).height();
	if(browserViewport > 800){
		var curBarHeight = $('#coming-soon .color-bar').height();
		var newBarHeight = (browserViewport - 800) + curBarHeight;
		$('#coming-soon .color-bar').height(newBarHeight);
		$('#coming-soon').height(browserViewport);
	}
	
	//Show/hide label on email signup field
	var emailLabel = 'Enter your email';
	var inactiveClass = 'inactive';
	if($('.email-field').val() == '' || $('.email-field').val() == emailLabel){
		$('.email-field').val(emailLabel).addClass(inactiveClass);
	}
	$('.email-field').focus(function(){
		if($(this).val() == emailLabel) $(this).val('').removeClass(inactiveClass); 
	})
		.blur(function(){
		if($(this).val() == '') $(this).val(emailLabel).addClass(inactiveClass);
	});
	
});
