
function __Form_input_by_name(name, index) { 

                     try {

							var input_ret;
							var input_collection = document.getElementsByName(name);

							if ( !isNaN(index) ) {
								input_ret = input_collection[index];
							}
							else {
								if ( input_collection.length > 1 ) {
									input_ret = input_collection;
								}
								else {
									input_ret = input_collection[0];
								}
							}

							return input_ret;
                      }
                      catch (e) {
                            return null;
                      }

					}

function validate_consumer_editor() {

	var cur_input;
	var input_messages = new Array();

	try {
		//--------consumer_access_global-------//

if ( cur_input = __Form_input_by_name('consumer_access_global') ) {
							if ( (cur_input.value == '0' ) ) { 
		//--------consumer_id-------//

if ( cur_input = __Form_input_by_name('consumer_id') ) {
							if ( (cur_input.value == '' ) ) { 
				//--------new_username-------//

if ( cur_input = __Form_input_by_name('new_username') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter a username' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
}
}
}
}
//--------end new_username-------//

		//--------consumer_access_global-------//

if ( cur_input = __Form_input_by_name('consumer_access_global') ) {
							if ( (cur_input.value == '0' ) ) { 
		//--------consumer_id-------//

if ( cur_input = __Form_input_by_name('consumer_id') ) {
							if ( (cur_input.value == '' ) ) { 
				//--------new_password1-------//

if ( cur_input = __Form_input_by_name('new_password1') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter a password' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
}
}
}
}
//--------end new_password1-------//

		//--------consumer_access_global-------//

if ( cur_input = __Form_input_by_name('consumer_access_global') ) {
							if ( (cur_input.value == '0' ) ) { 
		//--------consumer_id-------//

if ( cur_input = __Form_input_by_name('consumer_id') ) {
							if ( (cur_input.value == '' ) ) { 
				//--------new_password2-------//

if ( cur_input = __Form_input_by_name('new_password2') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter your password again' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
}
}
}
}
//--------end new_password2-------//

		//--------consumer_f_name-------//

if ( cur_input = __Form_input_by_name('consumer_f_name') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter your first name' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
//--------end consumer_f_name-------//

		//--------consumer_l_name-------//

if ( cur_input = __Form_input_by_name('consumer_l_name') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter your last name' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
//--------end consumer_l_name-------//

		//--------consumer_email-------//

if ( cur_input = __Form_input_by_name('consumer_email') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter your email address' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
//--------end consumer_email-------//

		//--------add_new_consumer_address-------//

if ( cur_input = __Form_input_by_name('add_new_consumer_address') ) {
							if ( (cur_input.value == '1' ) ) { 
		//--------consumer_id-------//

if ( cur_input = __Form_input_by_name('consumer_id') ) {
							if ( (cur_input.value == '' ) ) { 
				//--------consumer_city_name-------//

if ( cur_input = __Form_input_by_name('consumer_city_name') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter consumer_city_name' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
}
}
}
}
//--------end consumer_city_name-------//

		//--------add_new_consumer_address-------//

if ( cur_input = __Form_input_by_name('add_new_consumer_address') ) {
							if ( (cur_input.value == '1' ) ) { 
		//--------consumer_id-------//

if ( cur_input = __Form_input_by_name('consumer_id') ) {
							if ( (cur_input.value == '' ) ) { 
				//--------consumer_address_l1-------//

if ( cur_input = __Form_input_by_name('consumer_address_l1') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter consumer_address_l1' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
}
}
}
}
//--------end consumer_address_l1-------//

		//--------add_new_consumer_address-------//

if ( cur_input = __Form_input_by_name('add_new_consumer_address') ) {
							if ( (cur_input.value == '1' ) ) { 
		//--------consumer_id-------//

if ( cur_input = __Form_input_by_name('consumer_id') ) {
							if ( (cur_input.value == '' ) ) { 
				//--------consumer_country_id-------//

if ( cur_input = __Form_input_by_name('consumer_country_id') ) {
							if ( (cur_input.value == '' ) ) { 

alert( 'Please enter consumer_country_id' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;}
}
}
}
}
}
//--------end consumer_country_id-------//

var input1 = null;
var input2 = null;
if( input1 = __Form_input_by_name('new_password1') ) {
if( input2 = __Form_input_by_name('new_password2') ) {
if ( input1.value != input2.value ) {
alert( 'The fields for \'a password\' must match.' );
if ( typeof(cur_input.focus) != 'undefined' ) {
							try { cur_input.focus(); } catch(e) {} 
					       }

if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

return false;	}
} 
} 

if ( typeof(validation_hook_true) == 'function' ) { if ( validation_hook_true() ) { return true; } else { if ( typeof(validation_hook_false) == 'function' ) { validation_hook_false(); }

 return false; } }
	}
	catch(e) {
		return true;
	}
	return true;
}


