//global vars

var bdDivHeight = 0;
var bdNameCount = 0;
var bdStartY    = 0;
var bdNameBump  = 0;
var bdReStart   = 0;
var t1          = "";

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function writeThisMonthsBirthdays()
{
 var janBirthdays = new Array("Nikhil S.",
                             "Melinda P.",
                             "Makayla A."
);

var febBirthdays = new Array("Bill S.",
                             "Donna D.",
                             "Dylan S.",
                             "Anthony G.",
                             "Anthony B.",
                             "Evan D."
);                                

var marBirthdays = new Array("Richard L.",
                             "Joe S.",
                             "Alessandro T.",
                             "Jake L.",
                             "Derek H.",
                             "Gabriel M.",
                             "Arjun N."
);

var aprBirthdays = new Array("Louis R.",
                             "Thomas G.",
                             "Caitlin T.",
                             "Emma O.",
                             "Orlando F.",
                             "Jacob R.",
                             "Adel H.",
                             "Omari S."
);

var mayBirthdays = new Array("Lynne A.",
                             "Linda R.",
                             "Dan R.",
                             "Andrew B.",
                             "Theodore N.",
                             "Gabreila G.",
                             "Rushil S.",
                             "Alexis T."
);

var junBirthdays = new Array("Dakota R.",
                             "Julie M.",
                             "Mimi L.",
                             "Anthony C.",
                             "Rahul N.",
                             "Irene B.",
                             "Jay C."
);

var julBirthdays = new Array("Brandon M.",
                             "Jesse F.",
                             "Charles V."
);

var augBirthdays = new Array("Laurie S.",
                             "Colleen S.",
                             "Amanda D.",
                             "Joshua K.",
                             "Ian S."
);

var sepBirthdays = new Array("Carol B.",
                             "James A.",
                             "Lisa V.",
                             "Andrew F.",
                             "Sabrina T.",
                             "Zachary B.",
                             "Anthony L.",
                             "Enrique C.",
                             "Chaz S."
);

var octBirthdays = new Array("Anthony M.",
                             "David S.",
                             "Paul S.",
                             "Shihan Torri"
);

var novBirthdays = new Array("John S.",
                             "Dustin S.",
                             "Alena K.",
                             "Thomas H.",
                             "Jeremy A.",
                             "Anthony L.",
                             "Johan S."
);

var decBirthdays = new Array("John K.",
                             "Kris H.",
                             "Julia M.",
                             "Travor R."
);

var today = new Date()
var thisMonth = today.getMonth();

var numberOfNames = 0;
var i = 0;

switch (thisMonth)
{
case  0:
thisMonthsNames = janBirthdays;
break;
case  1:
thisMonthsNames = febBirthdays;
break;
case  2:
thisMonthsNames = marBirthdays;
break;
case  3:
thisMonthsNames = aprBirthdays;
break;
case  4:
thisMonthsNames = mayBirthdays;
break;
case  5:
thisMonthsNames = junBirthdays;
break;
case  6:
thisMonthsNames = julBirthdays;
break;
case  7:
thisMonthsNames = augBirthdays;
break;
case  8:
thisMonthsNames = sepBirthdays;
break;
case  9:
thisMonthsNames = octBirthdays;
break;
case 10:
thisMonthsNames = novBirthdays;
break;
case 11:

thisMonthsNames = decBirthdays;
}

numberOfNames = thisMonthsNames.length
bdNameCount   = thisMonthsNames.length

document.write('<div id="Text1" style="position: absolute; left: 0px; top:0px">');

for(i=0;i<numberOfNames;i++)
 {
  document.write(thisMonthsNames[i] + "<br />");
 }
 
 document.write('</div>');
}

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function bdMonth()
{
  var today     = new Date();
  var thisMonth = today.getMonth();
  
  
      var months    = new Array ("January", "February", "March",  "April",
                                 "May", "June", "July", "August",
                                 "September", "October", "November", "December");
  
                                   
      document.write(months[thisMonth]);
 }    

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function getDivHeight(divID) 
{

bdDivHeight = document.getElementById(divID).offsetHeight;
  
}


//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function placeIt(id, xPos, yPos){
    var obj = document.getElementById(id);
    obj.style.left = xPos + "px";
    obj.style.top  = yPos + "px";
}

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function shiftIt(id, deltaX, deltaY) {
    
    var  obj = document.getElementById(id);
    var xPos = xCoord(id);
    var yPos = yCoord(id);
    
    obj.style.left = xPos + deltaX + "px";
    obj.style.top  = yPos + deltaY + "px";
      
}

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function yCoord(id){
    
    var obj  = document.getElementById(id);
    var yPos = obj.style.top;
    var yPos = parseInt(yPos);
    return yPos;
} // returns the y coordinate as an integer

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
            
function xCoord(id)
{
    
    var obj  = document.getElementById(id);
    var xPos = obj.style.left;
    var xPos = parseInt(xPos);
    return xPos;
} // returns the x coordinate as an integer


 //----------------------------------------------------------------------------------
 //----------------------------------------------------------------------------------

function moveIt(id)
{
    var y = yCoord(id);
    
    if(y < -bdReStart)
    {
     placeIt(id, 0, 0);
    }
    else 
    {
     shiftIt(id, 0, - bdNameBump);
 
    }

}
//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

function getScrollInfo(id)
{
// get the amount to bump to the next name

bdNameBump  = Math.round(bdDivHeight/bdNameCount);

// get the orignal starting height of the scrolling name div

bdStartY = yCoord(id);

bdReStart = ((bdNameCount - 1) * bdNameBump) - 1

}
