// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults




function lightbox(action) {	
	lb = $('#lightbox');
	if(action == 'close') {
		lb.hide();
		$('#lightbox-overlay').hide();
		$('#lightbox-inner').html('');		
	} else {
		$('#lightbox-overlay').show();
		lb.show();
    $('#lightbox-content').css('position', 'absolute');
    $('#lightbox-content').css('top', ((($(window).height() - $('#lightbox-content').height()) / 2) + $(window).scrollTop()) + 'px');
    $('#lightbox-content').css('left',  (($(window).width() - $('#lightbox-content').width()) / 2) + "px");
	}
}
  
function defaultValue(obj, val) {
  $(obj).bind("focus", function(e) {
    if($(this).val() == val) {
      $(this).val('');
      $(this).removeClass('gray');
    } 
  });
  $(obj).bind("blur", function(e) {
    if($(this).val() == '') {
      $(this).val(val);
      $(this).addClass('gray');
    } else if($(this).hasClass('gray')) {
      $(this).removeClass('gray');
    }
  });
  $(obj).trigger('blur');
}

function toggleShare() {
  $('#share-links').toggle();
  $('a.share').toggleClass('on');
}