// open pop-up
function open_popup(url, options, target) {
  if (!options)
    options = 'width=600,height=600,scrollbars=yes';
  if(!target)
    target = '';
    
  window.open(url,target, options).focus();
  return false;
}

// switch off one or more divs....
function show_layer(new_div, old_divs) {
  if(old_divs) {
    if(typeof(old_divs)==Array) {
      for (var i=0; i<old_divs.length; i++) {
        $('#' + old_divs[i])[0].style.visibility = 'hidden';
        $('#' + old_divs[i])[0].style.display = 'none';
      }
    } else {
      $('#' + old_divs)[0].style.visibility = 'hidden';
      $('#' + old_divs)[0].style.display = 'none';
    }
  }

  // show new layer
  $('#' + new_div)[0].style.visibility = 'visible';
  $('#' + new_div)[0].style.display = 'block';
}


function submit_form(id) {
	$('#' + id)[0].submit();
}
