function open_page(new_url)
{
LeftPosition = (screen.width) ? (screen.width-600)/2 : 0;
TopPosition = (screen.height) ? (screen.height-450)/2 : 0;
settings="status=0,toolbar=0,width=600,height= 450 , top="+TopPosition+", left="+LeftPosition+", scrollbars=yes resizeable=no";
window.open (new_url,"search_result",settings);
}
//----------------------------------------------------------
function show_lectures_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=lectures&lectures_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function show_soundsunna_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=soundsunna&soundsunna_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function show_books_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=books&books_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function show_articles_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=articles&articles_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function show_fatawa_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=fatawa&fatawa_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function isvalid_search(){
   if(document.searchform.search_word.value=="")
    {window.alert("أدخل كلمة البحث ");return false;}
   else
    {document.searchform.submit();return true;}
 }
//----------------------------------------------------------
function is_valid_share(){

 if(document.share_form.guest_name.value=="" )
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.share_form.submit();return true;
  }
}
//-----------------------------------------------------------------
function is_valid_story(){
 if(document.story_form.title.value!="" && document.story_form.writer.value!="" )
  {
   document.story_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة ");
   return false;
  }
}
//-----------------------------------------------------------------
function is_valid_article(){
 if(document.article_form.title.value!="" && document.article_form.writer.value!="" )
  {
   document.article_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة ");
   return false;
  }
}
//----------------------------------------------------------
function is_vaild_comment(){
 if(document.commentform.auther.value!="" && document.commentform.reply.value!="")
  {
   document.commentform.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة ");
   return false;
  }
}
//-----------------------------------------------------------
function is_valid_contact() {
if (contactform.sender_name.value=="" ||contactform.sender_email.value=="" ||contactform.subject.value==""||contactform.message.value=="") {
 alert(" أكمل البيانات المطلوبة ");
 return false;
}
else
 {
    var x = contactform.sender_email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)==false)
	  {
	   alert('بريد الراسل غير صحيح');
	  }
    else
      {
        contactform.submit();
	    return true;
      }
  }
}
//-----------------------------------------------------------
function is_valid_question(){
 if(document.questionform.title.value!="" && document.questionform.question.value!="")
  {
   document.questionform.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة  ");return false;
  }
}
//-----------------------------------------------------------
	function expand(listID) {
		listID.style.display=(listID.style.display=="none" || listID.style.display=="")?"":"none";
		window.event.cancelBubble=true;
	}
//----------------------------------------------------------
	function contract(listID) {
		listID.style.display=(listID.style.display=="show")?"":"none";
		window.event.cancelBubble=true;
	}
//----------------------------------------------------------
	function show_hide(x)
	{
	obj = document.getElementById(x);
		if(	obj.style.display == "block")
		{
			obj.style.display = "none";
		}
		else
		{
			obj.style.display = "block";
		}
	}

