/**
 * checkCForm validates name, email address and message
 */
function checkCForm(oFormName)
		{
		/* The following is used to check if the form is valid*/
		var errors = ''
		if (oFormName.Ctitle.value.length == 0)
			{errors += '  * Please enter your title\n'};
		if (oFormName.Cfirstname.value.length == 0)
			{errors += '  * Please enter your first name\n'};
		if (oFormName.Cfirstname.value.length == 1)
			{errors += '  * Please check your first name is correct\n'};
		if (oFormName.Csurname.value.length == 0)
			{errors += '  * Please enter your family name\n'};
		if (oFormName.Csurname.value.length == 1)
			{errors += '  * Please check your family name is correct\n'};	
		if (oFormName.Cemail.value.length == 0)
				{errors += '  * Please enter your email address\n'};
		if (!CemailCheck(oFormName.Cemail.value))
				{errors += '  * Please check your e-mail address is correct\n'};
		if (oFormName.Ccountry.value.length == 0)
			{errors += '  * Please enter your country\n'};
		if (oFormName.Cquerytype.value.length == 0)
			{errors += '  * Please enter the type of query\n'};
		if (oFormName.Cmessage.value.length == 0)
			{errors += '  * Please enter your message\n'};
		if (oFormName.Cmessage.value.length == 1)
			{errors += '  * Please check your message is correct\n'};
		if (errors != '')
			{
			errors = 'Please correct the following and try again to send:-\n\n' + errors
			alert(errors);
			return (false);
			}
		/* finally return true if all conditions are met*/
  		return true;
		}

function CemailCheck(email)
	{
		/* The following is used to check if the entered e-mail address
   		is a valid format.*/
  		var result = false
  		var theStr = new String(email)
  		var index = theStr.indexOf("@");
  		if (index > 0)
  			{
    			var pindex = theStr.indexOf(".",index);
   				if ((pindex > index+1) && (theStr.length > pindex+1))
				result = true;
  			}
  		return result;
	}


