$(document).ready(function(){
				
	$("a.signup").click(function (e) {						   
		e.preventDefault();	
		$(this).colorbox({href:"content_pop.php #signup", height:"300px", width:"360px", opacity:0.5, transition:"elastic"});
	});
	$("a.welcome").click(function (e) {								   
		e.preventDefault();	
		$(this).colorbox({href:"content_pop.php #welcome", height:"300px", width:"450px", opacity:0.5, transition:"elastic"});
	});
	$("a#contact").click(function (e) {								   
		e.preventDefault();	
		$(this).colorbox({href:"content_pop.php #contactUs", height:"300px", width:"450px", opacity:0.5, transition:"elastic"});
	});
	$("a#terms").click(function (e) {								   
		e.preventDefault();	
		$(this).colorbox({href:"content_pop.php #termspop", height:"300px", width:"450px", opacity:0.5, transition:"elastic"});
	});
});
			
function signup(in1, in2, in3, in4, in5){
	if(in1 == "" || in1 == "First Name" || in2 == "" || in2 == "Last Name" || in3 == "" || in3 == "Email" || in4 == "" || in4 == "Company"){
		alert("all required!");
		return;
	}
	if(in5 == false) {
		alert("You have to read and accept the terms of use.");
		return;
	}
	
	AtPos = in3.indexOf("@")
	StopPos = in3.lastIndexOf(".")
	//alert(email + " att = " + AtPos + " stt = " + StopPos);
	if (AtPos == -1 || StopPos == -1) {
		alert("Not a valid email address");
		return;
	}else 
	
	if (StopPos < AtPos) {
		alert("Not a valid email address");
		return;
	}else
	
	if (StopPos - AtPos == 1) {
		alert("Not a valid email address");
		return;
	}
	

	$.post("send.php", { fname: in1, lname: in2, email: in3, company: in4 },
	   function(data){
			$('#done').fadeOut('slow', function() {
				$('#thanks').fadeIn('slow');
			});
	});
}

