/* DEFINITIONS FOR THE PAGE */

function denaliOutbound(outbound) {
	pageTracker._trackPageview(outbound);
	}

var content = {
	currentView: "keyAdvantages",
	swap: function (id) {
			switch (id) {
				case "keyAdvantages":
					bgShift = "0px 0px";
					image = "images/denali-it-advantages.jpg";
					break;
				case "ourServices":
					bgShift = "-40px 0px";
					image = "images/denali-it-services.jpg";
					break;
				case "hpPartnership":
					bgShift = "-80px 0px";
					image = "images/denali-it-partnership.jpg";
					break;
				}
		$("rightBarNavigation").style.backgroundPosition = bgShift;
		$("denali_personalimage").src = image;
		$(this.currentView).style.display='none';
		$(id).style.display='block';
		this.currentView = id;
		},
	truncate: function (fid) {
		args = fid.split("/");
		if(args[3] != '')  {
			id = args[3];
			}
		if(args[2] != "a") {
			pageTracker._trackPageview(fid + "_collapse");				
			}
		buttonid = id + "Control";
		imgid = id + "Img";
		if(document.getElementById(buttonid)) {
			document.getElementById(buttonid).onclick = function () { content.expand(fid); }
			$(imgid).src = "images/denali_bluearrowright.gif";
		}
		var ul = document.getElementById(id).getElementsByTagName("ul");
		for(i = 0; i < ul.length; i++) {
			var li = ul[i].getElementsByTagName("li");
				for(a = 0; a < li.length; a++) {
						li[a].style.display = 'none';
					}
				}
			},
	expand: function (fid) {
		pageTracker._trackPageview(fid + "_expand");
		args = fid.split("/");
		if(args[3] != '')  {
			id = args[3];
			}
		buttonid = id + "Control";
		imgid = id + "Img";
		if(document.getElementById(buttonid)) {
			document.getElementById(buttonid).onclick = function () { content.truncate(fid); }
			$(imgid).src = "images/denali_bluearrowdown.gif";
		}
		var li = document.getElementById(id).getElementsByTagName("li");
		for(i = 0; i < li.length; i++) {
						li[i].style.display = 'list-item';
						li[i].style.listStyleType = 'disc';						
						}
					}
		}
	
	function htmlContent() {
		this.div = document.createElement("div");
		this.div.setInnerHTML = function (html) { this.innerHTML = html; }
		}		
	
// substring(0, 10) displays first 10 characters of a string

	
window.onload = function () { 
	var URLparts = window.location.search.split('?');
	if($("swapContentContainer") && URLparts[1] != "hpPartnership") {
		content.truncate("/loadpage/a/swapContentContainer");
		}
	
		if(URLparts[1] != "undefined") {
			switch(URLparts[1]) {
				case "keyAdvantages":
					content.swap("keyAdvantages");
					break;
				case "ourServices":
					content.swap("ourServices");
					break;
				case "hpPartnership":
					content.swap("hpPartnership");
					break;				
				}
		}
	
	
	}