// JavaScript Document

calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();

var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var monthname = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" );

document.write("<div class='left'>");
document.write(dayname[day] + " ");
document.write(date);
document.write(findsuffix(date) + " ");
document.write(monthname[month] + " ");
ActualMonth=month+1;

if (navigator.appName == "Netscape") {
	ActualYear = year+1900
	document.write(ActualYear)
    }
    else
    {
    ActualYear = year
	document.write(ActualYear)
	}

document.write("<font color=FF0000>");

if ((ActualMonth == 1) && (date == 1)) document.write(" New Years Day");
if ((ActualMonth == 3) && (date == 17)) document.write(" St. Patrick's Day");
if ((ActualMonth == 4) && (day == 0) && (date > 0) && (date < 8)) document.write(" Daylight Savings Time (UK) Begins");
if ((ActualMonth == 5) && (day == 0) && (date > 7) && (date < 16)) document.write(" Mother's Day");
if ((ActualMonth == 6) && (day == 0) && (date > 15) && (date < 24)) document.write(" Father's Day");
if ((ActualMonth == 10) && (day == 0) && (date > 24) && (date < 31)) document.write(" Daylight Savings Time (UK) Ends");
if ((ActualMonth == 10) && (day == 0) && (date == 31)) document.write(" Daylight Savings Time (UK) Ends");
if ((ActualMonth == 10) && (date == 31)) document.write(" Halloween");
if ((ActualMonth == 12) && (date == 24)) document.write(" Christmas Eve");
if ((ActualMonth == 12) && (date == 25)) document.write(" Christmas");
if ((ActualMonth == 12) && (date == 31)) document.write(" New Year's Eve");

document.write("</font></div><div class='right'>");

	d=parseInt(date)
        adj=parseInt(date)
	m=parseInt(month+1)
	y=parseInt(ActualYear)

					if ((y>1582)||((y==1582)&&(m>10))||((y==1582)&&(m==10)&&(d>14))) 
						{
						jd=intPart((1461*(y+4800+intPart((m-14)/12)))/4)+intPart((367*(m-2-12*(intPart((m-14)/12))))/12)-
	intPart( (3* (intPart(  (y+4900+    intPart( (m-14)/12)     )/100)    )   ) /4)+d-32075
						}

						else

						{
						jd = 367*y-intPart((7*(y+5001+intPart((m-9)/7)))/4)+intPart((275*m)/9)+d+1729777
						}

					JD=jd
					wd=weekDay(jd%7)
					l=jd-1948440+10632
					n=intPart((l-1)/10631)
					l=l-10631*n+354
					j=(intPart((10985-l)/5316))*(intPart((50*l)/17719))+(intPart(l/5670))*(intPart((43*l)/15238))
					l=l-(intPart((30-j)/15))*(intPart((17719*j)/50))-(intPart(j/16))*(intPart((15238*j)/43))+29
					m=intPart((24*l)/709)
					d=l-intPart((709*m)/24)
                                        adj=0 <!-- adjust date -->
                                        d=(d+adj)
					y=30*n+j-30

	findsuffix(d)
	
	answer= wd + " " + d + findsuffix(d) + " " + Month(m) + " " + y	
	
	document.write(answer);

