//
// New Tribes Bible Institute Javascript
//
// Author: nGen Works (http://ngenworks.com)
//

// Cufon replace
Cufon.replace('#nav ul li a em,' +
              '#submit,' +
              '#hero-nav h3,' +
              'body#home #content article h2,' +
			  'body#home #secondary-content article h2,' +
              '.more-link a,' +
              '.fancy-date .month,' +
              '#secondary-nav h3,' +
              '#callouts .strong-callout h3,' +
              '#callouts .strong-callout p,' +
              '.top-link a,' +
			  '.prev-link a,' +
			  '.next-link a,' +
              '#callouts-photos .callout-grid h4,' +
              '.blog-pagination .older-link a,' +
              'body#current_students #secondary-content h3,' +
              '.submit,' +
              '#calendar .month-prev-link a,' +
              '#calendar .month-next-link a', { hover: true, fontFamily: 'Rockwell' });
Cufon.replace('#search #facebook a, #utility-nav ul li a', { hover: true, fontFamily: 'Gotham' });

//
// Hide and show the text in a form field on focus on blur, respectivley.
function clear_it(object){
  object.each(function(){
    $(this).bind("focus", function(){
      var orig_text = $(this).val();
      $(this).val('');
      $(this).bind("blur", function(){
        orig_text = ($(this).val() !== "") ? $(this).val() : orig_text ;
        $(this).val(orig_text);
      });
    });
  });
}


$(document).ready(function(){
	$("table.course-list tbody tr:nth-child(odd)").addClass("alt");
	$('.default_value').each(function() {
	    var default_value = this.value;
	    $(this).focus(function() {
	        if(this.value == default_value) {
	            this.value = '';
	        }
	    });
	    $(this).blur(function() {
	        if(this.value == '') {
	            this.value = default_value;
	        }
	    });
	});
});
