<!--
//------------------------------------------------------------------
//------------------------------------------------------------------
function get_search_sub_cats(){
  search_parent_cat_id=SearchForm.search_parent_cat_id.options[SearchForm.search_parent_cat_id.selectedIndex].value;
  if(search_parent_cat_id)
    window.location.href='index.php?search_parent_cat_id='+search_parent_cat_id;
}
//----------------------------------------------------------
function is_valid_share(){

 if(document.share_form.guest_name.value=="" || document.share_form.guest_email.value=="" || document.share_form.guest_share.value=="")
  {
     alert(" أكمل الببانات المطلوبة");return false;
  }
 else
  {
  document.share_form.submit();return true;
  }
}
//------------------------------------------------------------------
function CategoriesChange()
	  {
		for(k=0; k<SearchForm.SubCatName.length; k++)
		SearchForm.SubCatName.options[0]=null;

		var k=-1;
		SubCatNameArray=new Array();
		for (var i=0;i<SubCatArray.length; i++)
		{
			if(SubCatArray[i][0]==SearchForm.CatName.value)
			{
				k++;
				SubCatNameArray[k]=new Array();
				SubCatNameArray[k][0]=SubCatArray[i][1];//إسم الشركة
			}
		}
		//*********************************
		for(k=0; k<SearchForm.SubCatName.length; k++)
		SearchForm.SubCatName.options[0]=null;

		var option= new Array;
		   option[0] = new Option('الكل','')
	//	   SearchForm.SubCatName.options[0]=option[0]
		for(var ii=1; ii<=SubCatNameArray.length; ii++)
		{
		   option[ii] = new Option(SubCatNameArray[ii-1][0], SubCatNameArray[ii-1][0])
		}
		for (var iii=0; iii<=SubCatNameArray.length; iii++)
		{
		   SearchForm.SubCatName.options[iii]=option[iii]
		}
	  }//end of function

	  SubCatArray=new Array(22);

	   SubCatArray[0]=new Array(3);

	   SubCatArray[0][0]='عقارات';

	   SubCatArray[0][1]='تأجير';

	   SubCatArray[1]=new Array(3);

	   SubCatArray[1][0]='عقارات';

	   SubCatArray[1][1]='شراء';

	   SubCatArray[2]=new Array(3);

	   SubCatArray[2][0]='عقارات';

	   SubCatArray[2][1]='بيع';

	   SubCatArray[3]=new Array(3);

	   SubCatArray[3][0]='سيارات';

	   SubCatArray[3][1]='تأجير';

	   SubCatArray[4]=new Array(3);

	   SubCatArray[4][0]='سيارات';

	   SubCatArray[4][1]='شراء';

	   SubCatArray[5]=new Array(3);

	   SubCatArray[5][0]='سيارات';

	   SubCatArray[5][1]='بيع';

	   SubCatArray[6]=new Array(3);

	   SubCatArray[6][0]='وظائف';

	   SubCatArray[6][1]='وقت كامل';

	   SubCatArray[7]=new Array(3);

	   SubCatArray[7][0]='وظائف';

	   SubCatArray[7][1]='من المنزل';

	   SubCatArray[8]=new Array(3);

	   SubCatArray[8][0]='وظائف';

	   SubCatArray[8][1]='نصف وقت';

	   SubCatArray[9]=new Array(3);

	   SubCatArray[9][0]='تكنلوجيا';

	   SubCatArray[9][1]='بيع';

	   SubCatArray[10]=new Array(3);

	   SubCatArray[10][0]='تكنلوجيا';

	   SubCatArray[10][1]='شراء';

	   SubCatArray[11]=new Array(3);

	   SubCatArray[11][0]='هواتف';

	   SubCatArray[11][1]='بيع';

	   SubCatArray[12]=new Array(3);

	   SubCatArray[12][0]='هواتف';

	   SubCatArray[12][1]='تنازل';

	   SubCatArray[13]=new Array(3);

	   SubCatArray[13][0]='هواتف';

	   SubCatArray[13][1]='شراء';

	   SubCatArray[14]=new Array(3);

	   SubCatArray[14][0]='مقتنيات';

	   SubCatArray[14][1]='استعارة';

	   SubCatArray[15]=new Array(3);

	   SubCatArray[15][0]='مقتنيات';

	   SubCatArray[15][1]='بيع';

	   SubCatArray[16]=new Array(3);

	   SubCatArray[16][0]='مقتنيات';

	   SubCatArray[16][1]='شراء';

	   SubCatArray[17]=new Array(3);

	   SubCatArray[17][0]='انترنت';

	   SubCatArray[17][1]='بيع';

	   SubCatArray[18]=new Array(3);

	   SubCatArray[18][0]='انترنت';

	   SubCatArray[18][1]='خدمة';

	   SubCatArray[19]=new Array(3);

	   SubCatArray[19][0]='انترنت';

	   SubCatArray[19][1]='شراء';

	   SubCatArray[20]=new Array(3);

	   SubCatArray[20][0]='الدعوية';

	   SubCatArray[20][1]='بناء';

	   SubCatArray[21]=new Array(3);

	   SubCatArray[21][0]='الدعوية';

	   SubCatArray[21][1]='دعم';

	  SortedSubCatArray=SubCatArray.sort();

