function maxLen(item, len) {
	if (item.value.length > len)
		item.value = item.value.substring(0, len);
}
function admin() {
	document.getElementById("admin").innerHTML = "<form method='post' action=''><input id='passwordField' type='password' name='password' size='5' /><input type='submit' value='log in' /></form>";
	document.getElementById("passwordField").focus();
}
function toggleVideo(item) {
	if (document.getElementById('video').style.display != 'inline') {
		document.getElementById('video').style.display = 'inline';
		item.value = "I'm done watching.";
	} else {
		document.getElementById('video').style.display = 'none';
		item.value = "See our commercial!";
	}
}
function blink() {
	document.getElementById("blinkFrame").style.display = "inline";
	setTimeout("unblink()", 100);
}
function unblink() {
	document.getElementById("blinkFrame").style.display = "none";
	var time = 2000 + Math.floor(Math.random() * 2000);
	if (Math.random() < 0.2) time = 100;
	setTimeout("blink()", time);
}
function bloop(item){
	document.getElementById("dummy").innerHTML="<embed src=\"tinky.wav\" hidden=\"true\" autostart=\"true\" loop=\"false\" style=\"display: hidden;\" />";
	$(item).animate({top: '-=5'}, 100, function(){$(this).animate({top: '+=5'}, 100);});
}

