// JavaScript Document
function changeformaction(currentnode)
{
	if(currentnode.value == 'Graduate')
	{
		$('intelli').setAttribute('action', 'http://njit.intelliresponse.com/grad/index.jsp');
	}
	if(currentnode.value == 'Undergraduate')
	{
		$('intelli').setAttribute('action', 'http://njit.intelliresponse.com/undergrad/index.jsp');
	}
}

function topten()
{
	var gradunderCheck = $('grad_undergrad_check').getElementsByTagName('input');
	var ischecked = false;
	for(i=0; i<gradunderCheck.length; i++)
	{
		if(gradunderCheck[i].checked)
		{
			ischecked = true;
			if(gradunderCheck[i].value == 'Graduate')
			{
				window.location = 'http://njit.intelliresponse.com/grad/index.jsp?question=&requestType=TopQuestionsRequest';
			}
			if(gradunderCheck[i].value == 'Undergraduate')
			{
				window.location = 'http://njit.intelliresponse.com/undergrad/index.jsp?question=&requestType=TopQuestionsRequest';
			}
		}
		
	}
	if(!ischecked)
	{
		alert('Please select either Undergrad or Graduate.');
	}
}

function setformaction()
{
	var gradunderCheck = $('grad_undergrad_check').getElementsByTagName('input');
	for(i=0; i<gradunderCheck.length; i++)
	{
		if(gradunderCheck[i].checked)
		{
			if(gradunderCheck[i].value == 'Graduate')
			{
				$('intelli').setAttribute('action', 'http://njit.intelliresponse.com/grad/index.jsp');
			}
			if(gradunderCheck[i].value == 'Undergraduate')
			{
				$('intelli').setAttribute('action', 'http://njit.intelliresponse.com/undergrad/index.jsp');
			}
		}
		
	}
}

