/**
 * function to erase the prepopulated value of a form input
 */
function ClearText( field )
{
  if( field.defaultValue == field.value )
      field.value = ""   

}//ClearText


/**
 * toggle the shipping information if the user selects 'ship order' on order form
 */
function ToggleShippingInfo( el ){

  if( el.value == 'ship' ) {
    
    //show the shipping dropdow and info
    document.getElementById( 'shipdetails' ).style.display='inline';
    el.checked = true;
  } else {
    document.getElementById( 'shipdetails' ).style.display='none';
    el.checked = true;
  }


} //ToggleShippingInfo
/**
 * toggle the shipping information if the user selects 'ship order' on order form
 */
function ToggleBillto( el ){

  if( el.value == 'different' ) {
    
    //show the shipping dropdown and info
    // grabs the table with the id 'billing_address_table' and adjusts the display style
    document.getElementById( 'billing_address_table' ).style.display='inline';
    el.checked = true;
  } else {
    document.getElementById( 'billing_address_table' ).style.display='none';
    el.checked = true;
  }


} //ToggleBillto


// two scrips to toggle menu items ChangeMenu, HideMenuSetup
// toggles visibility of the given menu elements
// to use just pass an array containing the ids of the elements you 
// want to toggle.
function change(id)  //ChangeMenu
{
     for(i = 0; i < id.length; i++)
     {
        // get the element
        ID = document.getElementById(id[i]); 
        
        // toggle visibility
     	  if(ID.style.display == "") 
      	      ID.style.display = "none"; 
     	  else 
          	  ID.style.display = ""; 
     }
}   //ChangeMenu


// edit this function to change() all the hidden
// menus on page load
// this version doesn't hide menus that may be wanted.
function setup_menu()  //HideMenuSetup
{
// set for planting tips pages if other pages needed
// then add new id for that sub menu   item
    if(page_type != "tips")
       change(["plant","winter","links","video","notes"]);
       
// other ifs can be added for other menu headers with sub menu       
}   //HideMenuSetup
