var contact = false;
var divtags = Array ('uses','what','try-it','featured-apps','inquiry','get-it','features','thank-you');

function showContent(id)
{
	if (!contact) {
		var divlength = divtags.length;
		for (i=0; i<divlength; i++) {
			var content_id = divtags[i];
			var object_id = getStyleObject(content_id);
			if (content_id != id) {
				object_id.display = "none";
			} else {
				object_id.display = "inline";
			}
		}
		if (id=='inquiry') contact = true;
	} else return false;
}
	
function getStyleObject(objectId) 
{
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	} else if (document.all && document.all(objectId)) {
		return document.all(objectId).style;
	} else if (document.layers && document.layers[objectId]) {
		return document.layers[objectId];
	} else {
		return false;
	}
}

function processform(f)
{
	var d = document.inquiry_form;
	var a = 'Please enter ';
	var name = d.form_name.value;
	var email = d.form_email.value;
	var comments = d.form_comments.value;
	if (name.length<2||email.length<7||comments.length<4||comments.length>250) {
		if (name.length<2) {
			a += 'your name';
			if (email.length<7) {
				a+= ' and email';	
			}
			if (comments.length<4) {
				a+= ' and comment';	
			} 
			if (comments.length>250) {
				a+= ' and limit your comment to 250 characters or less';
			}
		} else {
			if (email.length<7) {
				a+= 'your email';
				if (comments.length<4) {
				a+= ' and comment';	
				}
				if (comments.length>250) {
				a+= ' and limit your comment to 250 characters or less';
				}
			} else {
				if (comments.length<4) {
				a+= 'a comment';	
				}
				if (comments.length>250) {
				a = 'Please limit your comment to 250 characters or less';
				}
			}
		}
		a += "!";
		alert (a);	
	} else {
		d.submit();	
	}
}

function clearform()
{
	if (confirm("Are you sure you want to clear the form?")) {
		document.inquiry_form.reset();
	}
	return true;
}

function hideform()
{
	contact = false;
	showContent('featured-apps');
}