//------------------------------------------------------------------
function fx_init(img){
	if(img && img.filters && img.filters[0]){
		img.filters[0].apply();
		img.filters[0].play();
	}
}
function fx_over(img){
	if(img && img.filters && img.filters[0]){
		img.filters[0].apply();
		img.filters[0].play();
	}
}
function high(img){
	if(img && img.filters && img.filters.alpha){
		img.filters.alpha.opacity=60;
		if (window.highlighting)
			clearInterval(highlighting);
	}
}

function low(img){
	if(img.filters){
		tmp = img;
		highlighting=setInterval("chlight(tmp)",50)
	}
}
function chlight(img){
	if(img.filters && img.filters.alpha){

		if (img.filters.alpha.opacity<100){
			img.filters.alpha.opacity+=4;
		}else{
			if (window.highlighting)
				clearInterval(highlighting);
		}
	}
}
// EOF

function open_page(new_url)
{
LeftPosition = (screen.width) ? (screen.width-700)/2 : 0;
TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
settings="status=0,toolbar=0,width=700,height= 430 , top="+TopPosition+", left="+LeftPosition+", scrollbars=yes resizeable=no";
window.open (new_url,"search_result",settings);
}
//---------------------------------------
function open_new_page(new_url)
{
LeftPosition = (screen.width) ? (screen.width-500)/2 : 0;
TopPosition = (screen.height) ? (screen.height-330)/2 : 0;
settings="status=0,toolbar=0,width=500,height= 330 , top="+TopPosition+", left="+LeftPosition+", scrollbars=yes resizeable=no";
window.open (new_url,"student_details",settings);
}

/**
 *
 * @access public
 * @return void
 **/
function open_small_page(new_url){
LeftPosition = (screen.width) ? (screen.width-400)/2 : 0;
TopPosition = (screen.height) ? (screen.height-250)/2 : 0;
settings="status=0,toolbar=0,width=400,height= 250 , top="+TopPosition+", left="+LeftPosition+", scrollbars=yes resizeable=no";
window.open (new_url,"view",settings);
}

//----------------------------------------------------------
_editor_url="include/html/";
var win_ie_ver=parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.studentAgent.indexOf('Mac')        >= 0){win_ie_ver=0;}
if (navigator.studentAgent.indexOf('Windows CE') >= 0){win_ie_ver=0;}
if (navigator.studentAgent.indexOf('Opera')      >= 0){win_ie_ver=0;}
if (win_ie_ver >= 5.5) {
document.write('<scr'+'ipt src="'+_editor_url+'editor.js"');
document.write('language="Javascript1.2"></scr' +'ipt>');
}else{document.write('<scr'+'ipt>function editor_generate(){ return false; }</scr'+'ipt>');
}
//-----------------------------------------------------------
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 show_part_details()
 {
  part_number=main.sections.options[main.sections.selectedIndex].value;
  if(part_number)
    window.location.href='index.php?view=sections&sections_action=show_part_details&part_number='+part_number;
 }
