
function MarkSelectedTab() {
	//mark selected tab
	var rootURL = "amykathryn.com";
	var thisLocation = location.href;
	var thisTabElement;
	
	//are we .dev?
	if(thisLocation.indexOf(".dev") > -1) {
		rootURL = "amykathryn.dev";
	}
	
	//front end
	if(thisLocation.indexOf(rootURL +"/default.aspx") > 0 || thisLocation == "http://"+ rootURL +"/" || thisLocation == "http://www."+ rootURL +"/") {
		thisTabElement = document.$("tmpl_tab_home");
	}
	else if(thisLocation.indexOf(rootURL +"/cart.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_shop");
	}
	else if(thisLocation.indexOf(rootURL +"/store.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_locator");
	}
	else if(thisLocation.indexOf(rootURL +"/press.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_press");
	}
	else if(thisLocation.indexOf(rootURL +"/events.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_events");
	}
	else if(thisLocation.indexOf(rootURL +"/about.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_about");
	}
	else if(thisLocation.indexOf(rootURL +"/contact.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_contact");
	}
	else if(thisLocation.indexOf(rootURL +"/faq.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_faq");
	}

	//back end
	else if(thisLocation.indexOf(rootURL +"/admin/master/") > 0) {
		thisTabElement = document.$("tmpl_tab_master");
	}
	else if(thisLocation.indexOf(rootURL +"/admin/") > 0) {
		thisTabElement = document.$("tmpl_tab_home");
	}
	
	//admin popups
	if(thisLocation.indexOf(rootURL +"/admin/customer.aspx?r=history") > 0) {
		thisTabElement = document.$("tmpl_tab_customer_history");
	}
	else if(thisLocation.indexOf(rootURL +"/admin/customer.aspx?r=orders") > 0) {
		thisTabElement = document.$("tmpl_tab_customer_orders");
	}
	else if(thisLocation.indexOf(rootURL +"/admin/customer.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_customer_details");
	}
	else if(thisLocation.indexOf(rootURL +"/admin/order.aspx?r=history") > 0) {
		thisTabElement = document.$("tmpl_tab_order_history");
	}
	else if(thisLocation.indexOf(rootURL +"/admin/order.aspx") > 0) {
		thisTabElement = document.$("tmpl_tab_order_details");
	}

	//select the tab
	if(thisTabElement) thisTabElement.className = "selected";
}