<!-- update clients

function validate_update_clients() 
{
	
	var theMessage = "---------------ERROR!---------------\n\nPlease fill in:\n";
	var noErrors = theMessage;

	/* */
	
	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.form_update_clients.email.value))
	{
		theMessage = theMessage + "\n --> A valid e-mail address (Customer)";
	}
	
	if(document.form_update_clients.fullname)
	{
		if(document.form_update_clients.fullname.value=="" ) 
		{	
			theMessage = theMessage + "\n --> Full Name (Customer)";
		}
	}
	
	if(document.form_update_clients.comp)
	{
		if(document.form_update_clients.comp.value=="") 
		{	
			theMessage = theMessage + "\n --> The Company name (Customer)";
		}
	}
	
	if(document.form_update_clients.title)
	{
		if(document.form_update_clients.title.value=="") 
		{	
			theMessage = theMessage + "\n --> The Title (Customer)";
		}
	}
	
	if(document.form_update_clients.pass)
	{
		if(document.form_update_clients.pass.value=="") 
		{	
			theMessage = theMessage + "\n --> The password (Customer). Don't forget to send this new password by mail to the customer.";
		}
	}

	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		document.form_update_clients.action = "update_clients_dbase.php";
		document.form_update_clients.submit();
		return true;
	
	}

	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
} 



function validate_create_client() 
{
	
	var theMessage = "---------------ERROR!---------------\n\nPlease fill in:\n";
	var noErrors = theMessage;

	/* */
	/*
	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.create_client.email.value))
	{
		theMessage = theMessage + "\n --> A valid e-mail address (Customer)";
	}
	
	if(document.create_client.fullname)
	{
		if(document.create_client.fullname.value=="" ) 
		{	
			theMessage = theMessage + "\n --> Full Name (Customer)";
		}
	}
	
	if(document.create_client.comp)
	{
		if(document.create_clients.comp.value=="") 
		{	
			theMessage = theMessage + "\n --> The Company name (Customer)";
		}
	}
	
	if(document.create_client.title)
	{
		if(document.create_client.title.value=="") 
		{	
			theMessage = theMessage + "\n --> The Title (Mr/Mrs/Dr.)";
		}
	}
	
	if(document.create_client.pass)
	{
		if(document.create_client.pass.value=="") 
		{	
			theMessage = theMessage + "\n --> The password (Customer). Don't forget to send this new password by mail to the customer.";
		}
	}*/

	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		document.create_client.action = "create_client.php";
		document.create_client.submit();
		return true;
	
	}

	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
} 



function delete_client()
{
	document.form_update_clients.action = "delete_client.php";
	document.form_update_clients.submit();
	return true;
}
<!-- edit_message.php
function delete_file()
{
	document.edit_message.action = "delete_file.php";
	document.edit_message.submit();
	return true;
}

function update_file()
{
	document.edit_message.action = "update_file.php";
	document.edit_message.submit();
	return true;
}


<!-- quoatation
function validate_quotation()
{
	var theMessage = "---------------ERROR!---------------\n\nPlease fill in:\n";
	
	var noErrors = theMessage;
	
	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.quotation.your_email.value))
	{
		theMessage = theMessage + "\n --> A valid e-mail address (Your Informations)";
	}
	
	if(document.quotation.your_family_name)
	{
		if(document.quotation.your_family_name.value=="" ) 
		{	
			theMessage = theMessage + "\n --> Your Name (Your Informations)";
		}
	}
	
	var radioCheck = false;
	for (i = 0; i < document.quotation.your_title.length; i++) {
	if (document.quotation.your_title[i].checked)
	radioCheck = true; }
	if (!radioCheck) {
	theMessage = theMessage + "\n -->  Your Title: Mr, Mrs (Your Informations)";
	}
	
	if(document.quotation.commodity)
	{
		if(document.quotation.commodity.value=="") 
		{	
			theMessage = theMessage + "\n --> The Commodity (Cargo Specifications)";
		}
	}
	
	if(document.quotation.dimensions)
	{
		if(document.quotation.dimensions.value=="") 
		{	
			theMessage = theMessage + "\n --> The Dimensions of the goods (Cargo Specifications)";
		}
	}
	
	if(document.quotation.org_country)
	{
		if(document.quotation.org_country.value=="") 
		{	
			theMessage = theMessage + "\n --> The Country where the goods are at the moment (Cargo Location)";
		}
	}
	
	if(document.quotation.dest_country)
	{
		if(document.quotation.dest_country.value=="") 
		{	
			theMessage = theMessage + "\n --> The Country where the goods are going to be deliver (Cargo Destination)";
		}
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}

