#!/usr/bin/perl
# Biography Builder processing 
#

require "./cgi-bin.pl";

$ret = &ReadParse;
&CgiDie("Error in reading and parsing of CGI input") if !defined $ret;

%bio = (
"Andie", "Andie has a perpetual smile and a spring in her step. She finds satisfaction in making people happy and is a great listener. Her abundance of energy comes from exercise and a positive attitude. She is a gymnast and loves to dance. Her popularity is a result of her modesty. To her, it is not perfection, but the acceptance of imperfection, that leads to nirvana.",
"Natasha", "Natasha is the spirit of any season. She loves to wrap gifts and enjoys giving them to family and friends for holidays and special occasions. To strangers, she warmly gives and receives smiles. She plays tennis and is competitive, but fair. She has mutual admiration for both winners and non-winners; she has been in both positions. She develops her abilities through hard work and a supportive family.",
"Sophia", "All the world is a stage for Sophia and she pays very close attention to the props and the script. She strives to make her surroundings beautiful and is aware of the statement her appearance makes. She designs and builds unique wooden boxes for the exotic flowers and other plants she grows. She hates litter and the emotional ugliness in the world.",
"Wes", "Wes has a sharp sense for business and sells his abilities agressively. As a child, he always had money from working or selling things. He is committed to his friends and his work -- not always in that order. He strives to become a \"success,\" driven by the adrenaline of living on the edge. He enjoys conversation and commands a breadth of experience.",
"Marc", "\"Some assembly required\" is a label that promises a few minutes, or hours, of entertainment for Marc; he is mechanically-inclined. His preference for simplicity in design applies to many aspects of his life -- his furniture, his car, his schedule, his friends. . . There is a calm satisfaction in his demeanor and he is not afraid to try new things -- seeking to understand more about himself in the context of new experiences.",
"Steve", "Steve always says \"some of the best things in life are free. . . and recyclable.\" He has a social conscience, which he displays by volunteering time to the current environmental movement. He reuses his grocery bags and performs the maintenance required to keep his car tuned-up. He designs computer games and has played saxaphone since grade school. He is a sports spectator.",
"Laura", "If Laura were to write a personal ad, she might describe herself as \"picture perfect.\" She is a photographer with a sense of humor. She has modeled, but prefers to be behind the camera. She communicates visually and prefers personal contact to the telephone. She is assertive, yet sensitive to people's feelings. Her dream is to ride and raise horses.",
"Dave", "If Dave was what he ate, he would certainly not contain any additives or preservatives. Among the items he regularly reads are newspapers, periodicals and food labels. He is well-informed and is excellent at defending his opinions with reason. He is inventive and comfortable with science, often predicting future advances in technology.",
"Christina", "Christina is wide-eyed and excitable. She has a bubbly, champagne spirit and enjoys sharing good times with other people. She is an avid reader and writer of essays and stories. She incorporates her traits, as well as those of the people she meets, in the characters of her stories. She is a meticulous person -- well-organized financially and socially. She enjoys solving brain-teasers and puzzles.",
"Griffin", "For Griffin, time is of the essence. His daytimer always reflects a well-planned schedule, including time for his recreations which are important to him -- cycling, sailing, playing hoops and running with his dog, Mortimer. He is a good samaritan and is flexible with his schedule should a friend or stranger need his help. He is a good cook and enjoys preparing dinner for friends.",
"Jasmine", "Jasmine enjoys coffee, though she doesn't drink much of it outside of caf&eacute;s. She is stimulated, not by the coffee -- it is usually decaffeinated -- but by the atmosphere of the caf&eacute; and a discussion with a friend. She enjoys debate and education and is not abashed to ask \"why?\" Astronomy is one of her interests because it confronts (wo)man's wisdom and place in existence.",
"Peter", "The theory of evolution states that we came from the ocean -- that's where \"they\" are wrong, Peter would argue. A truly evolutionary species would choose to stay in the ocean and catch some waves. He sees the surfer as an icon of man in harmony with nature. When he isn't drawing, he prefers to be engaged in some outdoor activity -- at the beach or elsewhere.",
"Jeannine", "Jeannine puts her best foot forward and isn't afraid to take the next step. Her sincerety and gratitude are infectious. She collaborates to achieve personal and professional goals, which include having fun. She enjoys backpacking and the splendor of nature. Her job is a means, rather than an end, to living a life filled with meaningful relationships and accomplishments.",
"Ed", "To Ed, discovery is the reward of a relentless pursuit. He approaches problems with optimism and solves them with persistence. He enjoys listening to jazz and appreciates its subtle patterns and unexpected incongruities. In discussions with family members, friends and co-workers, he concentrates on understanding before reacting. His hobbies include building and flying model airplanes.",
"Julie", "Julie is good at adapting and rolling with change. She approaches obstacles with imagination and good humor. \"Life has its ups and downs,\" she says, \"especially for a mogul skier.\" She has a passion for winter sports and activities. Her actions are precise and deliberate, an attribute of her skill as an athlete. As a team player, she values diversity and the power of collaboration to attain a common goal.",
"John", "For life's adventure, John likes to be well-equipped. His gear is important and performance counts. He makes bold moves, but takes care to weigh his options. He is dramatic and acts hospitably during holidays and special occasions. He is a player in life's rich pageant, rehearsing and performing, changing roles and costumes,  and living as a spectator and spectacle of society.",
"Mel", "Mel has a good sense of humor. He makes people feel comfortable by smiling and joking with them. He feels lucky and has had many fortunate experiences. He genuinely cares about people and is charitable in non-\"tax deductible\" ways. He does not seek recognition for his good deeds; his generosity is its own reward. He follows a simple business ethic: provide a good product or service at a reasonable price.",
"Patrick", "Patrick takes his imagination seriously. He is open-minded and respects people's opinions that may differ from his own. Every day, he explores new processes or places that lead him to new discoveries. He strives to keep learning and preaches what he practices. He admires musicians, artists and craftspeople for their contributions to the soul of humankind.",
"Scott", "Scott studies things closely. He recognizes nuances in his environment that most people overlook. He regularly examines his life for areas of improvement. His \"big picture\" is to make meaningful, moral contributions to the advancement of science. People admire his candor and sportsmanship -- qualities that help him approach challenges with determination.",
"Tara", "Tara is a good judge of character. She is excellent at facilitating discussions and negotiating with salespeople. In a debate, her goal is compromise rather than conquest. She respects diverse lifestyles and opinions. She enjoys group activities that foster cooperation and personal growth. Her passion for adventure rubs off on her friends. Water skiing and cycling with her father are fond memories of her childhood.",
);

