// Clears field if the default value is there.
function clear_field(field)
{
    if (field.value==field.defaultValue)
    {
        field.value=''
    }
}
// Checks field to see if any information was entered. If not, the default value is reentered.
function check_field(field)
{
    if (field.value=='' ||
    field.value==' ')
    {
        field.value=field.defaultValue
    }
}

function ValidateForm(theform)
{
		if(theform.email.value==''||theform.email.value=='Your Email Address') {
		alert('Please kindly enter your Email Address')
		theform.email.focus()
		return false
	}
		if(emailValidator(theform.email)==false) {
		alert('The Email address is not valid. Please enter a valid Email address')
		theform.email.focus()
		return false
	}
			if(!(theform.country[0].checked || theform.country[1].checked)) {
		alert('Please select your country')
		theform.country[0].focus()
		return false
	}

	return true
}

function ValidateForm2(theform)
{
	if(theform.email.value!='') {
			if(emailValidator(theform.email)==false) {
			alert('The Email address is not valid. Please enter a valid Email address')
			theform.email.focus()
			return false
		}
	}

		if(theform.name.value=='') {
		alert('Please kindly enter your Name')
		theform.name.focus()
		return false
	}

		if(theform.contact.value=='') {
		alert('Please kindly enter your Contact number')
		theform.contact.focus()
		return false
	}

		if(theform.message.value=='') {
		alert('Please tell us how we could help you')
		theform.message.focus()
		return false
	}

		if(theform.security_code.value=='') {
		alert('Please kindly type in the letters from the image')
		theform.security_code.focus()
		return false
	}


	return true
}

function emailValidator(elem){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,10}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		return false;
	}
}


function changeImage(filename)
{
	document.packshot.src = filename;
}

