
Cufon.replace('h1')('h2')('h3')('h4')('h5');
$(document).ready( function(){
	$('.slide').cycle({
		prev:   '.prev', 
  		next:   '.next',
  		timeout:  8000
	});
});

//open new window using jQuery
$(function(){
  	$('a.new-window').click(function(){
      window.open(this.href);
      return false;
  	});
});
	
//email validation
function validate_infoform ( )
{
	document.infoForm.theButton.disabled = true;
	
	Ctrl = document.infoForm.email;
	if (Ctrl.value == "" || Ctrl.value.indexOf ('@', 1) == -1 || Ctrl.value.indexOf ('.', 1) == -1 || 
		((Ctrl.value.indexOf(".com")<5)&&(Ctrl.value.indexOf(".org")<5)
		&&(Ctrl.value.indexOf(".gov")<5)&&(Ctrl.value.indexOf(".net")<5)
		&&(Ctrl.value.indexOf(".mil")<5)&&(Ctrl.value.indexOf(".edu")<5))) 
	    {
			alert ( "Please enter a valid email" )
		    document.infoForm.email.focus();
			document.infoForm.theButton.disabled = false;
		    return false;
	} 
	return true;
}


////////
function validate_topform ( )	{


    Ctrl = document.topform.email;
    if (Ctrl.value == "" || Ctrl.value.indexOf ('@', 1) == -1 || Ctrl.value.indexOf ('.', 1) == -1 || 
	((Ctrl.value.indexOf(".com")<5)&&(Ctrl.value.indexOf(".org")<5)
	&&(Ctrl.value.indexOf(".gov")<5)&&(Ctrl.value.indexOf(".net")<5)
	&&(Ctrl.value.indexOf(".mil")<5)&&(Ctrl.value.indexOf(".edu")<5)
	&&(Ctrl.value.indexOf(".us")<5))) 
    {
	alert ( "Please enter a valid email" )
    document.topform.email.focus();
    return false;
    } 
    return true;
}
	

// JavaScript Document
function removeSpaces(string) {
 return string.split(' ').join('');
}