sub buildList {
   local($fig,$cell,$bio) = @_;
   if (($fig eq "Laura") || ($fig eq "Andie") || ($fig eq "Natasha") || ($fig eq "Christina") || ($fig eq "Jasmine") || ($fig eq "Sophia")) {
      print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Select&nbsp;Biography:</FONT>&nbsp;<SELECT NAME=\"", $cell, "bio\" onChange=\"changeBio()\"><OPTION VALUE=\"Laura\"", ($bio eq "Laura") && " SELECTED",">Laura\n";
      print "<OPTION VALUE=\"Andie\"", ($bio eq "Andie") && " SELECTED",">Andie\n";
      print "<OPTION VALUE=\"Natasha\"", ($bio eq "Natasha") && " SELECTED",">Natasha\n";
      print "<OPTION VALUE=\"Christina\"", ($bio eq "Christina") && " SELECTED",">Christina\n";
      print "<OPTION VALUE=\"Jasmine\"", ($bio eq "Jasmine") && " SELECTED",">Jasmine\n";
      print "<OPTION VALUE=\"Sophia\"", ($bio eq "Sophia") && " SELECTED",">Sophia\n";
      print "<OPTION VALUE=\"Jeannine\"", ($bio eq "Jeannine") && " SELECTED",">Jeannine\n";
      print "<OPTION VALUE=\"Julie\"", ($bio eq "Julie") && " SELECTED",">Julie\n";
      print "<OPTION VALUE=\"Tara\"", ($bio eq "Tara") && " SELECTED",">Tara\n";
      print "</SELECT>";
   }
   else {
      print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Select&nbsp;Biography:</FONT>&nbsp;<SELECT NAME=\"", $cell, "bio\" onChange=\"changeBio()\"><OPTION VALUE=\"Dave\"", ($bio eq "Dave") && " SELECTED",">Dave\n";
      print "<OPTION VALUE=\"Steve\"", ($bio eq "Steve") && " SELECTED",">Steve\n";
      print "<OPTION VALUE=\"Marc\"", ($bio eq "Marc") && " SELECTED",">Marc\n";
      print "<OPTION VALUE=\"Griffin\"", ($bio eq "Griffin") && " SELECTED",">Griffin\n";
      print "<OPTION VALUE=\"Wes\"", ($bio eq "Wes") && " SELECTED",">Wes\n";
      print "<OPTION VALUE=\"Peter\"", ($bio eq "Peter") && " SELECTED",">Peter\n";
      print "<OPTION VALUE=\"Ed\"", ($bio eq "Ed") && " SELECTED",">Ed\n";
      print "<OPTION VALUE=\"John\"", ($bio eq "John") && " SELECTED",">John\n";
      print "<OPTION VALUE=\"Mel\"", ($bio eq "Mel") && " SELECTED",">Mel\n";
      print "<OPTION VALUE=\"Patrick\"", ($bio eq "Patrick") && " SELECTED",">Patrick\n";
      print "<OPTION VALUE=\"Scott\"", ($bio eq "Scott") && " SELECTED",">Scott\n";
      print "</SELECT>";
   }
}

