// vim: set expandtab tabstop=3 shiftwidth=3 foldmethod=marker:
// ------------------------------------------------------------
//   Author: Brian Clark (brian@spamcop.net)
//     File: js/header.js
//  Created: 05:28:53 PM EDT Tue, April 29, 2008
// Modified: 09:55:14 PM EDT Tue, June 24, 2008
// ------------------------------------------------------------

// the purpose of this convoluted mess is to work around IE's strange 
// "Click to activate this control" feature that would be present without it.
function displayFlashHeader() {
   
   var loc = document.location + ''; // force document.location to string
   var place = loc.match(/^http.+\/([a-z]+).php/);
   var xmlfile = null;
   if (!place) {
      xmlfile = 'header';
   } else {
      switch (place[1]) {
         case 'index':
            xmlfile = 'header';
            break;
         case 'staff':
            xmlfile = 'staff';
            break;
         case 'billing':
            xmlfile = 'staff';
            break;
         case 'services':
            xmlfile = 'services';
            break;
         case 'srh':
            xmlfile = 'srh';
            break;
         case 'history':
            xmlfile = 'srh';
            break;
         case 'surgery':
            xmlfile = 'surgery';
            break;
         case 'pediatric':
            xmlfile = 'pediatric';
            break;
         case 'anesthesia':
            xmlfile = 'anesthesia';
            break;
         default:
            xmlfile = 'header';
            break;
      }
   }
   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
   document.write('codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" name="'+ xmlfile +'" width="761" height="186" align="center">');
   document.write('<param name=movie value="header.swf">');
   document.write('<param name=FlashVars value="xml_name='+ xmlfile +'.xml">');
   document.write('<param name=menu value=false>');
   document.write('<param name=quality value=high>');
   document.write('<param name=scale value=noscale>');
   document.write('<param name=salign value=LT>');
   document.write('<param name=wmode value=opaque>');
   document.write('<param name=bgcolor value=#FFFFFF>');
   document.write('<embed src="header.swf" width="761" height="186" align="center" flashvars="xml_name='+ xmlfile +'.xml" ');
   document.write('menu=false quality=high scale=noscale salign=LT wmode=opaque bgcolor=#FFFFFF name="'+ xmlfile +'" ');
   document.write('type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer"></embed></object>');

}

