// JavaScript Document

//------------------------------------
function submitGuestForm()	
	{
	if (frmGuest.txtName.value=="")
		alert ("!الرجاء كتابة الاسم");
	else if (frmGuest.txtComments.value=="")
		alert ("!الرجاء كتابة تعليقك");
	else
		return true;
	return false;
	}


function submitContactForm()	
	{
	if (frmContact.txtName.value=="")
		alert ("!الرجاء كتابة الاسم");
	else if (frmContact.txtEmail.value=="")
		alert ("!الرجاء كتابة البريد الإلكتروني");
	else if (frmContact.txtComments.value=="")
		alert ("!الرجاء كتابة تعليقك");
	else if (frmContact.txtMobile.value=="")
		alert ("!الرجاء كتابة رقم هاتفك الصحيح");
	else
		return true;
	return false;
	}

//------------------------------------
function submitLectureForm()	
	{
	if (frmLecture.txtTitle.value=="")
		alert ("!الرجاء كتابة العنوان")
	else if (frmLecture.txtType.value=="0")
		alert ("!اختر القسم الفرعي المناسب")
	else if (frmLecture.txtEnDate.value=="")
		alert ("!الرجاء كتابة التاريخ الميلادي")
	else if (frmLecture.txtDetails.value=="")
		alert ("!الرجاء كتابة التفاصيل")
	else
		return true; 
	return false;
	}

//------------------------------------
function submitOptionsForm()	
	{
	if (frmOptions.txtPass.value=="")
		alert ("!لا تجعل حق الكلمة السرية فارغا")
	
		return true; 
	return false;
	}
//------------------------------------
function goCat()
	{
	url = "?start=0&cat=" + frmCats.mainCats.options(frmCats.mainCats.selectedIndex).value;
	window.location = url;
	}


//------------------------------------
function swap2(img1, img2, LayerName)
{
	if (LayerName.style.display=='none')
		{
			document.images[img1].src=eval(img2+".src");		
		}		
}

//------------------------------------
function ShowLayer(LayerName, img0)
{
	if (LayerName.style.display=='none')
		{
		LayerName.style.display='';
		document.images[img0].src=eval(img0+"_on.src");
		}
	else
		{
		LayerName.style.display='none';
		document.images[img0].src=eval(img0+"_off.src");		
		}	
}

//------------------------------------
function printThis(id)
	{
		var w = 550;
		var h=570;		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable=0'
		winurl = 'pages.php?page=print&id=' + id
		win = window.open(winurl, 'mywindow', winprops)
	}

//------------------------------------
function submitSendForm()	
	{
	if (frmSend.txtFromName.value=="")
		alert ("!الرجاء كتابة اسمك")
	else if (frmSend.txtFromEmail.value=="")
		alert ("!الرجاء كتابة بريدك الإلكتروني")
	else if (frmSend.txtToName.value=="")
		alert ("!الرجاء كتابة اسم صديقك")
	else if (frmSend.txtToEmail.value=="")
		alert ("!الرجاء كتابة بريد صديقك")
	else
		return true; 
	return false;
	}

//------------------------------------
function submitListForm()
	{
	if (frmList.txtEmail.value=="")
		alert ("!الرجاء كتابة بريدك الإلكتروني")
	else
		return true; 
	return false;		
	}
	
//------------------------------------
function submitAnswerForm()
	{
	if (frmAnswer.txtQuestion.value=="")
		alert ("!الرجاء ذكر السؤال")
	else if (frmAnswer.txtAnswer.value=="")
		alert ("!الرجاء ذكر الجواب")
	else if (frmAnswer.txtType.value=="0")
		alert ("!الرجاء اختيار التصنيف المناسب")
	else
		return true; 
	return false;		
	}

//-------------------------------------
function disableIt(obj)
{
	obj.disabled = !(obj.disabled);
	var z = (obj.disabled) ? 'disabled' : 'enabled';
}

//------------------------------------
function submitMainCat()
	{
	if (frmMain.txtNameMain.value=="")
		alert ("!الرجاء كتابة اسم التصنيف")
	else
		return true; 
	return false;		
	}