document.write("<font color=Red>");	
<!-- MUHARRAM -->
if ((m == 1) && (d == 10)) document.write(" ASHOORA - Shahadat of Imam Hussain (AS)");
if ((m == 1) && (d == 25)) document.write(" Shahadat of Imam Ali Zaynul Abideen (AS)");
<!-- SAFAR -->
if ((m == 2) && (d == 7)) document.write(" Wiladat of Imam Musa Al-Kazim (AS)");
if ((m == 2) && (d == 13)) document.write(" Shahadat of Sakina Bintul Hussain (AS)");
if ((m == 2) && (d == 17)) document.write(" Shahadat of Imam Ali Ar-Ridha (AS)");
if ((m == 2) && (d == 20)) document.write(" Arbaeen of Shuhada-e-Karbala");
if ((m == 2) && (d == 28)) document.write(" Wafat of the Holy Prophet (SAW) &amp; Shahadat of Imam Hasan (AS)");
<!-- RABI AL AWWAL -->
if ((m == 3) && (d == 1)) document.write(" Day of Hijrah");
if ((m == 3) && (d == 8)) document.write(" Shahadat of Imam Hasan Al-Askari (AS)");
if ((m == 3) && (d == 9)) document.write(" EID-uz-Zahra'");
if ((m == 3) && (d == 10)) document.write(" Demise of Hadhrat Abdul Muttalib (AS)");
if ((m == 3) && (d == 14)) document.write(" Death of Yazid bin Mu'awiyah");
if ((m == 3) && (d == 17)) document.write(" Wiladat of the Holy Prophet (SAW) &amp; Wiladat of Imam Ja'far As-Sadiq (AS)");
if ((m == 3) && (d == 26)) document.write(" Demise of Hadhrat Abu Talib (AS)");
<!-- RABI AL AAKHIR -->
if ((m == 4) && (d == 10)) document.write(" Wiladat of Imam Hasan Al-Askari (AS)");
<!-- JAMAADI AL AWWAL -->
if ((m == 5) && (d == 15)) document.write(" Wiladat of Imam Ali Zaynul Abideen (AS)");
<!-- JAMAADI AL AAKHIR -->
if ((m == 6) && (d == 3)) document.write(" Sad demise of Hadhrat Fatima Zahra'(AS)");
if ((m == 6) && (d == 20)) document.write(" Wiladat of Hadhrat Fatima Zahra'(AS)");
<!-- RAJAB -->
if ((m == 7) && (d == 1)) document.write(" Wiladat of Imam Muhammad Al-Baqir (AS)");
if ((m == 7) && (d == 3)) document.write(" Shahadat of Imam Ali An-Naqi (AS)");
if ((m == 7) && (d == 10)) document.write(" Wiladat of Imam Muhammad Taqi (AS)");
if ((m == 7) && (d == 13)) document.write(" Wiladat of Imam Ali Murtadha (AS)");
if ((m == 7) && (d == 14)) document.write(" Wiladat of Prophet Ibrahim (AS)");
if ((m == 7) && (d == 22)) document.write(" Death of Mu'awiyah bin Abu Sufyan &amp; Nadhr of Imam Ja'far As-Sadiq (AS)");
if ((m == 7) && (d == 25)) document.write(" Shahadat of Imam Musa Al-Kadhim (AS)");
if ((m == 7) && (d == 26)) document.write(" Night of Mi'raaj");
if ((m == 7) && (d == 27)) document.write(" Eid-e-Bitha't Al-Rasool");
<!-- SHA'BAN -->
if ((m == 8) && (d == 3)) document.write(" Wiladat of Imam Hussain (AS)");
if ((m == 8) && (d == 4)) document.write(" Wiladat of Hadhrat Abbas bin Ali (AS)");
if ((m == 8) && (d == 5)) document.write(" Wiladat of Hadhrat Ali Akbar bin Hussain (AS)");
if ((m == 8) && (d == 6)) document.write(" Wiladat of Hadhrat Zainab (AS)");
if ((m == 8) && (d == 7)) document.write(" Wiladat of Hadhrat Qasim bin Hasan (AS)");
if ((m == 8) && (d == 15)) document.write(" Wiladat of Imam Muhammad Al-Mahdi (ATF)");
<!-- RAMADHAN -->
if ((m == 9) && (d == 10)) document.write(" Wafat of Hadhrat Khadija (AS)");
if ((m == 9) && (d == 15)) document.write(" Wiladat of Imam Hasan (AS)");
if ((m == 9) && (d == 19)) document.write(" Shab-e-Dharbat: Imam Ali is wounded");
if ((m == 9) && (d == 21)) document.write(" Shahadat of Imam Ali (AS)");
if ((m == 9) && (d == 22)) document.write(" The night of POWER!");
if ((m == 9) && (d == 23)) document.write(" The day of POWER!");
<!-- SHAWWAL -->
if ((m == 10) && (d == 1)) document.write(" Eid-ul-Fitr");
if ((m == 10) && (d == 8)) document.write(" Demolition of Jannatul Baqi");
if ((m == 10) && (d == 10)) document.write(" Ghaibat-e-Kubra");
if ((m == 10) && (d == 14)) document.write(" Shahadat of Hadhrat Amir Hamza (AS)");
if ((m == 10) && (d == 25)) document.write(" Shahadat of Imam Ja'far As-Sadiq (AS)");
<!-- DHI QAIDAH -->
if ((m == 11) && (d == 11)) document.write(" Wiladat of Imam Ali Ar-Ridha (AS)");
if ((m == 11) && (d == 23)) document.write(" Shahadat of Imam Ali Ar-Ridha (AS)");
if ((m == 11) && (d == 29)) document.write(" Shahadat of Imam Muhammad Taqi (AS)");
if ((m == 11) && (d == 30)) document.write(" Shahadat of Imam Muhammad Taqi (AS)");
<!-- DHIL HIJJ -->
if ((m == 12) && (d == 1)) document.write(" Marriage of Imam Ali with Bibi Fatima Zahra'(AS)");
if ((m == 12) && (d == 7)) document.write(" Shahadat of Imam Muhammad Al-Baqir (AS)");
if ((m == 12) && (d == 9)) document.write(" Arafat &amp; Shahadat of Hadhrat Muslim bin Aqeel (AS)");
if ((m == 12) && (d == 10)) document.write(" Eid-udh-dhuha");
if ((m == 12) && (d == 15)) document.write(" Wiladat of Imam Ali An-Naqi (AS)");
if ((m == 12) && (d == 18)) document.write(" Eid-ul-Ghadeer");
if ((m == 12) && (d == 24)) document.write(" Eid-e-Mubahila");
	
	document.write("</font></div><br />");