/* Greenie Selection Script */

// Make it so if customer selects waterproof theatre greenie
// they are only presented with the option of unisex style
// and the colour green.

function getObjRef(id) {
  if(document.getElementById) { return document.getElementById(id); }
  if(document.all) { return document.all[id]; }
}

function greenieOptions(selected) { //selected is the selected option
  var val = selected.value.toLowerCase(); //selected's value property is
     // retrieved and converted to lower case for easier

  var el = getObjRef('optional'); //gets the object reference for the element
  var el2 = getObjRef('optional2'); //gets the object reference for the element
  var el3 = getObjRef('optional3'); //gets the object reference for the element

  if (val == 'printed scrub top') { //if val is set to 'Printed Scrub Top' show the textbox el
 	  el.style.display='inline';
 	  el2.style.display='none';
 } else if (val == 'plain scrub top') { //if val is set to 'Plain Scrub Top' show the textbox el2
 	  el2.style.display='inline';
 	  el.style.display='none';
 } else if (val == 'aussie animal print scrub top') { //if val is set to 'Plain Scrub Top' show the textbox el2
 	  el3.style.display='inline';
    el2.style.display='none';
 	  el.style.display='none';
 }
  else {
 	  el.style.display='none';
 	  el2.style.display='none';
 }

}
