var MD=new Array();
MD[0]="19941_1" //Ethiopian New Year
MD[1]="19941_17" //The Founding of the true cross
MD[2]="19944_7" //Id Al Fater(Remedan)
MD[3]="19944_29" //Ethiopian Christmas
MD[4]="19945_11" //Ethiopian Epiphany
MD[5]="19946_15" //Id Al Adaha(Arafa)
MD[6]="19946_23" // Victory Of Adwa
MD[7]="19948_23" //International Labour Day
MD[8]="19948_25" //Ethiopian Good Friday
MD[9]="19948_27" //Ethiopian Easter
MD[10]="19948_27_1" //Ethiopian Patriots Victory
MD[11]="19949_16" //Birth day of the prophet Mohammed (Maulid)
MD[12]="19949_20" //Down fall of Dergue


function DrawCalendar()
{
	var Gregorian_Year=new Date(Current_date)
	var YMDDayAry=ChangeToEth(Gregorian_Year.getDate(),Gregorian_Year.getMonth()+1,Gregorian_Year.getFullYear(),-1);
	var Num=0,Pagme=5,Counter,Yearr=YMDDayAry[0],Monthh=YMDDayAry[1],Datee=YMDDayAry[2],Dayy=YMDDayAry[3]
	YMDCon=Yearr + Monthh
	document.write("<table id='date' border='0' width='100%'>")
	document.write("<tr>")
	document.write("<td width='100%' colspan='7'>" + "<img border='0' src=../shop/months/" + Monthh + ".jpg> " + "<font size='2' color='#000055'> " + "&nbsp;&nbsp;" + Yearr + "</font>")
	document.write("</td>")
	document.write("</tr>")
	document.write("<tr>")
	document.write("<td width='14%'><Font size='1'>Mo<font></td>")
	document.write("<td width='14%'><Font size='1'>Tu<font></td>")
	document.write("<td width='14%'><Font size='1'>We<font></td>")
	document.write("<td width='14%'><Font size='1'>Th<font></td>")
	document.write("<td width='14%'><Font size='1'>Fr<font></td>")
	document.write("<td width='15%'><Font size='1'>Sa<font></td>")
	document.write("<td width='15%'><Font size='1'>Su<font></td>")
	document.write("</tr>")
	var ly=new Date(Current_date)
	var lyr=ly.getFullYear()
	
	if(Monthh==13 && (((Yearr-1991)%4)==0))
	{ counter=6
		Pagme=6
	}
	else if ((Dayy==7)||(Monthh==13 && Dayy>1))
	{ counter=5
		Pagme=5
	}
	else
	{
		counter=4
		Pagme=5
	}
	
	for (i=0;i<=counter;i++)
	{
		document.write("<tr>")
		for (k=1;k<8;k++)
		{
			if((i==0 && k<Dayy) ||(Num>=30 && Monthh!=13)||(Num>=Pagme && Monthh==13))
			{
				document.write("<td width='14%'><Font size='1'>&nbsp;</Font></td>")
				} else {
				Num=Num+1
				if(Num==30 && Monthh==13)
				{
					Num=1
					if(Datee==Num && Monthh==13)
					document.write("<td width='14%' align='center' bgcolor='#4b4e8b'><font size='1' color='#FFFFFF'><strong>" + Num + "</strong></Font></td>")
					document.write("<td width='14%' align='center' bgcolor='#c7d5e7'><font size='1' color='#FFFFFF'>" + Num + "</Font></td>")
					}else{
					if(Datee==Num)
					{  document.write("<td width='14%' align='center' bgcolor='#4b4e8b'><font size='1' color='#FFFFFF'><strong>" + Num + "</strong></Font></td>")
						}else if (HighL(Num)){
						document.write("<td width='14%' align='center' bgcolor='#ffffbf'><font size='1' color='#000000'>" + Num + "</Font></td>")
						}else{
						
						document.write("<td width='14%' align='center' bgcolor='#c7d5e7'><font size='1' color='#FFFFFF'>" + Num + "</Font></td>")
		}}}}
		document.write("</tr>")
	}
	document.write("</table>")
}


function HolyD()
{
	var Gregorian_Year=new Date(Current_date),YrMn
	var YrMnDyAry=ChangeToEth(Gregorian_Year.getDate(),Gregorian_Year.getMonth()+1,Gregorian_Year.getFullYear(),-1);
	var Yr=YrMnDyAry[0],Mn=YrMnDyAry[1],Dt=YrMnDyAry[2],Dy=YrMnDyAry[3]
	
	var YMDCon=Yr + Mn
	for (i=0;i<=12;i++)
	{
		YrMn=MD[i].split("_")
		if(YMDCon==YrMn[0])
		document.write("<img border='0' src=../shop/months/" + MD[i] + ".jpg> ")
	}
}

function HighL(Dtval)
{
	var Gregorian_Year=new Date(Current_date)
	var YrMnDyAry=ChangeToEth(Gregorian_Year.getDate(),Gregorian_Year.getMonth()+1,Gregorian_Year.getFullYear(),-1);
	var Yr=YrMnDyAry[0],Mn=YrMnDyAry[1]
	YMDCon=Yr + Mn
	for(j=0;j<=12;j++)
	{
		if(YMDCon + "_" + Dtval ==MD[j])
		{
			return true;
		}
	}
	return false;
}

