///------------Services functions

//internal nav button functions
var fadeFunc;
var typerFunc;
var menuHTMLHold;
function changeButtonText(newText, newColor, action){
	//set text for button titles
	if (newText == "Work"){
		textTitle = "Our Work";
	} else if (newText == "Clients") {
		textTitle = "Our Clients";
	} else {
		textTitle = newText;
	}

	if (action=="click") {

		//clear timers in case user clicks on 2 sections back to back
		if (fadeFunc){
			clearTimeout(fadeFunc);
			fadeFunc = null;
		}
		if (typerFunc){
			clearTimeout(typerFunc);
			typerFunc = null;
		}

		//set button status
		document.getElementById("Services").innerHTML = "Services";
		document.getElementById("Pricing").innerHTML = "Pricing";
		document.getElementById("Process").innerHTML = "Process";
		document.getElementById("Work").innerHTML = "Our Work";
		document.getElementById("Clients").innerHTML = "Our Clients";
		document.getElementById(newText).innerHTML = textTitle.toUpperCase();

		document.getElementById("Services").style.fontSize = null;
		document.getElementById("Pricing").style.fontSize = null;
		document.getElementById("Process").style.fontSize = null;
		document.getElementById("Work").style.fontSize = null;
		document.getElementById("Clients").style.fontSize = null;
		document.getElementById(newText).style.fontSize = "14pt";
		document.getElementById("Services").style.color = "#333333";
		document.getElementById("Pricing").style.color = "#333333";
		document.getElementById("Process").style.color = "#333333";
		document.getElementById("Work").style.color = "#333333";
		document.getElementById("Clients").style.color = "#333333";
		document.getElementById(newText).style.color = newColor;

		if ((version >= 5.5) && (version < 7) && (document.body.filters)){
			document.getElementById("btn_ServicesWrap").innerHTML = '<img id="' + "btn_Services" + '" src="' + "images/wball1.png" + '" border="0" />';
			document.getElementById("btn_PricingWrap").innerHTML = '<img id="' + "btn_Pricing" + '" src="' + "images/wball1.png" + '" border="0" />';
			document.getElementById("btn_ProcessWrap").innerHTML = '<img id="' + "btn_Process" + '" src="' + "images/wball1.png" + '" border="0" />';
			document.getElementById("btn_WorkWrap").innerHTML = '<img id="' + "btn_Work" + '" src="' + "images/wball1.png" + '" border="0" />';
			document.getElementById("btn_ClientsWrap").innerHTML = '<img id="' + "btn_Clients" + '" src="' + "images/wball1.png" + '" border="0" />';
			document.getElementById("btn_" + newText + "Wrap").innerHTML = '<img id="' + "btn_" + newText + '" src="' + "images/Bball1.png" + '" border="0" />';
			swapPNGSingle("btn_Services");
			swapPNGSingle("btn_Pricing");
			swapPNGSingle("btn_Process");
			swapPNGSingle("btn_Work");
			swapPNGSingle("btn_Clients");
		} else {
			document.getElementById("btn_Services").src = "images/wball1.png";
			document.getElementById("btn_Pricing").src = "images/wball1.png";
			document.getElementById("btn_Process").src = "images/wball1.png";
			document.getElementById("btn_Work").src = "images/wball1.png";
			document.getElementById("btn_Clients").src = "images/wball1.png";
			document.getElementById("btn_" + newText).src = "images/Bball1.png";
		}

		//set current section
		document.getElementById("currentSection").value = newText;

		//change title with fade
		fadeTitle("sectionTitle", 0);
		document.getElementById("sectionTitle").innerHTML = textTitle + "_";
		
		//set section description and iFrame URL
		var sectionDescription;
		var sectionURL;
		if (newText == "Services"){
			sectionDescription = "Choose a service category, to view possibilities.";
			sectionURL = "ourServices.php";
		} else if (newText == "Pricing") {
			sectionDescription = "Choose a pricing option, for your project's specs.";
			sectionURL = "ourPricing.php";
		} else if (newText == "Process") {
			sectionDescription = "Choose a project phase, to understand our approach.";
			sectionURL = "ourProcess.php";
		} else if (newText == "Work") {
			sectionDescription = "Click the gallery button, to view some of the many styles and mediums we work in.";
			sectionURL = "ourWork.php";
		} else if (newText == "Clients") {
			sectionDescription = "Choose a client category, to access references.";
			sectionURL = "ourClients.php";
		}

		//create typeIn
		sectionDescription = sectionDescription + " - ";
		replaceDescription(sectionDescription,1);
		
		//set internal item
//		if (newText == "Services"){
//			getFlexData("ourServices");
//		} else if (newText == "Work"){
//			getFlexData("ourWork");
//		} else if (newText == "Pricing"){
//			getFlexData("ourPricing");
//		} else {
			getMiddleContent(sectionURL);
//		}
		getMiddleContent2(sectionURL, "&view=image");

		//set menu
		menuStart = "<div><img src='images/hudtop2.png' width='199' height='53'></div>";
		menuEnd = "<div><img src='images/hudlower2.png' width='199' height='51'></div>";
		
		if (menuHTMLHold){
			document.getElementById("menuCell").appendChild(menuHTMLHold);
			menuHTMLHold = null;
		}
			
		if (newText == "Services"){
			document.getElementById("choiceParent").innerHTML = "Website Development";
			menuMid = "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem1' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"consulting\",1);'>Consulting</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem2' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"management\",2);'>Project Management</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem3' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"preVis\",3);'>Storyboard_Pre-vis</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem4' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"animation\",4);'>2D_3D Animation</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem5' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"instructional\",5);'>Instructional Design</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem6' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"programming\",6);'>Programming</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem7' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"videoEditing\",7);'>Video Editing</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem8' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"videoProduction\",8);'>Video Production</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem9' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"audio\",9);'>Audio Recording</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem10' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourServices\",\"music\",10);'>Music Production</div>";
		} else if (newText == "Pricing") {
			document.getElementById("choiceParent").innerHTML = "Pricing philosophy";
			menuMid = "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem1' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourPricing\",\"priceList\",1);'>Price List</div>"			
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem2' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourPricing\",\"speedQuoter\",2);'>Speed Quoter</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem3' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourPricing\",\"savvyPricer\",3);'>Savvy Pricer</div>";
		} else if (newText == "Process") {
			document.getElementById("choiceParent").innerHTML = "Development";
			menuMid = "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem1' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourProcess\",\"preProduction\",1);'>Pre-production</div>"	
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem2' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourProcess\",\"production\",2);'>Production</div>"	
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem3' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourProcess\",\"postProduction\",3);'>Post-production</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem4' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourProcess\",\"postPaperwork\",4);'>Post-paperwork</div>";
		} else if (newText == "Work") {
			menuHTMLHold = document.getElementById("menuCell").firstChild;
			document.getElementById("menuCell").removeChild(menuHTMLHold);
			/*
			document.getElementById("choiceParent").innerHTML = "Websites_Corporate ID";
			menuMid = "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem1' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourWork\",\"elearning\",1);'>eLearning_Presentations</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem2' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourWork\",\"advertising\",2);'>Advertising_Promotions</div>"
			+ "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem3' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourWork\",\"multimedia\",3);'>Multi-media_Applications</div>";
		*/
		} else if (newText == "Clients") {
			document.getElementById("choiceParent").innerHTML = "Our approach";
			menuMid = "<div class='dropdownItem' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"'>&nbsp;</div>"
			+ "<div class='dropdownItem' id='menuItem1' onmouseover='this.className=\"dropdownItemHover\"' onmouseout='this.className=\"dropdownItem\"' onclick='changeMenuView(\"ourClients\",\"testimonials\",1);'>Testimonials</div>";	
		}

		document.getElementById("choiceChild").innerHTML = menuStart + menuMid + menuEnd;
	} else if (newText != document.getElementById("currentSection").value && action=="rollout"){
		document.getElementById(newText).innerHTML = textTitle;
		document.getElementById(newText).style.color = newColor;
		document.getElementById(newText).style.fontSize = null;
	} else if (action=="rollover"){
		document.getElementById(newText).innerHTML = textTitle.toUpperCase();
		document.getElementById(newText).style.color = newColor;
		document.getElementById(newText).style.fontSize = "14pt";
	}
}

