// JavaScript Document
document.observe('dom:loaded', function() {
    //Get the querystring if there is one.
	var queryString = window.location.search.substring(1);
	if(queryString.length > 0)
	{
		var theCategory = queryString.split("=")[1];
		var theClient = '';
		try
		{	
			theClient = queryString.split("=")[2];
			if(theClient==null)
			{
				theClient = '';
			}
			theCategory = theCategory.split("&")[0];
		}
		catch(err)
		{
			theClient = '';
		}
		if(theCategory != '')
		{
			var theTarget = "";
			var theSource = "";
			theClient = returnClient(theClient,theCategory);
			switch(theCategory)
			{
				case "branding":
				theTarget = "ul1";
				theSource = $('link1');
				break;
				case "design":
				theTarget = "ul2";
				theSource = $('link2');
				break;
				case "direct":
				theTarget = "ul3";
				theSource = $('link3');
				break;
				case "exhibition":
				theTarget = "ul4";
				theSource = $('link4');
				break;
				case "web":
				theTarget = "ul5";
				theSource = $('link5');
				break;
			}	
			showDesignCategory(theSource,theTarget,theClient,theCategory);
		}
	}
});

function returnClient(client,category)
{
	if(client == '')
	{
		switch(category)
		{
			case "branding":
			client = "pool";
			break;
			case "design":
			client = "zimmspine";
			break;
			case "direct":
			client = "andrews";
			break;
			case "exhibition":
			client = "artscott";
			break;
			case "web":
			client = "zpres";
			break;
		}
	}
	return client;
}