var content = {};

function init()
{
	insertFlash(document.getElementById("FlashBanner"), "swf", "FlashBanner", 930, 270);
	
	addMenu();
	addBoxes();
	addFooter();
	callGoogle("UA-10999145-1");
}

var newsStories = [];

function addBoxes()
{
	var contentDIV = document.getElementById("Content");
	
	for (var i=0; i<content.boxes.length; i++)
	{
		var box = new Box("box" + (i+1) + " ws");
		box.setTitle(content.boxes[i].heading);
		
		box.setHTML("<div class=\"text\">" + content.boxes[i].text + "<p><a href=\"" + content.boxes[i].go + "\">Read More</a> <img src=\"images/arrow_blue.gif\"></p></div>");
		box.content.style.backgroundImage = "url(\"images/" + content.boxes[i].image + "\")";
		box.content.style.backgroundRepeat = "no-repeat";
		
		contentDIV.appendChild(box.element);
		box.fixHeight();
	}
	
	box = new Box("box5 ws");
	box.setTitle("Clients");
	contentDIV.appendChild(box.element);
	
	var clientHTML = "<img src=\"images/" + clients.image + "\" usemap=\"#clients\" style=\"border:0;\"><map id=\"clients\" name=\"clients\">"
	
	for (var i=0; i<clients.hotspots.length; i++)
		clientHTML += "<area shape=\"" + clients.hotspots[i].shape + "\" coords=\"" + clients.hotspots[i].coords + "\" href=\"study.htm?name=" + clients.hotspots[i].client + "\">";
	
	clientHTML += "</map>";
	
	box.setHTML(clientHTML);
	box.fixHeight();
	
	box = new Box("box6 ws");
	box.setTitle(content.six.heading);

	box.setHTML("<div class=\"textsurvey\">" + content.six.text + "</div>");
	box.content.style.backgroundImage = "url(\"images/" + content.six.image + "\")";
	box.content.style.backgroundRepeat = "no-repeat";
	
	contentDIV.appendChild(box.element);
	box.fixHeight();
	
	$.getScript(
		"news.asp",
		function()
		{
			box = new Box("box4 ws")
			box.setTitle("News");
			contentDIV.appendChild(box.element);
	
			var stories = newsStories;
			
			var newsDiv = box.content;
			var storyCount = (stories.length<3?stories.length:3);
			var articleDiv = null;
			
			for (var i=0; i<storyCount; i++)
			{
				articleDiv = createDiv("story");
				articleDiv.innerHTML = "<div class=\"title\"><img src=\"images/bullet-blue-square.gif\">" + stories[i].title + "</div><div class=\"teaser\">" + stories[i].teaser + "</div><div class=\"more\"><a href=\"news.htm?item=" + stories[i].id + "\">Read More</a> <img src=\"images/arrow_blue.gif\"></div>";
				articleDiv.newsID = i;
				
				newsDiv.appendChild(articleDiv);
			}
			
			if (articleDiv != null)
				articleDiv.style.borderBottom = "none";
	
			box.fixHeight();
		}
	);
}

function addFooter(){};