// changes colors on main portfolio subnavs and page numbers within each section

function dynanav() { 

var com1 = "/bartlett/commercial1.php";
var com2 = "/bartlett/commercial2.php";
var com3 = "/bartlett/commercial3.php";
var res1 = "/bartlett/residential1.php";
var res2 = "/bartlett/residential2.php";
var res3 = "/bartlett/residential3.php";
var res4 = "/bartlett/residential4.php";
var mod1 =  "/bartlett/model1.php";
var mod2 =  "/bartlett/model2.php";
var mod3 =  "/bartlett/model3.php";



var pagenumber;
var portsection;

// next chunk assigns variables based on section
if (location.pathname == com1 || location.pathname == com2 || location.pathname == com3) var portsection = "com";
if (location.pathname == res1 || location.pathname == res2 || location.pathname == res3  || location.pathname == res4) var portsection = "res";
if (location.pathname == mod1 || location.pathname == mod2 || location.pathname == mod3) var portsection = "mod";

// next chunk assigns variables based on page number


if (location.pathname == com1 || location.pathname == res1 || location.pathname == mod1) var pagenumber = "one"; 
if (location.pathname == com2 || location.pathname == res2 || location.pathname == mod2) var pagenumber = "two";
if (location.pathname == com3 || location.pathname == res3 || location.pathname == mod3) var pagenumber = "three";
if (location.pathname == res4) var pagenumber = "four";

// next chunk assigns colors to section navs, based on section

if (portsection == "com")  document.getElementById("comlink").style.color = "#d57928"; 
if (portsection == "res")  document.getElementById("reslink").style.color = "#d57928"; 
if (portsection == "mod")  document.getElementById("modlink").style.color = "#d57928"; 




// next chunk assigns colors to page navs on each portfolio page


if (pagenumber == "one") document.getElementById("page1").style.color = "#d57928";
if (pagenumber == "two") document.getElementById("page2").style.color = "#d57928";
if (pagenumber == "three") document.getElementById("page3").style.color = "#d57928";
if (pagenumber == "four") document.getElementById("page4").style.color = "#d57928";
}