//------------------------------------
function submitSubCat()
	{
	if (frmSub.txtNameSub.value=="")
		alert ("!الرجاء كتابة اسم التصنيف")
	else if (frmSub.txtSubCat.value=="0")
		alert ("!الرجاء اختيار التصنيف الفرعي")
	else
		return true; 
	return false;		
	}


//----------------------------------
function submitMainDel()
	{
	if (frmMain.txtCat2.value=="0")
		alert ("!الرجاء اختيار التصنيف")
	else
		return true; 
	return false;		
	}

//----------------------------------
function submitSubDel()
	{
	if (frmSub.txtCat2.value=="0")
		alert ("!الرجاء اختيار التصنيف الفرعي")
	else
		return true; 
	return false;		
	}

//----------------------------------
function submitDelForm()
	{
	if (frmDel.txtCat.value=="0")
		alert ("!الرجاء اختيار التصنيف المناسب")
	else
		return true; 
	return false;		
	}


//----------------------------------
function submitBookForm()
	{
	if (frmBook.txtName.value=="")
		alert ("!الرجاء كتابة اسم الكتاب")
	else if (frmBook.txtPhoto.value=="")
		alert ("!الرجاء ذكر غلاف الكتاب")
	else if (frmBook.txtSrc.value=="")
		alert ("!الرجاء ذكر رابط الكتاب")
	else
		return true; 
	return false;		
	}


//------------------------------------
function trim(value) {
   var temp = value;
   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = /  /g;
   while (temp.match(obj)) { temp = temp.replace(obj, " "); }
   return temp;
}

//------------------------------------
function submitSearchForm()
	{
	searchBox = frmSearch.txtKeyWord
	if (searchBox.value=="")
		alert ("الرجاء كتابة كلمة البحث")
	else if (trim(searchBox.value) == " ")
		alert ("الرجاء كتابة كلمة بحث كاملة")
	else if (trim(searchBox.value).length < 4)
		alert ("الرجاء كتابة كلمة بحث كاملة")
	else
		return true; 
	searchBox.value="";
	searchBox.focus();
	return false;			
	}
	
//------------------------------------
function goMediaCat()
	{
	url = "?start=0&cat=" + frmMediaCats.mainCats.options(frmMediaCats.mainCats.selectedIndex).value;
	window.location = url;
	}
function goAllMediaCat()
	{
	url = "?p=Media&start=0&cat=" + frmAllMediaCats.mainCats.options(frmMediaCats.mainCats.selectedIndex).value;
	window.location = url;
	}
//------------------------------------
function delMedia(id)
	{	
	response = confirm("هل تريد فعلا حذف هذا الملف الصوتي؟");
	if (response) window.location = '?action=del&id=' + id;
	}

//----------------------------------
function submitMediaForm()
	{
	if (frmMedia.txtName.value=="")
		alert ("!الرجاء كتابة الاسم")
	else if (frmMedia.txtCat.value==0)
		alert ("!الرجاء اختيار التصنيف")
	else if (frmMedia.txtLen.value=="")
		alert ("!الرجاء ذكر المدة")
	else
		return true; 
	return false;		
	}

//------------------------------------
function goVideoCat()
	{
	url = "?p=video&start=0&cat=" + frmVideoCats.mainCats.options(frmVideoCats.mainCats.selectedIndex).value;
	window.location = url;
	}
	
//------------------------------------
function delVideo(id)
	{	
	response = confirm("هل تريد فعلا حذف هذا الملف المرئي؟");
	if (response) window.location = '?action=del&id=' + id;
	}

//----------------------------------
function submitVideoForm()
	{
	if (frmVideo.txtName.value=="")
		alert ("!الرجاء كتابة الاسم")
	else if (frmVideo.txtCat.value==0)
		alert ("!الرجاء اختيار التصنيف")
	else if (frmVideo.txtLen.value=="")
		alert ("!الرجاء ذكر المدة")
	else
		return true; 
	return false;		
	}

