function score(perform, id)
{
	get = "extension=deals&module=action&request=xmlhttp&action=score";
	post = "score="+perform+"&deals_product_id="+id;
	request('index.php', get, post, 'score-'+id);
}

function add_hit(id)
{
	get = "extension=deals&module=action&request=xmlhttp&action=add_hit";
	post = "deals_product_id="+id;
	request('index.php', get, post, '');
}

function reply()
{
	post = "deals_product_id="+document.getElementById('form_deals_product_id').value;
	post += "&name=" + document.getElementById('form_name').value;	
	post += "&email=" + document.getElementById('form_email').value;
	post += "&website=" + document.getElementById('form_website').value;
	post += "&message=" + document.getElementById('form_message').value;

			
	get = "extension=deals&module=replies&request=xmlhttp";
	request('index.php', get, post, 'reply_form');
}


function survey()
{
	$.post("actions.php?action=survey",	{
		gender:$("#survey_gender").val(),
		age:$("#survey_age").val(),
		education:$("#survey_education").val(),
		work:$("#survey_work").val(),
		comment:$("#survey_comment").val()
		
	},
	function(data)
	{
		$("#survey_text").html(data);
	});

}

function newsletter()
{
	$.post("actions.php?action=newsletter",	{
		name:$("#newsletter_name").val(),
		email:$("#newsletter_email").val(),
		per:$("#newsletter_per").val(),
		
	},
	function(data)
	{
		if (data) $("#newsletter_text").html(data);
		else 
		{
			$("#newsletter_text").css("border","solid 1px red");	
		}
	});

}



function idea()
{
	$.post("actions.php?action=survey",	{
		email:$("#email").val(),
		comment:$("#comment").val()
		
	},
	function(data)
	{
		$("#idea_text").html(data);
	});
}

function remove_feed(id)
{
	$.post("index.php?request=xmlhttp&extension=deals&module=deals",
	{
		action:"delete_feed",
		deals_feed_id:id
	},
	function(data)
	{
		$(".deals_feed_" + id). hide('normal', function () {
		      $(".deals_feed_" + id). addClass();
		});    
	

	});	
}

function show_feed(id)
{
	$.post("index.php?request=xmlhttp&extension=deals&module=deals",
	{
		action:"show_feed",
		deals_feed_id:id
	},
	function(data)
	{
		$(".deals_feed_hidden").show('normal', function () {
		      $(".deals_feed_hidden"). removeClass('deals_feed_hidden');
		});    
		$(".show_feed"). hide('normal');
	

	});	
}