﻿
function vote(id){
		val=getCheckedValue('vote_'+id);
		if (val>'0'){
			document.getElementById("poll_"+id).innerHTML='<img src="images/loader.gif"> جاري التصويت ..';
			ajaxCall('vote_for','id='+val);
		}

}//end function vote

function vote_results(id){
		document.getElementById("poll_"+id).innerHTML='<img src="images/loader.gif"> جلب النتائج ..';
		ajaxCall('vote_for','id=results_'+id);

}//end function vote

function send_comment(id,data_type){
	var comment_name = document.getElementById('comment_name').value;
	var comment_email = document.getElementById('comment_email').value;
	var comment_comment = document.getElementById('comment_comment').value;
	var comment_parent = document.getElementById('comment_parent').value;
	var show_email=0;
	if (document.getElementById('show_email').checked==true){
		show_email=1;
	}
	
	if (comment_name==''){
		alert ('الاسم قصير جدا');
		return false;
	}
	
	if (comment_comment==''){
		alert ('الرجاء ادخال تعليق');
		return false;
	}
	
	param='id='+id;
	param+='&data_type='+data_type;
	param+='&comment_name='+encodeURIComponent(comment_name);
	param+='&comment_email='+encodeURIComponent(comment_email);
	param+='&comment_comment='+encodeURIComponent(comment_comment);
	param+='&comment_parent='+encodeURIComponent(comment_parent);
	param+='&show_email='+encodeURIComponent(show_email);
	
	document.getElementById('add_comment_msg').innerHTML='<img src="images/loader.gif"> جاري اضافة التعليق ..';
	hideObj('add_comment_box');
	showObj('add_comment_msg');
	
	ajaxCall('comment_on',param);
	
	document.getElementById('comment_name').value='';
	document.getElementById('comment_email').value='';
	document.getElementById('comment_comment').value='';
	document.getElementById('comment_parent').value='';
	comment_unreply();
}//end function vote

function report_comment(id){
	if (confirm('التبليغ عن تعليق سيء ؟')){
		ajaxCall('report_comment','id='+id);
	}
}//


pic1= new Image(100,25); 
pic1.src="images/loader.gif"; 
