function login_check(){	var username = $("#username").val();	
			var password = $("#password").val();
			msg = "";
			if ( username == "" ) {
				msg = 'نام کاربری وارد نشده';
			}
			else if ( password == "" ){
				msg = 'رمز عبور وارد نشده';
			}
			if ( msg == "" ){
				core('login_place' , 'task=login&username='+ username +'&password=' + password);	
			}
			else {
					 $("#login_check").html(msg);	
			}}
function change_pass(){		var username      = $("#ch_username").val();	
		var password      = $("#old_password").val();
		var new_password1 = $("#new_password1").val();
		var new_password2 = $("#new_password2").val();
		msg = "";
			if ( username == "" ) {
				msg = 'نام کاربری وارد نشده';
			}
			else if ( password == "" ){
				msg = 'رمز عبور قبلی وارد نشده';
			}
			else if ( new_password1 == "" ){
				msg = 'رمز عبور جدید وارد نشده';
			}
			else if ( new_password1 != new_password2 ){
				msg = 'رمز عبور جدید و تکرار رمز ورود یکسان نیست';
			}
			if ( msg == "" ){
				core('ajax_overlayer_in_page' , 'task=change_pass&username='+ username 
				+'&password=' + password
				+'&newpass1=' + new_password1
				);	
			}
			else {
					 $("#change_pass_check").html(msg);	
			}
		}
function forget_password(){		var username = $("#mail_username").val();	
		var email    = $("#mail_email").val();
		msg = "";
			if ( username == "" ) {
				msg = 'نام کاربری وارد نشده';
			}
			else if ( email == "" ){
				msg = 'آدرس پست الکترونیکی وارد نشده';
			}
			if ( msg == "" ){
				core('ajax_overlayer_in_page' , 'task=forget_pass&username='+ username 
				+'&email=' + email
			
				);	
			}
			else {
					 $("#forget_pass_check").html(msg);	
			}	}
function reg_day_msg(day_msg,id) {

	if (day_msg == '' ) {
			$('#day_msg_check').html('متن پیام روز نمی تواند خالی باشد');	
			
	}
	else {
			admin_core('select_menu','task=day_msg'+
					   '&content=' + day_msg +
					   '&id= ' + id
					   );	
	}}
function add_root_gall(){
		var name 		       = $('#gallety_name').val();
		var gallery_role       = $('#gallery_role').val();
		var gallery_admin_role = $('#gallery_admin_role').val();
		var id  		       = $('#gallety_id').val();
		var level  		       = $('#gallety_level').val();
		if (name == '' ) {
			$('#add_root_gall_check').html('نام گالری نمی تواند خالی باشد');	
			$('#gallety_name').focus();
		}
		else {
				admin_core('select_menu','task=add_root_gall'+
						   '&name=' + name                      + 
						   '&parent_id='   + id                 + 
						   '&level='       + level              + 
						   '&admin_role='  + gallery_admin_role + 
						   '&roleid='      + gallery_role
						   );	
		}}
function show_level(target_id,gallery_id){
	$('#show_over_level').animate({
							opacity : '0',
							width   :"0"
		},350);	
		var old_t = $('#old_galley_id').val();
		if ( old_t == target_id ) {
			 $("#"+target_id).slideToggle(480);	
		}
		else {
			$("#"+target_id).slideDown(480);
			if ( old_t != "" ) {
			$("#"+old_t).slideUp(600);
			}
			$('#old_galley_id').val( target_id );	
		}
		
		admin_core('gall_inf','task=gallery_inf&id='+gallery_id);
		$("#main_gallery").text('');}
function show_gal_inf(gallery_id) {
		admin_core('gall_inf','task=gallery_inf&id='+gallery_id);
		$("#main_gallery").text('');}
function show_level2(gallery_id,e) {
	
		var IE = document.all?true:false
		var overX = e.clientX -60 ;
		var overY = e.clientY - 10 ;
		if (IE) { // grab the x-y pos.s if browser is IE
					
			overX = e.clientX  ;
			overY = e.clientY -60;
		}
		
				admin_core('gall_inf','task=gallery_inf&id='+gallery_id);
				
					
					
					$('#show_over_level').css('left',overX);
					$('#show_over_level').css('top',overY);
					$('#show_over_level').css('display','block').fadeTo(5,0.01);
					$('#show_over_level').html($('#level2'+gallery_id).html());
					$('#show_over_level').animate({
												 top    :  overY,
												 left   :  overX-120,
												 opacity : '1',
												 width  :"160"
												  },450);
			
		
				$("#main_gallery").text('');  
										 
		}
