$(function(){
   
    $(".content_right .testimonial, .content_right .form_image").hide();
   
   
    $(".breadcrumb").each(function(){
        var charReplace = $(this).html();
        charReplace = charReplace.replace("&gt;","|");
        charReplace = charReplace.replace("&gt;","|");
        charReplace = charReplace.replace("&gt;","|");
        charReplace = charReplace.replace("&gt;","|");
       $(this).html(charReplace);
    });
        
    $(".mm_form tr").each(function(){$("td:first",this).addClass("label");});
    $(".mm_form tr").each(function(){$("td:last",this).addClass("input");});   
    $(".mm_form .label").wrapInner("<div></div>");
    $(".mm_form input:last").addClass("SubmitButton");
    $(".mm_form textarea").parent().addClass("textareaTD");
    $(".mm_form .label:last").hide();
    $(".mm_form tr:last").addClass("SubmitButtonTR");
    $(".mm_form td:last").addClass("SubmitButtonTD");
    
    $(".content_right .testimonial:eq("+Math.floor(Math.random()*$(".content_right .testimonial").length)+")").show();
    $(".content_right .form_image:eq("+Math.floor(Math.random()*$(".content_right .form_image").length)+")").show();

    $(".tool").fullLink();
    
    $('.fadein img:gt(0)').hide();
	setInterval(function(){$('.fadein :first-child').fadeOut().next('img').fadeIn().end().appendTo('.fadein');}, 5000);
	
	$(".spot:nth-child(1)").attr("style"," top: 129px; left: 102px; position: absolute;").show();
	$(".spot:nth-child(2)").attr("style"," top: 41px; left: 116px; position: absolute;").show();
	$(".spot:nth-child(3)").attr("style"," top: 164px; left: 75px; position: absolute;").show();
	$(".spot:nth-child(4)").attr("style"," top: 68px; left: 96px; position: absolute;").show();
	
	$(".spot:nth-child(1)").hover(function(){$(".lpool").show();},function(){$(".lpool").hide();});
    $(".spot:nth-child(2)").hover(function(){$(".aberdeen").show();},function(){$(".aberdeen").hide();}); 
    $(".spot:nth-child(3)").hover(function(){$(".milford").show();},function(){$(".milford").hide();}); 
    $(".spot:nth-child(4)").hover(function(){$(".grange").show();},function(){$(".grange").hide();}); 
    
    $(".content_left .branches .branch").each(function(){
        $(this,"a").hover(function(){
           $(".desc",this).show();
           $(this).addClass("down");
        },function(){
           $(".desc",this).hide();
           $(this).removeClass("down");
        });  
    });
    
    if( $('#media').is(':visible') ) {} 
    else {$('#footer').attr("style","margin-top: 20px;");}

});

