try
{
	var IE = (navigator.userAgent.toLowerCase().indexOf("msie") != -1 ? true : false);
}
catch(e)
{
	var IE = false;
}

// Unfortunately SlideDown does not work in IE,
// hence this implementation.
// Show the properties of the folder
function ShowProperties()
{
	if(IE)
	{
		Element.hide('list');
		Element.show('folder_rights');
	}
	else
	{
		new Effect.SlideUp('list', {queue: 'front'});
		new Effect.SlideDown('folder_rights', {queue: 'end'});
	}
	Element.show('list_link');
	Element.hide('rights_link');
	return false;
}

// Show the sub-folders and files in a folder
function ShowList()
{
	if(IE)
	{
		Element.hide('folder_rights');
		Element.show('list');
	}
	else
	{
		new Effect.SlideUp('folder_rights', {queue: 'front'});
		new Effect.SlideDown('list', {queue: 'end'});
	}
	Element.show('rights_link');
	Element.hide('list_link');
	return false;
}

// Create, Update and Delete is only possible when Reading is allowed too.
// By using this function onclick of the Read checkbox, you make sure that if
// Reading is not allowed Create, Update and Delete is not allow either.
function UncheckCreateUpdateDelete(checked, group)
{
	if(!checked)
	{
		eval("document.getElementById('create_check_box_" + group + "').checked = false");
		eval("document.getElementById('update_check_box_" + group + "').checked = false");
		eval("document.getElementById('delete_check_box_" + group + "').checked = false");
	}
}

// By using this function onclick of the Create, Update and Delete checkbox,
// you make sure that if Create, Update and Delete is allowed, Reading is allowed too.
function CheckRead(checked, group)
{
	if(checked)
	{
		eval("document.getElementById('read_check_box_" + group + "').checked = true");
	}
}

function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}