function showTweet(id) {
	var d = new Date();
	var time = d.getTime();
	$("div#twitter").load("showtweet.php?id="+id+"&gibberish="+time);
}

function showVideo(id) {
	var d = new Date();
	var time = d.getTime();
	$("div#videoarea").load("showvideo.php?id="+id+"&gibberish="+time);
}

// mailing list functions

function addMail() {
	var email = $("#email").val();
	var state = $("#state").val();
	
	if (check_email(email)) {
		$.post("addmail.php", { email: email, state: state });
		$("#email").val("Thanks!");
		$("#email").attr("disabled","disabled");
	} else {
		alert("Please enter a valid email address.");
	}
}

function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
}	
} 

if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);		
} 

}

}

