function undergrad()
{
	document.getElementById('undergrad').style.display = 'block';
	document.getElementById('postgrad').style.display = 'none';
	return(false);
}

function postgrad()
{
	document.getElementById('postgrad').style.display = 'block';
	document.getElementById('undergrad').style.display = 'none';
	return(false);
}

function searchClear(){
	if(document.getElementById('qt').value == 'Search...'){
		document.getElementById('qt').value = '';	
	}
	return false;	
}

function searchLoss(){
	if(document.getElementById('qt').value == ''){
		document.getElementById('qt').value = 'Search...';	
	}	
}

function textSize(size)
{
	if(size == '1')
	{
		document.body.style.fontSize = '0%';
		writeCookie("UUCSS", "1", "99999");
		selectors(0);
	}
	if(size == '2')
	{
		document.body.style.fontSize = '100%';
		writeCookie("UUCSS", "2", "99999");
		selectors(1);
	}
	if(size == '3')
	{
		document.body.style.fontSize = '115%';
		writeCookie("UUCSS", "3", "99999");
		selectors(2);
	}
	if(size == '4')
	{
		document.body.style.fontSize = '130%';
		writeCookie("UUCSS", "4", "99999");
		selectors(3);
	}
}

function selectors(option)
{
	if(option == 0)
	{
		document.getElementById('textsizes').innerHTML = 'Accessibility<a href="#" onclick="javascript:textSize(1);"><img src="images/small.gif" alt="Small Font" width="15" height="15" border="0" align="absmiddle" class="on" /></a><a href="#" onclick="javascript:textSize(2);"><img src="images/normal.gif" alt="Normal Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(3);"><img src="images/large.gif" alt="Large Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(4);"><img src="images/xlarge.gif" alt="Extra Large Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a>';
	}
	
	if(option == 1)
	{
		document.getElementById('textsizes').innerHTML = 'Accessibility<a href="#" onclick="javascript:textSize(1);"><img src="images/small.gif" alt="Small Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(2);"><img src="images/normal.gif" alt="Normal Font" width="15" height="15" border="0" align="absmiddle" class="on" /></a><a href="#" onclick="javascript:textSize(3);"><img src="images/large.gif" alt="Large Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(4);"><img src="images/xlarge.gif" alt="Extra Large Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a>';

	}
	
	if(option == 2)
	{
		document.getElementById('textsizes').innerHTML = 'Accessibility<a href="#" onclick="javascript:textSize(1);"><img src="images/small.gif" alt="Small Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(2);"><img src="images/normal.gif" alt="Normal Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(3);"><img src="images/large.gif" alt="Large Font" width="15" height="15" border="0" align="absmiddle" class="on" /></a><a href="#" onclick="javascript:textSize(4);"><img src="images/xlarge.gif" alt="Extra Large Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a>';

	}
	
	if(option == 3)
	{
		document.getElementById('textsizes').innerHTML = 'Accessibility<a href="#" onclick="javascript:textSize(1);"><img src="images/small.gif" alt="Small Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(2);"><img src="images/normal.gif" alt="Normal Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(3);"><img src="images/large.gif" alt="Large Font" width="15" height="15" border="0" align="absmiddle" class="off" /></a><a href="#" onclick="javascript:textSize(4);"><img src="images/xlarge.gif" alt="Extra Large Font" width="15" height="15" border="0" align="absmiddle" class="on" /></a>';

	}
}

function showOptions()
{
	var option = document.getElementById("options");
	option.style.display = "block";
	
	document.getElementById("optionsTitle").innerHTML = '<a href="#" onClick="javascript:hideOptions();return false;"><img src="images/icons/up.gif" alt="See no options" align="absmiddle" /></a>&nbsp;<a href="#" onClick="javascript:hideOptions();return false;" alt="See no options">No options</a>';
	
}

function hideOptions()
{
	var option = document.getElementById("options");
	option.style.display = "none";
	
	document.getElementById("optionsTitle").innerHTML = '<a href="#" onClick="javascript:showOptions();return false;"><img src="images/icons/down.gif" alt="Show options" align="absmiddle" /></a>&nbsp;<a href="#" onClick="javascript:showOptions();return false;" alt="Show options">More options</a>';
}

function applyWindow(id)
{
	launchCenter('http://prospectus.ulster.ac.uk/apply2.php', 'appwin', '400', '800');
	return false;
}

function requestWindow()
{
	appwin=window.open('http://prospectus.ulster.ac.uk/apply2.php?id=','request', 'height=600, width=800, scrollbars=yes, resizable=no');
	launchCenter('http://prospectus.ulster.ac.uk/apply2.php', 'appwin', '600', '800');
	return false;
}

function launchCenter(url, name, height, width) {
	//function to open a window that is centered in the screen
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;

	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;

		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}
	str += ",resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no";
	return window.open(url, name, str);
}


function moreWindow(id)
{
	appwin=window.open('http://enquiries.ulster.ac.uk/prospects/?id=' + id,'more', 'height=600, width=950, scrollbars=yes, resizable=no');
	appwin.focus();
	return false;
}

function emailWindow(id)
{
	appwin=window.open('http://prospectus.ulster.ac.uk/email.php?id=' + id ,'email', 'height=230, width=400, scrollbars=yes, resizable=no');
	appwin.focus();
	return false;
}