//*********************************************
function is_valid_register(){
 if(document.register_form.student_name.value!=""  && document.register_form.pwd.value!="" && document.register_form.pwd_conf.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_teacher_register(){
 if(document.teacher_register_form.teacher_name.value!=""  && document.teacher_register_form.pwd.value!="" && document.teacher_register_form.pwd_conf.value!="" )
  {
   if(document.teacher_register_form.pwd.value==document.teacher_register_form.pwd_conf.value)
    {
        document.teacher_register_form.submit();return true;
	}
   else
	{
     alert("كلمة المرور لا تتوافق");return false;
	}
  }
 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_teacher_login(){
 if(document.login_form.teacher_name.value !="" && document.login_form.password.value !="" )
  {
   document.login_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}

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

//----------------------------------------------------------
function is_vaild_comment(){
 if(document.commentform.auther.value!="" && document.commentform.country.value!="" && document.commentform.comment.value!="")
  {
   document.commentform.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة ");
   return false;
  }
}
//-------------------------------------------------------------
/**
 *
 * @access public
 * @return void
 **/
function is_valid_e3lan(){
 if(document.e3lan_form.e3lan_name.value!=""   && document.e3lan_form.price.value!=""
   && document.e3lan_form.small_des.value!=""   && document.e3lan_form.large_des.value!=""
   && document.e3lan_form.syear.value!="" &&document.e3lan_form.eyear.value!="" )
  {
   e3lan_form.submit(); return true;
  }
 else
 {
  alert("أكمل الحقول الفارغة من فضلك "); return false;
 }
}
//----------------------------------------------------
/**
 *
 * @access public
 * @return void
 **/
function get_day(){

<!-- This script and many more are available online from -->

<!-- The JavaScript Source!! http://javascriptsource.com -->



<!-- Begin

var day="";

var month="";

var myweekday="";

var year="";

mydate = new Date();

myday = mydate.getDay();

mymonth = mydate.getMonth();

myweekday= mydate.getDate();

weekday= myweekday;

myyear= mydate.getYear();

year = myyear

if(myday == 0)

day = " الأحد, "

else if(myday == 1)

day = " الأثنين, "

else if(myday == 2)

day = " الثلاثاء, "

else if(myday == 3)

day = " الاربعاء, "

else if(myday == 4)

day = " الخميس, "

else if(myday == 5)

day = " الجمعة, "

else if(myday == 6)

day = " السبت, "

if(mymonth == 0) {

month = "يناير "}

else if(mymonth ==1)

month = "فبراير "

else if(mymonth ==2)

month = "مارس "

else if(mymonth ==3)

month = "ابريل "

else if(mymonth ==4)

month = "مايو "

else if(mymonth ==5)

month = "يونيو "

else if(mymonth ==6)

month = "يوليو "

else if(mymonth ==7)

month = "اغسطس "

else if(mymonth ==8)

month = "سبتمبر "

else if(mymonth ==9)

month = "اكتوبر "

else if(mymonth ==10)

month = "نوفمبر "

else if(mymonth ==11)

month = "ديسمبر "
// End -->
document.write("<b><font face=Tahoma size=1>" + day +myweekday   );
document.write(month + ", " + year + "</font></b>");
}
//-----------------------------------------------------------------
/**
 *
 * @access public
 * @return void
 **/
function is_valid_cat(){
 if(document.cat_form.cat_name.value!="")
  {
   cat_form.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";
		}
	}

//----------------------------------------------------------
/**
 *
 * @access public
 * @return void
 **/
function edit_cat_e3lanat(){
  cat_id=edit_e3lan.cat_id.options[edit_e3lan.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=e3lanat&e3lanat_action=edit_e3lan&step=1&cat_id='+cat_id;
}
//--------------------------------------------------------------
//--------------------------------------------------------------
function is_valid_student(){
 if(document.addstudent_form.student_name.value!=""
   && document.addstudent_form.pwd.value!="" && document.addstudent_form.pwd_conf.value!="" )
  {
   if(document.addstudent_form.pwd.value==document.addstudent_form.pwd_conf.value)
    {
        document.addstudent_form.submit();return true;
	}
   else
	{
     alert("كلمة المرور لا تتوافق");return false;
	}
  }
 else
  {
     alert("أدخل البيانات كاملة");return false;
  }
}
//--------------------------------------------------------------
function is_valid_teacher(){
 if(document.addteacher_form.teacher_name.value!=""
   && document.addteacher_form.pwd.value!="" && document.addteacher_form.pwd_conf.value!="" )
  {
   if(document.addteacher_form.pwd.value==document.addteacher_form.pwd_conf.value)
    {
        document.addteacher_form.submit();return true;
	}
   else
	{
     alert("كلمة المرور لا تتوافق");return false;
	}
  }
 else
  {
     alert("أدخل البيانات كاملة");return false;
  }
}
//-----------------------------------------------------------
function confirm_delete_student(student_id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=edit_students&students_action=do_delete&student_id="+student_id;
 }
}
//-----------------------------------------------------------
function confirm_delete_teacher(teacher_id){
if(confirm("سوف يتم حذف السجل , هل أنت متأكد ؟ "))
 {
 location.href="left_side.php?view=edit_teachers&teachers_action=do_delete&teacher_id="+teacher_id;
 }
}

//------------------------------------------------------------
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 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 show_e3lanat_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=e3lanat&e3lanat_action=show_part_details&cat_id='+cat_id;
 }
//----------------------------------------------------------
function change_cat_details_add(){
  cat_id=e3lan_form.cat_id.options[e3lan_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=my_control&control_action=add_e3lan&step=1&cat_id='+cat_id;
}
//----------------------------------------------------------
function change_cat_details_edit(){
  cat_id=e3lan_form.cat_id.options[e3lan_form.cat_id.selectedIndex].value;
  e3lan_id=e3lan_form.e3lan_id.value;
  if(cat_id)
    window.location.href='index.php?view=my_control&control_action=edit_e3lan&edit=true&step=1&cat_id='+cat_id+'&e3lan_id='+e3lan_id;
}
//----------------------------------------------------------
function change_cat_details_add_admin(){
  cat_id=e3lan_form.cat_id.options[e3lan_form.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='left_side.php?view=e3lanat&e3lanat_action=add_e3lan&step=1&cat_id='+cat_id;
}
//----------------------------------------------------------
function change_cat_details_edit_admin(){
  cat_id=e3lan_form.cat_id.options[e3lan_form.cat_id.selectedIndex].value;
  e3lan_id=e3lan_form.e3lan_id.value;
  if(cat_id)
    window.location.href='left_side.php?view=e3lanat&e3lanat_action=edit_e3lan&step=2&edit=true&cat_id='+cat_id+'&e3lan_id='+e3lan_id;
}
//----------------------------------------------------------
function get_adde3lan_sub_cats_admin(){
  parent_cat_id=e3lan_form.parent_cat_id.options[e3lan_form.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=e3lanat&e3lanat_action=add_e3lan&step=1&parent_cat_id='+parent_cat_id;
}
//------------------------------------------------------------------
function Check()
	{
		if(CashData.hewala_no.value=="")
		{
			alert("من فضلك أدخل رقم الحوالة");
			return;
		}
		//////////////////////////////////
		if(CashData.sender_name.value=="")
		{
			alert("من فضلك أدخل إسم الراسل");
			return;
		}
		//////////////////////////////////
		if(CashData.cash_ammount.value=="")
		{
			alert("من فضلك أدخل المبلغ");
			return;
		}

		//////////////////////////////////
		CashData.submit();
	}//end of function
//------------------------------------------------------------
	function ValidateNumScript(Value)
	{
		Found = Value.match(/^[0-9]+$/i);
		if(  (Found==null)  &&  (Value!="")  )
		{
			alert("wrong age");
			Valuelen=Value.length;
			Valuelen--;
			NewValue=Value.substr(0,Valuelen);
			return NewValue;
		}
		else
		{
			return Value;
		}
	}//end of function
		function ValidateNumFloatScript(Value)
	{
		Found = Value.match(/^[0-9,.]+$/i);
		if(  (Found==null)  &&  (Value!="") )
		{
			Valuelen=Value.length;
			Valuelen--;
			NewValue=Value.substr(0,Valuelen);
			return NewValue;
		}
		else
		{
			return Value;
		}
	}//end of function
//----------------------------------------------------------
function isvalid_search(){
   if(document.searchform.search_word.value=="")
    {window.alert("أدخل كلمة البحث ");return false;}
   else
    {document.searchform.submit();return true;}
 }
//----------------------------------------------------------
function isvalid_matger(){
   if(document.matger_form.matger_name.value=="" || document.matger_form.matger_title.value=="")
    {window.alert("أدخل إسم متجرك ");return false;}
   else
    {document.matger_form.submit();return true;}
 }
//----------------------------------------------
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 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 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.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//--------------------------------------------------
//------------------------------------------------------
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 get_admin_student_matger(){
  student_id=matger_form.student_id.options[matger_form.student_id.selectedIndex].value;
  if(student_id)
    window.location.href='left_side.php?view=shops&shops_action=pre_shop&step=1&student_id='+student_id;
}
//---------------------------------------------------------------
function is_valid_settings(){
if(document.settings_form.material_title.value !=""   && document.settings_form.contactus_to.value !="" && document.settings_form.max_ads_show_center.value !=""
  )
  {
   	 document.settings_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//---------------------------------------------------------------
function is_valid_country(){
if(document.country_form.country_name.value !="" )
  {
   	 document.country_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//----------------------------------------------------------
function show_materials_part_details()
 {
  cat_id=parts.cat_id.options[parts.cat_id.selectedIndex].value;
  if(cat_id)
    window.location.href='index.php?view=browse&cat_id='+cat_id;
 }
 //--------------------------------------
function is_valid_bad_link()
{
if (bad_link_form.sender_name.value=="" || bad_link_form.message.value=="" )
 {
 alert(" أكمل البيانات المطلوبة ");
 return false;
 }
else
 {
    bad_link_form.submit();
    return true;
 }
}
//----------------------------------------------------------
function is_valid_material(){
 if(document.material_form.material_name.value!="" && document.material_form.material_grade.value!="")
  {
   document.material_form.submit();
   return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------------
function edit_cat_sub_materials () {
  parent_cat_id=edit_material.parent_cat_id.options[edit_material.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=materials&materials_action=edit_material&step=1&parent_cat_id='+parent_cat_id;
}
//*******************************************************
function edit_cat_sub_materials_casse1 () {
  parent_cat_id=edit_material.parent_cat_id.options[edit_material.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=materials&materials_action=add_marks&step=1&parent_cat_id='+parent_cat_id;
}
//*******************************************************
function edit_cat_sub_materials_teachers () {
  parent_cat_id=edit_material.parent_cat_id.options[edit_material.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=edit_teachers&teachers_action=activate_materials&step=1&parent_cat_id='+parent_cat_id;
}
//*******************************************************
function edit_cat_sub_materials_casse2 () {
  parent_cat_id=edit_material.parent_cat_id.options[edit_material.parent_cat_id.selectedIndex].value;
  if(parent_cat_id)
    window.location.href='left_side.php?view=edit_students&students_action=add_marks&step=1&parent_cat_id='+parent_cat_id;
}
//*******************************************************
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_require(){
if(document.require_form.require_name.value !="" )
  {
   	 document.require_form.submit();
     return true;
  }
 else
 {
  alert("أكمل البيانات المطلوبة");
  return false;
 }
}
//---------------------------------------------------------------
function is_valid_change(){
 if( document.change_account_form.old_password.value !="" && document.change_account_form.new_password.value !=""
 && document.change_account_form.conf_new_password.value !=""  )
  {
   if(document.change_account_form.new_password.value == document.change_account_form.conf_new_password.value)
    {
	 document.change_account_form.submit();
     return true;
    }
    else
	{
	 alert("كلمات المرور غير متوافقة");return false;
	}
  }
 else
 {
  alert("أكمل البيانات المطلوبة");return false;
 }
}
//----------------------------------------------------
function get_num_teachers(){
  teachers_num=addteacher_form.teachers_num.options[addteacher_form.teachers_num.selectedIndex].value;
  if(teachers_num)
    window.location.href='left_side.php?view=edit_teachers&teachers_action=add&step=1&teachers_num='+teachers_num;
}
//----------------------------------------------------
function get_num_materials(){
  materials_num=material_form.materials_num.options[material_form.materials_num.selectedIndex].value;
  if(materials_num)
    window.location.href='left_side.php?view=materials&materials_action=add&step=1&materials_num='+materials_num;
}
//----------------------------------------------------
function get_num_students(){
  students_num=student_form.students_num.options[student_form.students_num.selectedIndex].value;
  if(students_num)
    window.location.href='left_side.php?view=edit_students&students_action=add&step=1&students_num='+students_num;
}
//------------------------------------------------------
function is_valid_sendprog(){
 if(document.send_form.message.value!="" && document.send_form.email.value!="")
  {
   document.send_form.submit();return true;
  }
 else
  {
   alert(" أكمل البيانات المطلوبة ");
   return false;
  }
}
