$(function() {
  Cufon.set('forceHitArea', true);
  Cufon.replace('h2,h3,#content h4,legend');
  Cufon.replace('#sub-nav', {fontFamily: 'Univers'});
  Cufon.replace('.sub-nav a');
  Cufon.replace('.actions a span');
  Cufon.replace('.photo .caption .inner', {fontFamily: 'Journal'});

  /* Allows the modal to fit to the viewport's height if the viewport is too short */
  $('.modal').bind('show', function(){
    if ($(window).height() < $(this).height()) {
      $(this).css({height: ($(window).height()*.745)+'px'});
    }
    $(this).css({top: ($(window).height()*.025)+'px'}).show();
  });
  $('.modal').bind('hide', function(){ $(this).css({height: 'auto'}); $(this).hide(); });
	});

jQuery.fn.defaultVal = function(value) {
    $(this).val(value);
  $(this).focus(
		function() { if ($(this).val() == value) $(this).val(''); }
	).blur(
		function() { if ($(this).val() == '') $(this).val(value); }
	);


  $('.slider').cycle({fx:'fade'});
	
}

/*SET DEFAULT BUTTONS*/
    if ($.browser.mozilla) 
    {
        $('.contactus input:not(textarea)').keypress(checkForEnterContactUs);
        
    } else {
        $('.contactus input:not(textarea)').keydown(checkForEnterContactUs);
    }

  
function checkForEnterContactUs(event) {
        if (event.keyCode == 13) {
            $('#contactussubmit').click();
            event.preventDefault();
            return false;
        }
    }
    
    