if ($in{'status'} eq "printing") {
   print "Pragma-type: no-cache\n";
   print "Content-type: text/html\n\n";
   print "<HEAD>\n";
   $url = "";
   if ($in{'afig'}) {
      $url = join("","afig=",$in{'afig'},"&abio=",$in{'abio'},"&aname=",$in{'aname'});
   }
   if ($in{'bfig'}) {
      $url = join("",$url,"&bfig=",$in{'bfig'},"&bbio=",$in{'bbio'},"&bname=",$in{'bname'});
   }
   if ($in{'cfig'}) {
      $url = join("",$url,"&cfig=",$in{'cfig'},"&cbio=",$in{'cbio'},"&cname=",$in{'cname'});
   }
   if ($in{'dfig'}) {
      $url = join("",$url,"&dfig=",$in{'dfig'},"&dbio=",$in{'dbio'},"&dname=",$in{'dname'});
   }
   if ($in{'efig'}) {
      $url = join("",$url,"&efig=",$in{'efig'},"&ebio=",$in{'ebio'},"&ename=",$in{'ename'});
   }
   if ($in{'ffig'}) {
      $url = join("",$url,"&ffig=",$in{'ffig'},"&fbio=",$in{'fbio'},"&fname=",$in{'fname'});
   }
   print "<META HTTP-EQUIV=REFRESH CONTENT=0;URL=http://www2.fab7.com/builder.pl?", $url, ">\n";
   print "</HEAD>\n";
   print "<BODY></BODY>\n";
}
else {
   print "Pragma-type: no-cache\n";
   print "Content-type: text/html\n\n";
   print "<HEAD>\n";
   print "<TITLE>The Upwardly Mobile: Biography Builder</TITLE>\n";
   print "<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"http://www.fab7.com/styles.css\">\n";
   print "<STYLE TYPE=\"text/css\">\n";
   print "BODY { background: \#ffffff url(http://www.fab7.com/um/images/side_bar.gif) repeat-y fixed top left }\n";
   print "</STYLE>\n";
   print "<SCRIPT>\n";
   print "function buttonOn(name){\n";
   print "   document.images[name].src = \"http://www.fab7.com/um/images/nav_arrow.gif\";\n";
   print "}\n";
   print "function buttonOff(name){\n";
   print "   document.images[name].src = \"http://www.fab7.com/um/images/1x1.gif\";\n";
   print "}\n";
   print "function mobileA(){\n";
   print "   window.location=\"http://www2.fab7.com/bio_builder.pl?afig=Natasha&abio=Natasha&aname=Natasha&bfig=Marc&bbio=Marc&bname=Marc&cfig=Andie&cbio=Andie&cname=Andie&dfig=Steve&dbio=Steve&dname=Steve&efig=Laura&ebio=Laura&ename=Laura&ffig=Dave&fbio=Dave&fname=Dave\";\n";
   print "}\n";
   print "function mobileB(){\n";
   print "   window.location=\"http://www2.fab7.com/bio_builder.pl?afig=Christina&abio=Christina&aname=Christina&bfig=Griffin&bbio=Griffin&bname=Griffin&cfig=Jasmine&cbio=Jasmine&cname=Jasmine&dfig=Wes&dbio=Wes&dname=Wes&efig=Sophia&ebio=Sophia&ename=Sophia&ffig=Peter&fbio=Peter&fname=Peter\";\n";
   print "}\n";
   print "function addFigure(name) {\n";
   if (!$in{'cellfocus'} && !$in{'ffig'}) {
      $cellfocus = "a";
   }
   elsif (!$in{'cellfocus'} && $in{'ffig'}) {
      $cellfocus = "g";
   }
   else {
      $cellfocus = $in{'cellfocus'};
   }
   ($in{'cellfocus'} eq "a" && $in{'afig'}) && ($cellfocus = "b");
   ($in{'cellfocus'} eq "b" && $in{'bfig'}) && ($cellfocus = "c");
   ($in{'cellfocus'} eq "c" && $in{'cfig'}) && ($cellfocus = "d");
   ($in{'cellfocus'} eq "d" && $in{'dfig'}) && ($cellfocus = "e");
   ($in{'cellfocus'} eq "e" && $in{'efig'}) && ($cellfocus = "f");
   ($in{'cellfocus'} eq "f" && $in{'ffig'}) && ($cellfocus = "g");
   print "   document.buildform.action = \"bio_builder.pl\";\n";
   print "   document.buildform.", $cellfocus, "fig.value=name;\n";
   print "   document.buildform.", $cellfocus, "bio.value=name;\n";
   print "   document.buildform.", $cellfocus, "name.value=name;\n";
   print "   document.buildform.submit();\n";
   print "}\n";
   print "function changeBio(){\n";
   print "   document.buildform.action = \"bio_builder.pl\";\n";
   print "   document.buildform.submit();\n";
   print "}\n";
   print "function changeName(){\n";
   print "   document.buildform.action = \"bio_builder.pl\";\n";
   print "   document.buildform.submit();\n";
   print "}\n";
   print "function printForm(){\n";
   print "   document.buildform.action = \"builder.pl\";\n";
   print "   document.buildform.submit();\n";
   print "}\n";
   print "</SCRIPT>\n";
   print "</HEAD>\n";
   print "<BODY MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" LEFTMARGIN=\"0\" TOPMARGIN=\"0\">\n";
   print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" WIDTH=\"740\">\n";
   print "<TR>\n";
   print "<TD><IMG SRC=\"http://www.fab7.com/um/images/head_um1.gif\" WIDTH=\"167\" HEIGHT=\"103\"></TD>\n";
   print "<TD><IMG SRC=\"http://www.fab7.com/um/images/head_um2.gif\" WIDTH=\"288\" HEIGHT=\"56\"><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/head_um3_bio.gif\" WIDTH=\"288\" HEIGHT=\"29\"><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/head_um4.gif\" WIDTH=\"288\" HEIGHT=\"18\"></TD>\n";
   print "<TD NOWRAP><IMG SRC=\"http://www.fab7.com/um/images/head_um5.gif\" WIDTH=\"150\" HEIGHT=\"103\"><IMG SRC=\"http://www.fab7.com/um/images/head_graypix.gif\" WIDTH=\"170\" HEIGHT=\"103\"></TD>\n";
   print "</TR>\n";
   print "</TABLE>\n";
   print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
   print "<TR VALIGN=\"TOP\">\n";
   print "<TD NOWRAP><IMG SRC=\"http://www.fab7.com/um/images/nav1_sp.gif\" WIDTH=\"151\" HEIGHT=\"26\"><BR>\n";
   print "<A HREF=\"http://www.fab7.com/um/how_to_buy.html\" onMouseOver=\"buttonOn('how')\"  onMouseOut=\"buttonOff('how')\"><IMG SRC=\"http://www.fab7.com/um/images/nav_how_button_off.gif\" WIDTH=\"151\" HEIGHT=\"20\" BORDER=\"0\"></A><IMG NAME=\"how\" SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"16\" HEIGHT=\"20\"><BR>\n";
   print "<A HREF=\"http://www.fab7.com/um/where_to_see.html\" onMouseOver=\"buttonOn('where')\"  onMouseOut=\"buttonOff('where')\"><IMG SRC=\"http://www.fab7.com/um/images/nav_where_button_off.gif\" WIDTH=\"151\" HEIGHT=\"20\" BORDER=\"0\"></A><IMG NAME=\"where\" SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"16\" HEIGHT=\"20\"><BR>\n";
   print "<A HREF=\"http://www.fab7.com/um/get_to_know.html\" onMouseOver=\"buttonOn('get')\"  onMouseOut=\"buttonOff('get')\"><IMG SRC=\"http://www.fab7.com/um/images/nav_get_button_off.gif\" WIDTH=\"151\" HEIGHT=\"20\" BORDER=\"0\"></A><IMG NAME=\"get\" SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"16\" HEIGHT=\"20\"><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/nav2_sp.gif\" WIDTH=\"151\" HEIGHT=\"20\"><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/nav_bio_button_on.gif\" WIDTH=\"151\" HEIGHT=\"20\"><BR>\n";
   print "<A HREF=\"http://www.fab7.com/um/community.html\" onMouseOver=\"buttonOn('comm')\"  onMouseOut=\"buttonOff('comm')\"><IMG SRC=\"http://www.fab7.com/um/images/nav_comm_button_off.gif\" WIDTH=\"151\" HEIGHT=\"20\" BORDER=\"0\"></A><IMG NAME=\"comm\" SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"16\" HEIGHT=\"20\"><BR>\n";
   print "<A HREF=\"http://www.fab7.com/um/survey.html\" onMouseOver=\"buttonOn('survey')\"  onMouseOut=\"buttonOff('survey')\"><IMG SRC=\"http://www.fab7.com/um/images/nav_survey_button_off.gif\" WIDTH=\"151\" HEIGHT=\"20\" BORDER=\"0\"></A><IMG NAME=\"survey\" SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"16\" HEIGHT=\"20\"><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/nav3_sp.gif\" WIDTH=\"151\" HEIGHT=\"20\"><BR>\n";
   print "<A HREF=\"http://www.fab7.com/um/index.html\" onMouseOver=\"buttonOn('home')\"  onMouseOut=\"buttonOff('home')\"><IMG SRC=\"http://www.fab7.com/um/images/nav_home_button_off.gif\" WIDTH=\"151\" HEIGHT=\"20\" BORDER=\"0\"></A><IMG NAME=\"home\" SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"16\" HEIGHT=\"20\"><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/nav4_sp.gif\" WIDTH=\"151\" HEIGHT=\"303\" BORDER=\"0\"></TD>\n";
   print "<TD>\n";
   print "<FORM NAME=\"buildform\" ACTION=\"http://www2.fab7.com/bio_builder.pl\" METHOD=\"POST\">\n";
   print "<INPUT TYPE=\"HIDDEN\" NAME=\"status\" VALUE=\"preparing\">\n";
   print "<INPUT TYPE=\"HIDDEN\" NAME=\"cellfocus\" VALUE=\"", $cellfocus,"\">\n";
   print "<INPUT TYPE=\"HIDDEN\" NAME=\"", $cellfocus, "fig\" VALUE=\"\">\n";
   print "<INPUT TYPE=\"HIDDEN\" NAME=\"", $cellfocus, "bio\" VALUE=\"\">\n";
   print "<INPUT TYPE=\"HIDDEN\" NAME=\"", $cellfocus, "name\" VALUE=\"\">\n";
   print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"10\" BORDER=\"0\" WIDTH=\"600\">\n";
   print "<TR>\n";
   print "<TD COLSPAN=\"2\" ALIGN=\"CENTER\"><P><BR><B>Click on a figure below to add it to the page. To customize Version \n";
   print "A or Version B of the mobile you may also click on A or B below to display all of the figures.</B>\n";
   print "<P>When you have finished customizing the names and biographies of the figures, click \"Display Printer Page\" to create a page\n";
   print "to print from your web browser.</P>\n";
   print "<A HREF=\"javascript:mobileA()\" onMouseOver=\"self.status='Mobile Version A'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/bb_A.gif\" WIDTH=\"92\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Laura')\" onMouseOver=\"self.status='Laura'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Laura.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Andie')\" onMouseOver=\"self.status='Andie'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Andie.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Natasha')\" onMouseOver=\"self.status='Natasha'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Natasha.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><IMG SRC=\"http://www.fab7.com/um/images/bb_female.gif\" WIDTH=\"39\" HEIGHT=\"68\"><A HREF=\"javascript:addFigure('Christina')\" onMouseOver=\"self.status='Christina'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Christina.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Jasmine')\" onMouseOver=\"self.status='Jasmine'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Jasmine.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Sophia')\" onMouseOver=\"self.status='Sophia'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Sophia.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:mobileB()\" onMouseOver=\"self.status='Mobile Version B'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/bb_B.gif\" WIDTH=\"92\" HEIGHT=\"68\" BORDER=\"0\"></A><BR>\n";
   print "<IMG SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"92\" HEIGHT=\"68\"><A HREF=\"javascript:addFigure('Dave')\" onMouseOver=\"self.status='Dave'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Dave.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Steve')\" onMouseOver=\"self.status='Steve'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Steve.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Marc')\" onMouseOver=\"self.status='Marc'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Marc.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><IMG SRC=\"http://www.fab7.com/um/images/bb_male.gif\" WIDTH=\"39\" HEIGHT=\"68\"><A HREF=\"javascript:addFigure('Griffin')\" onMouseOver=\"self.status='Griffin'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Griffin.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Wes')\" onMouseOver=\"self.status='Wes'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Wes.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><A HREF=\"javascript:addFigure('Peter')\" onMouseOver=\"self.status='Peter'; return true\"><IMG SRC=\"http://www.fab7.com/um/images/figures/bb_Peter.gif\" WIDTH=\"47\" HEIGHT=\"68\" BORDER=\"0\"></A><IMG SRC=\"http://www.fab7.com/um/images/1x1.gif\" WIDTH=\"92\" HEIGHT=\"68\"></TD>\n";
   print "</TR>\n";
   
   if ($in{'afig'} || $in{'bfig'}) {
      if ($in{'afig'}) { print "<INPUT TYPE=\"HIDDEN\" NAME=\"afig\" VALUE=\"", $in{'afig'}, "\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         print "<TD>\n";
         print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         $newbio = $bio{$in{'abio'}};
         $newbio =~ s/$in{'abio'}/$in{'aname'}/g;
         print "<TD ALIGN=\"RIGHT\"><IMG SRC=\"/images/1x1.gif\" WIDTH=\"175\" HEIGHT=\"1\"><BR>\n";
         &buildList($in{'afig'},'a',$in{'abio'});
         print "<BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Choose&nbsp;Name:</FONT>&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"aname\" VALUE=\"", $in{'aname'}, "\" onChange=\"changeName()\"><BR><BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\">", $newbio, "</FONT></TD>\n";
         print "<TD><IMG SRC=\"/images/", $in{'afig'}, "_r.gif\" WIDTH=\"95\" HEIGHT=\"145\"></TD>\n";
         print "</TR>\n";
         print "</TABLE>\n";
         print "</TD>\n";
      }
      else { print "<TR VALIGN=\"TOP\"><TD></TD>\n"; }
   
      if ($in{'bfig'}) { print "<INPUT TYPE=\"HIDDEN\" NAME=\"bfig\" VALUE=\"", $in{'bfig'}, "\">\n";
         print "<TD>\n";
         print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         print "<TD><IMG SRC=\"/images/", $in{'bfig'}, "_l.gif\" WIDTH=\"95\" HEIGHT=\"145\"></TD>\n";
         $newbio = $bio{$in{'bbio'}};
         $newbio =~ s/$in{'bbio'}/$in{'bname'}/g;
         print "<TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"175\" HEIGHT=\"1\"><BR>\n";
         &buildList($in{'bfig'},'b',$in{'bbio'});
         print "<BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Choose&nbsp;Name:</FONT>&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"bname\" VALUE=\"", $in{'bname'}, "\" onChange=\"changeName()\"><BR><BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\">", $newbio, "</FONT></TD>\n";
         print "</TR>\n";
         print "</TABLE>\n";
         print "</TD>\n";
         print "</TR>\n";
      }
      else { 
         print "<TD VALIGN=\"MIDDLE\" ALIGN=\"CENTER\"><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"1\"><BR>\n";
         print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\"><B>Click another figure or \"Display Printer Page.\"</B></FONT></TD></TR>\n";
      }
   }
   else {
      print "<TR VALIGN=\"MIDDLE\" ALIGN=\"CENTER\"><TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"1\"><BR>\n";
      print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\"><B>Click a figure or mobile version above.</B></FONT></TD>\n";
      print "<TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"145\"></TD></TR>\n";
   }
   
   if ($in{'afig'} && $in{'bfig'} && !$in{'cfig'}) { 
      print "<TR VALIGN=\"MIDDLE\" ALIGN=\"CENTER\"><TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"1\"><BR>\n";
      print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\"><B>Click another figure or \"Display Printer Page.\"</B></FONT></TD>\n";
      print "<TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"145\"></TD></TR>\n";
   }
   
   if ($in{'cfig'} || $in{'dfig'}) {
      if ($in{'cfig'}) { print "<INPUT TYPE=\"HIDDEN\" NAME=\"cfig\" VALUE=\"", $in{'cfig'}, "\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         print "<TD>\n";
         print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         $newbio = $bio{$in{'cbio'}};
         $newbio =~ s/$in{'cbio'}/$in{'cname'}/g;
         print "<TD ALIGN=\"RIGHT\"><IMG SRC=\"/images/1x1.gif\" WIDTH=\"175\" HEIGHT=\"1\"><BR>\n";
         &buildList($in{'cfig'},'c',$in{'cbio'});
         print "<BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Choose&nbsp;Name:</FONT>&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"cname\" VALUE=\"", $in{'cname'}, "\" onChange=\"changeName()\"><BR><BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\">", $newbio, "</FONT></TD>\n";
         print "<TD><IMG SRC=\"/images/", $in{'cfig'}, "_r.gif\" WIDTH=\"95\" HEIGHT=\"145\"></TD>\n";
         print "</TR>\n";
         print "</TABLE>\n";
         print "</TD>\n";
      }
      else { print "<TR VALIGN=\"TOP\"><TD></TD>\n"; }
   
      if ($in{'dfig'}) { print "<INPUT TYPE=\"HIDDEN\" NAME=\"dfig\" VALUE=\"", $in{'dfig'}, "\">\n";
         print "<TD>\n";
         print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         print "<TD><IMG SRC=\"/images/", $in{'dfig'}, "_l.gif\" WIDTH=\"95\" HEIGHT=\"145\"></TD>\n";
         $newbio = $bio{$in{'dbio'}};
         $newbio =~ s/$in{'dbio'}/$in{'dname'}/g;
         print "<TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"175\" HEIGHT=\"1\"><BR>\n";
         &buildList($in{'dfig'},'d',$in{'dbio'});
         print "<BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Choose&nbsp;Name:</FONT>&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"dname\" VALUE=\"", $in{'dname'}, "\" onChange=\"changeName()\"><BR><BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\">", $newbio, "</FONT></TD>\n";
         print "</TR>\n";
         print "</TABLE>\n";
         print "</TD>\n";
         print "</TR>\n";
      }
      else { 
         print "<TD VALIGN=\"MIDDLE\" ALIGN=\"CENTER\"><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"1\"><BR>\n";
         print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\"><B>Click another figure or \"Display Printer Page.\"</B></FONT></TD></TR>\n";
      }
   }
   
   if ($in{'afig'} && $in{'bfig'} && $in{'cfig'} && $in{'dfig'} && !$in{'efig'}) { 
      print "<TR VALIGN=\"MIDDLE\" ALIGN=\"CENTER\"><TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"1\"><BR>\n";
      print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\"><B>Click another figure or \"Display Printer Page.\"</B></FONT></TD>\n";
      print "<TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"145\"></TD></TR>\n";
   }
   
   if ($in{'efig'} || $in{'ffig'}) {
      if ($in{'efig'}) { print "<INPUT TYPE=\"HIDDEN\" NAME=\"efig\" VALUE=\"", $in{'efig'}, "\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         print "<TD>\n";
         print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         $newbio = $bio{$in{'ebio'}};
         $newbio =~ s/$in{'ebio'}/$in{'ename'}/g;
         print "<TD ALIGN=\"RIGHT\"><IMG SRC=\"/images/1x1.gif\" WIDTH=\"175\" HEIGHT=\"1\"><BR>\n";
         &buildList($in{'efig'},'e',$in{'ebio'});
         print "<BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Choose&nbsp;Name:</FONT>&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"ename\" VALUE=\"", $in{'ename'}, "\" onChange=\"changeName()\"><BR><BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\">", $newbio, "</FONT></TD>\n";
         print "<TD><IMG SRC=\"/images/", $in{'efig'}, "_r.gif\" WIDTH=\"95\" HEIGHT=\"145\"></TD>\n";
         print "</TR>\n";
         print "</TABLE>\n";
         print "</TD>\n";
      }
      else { print "<TR VALIGN=\"TOP\"><TD></TD>\n"; }
   
      if ($in{'ffig'}) { print "<INPUT TYPE=\"HIDDEN\" NAME=\"ffig\" VALUE=\"", $in{'ffig'}, "\">\n";
         print "<TD>\n";
         print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\n";
         print "<TR VALIGN=\"TOP\">\n";
         print "<TD><IMG SRC=\"/images/", $in{'ffig'}, "_l.gif\" WIDTH=\"95\" HEIGHT=\"145\"></TD>\n";
         $newbio = $bio{$in{'fbio'}};
         $newbio =~ s/$in{'fbio'}/$in{'fname'}/g;
         print "<TD><IMG SRC=\"/images/1x1.gif\" WIDTH=\"175\" HEIGHT=\"1\"><BR>\n";
         &buildList($in{'ffig'},'f',$in{'fbio'});
         print "<BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"1\">Choose&nbsp;Name:</FONT>&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"fname\" VALUE=\"", $in{'fname'}, "\" onChange=\"changeName()\"><BR><BR><FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\">", $newbio, "</FONT></TD>\n";
         print "</TR>\n";
         print "</TABLE>\n";
         print "</TD>\n";
         print "</TR>\n";
      }
      else { 
         print "<TD VALIGN=\"MIDDLE\" ALIGN=\"CENTER\"><IMG SRC=\"/images/1x1.gif\" WIDTH=\"270\" HEIGHT=\"1\"><BR>\n";
         print "<FONT FACE=\"ARIAL,HELVETICA,SANS\" SIZE=\"2\"><B>Click another figure or \"Display Printer Page.\"</B></FONT></TD></TR>\n";
      }
   }
   
   print "<TR>\n";
   print "<TD COLSPAN=\"2\" ALIGN=\"CENTER\"><BR><INPUT TYPE=\"BUTTON\" VALUE=\"Display Printer Page\" onClick=\"printForm()\">&nbsp;&nbsp;<INPUT TYPE=\"BUTTON\" VALUE=\"Clear Page\" onClick=\"window.location='bio_builder.pl'\"></TD>\n";
   print "</TR>\n";
   print "</FORM>\n";
   print "</TABLE>\n";
   print "</TD>\n";
   print "</TR>\n";
   print "</TABLE>\n";
   print "</BODY>\n";
}
   
exit 0;
   
