$(document).ready(function() {
						   
	$(".tooltip[title]").tooltip({tip: '#demotip', effect: 'bouncy'});
	
	// create custom animation algorithm for jQuery called "bouncy"
	$.easing.bouncy = function (x, t, b, c, d) {
		var s = 1.70158;
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	}
	
	// create custom tooltip effect for jQuery Tooltip
	$.tools.tooltip.addEffect("bouncy",
	
		// opening animation
		function(done) {
			this.getTip().animate({top: '+=15'}, 500, 'bouncy', done).show();
		},
	
		// closing animation
		function(done) {
			this.getTip().animate({top: '-=15'}, 500, 'bouncy', function()  {
				$(this).hide();
				done.call();
			});
		}
	);
		
	$(".tooltip[title]").tooltip({tip: '#demotip', effect: 'bouncy'});
});



function verifyForm()
{
	if (document.getElementById('getFirst').value == '') {
		alert('Please enter a first name');
		document.getElementById('getFirst').focus();
		return false;	
	}
	
	if (document.getElementById('getLast').value == '') {
		alert('Please enter a last name');
		document.getElementById('getLast').focus();
		return false;	
	}
	
	if (document.getElementById('getPhone').value == '') {
		alert('Please enter a phone number');
		document.getElementById('getPhone').focus();
		return false;	
	}
	
	if (document.getElementById('getEmail').value == '') {
		alert('Please enter a email address');
		document.getElementById('getEmail').focus();
		return false;	
	}
	
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	strEmail = document.getElementById('getEmail').value;
	if (strEmail.search(validRegExp) == -1) 
	{
	  alert('A valid e-mail address is required.');
	  return false;
	} 

	document.getElementById('contactForm').submit();
}


var xmlhttp;
function loadXMLDoc(url)
{
	xmlhttp=null;
	if (window.XMLHttpRequest)
	{
		// code for Firefox, Opera, IE7, etc.
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change()
{
	if (xmlhttp.readyState==4)
	{
		// 4 = "loaded"
		if (xmlhttp.status==200)
		{
			// 200 = "OK"
			document.getElementById('showContent').innerHTML=xmlhttp.responseText;
		}
		else
		{
			alert("Problem retrieving data:" + xmlhttp.statusText);
		}
	}
}