<!---
mainTemplate.cfm
M Jeo, L Chalnick, inspired by Ben Edwards' contact manager

params: REQUEST.event - note that the event contains a few 
        additional arguments. pageTitle provides the title for
        the current page. It's parameterized so that this
        template can be used to display the resulting content
        from all other templates

Defines the basic HTML layout for all pages in the 
contact manager, which includes a drop down menu that
triggers two events -- newContact and listContacts
when submitted (to index.cfm).
--->
<cfset pageTitle = REQUEST.event.getArg('pageTitle') />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title><cfoutput>Contact Manager</cfoutput></title>
  <link rel="Stylesheet" type="text/css" href="views/default.css">
  <script language="JavaScript">
    function doSubmit() {
      document.menuForm.submit();
    }
  </script>
</head>
<body>
<h2>Simple Contact Manager</h2>
<form name="menuForm" action="index.cfm" method="post">
<table width="700" cellspacing="0">
  <tr bgcolor="#efefef">
    <td>
      <select name="event" onChange="doSubmit()">
        <!--- first choice is here to force the onChange event --->
        <option value="">---- Contacts ----</option> 
        <option value="listContacts">Display all contacts
        <option value="newContact">Create a new contact
      </select>
    </td>
    <td align="right" class="bigText"><cfoutput>#VARIABLES.pageTitle#</cfoutput></td>
  </tr>
</table>
</form>

<cfoutput>#REQUEST.content#</cfoutput> 
<p>&nbsp;</p>
<table cellpadding="5" width="100%" cellspacing="0">
  <tr bgcolor="#efefef"> 
    <td class="smallText">&copy; 2004, Orange Whip Studios</td>
  </tr>
</table>
</body>
</html>
