//Javascript - javascript.js

// ===================================================================

/*

 This is a function for generating an email link to a specified address and
 optional text for the link and an optional subject line. If the fourth
 argument -- the link text -- is blank, then the email address is used.

 arguments:
   1. user   = user name
   2. dname  = domain name (less the type)
   3. dtype  = domain type (e.g., 'com' or 'org')
   4. lnktxt = text of the link
   5. subj   = subject line of message

*/

function mlink ( user , dname , dtype , lnktxt , subj ) {

  var linktext = '' ;

  if ( lnktxt != "" ) {
    linktext = lnktxt ;
    }
  else {
    linktext = user + '@' + dname + '.' + dtype ;
    }

  var first  = 'ma' ;
  var second = 'il' ;
  var third  = 'to:' ;

  document.write( '<a href="' ) ;
  document.write( first + second + third ) ;
  document.write( user ) ;
  document.write( '@' ) ;
  document.write( dname ) ;
  document.write( '.' ) ;
  document.write( dtype ) ;
  if ( subj != "" ) document.write( '?subject=' + subj ) ;
  document.write( '">' + linktext + '</a>' ) ;

}

// ===================================================================

// This function creates the banner at the top of each page.

function header() {

  document.write('<a name="top"></a>');

  document.write('<hr size="6">');

  document.write('<h1>');
  document.write(' <span class="headcap">B</span>oston');
  document.write(' <span class="headcap">I</span>srael');
  document.write(' <span class="headcap">A</span>ction');
  document.write(' <span class="headcap">C</span>ommittee');
  document.write('</h1>');

  document.write('<p>');
  document.write(' <img src="Boston.jpg" width="300" height="100" class="left" alt="Boston skyline">');
  document.write(' <img src="Israel.jpg" width="300" height="100" class="right" alt="Israel: wall of Jerusalem"');
  document.write('</p>');

  document.write('<br clear="all">');

}

// ===================================================================

// This function adds the logo and copyright notice at the bottom of the page.

function footer() {

  today = new Date();

  document.write('<div align="center" class="footer">');

  document.write('<table width="100%"><tr>');

  document.write('<td>');
  document.write('<img src="BIAC_Logo.gif" width="300" height="57" alt="BIAC Logo">');
  document.write('</td>');

  document.write('<td align="right">');
  document.write('Website &copy; ' + today.getFullYear() +
   ' Boston Israel Action Committee, Inc.<br>');
  document.write( '(page last updated ' + document.lastModified + ')<br>' );
  document.write('Send comment to ' +
    '<a href="mailto:webmaster@IsraelAction.org?subject=Comment from BIAC Website">Webmaster</a>.');
  document.write('</td>');

  document.write('</tr></table>');

  document.write('</div>');
  document.write('</br><br>');

}

// ===================================================================

// This code generates the menu items in the left column of the page.

function menus() {

  document.write('   <p class="menuitem"><a href="index.htm" class="menuitem">&nbsp;Home</a></p>');
  document.write('   <p class="menuitem"><a href="AboutUs.htm" class="menuitem">&nbsp;About Us</a></p>');
  document.write('   <p class="menuitem"><a href="contact.htm" class="menuitem">&nbsp;Contact Us</a></p>');
  document.write('   <p class="menuitem"><a href="events.htm" class="menuitem">&nbsp;Events</a></p>');
  document.write('   <p class="menuitem"><a href="links.htm" class="menuitem">&nbsp;Links</a></p>');
  document.write('   <p class="menuitem"><a href="membership.htm" class="menuitem">&nbsp;Membership</a></p>');
}
