function switchDiv ( divThis, divThat ) {
  $('#'+divThis).hide();
  $('#'+divThat).show();
}

function menu_select(id, type) {
  if ( type == 1 ) {
    $('#menu_sub_' + id).css('display', 'block');
  } else {
    $('#menu_sub_' + id).css('display', 'none');
  }
}

function new_file() {
  var c = window.prompt('Enter name of the new file');

  if ( c != '' ) {
    document.title = 'Editing file: ' + c;

    $.ajax({
      type: "POST",
      url: "ajax_create_page.php",
      data: "page_name=" + c,
      success: function(msg){
        //alert(msg);
        $('#current_project').val(msg);
      }
    });
  } else {
    new_file();
  }
}
