/* Script to set the value in a a hidden field with the specified id. */
   function setValue(id, value) {
      document.getElementById(id).value=value;
   }
   
/* Script to provide support for menu highlighting and also generating */
/* a supporting display window for the plant catalog. */

   function HiliteLink(buttonName, text, isOn) {
		var button = document.getElementById(buttonName);
		
		if(isOn) {
			button.className = 'TopMenuLinkButtonHi';
			text.className = 'TopMenuLinkHi';
		}
		else {
			button.className = 'TopMenuLinkButton';
			text.className = 'TopMenuLink';
		}
	};
   
   var NewWin = null;
   function showDetails(name, pic, details) {
      if (NewWin == null || (NewWin != null && NewWin.closed)) {
         NewWin = window.open('', 'plantDetails', 'width=600, height=600, scrollbars=yes, resizable=yes, status=no, toolbar=no, top=100, left=100');
      }
      else {
         NewWin.document.open();
      }
      
      
      NewWin.document.write("<html><head>");
      NewWin.document.write("<title>GardenHood Atlanta</title>");
      NewWin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
      NewWin.document.write("<link href='GardenHoodWindow.css' type='text/css' rel='stylesheet'>");
      NewWin.document.write("</head>");
      NewWin.document.write("<body>");
      title_output = "<h3>"+name+"</h3>";
      NewWin.document.write(title_output);
      if (pic == "") {
         image_output = "<p>No photo available.</p>";
      }
      else {
         image_output = "<center><img src=" + pic + " ></center>";
      }
      NewWin.document.write("<p>");
      NewWin.document.write(details);
      NewWin.document.write("</p>");
      
      NewWin.document.write(image_output);
      
      NewWin.document.write("</body>");
      NewWin.document.write("</html>");
      
      NewWin.document.close();
      NewWin.moveTo(100, 100);
      NewWin.focus();
   };
   
   
/*  Script to toggle visibility on/off. */
function toggleDisplay(objname, buttonId) {
   
   var DivDisplay = document.getElementById(objname).style;
   var buttonObj = document.getElementById(buttonId);
	if (DivDisplay.display  == 'none') {
	  DivDisplay.display = 'block';
     buttonObj.value = "Hide";
	}else{
	  DivDisplay.display = 'none';
     buttonObj.value = "Show";
	}
}  
  
/* Script to set a visible and invisble field to a selected value. */
function setHtml(fieldId, value) {
   
   var field = parent.document.getElementById(fieldId);
   field.innerHTML = value;
   
} 


/* Script to set a visible and invisble field to a selected value. */
function setValues(fieldId, hfieldId, value) {
   
   var field = parent.document.getElementById(fieldId);
   field.innerHTML = value;
   
   
   var hfield = parent.document.getElementById(hfieldId);
   hfield.value = value;

}
   

