

// JavaScript Document

$(document).ready(
		function(){
			$('#bg1').fadeIn("slow"); 
		});
$(document).ready(
		function(){
			$('#image_rotate1').innerfade({ 
				speed: 3000, 
				timeout: 6000, 
				type: 'sequence', 
				containerheight: '220px'
		});
	});

	function menuActivate()
	{
//		clearTimeout(to);
		$('#yellowbox').fadeIn('slow');
	}
	
	function menuDeactivate()
	{
		to = setTimeout(function () { $('#yellowbox').slideLeftHide(); }, 5000);
	}
	
	function menuItem(menuId, menuCol)
	{
		document.getElementById('yellowbox').style.backgroundImage = "url(/images/colour-" + menuCol + ".png)";
		$('#yellowbox').fadeIn('slow');
		$("#bluebox").fadeOut("fast");
		$("#greenbox").fadeOut("fast");
		$("#orangebox").fadeOut("fast");
		for(a = 1; a <= 8; a++)
		{
			$("#subMenu" + a).fadeOut("fast");
			$('#bg' + a).hide();
		}
		document.getElementById('greenDot').style.display = 'none';
		document.getElementById('orangeDot').style.display = 'none';
		$('#bg' + menuId).fadeIn("slow"); 
		$("#subMenu" + menuId).fadeIn("slow");
	}
	
	function boxActivate(boxId)
	{
		if((boxId >= 36)&&(boxId <= 43))
		{
			$("#bluebox").fadeOut("fast");
			$("#orangebox").fadeOut("fast");
			$("#greenbox").fadeIn("slow");
		}
		else if(((boxId >= 44)&&(boxId <= 50))||((boxId >= 63)&&(boxId <= 64)))
		{
			$("#bluebox").fadeOut("fast");
			$("#greenbox").fadeOut("fast");
			$("#orangebox").fadeIn("slow");
		}
		else
		{
			$("#greenbox").fadeOut("fast");
			$("#orangebox").fadeOut("fast");
			$("#bluebox").fadeIn("slow");
		}
		fadeOutOthers();
		$("#bluecontent" + boxId).fadeIn("slow");
	}
	
	function fadeOutOthers()
	{
		for(a = 1; a <= 100; a++)
		{
			if(document.getElementById("bluecontent" + a))
			{
				document.getElementById("bluecontent" + a).style.display = 'none';
			}
		}
	}
	
	function closeBlueBox()
	{
		fadeOutOthers();
		$("#bluebox").fadeOut("slow");
	}

	function closeGreenBox()
	{
		fadeOutOthers();
		$("#greenbox").fadeOut("slow");
	}

	function closeOrangeBox()
	{
		fadeOutOthers();
		$("#orangebox").fadeOut("slow");
	}

	function closeYellowBox()
	{
		fadeOutOthers();
		$("#greenbox").fadeOut("slow");
		$("#orangebox").fadeOut("slow");
		$("#bluebox").fadeOut("slow");
		$("#yellowbox").fadeOut("slow");
	}

	function toggleProjects(showDiv)
	{
		document.getElementById('projectsLive').style.display = 'none';
		document.getElementById('projectsFuture').style.display = 'none';
		document.getElementById(showDiv).style.display = 'inline';
	}
	
	function showGreenDot(leftPos, topPos)
	{
		document.getElementById('orangeDot').style.display = 'none';
		document.getElementById('greenDot').style.display = 'inline';
		document.getElementById('greenDot').style.left = leftPos + 'px';
		document.getElementById('greenDot').style.top = topPos + 'px';
	}

	function showOrangeDot(leftPos, topPos)
	{
		document.getElementById('greenDot').style.display = 'none';
		document.getElementById('orangeDot').style.display = 'inline';
		document.getElementById('orangeDot').style.left = leftPos + 'px';
		document.getElementById('orangeDot').style.top = topPos + 'px';
	}


// JavaScript Document
function print_mail_to(mailto_name, mailto_domain, mailto_subject)
{
	document.write('<a href=\"mailto:');
	document.write(mailto_name+'@');
	document.write(mailto_domain+'?');
	document.write('Subject='+mailto_subject+'\">'+mailto_name);
	document.write('@'+mailto_domain);
	document.write('</a>');
}


