﻿
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: James Crooke :: http://www.cj-design.com

** Additional formats can be seen on the Web site at:
http://www.cj-design.com/demos/cjeventcountdownv1/ */

var date_deadline = new Date()
var str_homeowners = new String()
var str_referrals = new String()

date_deadline = "May 15, 2012"
str_homeowners = "72,200"
str_referrals = "9,000"


function renderMessage(dateStr, msg1, msg2, countFrom) {
  var date = new Date(dateStr);
  var now = new Date();
  var diff = date.getTime() - now.getTime();
  var days = Math.floor(diff / (1000 * 60 * 60 * 24)) + 1;
  if(days < 1) {
    document.write(msg1);
  } else {
    if(countFrom)
      days = countFrom - days;
    document.write(msg2.replace(/%days%/g, number_format(days)));
  }
}
function number_format(num) {
  num = num.toString().replace(/\$|\,/g,'');
  if(isNaN(num)) {
    num = "0";
  }
  sign = (num == (num = Math.abs(num)));
  num = Math.floor(num*100+0.50000000001);
  num = Math.floor(num/100).toString();
  for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
  num = num.substring(0,num.length-(4*i+3))+','+
  num.substring(num.length-(4*i+3));
  return (((sign)?'':'-') + num);
}

function getDeadline()
{
    document.write(date_deadline.toString());
}

function getHomeowners() 
{
    document.write(str_homeowners.toString());
}


function getReferrals() 
{
    document.write(str_referrals.toString());
}

function headerMessage() {
    document.write('<div align=center id=message><strong><span style="font-family: Arial;"> Grievance Day is <script type="text/javascript">getDeadline();</script><br /> We have saved money for <script type="text/javascript">getHomeowners();</script>&nbsp;homeowners</span></strong><br/><br/><strong><span style="font-family: Arial;"><span style="color: #800000;">');
    renderMessage(date_deadline, "You missed it!!", "Hurry, there are only %days% days to go!");
    document.write("</span></span></strong>");
    document.write('</div>');
    document.write("<hr />");
    
}

function headerMessage2() {
    document.write("<td>");
    document.write("<div align=center>");
    document.write('<strong><span style="font-family: Arial;"><span style="color: #800000;">');
    renderMessage(date_deadline, "You missed it!!", "Hurry, there's only %days% days to go!");
    document.write('</span></strong>');
    document.write("<\/td>");
    document.write("<\/div>");
}

