﻿// FOR MISC JAVASCRIPT STUFF
function hideDiv(divName)
{
    document.getElementById(divName).className = "invisible";
}

function showDiv(divName)
{
    document.getElementById(divName).className = "visible";
}

function hideDivsIn(id) 
{
	
    navRoot = document.getElementById(id);
    for (i=0; i<navRoot.childNodes.length; i++) 
    {
	    node = navRoot.childNodes[i];
		if (node.nodeName=="DIV") 
		{
			node.className="invisible";
		}
	}
}
			
function switchTo(id, hide) 
{
	hideDivsIn(hide);
	temp = document.getElementById(id);
	temp.className = "visible";
}

function sendFeedback()
{
	var name = $("name");
	var email = $("email");
	var comments = $("comments");
	
	if(comments.value == "")
	{
		alert('Please enter a comment before sending us feedback');
		return;
	}
	
	new Ajax.Request(
		"service.ashx?method=sendfeedback",
		{
			method: "get",
			parameters: { name: name, email: email, comments: comments },
			onSuccess:  function(transport)
			{
				$("confirmation").show();
				new Effect.Fade("confirmation", { duration: 3.0 });
			}
		}
	);
}