// Help fend off spam spiders
function clean_contact_form() 
{

	document.write('<form class="standard-form" method="post" action="#clean_contact" name="clean_contact" id="clean_contact" onsubmit="return clean_contact_validate(this)">');
	document.write('<input type="hidden" name="clean_contact_token" value="<?=clean_contact_token()?>">');
   
   //document.write('<p class="form-input"><input type="text" name="clean_contact_from_name" id="clean_contact_from_name" tabindex="1" value="(required)" onclick="this.value=\'\';" onchange="clean_contact_msg_clr()" /><label for="clean_contact_from_name"><b>Name</b></label></p>');
   document.write('<p class="form-input"><input type="text" name="clean_contact_from_email" id="clean_contact_from_email" tabindex="2" value="(required)" onclick="this.value=\'\';" onchange="clean_contact_msg_clr()" /><label for="clean_contact_from_email"><b>E-Mail</b></label></p>');
   //document.write('<p class="form-input"><input type="text" name="clean_contact_subject" id="clean_contact_subject" tabindex="3" value="(required)" onclick="this.value=\'\';" onchange="clean_contact_msg_clr()" /><label for="clean_contact_subject"><b>Subject</b></label></p>');
   document.write('<p class="form-textarea"><textarea id="clean_contact_body" name="clean_contact_body" tabindex="4" onchange="clean_contact_msg_clr()" ></textarea></p>');
   document.write('<p class="form-submit"><input type="Submit" id="submit" tabindex="5" value="Submit"></p>');
	document.write('</form>');
}
function clean_contact_validate() {
	var email  = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/;
	var str = 	/\w+/;

	if(!email.test(document.getElementById('clean_contact_from_email').value)) {
		clean_contact_msg('Please supply a valid E-mail Address');
		return false;
	}


	if(!str.test(document.getElementById('clean_contact_body').value)) {
		clean_contact_msg('Please supply a message');
		return false;
	}
	return true;
}

function  clean_contact_msg_clr() {
	document.getElementById('clean_contact_msg').style.display = 'none';
	
}
function clean_contact_url(url) {
	window.location = url;
}


