// JavaScript Document
function InputHelperHideHint ( obj )
	{
		if ( $( obj ).attr ('set') == 0 ){
		    $( obj )
		        .css ( { color: '#000', fontStyle: 'normal' } )
				.attr ('set', 1)
		}
	}

function InputHelperIn ( obj, text )
	{
	    //чистим поле и вешаем стили
		if ( $( obj ).attr ('set') == 0 ){
		    $( obj )
		        .css ( { color: '#000', fontStyle: 'normal' } )
				.attr ('set', 1)
		        .val ( '' );
		}
	}
	
function InputHelperOut ( obj, text, color ){
	    //если при потере фокуса значение поля равно пустоте или значению по умолчанию,
            //то пихаем в него текст подсказки и вешаем стили подсказки
		if ( obj.value == '' || typeof(obj.value) == 'undefined' || $(obj).attr('set') == 0 ){
		    $( obj )
		        .css ('color', color)
				.attr ('set', 0)
		        .val ( text );
		}
	}
	
function InputHelperCreate ( obj, text, color ){
		color = color || '#b3b3b3';
	
	    //вешаем на поле эвенты. На фокус и потерю фокуса.
		$( obj )
			.bind ( 'focus', function () {
				InputHelperIn ( this, text );
			} )
			.bind ( 'blur', function () {
				InputHelperOut ( this, text, color );
			} );
			
		//первоначальный инит
		InputHelperOut ( obj, text, color );		
	}