//description typer function
function replaceDescription(sectionVar,i){
		document.getElementById('sectionDescription').innerHTML = sectionVar.substring(0, i);
		i = parseInt(i) + 1;
		if (i < sectionVar.length){
			javaFunction = "replaceDescription(\"" + sectionVar + "\"," + i +")";
			typerFunc = setTimeout(javaFunction,40);
		} else {
			clearTimeout(typerFunc);
			typerFunc = null;
		}
}

//fadeIn title function
function fadeTitle(item2Fade, fadePercent){
	var itemObject = document.getElementById(item2Fade);
	//for IE else for Mozilla/Safari
	if (document.all){
		itemObject.filter = "alpha(opacity:"+fadePercent+")";
	} else {
		itemObject.style.opacity=parseInt(fadePercent)/100;
	}
		fadePercent = parseInt(fadePercent) + 15;
	if (fadePercent <= 100){
		javaFunction = "fadeTitle('" + item2Fade + "'," + fadePercent +")";
		fadeFunc = setTimeout(javaFunction,.01);
	} else {
		clearTimeout(fadeFunc);
		fadeFunc = null;
	}
}

//for dropdown menu
//for dropdown menu (our work)
function changeMenuView(view, section,positionNum){
	var newSelectedTitle;
	var replacementTitle = document.getElementById("choiceParent").innerHTML;

	if (view == "ourProcess"){
		if (section == "development"){
			newSelectedTitle = "Development";
		} else if (section == "preProduction"){
			newSelectedTitle = "Pre-production";
		} else if (section == "production"){
			newSelectedTitle = "Production";
		} else if (section == "postProduction"){
			newSelectedTitle = "Post-production";
		} else if (section == "postPaperwork"){
			newSelectedTitle = "Post-paperwork";
		}
		if (replacementTitle == "Development"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","development",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","development",2); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","development",3); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","development",4); };
			}
		} else if (replacementTitle == "Pre-production"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","preProduction",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","preProduction",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","preProduction",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","preProduction",4); };
			}
		} else if (replacementTitle == "Production"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","production",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","production",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","production",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","production",4); };
			}
		} else if (replacementTitle == "postProduction"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postProduction",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postProduction",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postProduction",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postProduction",4); };
			}
		} else if (replacementTitle == "postPaperwork"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postPaperwork",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postPaperwork",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postPaperwork",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourProcess","postPaperwork",4); };
			}
		}
	} else if (view == "ourWork"){	//for Our work section
/*
		if (section == "corpID"){
			newSelectedTitle = "Websites_Corporate ID";
		} else if (section == "elearning"){
			newSelectedTitle = "E-learning_Presentations";
		} else if (section == "advertising"){
			newSelectedTitle = "Advertising_Promotion";
		} else if (section == "multimedia"){
			newSelectedTitle = "Multi-media_Applications";
		}
	
		if (replacementTitle == "Websites_Corporate ID"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","corpID",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","corpID",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","corpID",3); };
			}
		} else if (replacementTitle == "E-learning_Presentations"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","elearning",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","elearning",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","elearning",3); };
			}
		} else if (replacementTitle == "Advertising_Promotion"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","advertising",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","advertising",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","advertising",3); };
			}
		} else if (replacementTitle == "Multi-media_Applications"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","multimedia",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","multimedia",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourWork","multimedia",3); };
			}
		}
*/
	} else if (view == "ourPricing"){
		if (section == "pricingPhilosophy"){
			newSelectedTitle = "Pricing philosophy";
		} else if (section == "priceList"){
			newSelectedTitle = "Price list";
		} else if (section == "speedQuoter"){
			newSelectedTitle = "Speed Quoter";
		} else if (section == "savvyPricer"){
			newSelectedTitle = "Savvy Pricer";
		}
	
		if (replacementTitle == "Pricing Philosophy"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","pricingPhilosophy",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","pricingPhilosophy",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","pricingPhilosophy",3); };
			}
		} else if (replacementTitle == "Price List"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","priceList",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","priceList",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","priceList",3); };
			}
		} else if (replacementTitle == "Speed Quoter"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","speedQuoter",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","speedQuoter",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","speedQuoter",3); };
			}
		} else if (replacementTitle == "Savvy Pricer"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","savvyPricer",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","savvyPricer",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourPricing","savvyPricer",3); };
			}
		}
	} else if (view == "ourClients"){

		if (section == "approach"){
			newSelectedTitle = "Our approach";
		} else if (section == "testimonials"){
			newSelectedTitle = "Testimonials";
		}
	
		if (replacementTitle == "Our approach"){
			document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourClients","approach",1); };
		} else if (replacementTitle == "Testimonials"){
			document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourClients","testimonials",1); };
		}
	} else if (view == "ourServices"){				//for Our Work view
		if (section == "website"){
			newSelectedTitle = "Website Development";
		} else if (section == "consulting"){
			newSelectedTitle = "Consulting";
		} else if (section == "management"){
			newSelectedTitle = "Project Management";
		} else if (section == "preVis"){
			newSelectedTitle = "Storyboard_Pre-vis";
		} else if (section == "animation"){
			newSelectedTitle = "2D_3D Animation";
		} else if (section == "instructional"){
			newSelectedTitle = "Instructional Design";
		} else if (section == "programming"){
			newSelectedTitle = "Programming";
		} else if (section == "videoEditing"){
			newSelectedTitle = "Video Editing";
		} else if (section == "videoProduction"){
			newSelectedTitle = "Video Production";
		} else if (section == "audio"){
			newSelectedTitle = "Audio Recording";
		} else if (section == "music"){
			newSelectedTitle = "Music Production";
		}

		if (replacementTitle == "Website Development"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","website",10); };
			}
		} else if (replacementTitle == "Consulting"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","consulting",10); };
			}
		} else if (replacementTitle == "Project Management"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","management",10); };
			}
		} else if (replacementTitle == "Storyboard_Pre-vis"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",2); };

			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","preVis",10); };
			}
		} else if (replacementTitle == "2D_3D Animation"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","animation",10); };
			}
		} else if (replacementTitle == "Instructional Design"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","instructional",10); };
			}
		} else if (replacementTitle == "Programming"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","programming",10); };
			}
		} else if (replacementTitle == "Video Editing"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoEditing",10); };
			}
		} else if (replacementTitle == "Video Production"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","videoProduction",10); };
			}
		} else if (replacementTitle == "Audio Recording"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","audio",10); };
			}
		} else if (replacementTitle == "Music Production"){
			if (positionNum == 1){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",1); };
			} else if (positionNum == 2){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",2); };
			} else if (positionNum == 3){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",3); };
			} else if (positionNum == 4){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",4); };
			} else if (positionNum == 5){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",5); };
			} else if (positionNum == 6){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",6); };
			} else if (positionNum == 7){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",7); };
			} else if (positionNum == 8){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",8); };
			} else if (positionNum == 9){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",9); };
			} else if (positionNum == 10){
				document.getElementById("menuItem"+positionNum).onclick = function () { changeMenuView("ourServices","music",10); };
			}
		}
	}
	
	document.getElementById("menuItem"+positionNum).innerHTML = replacementTitle;
