/**
 *  File:  footer.js
 *
 *  Customize footer of BGSU webpages 
 * 
 *  Usage:
 *     
 *    <script type="text/javascript" 
 *            src="http://www.bgsu.edu/scripts/footer.js">
 *    </script>
 *
 *  Insert the <script> element into the <body> of your document.
 *
 *  Constructor:
 *    Footer()                     Create footer object
 *
 *  Properties:
 *    logoDisplayed                Whether or not logo is displayed
 *                                   (default: true)
 *    logoURL                      URL of logo
 *                                   (default: http://www.bgsu.edu/images/images3/BGseal.gif)
 *    URL                          URL of the homepage
 *                                   (default: http://www.bgsu.edu/)
 *    name                         name of the office or department
 *                                   (default: empty string)
 *    location                     location of the office or department
 *                                   (default: empty string)
 *    phone                        phone number of the office or department
 *                                   (default: empty string)
 *
 *  Methods:
 *    insertLogo                   specify whether a logo is displayed
 *    setLogoURL                   specify the URL of logo
 *    setOfficeURL                 specify the URL of the homepage of the office
 *    setDepartmentURL             specify the URL of the homepage of the department
 *    setOfficeName                specify the name of the office
 *    setDepartmentName            specify the name of the department
 *    setOfficeLocation            specify the location of the office
 *    setDepartmentLocation        specify the location of the department
 *    setOfficePhone               specify the phone of the office
 *    setDepartmentPhone           specify the phone of the department
 *    write()                      write the footer object into the current document
 * 
 *  Static methods:
 *    Footer.openPrivacyPolicyWindow      open privacy policy window
 *    Footer.openDisclaimerWindow         open disclaimer window
 *
 *  Example 1: footerTest1.html
 * 
 *    <!-- basic BGSU footer -->  
 *    <script type="text/javascript" 
 *            src="http://www.bgsu.edu/scripts/footer.js">' 
 *    </script>
 *    <!-- insert the following script into the body of the document -->
 *    <script type="text/javascript">
 *       var BGSUFooter = new Footer();
 *       BGSUFooter.write();
 *    </script>
 *    
 *  Example 2: footerTest2.html
 *
 *    <!-- footer of the webpage of an office of BGSU -->  
 *    <script type="text/javascript" 
 *            src="http://www.bgsu.edu/scripts/footer.js">' 
 *    </script>
 *    <!-- insert the following script into the body of the document -->
 *    <script type="text/javascript">
 *       var ITSFooter = new Footer();
 *       ITSFooter.setOfficeName( "Information Technology Services" );
 *       ITSFooter.setOfficeLocation( "Hayes Hall 209" );
 *       ITSFooter.setOfficePhone( "419-372-2911" );
 *       ITSFooter.setOfficeURL( "http://www.bgsu.edu/offices/its/" );
 *       ITSFooter.write();
 *    </script>
 *
 *  Example 3: footerTest3.html
 *
 *    <!-- footer without logo -->  
 *    <script type="text/javascript" 
 *            src="http://www.bgsu.edu/scripts/footer.js">' 
 *    </script>
 *    <!-- insert the following script into the body of the document -->
 *    <script type="text/javascript">
 *       var ITSFooter = new Footer();
 *       ITSFooter.insertLogo(false);
 *       ITSFooter.setOfficeName( "Information Technology Services" );
 *       ITSFooter.setOfficeLocation( "Hayes Hall 209" );
 *       ITSFooter.setOfficePhone( "419-372-2911" );
 *       ITSFooter.setOfficeURL( "http://www.bgsu.edu/offices/its/" );
 *       ITSFooter.write();
 *    </script>
 *
 *  Example 4: footerTest4.html
 *
 *    <!-- footer of the webpage of a department at BGSU -->  
 *    <script type="text/javascript" 
 *            src="http://www.bgsu.edu/scripts/footer.js">' 
 *    </script>
 *    <!-- insert the following script into the body of the document -->
 *    <script type="text/javascript">
 *       var DeptFooter = new Footer();
 *       DeptFooter.setDepartmentName( "Department of Future Science" );
 *       DeptFooter.setDepartmentLocation( "Future Hall" );
 *       DeptFooter.setDepartmentPhone( "419-372-xxxx" );
 *       DeptFooter.setDepartmentURL( "http://www.bgsu.edu/departments/" );
 *       DeptFooter.write();
 *    </script>
 *    
 *  Example 5: footerTest5.html
 *
 *    <!-- footer with a logo other than BGSeal -->  
 *    <script type="text/javascript" 
 *            src="http://www.bgsu.edu/scripts/footer.js">' 
 *    </script>
 *    <!-- insert the following script into the body of the document -->
 *    <script type="text/javascript">
 *       var DeptFooter = new Footer();
 *       DeptFooter.setLogoURL( "http://www.bgsu.edu/scripts/footerLogo.gif" );
 *       DeptFooter.setDepartmentName( "Department of Future Science" );
 *       DeptFooter.setDepartmentLocation( "Future Hall" );
 *       DeptFooter.setDepartmentPhone( "419-372-xxxx" );
 *       DeptFooter.setDepartmentURL( "http://www.bgsu.edu/departments/" );
 *       DeptFooter.write();
 *    </script>
 *
 */