<!-- mailus
function validate_mailusform()
{
	var theMessage = "---------------ERROR!---------------\n\nPlease fill in:\n";
	
	var noErrors = theMessage;
	
	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.mailusform.your_email.value))
	{
		theMessage = theMessage + "\n --> A valid e-mail address";
	}
	
	if(document.mailusform.your_family_name)
	{
		if(document.mailusform.your_family_name.value=="" ) 
		{	
			theMessage = theMessage + "\n --> Your Name";
		}
	}
	
	var radioCheck = false;
	for (i = 0; i < document.mailusform.your_title.length; i++) {
	if (document.mailusform.your_title[i].checked)
	radioCheck = true; }
	if (!radioCheck) {
	theMessage = theMessage + "\n -->  Your Title: Mr, Mrs";
	}
	
	
	if(document.mailusform.comments)
	{
		if(document.mailusform.comments.value=="" ) 
		{	
			theMessage = theMessage + "\n --> Your comments or questions";
		}
	}

		// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}

function CopyInfo(object) 
{
	if(object.sameinfo.checked == true) 
	{
		if(object.your_title[0].checked)
		var title = 'Mr. '
		
		if(object.your_title[1].checked)
		var title = 'Mrs. '
		
		if(!object.your_title[0].checked && !object.your_title[1].checked)
		var title = ''
		
		object.org_company_name.value = object.your_company_name.value;
		object.org_contact_person.value = title + object.your_family_name.value;
		object.org_full_address.value = object.your_full_address.value;
		
		object.org_country.value = object.your_country.value;
		object.org_phone_number.value = object.your_phone_number.value;
		object.org_fax_number.value = object.your_fax_number.value;
		object.org_email.value = object.your_email.value;
	}
	
	if(object.sameinfo.checked == false) 
	{
		object.org_company_name.value = "";
		object.org_contact_person.value = "";
		object.org_full_address.value = "";
		object.org_country.value = "";
		object.org_phone_number.value = "";
		object.org_fax_number.value = "";
		object.org_email.value  = "";
	}
}

function preload(id_one, id_two)  
{
	hideLayer(id_one);
	//safe function to show an element with a specified id
	if (document.getElementById) 
	{ 
		// DOM3 = IE5, NS6
		document.getElementById(id_two).style.display = 'block';
	}
	else 
	{
		if (document.layers) 
		{ 
			// Netscape 4
			document.id_two.display = 'block';
		}
		else 
		{ 
			// IE 4
			document.all.lyr.id_two.display = 'block';
		}
	}
}
// end

