//
// main.js
//
// General functions needed in site.
//
// 2009-10-25 
// Jason Alphonse <jalphonse@gmail.com>
//

function copyright_years()
{
   var start = 1998;
   var today = new Date();
   var this_yr = today.getFullYear();
   document.write(start + " - " + this_yr);
}

function daily_message()
{
   now= new Date();

   var day= "";
   var message= "";
   var daynum = now.getDay();

   var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];

   day = days[daynum];

   var timehour=now.getHours();

   if (day == 'Friday' && timehour > 14)
   {
      message = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>Have a nice weekend!</font>"; 
   }
   var zero="";
   var meridian = "am";

   if (timehour > 11) {
      timehour = timehour-12; meridian = "pm"; 
      if (timehour == 0) {timehour = 12}
   }

   if (now.getMinutes()<10) zero="0";

   document.write(day + ", " + (now.getMonth() + 1) + "/" + now.getDate() + "/" + (now.getFullYear()));
   document.write("  " + timehour + ":" + zero + now.getMinutes() + " " + meridian + message);

}

function sharethis_code()
{

   var url;
   if(permalink) url = permalink
   else url = 'http://www.andrewtobias.com';

   SHARETHIS.addEntry({
      title:'Share This!',
      summary:'Share this on Facebook, Twitter, Email, etc',
      url: url,      
      offsetLeft: 250,
      offsetTop: -170,      
      //icon: 'http://path.to/icon'
   }, {button:true} );

}

