// Help fend off spam spiders
function clean_contact_form() {
document.write('<a name="clean_contact"></a><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="cc">');
document.write('<fieldset class="CleanContact">');
document.write('<div><label for="clean_contact_from_name"><em>*</em> Navn:<br /></label><input type="text" name="clean_contact_from_name" id="clean_contact_from_name" onchange="clean_contact_msg_clr()" /></div>');
document.write('<div><label for="clean_contact_from_email"><em>*</em> E-post:</label><br /><input type="text" name="clean_contact_from_email" id="clean_contact_from_email"  onchange="clean_contact_msg_clr()"  /></div>');
document.write('<div><label for="clean_contact_subject"><em>*</em> Emne:</label><br /><input type="text" id="clean_contact_subject" name="clean_contact_subject"  onchange="clean_contact_msg_clr()"  /></div>');
document.write('<div><label for="clean_contact_body"><em>*</em> Melding:</label><br />');
document.write('<textarea id="clean_contact_body" name="clean_contact_body"  onchange="clean_contact_msg_clr()" ></textarea></div>');
document.write('<div id="clean_contact_msg"></div>');
document.write('<input type="Submit" id="clean_contact_send" style="font-size:14px;" value="Send meldingen">');
document.write('</fieldset>');
document.write('</form>');
}
function clean_contact_validate() {
var email  = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/;
var str = 	/\w+/;
if(!str.test(document.getElementById('clean_contact_from_name').value)) {
clean_contact_msg('Feil: Du m&aring; oppgi ditt navn');
return false;
}
if(!email.test(document.getElementById('clean_contact_from_email').value)) {
clean_contact_msg('Feil: Du m&aring; oppgi en gyldig e-postadresse');
return false;
}
if(!str.test(document.getElementById('clean_contact_subject').value)) {
clean_contact_msg('Feil: Du m&aring; skrive noe i emnefeltet');
return false;
}
if(!str.test(document.getElementById('clean_contact_body').value)) {
clean_contact_msg('Feil: Du m&aring; skrive noe i meldingsfeltet');
return false;
}
return true;
}
function  clean_contact_msg_clr() {
document.getElementById('clean_contact_msg').style.display = 'none';
}
function clean_contact_msg(msg) {
em = document.getElementById('clean_contact_msg');
em.innerHTML = msg;
em.style.display = 'block';
}
function clean_contact_url(url) {
window.location = url;
}

