var timeoutid;

function blinfo(id) {

	switch(id) {
		case 1:
			info = 'Click here to return to our front page.';
		break;
		case 2:
			info = 'Browse through our lineup of Arcade Stations and related products.';
		break;
		case 3:
			info = 'Read about our company.';
		break;
		case 4:
			info = 'Contact us by phone, fax, mail, or directly through our website.';
		break;
		case 5:
			info = 'Technical and billing support information.';
		break;
		case 6:
			info = 'A map of our site, in case you get lost.';
		break;
		case 7:
			info = 'Links to recommended sites about arcade machines, gaming, and more.';
		break;
		case 8:
			info = 'View site privacy policy and terms of service.';
		break;
		case 'x':
			document.getElementById('binfo').style.background = '';
			return true;
	}
	clearTimeout(timeoutid);
	document.getElementById('binfo').innerHTML = info;
	document.getElementById('binfo').style.display = 'block';
}

function hide_blinfo() {
	clearTimeout(timeoutid);
	timeoutid = setTimeout("blinfo(\"x\");", 2000);
}

function emails() {
	esuf = '@' + 'quasimoto' + '.' + 'com';
	epre = '<a href="mail' + 'to:';
	document.getElementById('e_0').innerHTML = epre + 'cgerding' + esuf + '">' + 'cgerding' + esuf;
	document.getElementById('e_1').innerHTML = epre + 'jessica' + esuf + '">' + 'jessica' + esuf;
	document.getElementById('e_2').innerHTML = epre + 'dtrent' + esuf + '">' + 'dtrent' + esuf;
	
}

function fcheck() {
	err = document.getElementById('e_err');
	err.innerHTML = "";
	e_name = document.getElementById('e_name');
	if (e_name.value.length < 1) {
		e_name.style.border = "1px solid #ff0000";
		err.innerHTML += "<li>Please provide your name.</li>";
	}
	e_email = document.getElementById('e_email');
	if (e_email.value.length < 3 || strpos(e_email.value, '@', 0) == false) {
		err.innerHTML += "<li>Please provide a valid email address.</li>";
	}
	e_subject = document.getElementById('e_subject');
	if (e_subject.value.length < 1) {
		e_subject.value = "(no subject)";
	}
	e_body = document.getElementById('e_body');
	if (e_body.value.length < 20) {
		e_body.style.border = "1px solid #ff0000";
		err.innerHTML += "<li>You forgot to type a message.</li>";
	}

	if (err.innerHTML.length > 0) {
		err.innerHTML = "<br><strong>Message cannot be sent.</strong><ul>" + err.innerHTML + "</ul>";


		return false;
	} else {
		return true;
	}
}


function strpos( haystack, needle, offset){
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: strpos('Kevin van Zonneveld', 'e', 5);
    // *     returns 1: 14
 
    var i = haystack.indexOf( needle, offset ); // returns -1
    return i >= 0 ? i : false;
}

function hide_dom(id) {
	document.getElementById(id).style.display = 'none';
}

function show_dom(id) {
	document.getElementById(id).style.display = 'block';
}