function hideLayer(id) 
{
	//safe function to hide an element with a specified id
	if (document.getElementById) 
	{ 
		// DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else 
	{
		if (document.layers) 
		{ 
			// Netscape 4
			document.id.display = 'none';
		}
		else 
		{
			// IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function validatemyform() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.myform.email.value))
	{
		theMessage = theMessage + "\n --> your e-mail address ";
	}
	
	// make sure field is not blank
	if (document.myform.password.value=="" || document.myform.password.value=="Exp: afrimarl25") 
	{
		theMessage = theMessage + "\n --> your password";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{	
		document.myform.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validateforgotpassform() 
{
	var theMessage = "YOUR ATTENTION PLEASE \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.forgotpassform.youremail.value))
	{
		theMessage = theMessage + "\n --> your e-mail address is invalid";
	}
	
	// make sure password obeys to th rules of hostway
	if (document.forgotpassform.desiredpassword.value!="" && document.forgotpassform.desiredpassword.value!="your desired password") 
	{
		if(document.forgotpassform.desiredpassword.value.length < 6)
		theMessage = theMessage + "\n --> your password must contain at least six characters"; 
		
		re = /^\w+$/;
		if (!re.test(document.forgotpassform.desiredpassword.value))
		theMessage = theMessage + "\n --> your password must contain only letters, numbers or underscores. Space is not permitted"; 
		
		re = /[0-9]/;
		if (!re.test(document.forgotpassform.desiredpassword.value))
		theMessage = theMessage + "\n --> your password must contain at least one number."; 
		
		re = /[a-zA-Z]/;
		var char = document.forgotpassform.desiredpassword.value.charAt(0);
		if (!re.test(char))
		theMessage = theMessage + "\n --> your password must start with a letter."; 
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{	
		document.forgotpassform.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validateforgotpassformtwo() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.forgotpassformtwo.youremail.value))
	{
		theMessage = theMessage + "\n --> your email address";
	}
	
	// make sure password obeys to th rules of hostway
	if (document.forgotpassformtwo.desiredpassword.value!="" && document.forgotpassformtwo.desiredpassword.value!="your desired password") 
	{
		if(document.forgotpassformtwo.desiredpassword.value.length < 6)
		theMessage = theMessage + "\n --> your password must contain at least six characters"; 
		
		re = /^\w+$/;
		if (!re.test(document.forgotpassformtwo.desiredpassword.value))
		theMessage = theMessage + "\n --> your password must contain only letters, numbers and underscores"; 
		
		re = /[0-9]/;
		if (!re.test(document.forgotpassformtwo.desiredpassword.value))
		theMessage = theMessage + "\n --> your password must contain at least one number."; 
		
		re = /[a-zA-Z]/;
		var char = document.forgotpassformtwo.desiredpassword.value.charAt(0);
		if (!re.test(char))
		theMessage = theMessage + "\n --> your password must start with a letter."; 
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{	
		document.forgotpassformtwo.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validatetrackinglogmeinform() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.trackinglogmein.email.value))
	{
		theMessage = theMessage + "\n --> your e-mail address ";
	}
	
	// make sure field is not blank
	if (document.trackinglogmein.password.value=="" || document.trackinglogmein.password.value=="Exp: afrimarl25") 
	{
		theMessage = theMessage + "\n --> your password";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{	
		document.trackinglogmein.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validatecslogmein() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (document.cslogmein.yourpassword.value=="" || document.cslogmein.yourpassword.value=="Exp: your password") 
	{
		theMessage = theMessage + "\n --> your password";
	}
	
	// make sure field is not blank
	if (document.cslogmein.yourusername.value=="" || document.cslogmein.yourusername.value=="Exp: your username") 
	{
		theMessage = theMessage + "\n --> your username";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{	
		document.cslogmein.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validateforgotpasscsform() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.forgotpasscsform.youremail.value))
	{
		theMessage = theMessage + "\n --> your email address";
	}
	
	// make sure password obeys to th rules of hostway
	if (document.forgotpasscsform.desiredpassword.value!="" && document.forgotpasscsform.desiredpassword.value!="your desired password") 
	{
		if(document.forgotpasscsform.desiredpassword.value.length < 6)
		theMessage = theMessage + "\n --> your password must contain at least six characters"; 
		
		re = /^\w+$/;
		if (!re.test(document.forgotpasscsform.desiredpassword.value))
		theMessage = theMessage + "\n --> your password must contain only letters, numbers and underscores"; 
		
		re = /[0-9]/;
		if (!re.test(document.forgotpasscsform.desiredpassword.value))
		theMessage = theMessage + "\n --> your password must contain at least one number."; 
		
		re = /[a-zA-Z]/;
		var char = document.forgotpasscsform.desiredpassword.value.charAt(0);
		if (!re.test(char))
		theMessage = theMessage + "\n --> your password must start with a letter."; 
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{	
		document.forgotpasscsform.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
	
}
// End -->

function validatesearchtrackformbuttonsearch() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	var a = document.searchtrackform.searchtrack.value;
	if (a=="") 
	{
		theMessage= theMessage + "\n --> Typ in a word or a sentence";
	}
	
	if (!a == "" && a.length < 4)
	{
		theMessage= theMessage + "\n --> Typ in a word of at least four letters";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		document.searchtrackform.action = "search.php";
		document.searchtrackform.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validatetracking()
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	var a = document.tracking.trackingnumber.value;
	var b = document.tracking.trackingpassword.value;
	
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.tracking.trackingnumber.value))
	{
		theMessage= theMessage + "\n --> Typ in your email address";
	}
	
	if (b=="" || b=="Fill in your password") 
	{
		theMessage= theMessage + "\n --> Typ in your password";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		document.tracking.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->

function validatesearchtrackformbuttontrack() 
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.searchtrackform.searchtrack.value))
	{
		theMessage= theMessage + "\n --> Typ in your email address";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		document.searchtrackform.action = "track.php";
		document.searchtrackform.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}

//post_message
function validate_post_message()
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (document.post_message.title.value=="" || document.post_message.title.value=="Title") 
	{
		theMessage = theMessage + "\n -->Please! Fill in the title of the message";
	}
	
	// make sure field is not blank
	if (document.post_message.message.value=="") 
	{
		theMessage = theMessage + "\n -->Please! Fill in the content of the message";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}

//mail_customer
function validate_mail_customer()
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (document.mail_customer.title.value=="") 
	{
		theMessage = theMessage + "\n -->Please! Fill in the title of the message";
	}
	
	// make sure field is not blank
	if (document.mail_customer.message.value=="") 
	{
		theMessage = theMessage + "\n -->Please! Fill in the content of the message";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}

//add new file
function validate_add_newfile()
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if ( document.add_newfile.reference.value == "" ) 
	{
		theMessage = theMessage + "\n -->Please! Fill in the reference/file number";
	}
	
	// make sure field is not blank
	if (document.add_newfile.cargo_location.value=="") 
	{
		theMessage = theMessage + "\n -->Please! Fill in the cargo location/pick up address";
	}
	
	// make sure field is not blank
	if (document.add_newfile.cargo_destination.value=="") 
	{
		theMessage = theMessage + "\n -->Please! Fill in the cargo destination/delivery address";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}

function validateforgotpasstracking()
{
	var theMessage = "Please provide the following informations: \n";
	var noErrors = theMessage

	// make sure field is not blank
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,8})+$/.test(document.forgotpasstracking.trackingemail.value))
	{
		theMessage = theMessage + "\n --> your email address";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors ) 
	{	
		document.forgotpasstracking.submit();
		return true;
	} 
	else 
	{
		// If errors were found, show alert message
		alert(theMessage);
		return false;
	}
}
// End -->