//Add the holidays here

var holidays = new Array ("1/1", "12/25");

 

var SecondsInOneDay = 86400000;

 

function populateNextBusinessDay(obj)

{

                var textbox = document.getElementById(obj);

                if(textbox.value == "")

                {

                                var now = new Date();

                                textbox.value = GetNextBusinessDay(now);

                }

}

 

function GetNextBusinessDay(date)

{

                var now = new Date();

                var nextBusinessDay = new Date(date.getTime() + SecondsInOneDay);

                

                if(nextBusinessDay.getDay() == 5 || nextBusinessDay.getDay() == 6)

                {

                                return GetNextBusinessDay(nextBusinessDay);

                }

                else

                {

                                

                                var dayMonth = (nextBusinessDay.getMonth() + 1) +  "/" + nextBusinessDay.getDate();               

                                for(var i=0; i < holidays.length; i++)

                                {

                                                if(dayMonth == holidays[i])

                                                                return GetNextBusinessDay(nextBusinessDay);

                                }

                                

                                return dayMonth + "/" + nextBusinessDay.getFullYear();

                }

}