// this script uses PopUpWindow objects:
document.writeln( '<script type="text/javascript"' );
document.writeln( '        src="http://intranet.bgsu.edu/scripts/popUpWindow.js">' );
document.writeln( '<\/script>' );

// Footer object constructor:
function Footer() {
  this.logoDisplayed = true; 
  this.logoURL = "http://www.bgsu.edu/images/images3/BGseal.gif";
  this.URL = "http://www.bgsu.edu/"; 
  this.name = "";
  this.location = "";
  this.phone = "";
}

// static method to open privacy policy window:
function Footer_openPrivacyPolicyWindow() {
  var privacyPolicyURL = "http://www.bgsu.edu/offices/bursar/privacypolicy.htm";
  var privacyPolicyWindow = new PopUpWindow( privacyPolicyURL );
  privacyPolicyWindow.setWidth( 465 );
  privacyPolicyWindow.setHeight( 375 );
  privacyPolicyWindow.setScrollbars( true );
  privacyPolicyWindow.setResizable( true );
  privacyPolicyWindow.open();
}
Footer.openPrivacyPolicyWindow = Footer_openPrivacyPolicyWindow;

// static method to open disclaimer window:
function Footer_openDisclaimerWindow() {
  var disclaimerURL = "http://www.bgsu.edu/welcome/disclaimer.html";
  var disclaimerWindow = new PopUpWindow( disclaimerURL );
  disclaimerWindow.setWidth( 465 );
  disclaimerWindow.setHeight( 485 );
  disclaimerWindow.setScrollbars( true );
  disclaimerWindow.setResizable( true );
  disclaimerWindow.open();
} 
Footer.openDisclaimerWindow = Footer_openDisclaimerWindow;

// method to specify whether to display logo or not:
function Footer_insertLogo(true_or_false) {
  this.logoDisplayed = true_or_false;
}
Footer.prototype.insertLogo = Footer_insertLogo;

// method to specify the URL of the logo:
function Footer_setLogoURL(logoURL) {
  this.logoURL = logoURL;
}
Footer.prototype.setLogoURL = Footer_setLogoURL;

// method to specify the URL of the homepage of the office:
function Footer_setOfficeURL(officeURL) {
  if (officeURL != "")
    this.URL = officeURL;
}
Footer.prototype.setOfficeURL = Footer_setOfficeURL;

// alias method to specify the URL of the homepage of the department:
Footer.prototype.setDepartmentURL = Footer_setOfficeURL;


// method to specify the name of the office:
function Footer_setOfficeName(officeName) {
  if (officeName != "")
    this.name = officeName;
}
Footer.prototype.setOfficeName = Footer_setOfficeName;