//------------------------------------
function submitListForm()
	{
	emailBox = frmList.txtEmail
	eMail = document.frmList.txtEmail.value;
	
	if (eMail == "")
		alert ("! الرجاء كتابة بريدك الإلكتروني");
	else if (eMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
		alert ("! الرجاء التأكد من البريد الإلكتروني");
	else
		return true;
	
	emailBox.value="";
	emailBox.focus();
	return false;
	}

//---------------------------mailling list

//------------------------------------
function goLinksCat()
	{
	url = "?start=0&cat=" + frmLinksCats.mainCats.options(frmLinksCats.mainCats.selectedIndex).value;
	window.location = url;
	}

function goAllLinksCat()
	{
	url = "?p=links&start=0&cat=" + frmLinksCats.mainCats.options(frmLinksCats.mainCats.selectedIndex).value;
	window.location = url;
	}

//------------------------------------
function delUser(usrID, start, cat)
	{
	response = confirm("هل تريد فعلاً حذف هذا المشترك؟");
	if (response) window.location = "?id=" + usrID + "?>&start=" + start + "&action=del&cat=" + cat
	}

//------------------------------------
function selectAll()
	{
		if (document.frmMsg.chkAll.checked)
			{
				document.frmMsg.chkSub.checked = true;
				document.frmMsg.chkMale.checked = true;
				document.frmMsg.chkFemale.checked = true;
			}
		else if (document.frmMsg.chkFemale.checked && document.frmMsg.chkMale.checked && 

document.frmMsg.chkSub.checked)
				document.frmMsg.chkAll.checked = true;
			
	}

//------------------------------------
function deSelectAll(check)
	{
			if (check.checked==false)
				document.frmMsg.chkAll.checked = false;
			else if (document.frmMsg.chkFemale.checked && document.frmMsg.chkMale.checked && 

document.frmMsg.chkSub.checked)
				document.frmMsg.chkAll.checked = true;				
	}

//------------------------------------
function submitMsgForm()
	{
		if (! (frmMsg.chkAll.checked || frmMsg.chkSub.checked || frmMsg.chkMale.checked || 

frmMsg.chkFemale.checked) )
			alert ("! الرجاء اختيار الفئة التي تود الإرسال إليها");
		else if (frmMsg.txtTitle.value=="")
			alert ("! الرجاء ذكر عنوان الرسالة");
		else if (frmMsg.txtDetails.value=="")
			alert ("! الرجاء ذكر نص الرسالة");
		else
			return true;
		return false;
	}

//------------------------------------
function delMsg(msgID, start)
	{
	response = confirm("هل تريد فعلاً حذف هذه الرسالة من الأرشيف؟");
	if (response) window.location = "?id=" + msgID + "?>&start=" + start + "&action=del"
	
	}
	
	//------------------------------------
function submitListForm2()
	{
	emailBox = frmList.txtEmail
	eMail = document.frmList.txtEmail.value;
	
	if (eMail == "")
		alert ("! الرجاء كتابة البريد الإلكتروني");
	else if (eMail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
		alert ("! الرجاء التأكد من البريد الإلكتروني");
	else if ( frmList.txtCat.options(frmList.txtCat.selectedIndex).value>1 && document.frmList.txtName.value=="" )
		alert ("! الرجاء كتابة اسم الطالب/الطالبة")
	else
		return true;
	
	return false;
	}
//---------------------------- end mailling list
//------------------------------------
function printNew()
	{
		var w = 640;
		var h=364;		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable=0'
		win = window.open('qprint.php', 'mywindow', winprops)
	}

//------------------------------------
function delPost(postID, start)
	{
	response = confirm("هل تريد فعلاً حذف هذه المشاركة؟");
	if (response) window.location = "?id=" + postID + "?>&start=" + start + "&action=del"
	}




//------------------------------------
function delHekma(bnrID)
	{
	response = confirm("هل تريد فعلاً حذف هذه الحكمة؟");
	if (response) window.location = "?action=del&hekmaID=" + bnrID
	}

//------------------------------------

function delTopic(id, start, cat)
	{	
	response = confirm("هل تريد فعلاً حذف هذا الموضوع؟");
	if (response) window.location = '?action=del&lecID=' + id + '&start=' + start + '&cat=' + cat;
	}
	//------------------------------------
function delLink(id, cat)
	{	
	response = confirm("هل تريد فعلاً حذف هذا الرابط؟");
	if (response) window.location = '?action=del&linkID=' + id + '&cat=' + cat;
	}

//------------------------------------
function submitLinkForm()
	{
	if (frmLink.txtName.value=="")
		alert ("!الرجاء كتابة إسم الموقع");
	else if (frmLink.txtURL.value=="")
		alert ("!الرجاء كتابة رابط الموقع");
	else
		return true;
	return false;		
	}


//------------------------------------
function goLinksCat()
	{
	url = "?start=0&cat=" + frmLinksCats.mainCats.options(frmLinksCats.mainCats.selectedIndex).value;
	window.location = url;
	}
//------------------------------------
function sendThis(lecID)
	{
		var w = 565;
		var h= 247;		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable=0'
		winurl = 'send.php?lecID=' + lecID
		win = window.open(winurl, 'mywindow', winprops)
	}
		//------------------------------------
function delSms(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا الرقم؟");
	if (response) window.location = '?action=del&smsID=' + id;
	}
//----------------------------------
function submitSmsForm()
	{
	if (frmSms.txtName.value=="")
		alert ("!الرجاء كتابة الاسم الثلاثي")
	else if (frmSms.txtSex.value==0)
		alert ("!الرجاء اختيار الجنس")
	else if (frmSms.txtMobile.value=="")
		alert ("!الرجاء كتابة رقم الموبايل")
	else
	if (frmSms.txtCountry.value=="")
		alert ("!الرجاء كتابة إسم دولتك")
	else
	if (frmSms.txtQaryah.value=="")
		alert ("!الرجاء كتابة إسم مدينتك / قريتك")
	else
			return true; 
	return false;		
	}

//------------------------------------

function submitAlsalatForm()	
	{
	if (frmAlsalat.txtDate.value=="")
		alert ("!الرجاء كتابة التاريخ الميلادي")
	else 
if (frmAlsalat.txtHdate.value=="")
		alert ("!الرجاء كتابة التاريخ الهجري")
	else 
if (frmAlsalat.txtDay.value=="")
		alert ("!الرجاء إسم اليوم")
	else 
if (frmAlsalat.txtFajr.value=="")
		alert ("!الرجاء كتابة أوقات صلاة الصبح")
	else 
if (frmAlsalat.txtShurooq.value=="")
		alert ("!الرجاء كتابة أوقات الشروق")
	else 
if (frmAlsalat.txtThuhr.value=="")
		alert ("!الرجاء كتابة أوقات صلاة الظهرين")
	else 
if (frmAlsalat.txtGhuroob.value=="")
		alert ("!الرجاء كتابة أوقات الغروب")
	else
if (frmAlsalat.txtEshaain.value=="")
		alert ("!الرجاء كتابة أوقات صلاة العشائين")
	else  
		return true; 
	return false;
	}
//--------------------------------------
function delAlsalat(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الأوقات؟");
	if (response) window.location = '?action=del&alsalatID=' + id;
	}
//--------------------------------------
function delAlhussainia(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الفعالية؟");
	if (response) window.location = '?action=del&alhussainiaID=' + id;
	}
	
	//------------------------------------
function goMasaelCat()
	{
	url = "?p=masala&cat=" + frmMasaelCats.mainCats.options(frmMasaelCats.mainCats.selectedIndex).value;
	window.location = url;
	}

//------------------------------------
function delMasael(id)
	{	
	response = confirm("هل تريد فعلا حذف هذه المسألة؟");
	if (response) window.location = '?action=del&id=' + id;
	}

//----------------------------------
function submitMasaelForm()
	{
	if (frmMasael.txtSoaal.value=="")
		alert ("!الرجاء كتابة السؤال")
	else if (frmMasael.txtCat.value==0)
		alert ("!الرجاء اختيار التصنيف")
	else if (frmMasael.txtGawab.value=="")
		alert ("!الرجاء كتابة الجواب")
	else
	 if (frmMasael.txtDate.value=="")
		alert ("!الرجاء كتابة التاريخ")
	else
		return true; 
	return false;		
	}
//------------------------------------
function OpenThis(ID)
	{
		var w = 604;
		var h=537;		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable=0'
		winurl = 'malthekropen.php?ID=' +ID
		win = window.open(winurl, 'mywindow', winprops)
	}




//------------------------------------
function submitVoteForm()
	{
	if (frmVote.txtName.value=="")
		alert ("!الرجاء كتابة اسم التصويت");
	else if (frmVote.txtQuestion.value=="")
		alert ("!الرجاء كتابة السؤال");
	else if (frmVote.txtAnswer[0].value=='')
		alert ("!الرجاء ذكر إجابتين على الأقل");
	else if (frmVote.txtAnswer[1].value=='')
		alert ("!الرجاء ذكر إجابتين على الأقل");
	else 
		{
		results = '';
		votes = '';		
		for (i=0; i<5; i++)
			if (frmVote.txtAnswer[i].value!='')
				{
				results += frmVote.txtAnswer[i].value + '|';			
				votes += "0|";			
				}
		frmVote.txtAnswers.value = results.substring(0, results.length-1);
		frmVote.txtVotes.value = votes.substring(0, votes.length-1);
		return true; 
		}
	return false;
	}

//------------------------------------
function delVote(id)
	{	
	msg = "هل تريد فعلاً حذف هذا التصويت؟";
	response = confirm(msg);
	if (response) window.location = '?action=del&vID=' + id;
	}
	

//------------------------------------
function submitUserVoteForm()
	{
	for (i=0; i<frmVote.txtVotes.length; i++)
		if (frmVote.txtVotes[i].status)
			{
			frmVote.txtChoice.value= i;
			return true;
			}
	alert ("!الرجاء تحديد أحد الخيارات");
	return false;
	}
//------------------------------------
function submitCatLinksForm()
	{
	if (frmCatLinks.txtName.value=="")
		alert ("!الرجاء كتابة اسم التصنيف");
	else
		return true;
	return false;		
	}

//------------------------------------
function editCat(id, name)
	{
		document.frmCatLinks.txtName.value=name;
		document.frmCatLinks.txtID.value=id;
		document.frmCatLinks.btnSubmit.value='تحديث تصنيف';
	}

//------------------------------------
function delCatLinks(id)
	{	
	msg = "هل تريد فعلاً حذف هذا التصنيف؟";
	response = confirm(msg);
	if (response) window.location = 'delLinksCat.php?cat=' + id;
	}

//------------------------------------
function delLinkscat(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا التصنيف؟");
	if (response) window.location = '?action=del&linkscatID=' + id;
	}
	
//----------------------------------

function submitBannersForm()	
	{
	if (frmBanners.txtName.value=="")
		alert ("!الرجاء كتابة الاسم")
	else if (frmBanners.txtSrc.value=="")
		alert ("!الرجاء وضع الإعلان")

		return true; 
	return false;		
	}
//------------------------------------
function delBanner(bnrID)
	{
	response = confirm("هل تريد فعلاً حذف هذا الإعلان؟");
	if (response) window.location = "?action=del&bannerID=" + bnrID
	}
	
	
//------------------------------------
function submitCatPicsForm()
	{
	if (frmCatPics.txtName.value=="")
		alert ("!الرجاء كتابة اسم القسم");
	else
		return true;
	return false;		
	}

//------------------------------------
function editCat(id, name)
	{
		document.frmCatPics.txtName.value=name;
		document.frmCatPics.txtID.value=id;
		document.frmCatPics.btnSubmit.value='تحديث قسم';
	}


//------------------------------------
function delPicscat(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا القسم؟");
	if (response) window.location = '?action=del&picsscatID=' + id;
	}
	
//------------------------------------
function goPicsCat()
	{
	url = "?start=0&cat=" + frmPicsCats.mainCats.options(frmPicsCats.mainCats.selectedIndex).value;
	window.location = url;
	}

function goAllPicsCat()
	{
	url = "?p=pics&start=0&cat=" + frmPicsCats.mainCats.options(frmPicsCats.mainCats.selectedIndex).value;
	window.location = url;
	}


	//------------------------------------
function delPics(id, cat)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الصورة؟");
	if (response) window.location = '?action=del&picsID=' + id + '&cat=' + cat;
	}

//------------------------------------
function submitPicsForm()
	{
	if (frmPics.txtName.value=="")
		alert ("!الرجاء كتابة إسم الصورة");
	else if (frmPics.txtImg.value=="")
		alert ("!الرجاء كتابة عنوان الصورة");
	else
		return true;
	return false;		
	}


//------------------------------------
function submitAdvForm()	
	{
	if (frmAdv.txtTitle.value=="")
		alert ("!الرجاء كتابة العنوان")
	else 
	if (frmAdv.txtImg.value=="")
		alert ("!الرجاء كتابة رابط العرض")
	else
		return true; 
	return false;
	}
//------------------------------------
function delAdv(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا العرض؟");
	if (response) window.location = '?action=del&ID=' + id;
	}

//------------------------------------
function submitMobileForm()
	{
	if (frmMobile.txtMobile.value=="")
		alert ("!الرجاء كتابة رقم الجوال");
	else
		return true;
	return false;		
	}


//------------------------------------

function delMobile(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا الرقم؟");
	if (response) window.location = '?action=del&txtID=' + id;
	}
	
//------------------------------------
function submitGallerycatForm()	
	{
	if (frmGallerycat.txtName.value=="")
		alert ("!الرجاء كتابة إسم المجموعة")
else
		return true; 
	return false;
	}
//------------------------------------
function editGallerycat(id, name, date, details)
	{
		
		document.frmGallerycat.txtDetails.value=details;		
		document.frmGallerycat.txtDate.value=date;
		document.frmGallerycat.txtName.value=name;
		document.frmGallerycat.txtID.value=id;
		document.frmGallerycat.btnSubmit.value='تحديث';
	}
//------------------------------------
function delGallerycat(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه المجموعة؟");
	if (response) window.location = '?action=del&ID=' + id;
	}
//------------------------------------
function editGallery(id, file, commant, date)
	{
	    document.frmGallery.txtDate.value=date;
		document.frmGallery.txtCommant.value=commant;
		document.frmGallery.txtFile.value=file;
		document.frmGallery.txtID.value=id;
		document.frmGallery.btnSubmit.value='تحديث';
	}
//------------------------------------
function delGallery(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الصورة؟");
	if (response) window.location = '?action=del&ID=' + id;
	}
	
//------------------------------------
function editCourse(id, course, details, cat, type)
	{
		document.frmCourses.txtType.value=type;
		document.frmCourses.txtCat.value=cat;
		document.frmCourses.txtDetails.value=details;
		document.frmCourses.txtCourse.value=course;
		document.frmCourses.txtID.value=id;
		document.frmCourses.btnSubmit.value='تحديث';
	}
	//------------------------------------
function delCourse(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الدورة؟");
	if (response) window.location = '?action=del&ID=' + id;
	}	
//------------------------------------
function editCoursesCat(catid, catname, catimg)
	{
	    document.frmCoursesCat.txtID.value=catid;
		document.frmCoursesCat.txtName.value=catname;
		document.frmCoursesCat.txtImg.value=catimg;
		document.frmCoursesCat.btnSubmit.value='تحديث';
	}
//------------------------------------
function delCoursesCat(catid)
	{	
	response = confirm("هل تريد فعلاً حذف هذا القسم؟");
	if (response) window.location = '?action=del&catID=' + catid;
	}
//----------------------------------
function submitCoursesCatForm()
	{
	if (frmCoursesCat.txtName.value=="")
		alert ("!الرجاء كتابة إسم القسم")
			return true; 
	return false;		
	}

//------------------------------------
function editShareek(id, name, file)
	{
		document.frmShareek.txtFile.value=file;
		document.frmShareek.txtName.value=name;
		document.frmShareek.txtID.value=id;
		document.frmShareek.btnSubmit.value='تحديث';
	}
	//------------------------------------
function delShareek(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الشريك؟");
	if (response) window.location = '?action=del&ID=' + id;
	}
//------------------------------------
function editOmalaa(id, name)
	{
		document.frmOmalaa.txtName.value=name;
		document.frmOmalaa.txtID.value=id;
		document.frmOmalaa.btnSubmit.value='تحديث';
	}
	//------------------------------------
function delOmalaa(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه العميل؟");
	if (response) window.location = '?action=del&ID=' + id;
	}
	//------------------------------------	
function submitEmailForm()
	{
	searchBox = frmEmail.txtEmail
	if (emailBox.value=="")
		alert ("الرجاء كتابة بريدك الإلكتروني")
		else
		return true; 
	emailBox.value="";
	emailBox.focus();
	return false;			
	}

//------------------------------------

function delLbnr(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذه الصورة؟");
	if (response) window.location = '?action=del&txtID=' + id;
	}
//------------------------------------

function delMlist(id)
	{	
	response = confirm("هل تريد فعلاً حذا البريد؟");
	if (response) window.location = '?action=del&txtID=' + id;
	}
//------------------------------------
function submitMlistForm()
	{
	if (frmMlist.txtEmail.value=="")
		alert ("!الرجاء كتابة البريد")
	else 
		return true; 
	return false;		
	}
//------------------------------------
function editFaez(id, name, mobile)
	{
		document.frmFaez.txtMobile.value=mobile;
		document.frmFaez.txtName.value=name;
		document.frmFaez.txtID.value=id;
		document.frmFaez.btnSubmit.value='تحديث';
	}
	//------------------------------------
function delFaez(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا المشارك؟");
	if (response) window.location = '?action=del&ID=' + id;
	}
//----------------------------------
function submitFaezForm()
	{
	if (frmFaez.txtName.value=="")
		alert ("!الرجاء كتابة الاسم")
	else if (frmFaez.txtMobile.value=="")
		alert ("!الرجاء كتابة الموبايل")
	else
		return true; 
	return false;		
	}
//------------------------------------
function editFaezeen(id, name, mobile, month, type)
	{
	
		document.frmFaezeen.txtType.value=type;
		document.frmFaezeen.txtMonth.value=month;
		document.frmFaezeen.txtMobile.value=mobile;
		document.frmFaezeen.txtName.value=name;
		document.frmFaezeen.txtID.value=id;
		document.frmFaezeen.btnSubmit.value='تحديث';
	}
	//------------------------------------
function delFaezeen(id)
	{	
	response = confirm("هل تريد فعلاً حذف هذا الفائز؟");
	if (response) window.location = '?action=del&ID=' + id;
	}
//----------------------------------
function submitFaezeenForm()
	{
	if (frmFaezeen.txtName.value=="")
		alert ("!الرجاء كتابة الاسم")
	else
 if (frmFaezeen.txtMobile.value=="")
		alert ("!الرجاء كتابة الموبايل")
	else 
if (frmFaezeen.txtMonth.value=="")
		alert ("!الرجاء كتابة الشهر الذي فاز به المشارك")
	else 
if (frmFaezeen.txttype.value=="")
		alert ("!الرجاء كتابة نوع الجائزة")
	else
		return true; 
	return false;		
	}
//------------------------------------

// Generate Random Image Title
var imgNo= Math.round(Math.random()*9) + 1;
var img = new Array(9);
MainImage = "<img src='img/lbnr/01-" + imgNo + ".gif'>";
SubImage = "<img src='img/lbnr/01-" + imgNo + ".gif'>";

