Cufon.replace(['h1', 'h2', '#nav ul li a', 'p.count'
],{
	hover:true
});

$(function(){
	$.preloadCssImages();
	if($('#slideshow').length > 0) {
		$('#slideshow').cycle({ 
    		timeout: 0,
    		fit: 1,
    		next: '#nextSlide',
    		prev: '#prevSlide' 
		});
		$('img#prev').hover(function(){
			$(this).attr("src","images/icons/prev-proj-hover.gif");
		}, function(){
			$(this).attr("src","images/icons/prev-proj.gif");
		});
		$('img#next').hover(function(){
			$(this).attr("src","images/icons/next-proj-hover.gif");
		}, function(){
			$(this).attr("src","images/icons/next-proj.gif");
		});
	}
	if($('#msg')){$('#msg').hide();}

});

function checkForm(){
	$email = $('#email').val().toString();
	$name = $('#author').val().toString();
	var $validEmail = /^[a-z0-9][a-z0-9_\.-]{0,}[a-z0-9]@[a-z0-9][a-z0-9_\.-]{0,}[a-z0-9][\.][a-z0-9]{2,4}$/;
	$msg = $('#msg');
	var emailTest = $validEmail.test($email);
	
	if(emailTest == false) {
		if($name == '') {
			$msg.html("What's your name and correct email address?").show().addClass("msgVisible");
			 window.location.href = "#msg";
		} else {
			$msg.html("Got your name...is your email address correct?").show().addClass("msgVisible");
			 window.location.href = "#msg";
		}
		return false;
	} else if($name == '') {
		$msg.html("So what's your name?").show().addClass("msgVisible");
		 window.location.href = "#msg";
		return false;
	} else {
		return true;
	}
	

}	


