﻿	<!-- 
	function confirmDelete()
	{
		if(confirm("هل أنت متأكد؟"))
			return true;
		else
			return false;
	}

// This function checks that the day is valid interms of the selected month and year.
// Here the year, month and day, all are drop down menus.
function CheckDayComboWithinMonth(day, month, year, captionName)
	{

		var Mon = new Array(12);
			Mon[1] = 31;
			Mon[2] = 28;
			Mon[3] = 31;
			Mon[4] = 30;
			Mon[5] = 31;
			Mon[6] = 30;
			Mon[7] = 31;
			Mon[8] = 31;
			Mon[9] = 30
			Mon[10] = 31;
			Mon[11] = 30;
			Mon[12] = 31;


		var MaxDay;
		var SelDay;
		var SelYear;
		var RemDiv;
		var result;

		MaxDay = Mon[eval(month[month.selectedIndex].value)];
		SelDay = eval(day[day.selectedIndex].value);
		SelYear = eval(year[year.selectedIndex].value);

		
		if (MaxDay == 28){	// Check if the selected month is February, by checking 
							// its value (if=28 then Feb is selected).
			RemDiv = SelYear % 100	// Divide by 100 to ensure that the selected
									// is the end of the century (ex: 1900, 2000).
			if (RemDiv == 0)
				result = SelYear % 40	// if the selected year is the end of the
										// century then divide by 40  .
			else
				result = SelYear % 4	// else divide by 4  .
			if (result == 0){	// It means the year is fiscal year (Feb is 29 days.).
				if (eval(SelDay) < 1 || eval(SelDay) > 29){					
					alert ("الرجاء اعادة ادخال " + captionName + ".شهر شباط لهذه السنة هو فقط 29 يوم");
					day.focus()
					return false;
				}
			}
			else
				if (SelDay < 1 || SelDay > 28){	// The year is not fiscal (Feb is 28 days).
					alert ("الرجاء اعادة ادخال " + captionName + " .شهر شباط لهذه السنة هو فقط 28 يوم");
					day.focus()
					return false;
				}
				
		}
		else

		if (SelDay > MaxDay || SelDay < 1) {	// The selected month is other than Feb.
			// Return false if the day is out of range of the selected month.
			alert (captionName + " المدخل غير موجود. الرجاء اعادة ادخال التاريخ مرة أخرى ");
			day.focus()
			return false
		}

		return true
	}
	// -->