window.onload = montre;

function montre(id,levelid)
{
	var d = document.getElementById(id);
	for (var i = 1; i<=30; i++)
	{
		if (document.getElementById(levelid+i))
		{
			document.getElementById(levelid+i).style.display='none';
		}
	}
	if (d)
	{
		d.style.display='block';
	}
}

function redirect(t)
{
	document.location.href = t;
}

function searchUrl(t, path)
{
	redirect('/' + path + '?search=' + t);
}

function search(e, path)
{
	searchUrl(document.getElementById(e).value, path);
}

function searchEnter(e, path)
{
	var callerObject = e;
	var characterCode;

	if(e && e.which)
	{
		e = e;
		characterCode = e.which;
	}
	else
	{
		e = event;
		characterCode = e.keyCode;
	}

	if(characterCode == 13)
	{
		searchUrl(callerObject.value, path);
		return false;
	}
	else
	{
		return true;
	}
}

