// what we need to set the page locations
var ourvert; //define the page checking variable
var mapage = new String(window.location); //pulling the browser url

var inc = new Array();
	inc[0] = "/includes/header.html";
	inc[1] = "/includes/Navtop.html";
	inc[2] = "/includes/Navbottom.html";
	inc[3] = "/includes/NavLeft.html";
	inc[4] = "/includes/footer.html";
	inc[5] = "/includes/flash.html";
	// left navigation elements 
	inc[6] = "/includes/l3nav/safety.html";
			

		
window.addEvent('domready', function() { 
	// grabs the non-special pages
	new Ajax(inc[0], { method: 'get', update: $('searchBox') }).request(); 
	new Ajax(inc[1], { method: 'get', update: $('navTop') }).request();
	new Ajax(inc[2], { method: 'get', update: $('navBottom') }).request();
	new Ajax(inc[4], { method: 'get', update: $('footer') }).request();
	
	
	// writes the flash promo's
	if (mapage.test("/index/")) {
//		new Ajax(inc[5], { method: 'get', update: $('flashPromo'), onComplete: function() {
//			var so = new SWFObject("../swf/promo_main.swf", "sdge_promos", "494", "221", "8", "#fff");
//			so.write("newflash"); } }).request();
		}
	
	else {
			new Ajax(inc[3], {
				method: 'get',
				update: $('LnavContainer'),
				onComplete: function() {
					// primary detection
					if ( mapage.test("/residential/")) { ourvert = 0; }
					else if ( mapage.test("/business/")) { ourvert = 1; }
					//else if ( mapage.test("/safety/")) { new Ajax(inc[6], { method: 'get', async: false, update: $('l3nav') }).request(); ourvert = 2; }
						else { ourvert = 999; } //don't open aything
					
					//this is where the accordion gets activated					
					var accordion = new Accordion('h3.atStart', 'div.atStart', { // start the accorion
						display: ourvert, //here is the variable from above
						opacity: true,
						onActive: function(toggler, element){ },
						onBackground: function(toggler, element){ }
					}, $('globalLeftNav')); }
			}).request();
		}
}); 