// JavaScript Document

	var userInputYears;
    var userInputMonth;
    var userInputDays;
    var convertedYears = 0;
	
	var months;
    var days;
    var convertedDays;
    var convertedMonths;
    var intConvertedMonths;
   
    
    function getResult(dd, mm, yy)
    {        
        userInputDays = dd;
        userInputMonth = mm;
        userInputYears = yy;        
        
        //if ***Leap*** Year ethiopia & ***Not Leap*** year western
        if (userInputYears % 4 == 2)        
        {         
            if (userInputMonth >= 9 && userInputMonth <= 12) 
            {   
                if (userInputMonth == 9)
                {
                    if (userInputDays >=11 && userInputDays <= 30)
                    {     
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 == 3)
                        {                           
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                if (userInputMonth == 10)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {                       
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                if (userInputMonth == 11)
                {
                    if (userInputDays >=1 && userInputDays <= 30)
                    {              
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                if (userInputMonth == 12)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {    
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                
            }
        }
        
        
        
        //if ***Leap*** Year ethiopia & ***Not Leap*** year western
        if (userInputYears % 4 == 3)         
        {         
            if (userInputMonth >= 1 && userInputMonth <= 9)
            {   
                if (userInputMonth == 1)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {    
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 2)
                {
                    if (userInputDays >=1 && userInputDays <=28)
                    {            
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 3)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                      
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 4)
                {
                    if (userInputDays >=1 && userInputDays <=30)
                    {                        
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 5)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 6)
                {
                    if (userInputDays >=1 && userInputDays <=30)
                    {                        
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 7)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 8)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOne(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 9)
                {
                    if (userInputDays >=1 && userInputDays <=11)
                    {                        
                        if ((userInputYears - 8 ) % 4 == 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableOnePagumen(userInputMonth, userInputDays);
                        }
                    }
                }
                
                
            }
        }
        
        //if ***Not leap*** year ethiopia & ***Leap*** year western
        if (userInputYears % 4 == 3)        
        {         
            if (userInputMonth >= 9 && userInputMonth <= 12) 
            {   
                if (userInputMonth == 9)
                {
                    if (userInputDays >=12 && userInputDays <=30)
                    {                        
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                if (userInputMonth == 10)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                if (userInputMonth == 11)
                {
                    if (userInputDays >=1 && userInputDays <=30)
                    {                        
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }
                if (userInputMonth == 12)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;
                    }
                }                
                
            }
        }
        
        //if ***not leap*** year ethiopia & ***leap*** year western
        if (userInputYears % 4 == 0)         
        {         
            if (userInputMonth >= 1 && userInputMonth <= 9)         
            {   
                if (userInputMonth == 1)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 2)
                {
                    if (userInputDays >=1 && userInputDays <=29)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 3)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 4)
                {
                    if (userInputDays >=1 && userInputDays <=30)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 5)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 6)
                {
                    if (userInputDays >=1 && userInputDays <=30)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 7)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 8)
                {
                    if (userInputDays >=1 && userInputDays <=31)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 9)
                {
                    if (userInputDays >=1 && userInputDays <=10)
                    {                        
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableTwo(userInputMonth, userInputDays);
                        }
                    }
                }                
                
            }
        }
        
        //if ***Not leap*** year ethiopia & ***Not leap*** year western
        if ((userInputYears % 4 == 0) || (userInputYears % 4 == 1))
        {   
            if ((9 <= userInputMonth && userInputMonth <=12))
            {
                if (userInputMonth == 9)                                     
                {   
                    if(userInputDays >= 11 && userInputDays <= 30 )
                    {
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;                           
                    }                    
                }
                if (userInputMonth == 10)                                     
                {   
                    if(userInputDays >= 1 && userInputDays <= 31 )
                    {
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;                           
                    }                    
                }
                if (userInputMonth == 11)                                     
                {   
                    if(userInputDays >= 1 && userInputDays <= 30 )
                    {
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;                           
                    }                    
                }
                if (userInputMonth == 12)                                     
                {   
                    if(userInputDays >= 1 && userInputDays <= 31 )
                    {
                        userInputYears += 1;         
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                        userInputYears -= 1;                           
                    }                    
                }
                
            }
        }
        
        //if ***Not leap*** year ethiopia & ***Not leap*** year western
        if (userInputYears % 4 != 0)         
        {         
            if (userInputMonth >= 1 && userInputMonth <= 9)
            {
                if (userInputMonth == 1)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 2)
                {
                    if (userInputDays >=1 && userInputDays <= 28)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 3)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 4)
                {
                    if (userInputDays >=1 && userInputDays <= 30)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 5)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 6)
                {
                    if (userInputDays >=1 && userInputDays <= 30)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 7)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 8)
                {
                    if (userInputDays >=1 && userInputDays <= 31)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                if (userInputMonth == 9)
                {
                    if (userInputDays >=1 && userInputDays <= 10)
                    {
                        if ((userInputYears - 8 ) % 4 != 3)
                        {   
                            convertedYears = userInputYears - 8;                    
                            convertTableThree(userInputMonth, userInputDays);
                        }
                    }
                }
                
            }
        }
    }
    
    
   

	
    
    function convertTableOne(m, d)
    {
        months = m;
        days = d;
        if ((months == 9 && days >=11) || (months == 10 && days <= 10))
        {
            if (months == 9 && days <=30)
            {
                convertedMonths = "Meskerem";
				intConvertedMonths = 1;
                convertedDays = days - 10;
            }
            else if (months == 10 && days <=10)
            {
                convertedMonths = "Meskerem";
				intConvertedMonths = 1;
                convertedDays = days + 20;
            }
        }
        else if ((months == 10 && days >=11) || (months == 11 && days <=9))
        {
            if (months == 10 && days <= 31)
            {
                convertedMonths = "Teqemt";
				intConvertedMonths = 2;
                convertedDays = days - 10;
            }
            else if (months == 11 && days <=9)
            {
                convertedMonths = "Teqemt";
				intConvertedMonths = 2;
                convertedDays = days + 21;
            }
        }
        else if ((months == 11 && days >=10) || (months == 12 && days <=9))
        {
            if (months == 11 && days <= 30)
            {
                convertedMonths = "Hidar";
				intConvertedMonths = 3;
                convertedDays = days - 9;
            }
            else if (months == 12 && days <=9)
            {
                convertedMonths = "Hidar";
				intConvertedMonths = 3;
                convertedDays = days + 21;
            }
        }
        else if ((months == 12 && days >=10) || (months == 1 && days <= 8))
        {
            if (months == 12 && days <= 31)
            {
                convertedMonths = "Tahisas";
				intConvertedMonths = 4;
                convertedDays = days - 9;
            }
            else if (months == 1 && days <=8)
            {
                convertedMonths = "Tahisas";
				intConvertedMonths = 4;
                convertedDays = days + 22;
            }
        }
        else if ((months == 1 && days >=9) || (months == 2 && days <= 7))
        {
            if (months == 1 && days <= 31)
            {
                convertedMonths = "Tir";
				intConvertedMonths = 5;
                convertedDays = days - 8;
            }
            else if (months == 2 && days <=7)
            {
                convertedMonths = "Tir";
				intConvertedMonths = 5;
                convertedDays = days + 23;
            }
        }
        else if ((months == 2 && days >=8) || (months == 3 && days <= 9))
        {
            if (months == 2 && days <= 28)
            {
                convertedMonths = "Yekatit";
				intConvertedMonths = 6;
                convertedDays = days - 7;
            }
            else if (months == 3 && days <=9)
            {
                convertedMonths = "Yekatit";
				intConvertedMonths = 6;
                convertedDays = days + 21;
            }
        }
        else if ((months == 3 && days >=10) || (months == 4 && days <= 8))
        {
            if (months == 3 && days <= 31)
            {
                convertedMonths = "Megabit";
				intConvertedMonths = 7;
                convertedDays = days - 9;
            }
            else if (months == 4 && days <=8)
            {
                convertedMonths = "Megabit";
				intConvertedMonths = 7;
                convertedDays = days + 22;
            }
        }
        else if ((months == 4 && days >=9) || (months == 5 && days <= 8))
        {
            if (months == 4 && days <= 30)
            {
                convertedMonths = "Miaziya";
				intConvertedMonths = 8;
                convertedDays = days - 8;
            }
            else if (months == 5 && days <=8)
            {
                convertedMonths = "Miaziya";
				intConvertedMonths = 8;
                convertedDays = days + 22;
            }
        }
        else if ((months == 5 && days >=9) || (months == 6 && days <= 7))
        {
            if (months == 5 && days <= 31)
            {
                convertedMonths = "Ginbot";
				intConvertedMonths = 9;
                convertedDays = days - 8;
            }
            else if (months == 6 && days <=7)
            {
                convertedMonths = "Ginbot";
				intConvertedMonths = 9;
                convertedDays = days + 23;
            }
        }
        else if ((months == 6 && days >=8) || (months == 7 && days <= 7))
        {
            if (months == 6 && days <= 30)
            {
                convertedMonths = "Sane";
				intConvertedMonths = 10;
                convertedDays = days - 7;
            }
            else if (months == 7 && days <=7)
            {
                convertedMonths = "Sane";
				intConvertedMonths = 10;
                convertedDays = days + 23;
            }
        }
        else if ((months == 7 && days >=8) || (months == 8 && days <= 6))
        {
            if (months == 7 && days <= 31)
            {
                convertedMonths = "Hamle";
				intConvertedMonths = 11;
                convertedDays = days - 7;
            }
            else if (months == 8 && days <=6)
            {
                convertedMonths = "Hamle";
				intConvertedMonths = 11;
                convertedDays = days + 24;
            }
        }
        else if ((months == 8 && days >=7) || (months == 9 && days <= 5))
        {
            if (months == 8 && days <= 31)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 12;
                convertedDays = days - 6;
            }
            else if (months == 9 && days <=5)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 12;
                convertedDays = days + 25;
            }
             
        }           
        
    }
    function convertTableOnePagumen(m, d)
    {
        months = m;
        days = d;
        if ((months == 8 && days >=7) || (months == 9 && days <= 5))
        {
            if (months == 8 && days <= 31)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 13;
                convertedDays = days - 6;
            }
            else if (months == 9 && days <=5)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 13;
                convertedDays = days + 25;
            }
        }     
        else if ((months == 9 && days >=6) || (months == 9 && days <= 11))
        {
            if (months == 9 && days <= 11)
            {
                convertedMonths = "Pagumen";
				intConvertedMonths = 13;
                convertedDays = days - 5;
            }            
        }
    }
    
    function convertTableTwo(m, d)
    {
        months = m;
        days = d;
        if ((months == 9 && days >=12) || (months == 10 && days <= 11))
        {
            if (months == 9 && days <=30)
            {
                convertedMonths = "Meskerem";
				intConvertedMonths = 1;
                convertedDays = days - 11;
            }
            else if (months == 10 && days <=11)
            {
                convertedMonths = "Meskerem";
				intConvertedMonths = 1;
                convertedDays = days + 19;
            }
        }
        else if ((months == 10 && days >=12) || (months == 11 && days <=10))
        {
            if (months == 10 && days <= 31)
            {
                convertedMonths = "Teqemt";
				intConvertedMonths = 2;
                convertedDays = days - 11;
            }
            else if (months == 11 && days <=10)
            {
                convertedMonths = "Teqemt";
				intConvertedMonths = 2;
                convertedDays = days + 20;
            }
        }
        else if ((months == 11 && days >=11) || (months == 12 && days <=10))
        {
            if (months == 11 && days <= 30)
            {
                convertedMonths = "Hidar";
				intConvertedMonths = 3;
                convertedDays = days - 10;
            }
            else if (months == 12 && days <=10)
            {
                convertedMonths = "Hidar";
				intConvertedMonths = 3;
                convertedDays = days + 20;
            }
        }
        else if ((months == 12 && days >=11) || (months == 1 && days <= 9))
        {
            if (months == 12 && days <= 31)
            {
                convertedMonths = "Tahisas";
				intConvertedMonths = 4;
                convertedDays = days - 10;
            }
            else if (months == 1 && days <=9)
            {
                convertedMonths = "Tahisas";
				intConvertedMonths = 4;
                convertedDays = days + 21;
            }
        }
        else if ((months == 1 && days >=10) || (months == 2 && days <= 8))
        {
            if (months == 1 && days <= 31)
            {
                convertedMonths = "Tir";
				intConvertedMonths = 5;
                convertedDays = days - 9;
            }
            else if (months == 2 && days <=8)
            {
                convertedMonths = "Tir";
				intConvertedMonths = 5;
                convertedDays = days + 22;
            }
        }
        else if ((months == 2 && days >=9) || (months == 3 && days <= 9))
        {
            if (months == 2 && days <= 29)
            {
                convertedMonths = "Yekatit";
				intConvertedMonths = 6;
                convertedDays = days - 8;
            }
            else if (months == 3 && days <=9)
            {
                convertedMonths = "Yekatit";
				intConvertedMonths = 6;
                convertedDays = days + 21;
            }
        }
        else if ((months == 3 && days >=10) || (months == 4 && days <= 8))
        {
            if (months == 3 && days <= 31)
            {
                convertedMonths = "Megabit";
				intConvertedMonths = 7;
                convertedDays = days - 9;
            }
            else if (months == 4 && days <=8)
            {
                convertedMonths = "Megabit";
				intConvertedMonths = 7;
                convertedDays = days + 22;
            }
        }
        else if ((months == 4 && days >=9) || (months == 5 && days <= 8))
        {
            if (months == 4 && days <= 30)
            {
                convertedMonths = "Miaziya";
				intConvertedMonths = 8;
                convertedDays = days - 8;
            }
            else if (months == 5 && days <=8)
            {
                convertedMonths = "Miaziya";
				intConvertedMonths = 8;
                convertedDays = days + 22;
            }
        }
        else if ((months == 5 && days >=9) || (months == 6 && days <= 7))
        {
            if (months == 5 && days <= 31)
            {
                convertedMonths = "Ginbot";
				intConvertedMonths = 9;
                convertedDays = days - 8;
            }
            else if (months == 6 && days <=7)
            {
                convertedMonths = "Ginbot";
				intConvertedMonths = 9;
                convertedDays = days + 23;
            }
        }
        else if ((months == 6 && days >=8) || (months == 7 && days <= 7))
        {
            if (months == 6 && days <= 30)
            {
                convertedMonths = "Sane";
				intConvertedMonths = 10;
                convertedDays = days - 7;
            }
            else if (months == 7 && days <=7)
            {
                convertedMonths = "Sane";
				intConvertedMonths = 10;
                convertedDays = days + 23;
            }
        }
        else if ((months == 7 && days >=8) || (months == 8 && days <= 6))
        {
            if (months == 7 && days <= 31)
            {
                convertedMonths = "Hamle";
				intConvertedMonths = 11;
                convertedDays = days - 7;
            }
            else if (months == 8 && days <=6)
            {
                convertedMonths = "Hamle";
				intConvertedMonths = 11;
                convertedDays = days + 24;
            }
        }
        else if ((months == 8 && days >=7) || (months == 9 && days <= 5))
        {
            if (months == 8 && days <= 31)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 12;
                convertedDays = days - 6;
            }
            else if (months == 9 && days <=5)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 12;
                convertedDays = days + 25;
            }
        }
        else if ((months == 9 && days >=6) || (months == 9 && days <= 10))
        {
            if (months == 9 && days < 11)
            {
                convertedMonths = "Pagumen";
				intConvertedMonths = 13;
                convertedDays = days - 5;
            }            
        }           
    }
    
    function convertTableThree(m, d)
    {
        months = m;
        days = d;
        if ((months == 9 && days >=11) || (months == 10 && days <= 10))
        {
            if (months == 9 && days <=30)
            {
                convertedMonths = "Meskerem";
				intConvertedMonths = 1;
                convertedDays = days - 10;
            }
            else if (months == 10 && days <=10)
            {
                convertedMonths = "Meskerem";
				intConvertedMonths = 1;
                convertedDays = days + 20;
            }
        }
        else if ((months == 10 && days >=11) || (months == 11 && days <=9))
        {
            if (months == 10 && days <= 31)
            {
                convertedMonths = "Teqemt";
				intConvertedMonths = 2;
                convertedDays = days - 10;
            }
            else if (months == 11 && days <=9)
            {
                convertedMonths = "Teqemt";
				intConvertedMonths = 2;
                convertedDays = days + 21;
            }
        }
        else if ((months == 11 && days >=10) || (months == 12 && days <=9))
        {
            if (months == 11 && days <= 30)
            {
                convertedMonths = "Hidar";
				intConvertedMonths = 3;
                convertedDays = days - 9;
            }
            else if (months == 12 && days <=9)
            {
                convertedMonths = "Hidar";
				intConvertedMonths = 3;
                convertedDays = days + 21;
            }
        }
        else if ((months == 12 && days >=10) || (months == 1 && days <= 8))
        {
            if (months == 12 && days <= 31)
            {
                convertedMonths = "Tahisas";
				intConvertedMonths = 4;
                convertedDays = days - 9;
            }
            else if (months == 1 && days <=8)
            {
                convertedMonths = "Tahisas";
				intConvertedMonths = 4;
                convertedDays = days + 22;
            }
        }
        else if ((months == 1 && days >=9) || (months == 2 && days <= 7))
        {
            if (months == 1 && days <= 31)
            {
                convertedMonths = "Tir";
				intConvertedMonths = 5;
                convertedDays = days - 8;
            }
            else if (months == 2 && days <=7)
            {
                convertedMonths = "Tir";
				intConvertedMonths = 5;
                convertedDays = days + 23;
            }
        }
        else if ((months == 2 && days >=8) || (months == 3 && days <= 9))
        {
            if (months == 2 && days <= 28)
            {
                convertedMonths = "Yekatit";
				intConvertedMonths = 6;
                convertedDays = days - 7;
            }
            else if (months == 3 && days <=9)
            {
                convertedMonths = "Yekatit";
				intConvertedMonths = 6;
                convertedDays = days + 21;
            }
        }
        else if ((months == 3 && days >=10) || (months == 4 && days <= 8))
        {
            if (months == 3 && days <= 31)
            {
                convertedMonths = "Megabit";
				intConvertedMonths = 7;
                convertedDays = days - 9;
            }
            else if (months == 4 && days <=8)
            {
                convertedMonths = "Megabit";
				intConvertedMonths = 7;
                convertedDays = days + 22;
            }
        }
        else if ((months == 4 && days >=9) || (months == 5 && days <= 8))
        {
            if (months == 4 && days <= 30)
            {
                convertedMonths = "Miaziya";
				intConvertedMonths = 8;
                convertedDays = days - 8;
            }
            else if (months == 5 && days <=8)
            {
                convertedMonths = "Miaziya";
				intConvertedMonths = 8;
                convertedDays = days + 22;
            }
        }
        else if ((months == 5 && days >=9) || (months == 6 && days <= 7))
        {
            if (months == 5 && days <= 31)
            {
                convertedMonths = "Ginbot";
				intConvertedMonths = 9;
                convertedDays = days - 8;
            }
            else if (months == 6 && days <=7)
            {
                convertedMonths = "Ginbot";
				intConvertedMonths = 9;
                convertedDays = days + 23;
            }
        }
        else if ((months == 6 && days >=8) || (months == 7 && days <= 7))
        {
            if (months == 6 && days <= 30)
            {
                convertedMonths = "Sane";
				intConvertedMonths = 10;
                convertedDays = days - 7;
            }
            else if (months == 7 && days <=7)
            {
                convertedMonths = "Sane";
				intConvertedMonths = 10;
                convertedDays = days + 23;
            }
        }
        else if ((months == 7 && days >=8) || (months == 8 && days <= 6))
        {
            if (months == 7 && days <= 31)
            {
                convertedMonths = "Hamle";
				intConvertedMonths = 11;
                convertedDays = days - 7;
            }
            else if (months == 8 && days <=6)
            {
                convertedMonths = "Hamle";
				intConvertedMonths = 11;
                convertedDays = days + 24;
            }
        }
        else if ((months == 8 && days >=7) || (months == 9 && days <= 5))
        {
            if (months == 8 && days <= 31)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 12;
                convertedDays = days - 6;
            }
            else if (months == 9 && days <=5)
            {
                convertedMonths = "Nahassie";
				intConvertedMonths = 12;
                convertedDays = days + 25;
            }
        }
        else if ((months == 9 && days >=6) || (months == 9 && days <= 10))
        {
            if (months == 9 && days < 11)
            {
                convertedMonths = "Pagumen";
				intConvertedMonths = 13;
                convertedDays = days - 5;
            }            
        }           
    }
	    
    function getConvertedDays()
    {
        return convertedDays;
    }
    function getConvertedMonths()
    {
        return convertedMonths;
    }
 
    function getConvertedYears()
    {
        return convertedYears;
    }


var remainingYears;
var remainingMonths;
var remainingDays;
var totalRemainingDays;

function calculateRemainingDays()
{
	remainingYears = 2000 - convertedYears - 1;
	remainingMonths = 13 - intConvertedMonths;
	remainingDays = 30 - convertedDays;
	
	
	totalRemainingDays = (((remainingYears * 365) + 1) + (((remainingMonths - 1) * 30) + 5) + remainingDays);
	
	return totalRemainingDays;
}

