
function MarkSelectedNav() {
	//mark selected tab
	var rootURL = "www.submitawebsite.com";
	var thisLocation = location.href;
	var thisTabElement;
	
	var thisLCLink;

	//are we .dev?
	if(thisLocation.indexOf(".dev") > -1) {
		rootURL = "www.submitawebsite.dev";
	}
	
	//Home Page
	if(thisLocation.indexOf(rootURL +"/index.html") > -1 || thisLocation == "http://"+ rootURL +"/") {
		thisTabElement = document.$("tmpl_tab_home");
	}
	
	//Services
	if(thisLocation.indexOf(rootURL +"/services/") > -1) {
		thisTabElement = document.$("tmpl_tab_services");
	}
	//sub pages
	if(thisLocation.indexOf(rootURL +"/services/seo.html") > -1) {
		thisLCLink = document.$("tmpl_lc_seo");
	}
	else if(thisLocation.indexOf(rootURL +"/services/small-medium-business.html") > -1) {
		thisLCLink = document.$("tmpl_lc_small-medium-business");
	}
	else if(thisLocation.indexOf(rootURL +"/services/enterprise-business.html") > -1) {
		thisLCLink = document.$("tmpl_lc_enterprise-business");
	}
	else if(thisLocation.indexOf(rootURL +"/services/seo-consulting.html") > -1) {
		thisLCLink = document.$("tmpl_lc_seo-consulting");
	}
	else if(thisLocation.indexOf(rootURL +"/services/social-media.html") > -1) {
		thisLCLink = document.$("tmpl_lc_social-media");
	}
	else if(thisLocation.indexOf(rootURL +"/services/profile-creation.html") > -1) {
		thisLCLink = document.$("tmpl_lc_profile-creation");
	}
	else if(thisLocation.indexOf(rootURL +"/services/social-bookmarking.html") > -1) {
		thisLCLink = document.$("tmpl_lc_social-bookmarking");
	}
	else if(thisLocation.indexOf(rootURL +"/services/local-seo.html") > -1) {
		thisLCLink = document.$("tmpl_lc_local-seo");
	}
	else if(thisLocation.indexOf(rootURL +"/services/search-engine-reputation-management.html") > -1) {
		thisLCLink = document.$("tmpl_lc_search-engine-reputation-management");
	}
	else if(thisLocation.indexOf(rootURL +"/services/paid-inclusion.html") > -1) {
		thisLCLink = document.$("tmpl_lc_paid-inclusion");
	}
	else if(thisLocation.indexOf(rootURL +"/services/link-building.html") > -1) {
		thisLCLink = document.$("tmpl_lc_link-building");
	}
	else if(thisLocation.indexOf(rootURL +"/services/premium-links.html") > -1) {
		thisLCLink = document.$("tmpl_lc_premium-links");
	}
	else if(thisLocation.indexOf(rootURL +"/services/blog-reviews.html") > -1) {
		thisLCLink = document.$("tmpl_lc_blog-reviews");
	}
	else if(thisLocation.indexOf(rootURL +"/services/directories.html") > -1) {
		thisLCLink = document.$("tmpl_lc_directories");
	}
	else if(thisLocation.indexOf(rootURL +"/services/press-release-distribution.html") > -1) {
		thisLCLink = document.$("tmpl_lc_press-release-distribution");
	}
	else if(thisLocation.indexOf(rootURL +"/services/ppc-management.html") > -1) {
		thisLCLink = document.$("tmpl_lc_ppc-management");
	}
	else if(thisLocation.indexOf(rootURL +"/services/website-design.html") > -1) {
		thisLCLink = document.$("tmpl_lc_website-design");
	}
	else if(thisLocation.indexOf(rootURL +"/services/analytics.html") > -1) {
		thisLCLink = document.$("tmpl_lc_analytics");
	}
	else if(thisLocation.indexOf(rootURL +"/services/account-services.html") > -1) {
		thisLCLink = document.$("tmpl_lc_account-services");
	}
	else if(thisLocation.indexOf(rootURL +"/services/vertical.html") > -1) {
		thisLCLink = document.$("tmpl_lc_vertical");
	}
	else if(thisLocation.indexOf(rootURL +"/services/automotive.html") > -1) {
		thisLCLink = document.$("tmpl_lc_automotive");
	}
	else if(thisLocation.indexOf(rootURL +"/services/apparel.html") > -1) {
		thisLCLink = document.$("tmpl_lc_apparel");
	}
	else if(thisLocation.indexOf(rootURL +"/services/legal.html") > -1) {
		thisLCLink = document.$("tmpl_lc_legal");
	}
	else if(thisLocation.indexOf(rootURL +"/services/real-estate.html") > -1) {
		thisLCLink = document.$("tmpl_lc_real-estate");
	}
	else if(thisLocation.indexOf(rootURL +"/services/e-commerce.html") > -1) {
		thisLCLink = document.$("tmpl_lc_e-commerce");
	}
	else if(thisLocation.indexOf(rootURL +"/services/travel.html") > -1) {
		thisLCLink = document.$("tmpl_lc_travel");
	}
	else if(thisLocation.indexOf(rootURL +"/services/b2b.html") > -1) {
		thisLCLink = document.$("tmpl_lc_b2b");
	}
	else if(thisLocation.indexOf(rootURL +"/services/it.html") > -1) {
		thisLCLink = document.$("tmpl_lc_it");
	}
	else if(thisLocation.indexOf(rootURL +"/services/medical.html") > -1) {
		thisLCLink = document.$("tmpl_lc_medical");
	}



	//company
	if(thisLocation.indexOf(rootURL +"/company/") > -1) {
		thisTabElement = document.$("tmpl_tab_company");
	}
	//sub pages
	if(thisLocation.indexOf(rootURL +"/company/management.html") > -1) {
		thisLCLink = document.$("tmpl_lc_management");
	}
	else if(thisLocation.indexOf(rootURL +"/company/news.html") > -1) {
		thisLCLink = document.$("tmpl_lc_news");
	}
	else if(thisLocation.indexOf(rootURL +"/company/career-opportunities.html") > -1) {
		thisLCLink = document.$("tmpl_lc_career-opportunities");
	}
	else if(thisLocation.indexOf(rootURL +"/company/contact-us.html") > -1) {
		//change the tab
		thisTabElement = document.$("tmpl_tab_contact");
		thisLCLink = document.$("tmpl_lc_contact-us");
	}
	else if(thisLocation.indexOf(rootURL +"/company/link-to-us.html") > -1) {
		thisLCLink = document.$("tmpl_lc_link-to-us");
	}
	else if(thisLocation.indexOf(rootURL +"/company/request-a-quote.html") > -1) {
		thisLCLink = document.$("tmpl_lc_request-a-quote");
	}
	
	//seo tools
	if(thisLocation.indexOf(rootURL +"/seo-tools/") > -1) {
		thisTabElement = document.$("tmpl_tab_seotools");
	}
	//sub pages
	if(thisLocation.indexOf(rootURL +"/seo-tools/domain-trust.html") > -1) {
		thisLCLink = document.$("tmpl_lc_domain-trust");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/search-engine-submission.html") > -1) {
		thisLCLink = document.$("tmpl_lc_search-engine-submission");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/seo-competition-report.html") > -1) {
		thisLCLink = document.$("tmpl_lc_seo-competition-report");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/seo-shortcut-widget.html") > -1) {
		thisLCLink = document.$("tmpl_lc_seo-shortcut-widget");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/search-engine-ranking-report.html") > -1) {
		thisLCLink = document.$("tmpl_lc_search-engine-ranking-report");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/pagerank-checker.html") > -1) {
		thisLCLink = document.$("tmpl_lc_pagerank-checker");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/link-popularity-checker.html") > -1) {
		thisLCLink = document.$("tmpl_lc_link-popularity-checker");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/backlinks-checker.html") > -1) {
		thisLCLink = document.$("tmpl_lc_backlinks");
	}
	else if(thisLocation.indexOf(rootURL +"/seo-tools/meta-tag-generator.html") > -1) {
		thisLCLink = document.$("tmpl_lc_meta-tag-generator");
	}
	
	//search 101
	if(thisLocation.indexOf(rootURL +"/blog/") > -1) {
		thisTabElement = document.$("tmpl_tab_seo101");
	}
	
	//sub pages
	if(thisLocation.indexOf(rootURL +"/blog/how-does-search-work.html") > -1) {
		thisLCLink = document.$("tmpl_lc_how-does-search-work");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/about-search.html") > -1) {
		thisLCLink = document.$("tmpl_lc_about-search");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/what-is-link-building.html") > -1) {
		thisLCLink = document.$("tmpl_lc_what-is-link-building");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/seo-ranking-tips.html") > -1) {
		thisLCLink = document.$("tmpl_lc_seo-ranking-tips");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/ppc-engines.html") > -1) {
		thisLCLink = document.$("tmpl_lc_ppc-engines");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/seo-questions-answers.html") > -1) {
		thisLCLink = document.$("tmpl_lc_seo-questions-answers");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/search-glossary.html") > -1) {
		thisLCLink = document.$("tmpl_lc_search-glossary");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/search-engine-stats.html") > -1) {
		thisLCLink = document.$("tmpl_lc_search-engine-stats");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/affordable-seo.html") > -1) {
		thisLCLink = document.$("tmpl_lc_affordable-seo");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/build-seo-website.html") > -1) {
		thisLCLink = document.$("tmpl_lc_build-seo-website");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/ethical-seo.html") > -1) {
		thisLCLink = document.$("tmpl_lc_ethical-seo");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/web-analytics.html") > -1) {
		thisLCLink = document.$("tmpl_lc_web-analytics");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/internet-marketing-strategy.html") > -1) {
		thisLCLink = document.$("tmpl_lc_internet-marketing-strategy");
	}
	else if(thisLocation.indexOf(rootURL +"/blog/measuring-conversions.html") > -1) {
		thisLCLink = document.$("tmpl_lc_measuring-conversions");
	}
	
	//clients and partners
	if(thisLocation.indexOf(rootURL +"/clients-partners/") > -1) {
		thisTabElement = document.$("tmpl_tab_clients");
	}
	//sub pages
	if(thisLocation.indexOf(rootURL +"/clients-partners/clients.html") > -1) {
		thisLCLink = document.$("tmpl_lc_clients");
	}
	else if(thisLocation.indexOf(rootURL +"/clients-partners/partners.html") > -1) {
		thisLCLink = document.$("tmpl_lc_partners");
	}
	else if(thisLocation.indexOf(rootURL +"/clients-partners/become-a-partner.html") > -1) {
		thisLCLink = document.$("tmpl_lc_becomepartner");
	}
	else if(thisLocation.indexOf(rootURL +"/clients-partners/case-studies.html") > -1) {
		thisLCLink = document.$("tmpl_lc_case-studies");
	}
	else if(thisLocation.indexOf(rootURL +"/clients-partners/testimonials.html") > -1) {
		thisLCLink = document.$("tmpl_lc_testimonials");
	}
	
	//select the tab
	if(thisTabElement) thisTabElement.className = "selected";
	
	//select the lc
	if(thisLCLink) thisLCLink.className = "selected";
}