/**
 * @author Yaroslav Shuvaev
 * @version 1.0 For all INPUTS witch has 'placeholder' Attr adds placeholder
 *          behavior
 */
$(document).ready(function() {
	$('INPUT[placeholder]').each(function() {

		if ($(this).attr('value') == '') {
			$(this).addClass('placeholder');
			$(this).attr('value', $(this).attr('placeholder'));
		}

		$(this).blur(function() {
			if ($(this).attr('value') == ''
					|| $(this).attr('value') == $(this).attr('placeholder')) {
				$(this).addClass('placeholder');
				$(this).attr('value', $(this).attr('placeholder'));
			}
		});

		$(this).keydown(function() {
					if ($(this).attr('value') == $(this).attr('placeholder')) {
						$(this).removeClass('placeholder');
						$(this).attr('value', '');
					}
				});

		$(this).focus(function() {
					if ($(this).attr('value') == $(this).attr('placeholder')) {
						$(this).removeClass('placeholder');
						$(this).attr('value', '');
					}
				});

	});

});