function writeLogindate() {
    var this_month = new Array(12);
    this_month[0]  = "January";
    this_month[1]  = "February";
    this_month[2]  = "March";
    this_month[3]  = "April";
    this_month[4]  = "May";
    this_month[5]  = "June";
    this_month[6]  = "July";
    this_month[7]  = "August";
    this_month[8]  = "September";
    this_month[9]  = "October";
    this_month[10] = "November";
    this_month[11] = "December";
    var today = new Date();
    var day   = today.getDate();
    var month = today.getMonth();
    var year  = today.getYear();
    if (year< 1900) {
	year += 1900;
    }
    //return(this_month[month]+" "+day+", "+year);
    return(this_month[month]+ "&nbsp;" + day +", " + year);
}

/**
 * Parse a passed path into an array of Strings filled in reverse order.
 * 
 * For example if input is:
 *   /foo/bar/baz.html
 * 
 * We return an array with:
 *   array.length=3
 *   array[0] = "baz.html"
 *   array[1] = "bar"
 *   array[2] = "foo"
 * 
 * Null input gets an array with length 0
 * We treat / and \ equally
 */
function parsePath(path)
{
  // Make an empty array
  var items = new Array();

  if (path == null)
    return items;

  // Set initial indices
  var end = path.length;

  // Iterate thru the string backwards
  for (var i=path.length-1; i>=0; i--)
  {
    var c = path.charAt(i);
    if ((c == '/') || (c == '\\'))
    {
      // We are at a delimiter.  Get from here to the value of "end" as long
      // as we have not hit a double-delimiter.
      var start = i+1;
      if ((path.charAt(end-1) != '/') && (path.charAt(end-1) != '\\'))
        items[items.length] = path.substring(start, end);
      // Mark the new end value
      end = i;
    }
  }

  // Do we have one final String?
  if (end != 0)
    items[items.length] = path.substring(0, end);  
    return items;
}

// this function creates a string that writes the appropriate HTML for a button and along with it's action, 
// the final argument is a boolean that if set to true designates the action as one that requires a link or a url 
function getButton(button_name, width, action, url)
{

/*********** get the number of arguments passed to this function ************/
  var argv = getButton.arguments;
  var argc = getButton.arguments.length;

// set the variables to the values passed to the function 
  var button_name = argv[0];
  var width = argv[1];
  var action = argv[2];
  var url = "'" + argv[3] + "';";
  var title = '';
  

/************* the button action definitions ************/
// submit the form in frames[2] with no validation 
  var submit = 'top.frames[2].document.forms[0].submit();';

// validate the form in frames[2] and then submit the form if it is valid
  var validate_submit = 'if(top.frames[2].validate())' + submit;

// go back one in the history of frames[2]
  var history_back = 'top.frames[2].history.back();';

// go to a new page or url
  var go_url = 'top.frames[2].location.href = ' + url ;

// validate this page and go to a new url
  var validate_go_url = 'if(top.frames[2].validate())' + go_url;

// reset a form in frames[2]
   var reset = 'top.frames[2].document.forms[0].reset();';

// run GO function on the form in frames[2] and then submit the form if it is valid
  var Navigate_submit = 'if(top.frames[2].Navigate())' + submit;

// submit the form in frames[2] with no validation 
  var submit_go_url = 'top.frames[2].document.forms[0].submit();' + go_url;

/************ assign the appropriate action to the button *****************/  
  // action = 'top.frames[2].location.href =';
  if (action == 'go_url')
     action =  go_url;
  else if (action == 'validate_go_url')
     action = validate_go_url;
  else if(action == 'submit')
     action = submit;
  else if (action == 'history_back')
     action = history_back;
  else if (action == 'reset')
     action = reset;
  else if(action == 'validate_submit')
     action = validate_submit; 
  else if(action == 'Navigate_submit')
     action = Navigate_submit; 
  else if (action == 'submit_go_url')
     action = submit_go_url;

 
  button = '<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + button_name + '\',\'\',\'buttons/btn_' + button_name + '_on.gif\',1)" onMouseUp="' + action + url + /* + '; top.frames[1].location.href = \'titleFrame.html\*/ '"><img src="buttons/btn_' + button_name + '_off.gif" width="' + width + '" height="22" border="0" hspace="1" name="' + button_name + '"></a>';
  return button;
}

