jQuery.noConflict();
jQuery(function($) {
	
	try {
		document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
	
	if( !$.support.placeholder )
	{
		
		$('input:text').val(function() {
			if( $.trim( $( this ).val() ) == '' ) 
				return $( this ).attr('placeholder');
			else
				return $( this ).val();
			
		}).click(function() {
			
			var self = $( this );
			if( self.val() == self.attr('placeholder') ) self.val('');
			
		}).blur(function() {
			
			var self = $( this );
			if( self.val() == '') self.val( self.attr('placeholder') );
			
		});
		
	}
	
	$('#add-comment').click(function(event) {
		var c = $('#respond'),
			submit = true;
		
		$('input:text, textarea', '#respond').each(function() {
			if( $.trim( $(this).val() ).length == 0 )
				submit = false;
		});
		
		if( !submit )
		{
			$('#respond h4:first').next('p.msg').remove().end().after('<p class="msg warning">Palun täida kõik väljad.</p>');
			$('input[value=""]:first', '#respond').focus();
		}
		
		return submit;
	});
	
	$('#captcha_code').next().css({'width': 150, 'padding-left' : 14});
});
