/*
 * JavaScript Source Code
 * Created by Kalin Ganev
 * <kalinganev [AT] webfactory (DOT) bg>
 * Date Created:  April 17, 2006
 * Last Modified: April 27, 2006
 */





function focusFirstField () {
	if (document.getElementById) {
		document.getElementById("Title").focus();
	}
}




function checkFormCleaner (obj_form) {
	// checking Title
	if ( 0 == obj_form.Title.value ) {
		alert(gstr_errorMsgTitle);
		obj_form.Title.focus();
		return false;
	}

	// checking Name
	if ( "" == obj_form.Name.value ) {
		alert(gstr_errorMsgName);
		obj_form.Name.focus();
		return false;
	}

	// checking Address
	if ( "" == obj_form.Address1.value ) {
		alert(gstr_errorMsgAddress);
		obj_form.Address1.focus();
		return false;
	}

	// checking Postcode
	if ( "" == obj_form.Postcode.value ) {
		alert(gstr_errorMsgPostcode);
		obj_form.Postcode.focus();
		return false;
	}

	// checking E-mail Address
	if ( !obj_form.Email.value.match(gobj_regExpEmail) ) {
		alert(gstr_errorMsgEmail);
		obj_form.Email.focus();
		return false;
	}

	// checking Hear about pull-down menu
	if ( "" == obj_form.WhereHear.value ) {
		alert(gstr_errorMsgHear);
		obj_form.WhereHear.focus();
		return false;
	}
	// check Validation Code
	if ( "" == obj_form.codes.value ) {
		alert(gstr_errorMsgCodes);
		obj_form.codes.focus();
		return false;
	}


	return true;
}




window.onload=focusFirstField;
