﻿//store thehadith in arrays
hadith = new Array(52);
hadith[0] = "The Prophet (peace be upon him) said &quot;On the Day of Judgment, the closest people to me will be those who invoked blessings upon me the most (in the world)&quot; (Al Tirmidhi)"
hadith[1] = "Ibn Jaz said: &quot;I have not seen anyone who smiled more than the Messenger of Allah (peace be upon him).&quot; (Hasan) [Chapters on Al-Manaqib: Jami At-Tirmidhi]"
hadith[2] = "The Prophet Muhammad (peace be upon him) said: &quot;None of you is truly a believer until he wishes for his brother what he wishes for himself.&quot; [Muslim]"
hadith[3] = "The Prophet Muhammad (peace be upon him) said: &quot;O Aysha, love the poor and let them come to you and Allah will draw you near to Himself.&quot; [Sahih Bukhari]"
hadith[4] = "The Prophet Muhammad (peace be upon him) said: &quot;Allah has inspired to me that you are all to be humble towards each other such that no one transgresses against or exalts himself above another.&quot; [Sahih Muslim]"
hadith[5] = "The Prophet Muhammad (peace be upon him) said: &quot;Give due respect and regard to your children and decorate them with the best of manners.&quot; [Abu Daud]"
hadith[6] = "The Prophet Muhammad (peace be upon him) said: &quot;Whoever does not argue when he is in the wrong will have a home built for him on the edge of Paradise. Whoever avoids it when he in the right will have a home built for him in the middle of Paradise. And whoever improves his own character, a home will be built for him in the highest part of Paradise.&quot; [Tirmidhi]"
hadith[7] = "Abu Hurairah (ra) reports that the Messenger of Allah (peace be upon him) said: &quot;The most perfect of the believers in faith is who one best in manners. [Abu Dawood]"
hadith[8] = "Abu Hurairah (ra) narrates from the Messenger of Allah (peace be upon him) saying: &quot;In the court of Allah (God), there is no greater thing than Supplication (Dua)&quot; (Ibn-e-Majah)"
hadith[9] = "The Prophet Muhammad (peace be upon him) said: &quot;Do good deeds properly, sincerely and moderately. Always adopt a middle, moderate, regular course, whereby you will reach your target (of paradise).&quot; [Sahih Al-Bukhari, Volume 8,hadith 470]"
hadith[10] = "Abdullah bin Salam reported: I heard the Messenger of Allah (peace be upon him) saying, &quot;O people, exchange greetings of peace, feed people, strengthen the ties of kinship, and be in prayer when others are asleep, you will enter Paradise in peace.'' [Tirmidhi]"
hadith[11] = "Narrated by Abu Hurraira: The Messenger of Allah (may peace and blessings be upon him) observed: He will not enter Paradise whose neighbour is not secure from his wrongful conduct. [Sahih Muslimhadith No. 15]"
hadith[12] = "Narrated by Abdullah bin Amr: A man asked the Prophet (peace be upon him) &quot;What sort of deeds or (what qualities of) Islam are good?&quot; The Prophet replied, 'To feed (the poor) and greet those whom you know and those whom you do not know. [Bukhari Book 1 Volume 2hadith 11]"
hadith[13] = "The Prophet Muhammad (peace be upon him) said: &quot;The believer's shade on the Day of Resurrection will be his charity.&quot; - (Al-Tirmidhi,hadith 604)"
hadith[14] = "The Prophet Muhammad (peace be upon him) said: &quot;The best of you are those who are slow to anger and swift to cool down. Beware of anger, for it is a live coal on the heart of the descendants of Adam.&quot; [Al-Tirmidhi,hadith 1331]"
hadith[15] = "Aisha (RA) reported Allah's Messenger (may peace be upon him) as saying: When Allah's Messenger (may peace be upon him) visited the sick he would say: Lord of the people, remove the disease, cure him, for Thou art the great Curer, there is no cure but through Thine healing Power, which leaves nothing of the disease. (Muslim Book 26, Number 5434)"
hadith[16] = "Prophet Muhammad (peace be upon him) said &quot;Avoid jealousy, for it destroys good deeds as fire destroys wood.&quot; [Riyadh-us-Salahin No. 1569]"
hadith[17] = "Prophet Muhammad (peace be upon him) said, &quot;I guarantee a house in the surroundings of Paradise for a man who avoids quarrelling even if he were in the right, a house in the middle of Paradise for a man who avoids lying even if he were joking, and a house in the upper part of Paradise for a man who made his character good.&quot; (Abu Dawud Book 41 No. 4782)"
hadith[18] = "Narrated Abu Huraira: The Prophet (peace be upon him) said, &quot;Religion is very easy and whoever overburdens himself in his religion will not be able to continue in that way. So you should not be extremists, but try to be near to perfection and receive the good tidings that you will be rewarded; and gain strength by worshipping in the mornings, the nights.&quot; [Bukhari Volume 1, Book 2, Number 38]"
hadith[19] = "Narrated Al-Mughira: The Prophet (peace be upon him) used to stand (in the prayer) or pray till both his feet or legs swelled. He was asked why (he offered such an unbearable prayer) and he said, 'should I not be a thankful slave.&quot; [Bukhari, Book 21 Volume 2, Book 21, Number 230]"
hadith[20] = "Narrated by (Abu Dawud, Tirmidhi): The Prophet (peace be upon him) said &quot;The Merciful One shows mercy to those who are themselves merciful (to others). So show mercy to whatever is on earth, then He who is in heaven will show mercy to you&quot; "
hadith[21] = "Ibn Abbas narrated that Allah's Messenger (peace be upon him) said: &quot;Allah will dispel his worries of one who regularly prays for forgiveness, He will lead him out of trying situations, and grant him earnings from sources he does not anticipate.&quot; (Reported in Sunan Abu Dawud. Medicine of the Prophet pg. 159.)"
hadith[22] = "‎&quot;O you who believe! Seek assistance through patience and prayer, surely Allah is with the patient.&quot; [Qur'an 2:153] "
hadith[23] = "A group of companions asked Prophet Muhammad (Peace Be Upon Him): &quot;Teach us which kind of wealth is best, so that we may try to acquire it?&quot; He (Peace Be Upon Him): said: &quot;The best is a remembering tongue (one that remembers Allah), a grateful heart and a believing wife who helps one’s faith.&quot; [Reported by Ahmad, 5/278; al-Tirmidhi, 3039; Saheeh al-Jaami’, 5231]"
hadith[24] = "Abdullah: I visited the Prophet (peace be upon him) during his ailments and he was suffering from a high fever. I said, &quot;You have a high fever. Is it because you will have a double reward for it?&quot; He said, &quot;Yes, for no Muslim is afflicted with any harm but that Allah will remove his sins as the leaves of a tree fall down.&quot; [Bukhari Book 7 Volume 70 hadith 550]"
hadith[25] = "Abu Masud reported Allah's Messenger (peace be upon him) as saying: When a Muslim spends on his family seeking reward for it from Allah, it counts for him as sadaqa.&quot; (Muslim Book 5, Number 2192)"
hadith[26] = "From the Prophet (peace be upon him), who said: &quot;Allah (mighty and sublime be He) said: Spend (on charity), O son of Adam, and I shall spend on you.&quot; [hadith Qudsi No. 11]"
hadith[27] = "Abu Huraira reported Allah's Messenger (may peace be upon him) as saying: He who called (people) to righteousness, there would be reward (assured) for him like the rewards of those who adhered to it, without their rewards being diminished in any respect. And he who called (people) to error, he shall have to carry (the ...burden) of its sin, like those who committed it, without their sins being diminished in any respect.&quot; (Muslim Book 34 No. 6470)"
hadith[28] = "The Messenger of Allah (peace be upon him) said : &quot;When Allah decreed the Creation He pledged Himself by writing in His book which is laid down with Him : My mercy prevails over my wrath.&quot;"
hadith[29] = "The Prophet (peace be upon him) said &quot;None of you will enter Paradise by his deeds alone.&quot; They asked: &quot;Not even you, O Messenger of Allah?&quot; He said, &quot;Not even me, unless Allah covers me with His Grace and Mercy&quot; [Sahih Muslim]"
hadith[30] = "Narrated by Abu Huraira: The Prophet (peace be upon him) said &quot;Allah will give shade to seven (types of people) under His Shade (on the Day of Resurrection). (one of them will be) a person who remembers (God) Allah and his eyes are then flooded with tears.&quot; (Bukhari)"
hadith[31] = "The Prophet (peace be upon him) said &quot;Whoever believes in Allah and the Last Day should not hurt (trouble) his neighbour. And I advise you to take care of the women, for they are created from a rib and the most crooked portion of the rib is its upper part; if you try to straighten it, it will break, and if you leave it, it will remain crooked, so I urge you to take care of the women.&quot; (Sahih Al-Bukhari)"
hadith[32] = "The Prophet (peace be upon him) said &quot;The most perfect believer in the matter of faith is one who has excellent behaviour; and the best among you are those who behave best towards their wives.&quot; (Al Tirmidi)"
hadith[33] = "The Prophet (peace be upon him) said &quot;The most hated person in the sight of Allah is the most quarrelsome person&quot; (Bukhari)"
hadith[34] = "The Prophet (peace be upon him) said &quot;Verily Allah does not look to your faces and your wealth but He looks to your heart and to your deeds&quot;"
hadith[35] = "The Prophet (peace be upon him) said &quot;He who believes in Allah and the Last Day must either speak good or remain silent.&quot; [Muslim]"
hadith[36] = "The Prophet (peace be upon him) said &quot;Allah will not be merciful to those who are not merciful to people.&quot; [Bukhari)"
hadith[37] = "The Prophet (peace be upon him) said &quot;Any Muslim who inflicts injustice to a non muslim who had an agreement to live peacefully with muslims would face my charge in the Hereafter&quot;"
hadith[38] = "The Prophet (peace be upon him) said &quot;Faith is sincerity, We (the comanions) asked to Towards whom?, he the Messenger of God replied Towards Allah, His Books, His Messengers, the Muslims leaders and all ordinary Muslims.&quot;"
hadith[39] = "Anas (May God be pleased with him) reported: A man said: &quot;O Messenger of Allah! I love Surat-Al-Ikhlas [Say: He is Allah, (the) One].'' He (Sallallaahu 'alaihi wasallam) said, &quot;Your love for it will admit you to Paradise.&quot [At-Tirmidhi]"
hadith[40] = "The Prophet (peace be upon him) said &quot;Facilitate things to people (concerning religious matters), and do not make it hard for them and give them good tidings and do not make them run away (from Islam).&quot; (Bukhari)"
hadith[41] = "The Prophet (peace be upon him) said &quot;Hell is hidden behind (evil) desires and Paradise is screened by difficult striving&quot; (Al Bukhari)"
hadith[42] = "The Prophet (peace be upon him) said &quot;Every servant of Allah will remain standing before Allah on the Day of Judgment until he has answered five questions about 5 things: his life, and how he spent it; his knowledge, and how much he has acted upon it; his wealth, and how he acquired it, and how he spent it; and his body (and health), and how he used it&quot; (Muslim)"
hadith[43] = "The Prophet (peace be upon him) said &quot;If you have complete trust in Allah, He will provide for you as He does for the birds. They leave their nests hungry in the morning and return  satisfied in the evening&quot; (Al Tirmidhi)"
hadith[44] = "The Prophet (peace be upon him) said &quot;The disease of the nations before you; Malice and Hatred, may also overtake you. Remember, they are like shavers; but they do not shave hair, rather, they shave virtues&quot; (Ahmad)"
hadith[45] = "The Prophet (peace be upon him) said &quot;Allah the exalted has said: O Son of Adam! If you come to me with an earth full of sins and meet me without associating anything with me, I will come to you with an earth full of forgiveness&quot; (Al Tirmidhi)"
hadith[46] = "The Prophet (peace be upon him) said &quot;The hypocrites find no prayers as burdensome as the Fajr and Isha prayers; yet if they knew the blessings in these prayers, they would come to them even if they had to crawl (on their knees)&quot; (Al Bukhari)"
hadith[47] = "The Prophet (peace be upon him) said &quot;No servant of Allah does an action which protects him most from the punishment of Allah except the remembrance&quot; (Ibn Majah)"
hadith[48] = "The prophet (peace be upon him) said &quot;Riches does not mean having a great amount of property, real wealth is self-contentment&quot; (Bukhari)"
hadith[49] = "The Prophet (peace be upon him) said &quot;Surely God does not consider your figures and wealth. He rather values your hearts and acts&quot; (Muslim)"
hadith[50] = "The Prophet (peace be upon him) said &quot;However plentiful usary may be, its end is want and scarcity&quot; (Ibn Majah)"
hadith[51] = "The Prophet (peace be upon him) said &quot;A believer never stops seeking knowledge until he enters Paradise&quot; (Al Tirmidhi)"
hadith[52] = "The Prophet (peace be upon him) said &quot;Earning an honest living is a duty next to the principal duties of Faith&quot; (Al Baihaqi)"
//calculate a random index

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function getWeek(year, month, day) {
    var when = new Date(year, month, day);
    var newYear = new Date(year, 0, 1);
    var offset = 7 + 1 - newYear.getDay();
    if (offset == 8) offset = 1;
    var daynum = ((Date.UTC(y2k(year), when.getMonth(), when.getDate(), 0, 0, 0) - Date.UTC(y2k(year), 0, 1, 0, 0, 0)) / 1000 / 60 / 60 / 24) + 1;
    var weeknum = Math.floor((daynum - offset + 7) / 7);
    if (weeknum == 0) {
        year--;
        var prevNewYear = new Date(year, 0, 1);
        var prevOffset = 7 + 1 - prevNewYear.getDay();
        if (prevOffset == 2 || prevOffset == 8) weeknum = 53; else weeknum = 52;
    }
    return weeknum;
}

var now = new Date();
//document.write('Week number = ' + getWeek(y2k(now.getYear()), now.getMonth(), now.getDate())); 

//display the hadith of the week
document.write(hadith[getWeek(y2k(now.getYear()), now.getMonth(), now.getDate())]);
//display random hadith
//index = Math.floor(Math.random() * hadith.length);
//document.write(hadith[index]);
//done

 

