/**
 * JavaScript for validating the Guestbook entries
 *
 * @version 1.0
 * @copyright Copyright © 2003-2004, Dino Karl
 * @author Dino Karl <contact@dinokarl.de>
 * @package com.dinokarl.guestbook
 * @subpackage view
 *
 */
// $Id: guestbook_verify.js,v 1.2 2006/03/11 21:14:54 karldino Exp $

/**
 * Before submitting the form check the form fields
 *
 * @return void
 */
function submitting() {
	document.guestbookform['formAction'].value = "submit";
	if (verifyForm()) document.guestbookform.submit();    
}

/**
 * Reseting the CAPTCHA WORD
 *
 * @return void
 */
function resetWord() {
	document.guestbookform['formAction'].value = "resetWord";
    document.guestbookform.submit();    

}


/**
 * Verify the form values 
 *
 * @return boolean TRUE if all fields are validated correctly, otherwise FALSE
 */
function verifyForm() {

	if(document.guestbookform['name'].value == '') {
		alert ('Bitte geben Sie einen Namen ein !');
		document.guestbookform['name'].focus();
		return false;
	}

	if(document.guestbookform['entry'].value == '') {
		alert ('Bitte machen Sie einen Eintrag !');
		document.guestbookform['entry'].focus();
		return false;
	}
    
    return true;

} // function verifyForm()