function close_over_layer(e){
		$('#show_over_level').animate({
							opacity : '0',
							width   :"0"
		},350);	}
function edit_gall(){
		var name 		 = $('#edit_gallety_name').val();
		var id  		 = $('#gallety_id').val();
		var gallery_role = $('#edit_gallery_role').val();
		var admin_role   = $('#edit_gallery_admin_role').val();
		if (name == '' ) {
			$('#add_root_gall_check').html('نام گالری نمی تواند خالی باشد');	
			$('#gallety_name').focus();
		}
		else {
				admin_core('gall_inf','task=gallery_inf'+
						   '&name='           + name + 
						   '&id='             + id   + 
						   '&admin_role='     + admin_role   + 
						   '&roleid='         + gallery_role
						   );	
		}}
function edit_image_form() {
		$(".edit_image").fadeIn(200,function(){$(".edit_image_form").fadeIn(300)});}
function cansel_gallery(){	$(".edit_image_form").fadeOut(300,function(){
			$.ajax({
				type: "POST",
				url: 'admin/core.php',
				data: 'task=cancel_gallery',
				success: function(msg){
					
			   }
			   });
									$(".edit_image").fadeOut(200)		 
											 });}
function reg_image(gallery_id) {	var id = $('#img_id').val();
	image_check = $('#image_check').val();
	var msg = '';
	if ( id == "" ){
		if (image_check == 'no'){
			msg = 'لطفا تصویر را انتخاب کنید'
			
		}
	}
	if (msg != ''){
		$('#image_check_o').html(msg);
	}
	else {
	admin_core('main_gallery','task=galley_images&act=act&gallery_id='+gallery_id+'&title=' + $('#image_title').val());
	}}
function reg_slide() {		
	var id = $('#img_id').val();
	image_check = $('#image_check').val();
	var msg = '';
	if ( id == "" ){
		if (image_check == 'no'){
			msg = 'لطفا تصویر را انتخاب کنید'
			
		}
	}
	if (msg != ''){
		$('#image_check_o').html(msg);
	}
	else {
	admin_core('select_menu','task=slideshow&act=act&id='+ id +'&title=' + $('#image_title').val());
	}}
function reg_adver() {		
	var id = $('#img_id').val();
	image_check = $('#image_check').val();
	var msg = '';
	if ( id == "" ){
		if (image_check == 'no'){
			msg = 'لطفا تصویر را انتخاب کنید'
			
		}
	}
	if (msg != ''){
		$('#image_check_o').html(msg);
	}
	else {
	admin_core('select_menu','task=adver&act=act&id='+ id +'&link=' + $('#image_link').val() 
			+ '&text=' + $('#image_text').val());
	}}
function next_images(){
		var top_pos    = parseInt($('#img_box').css('top')) - 220;
		var div_height = parseInt($('#img_box').css('height'));
		if ( top_pos > -div_height){
		$('#img_box').animate({
							top:top_pos			 
		 }, 300);
		}}
function pre_image(){var top_pos    = parseInt($('#img_box').css('top')) + 220;
		var div_height = parseInt($('#img_box').css('height'));
		if ( top_pos < 220){
		$('#img_box').animate({
							top:top_pos			 
		 }, 300);
		}}
function edit_del_image(image_id){
			admin_core('edit_image_form','task=edit_del_image&id='+image_id);
			$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '70%' ,
																			height: '46%',
																			left  : '15%',
																			top   : '27%'
																			   },350);
												 
												 });}
function edit_del_slide(image_id){
			admin_core('edit_image_form','task=edit_del_slide&id='+image_id);
			$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '70%' ,
																			height: '46%',
																			left  : '15%',
																			top   : '27%'
																			   },350);
												 
												 });}
function edit_del_adver(image_id){
			admin_core('edit_image_form','task=edit_del_adver&id='+image_id);
			$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '70%' ,
																			height: '46%',
																			left  : '15%',
																			top   : '27%'
																			   },350);
												 
												 });}
