
function checkZipForm(f) {
  if (f.zip.style.display != 'none' && f.zip.parentNode.style.display != 'none') {
    if (f.zip.value == '' || f.zip.value == 'Zip code *') {
      alert('Zip code is required.');
      f.zip.focus();
      f.zip.select();
      return false;
    }
  }
  
  var city = true;
  var state = true;
  
  if (f.city.style.display != 'none' && f.city.parentNode.style.display != 'none') {
    if (f.city.value == '' || f.city.value == 'City *') {
      alert('City is required.');
      city = false;
    }
  }
  
  if (f.state.style.display != 'none' && f.state.parentNode.style.display != 'none') {
    if (f.state.value == '' || f.state.value == 'State *') {
      alert('State is required.');
      state = false;
    }
  }
  
  if (!city) {
      f.city.focus();
      f.city.select();
      return false;
  } else if (!state) {
      f.state.focus();
      //f.state.select(); //can't use w/ select box
      return false;
  }

return true;
}

function showCityState(prefix) {
  document.getElementById(prefix+'zip').style.display = 'none';
  document.getElementById(prefix+'city').style.display = 'inline';
  document.getElementById(prefix+'state').style.display = 'inline';
}

function init_editor(id) {
  var oFCKeditor = new FCKeditor(id);
  oFCKeditor.Height=200;
  oFCKeditor.BasePath	= '/js/fckeditor/';
  oFCKeditor.ReplaceTextarea();
  
  //Hack for IE - for some reason the iframe needs to be reloaded before it will show correctly
  if(document.all)
  {
    var frame = document.getElementById(instance+'___Frame');
    frame.contentWindow.location.reload();
  }
}