function pages_cancel( vc_URL )
{
  // Get confirmation of the request
  var cancel = confirm( 'Are you sure you want to cancel?\n\nAny changes will be lost.' );

  // Send the request if necessary
  if( cancel == true )
    window.location = "index.php?module=Pages&op=view&title=" + vc_URL;
}

function pages_create()
{
  // Initialize the form checker variable
  var ValidForm = true;
  var ErrorMsg = "";

  // Make sure that the title and page have contents
  var vc_Title = document.getElementById( 'vc_Title' ).value;
  var txt_Page = document.getElementById( 'txt_Page' ).value;

  // Check against the length
  if( vc_Title.length < 2 )
  {
    ErrorMsg = "The title must be at least 2 characters.";
    ValidForm = false;
  }
  else if( txt_Page.length < 10 )
  {
    ErrorMsg = "Your page body is too short.";
    ValidForm = false;
  }

  // If the form is still valid after the form checking, process
  // the form 
  if( ValidForm )
    document.getElementById('PageForm').submit();
  else
    alert( ErrorMsg );

}

