$(document).ready(function(){
	
	if(typeof(onReadyFuncA) != 'undefined')
		onReadyFuncA();
	
	if(typeof(onReadyFunc) != 'undefined')
		onReadyFunc();
});


function doVote(f){
	if( $('.voteVariant:checked').length < 1 ){
		return false;
	}
	
	$(f).find('button').attr('disabled', 'disabled').html('Голосуем...');
	
	$.ajax({
		url: AJAXPath + 'vote.php', dataType: 'text', type: 'post', 
		data: $(f).serialize(),
		success: function(data){
			if(data){
				$('#votes').html(data);
			}else{
				alert('Произошла ошибка. Попробуйте еще раз');
				$(f).find('input,button').removeAttr('disabled');
			}
		},
		error: function(){
			alert('Произошла ошибка. Попробуйте еще раз');
			$(f).find('input,button').removeAttr('disabled');
		}
	});
	
	$(f).find('input').attr('disabled', 'disabled');
	
	return false;
}

function refImg(id){
	var s = $('#childfor'+id).css('display') == 'none' ? 'plus' : 'minus';
	$('#imgStat'+id).attr('src', '/templates/img/menu_'+s+'.gif');
}