// this function uses the directory name (i.e. accounts) and the page name (i.e account_summary.html) to 
// determine, write and display appropriate page title, path and interface buttons (along with their behaviors)
// in the second frame.

function writeFrame()
{
//set the name of the folder in which the desired stylesheet resides
var css_name = "brokat";
var argv = writeFrame.arguments;
// get the href assigned to frame[2]
if (top.frames[2] == null)
{ 
   for (var i=0; i<10000; i++)
   {
     if (top.frames[2] != null)
     {
       // alert ("waited and got it");
       break;
     }
   }
   if (top.frames[2] == null)
   {
     // alert('waited and did not get it'); 
   }
     
   // setTimeout("writeFrame()", 100);
   // return;
}
/*
if (top.frames[2].location == null) 
alert('This is null');
*/
//  alert('loc is: ' + top.frames[2].location);
  var pageString = top.frames[2].location.href;
//  alert('pageString value set by top.frames[2].location.href is:' + top.frames[2].location.href);
// parse the href to get the directory and the page name which returned as part of the items array form parsePath
  items = parsePath(pageString);
  var page = items[0];
  var path = items[1];
//  alert('The page title is: ' + page);
//  alert('The path is: ' + path);


//initialize some variables
  // var title = '';
  var button1 = '';
  var button2 = '';
  var button3 = '';
  var button4 = '';
  var button5 = '';
  var button6 = '';
  var button7 = '';


//  First test to find the correct group, then test to find the specific page, then assign 
// the appropriate title string and button groupings.
  if(path == 'welcome')
  {
      path = ' ';
       if (page == 'welcome.html')
      {
         title = 'Welcome to SwadePages';
      }
}
     if(path == 'lesbian')
  {
      path = 'Lesbian&nbsp;>&nbsp;';

      if (page == 'stories.html')
      {
         title = 'Swade\'s LesbiErotica - Sign On';
      }
      if (page == 'request.html')
      {
         title = 'Swade\'s LesbiErotica - Request ID and Password';
      }
      if (page == 'requestthanks.html')
      {
         title = 'Swade\'s LesbiErotica - Thank You';
      }


  }
     else if(path == 'lesbierotica')
  {
      path = 'Lesbian&nbsp;>&nbsp;Swade\'s LesbiErotica&nbsp;>&nbsp;';
      if (page == 'deborah.html')
      {
         title = 'Deborah, &copy;&nbsp;1999';
      }
      else if (page == 'fantasea.html')
      {
         title = 'Fantasea, &copy;&nbsp;1996';
      }
     else if (page == 'altercation.html')
      {
         title = 'The Altercation, &copy;&nbsp;1988';
      }

  }

     else if(path == 'tribal_chant')
  {
      path = 'Lesbian&nbsp;>&nbsp;Tribal Chant&nbsp;>&nbsp;';
      if (page == 'les_hist.html')
      {
         title = 'Women\'s Herstory 580AD-1969';
      }
      else if (page == 'les_hist2.html')
      {
         title = 'Women\'s Herstory 1970 to 1999';
      }
      if (page == 'les_hist3.html')
      {
         title = 'Women\'s Herstory 2000 to 2002';
      }
  }
     else if(path == 'links')
  {
      path = 'Lesbian Links&nbsp;>&nbsp;';
      if (page == 'les_mus.html')
      {
         title = 'The Talent of Women&nbsp;>&nbsp;Women In Music';
      }
      else if (page == 'les_tal.html')
      {
         title = 'The Talent of Women&nbsp;>&nbsp;Women in Print, Art and Theater';
      }
      else if (page == 'les_health.html')
      {
         title = 'Women\'s Health';
      }
      else if (page == 'les_ind.html')
      {
         title = 'Lesbian Home Pages';
      }
      else if (page == 'les_kewl.html')
      {
         title = 'Great Lesbian Sites';
      }
      else if (page == 'les_atl.html')
      {
         title = 'Atlanta Lesbian Links';
      }

  }
     else if(path == 'art')
  {
      path = 'Swade\'s Line Art&nbsp;>&nbsp;';
      if (page == 'art.html')
      {
         title = 'Original Line Art by Swade';
      }
      else if (page == 'art.html')
      {
         title = '';
      }
	else if ((page == 'art_les.html')|| (page == 'art_les1.html') || (page == 'art_les2.html'))
     {
         title = 'Original LesbiErotic Line Art by Swade';
      }
  }

 else if(path == 'glbt')
  {
      path = 'GLBT&nbsp;>&nbsp;';

      if (page == 'bible.html')
      {
         title = 'What the Bible REALLY says About Queers!';
      }
      else if (page == 'gay_atl.html')
      {
         title = 'Atlanta Links';
      }
      else if (page == 'gay_org.html')
      {
         title = 'Organization Links';
      }
      else if (page == 'gay_safesex.html')
      {
         title = 'Safe Sex Links';
      }
      else if (page == 'gay_intl.html')
      {
         title = 'International Links';
      }
      else if (page == 'gay_bi_tran.html')
      {
         title = 'BiSexual and Transgendered Links';
      }
  }
   else if(path == 'gallery')
  {
      path = 'GLBT&nbsp;>&nbsp;Gallery&nbsp;>&nbsp;';

      if (page == 'symbols.html')
      {
         title = 'Origin of Gay &amp; Lesbian Symbols!';
      }
      else if (page == 'btri.html')
      {
         title = 'Black Triangles';
      }
      else if (page == 'ptri.html')
      {
         title = 'Pink Triangles';
      }
      else if (page == 'pr_flags.html')
      {
         title = 'Rainbow Flags';
      }
      else if (page == 'labrys.html')
      {
         title = 'Labrys';
      }
      else if (page == 'lambda.html')
      {
         title = 'Lambda';
      }
     else if (page == 'rbn.html')
      {
         title = 'Ribbons';
      }
      else if (page == 'anis.html')
      {
         title = 'Animated GIFs';
      }
      else if (page == 'icons.html')
      {
         title = 'Web Icons';
      }
      else if (page == 'gender.html')
      {
         title = 'Gender Symbols';
      }
      else if (page == 'misc.html')
      {
         title = 'Miscellaneous Symbols';
      }

      else if (page == 'bi_tran.html')
      {
         title = 'BiSexual and Transgendered';
      }

      else if (page == 'gallery_link.html')
      {
         title = 'Gallery Link';
      }

  }
 else if(path == 'other')
  {
      path = 'Other&nbsp;Interests&nbsp;>&nbsp;';

      if (page == 'ref.html')
      {
         title = 'Reference Linkage';
      }
  }
 else if(path == 'oz')
  {
      path = 'My Trip to Australia&nbsp;>&nbsp;';

      if (page == 'oz1.html')
      {
         title = 'Week 1';
      }
      else if (page == 'oz2.html')
      {
         title = 'Week 2';
      }
      else if (page == 'oz3.html')
      {
         title = 'Week 3';
      }

  }

 else if(path == 'dreams')
  {
      path = 'Other&nbsp;Interests&nbsp;>&nbsp;Dreams Analysis&nbsp;>&nbsp;';

      if (page == 'dream.html')
      {
         title = 'Dreams Analysis';
      }
      if (page == 'dreamlst.html')
      {
         title = 'Dream Symbols';
      }

  }

 else if(path == 'site')
  {
      path = 'Site&nbsp;>&nbsp;';

      if (page == 'copyright.html')
      {
         title = 'Copyright & Privacy';
      }
      else if (page == 'webrings.html')
      {
         title = 'Webrings';
      }
      else if (page == 'associations.html')
      {
         title = 'Membership Associations';
      }
      else if (page == 'awards.html')
      {
         title = 'Awards &amp; Accolades';
      }
      else if (page == 'sitemap.html')
      {
         title = 'Site Map';
      }
      else if ((page == 'addalink.html') || (addalink.html))
      {
         title = 'Add a Link Request';
      }
  }


var myalert = '<script language=javascript>document.write(writeLogindate())</script>';
// var myalert = '<table cellpadding="2" cellspacing="0" border="0"><tr><td><font class="alert">Your final <a href="#" class="alert" onMouseUp="top.frames[2].location.href =\'inforeporting/control_disbursement.html\';">Control Disbursement</a> amount is available and seven new <a href="#" class="alert" onMouseUp="top.content.location.href =\'wires/approvewires.html\';">wires</a> need approval.</font></td></tr></table>';
/********************* write the HTML for the titleFrame including any buttons and their actions ****************************/
var begin_tags = '<html><head><title>My Title</title><link rel="stylesheet" href="style/swadepages.css"></script></head><body bgcolor="#ffffff" class="interface" margin="0" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">';
var end_tags = '<script type="text/Javascript" src="../scripts/btitle.js"></script></body></html>';
var format_width = '771';
var lmenu_height = '2';
var left_margin = '20';
var title_height='27';
var message_height='48';
var rule_height ='4';
var taskbar_height = '30';
var titleFrame = 
// begin_tags + '<table width="' + format_width + '"border="0" cellspacing="0" cellpadding="0"><tr><td class="menuBar" height="' + lmenu_height + '"><img src="images/clr.gif" height="1" width="1" alt="" /></td></tr></table><table border="0" cellspacing="0" cellpadding="0" width="780"><tr><td valign="bottom" height="30" width="20"><img src="images/clr.gif" height="30" width="20" border="0" alt="spacer image"></td><td valign="bottom" height="' + title_height + '">&nbsp;</td><td align="right">&nbsp;</td></tr><tr><td valign="bottom" height="30" width="20"><img src="images/clr.gif" height="30" width="20" border="0" alt="spacer image"></td><td valign="bottom" height="' + title_height + '">&nbsp;<font class="path">' + path + title + '</font></td><td align="right"><font class="alert">' + myalert + '</font></td></tr></table>' + end_tags;
begin_tags + '<table border="0" cellspacing="0" cellpadding="0" width="780"><tr><td valign="bottom" height="30" width="20"><img src="images/clr.gif" height="30" width="20" border="0" alt="spacer image"></td><td valign="bottom" height="' + title_height + '" align="right" width="739"><font class="alert">'       + myalert + '</font></td><td align="right" width="21"><img src="images/clr.gif" height="30" width="20" border="0" alt="spacer image"></td></tr><tr>     <td valign="bottom" height="30" width="20"><img src="images/clr.gif" height="30" width="20" border="0" alt="spacer image"></td><td valign="bottom" height="' + title_height + '" width="739">&nbsp;<font class="path">'  + path + title + '</font></td><td align="right" width="21">&nbsp;</td></tr><tr><td><img src="images/clr.gif" width="20" height="3" border="0" alt="spacer image"></td><td colspan="2"><img src="images/gradient.gif" width="740" height="3" border="0" alt="gradient image"></table>' + end_tags;
document.write(titleFrame);
return title;

// return the title variable as a value to the page so that it can be used to test
// whether a reload of the title page is necessary (we have a missmatch with
// content being presented in the third frame)
// alert('The value of title is:' + title);
}
