// Custom fonts
Cufon.replace('h1, h2');
Cufon.replace('.xlink a, .download a');
Cufon.replace('ul#nav_642739>li>a.normal', {
    hover: true
});
Cufon.replace('ul#nav_642739>li>a.bold', {
    fontFamily: 'ClarendonB'
});
Cufon.replace('h3, .readmore a, .ylink a', {
    fontFamily: 'ClarendonB'
});

jQuery("#nav_642739 a").each(function () {
	var parentId = jQuery(this).parent().parent();
	if (parentId.attr("id") == "nav_642739") {
		jQuery(this).addClass('normal');
		jQuery(this).removeAttr("onclick");
		jQuery(this).after("<a href='" + jQuery(this).attr("href") + "' class='bold'>" + jQuery(this).text() + "</a>");
	}
});

function initMenu() {
var loc=location.pathname;
jQuery('#nav_642739 ul').hide();
jQuery('#nav_642739 ul').each(function(){
    jQuery(this).find('li a').each(function(){
			if(jQuery(this).attr('href')==loc) {
				jQuery(this).parent().parent().show();
			} 

    });
});

    jQuery('#nav_642739>li>a').click(

    function () {
        jQuery(".selected").removeClass("selected");
        jQuery(this).parent().addClass("selected");
        var checkElement = jQuery(this).parent().children("ul");
        if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
            return false;
        }
        if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
            jQuery('#nav_642739 ul:visible').slideUp('normal');
            checkElement.slideDown('normal');
            return false;
        }
    });
}
jQuery(document).ready(function () {
    initMenu();
    jQuery(".wheretxt").stop(true, false).animate({
        opacity: 0
    }, 500, function () {
        // Animation complete.
    });
    jQuery(".subscribeform").stop(true, false).animate({
        opacity: 0
    }, 500, function () {
        // Animation complete.
    });

    //where to find us CTA on hover
    jQuery(".wherebtn a").hover(function () {
        jQuery(this).parent().prev().stop(true, false).animate({
            opacity: 1
        }, 500, function () {
            // Animation complete.
        });
        jQuery(this).css({
            "padding-right": "12px"
        });
    }, function () {
        //do nothing
    });
    //where to find us CTA box on hover
    jQuery(".wheretxt").hover(function () {
        //do nothing
    }, function () {
        jQuery(this).stop(true, false).animate({
            opacity: 0
        }, 500, function () {
            // Animation complete.
        });
        jQuery(this).next().find("a").css({
            "padding-right": "0px"
        });
    });
    //where to find us box on hover
    jQuery(".wherebox").hover(function () {
        //do nothing				
    }, function () {
        jQuery(this).find('.wheretxt').stop(true, false).animate({
            opacity: 0
        }, 500, function () {
            // Animation complete.
        });
        jQuery(this).find(".wherebtn a").css({
            "padding-right": "0px"
        });
    });

    //subscribe to our newsletter CTA on hover
    jQuery(".subscribebtn a").hover(function () {
        jQuery(this).parent().prev().stop(true, false).animate({
            opacity: 1
        }, 500, function () {
            // Animation complete.
        });
        jQuery(this).css({
            "padding-left": "12px"
        });
    }, function () {
        //do nothing
    });
    //subscribe to our newsletter CTA box on hover
    jQuery(".subscribeform").hover(function () {
        //do nothing
    }, function () {
        jQuery(this).stop(true, false).animate({
            opacity: 0
        }, 500, function () {
            // Animation complete.
        });
        jQuery(this).next().find("a").css({
            "padding-left": "0px"
        });
    });
    //subscribe to our newsletter box on hover
    jQuery(".subscribebox").hover(function () {
        //do nothing				
    }, function () {
        jQuery(this).find('.subscribeform').stop(true, false).animate({
            opacity: 0
        }, 500, function () {
            // Animation complete.
        });
        jQuery(this).find(".subscribebtn a").css({
            "padding-left": "0px"
        });
    });


});
