
get_selected_radio = function(radio_group)
{
	for(var i=0;i<radio_group.length;i++)
	{
		if(radio_group[i].checked){return i;}	
	}
	return 0;
}
on_sent = function(data)
{
//	alert(data);
	$('#abuse_feedback').html(data);
}
Send_abuse = function()
{
//	var test_id=document.getElementById('id').value;
	var id=$('#id').attr('value');
	var guest_name=$('#guest_name').attr('value');
	var guest_email=$('#guest_email').attr('value');
	var guest_email_confirm=$('#guest_email_confirm').attr('value');
	var problem_types=document.getElementsByName('problem_type');
	var problem_type=problem_types[get_selected_radio(problem_types)].value;
	var other_type=$('#other_type').attr('value');
	var notes=$('#notes').attr('value');
	var antibot=$('#antibot').attr('value');
//	if(notes)
//	{alert('OK');}
//	else{alert('NO');}
//	alert (notes);
	
	$.post('/index.php?action=feedback/abuse_feedback',
  		{
    		id:id,
			guest_name:(guest_name)?guest_name:'',
			guest_email:(guest_email)?guest_email:'',
			guest_email_confirm:(guest_email_confirm)?guest_email_confirm:'',
			problem_type:(problem_type)?problem_type:'',
			other_type:(other_type)?other_type:'',
			notes:(notes)?notes:'',
			antibot:(antibot)?antibot:'',
			ajax:1,
			send:1
  		},
  		on_sent
	);
}

function problem_type_onchange()
{
	problem_type = $('#problem_type').attr('value');
	if(problem_type == 'Other')
	{
		document.getElementById('other_type').style.display = "block";
	}
	else
	{
		document.getElementById('other_type').style.display = "none";
	}
}
