﻿$(document).ready(function () {
    var pathname = window.location.pathname;
    //alert(pathname);
    var breadcrumb = '<a href="/">Home</a>';
    $("#breadcrumbs").html();
    var bc = pathname.split('default')[0].split('.')[0].split('/');
    var path = 'http://www.lawyersite4';
    for (i = 0; i < bc.length; i++) {
        if (i > 0) {
            path += "/" + bc[i]
        }
        if (bc[i].length > 1) {
            breadcrumb += ' &gt; <a style="text-transform:capitalize;" href="' + path + '">' + decodeURI(bc[i]) + '</a>';
        }
    }
    $("#breadcrumbs").html(breadcrumb);
    $(".navigation_main a").each(function (i) {
        if ($(this).attr("href").indexOf(bc[1]) > 0 || ($(this).attr("href").length == 1 && bc[1] == "")) {
            $(this).addClass("current");
        }
    });

    if ($("#subnavigation_about").exists()) {
        $("#subnavigation_about a").each(function (i) {
            //alert($(this).attr("href") + " " + pathname)
            if ($(this).attr("href").indexOf(pathname) > -1 && $(this).attr("href").length == pathname.length) {
                $(this).addClass("current");
            }
        });
    }
    

});
jQuery.fn.exists = function () { return jQuery(this).length > 0; }

Cufon.replace('.navigation_main', { fontFamily: 'calibri' }); // Works without a selector engine
Cufon.replace('.header_contact', { fontFamily: 'calibri' });
Cufon.replace('h1', { fontFamily: 'caslon' });
Cufon.replace('h2', { fontFamily: 'caslon' });
Cufon.replace('h3', { fontFamily: 'caslon' });
Cufon.replace('.caslon', { fontFamily: 'caslon' });
Cufon.replace('.logo a', { fontFamily: 'caslon' });
Cufon.replace('.bannerlinks a', { fontFamily: 'caslon' });
Cufon.replace('.logo span', { fontFamily: 'calibri' }); 



//Cufon.replace('a'); // Requires a selector engine for IE 6-7, see above