function writeNavBar() {
document.write("<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">");
document.write("<tbody>");
document.write("<tr>");
document.write("<th><a href=\"index.htm\">");
document.write("Home<\/a><\/th> <th><strong><a href=\"brochure.htm\">");
document.write("Brochure<\/a><\/th> <th><a href=\"taxletter.htm\">");
document.write("Letter to Taxpayers<\/a><\/th><th><a href=\"application.htm\">");
document.write("Instant Refund<\/a><\/strong><\/th>");
document.write("<th><a href=\"faq.htm\">");
document.write("FAQ<\/a><\/th> <th><a href=\"application.htm\">");
document.write("Grievance Application<\/a><\/th> <th><a href=\"authorization.htm\">");
document.write("Authorization<\/a><\/th><th><a href=\"fee.htm\">");
document.write("Fee Schedule<\/a><\/th>");
document.write("<\/tr>");
document.write("<\/tbody>");
document.write("<\/table>");

}

function cssNavBar() {
    document.write("<div class=\"blacktabs\">");
    document.write("<ul>");
    document.write("<li><a href=\"index.htm\">Home<\/a><\/li>");
    document.write("<li><a href=\"brochure.htm\">Brochure<\/a><\/li>");
    document.write("<li><a href=\"taxletter.htm\">Letter To Taxpayers<\/a><\/li>");
    document.write("<li><a href=\"refund.htm\">Instant Refund<\/a><\/li>");
    document.write("<li><a href=\"faq.htm\">FAQ<\/a><\/li>");
    document.write("<li><a href=\"application.htm\">Grievance Application<\/a><\/li>");
    document.write("<li><a href=\"authorization.htm\">Authorization<\/a><\/li>");
    document.write("<li><a href=\"fee.htm\">Fee Schedule<\/a><\/li>");
    document.write("<\/ul>");
    document.write("<\/div>");
}

/*Width is 850 */
function writeSiteHeader() {
document.write("<div align=\"center\">");
document.write("<table id = border=\"0\" width=\"850\" cellspacing=\"0\" cellpadding=\"0\">");
document.write("<tbody>");
document.write("<tr>");
document.write("<td style=\"border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px solid #FFFFFF\" rowspan=\"2\"><img border=\"0\" src=\"images\/TITLE_a.jpg\" width=\"115\" height=\"133\" \/><\/td>");
document.write("<td><img border=\"0\" src=\"/images\/TITLE_b.jpg\" width=\"734\" height=\"100\" \/><\/td>");
document.write("<\/tr>");
document.write("<tr>");
document.write("<td bgcolor=\"#000000\" height=\"34\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px solid #FFFFFF\">");
document.write("<script type=\"text\/javascript\">    cssNavBar();<\/script>");
document.write("<\/td>");
document.write("<\/tr>");
document.write("<\/tbody>");
document.write("<\/table>");
document.write("<\/div>");
}


function writeSideBar(){
document.write("<p align=\"center\"><img border=\"0\" src=\"images\/building3.jpg\" width=\"150\" height=\"102\" \/><br \/> <strong><span style=\"font-family: Arial; font-size: x-small;\">");
document.write("    Mark Lewis Tax Grievance<\/span><\/strong><\/p>");
document.write("<p align=\"center\"><span style=\"font-family: Arial;\"><strong> <span style=\"font-size: x-small;\">");
document.write("    1685 Middle Country Rd.<br \/> Centereach, NY 11720<\/span><\/strong><\/span><\/p>");
document.write("<p align=\"center\"><span style=\"font-family: Arial;\"><strong> <span style=\"font-size: x-small;\">");
document.write("    P: (631) 696-2222<br \/> F: (631) 696-5844<br \/> <a href=\"mailto:marklewistax@aol.com\"> ");
document.write("    marklewistax@aol.com<\/a><\/span><\/strong><\/span><\/p>");
document.write("<p align=\"center\"><strong><span style=\"font-family: Arial; font-size: x-small;\"> <a target=\"_blank\" href=\"http:\/\/marklewistax.com\/Policy.htm\"> <span style=\"color: #000080;\"> <\/span> <span style=\"color: #000080;\"> <\/span><\/a><span style=\"color: #000080;\"><a href=\"privacy.htm\">");
document.write("    click here for privacy statement<\/a><\/span><\/span><\/strong><span style=\"font-family: Arial;\"><a href=\"privacy.htm\"> <\/a> <\/span><\/p>");
document.write("<p align=\"center\"><strong><span style=\"font-family: Arial; font-size: x-small;\"> <a href=\"spanish\/index.htm\">");
document.write("    Ver www.marklewistax.com en espanol<\/a><\/span><\/strong><\/Ver www.marklewistax.com en espanol<\/a><\/span><\/strong><\/p>");
document.write("<p align=\"center\"><i><strong><span style=\"font-family: Arial; font-size: medium;\"> ");
document.write("    &quot;Why Don't You Call Today &amp; Find Out If You Are Entitled To Share In That 1 ");
document.write("    Billion?&quot;<\/span><\/i><\/strong><\/p>");
document.write("<p align=\"center\">&nbsp;<\/p>");

}

function writeFooter() {
    document.write("<br\/><table width=\"850\">");
    document.write("<tr>");
    document.write("<td class=\"footer\">");
    document.write("<div align=center>");
    document.write("<strong>Mark Lewis Tax Grievance<\/strong><br/>1685 Middle Country Rd. | Centereach, NY 11720 P: (631) 696-2222 | F: (631) 696-5844 | <a href=\"mailto:marklewistax@aol.com\"> marklewistax@aol.com<\/a><\/div><\/td>");
    document.write("<\/tr>");
    document.write("<\/table>");
}

