	$(function () {
		$(".small-box:last-child .ie-name").watermark("name");
		$(".small-box:last-child .ie-name").click(
			function () {
				$(".small-box:last-child .ie-name")[0].focus();
			}
		);
	});
	$(function () {
		$(".small-box:last-child .ie-email").watermark("e-mail");
		$(".small-box:last-child .ie-email").click(
			function () {
				$(".small-box:last-child .ie-email")[0].focus();
			}
		);
	});
	$(function () {
		$(".small-box:last-child .ie-phone").watermark("phone ex:(317)555-5555");
		$(".small-box:last-child .ie-phone").click(
			function () {
				$(".small-box:last-child .ie-phone")[0].focus();
			}
		);
	});





$(document).ready(function(){
//Code to active link fading and border fading
	$('a').hoverFadeColor();
	$('.back-fade').mouseover(function() {
       	$(this).stop().animate({ backgroundColor:"#093765" }, '300', "swing");
	});
	$('.back-fade').mouseout(function() {
		$(this).stop().animate({ backgroundColor:"#3878b8" }, '300', "swing");
	});
	$('.page-nav li').mouseover(function() {
       		$(this).stop().animate({ borderBottomColor:"#3878b8" }, '300');
	});
	$('.page-nav li').mouseout(function() {
		$(this).stop().animate({ borderBottomColor:"#fff" }, '300');
	});
	
	$('input[type="image"], img').mouseover(function() {
		var overColor = "#093765";
       		$(this).parent().stop().animate({ borderBottomColor: overColor, borderRightColor: overColor, borderLeftColor: overColor, borderTopColor: overColor}, '300');
	});
	$('input[type="image"], img').mouseout(function() {
		var overColor = "#3878b8";
       		$(this).parent().stop().animate({ borderBottomColor: overColor, borderRightColor: overColor, borderLeftColor: overColor, borderTopColor: overColor}, '300');
	});
	$('.sidebox a').mouseover(function() {
		var overColor = "#093765";
       		$(this).stop().animate({backgroundColor: "#ddd", color: overColor, borderBottomColor: overColor, borderRightColor: overColor, borderLeftColor: overColor, borderTopColor: overColor}, '300');
	});
	$('.sidebox a').mouseout(function() {
		var overColor = "#3878b8";
       		$(this).stop().animate({backgroundColor: "#eee", color: overColor, borderBottomColor: overColor, borderRightColor: overColor, borderLeftColor: overColor, borderTopColor: overColor}, '300');
	});

//Sets all home boxes to same height
	var boxHeight = $('.big-box .border-box-container').height();
	//THIS LINE CONTROLS WHICH BOX SETS THE HEIGHT
	$('.home-boxes .small-box .border-box-container, .home-boxes .big-box .border-box-container').height(boxHeight);

		
});

//Activates nivo slider
$(window).load(function() {
    $('#slider').nivoSlider();
});

//Navigation JS
$(document).ready(function(){
    var path = location.pathname.substring(1);

    var subPath = path.substring(path.lastIndexOf("/") + 1);
    
    var mainPath = path.split("/");
    var appendedPath = mainPath[0];
    var navPath = appendedPath;
    var header;
    var x = 1;
    
    if (navPath.indexOf(".aspx") == -1){	
    	navPath += ".aspx";
	header = appendedPath;
	$('h1.sub-page-header').text(header);
 	if (header.indexOf("-") != -1){
 	    var splitHeader = header;
 	    var newHeader = splitHeader.split("-");
 	    $('h1.sub-page-header').text(newHeader[0] + " " + newHeader[1]);
	}
	else {
	    $('h1.sub-page-header').text(header);
	}

    }
    else{
    	header = appendedPath.split(".");
 	if (header[0].indexOf("-") != -1){
 	    var splitHeader = header[0];
 	    var newHeader = splitHeader.split("-");
 	    $('h1.sub-page-header').text(newHeader[0] + " " + newHeader[1]);
	}
	else {
	    $('h1.sub-page-header').text(header[0]);
	}
    }
    
    if(navPath == "parts.aspx"){
    	$(".head-img").attr("src","/css/img/content-header-bg2.jpg");
    }
    if(navPath == "about.aspx"){
    	$(".head-img").attr("src","/css/img/content-header-bg1.jpg");
    }
    if(navPath == "programs.aspx"){
    	$(".head-img").attr("src","/css/img/content-header-bg6.jpg");
    }    
    if(navPath == "service.aspx"){
    	$(".head-img").attr("src","/css/img/content-header-bg3.jpg");
    	    	$(".head-img").css({"margin-top":"-100px"});
    }
    if(navPath == "markets-served.aspx"){
    	$(".head-img").attr("src","/css/img/content-header-bg4.jpg");
    	$(".head-img").css({"margin-top":"-100px"});
    }   
    if(navPath == "installations.aspx"){
    	$(".head-img").attr("src","/css/img/content-header-bg5.jpg");

    }      
    if ( path ) {  	
        $('.page-nav a[href$="' + navPath + '"]').parent("li").addClass('page-active');
        $('.sub-side-nav a[href$="' + subPath + '"]').addClass('menu-active');
        
    }

    	
});
//Misc Script

$(document).ready(function(){
	$('.mainImage').wrap('<div class="big-img-container" />');
	$('.big-img-container').wrap('<div class="big-img-holder" />');
	$('.big-img-holder').addClass('big-img-shadow');
	
	$('.imgRight').wrap('<div class="small-img-container" />');
	$('.small-img-container').wrap('<div class="small-img-holder" />');
	$('.small-img-holder').addClass('small-img-shadow');
	
	$('.imgLeft').wrap('<div class="small-img-container-left" />');
	$('.small-img-container-left').wrap('<div class="small-img-holder-left" />');
	$('.small-img-holder-left').addClass('small-img-shadow');
	
	
	$('li:has(ul)').css({background:"url(/css/img/nav-arrow-down.png) no-repeat top right"});
	$('#ctl00_CrumbPanel a:contains("Site Map")').text("Home").attr("href", "/default.aspx");
	$('span#ctl00_smpBreadCrumb span:contains(">")').css({"padding":"0 10px 0 10px"});
	$('.AspNet-Menu li:last-child').css({"border-bottom":"none"});
});

/*$(document).ready(function(){
	$('.sub-content p:first-child input[type="image"]').wrap('<div class="big-img-container" />');
	$('.big-img-container').wrap('<div class="big-img-holder" />');
	$('.big-img-holder').addClass('big-img-shadow');
	$('.sub-content p:not(:first-child) input[type="image"]').wrap('<div class="small-img-container" />');
	$('.sub-content p:not(:first-child) img').wrap('<div class="small-img-container" />');
	$('.small-img-container').wrap('<div class="small-img-holder" />');
	$('.small-img-holder').addClass('small-img-shadow');
	$('li:has(ul)').css({background:"url(/css/img/nav-arrow-down.png) no-repeat top right"});
	$('#ctl00_CrumbPanel a:contains("Site Map")').text("Home").attr("href", "/default.aspx");
	$('span#ctl00_smpBreadCrumb span:contains(">")').css({"padding":"0 10px 0 10px"});
	$('.AspNet-Menu li:last-child').css({"border-bottom":"none"});
});*/
