var nColor = 'white';
var oColor = '';

function initHomePage() {
	changeBG(0);
	flashAutoInit();
}

function flashAutoInit() {
	var flashObjs = document.getElementsByTagName("object");
	for (var i=0; i<flashObjs.length; i++) {
		flashObjs[i].outerHTML = flashObjs[i].outerHTML;
	}
}

function changeBG(link){
	document.getElementById("menuItem0").style.backgroundColor = oColor;
	//document.getElementById("menuItem1").style.backgroundColor = oColor;
	document.getElementById("menuItem2").style.backgroundColor = oColor;
	document.getElementById("menuItem3").style.backgroundColor = oColor;
	//document.getElementById("menuItem4").style.backgroundColor = oColor;
	//document.getElementById("menuItem5").style.backgroundColor = oColor;
	document.getElementById("menuItem6").style.backgroundColor = oColor;
	//document.getElementById("menuItem7").style.backgroundColor = oColor;

	switch(link) {
		case 0:
			document.getElementById("menuItem0").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="http://www.berryplastics.com/wps/portal/!ut/p/c1/04_SB8K8xLLM9MSSzPy8xBz9CP0os3g30-BgRydDRwP_EFcLA6MAYwvjkCA3IwNPM6B8JJK8hauvIVDe0M_X18LEAAgI6A4H2YekwsDUD6zfzcLfBWiSvwmaPJr57gTkQfaD5A1wAEcDfT-P_NxU_YLcCINMT11HAL3ttnU!/dl2/d1/L2dJQSEvUUt3QS9ZQnB3LzZfRjVTU0FCMUEwT1RFODAyUDM4M1RSRjIwMjM!/?WCM_GLOBAL_CONTEXT=/wps/wcm/connect/Berry%20Plastics%20Web%20Content/www.berryplastics.com/home/corporate/news/news+articles/new+ruffies+pro+duct+and+masking+tape+line+delivers+quality+adhesive+products+for+consumer+household+applications" title=""><img src="'+whatsNewImg+'" alt=""  /></a></td></tr></table>';		
			break;
			
		case 1:
			document.getElementById("menuItem1").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="">Innovation</a><br>text </td></tr></table>';		
			break;
			
		case 2:
			document.getElementById("menuItem2").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="/wps/portal/services/creativeservices" target="" title=""><img src="'+creativeServicesHomeImg+'" alt=""  /></a></td></tr></table>';
			break;
			
		case 3:
			document.getElementById("menuItem3").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="/wps/portal/services/berrydesigncenter" target="" title=""><img src="'+designCenterHomeImg+'" alt=""  /></a></td></tr></table>';	
			break;
			
		case 4:
			document.getElementById("menuItem4").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="">Global Services</a><br>text </td></tr></table>';
			break;
			
		case 5:
			document.getElementById("menuItem5").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="">Technical Services</a><br>text </td></tr></table>';
			break;
			
		case 6:
			document.getElementById("menuItem6").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><a href="/wps/portal/services/decoratingservices" target="" title=""><img src="'+decoratingServicesHomeImg+'" alt=""  /></a></td></tr></table>';
			break;
			
		case 7:
			document.getElementById("menuItem7").style.backgroundColor = nColor;
			document.getElementById("contentArea").innerHTML= '<table id="topic2"><tr><td><img src="'+topic3Image+'" width="60" height="60" alt="" style="float:left"><a href="">Plastic Codes</a><br>What does the number coee mean on the bottom of your product?</td></tr><tr><td><a href="">Resin Capabilities</a><br>We use over 8 different resins for our products. Learn the differences of each.</td></tr><tr><td><a href="">Bio Resins</a><br>New resin options have environmentally-friendly traits.</td></tr></table>';		
			break;

		case 8:
			document.getElementById("menuItem8").style.backgroundColor = nColor;
			break;

		default:
			document.getElementById("menuItem0").style.backgroundColor = nColor;
	};
}