//this is the 'You are here' script
function nav() {
var thisPath = window.location.pathname;
var thisPage = thisPath.substring(thisPath.lastIndexOf('/') + 1);
var thisFolder = thisPath.substring(thisPath.indexOf('/'),thisPath.lastIndexOf('/'));

//this next line can be taken out when the site gets out of the 'new' virtual directory
//if (thisFolder.substring(1,4) == "new") {thisFolder = thisFolder.substring(4,15)};

//getting the page name only
var cutter = thisPage.lastIndexOf(".");
var pageName = thisPage.substring(0, cutter).replace(/_/g, " ");

if (pageName.substring(0,3) == "pkg") {pageName = thisPage.substring(4, cutter) + " Package"};
if (pageName.substring(0,6) == "merch_") {pageName = thisPage.substring(6, cutter)};

var navtextstart = "You are here &gt;&gt; <a href='http://www.smartdolphins.com' class='white'>Home</a> &gt; ";
var navtextend = "&nbsp; &nbsp;<font color=\"#94B1E2\">[<a href=\"http://www.smartdolphins.com/sitemap.htm\" class='fadeblue'>Site Map</a>]</font>";
var navtext = navtextstart + pageName + navtextend;

if (thisPath == "/default.htm" || thisPath == "/"){navtext = "&gt;&gt; <a href='sitemap.htm' class='white'>Site Map</a>"};

if (thisFolder == "/is") {
navtext = navtextstart + "<a href=\"default.htm\" class=\"white\">I.S. Services</a> &gt; " + pageName + navtextend;
if (thisPage == "default.htm") {navtext = navtextstart + "I.S. Services" + navtextend}
};
else if (thisFolder == "/about") {
navtext = navtextstart + "<a href='default.htm' class='white'>About Us</a> &gt; " + pageName + navtextend;
if (thisPage == "default.htm") {navtext = navtextstart + "About Us" + navtextend}
};
else if (thisFolder == "/resources") {
navtext = navtextstart + "<a href='default.htm' class='white'>Tips &amp; Resources</a> &gt; " + pageName + navtextend;
if (thisPage == "default.htm") {navtext = navtextstart + "Tips &amp; Resources" + navtextend}
};
else if (thisFolder == "/web") {
navtext = navtextstart + "<a href='default.htm' class='white'>Web Services</a> &gt; " + pageName + navtextend;
if (thisPage == "default.htm") {navtext = navtextstart + "Web Services" + navtextend}
};

else if (thisFolder != "" && pageName == "") { //this one is for virtual directories
navtext = navtextstart + thisFolder.substring(1,thisFolder.length) + navtextend;
};

else {navtext = navtext};
//alert thisFolder;

//navtext = navtext + " - " + thisFolder;

return navtext 
}