function change_parent(id) {
	admin_core('main_gallery','task=change_parent&id='+ id +
'&main_grs='  +  $('#main_grs').val() + 
'&l1_childs=' +  $('#l1_childs').val() + 
'&l2_childs=' +  $('#l2_childs').val() 
)	;
	cansel_gallery(); }
function add_root_n_level(){
		var name      = $('#news_gr_name').val();
		var roleid    = $('#news_level_role').val();
		var admin_role= $('#news_level_admin_role').val();
		
		var id =  $('#news_level_id').val();
		if ( name == '' ){
			
				$('#add_root_news_check').html('نام گروه -دسته خبر نمی تواند خالی باشد');
		}
		else {
				admin_core('select_menu','task=add_root_news&name=' + name + 
						   '&roleid='    + roleid     +
						   '&admin_role='+ admin_role + 
						   '&id='       + id);	
		} }
function show_level1_news(news_id){	
		
		var old_t = $('#old_news_id').val();
		
		if ( old_t == "level1"+news_id ) {
			 $("#level1"+news_id).slideToggle(320);	
		}
		else {
			$("#level1"+news_id).slideDown(320);
			if ( old_t != "" ) {
			$("#"+old_t).slideUp(600);
			}
			$('#old_news_id').val( "level1"+news_id );	
		}
		show_news(news_id);
		 }
function show_news(news_id) {
		$('#main_news').html('')	;
		admin_core('news_inf','task=news_inf&id=' + news_id); }
function add_news_level() {
		var name        = $('#news_level_gr_name').val();
		var roleid      = $('#news_level_role2').val();
		var admin_role  = $('#news_level_admin_role2').val();
		var parent_id   = $('#newslevel_parent_id').val();
		if ( name == '' ){
			
				$('#add_root_news_check2').html('نام گروه -دسته خبر نمی تواند خالی باشد');
		}
		else {
				admin_core('select_menu','task=add_news_level&name=' + name + 
						   '&roleid='     + roleid     + 
						   '&admin_role=' + admin_role +
						   '&parent_id='  + parent_id);	
		}
		 }
function add_edit_news(){
			$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '96%' ,
																			height: '96%',
																			left  : '2%',
																			top   : '2%'
																			   },350);
												 
												 });}
function edit_news() {
		var content        = FCKeditorAPI.GetInstance('news_content').GetXHTML();
		content = content.replace(/&quot;/gi,'');
		content = content.replace(/&nbsp;/gi,'');
		content = content.replace(/&/gi,'');
		var title          = $('#news_title').val();
		var id             = $('#news_id').val();
		var parent_id      = $('#news_parent_id').val();
		var summary        = $('#news_summary').val();
		var source         = $('#news_source').val();
		var link_to_source = $('#news_link_to_source').val();
		var roleid         = $('#news_roleid').val();
		var admin_role     = $('#news_admin_roleid').val();
		var msg = '';
		if ( title == '' ){
			msg = 'عنوان خبر نمی تواند خالی باشد';
			$('#news_title').focus();
			
		}
		else if ( content == '' ){
			msg = 'متن خبر نمی تواند خالی باشد';
			
		}
		else if ( source == '' ){
			msg = 'منبع خبر نمی تواند خالی باشد';
			$('#news_source').focus();	
		}
		if ( msg != '' ){
			$('#news_check').html(msg);
		}
		else {
				$('#news_check').html('');
				admin_core('main_news','task=add_edit_news&title=' + title
						   + '&content='        + content
						   + '&summary='        + summary
						   + '&parent_id='      + parent_id
						   + '&id='             + id
						   + '&source='         + source
        				   + '&admin_role='     + admin_role
						   + '&link_to_source=' + link_to_source
						   + '&roleid='         + roleid
						   );
		}
		
		 }
function edit_form(news_id,parent_id) {
 		admin_core('edit_image_form','task=edit_news&parent_id='+parent_id+'&id=' + news_id );
		add_edit_news();
		 }
function add_menu(name,descriptoin,roleid,id,admin_role){
		if (name == ""){
			$('#add_menu_check').html('نام منو نمی تواند خالی باشد');
		}
		else {
			$('#add_menu_check').html('');
		
			admin_core('admin_layer','task=add_edit_root&name=' + name
						   + '&description=' + descriptoin
						   + '&roleid='      + roleid
						   + '&admin_role='  + admin_role
						   + '&id='          + id
						   );
		} }
