// JavaScript Document
$(document).ready(function()
{
	$("#add_comment .genericForm").submit(function()
	{
		var _parameters = $(this).serialize();
		var _this = this;
		
		_parameters += '&ajax=1';
		
		$.ajax({type: 'POST', url: _this.action, data: _parameters, dataType: 'json', success: function(_data) 
		{
			if (_data.ok == 1)
			{
				$(_this).hide();
				$('.error_content',$(_this).closest('div')).fadeOut(0).html('<div class="info-success">'+_data.response+'</div>').fadeIn('slow');
			}
			else
			{
				$('.error_content',$(_this).closest('div')).fadeOut(0).html('<div class="info-error">'+_data.response+'</div>').fadeIn('slow');
				
				var _key = $('#tbxKey');
				
				if (_key.length == 1)
				{
					$('#tbxKeyCode').val('');
					var _src = _key.attr('src')+'?'+(new Date()).getTime();
					_key.attr('src',_src);
				}
			}
		}
		});
		return false;
	});
	
	$('#tbxComment').focus(function()
	{
		var _this = $(this);
		if (_this.val() == 'Type your comment here...') _this.val('');
	}).blur(function()
	{
		var _this = $(this);
		if (_this.val() == '') _this.val('Type your comment here...');
	});
});

// JavaScript Document
function delete_product()
{
	if(confirm("You are about to remove a record from the database!"))
	{
		return true;
	}
	else
	{
		return false;
	}
}
