window.onload = loadBody;
function loadBody() {
	if (!document.all) {
		if (document.getElementById('portfolio'))
			document.getElementById('portfolio').style.height = '100%';
		if (document.body.clientHeight < window.innerHeight)
			document.getElementById('container').style.height = (window.innerHeight - 33) + 'px';
	}
}

function validateContactForm(theForm) {
	if (theForm.name.value == '' && theForm.business.value == '') {
		alert('Error: You must specify a name or business name!');
		return false;
	}
	if (theForm.phone.value == '' && theForm.email.value == '') {
		alert('Error: You must specify a phone number or email address!');
		return false;
	}
	if (theForm.email.value != '') {
		if (!validEmail(theForm.email.value)) {
			alert('Error: Your email address is not valid!');
			return false;
		}
	}
	if (theForm.body.value == '') {
		alert('Error: You must enter something in the body of your email!');
		return false;
	}
	return true;
}

function validEmail(email) {
	if (email.length < 3)
		return false;
	theStr = new String(email);
	var index = theStr.indexOf("@");
	if (index > 0) {
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index + 1) && (theStr.length > pindex + 1))
			result = true;
	}
	return result;
}