function add_menu_level(){

		var name         = $('#menu_name').val();
		var level        = $('#menu_level').val();
		var parent_id    = $('#menu_parent_id').val();
		var description  = $('#menu_description').val();
		var role         = $('#menu_role').val();
		var admin_role   = $('#menu_admin_role').val();
		var id           = $('#menu_id').val();
		if (name == ""){
			$('#add_menu_level_check').html('نام زیر منو نمی تواند خالی باشد');
			$('#menu_name').focus();
		}
		else {
			$('#add_menu_level_check').html('');
			admin_core('select_menu','task=add_menu_level&name=' + name
						   + '&description=' + description
						   + '&roleid='      + role
						   + '&admin_role='  + admin_role
						   + '&level='       + level
						   + '&parent_id='   + parent_id
						   + '&id='          + id
						   );
		}	 }
function level_menu(target_id,menuid) {
	 
		var old_t = $('#old_menu_id').val();
		if ( old_t == target_id ) {
			 $("#"+target_id).slideToggle(480);	
		}
		else {
			$("#"+target_id).slideDown(480);
			if ( old_t != "" ) {
			$("#"+old_t).slideUp(600);
			}
			$('#old_menu_id').val( target_id );	
		}	
		admin_core('menu_inf','task=menu_inf&id='+menuid);
		$('#main_menus').html('');
		}
function add_sub_menu(){

		var name         = $('#sub_menu_name').val();
		var level        = $('#sub_menu_level').val();
		var parent_id    = $('#sub_menu_parent_id').val();
		var description  = $('#sub_menu_description').val();
		var role         = $('#sub_menu_role').val();
		var admin_role   = $('#sub_menu_admin_role').val();
	
		if (name == ""){
			$('#add_sub_menu_level_check').html('نام زیر منو نمی تواند خالی باشد');
			$('#sub_menu_name').focus();
		}
		else {
			$('#add_menu_level_check').html('');
			admin_core('menu_inf','task=add_sub_menu&name=' + name
						   + '&description=' + description
						   + '&roleid='      + role
						   + '&admin_role='  + admin_role
						   + '&level='       + level
						   + '&parent_id='   + parent_id
						   );
		}	 }
function add_edit_content(id,parent_id) {
			$.ajax({
				type: "POST",
				url: 'admin/core.php',
				data: 'task=add_edit_content&id='+id+'&parent_id='+parent_id,
				success: function(msg){
						$('#edit_image_form').html( msg );
						$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '96%' ,
																			height: '96%',
																			left  : '2%',
																			top   : '2%'
																			   },350);
												 
												 });
			   				}
			   });	
	
	
			}
function edit_content(parent_id) {
			
			$.ajax({
				type: "POST",
				url: 'admin/core.php',
				data: 'task=edit_content&parent_id='+parent_id,
				success: function(msg){
						$('#edit_image_form').html( msg );
						$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '96%' ,
																			height: '96%',
																			left  : '2%',
																			top   : '2%'
																			   },350);
												 
												 });
			   				}
			   });	
	
	
			}
function edit_menu_content(task){
		
		var content        = FCKeditorAPI.GetInstance('menu_content2').GetXHTML();
		content = content.replace(/&quot;/gi,'');
		content = content.replace(/&nbsp;/gi,'');
		content = content.replace(/&/gi,'');
		var title          = $('#menu_title2').val();
		var id             = $('#menu_id2').val();
		var parent_id      = $('#menu_parent_ir2').val();
		var summary        = $('#menu_summary2').val();
		var roleid         = $('#menu_role2').val();
		var admin_role     = $('#menu_admin_role2').val();
		var msg = '';
		if ( title == '' ){
			msg = 'عنوان منو نمی تواند خالی باشد';
			$('#menu_title2').focus();
			
		}
		else if ( content == '' ){
			msg = 'متن منو نمی تواند خالی باشد';
			
		}
		if ( msg != '' ){
			$('#menu_content_check').html(msg);
		}
		else {
				$('#menu_content_check').html('');
				cansel_gallery();
				admin_core('main_menus','task='+ task +'&title=' + title
						   + '&content='        + content
						   + '&summary='        + summary
						   + '&parent_id='      + parent_id
						   + '&id='             + id
        				   + '&admin_role='     + admin_role
						   + '&roleid='         + roleid
						   );
				
		}
		
		 		 }
