	function opacity(id, opacStart, opacEnd, millisec) {

		//speed for each frame
		var speed = Math.round(millisec / 100);
		var timer = 0;
	
		//determine the direction for the blending, if start and end are the same nothing happens
		if(opacStart > opacEnd) {
			for(i = opacStart; i >= opacEnd; i--) {
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		} else if(opacStart < opacEnd) {
			for(i = opacStart; i <= opacEnd; i++)
				{
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		}
	}
	
	//change the opacity for different browsers
	function changeOpac(opacity, id) {
		var object = document.getElementById(id).style; 
		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = "alpha(opacity=" + opacity + ")";
	}
	
	
	function mouseovermain(divid)
	{
		document.getElementById('bg'+divid).style.background='url(engineering2.jpg)';
		document.getElementById(divid).style.filter='alpha(opacity=0)';
		document.getElementById(divid).style.opacity='0';
		document.getElementById(divid).style.display='inline';
		document.getElementById('text'+divid).style.paddingLeft='1px';
		document.getElementById('text'+divid).style.paddingTop='3px';

		opacity(divid, 0, 100, 500);
	}
	function mouseoffmain(divid)
	{
		document.getElementById(divid).style.display='none';
		document.getElementById('bg'+divid).style.background='url(barrepeat.jpg)';
		document.getElementById('text'+divid).style.paddingLeft='0px';
		document.getElementById('text'+divid).style.paddingTop='2px';

	}
	function mouseoversub(divid)
	{
		document.getElementById(divid).style.display='inline';
		document.getElementById('bg'+divid).style.background='url(engineering2.jpg)';
		document.getElementById('text'+divid).style.paddingLeft='1px';
		document.getElementById('text'+divid).style.paddingTop='3px';
	}
	function mouseoffsub(divid)
	{
		document.getElementById(divid).style.display='none';
		document.getElementById('bg'+divid).style.background='url(barrepeat.jpg)';
		document.getElementById('text'+divid).style.paddingLeft='0px';
		document.getElementById('text'+divid).style.paddingTop='2px';

	}
	function mouseoversubsmall(divid)
	{
		document.getElementById(divid).style.display='inline';
	}
	function mouseoffsubsmall(divid)
	{
		document.getElementById(divid).style.display='none';

	}
	function mouseovermainsmall(divid)
	{
		document.getElementById('bg'+divid).style.background='url(engineering2.jpg)';
		document.getElementById(divid).style.filter='alpha(opacity=0)';
		document.getElementById(divid).style.opacity='0';
		document.getElementById(divid).style.display='inline';

		opacity(divid, 0, 100, 500);
	}
	function mouseoffmainsmall(divid)
	{
		document.getElementById(divid).style.display='none';
		document.getElementById('bg'+divid).style.background='url(barrepeat.jpg)';

	}
	function mouseoverimg(divid)
	{
		document.getElementById('color'+divid).style.display='none';
		document.getElementById(divid).style.filter='alpha(opacity=0)';
		document.getElementById(divid).style.opacity='0';
		document.getElementById(divid).style.display='inline';
		opacity(divid, 0, 100, 150);
	}
	function mouseoffimg(divid)
	{
		document.getElementById('color'+divid).style.filter='alpha(opacity=0)';
		document.getElementById('color'+divid).style.display='inline';
		document.getElementById(divid).style.display='none';
		document.getElementById('color'+divid).style.opacity='0';
		opacity('color'+divid, 0, 100, 150);
	}