tilt.attachEvent(document, "contentreceived", function(){
	try {
	var nbsp = String.fromCharCode(160);
	var body = document.body;
	var isHome = true;
	var SCRIPTBASE = "";
	var cas = new ElementIdBag(
		"homemesg1",
		"homemesg2",
		"slideshow",
		"slideshow2",
		"headerimage",
		"bottom",
		"navigation"
	);
	body.appendChild(
		tilt.createTable(
			{
			"l-header":
				{
					"l-header": tilt.createTable(
					{
						"l-header-body":
						{
							"l-home-header":
								[ cas.headerimage ]
						}
					}, "l-header-body")
				},
			"l-message":
				{
					"l-message": [ " " ]
				},
			"l-body":
				{
					"l-left":
						[ cas.navigation ],
					"l-center": [
						tilt.createTable(
						{
							"l-home-top":
							{
								"l-left": [ cas.slideshow ],
								//"l-left": [ " " ],
								"l-right": [ cas.homemesg1 ]
							},
							"l-home-bottom":
							{
								"l-left": [ cas.homemesg2 ],
								"l-right": [ cas.slideshow2 ]
								//"l-right": [ " " ]
							}
						}, "l-home-body"),
						cas.bottom
					]
				}
			}, "l-body")
	);

	// mark first li as "first"
	foreach(body.getElementsByTagName("ul"), function(ul) {
		var items = ul.getElementsByTagName("li");
		if (items.length > 0) {
			var li = items[0];
			li.className = li.className + " first";
		}
	});

	// mark the ul and li elements with unique class
	var listnum = 0;
	numberLists(cas.navigation);

	}catch(e){alert(e)}
	
	function numberLists(node) {
		var inum = 0;
		var nodes = node.childNodes;
		if (nodes)
		{
			var length = nodes.length;
			for (var idx = 0; idx < length; ++idx)
			{
				if (nodes[idx].tagName)
				{
					switch (nodes[idx].tagName.toLowerCase())
					{
						case "ul":
							nodes[idx].className = nodes[idx].className + " l" + listnum++; 
							numberLists(nodes[idx]);
							break;
						case "li":
							nodes[idx].className = nodes[idx].className + " i" + inum++;
							numberLists(nodes[idx]);
							break;
					}
				}
			}
		}
	}
	
	function addClassIfPresent(node, test, className) {
		if (test) {
			node.className += " " + className;
		}
		return test;
	}
	
	function getInnerText(node)
	{
		var text = node.innerText;
		if (!text)
		{
			text = "";
			var childNode = node.firstChild;
			while(childNode)
			{
				if (childNode)
				{
					text += childNode.nodeType == 3 ? childNode.nodeValue : getInnerText(childNode);
				}
				childNode = childNode.nextSibling;
			}
		}
		return text;
	}
	
	function ElementIdBag()
	{
		this.contains = function()
		{
			for(var i = 0; i < arguments.length; i++)
			{
				if (!this[arguments[i]])
				{
					return false;
				}
			}
			return true;
		}
		
		for(var i = 0; i < arguments.length; i++)
		{
			var id = arguments[i];
			var element = document.getElementById(id);
			if (element)
			{
				this[id] = element;
			}
		}
	}
		
	function first(col) {
		if (col) {
			if (col.length) {
				return col.length > 0 && col[0];
			}
			else {
				var child = col.firstChild;
				while(child) {
					if (child.nodeType == 1) {
						return child;
					}
					child = child.nextSibling;
				}
			}
		}
		return null;
	}
	
	function children(node) {
		var result = [];
		var child = node.firstChild;
		while(child) {
			if (child.nodeType == 1) {
				result.push(child);
			}
			child = child.nextSibling;
		}
		return result;
	}
	
	function map(col, func) {
		var result = [];
		var length = col.length;
		if (length) {
			if (!func) {
				func = function(item) {
					return item;
				}
			}
			for(var i = 0; i < length; i++) {
				result.push(func(col[i], i, col));
			}
		}
		else {
			var child = col.firstChild;
			while(child) {
				if (child.nodeType == 1) {
					result.push(child);
				}
				child = child.nextSibling;
			}
		}
		return result;
	}
	
	function filter(col, func) {
		var result = [];
		var length = col.length;
		if (length) {
			if (!func) {
				func = function() {
					return true;
				}
			}
			for(var i = 0; i < length; i++) {
				var item = col[i];
				if (func(item, i, col)) {
					result.push(item);
				}
			}
		}
		return result;
	}
	
	function foreach(col, func) {
		var length = col.length;
		if (length) {
			for(var i = 0; i < length; i++) {
				if (func(col[i], i, col)) {
					return true;
				}
			}
		}
		else {
			var child = col.firstChild;
			while(child) {
				if (child.nodeType == 1 && func(child)) {
					return true;
				}
				child = child.nextSibling;
			}
		}
	}
	
	function rationalize(col) {
		if (col) {
			var hasValues;
			if (col.length > 0) {
				foreach(col, function(item) {
					if (item) {
						hasValues = true;
						return true;
					}
				});
				if (hasValues) {
					return col;
				}
			}
		}
	}
	
	function hasClass(node, className)
	{
		var rv = false;
		var classNames = node.className.split(" ");
		if (classNames && classNames.length > 0)
		{
			for (var y=0; (y < classNames.length) && (rv == false); ++y)
			{
				if (classNames[y] == className)
				{
					rv = true;
				}
			}
		}
		return rv;	
	}
	
	function replaceWithFlash(img)
	{
		var width = img.currentStyle ? img.currentStyle.width.replace(/px/, "") : img.width;
		var height = img.currentStyle ? img.currentStyle.height.replace(/px/, "") : img.height;
		var src = img.src;
		if (width && height && src) {

			var movie = src.replace(/\.swf\..+/, ".swf");
			var version = 4;
			var useNetscapePlugins = navigator.plugins && navigator.mimeTypes.length;
			
			if (detectFlash())
			{
				var parent = img.parentNode;
				if (parent.nodeName.toUpperCase() == "A") {
					parent = parent.parentNode;
				}
				parent.innerHTML = createMovieHtml();
			}
			
		}

		function createMovieHtml()
		{
			var sizeAttributes = "width=\"" + width + "\" height=\"" + height + "\"";
			return useNetscapePlugins ?
				"<embed type=\"application/x-shockwave-flash\" src=\"" + movie + "\" " + sizeAttributes + "></embed>"
				:
				"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " + sizeAttributes + "><param name=\"movie\" value=\"" + movie + "\" /></object>";
		}
		
		function detectFlash()
		{
			return getFlashVersion() >= version;

			function getFlashVersion()
			{
				if (useNetscapePlugins)
				{
					var plugin = navigator.plugins["Shockwave Flash"];
					if(plugin && plugin.description)
					{
						var description = plugin.description;
   						return description.charAt(description.indexOf('.')-1);
					}
				} 
				else
				{
					var version = 0;
					for(var i = 4; i >= 3; i--)
					{
						var testObject;
						try
						{
							testObject = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." +  i);
						}
						catch(e)
						{
							continue;
						}
						return i;
   					}
				}
				return 0;
			}
		}
	}
	
	function addScript(script, base) {
		if (script && document.body) {
			var scriptbase = base;
			var e = document.body.appendChild(document.createElement("script"));
			e.type = "text/javascript";
			if (base == null || base =="")
			{
				scriptbase = SCRIPTBASE;
			}
			e.src =  scriptbase + script;
		}
	}

});