function reg_link(title,description,site_url,id) {
		var msg = '';
		if ( title == '' ){
			msg = 'عنوان پیوند وارد نشده';
		}
		else if ( site_url == '' ){
			msg = 'نشانی اینترنتی پیوند وارد نشده';
		}
		if ( msg == '' ){
				$('#links_check').html('&nbsp;');
				admin_core('select_menu','task=admin_links&title=' + title + 
						   '&description=' + description +
						   '&site_url='    + site_url +
						   '&id=' + id      
						   );
		}
		else {
				$('#links_check').html(msg);	
		} }
function reg_rss(title,description,site_url,id) {
		var msg = '';
		if ( title == '' ){
			msg = 'عنوان پیوند وارد نشده';
		}
		else if ( site_url == '' ){
			msg = 'نشانی اینترنتی پیوند وارد نشده';
		}
		if ( msg == '' ){
				$('#rss_check').html('&nbsp;');
				admin_core('select_menu','task=admin_rss&title=' + title + 
						   '&description=' + description +
						   '&site_url='    + site_url +
						   '&id=' + id      
						   );
		}
		else {
				$('#rss_check').html(msg);	
		} }
function add_edit_manager(){
		var name      = $('#name').val();
		var family    = $('#family').val();
		var username  = $('#username').val();
		var uname     = $('#uname').val();
		var password1 = $('#password1').val();
		var password2 = $('#password2').val();
		var tel_number= $('#tel_number').val();
		var email     = $('#email').val();
		var uemail    = $('#uemail').val();
		var role_id   = $('#role_id').val();
		var id        = $('#id').val();
		var msg = ''
		if ( name == '' ){
			msg = 'فیلد نام وارد نشده ';
			 $('#name').focus();
		}
		else if ( family == '' ){
			msg = 'فیلد نام خانوادگی وارد نشده ';
			 $('#family').focus();
		}
		else if ( username == '' ){
			msg = 'فیلد نام کاربری وارد نشده ';
			 $('#username').focus();
		}
		else if ( uname == 'no' ){
			msg = 'فیلد نام کاربری صحیح نیست ';
			 $('#username').focus();
		}
		else if ( email == '' ){ 
			msg = 'نشانی پست الکترونیک وارد نشده';
			 $('#email').focus();
		}
		else if ( uemail == '' ){
			msg = 'نشانی پست الکترونیک صحیح نیست';
			 $('#email').focus();
		}
		else if ( id == '' ){
				if ( password1 == '' ){
						msg = 'فیلد رمز عبور وارد نشده';
			 			$('#password1').focus();	
				}
				if ( password1 != password2 ){
						msg = 'رمز عبور و تکرار رمز عبور صحیح وارد نشده اند';
			 			$('#password1').focus();
				}
		}
		else if ( id != '' ){
				if ( password1 != '' ){
						if ( password1 != password2 ){
						msg = 'رمز عبور و تکرار رمز عبور صحیح وارد نشده اند';
			 			$('#password1').focus();
						}
				}
		}
		if ( msg == '' ){
				$('#check_manager_form').html('');
				admin_core('permission_form','task=add_edit_manager'+
						   '&id='         + id +
						   '&role_id='    + role_id +
						   '&email='      + email +
						   '&tel_number=' + tel_number +
						   '&password='  + password1 +
						   '&username='   + username +
						   '&family='     + family +
						   '&name='       + name
						   );
		}
		else {
			$('#check_manager_form').html(msg);	
		}
		 }
function search_managers() {
			var search_verb  = $('#search_verb').val()
			var search_field = $('#search_field').val();
			if ( search_verb.length > 3 ){
					admin_core('manager_search_result','task=search_manager&search_verb=' + search_verb + '&search_field=' + search_field);
			}
		 }
function add_edit_role_f(name,description,id) {
	if (name != 0){
		 $('#role_description').val(description);
		 $('#role_id').val(id);
		 $('#role_name').val(name);
	}
	else {
		 $('#role_description').val('');
		 $('#role_id').val('');
		 $('#role_name').val('');	
	}
		 
		 $('#add_edit_admin_role').slideDown(300);
		  }
