(function ($) {
	$(document).ready(function(){
		//text input labels to inline value
		$.fn.setCursorPosition = function(pos) {
			if ($(this).get(0).setSelectionRange) {
				$(this).get(0).setSelectionRange(pos, pos);
			} else if ($(this).get(0).createTextRange) {
				var range = $(this).get(0).createTextRange();
				range.collapse(true);
				range.moveEnd('character', pos);
				range.moveStart('character', pos);
				range.select();
	        }
	    }

	    $('.inline-label[id]').each(function() {
	    	var label = $('label[for=' + $(this).attr('id') + ']');
	    	if (label.length == 1) {
	    		var inlineText = label.text();
	    		label.hide();
	    		$(this).focus(function() {
					if(inlineText == $(this).val()) {
						$(this).val('');
					}
	    		}).blur(function() {
					if($.trim($(this).val()) == '') {
						$(this).val(inlineText);
					}
	    		}).blur();
	    	}
	    });
	});
}) (jQuery);