//	window.frames.middleContent.changeData(section);
	document.getElementById("choiceParent").innerHTML = newSelectedTitle;
	if (!(view == "ourPricing" && (section == "savvyPricer" || section == "speedQuoter"))){
		getMiddleContent2(view + ".php", "&view=image&imgName="+section);
	}
	at_hide();
	changeData(view,section);
}

//functions to turn section buttons on/off
var currState;
function buttonOn(btnname){
	imgLoc = "images/" + btnname + "_grey.png";

	if ((version >= 5.5) && (version < 7) && (document.body.filters)){
		if (currState != "over"){
			currState = "over";
			document.getElementById(btnname+"Wrap").innerHTML = "<img id='" + btnname + "' src='" + imgLoc + "' border='0' />";
			swapPNGSingle(btnname);
		}
	} else {
		document.getElementById(btnname).src = imgLoc;
	}
}

function buttonOff(btnname){
	imgLoc = "images/" + btnname + "_white.png";

	if ((version >= 5.5) && (version < 7) && (document.body.filters)){
		if (currState != "out"){
			currState = "out";
			document.getElementById(btnname+"Wrap").innerHTML = "<img id='" + btnname + "' src='" + imgLoc + "' border='0' />";
			swapPNGSingle(btnname);
		}
	} else {
		document.getElementById(btnname).src = imgLoc;
	}
}

