
        /* This FooterSpec function is where you specify the footer content.
        *
        * copyrightText = just what it sounds like.
        *
        * image = if you want an image to appear on the top in the footer just enter the image
        *    filepath and file name. If you don't want an image there just leave two quotation 
        *    marks with no space in between, like ""
        */
function FooterSpec(){

  this.image = "";
  
  this.copyrightText = "";
}



        /* In this linkSpec function you specify the navigation links and their attributes.
        *
        * names = The the link text as displayed on the page. Any Whitespace entered will 
        *        appear on the page too. Each entry except from the last one must be followed  
        *        by a comma i.e. the enteries must be separated by commas. No comma should
        *        be entered before the first entery or after the last entery.
        *
        * url = The path and the file name for the file that should display when you click 
        *        the link. They have to be listed in the same order as the links in the
        *        "name" variable. the same rules apply for the comma separation as mentioned
        *        in the "name" specification above.
        *
        * caps = If the link text is written with caps only or not. If caps the buttons will 
        *            be wider if the button size is set to "equal"
        *
        * spacing = This is the space between the link buttons.
        *
        * align = Where you want the buttons in the nave bar aligned: left, center or right
        *
        * schema = this is the CSS definitions for the links. A class with the name you enter 
        *            has to be defined in your CSS file for this to work.
        *
        * fontSize = The size of the fonts for the links. The 'hover' size needs to be set 
        *            in the CSS.
        *
        * btnSize = Determines if the buttons should be equally wide or if they should be
        *            sized based on how wide the link text really is.
        */
function LinkSpec(){

  this.names = "Add&nbsp;SS,"
  				+ "Manage Messages to client,"
				+ "Manage auto email Template,"
				+ "Manage auto email message,"
				+ "Clear APC Cash,"
				+ "Log Out";
  
  this.url = "http://pt.measurable-solutions.com/clientAddSS.php,"
  				+ "http://pt.measurable-solutions.com/clientManageContactMsg.php,"
				+ "http://pt.measurable-solutions.com/admin/email_auto_html_template.php,"
				+ "http://pt.measurable-solutions.com/admin/email_auto_message.php,"
				+ "http://pt.measurable-solutions.com/admin/APC_clear_cash.php,"
				+ "http://pt.measurable-solutions.com/admin/index.php?session=out";
  
  this.caps = false; // if the link text has capital letters only (or mostly caps) it should
                      //     be set to true. Then it will make the buttons wider.
                      //        true OR false (without quotation marks)
  
  this.spaceing = "5"; // Max 28 with nav table height 150px (IE)
  
  this.align = "center"; // button alignment on the nav bar. right, center, or left
  
  this.schema = "orangeSchema"; // Any class availible in the css file (it does not affect 
                                  //    links in footer).

  this.fontSize = "14"

  this.btnSize = "individual" /* "equal" or "individual". If set to equal all link buttons will be as
                         *    wide as the button that has the most letters. Individual means
                         *    that each button will be sized according to how many letters
                         *    there are in the text of the button.
                         */




//*******************************************************************************************
//***************** You should not have to set anything below this line *********************
//*******************************************************************************************


  this.nameArr = this.names.split(",");
  this.urlArr = this.url.split(",");
  this.width = 0;
  this.height = 0;
  var letterCount = 0;
  
          // Finds out which link has the most numbers of letters and sets the width (this.width)
          // of the link <TD>'s accordingly to the found text
  for (i = 0; i < this.nameArr.length; i++){
    if (this.nameArr[i].length > letterCount) letterCount = this.nameArr[i].length;
  }
  if (this.caps){
    this.width = letterCount*(Math.floor(this.fontSize/1.25));
  }
  else this.width = letterCount*(Math.floor(this.fontSize/1.5));
  this.height = Math.floor(this.fontSize*1.3);
}





var linkSpec = new LinkSpec();
var footerSpec = new FooterSpec();


function mainNav(){
  str = '<table class="darkBlue2px" cellpadding="1" cellspacing="0" width="100%" height="30">'
      + '  <tr>'
      + '    <td align="'+linkSpec.align+'">'
      +        getLinkTable()
      + '    </td>'
      + '  </tr>'
      + '</table>';
  
  return str;
}

function footer(){
  str = '<table class="darkBlue2px" cellpadding="0" cellspacing="0" width="100%">';
    if (footerSpec.image.length > 0){
      str += '  <tr>'
      + '    <td align="center"><br />'
      +        '<img src="'+footerSpec.image+'" /></img>'
      + '    </td>'
      + '  </tr>';
    }
      str += '  <tr>'
      + '  <tr>'
      + '    <td align="center">'
      +        getFooterLinks()
      + '    </td>'
      + '  </tr>'
      + '  <tr>'
      + '    <td align="center">'
      +        '<span class="small">'+footerSpec.copyrightText+'</span>'
      + '    </td>'
      + '  </tr>'
      + '  <tr>'
      + '    <td align="center">'
      +        '<span class="small"><a class="A1Link" href="http://www.a1webguys.com" target="" >Website design</a> and development by <a class="A1Link" href="http://www.a1webguys.com" target="" >A1 Webguys</a></span>'
      + '    <br /><br /></td>'
      + '  </tr>'
      + '</table>';
  
  return str;
}


function getLinkTable(){
  var str = '<table cellspacing="'+linkSpec.spaceing+'" border="0" >'
          + "<tr>";
  for (i = 0; i < linkSpec.nameArr.length; i++){
    str += '<td class="'+linkSpec.schema+'" onclick="document.location.href=&#39;'+linkSpec.urlArr[i]+'&#39;" style="height: '+linkSpec.height+'px;';
    if (linkSpec.btnSize == "equal"){
      str += ' width: '+linkSpec.width+'px;';
    }
    else{
      var letterCount = linkSpec.nameArr[i].length;
      if (linkSpec.caps) str += ' width: '+letterCount*(Math.floor(linkSpec.fontSize/1.25))+'px;';
      else str += ' width: '+letterCount*(Math.floor(linkSpec.fontSize/1.4))+'px;';
    }
    str += '"><a class="'+linkSpec.schema+'" href="'+linkSpec.urlArr[i]+'">'
        + linkSpec.nameArr[i]
        + "</a>"
        + "</td>";
  }
  str += '</tr>'
      + '      </table>';
  return str;
}

function getFooterLinks(){
  var str = '<table cellspacing="'+linkSpec.spaceing+'" border="0" >'
          + "<tr>";
  for (i = 0; i < linkSpec.nameArr.length; i++){
    str += '<td>'
        + '<a class="'+linkSpec.schema+'" href="'+linkSpec.urlArr[i]+'">';
    if (linkSpec.nameArr.length > (i+1)){
      str += "&nbsp;"+linkSpec.nameArr[i]+"&nbsp;&nbsp;|";
    }
    else {
      str += "&nbsp;"+linkSpec.nameArr[i]+"&nbsp;";
    }
    str += "</a>"
        + "</td>";
  }
  str += '</tr>'
      + '      </table>';
  return str;
}
