//when the message will start showing it self;
startDate        = 1319149372; // 20/10/2011, 02:22pm

//when the message will go away. This is usually an hour or two after the outage starts;
early_expDate    = 1323842400; // Dec 13th, 2011, 11:00pm

//this is when the outage starts;
actual_startDate = 1323838800; // Dec 13th, 2011, 09:00pm

//this is when the outage is scheduled to end;
full_expDate     = 1323867600; //15/11/2011, 05:00am



fetch_unix_timestamp = function() {
   return parseInt(new Date().getTime().toString().substring(0, 10));
}
currenttimestamp = fetch_unix_timestamp(); 

function outageMessage(siteName){
   

   if (startDate < currenttimestamp &&  currenttimestamp < early_expDate) {
      document.write ("   <div id='outage_notification'>   ");
      document.write ("      <h2 id='headline'>Scheduled maintenance for Tuesday, December 13th, 2011 (9:00pm Pacific time)</h2>   ");
      document.write ("      <p>The " + siteName + " system will be undergoing general maintenance on Tuesday, December 13th, 9:00pm to December 14th, 5:00am Pacific time. During this maintenance period, only our website will be unavailable. We apologize for any inconvenience.</p>   ");
      document.write ("   </div>   ");
   }
}

function brbMessage(siteName) {
   if (actual_startDate < currenttimestamp &&  currenttimestamp < full_expDate) {
        document.write("   <div id='message'>   ");
        document.write("   <h1> " + siteName + " is temporarily unavailable due to scheduled maintenance.</h1>   ");
        document.write("   <p>We are currently undergoing a scheduled maintenance on the website. Ad servers are not effected and your ads are still being served. </p>   ");
        document.write("   <p>We will be back by 5:00am  Pacific time on Wednesday, December 14th. </p>   ");
        document.write("   <p>Thank you for your patience and understanding. </p>   ");
        document.write("   <p>- The " + siteName + " team </p>   ");
        document.write("   </div>   ");
   } else {
      document.write("   <div id='message'>   ");
      document.write("   <h1>The " + siteName + " website is temporarily unavailable.</h1>   ");
      document.write("   <p>We are currently experiencing issues and our website is temporarily not available. </p>   ");
      document.write("   <p>Our engineers are aware of the issue and working hard to fix the problem. </p>   ");
      document.write("  <p>We apologize for any inconvenience this may cause and appreciate your patience as we restore the site to full functionality. </p>   ");
      document.write("   <p>Thank you for visiting " + siteName + ", and please check back soon. </p>   ");
      document.write("   </div>   ");
   }
}


