// JavaScript Document for New Millenium
var x;
var mba = new Array();
mba[0] = 'mba-one';
mba[1] = 'mba-two';
mba[2] = 'mba-three';
mba[3] = 'mba-four';

var tabs = new Array();
tabs[0] = 'tab-one';
tabs[1] = 'tab-two';
tabs[2] = 'tab-three';

var images = new Array();
images[0] = 'mba-image-one';
images[1] = 'mba-image-two';
images[2] = 'mba-image-three';
images[3] = 'mba-image-four';

var popup = new Array();
popup[0] = 'box0';
popup[1] = 'box1';
popup[2] = 'box2';
popup[3] = 'box3';
popup[4] = 'box4';
popup[5] = 'box5';
popup[6] = 'box6';


// called when document loads. Hides content and pop up boxes
function hideBoxes(){
	//hide content, show first one on load
	for (x in mba){
		document.getElementById(mba[x]).style.display = 'none';
	}
	document.getElementById(mba[0]).style.display = 'block';
	
	//hide images, show first one on load
	for (x in images){
		document.getElementById(images[x]).style.display = 'none';
	}
	document.getElementById(images[0]).style.display = 'block';
	
	//hide popup boxes
	for (x in popup){
		document.getElementById(popup[x]).style.display = 'none';
	}
}

//calls the changeTabs function and adds analytics code
function clickTabs(i,a){
	changeTabs(i);
	
	javascript: pageTracker._trackPageview(a);
}

//tabs change content
function changeTabs(i){
	//change content
	for (x in mba){
		document.getElementById(mba[x]).style.display = 'none';
	}
	document.getElementById(mba[i]).style.display = 'block';
	
	// handles tab selections
	for (x in tabs){
		document.getElementById(tabs[x]).style.backgroundPosition = 'bottom';
	}
	if(i == 1){
		document.getElementById(tabs[0]).style.backgroundPosition = 'top';
	}
	if(i == 2){
		document.getElementById(tabs[1]).style.backgroundPosition = 'top';
	}
	if(i == 3){
		document.getElementById(tabs[2]).style.backgroundPosition = 'top';
	}
	
	//change images
	for (x in images){
		document.getElementById(images[x]).style.display = 'none';
	}
	document.getElementById(images[i]).style.display = 'block';
}

// switches the boxes
function showBox(i){
	for (x in popup){
		document.getElementById(popup[x]).style.display = 'none';
	}		
	document.getElementById(popup[i]).style.display = 'block';	
}

function closeBox(i){
	document.getElementById(popup[i]).style.display = 'none';		
}
