function OverLabelSp() {}

OverLabelSp.prototype.init = function()
{
	this.setup_labels();
}

OverLabelSp.prototype.setup_labels = function()
{
    var obj = this;

	$( 'label' ).each( function( i ) {
		var label = this;
		var input_id = $( label ).attr('for');
		var input = $( '#' + input_id );
		
		$( label ).addClass( 'overlabel' );
		
		if ( input.val() != '' ) {
		    $( label ).hide();
		}

		input.focus( function() {
			$( label ).hide();
		} );
		
		$( '#' + input_id ).blur( function() {
			if ( input.val() == '' ) {
				$( label ).show();
			}
		} );
	} );
}

var OverLabelSp = new OverLabelSp;

$(document).ready(function() {
	OverLabelSp.init();
});