function send_poll_answer(id){
	my_answer = $("input[@name=poll_"+id+"][@checked]").val();
	if (id =='' || my_answer==''  || my_answer== null  ){
		$('#ajax_error_poll_'+id).show('slow').html('موارد الزامي را تکميل نماييد');
	}else{
		$('#ajax_error_poll_'+id).show('slow').html('منتظر بمانيد...');
		do_ajax( 'POST' , 'ajax.php?page=poll' , 'answer='+my_answer+'&id='+id , 'ajax_error_poll_'+id , 'body' , 'ok' , 'normal', 'write' )
	}
}
function do_success_poll(id){
	$('#ajax_error_poll_'+id).html('راي شما رسال گرديد');
	$('#md_form_poll_'+id).slideUp();
}
function change_block(){
	$(".block_title").each(function(i){
		$(this).click( function() { my_block_show($(this).attr('blockname')) });
		my_block_show($(this).attr('blockname'))
	})

}
var block_change = new Array;
function my_block_show(id){
	if ( ! block_change[id] ||   block_change[id] =='show' ) {
		if ( jQuery.browser.msie ){
			$('#block_content_'+id).hide();
		}else{
			$('#block_content_'+id).slideUp();
		}
		block_change[id] ='hide';
	}else{
		if ( jQuery.browser.msie ){
			$('#block_content_'+id).show();
		}
		$('#block_content_'+id).slideDown();
		block_change[id] ='show';
	}
}
function popup_show(url){
window.open('popup.php?'+url,'md_popup','status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no ,width=560px,height=500px') ;
}

$(document).ready(function() {
	change_block();
});


