// getform.jsvar timer_id,formdiv;function show_form() {	boxdiv = document.getElementById('emailformbox');	boxdiv.className = 'emailformboxplaced';	formdiv = document.getElementById('emailform');	formdiv.className = 'emailformon';	timer_id = setInterval('drop_form(0,0.12)', 40);	//alert('top is --' + formdiv.style.top +'--');}var http_request = false;function makePOSTRequest(url, parameters) {	http_request = false;	if (window.XMLHttpRequest) { // Mozilla, Safari,...		http_request = new XMLHttpRequest();		if (http_request.overrideMimeType) {			http_request.overrideMimeType('text/xml');		}	} else if (window.ActiveXObject) { // IE		try {			http_request = new ActiveXObject("Msxml2.XMLHTTP");		} catch (e) {			try {				http_request = new ActiveXObject("Microsoft.XMLHTTP");			} catch (e) {}		}	}	if (!http_request) {		//alert('Cannot create XMLHTTP instance');		return false;	}		http_request.onreadystatechange = alertContents;	http_request.open('POST', url, true);	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");	http_request.setRequestHeader("Content-length", parameters.length);	http_request.setRequestHeader("Connection", "close");	http_request.send(parameters);}	function alertContents() {	if (http_request.readyState == 4) {		if (http_request.status == 200 || http_request.status == 304) {			//alert(http_request.responseText);			result = http_request.responseText;			document.getElementById('lastrow').innerHTML = result;            		} else {			//alert(http_request.status);			alert('There was a problem with the contact form.');		}	}}function get(obj) {	var poststr = "name=" + encodeURI( document.getElementById("input-name").value ) + "&email=" + encodeURI( document.getElementById("input-email").value ) + "&comments=" + encodeURI( document.getElementById("ta-comments").value ) + '&captcha=' + document.getElementById('captcha').value;	makePOSTRequest('contactus.php', poststr);}function check_form(form) {	document.getElementById('captcha').style.border = 'solid 0px';	document.getElementById('input-email').style.border = 'solid 0px';	document.getElementById('input-name').style.border = 'solid 0px';	if (!check_name(form)) {		return false;	} else if (!check_email(form)) {		return false;	} else if (document.getElementById('captcha').value != 'ranch') {		document.getElementById('captcha').style.border = 'solid red 1px';		document.getElementById('captcha').focus();		return false;	} else {		var d = document.getElementById('lastrow');		d.innerHTML = '<p style="text-align:left;padding-left:78px;">Thanks for contacting us!</p>';		setTimeout('start_raise_form()', 2000);		return true;	}}function check_email(form){	var email = form.email.value;	var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;	var result = true;	if (!filter.test(email)) {		document.getElementById('input-email').style.border = 'solid red 1px';		document.getElementById('input-email').focus();		//document.getElementById('emailrow').appendChild(txt);		result = false;	}	return result;}function check_name(form) {	if (form.name.value == '') {		document.getElementById('input-name').style.border = 'solid red 1px';		document.getElementById('input-name').focus();		return false;	} else {		return true;	}}function drop_form(destination, max_speed) {	var current_top = parseInt(retrieveComputedStyle('top'));	if (isNaN(current_top)) {		current_top = 0;	}	if (current_top < destination) {		current_top += (destination-current_top)*max_speed;		if (current_top > destination) {			current_top = destination		}	}	formdiv.style.top = current_top + 'px';	if (current_top == destination) {		var firstfield = document.getElementById('input-name');		firstfield.focus();		clearInterval(timer_id);	}}function start_raise_form() {	timer_id = setInterval('raise_form(-280,-0.12)', 40);}function raise_form(destination, max_speed) {	var current_top = parseInt(retrieveComputedStyle('top'));	if (isNaN(current_top)) {		current_top = 0;	}	if (current_top > destination) {		current_top -= ((destination-current_top)*max_speed)+1;		if (current_top < destination) {			current_top = destination;		}	}	formdiv.style.top = current_top + 'px';	if (current_top == destination) {		var d = document.getElementById('lastrow');		d.innerHTML = '<span><input name="submit" type="submit" value="Fire Away" /></span>';		boxdiv = document.getElementById('emailformbox');		boxdiv.className = 'emailformoff';		clearInterval(timer_id);	}}function retrieveComputedStyle(styleProperty) {	var computedStyle = null;	if (typeof formdiv.currentStyle != 'undefined' && typeof formdiv.currentStyle != undefined) {		computedStyle = formdiv.currentStyle;	} else {		computedStyle = document.defaultView.getComputedStyle(formdiv, null);	}	return computedStyle[styleProperty];}