//----------------------------------------------------------
function is_valid_cat(){
 if(document.cat_form.cat_name.value!="")
  {
   document.cat_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_item(){
 if(document.item_form.item_name.value!="")
  {
   document.item_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_do3aa(){
 if(document.do3aa_form.do3aa_name.value!="" && document.do3aa_form.shikh.value!="" &&
    document.do3aa_form.do3aa_path.value!="" )
  {
   document.do3aa_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_nasheed(){
 if(document.nasheed_form.nasheed_name.value!="" && document.nasheed_form.monshed.value!="" &&
    document.nasheed_form.nasheed_path.value!="" )
  {
   document.nasheed_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_flash(){
 if(document.flash_form.flash_name.value!="" && document.flash_form.designer.value!="" &&
    document.flash_form.flash_path.value!="" )
  {
   document.flash_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_card(){
 if(document.card_form.card_title.value!="" && document.card_form.designer.value!="" &&
    document.card_form.card_image.value!="" )
  {
   document.card_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_signature(){
 if(document.signature_form.signature_title.value!="" && document.signature_form.designer.value!="" &&
    document.signature_form.signature_image.value!="" )
  {
   document.signature_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function is_valid_part(){
 if(document.part_form.shareet_id.value!="" && document.part_form.part_name.value!="" && document.part_form.part_path.value!="" )
  {
   document.part_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function get_cat_sub_items_lec(){
  parent_cat_id=part_form.parent_cat_id.options[part_form.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=lectures&lectures_action=add_part&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_msg(){
 parent_cat_id=edit_msg.parent_cat_id.options[edit_msg.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=daleel&daleel_action=edit_msg&step=1&parent_cat_id='+parent_cat_id;
}

//----------------------------------------------------------
function get_cat_sub_items_sound(){
  parent_cat_id=part_form.parent_cat_id.options[part_form.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=soundsunna&soundsunna_action=add_part&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_items_lec () {
  parent_cat_id=edit_item.parent_cat_id.options[edit_item.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=lectures&lectures_action=edit_item&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_items_sound () {
  parent_cat_id=edit_item.parent_cat_id.options[edit_item.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=soundsunna&soundsunna_action=edit_item&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_ideas() {
  parent_cat_id=edit_idea.parent_cat_id.options[edit_idea.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=ideas&ideas_action=edit_idea&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_handwritten() {
  parent_cat_id=edit_book.parent_cat_id.options[edit_book.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=handwritten&handwritten_action=edit_book&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_other_books() {
  parent_cat_id=edit_book.parent_cat_id.options[edit_book.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=other_books&other_books_action=edit_book&step=1&parent_cat_id='+parent_cat_id;
}



//----------------------------------------------------------
function confirm_delete(){
	if(window.confirm("هل أنت متأكد "))
      cat_form.submit();
}
//----------------------------------------------------------
function confirm_logout(){
	if(window.confirm("هل أنت متأكد "))
      {
       top.location.href="logout.php";
	  }
}

//************************** edit part --> step 1
//------------------------------------------------------------
function edit_part_cat_sub_items_lec(){
  cat_id=part_form.cat_id.options[part_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=lectures&lectures_action=edit_part&step=1&parent_cat_id='+cat_id;

}
//------------------------------------------------------------
function edit_part_cat_sub_items_sound(){
  cat_id=part_form.cat_id.options[part_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=soundsunna&soundsunna_action=edit_part&step=1&parent_cat_id='+cat_id;

}
//----------------------------------------------------------
function get_shareet_parts_lec(){
  shareet_id=part_form.shareet_id.options[part_form.shareet_id.selectedIndex].value;
  parent_cat_id=part_form.parent_cat_id.value;
  if(shareet_id)
    window.location.href='left_side.php?view=lectures&lectures_action=edit_part&step=1&parent_cat_id='+parent_cat_id+'&shareet_id='+shareet_id;
}
//----------------------------------------------------------
function get_shareet_parts_sound(){
  shareet_id=part_form.shareet_id.options[part_form.shareet_id.selectedIndex].value;
  parent_cat_id=part_form.parent_cat_id.value;
  if(shareet_id)
    window.location.href='left_side.php?view=soundsunna&soundsunna_action=edit_part&step=1&parent_cat_id='+parent_cat_id+'&shareet_id='+shareet_id;
}
//**************************************************************

//************************** edit part --> step 2
//------------------------------------------------------------
function edit_part_cat_sub_items_2_lec(){
  cat_id=part_form.cat_id.options[part_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=lectures&lectures_action=edit_part&step=2&parent_cat_id='+cat_id;

}
//------------------------------------------------------------
function edit_part_cat_sub_items_2_sound(){
  cat_id=part_form.cat_id.options[part_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=soundsunna&soundsunna_action=edit_part&step=2&parent_cat_id='+cat_id;

}
//****************************************************************************
//----------------------------------------------------------
function is_valid_book(){
 if(document.book_form.book_name.value!="" && document.book_form.book_path.value!="" )
  {
   document.book_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//------------------------------------
function edit_cat_sub_books () {
  parent_cat_id=edit_book.parent_cat_id.options[edit_book.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=books&books_action=edit_book&step=1&parent_cat_id='+parent_cat_id;
}
//*****************************************************************************
//----------------------------------------------------------
function is_valid_article (){
 if(document.article_form.title.value!=""  )
  {
   document.article_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//------------------------------------
function is_valid_reply (){
 if(document.reply_form.auther.value!="" && document.reply_form.reply.value!=""  )
  {
   document.reply_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}

//------------------------------------
function edit_cat_sub_articles () {
  parent_cat_id=edit_article.parent_cat_id.options[edit_article.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=articles&articles_action=edit_article&step=1&parent_cat_id='+parent_cat_id;
}
//------------------------------------
function edit_cat_sub_ramadan () {
  parent_cat_id=edit_article.parent_cat_id.options[edit_article.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=ramadan&ramadan_action=edit_article&step=1&parent_cat_id='+parent_cat_id;
}
//------------------------------------
function edit_cat_sub_hajj () {
  parent_cat_id=edit_article.parent_cat_id.options[edit_article.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=hajj&hajj_action=edit_article&step=1&parent_cat_id='+parent_cat_id;
}
//------------------------------------
function edit_cat_sub_signatures() {
  parent_cat_id=edit_signature.parent_cat_id.options[edit_signature.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=signatures&signatures_action=edit_signature&step=1&parent_cat_id='+parent_cat_id;
}
//********************************************************
function is_valid_fatwa(){
 if(document.fatwa_form.title.value!=""   )
  {
   document.fatwa_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//*******************************************************
function is_valid_site_new(){
 if(document.site_new_form.site_new.value !="" )
  {
   document.site_new_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//*******************************************************
function is_valid_idea(){
 if(document.idea_form.parent_cat_id.value !="" )
  {
   document.idea_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//*************************************************
function is_valid_login(){
 if(document.login_form.user_name.value !="" && document.login_form.password.value !="" )
  {
   document.login_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//------------------------------------------------------------
function is_valid_send() {
if (sendform.sender_name.value=="" ||sendform.sender_email.value=="" ||sendform.frind_email.value=="" ||sendform.message.value=="") {
 alert(" أكمل البيانات المطلوبة ");
 return false;
}
else
 {
    $valid_email=true;

    var x = sendform.sender_email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)==false)
	  {
	   alert('بريد الراسل غير صحيح');
	   $valid_email=false;
	  }

	var x = sendform.frind_email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)==false)
	  {
	   alert('بريد المرسل إليه غير صحيح');
	    $valid_email=false;
	  }

  if($valid_email==true)
    {
	 sendform.submit();
	 return true;
	}
 }
}
//----------------------------------------------------------
function show_quran_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=quran&quran_action=show_part_details&cat_id='+cat_id;
 }
 //----------------------------------------------------------
function get_cat_sub_items_qur(){
  parent_cat_id=part_form.parent_cat_id.options[part_form.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=quran&quran_action=add_part&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_items_qur () {
  parent_cat_id=edit_item.parent_cat_id.options[edit_item.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=quran&quran_action=edit_item&step=1&parent_cat_id='+parent_cat_id;
}
//------------------------------------------------------------
function edit_part_cat_sub_items_qur(){
  cat_id=part_form.cat_id.options[part_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=quran&quran_action=edit_part&step=1&parent_cat_id='+cat_id;

}
//----------------------------------------------------------
function get_shareet_parts_qur(){
  shareet_id=part_form.shareet_id.options[part_form.shareet_id.selectedIndex].value;
  parent_cat_id=part_form.parent_cat_id.value;
  if(shareet_id)
    window.location.href='left_side.php?view=quran&quran_action=edit_part&step=1&parent_cat_id='+parent_cat_id+'&shareet_id='+shareet_id;
}
//------------------------------------------------------------
function edit_part_cat_sub_items_2_qur(){
  cat_id=part_form.cat_id.options[part_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=quran&quran_action=edit_part&step=2&parent_cat_id='+cat_id;

}
//-----------------------------------------------------------
function is_valid_email() {
if (mail_form.email.value==""){
 alert(" أكمل البيانات المطلوبة ");
 return false;
}
else
 {
    var x = mail_form.email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)==false)
	  {
	   alert('بريد الراسل غير صحيح');
	  }
    else
      {
        mail_form.submit();
	    return true;
      }
  }
}
//*************************************************
function is_valid_mod_login(){
 if(document.moderator_login_form.moderator_name.value !="" && document.moderator_login_form.password.value !="" )
  {
   document.moderator_login_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//--------------------------------------------
function is_valid_moderator()
{
if(document.addmoderator_form.moderator_name.value!=""
   && document.addmoderator_form.pwd.value!="" && document.addmoderator_form.pwd_conf.value!="" )
  {
   if(document.addmoderator_form.pwd.value==document.addmoderator_form.pwd_conf.value)
    {
	   document.addmoderator_form.submit();return true;
	}
   else
	{
     alert("كلمة المرور لا تتوافق");return false;
	}
  }
 else
  {
     alert("أدخل البيانات كاملة");return false;
  }
}
//-----------------------------------------------------------
function confirm_delete_moderator(id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=edit_moderators&moderators_action=do_delete&id="+id;
 }
}
//----------------------------------------------------------
function is_valid_site(){
 if(document.siteform.site_name.value!="" && document.siteform.site_path.value!="")
  {
   document.siteform.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة ");
   return false;
  }
}
//--------------------------------------------------------------
function confirm_delete_email(id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=maillist&maillist_action=edit_emails&step=2&delete=yes&email_id="+id;
 }
}
//--------------------------------------------------------------
function confirm_delete_email(id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=maillist&maillist_action=edit_emails&step=2&delete=yes&email_id="+id;
 }
}
//---------------------------------------------------------------
function create_email_fields()
{
 index=document.emails_form.number_emails.options.selectedIndex;
 number_emails=document.emails_form.number_emails.options[index].value;
 window.location.href='left_side.php?view=maillist&maillist_action=add_emails&step=1&number_emails='+number_emails;
 document.emails_form.number_emails.options[index].selected;
}
//---------------------------------------------------------------

//---------------------------------------------------------------
/**
 *
 * @access public
 * @return void
 **/
function is_valid_email_edit(){
if (edit_email_form.email.value==""){
 alert(" أكمل البيانات المطلوبة ");
 return false;
}
else
 {
    var x = edit_email_form.email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)==false)
	  {
	   alert('البريد غير صحيح');
	  }
    else
      {
        edit_email_form.submit();
	    return true;
      }
  }
}
//----------------------------------------------------
function is_valid_emails_import(){
if(document.emails_import_form.file.value !="" )
  {
   	 document.emails_import_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//--------------------------------------------------
/**
 *
 * @access public
 * @return void
 **/
function is_valid_sendmaillist(){
if(document.sendmaillist_form.subject.value !="" && document.sendmaillist_form.body.value !="")
  {
   	 document.sendmaillist_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//--------------------------------------------------
//----------------------------------------------------------
function is_valid_program(){
 if(document.program_form.program_name.value!="" , document.program_form.program_path.value!="")
  {
   document.program_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function get_cat_sub_programs(){
  parent_cat_id=part_form.parent_cat_id.options[part_form.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=programs&programs_action=add_part&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_programs () {
  parent_cat_id=edit_program.parent_cat_id.options[edit_program.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=programs&programs_action=edit_program&step=1&parent_cat_id='+parent_cat_id;
}
//-----------------------------------------------------------
function confirm_delete_ads(id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=ads&ads_action=edit_ads&delete=true&step=2&&ads_id="+id;
 }
}
//------------------------------------------------------
function is_valid_ads(){
if(document.ads_form.name.value !="" && document.ads_form.url.value !="" && document.ads_form.file.value !=""
    )
  {
   	 document.ads_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//---------------------------------------------------------------
function is_valid_settings(){
if(document.settings_form.site_title.value !=""   && document.settings_form.contactus_to.value !="" )
  {
   	 document.settings_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//--------------------------------------------
function checkAll()
{
    window.location.href='left_side.php?view=maillist&maillist_action=edit_emails&step=1&check_action=check';
}

function uncheckAll()
{
    window.location.href='left_side.php?view=maillist&maillist_action=edit_emails&step=1&check_action=uncheck';
}
//------------------------------------------------------------
function is_valid_change(){
 if(document.change_account_form.old_user_name.value !="" && document.change_account_form.old_pass.value !=""
 && document.change_account_form.new_user_name.value !="" && document.change_account_form.new_pass.value !=""
 && document.change_account_form.conf_new_pass.value !=""  )
  {
   if(document.change_account_form.new_pass.value == document.change_account_form.conf_new_pass.value)
    {
	 document.change_account_form.submit();
     return true;
    }
    else
	{
	 alert("كلمات المرور غير متوافقة");return false;
	}
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//*********************************************
function is_valid_register(){
 if(document.register_form.user_name.value!=""
   && document.register_form.pwd.value!="" && document.register_form.pwd_conf.value!=""
   && document.register_form.email.value!="" )
  {
   if(document.register_form.pwd.value==document.register_form.pwd_conf.value)
    {

	       document.register_form.submit();return true;

	}
   else
	{
     alert("كلمة المرور لا تتوافق");return false;
	}
  }
 else
  {
     alert("أدخل البيانات كاملة");return false;
  }
}
//-----------------------------------------------------------
function is_valid_get_pass_email() {
if (get_pass_form.email.value=="")
 {
 alert(" أدخل بريدك");
 return false;
}
else
 {
    var x = get_pass_form.email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)==false)
	  {
	   alert('بريدك غير صحيح ');
	  }
    else
      {

	       get_pass_form.submit();
	       return true;

      }
  }
}
//--------------------------------------------------------------
function is_valid_admin_adduser(){
 if(document.adduser_form.user_name.value!=""
   && document.adduser_form.pwd.value!="" && document.adduser_form.pwd_conf.value!=""
   && document.adduser_form.email.value!="" && document.adduser_form.mobile.value!="")
  {
   if(document.adduser_form.pwd.value==document.adduser_form.pwd_conf.value)
    {
	 if( document.adduser_form.email.value.indexOf(".") > 2 && document.adduser_form.email.value.indexOf("@") > 0 )
	  {
        document.adduser_form.submit();return true;
	  }
	 else
	  {
	  alert("هناك خطأ فى البريد الإلكترونى");return false;
	  }
	}
   else
	{
     alert("كلمة المرور لا تتوافق");return false;
	}
  }
 else
  {
     alert("أدخل البيانات كاملة");return false;
  }
}
//-----------------------------------------------------------
function confirm_delete_user(user_id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=edit_users&users_action=do_delete&user_id="+user_id;
 }
}
//----------------------------------------------------------
function is_valid_megalla(){

 if(document.megalla_form.megalla_name.value=="" || document.megalla_form.megalla_path.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.megalla_form.submit();return true;
  }
}
//-----------------------------------------------------------
function confirm_delete_megalla(megalla_id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=megalla&megalla_action=edit_megalla&step=2&delete=true&megalla_id="+megalla_id;
 }
}
//-----------------------------------------------------------
function confirm_delete_mohadth(mohadth_id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=mohadth&mohadth_action=edit_mohadth&step=2&delete=true&mohadth_id="+mohadth_id;
 }
}
//-----------------------------------------------------------
function confirm_delete_daleel(daleel_id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=daleel&daleel_action=edit_msg&step=2&delete=true&daleel_id="+daleel_id;
 }
}

//----------------------------------------------------------
function is_valid_lesson(){

 if(document.lesson_form.lesson_name.value=="" || document.lesson_form.lesson_path.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.lesson_form.submit();return true;
  }
}
//----------------------------------------------------------
function is_valid_shikh(){

 if(document.shikh_form.shikh_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.shikh_form.submit();return true;
  }
}

//----------------------------------------------------------
function edit_cat_sub_lessons(){
  parent_cat_id=edit_lesson.parent_cat_id.options[edit_lesson.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=lessons&lessons_action=edit_lesson&step=1&parent_cat_id='+parent_cat_id;
}
//----------------------------------------------------------
function edit_cat_sub_megalla_sections(){
  megalla_id=edit_m_sections.megalla_id.options[edit_m_sections.megalla_id.selectedIndex].value;
  if(megalla_id)
    window.location.href='left_side.php?view=megalla&megalla_action=edit_section&step=1&megalla_id='+megalla_id;
}
//----------------------------------------------------------
function is_valid_section(){

 if(document.section_form.section_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.section_form.submit();return true;
  }
}

//----------------------------------------------------------
function show_fatawa_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=fatawa&fatawa_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function is_valid_mohadth(){

 if(document.mohadth_form.mohadth_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.mohadth_form.submit();return true;
  }
}
//----------------------------------------------------------
function is_valid_new_book(){

 if(document.book_form.book_name.value=="")
  {
     alert("فضلاً أدخل أسم الكتاب ونبذة عنه إن أمكن");return false;
  }
 else
  {
  document.book_form.submit();return true;
  }
}
//----------------------------------------------------------
function is_valid_sunna_def(){

 if(document.sunna_def_form.sunna_def_book.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.sunna_def_form.submit();return true;
  }
}
//----------------------------------------------------------
function is_valid_side(){

 if(document.side_form.side_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.side_form.submit();return true;
  }
}
//----------------------------------------------------------
function is_valid_amount(){

 if(document.amount_form.amount_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.amount_form.submit();return true;
  }
}

//----------------------------------------------------------
function is_valid_period(){

 if(document.period_form.period_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.period_form.submit();return true;
  }
}

//----------------------------------------------------------
function is_valid_type(){

 if(document.type_form.type_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.type_form.submit();return true;
  }
}

//----------------------------------------------------------
function is_valid_degree(){

 if(document.degree_form.degree_name.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.degree_form.submit();return true;
  }
}



//----------------------------------------------------------
function is_valid_sira(){
/*
 if(document.sira_section_form.section_body.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.sira_section_form.submit();return true;
  }*/
}

//----------------------------------------------------------
function edit_cat_sub_sira()
 {
  parent_cat_id=edit_section.parent_cat_id.options[edit_section.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=sira&sira_action=edit_section&step=1&parent_cat_id='+parent_cat_id;
 }


//----------------------------------------------
function Layers(X)
{

		if(document.all[X].style.display == 'none')
		{
			document.all[X].style.display = ''
		}else
		{
			document.all[X].style.display = 'none'
		 }
}

function Layers2(Y)
{

		if(document.all[Y].style.display == 'none')
		{
			document.all[Y].style.display = ''
		}else
		{
			document.all[Y].style.display = 'none'
		 }
}

function val(Parent,Child)
	{
	if(document.form[Parent].checked==true)
		{
		for (i=0 ; i < document.form[Child].length ; i++)
			document.form[Child][i].checked = true ;
		}
	if(document.form[Parent].checked==false)
		{
		for (i=0 ; i < document.form[Child].length ; i++)
			document.form[Child][i].checked = false ;
		}
	}

//-----------------------------------------------------------
function is_valid_block(){
 if(document.block_form.block_title.value!="" )
  {
   document.block_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة  ");return false;
  }
}
//-----------------------------------------------------------
function is_valid_asaneed_form(){
 if(document.asaneed_form.ffname.value!="" && document.asaneed_form.tname.value!="" && document.asaneed_form.sname.value!="" &&
 document.asaneed_form.fname.value!="" && document.asaneed_form.nationality.value!="" && document.asaneed_form.mob.value!="" &&
 document.asaneed_form.code_box.value!="" && document.asaneed_form.tel.value!="" && document.asaneed_form.city.value!="" &&
 document.asaneed_form.work_num.value!="" && document.asaneed_form.code_id.value!="" && document.asaneed_form.fax_num.value!="" &&
  document.asaneed_form.work_side.value!="" && document.asaneed_form.email.value!="" && document.asaneed_form.qualifation.value!=""
 && document.asaneed_form.name.value!=""  && document.asaneed_form.sign.value!=""  )

  {
   document.asaneed_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة  ");return false;
  }
}
//-----------------------------------------------------------
function is_valid_takhreeg_form(){
 if(document.takhreeg_form.ffname.value!="" && document.takhreeg_form.tname.value!="" && document.takhreeg_form.sname.value!="" &&
 document.takhreeg_form.fname.value!="" && document.takhreeg_form.nationality.value!="" && document.takhreeg_form.mob.value!="" &&
 document.takhreeg_form.code_box.value!="" && document.takhreeg_form.tel.value!="" && document.takhreeg_form.city.value!="" &&
 document.takhreeg_form.work_num.value!="" && document.takhreeg_form.code_id.value!="" && document.takhreeg_form.fax_num.value!="" &&
  document.takhreeg_form.work_side.value!="" && document.takhreeg_form.email.value!="" && document.takhreeg_form.qualifation.value!=""
 && document.takhreeg_form.name.value!=""  && document.takhreeg_form.sign.value!=""  )

  {
   document.takhreeg_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة  ");return false;
  }
}
//-----------------------------------------------------------
function is_valid_dnissa_form(){
 if(document.dnissa_form.ffname.value!="" && document.dnissa_form.tname.value!="" && document.dnissa_form.sname.value!="" &&
 document.dnissa_form.fname.value!="" && document.dnissa_form.nationality.value!="" && document.dnissa_form.mob.value!="" &&
 document.dnissa_form.code_box.value!="" && document.dnissa_form.tel.value!="" && document.dnissa_form.city.value!="" &&
 document.dnissa_form.work_num.value!="" && document.dnissa_form.code_id.value!="" && document.dnissa_form.fax_num.value!="" &&
  document.dnissa_form.work_side.value!="" && document.dnissa_form.email.value!="" && document.dnissa_form.qualifation.value!=""
 && document.dnissa_form.name.value!=""  && document.dnissa_form.sign.value!=""  )

  {
   document.dnissa_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة  ");return false;
  }
}
//-----------------------------------------------------------
function is_valid_baha_form(){
 if(document.baha_form.ffname.value!="" && document.baha_form.tname.value!="" && document.baha_form.sname.value!="" &&
 document.baha_form.fname.value!="" && document.baha_form.nationality.value!="" && document.baha_form.mob.value!="" &&
 document.baha_form.code_box.value!="" && document.baha_form.tel.value!="" && document.baha_form.city.value!="" &&
 document.baha_form.work_num.value!="" && document.baha_form.code_id.value!="" && document.baha_form.fax_num.value!="" &&
  document.baha_form.work_side.value!="" && document.baha_form.email.value!="" && document.baha_form.qualifation.value!=""
 && document.baha_form.name.value!=""  && document.baha_form.sign.value!=""  )

  {
   document.baha_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة  ");return false;
  }
}
//-----------------------------------------------------------