﻿
$(document).ready(function() {

	$("#tan").corner("5px");
	$("#promo-box").corner("5px");
	//$("#promo-container").fadeIn(5000);

	var url = window.location.href;
	url = url.toLowerCase();
	if(url.indexOf("/web-design") > -1){
		highlightNav("/web-design");
	}else if(url.indexOf("/web-development") > -1){
		highlightNav("/web-development");
	}else if(url.indexOf("/web-hosting") > -1){
		highlightNav("/web-hosting");
	}else if(url.indexOf("/web-marketing") > -1){
		highlightNav("/web-marketing");
	}else if(url.indexOf("/e-commerce") > -1){
		highlightNav("/e-commerce");
	}else if(url.indexOf("/portfolio") > -1){
		highlightNav("/portfolio");
	}else if(url.indexOf("/support") > -1){
		highlightNav("/support");
	}else{
		$("#nav-container div:first").removeClass("nav-link");
		$("#nav-container div:first").addClass("nav-link-active");
		$("#nav-container div:first").corner("5px");
	}
});

function highlightNav(seek){
	$("#nav-container div a").each(function(){
		var linkurl = $(this).attr("href").toLowerCase();
		if(linkurl.indexOf(seek.toLowerCase()) > -1){
			$(this).parent().removeClass("nav-link");
			$(this).parent().addClass("nav-link-active");
			$(this).parent().corner("5px");
			$(this).parent().mouseover(function(){});
			$(this).parent().mouseout(function(){});
		}else{
			$(this).parent().addClass("nav-link");
			$(this).parent().removeClass("nav-link-active");
			$(this).parent().hover(function() {
				$(this).stop(this).fadeTo("slow", 1.0);
				}, function() {
					$(this).stop(this).fadeTo("slow", 0.6);
			});
			$(this).parent().fadeTo("slow", 0.6);
		}
	});
	
}