
var reqfield		= 'هذا الحقل مطلوب';
var reqpic			= 'هذا الإمتداد غير مسموح';
var reqemail		= 'أدخل البريد بطريقة صحيحة';
var reqdigit		= 'يجب ان أن يكون أرقام فقط';

function popUp(URL,width,height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + width +",height=" + height +",left = 199.5,top = 196.5');");
}
// this function to add one answer input text and it used in form add new vote
function redir_stage(url) {
	window.location = url;
}
// this function to open popup share content site
function share(type,url, width,height) {
	day = new Date();
	id = day.getTime();
	facebook 	= 'http://www.facebook.com/sharer.php?u=';
	twitter 	= 'http://twitter.com/home?status=';
	if(type == 'facebook'){
		out = facebook+url;
	}
	else {
		out = twitter+url;
	}
	eval("page" + id + " = window.open(out, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + width +",height=" + height +",left = 199.5,top = 196.5');");
}

//this function to show result of any action that do in admin and this take('message that you need it show','color of background if you need') and it hide after 7 secound
function myNote(msg,x, color)
{
	dd = 'note'+x;
	if (color){
		$('#note'+x).addClass("berror");
	}
	else{
		$('#note'+x).addClass("bsuccess");
		}
	document.getElementById(dd).innerHTML = msg;
	document.getElementById(dd).style.display = 'block';
	setTimeout('document.getElementById(\''+dd+'\').style.display = \'none\'', 7000);
}

//this function to active any vote ask to show in main page
function report_comment(type,x) {
	$.ajax({type: "GET",url: "index.php?do=report&go="+type,data: 'id='+x,success: function(msg){
		myNote(msg,x);
		}
	});
}
