jQuery.fn.labelOver = function(overClass) {
	return this.each(function(){
		var label = jQuery(this);
		var f = label.attr('for');
		if (f) {
			var input = jQuery('#' + f);
			
			this.hide = function() {
			  label.css({ textIndent: -10000 })
			}
			
			this.show = function() {
			  if (input.val() == '') label.css({ textIndent: 0 })
			}

			// handlers
			input.focus(this.hide);
			input.blur(this.show);
		  label.addClass(overClass).click(function(){ input.focus() });
			
			if (input.val() != '') this.hide(); 
		}
	})
}

function signup() {
	$("#subForm").submit()
	return false;
}

$(document).ready(function() {
	
	$("#subForm label").labelOver('over-apply')
	
	$(".event_listing .date").each(function() {
	  
	  if($(this).height() > 20) {
	    $(this).css("display","block")
	  }
	  
	})
	
	$(".responses").change(function() {
		alert("Hello")
	})
	
	$(".carousel").jcarousel();
	
	$("ul.internal li:first").addClass("first")
	$("ul.internal li:eq(1)").addClass("second")
	
	$(".page-template-home-page-php #content .grid_4 p:first").addClass("intro")
	
	
	$(".articles #content .single .body p:first").addClass("intro")
	
	$("#banner span").click(function() {
		window.location = $("#banner a").attr("href")
	})
	
  $("#show_hide_comments").click(function() {
    $("#comments_flapper").toggle()
    $(this).toggleClass("show_hide_open")
  })
  $("#show_hide_writeup").click(function() {
    $("#writeup_flapper").toggle()
    $(this).toggleClass("show_hide_open")
  })
  
  $(".event_details li:even").addClass("even")
  $(".event_details li:odd").addClass("odd")
	
})
