function navigationtype_change()
{
	navtype = document.getElementById('navigationtype');

	switch (navtype.options[navtype.selectedIndex].value) {
		case 'showall':
			document.getElementById('status').style.display = 'none';
			showall();
			break;
		case 'status':
			document.getElementById('status').style.display = 'block';
			status_change();
			break;
	}
}


function showall()
{
	theform = document.getElementById('listprojects');
	
	theform.action = 'index.php?module=pagesetter&tid=7';
	theform.submit();
}


function status_change()
{
	theform = document.getElementById('listprojects');
	thestatus = document.getElementById('status');
	
	theform.action = 'index.php?module=pagesetter&tid=7&filter=status^sub^' + thestatus.options[thestatus.selectedIndex].value;
	theform.submit();
}


function project_navigationtype_change()
{
	navtype = document.getElementById('navigationtype');

	switch (navtype.options[navtype.selectedIndex].value) {
		case 'all':
			document.getElementById('thematicarea').style.display = 'none';
			document.getElementById('status').style.display = 'none';
			project_status_change();
			break;
		case 'thematicarea':
			document.getElementById('thematicarea').style.display = 'block';
			document.getElementById('status').style.display = 'none';
			project_thematicarea_change();
			break;
		case 'status':
			document.getElementById('thematicarea').style.display = 'none';
			document.getElementById('status').style.display = 'block';
			project_status_change();
			break;
	}
}


function project_thematicarea_change()
{
	var theform = document.getElementById('listprojects');

	var tid = document.getElementById('tid').value;
	var pid = document.getElementById('pid').value;

	var thematicarea = document.getElementById('thematicarea');
	var thematicareaval = thematicarea.options[thematicarea.selectedIndex].value;

	theform.action = 'index.php?module=pagesetter&func=viewpub&tid=' + tid + '&pid=' + pid + '&tpl=projects&navigationtype=thematicarea&thematicarea=' + thematicareaval;
	theform.submit();
}


function project_status_change()
{
	var theform = document.getElementById('listprojects');

	var tid = document.getElementById('tid').value;
	var pid = document.getElementById('pid').value;

	var status = document.getElementById('status');
	var statusval = status.options[status.selectedIndex].value;

	theform.action = 'index.php?module=pagesetter&func=viewpub&tid=' + tid + '&pid=' + pid + '&tpl=projects&navigationtype=status&status=' + statusval;
	theform.submit();
}