function add_edit_admin(){
		var name = $('#role_name').val();
		var description = $('#role_description').val();
		var id   = $('#role_id').val();
		if (name != ''){
			  admin_core('permission_form','task=add_edit_role&id='+id+'&name='+name+'&description='+description);
		}
		else {
			$('#role_name').focus();	
		} }
function edit_other(id) {
			$.ajax({
				type: "POST",
				url: 'admin/core.php',
				data: 'task=edit_others&id='+id,
				success: function(msg){
						$('#edit_image_form').html( msg );
						$(".edit_image").fadeIn(200,function(){
												 $(".edit_image_form").css('display','block');
												 $(".edit_image_form").animate({
																			width : '96%' ,
																			height: '96%',
																			left  : '2%',
																			top   : '2%'
																			   },350);
												 
												 });
			   				}
			   });	
	
	
			}
function reg_other(){
		
		var content        = FCKeditorAPI.GetInstance('other_content').GetXHTML();
		content = content.replace(/&quot;/gi,'');
		content = content.replace(/&nbsp;/gi,'');
		content = content.replace(/&/gi,'');
		var title          = $('#other_title').val();
		var id             = $('#other_id').val();
		
		var msg = '';
		if ( title == '' ){
			msg = 'فیلد عنوان خالی است';
			$('#menu_title2').focus();
			
		}
		else if ( content == '' ){
			msg = 'متن  نمی تواند خالی باشد';
			
		}
		if ( msg != '' ){
			$('#other_check').html(msg);
		}
		else {
				$('#other_check').html('');
				cansel_gallery();
				admin_core('select_menu','task=edit_others&title=' + title
						   + '&content='        + content
						   + '&id='             + id
						   );
				
		}
		 }
function next_page(){
		var top_pos    = parseInt($('#txt_box').css('top')) - 305;
		var div_height = parseInt($('#txt_box').css('height'));
		var mid_pos1   = parseInt($('#txt_box').css('top')) - 40;
		var mid_pos2   = parseInt($('#txt_box').css('top')) - 305;
		
		if (div_height == 0){
				div_height = 1600;
		}
		if ( top_pos > -div_height){
		
			 		$('#txt_box').animate({
										  top:mid_pos2
										  },800,function(){});			
			 
			
		}}
function pre_page(){
		var top_pos    = parseInt($('#txt_box').css('top')) + 305;
		var mid_pos1   = parseInt($('#txt_box').css('top')) + 50;
		var mid_pos2   = parseInt($('#txt_box').css('top')) + 305;
		var div_height = parseInt($('#txt_box').css('height'));
		if (div_height == 0){
				div_height = 1600;
		}
		if ( top_pos < 355){
		
			 		$('#txt_box').animate({
										  top:mid_pos2
										  },1200,function(){});			
			 
			
		}}
function add_edit_poll(){
		var title   = $('#poll_title').val();
		var content = $('#poll_content').val();
		var vote1   = $('#poll_vote1').val();
		var vote2   = $('#poll_vote2').val();
		var vote3   = $('#poll_vote3').val();
		var vote4   = $('#poll_vote4').val();
		var id      = $('#poll_id').val();
		var msg     = '';
		if ( title == '' ){
				$('#poll_title').focus();
				msg = 'عنوان نظرسنجی نمیتواند خالی باشد';
		}
		else if ( content == '' ){
				$('#poll_content').focus();
				msg = 'سوال نظرسنجی نمیتواند خالی باشد';	
		}
		else if ( vote1 == '' ){
				$('#poll_vote2').focus();
				msg = 'گزینه یک نمیتواند خالی باشد';	
		}
		else if ( vote2 == '' ){
				$('#poll_vote2').focus();
				msg = 'گزینه دو نمیتواند خالی باشد';	
		}
		if ( msg != "" ){
			 $('#add_poll_check').html(msg);
		}
		else {
			 $('#add_poll_check').html('');
			 admin_core('select_menu','task=add_edit_poll&id=' + id +
						'&title='   + title   +
						'&content=' + content +
						'&vote1='   + vote1   +
						'&vote2='   + vote2   +
						'&vote3='   + vote3   +
						'&vote4='   + vote4 
						);
			
		} }

