HELP! Need popup to check link of parent page and display html based on that link

Hello experts! As the title suggests I would like to make a popup that first checks the link of it’s parent.   Based on that link it then displays the picture for the popup, and also the wood options.  For better understanding of the latter, please view the following page and click on the thumb “stains”.

As you can see the woods are limited to only burl.  However if you had gone to this page and clicked on the “stains thumb”…

You would find that your options are Elm and Gingko.

Currently I am just linking to two separate pages.  I would rather not make a different page for each and every product, so I feel this mini-database would be the answer.  I would also like the page to be cached so the user need only load the list of variables once.

Here is the code of the current popup:
<title>Stains and Hardware</title>
function goto()
     self.resizeTo(document.images[0].width+15, document.images[0].height+132);

function getSelectValue(selObject){
  return selObject.options[selObject.selectedIndex].value;
function chimg(){
  var d = document.forms[0];
  var w = getSelectValue(d.wood);
  var s = getSelectValue(d.stains);
  var h = getSelectValue(d.hardware);
  var elem = document.getElementById("help");
  if(getSelectValue(d.wood) && getSelectValue(d.stains) && getSelectValue(d.hardware)){
  //alert(wood);alert(stain);alert(hardware); //Debugging
  document.images["myimg"].src = ""+ w +"-"+ s +"-"+ h +".jpg";
  elem.innerHTML="<img name=myimg src="+ w +"-"+ s +"-"+ h +".jpg>";
       return true;
       alert("Please select all options!");
         return false;
<body onLoad=goto() bgcolor="#B6CAAE" style="margin-left: 0; margin-top: 0; margin-bottom: 0; margin-right: 0">
<div align=center valign=middle>
<div id=help><img name=myimg src="" alt=""><br></div>
<table border=0 cellspacing=cellpadding=0>
        <td width=478 height=2 bgcolor="#ffffff"><img src="" width=478 height=1><br></td>
        <td width=478 height=2 bgcolor="#647F5B"><img src="" alt="" border=0 width=1 height=1><br></td>
<form name=imgform onsubmit="">

<SELECT NAME="wood">
      <OPTION VALUE="">- - - Select Wood - - -</OPTION>
      <OPTION VALUE="burl">Burl</OPTION>

<SELECT NAME="stains">
      <OPTION VALUE="">- - - Select Stain - - -</OPTION>
      <OPTION VALUE="gp">Golden Pecan</OPTION>
      <OPTION VALUE="fw">Fruitwood</OPTION>
      <OPTION VALUE="ro">Red Oak</OPTION>
      <OPTION VALUE="mh">Mahogany</OPTION>
      <OPTION VALUE="ch">Chocolate</OPTION>
      <OPTION VALUE="wn">Walnut</OPTION>

<SELECT NAME="hardware">
      <OPTION VALUE="">- - Select Handle - -</OPTION>
      <OPTION VALUE="bh">Brass Hirute</OPTION>
      <OPTION VALUE="ih">Iron Hirute</OPTION>
      <OPTION VALUE="bw">Brass Warabite</OPTION>
      <OPTION VALUE="iw">Iron Warabite</OPTION>
      <OPTION VALUE="ik">Iron Kakute</OPTION>

<input type=button onClick="return chimg();" value="Go" style="color: #FFFFFF; background-color: #8B987C; border-width: 1; border-style: 1">

<div align=left><font size=+1>&nbsp<b> For more information on how to order this piece <a href="order.html" target=_blank>click here</a>.</b></font></div>


As always, your help is greatly appreciated,

(P.S. Is there a better solution via php?)
Who is Participating?
monosodiumgConnect With a Mentor Commented:
Not sure I see the problem. You can avoid multiple popups by resuing hte same window by giving the popup window a name and then looking for it.
If you can do server side stuff then you need only on php page which takes the type of furniture as an argument and generate the HTML as per your code but with the differnt sets of options. It's output is targeted (target attribute of link or URL arg in to the popup. You only create the popup window if none exists already (and, optionally, you close it when you go to a different page).

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.