// alias method to specify the name of the department:
Footer.prototype.setDepartmentName = Footer_setOfficeName;

// method to specify the location of the office:
function Footer_setOfficeLocation(officeLocation) {
  if (officeLocation != "")
    this.location = officeLocation;
}
Footer.prototype.setOfficeLocation = Footer_setOfficeLocation;

// alias method to specify the location of the department:
Footer.prototype.setDepartmentLocation = Footer_setOfficeLocation;

// method to specify the phone number of the office:
function Footer_setOfficePhone(officePhone) {
  if (officePhone != "")
    this.phone = officePhone;
}
Footer.prototype.setOfficePhone = Footer_setOfficePhone;

// alias method to specify the phone number of the department:
Footer.prototype.setDepartmentPhone = Footer_setOfficePhone;

// method to write Footer object into the current document: 
function Footer_write() {
  document.writeln( '<table border="0">' );
  document.writeln( '  <tr>' );

  if ( this.logoDisplayed ) {
    document.writeln( '    <td valign="top" class="footertext" nowrap>' );
    document.write( '      <a href=' );
    if ( this.logoURL == "http://www.bgsu.edu/images/images3/BGseal.gif" )
       document.write( '"http://www.bgsu.edu/"' );
    else
    {
       document.write( '"' );
       document.write( this.URL );
       document.write( '"' );
    }
    document.writeln( '>' );
    document.write( '        <img src="' );
    document.write( this.logoURL );
    document.writeln( '"' );
    document.writeln( '        border="0" alt="Logo" align="left">' );
    document.writeln( '      </a>' );
    document.writeln( '    </td>');
  }

  document.writeln( '    <td valign="top" class="footertext" nowrap>');    
  if (this.name != "") {
    document.write( '        <a class="footer" href="' );
    document.write( this.URL );
    document.writeln( '">' );
    document.writeln( this.name );
    document.writeln( '      </a>' );
    document.writeln( '<br>' );
  }

  if (this.location != "") {  
    document.writeln( this.location );
    document.writeln( '<br>' );
  }

  document.write( 'Bowling Green State University' );
  document.writeln( '<br>' );

  document.writeln( 'Bowling Green, OH 43403 USA' );
  document.writeln( '<br>' );

  if (this.phone != "") {  
    document.writeln( this.phone );
    document.write( ' | 419-372-2531' );
  }
  else {
    document.writeln( '419-372-2531' );
  }

  document.writeln( '    </td>');

  document.write( '    <td valign="top" class="footertext" nowrap>' );
  if ( this.logoDisplayed ) {
     for( i = 0; i < 12; i++)
       document.write( '&nbsp;' );
  }
  else {
     for( i = 0; i < 18; i++)
       document.write( '&nbsp;' );
  }
  document.writeln( '    </td>');

  document.writeln( '    <td valign="top" class="footertext" nowrap>' );
  document.write( document.URL );
  document.writeln( '<br>' );
  if ( Date.parse( document.lastModified ) != 0 ) {
    document.write( '<em>Last modified:</em>&nbsp;&nbsp;' );
    document.writeln( document.lastModified );
  }
  document.writeln( '<br>' );
  document.writeln( 'Copyright &copy; 2002 BGSU' );
  document.writeln( '<br>' );

  document.writeln( '<a class="footer" href="javascript:Footer.openDisclaimerWindow()"' );
  document.writeln( '   onmouseover="window.status = \'View the disclaimer\'; return true"' );
  document.writeln( '   onmouseout="window.status = \'\'">Disclaimer</a>' );
  document.writeln( '|' );

  document.writeln( '<a class="footer" href="javascript:Footer.openPrivacyPolicyWindow()"' );
  document.writeln( '   onmouseover="window.status = \'View our Privacy Policy\'; return true"' );
  document.writeln( '   onmouseout="window.status = \'\'">Privacy Policy</a>' );

  document.writeln( '    </td>' );

  document.writeln( '  </tr>' );
  document.writeln( ' </table>' );

}                                            
Footer.prototype.write = Footer_write;