 Cufon.replace('h1', { fontFamily: 'Droid Serif' });
        Cufon.replace('h1 span', { fontFamily: 'Droid Serif' });
        Cufon.replace('.aside h2', { fontFamily: 'Droid Serif' });
        Cufon.replace('h2', { fontFamily: 'Droid Serif' });
        Cufon.replace('h3', { fontFamily: 'Droid Serif' });

        Cufon.replace('#nav ul li a', { fontFamily: 'HelveticaNeueLT Com 65 Md' });

        $(document).ready(function() {
            $('#nav>ul>li').bind("mouseleave", function() {
                $(this).find('a').css('color', 'white');
                $(this).css('background-color', '#36c');
                $(this).find('.subsubmenu').css('background-color', '#d7e1f5');
                Cufon.refresh('#nav ul li a', { fontFamily: 'HelveticaNeueLT Com 65 Md' });

            })
            $('#nav>ul>li').bind("mouseenter", function() {
                $(this).find('a').css('color', '#36c');
                $(this).css('background-color', '#B5CBFF');
                Cufon.refresh('#nav ul li a', { fontFamily: 'HelveticaNeueLT Com 65 Md' });


            })
            $('.divHead').bind("mouseenter", function() {
                $(this).parent().css('background-color', '#B5CBFF');

                if ($(this).parent().find('.submenu').children(':first').children(':first').attr("class") != "title")
                    $(this).parent().find('.submenu').children(':first').css('background-color', '#B5CBFF');
                if ($(this).parent().find('.submenu').children(':first').children(':first').attr("class") == "title")
                    $(this).parent().find('.submenu').children(':first').css('background-color', '#d7e1f5');
            });


            $('.subsubmenu').bind("mouseenter", function() {
                $(this).css('background-color', '#B5CBFF');
                $(this).prev().css('background-color', '#d7e1f5');
                $(this).next().css('background-color', '#d7e1f5');
                if ($(this).first() && $(this).children(':first-child').attr('class') != 'title')
                    $(this).parent().parent().css('background-color', '#B5CBFF');
                if ($(this).first() && $(this).children(':first-child').attr('class') == 'title')
                    $(this).parent().parent().css('background-color', '#d7e1f5');
            })
            $('.footer-item').bind("mouseleave", function() {
                $(this).css('background-color', '#858585');
                if ($(this).first() && $(this).children(':first-child').attr('class') != 'line')
                    $(this).parent().children(':first-child').css('background-color', '#858585');
            })
            $('.footer-item').bind("mouseenter", function() {
                $(this).css('background-color', '#ADADAD');
                if ($(this).first() && $(this).children(':first-child').attr('class') != 'line')
                    $(this).parent().children(':first-child').css('background-color', '#ADADAD');
            })
            $('.subsubmenu').click(function(e) {
                e.preventDefault();
                window.top.location = $(this).find('a').attr('href');
            });
            $('.footer-item').click(function(e) {
                e.preventDefault();
                window.top.location = $(this).find('a').attr('href');
            });
            $('.footer-col>div:first-child').bind("mouseleave", function() {
                $(this).css('background-color', '#858585');

            })
            $('.footer-col>div:first-child').bind("mouseenter", function() {
                $(this).css('background-color', '#ADADAD');

            })
            $('.footer-col>div:first-child').click(function(e) {
                e.preventDefault();
                window.top.location = $(this).find('a').attr('href');
            });

            $('input[type=text]').keydown(function(event) {
                if ($(this).attr("class") != 'search-text')
                    return !(event && event.keyCode == 13);
            });
        });
        writeMyEmail();

        $(function() {
            $('.callback').click(function(e) {
                e.preventDefault();
                var $this = $(this);
                var horizontalPadding = 30;
                var verticalPadding = 30;
                $('<iframe id="externalSite" class="externalSite" src="' + this.href + '" marginheight="0" marginwidth="0" frameborder="0" />').dialog({
                    title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
                    autoOpen: true,
                    width: 580,
                    height: 365,
                    modal: true,
                    resizable: false,
                    autoResize: false,
                    draggable: false,
                    overlay: {
                        opacity: 0.5,
                        background: "black"
                    }
                }).width(580 - horizontalPadding).height(395 - verticalPadding);
            });

            $('.apply').click(function(e) {
                e.preventDefault();
                var $this = $(this);
                var horizontalPadding = 30;
                var verticalPadding = 30;
                $('<iframe id="applyNow" class="applyNow" src="/apply-now.aspx?position=' + $(this).parent().find('.text').find('strong').text() + '" marginheight="0" marginwidth="0" frameborder="0" />').dialog({
                    title: 'Apply Now',
                    autoOpen: true,
                    width: 580,
                    height: 365,
                    modal: true,
                    resizable: false,
                    autoResize: false,
                    draggable: false,
                    overlay: {
                        opacity: 0.5,
                        background: "black"
                    }
                }).width(580 - horizontalPadding).height(395 - verticalPadding);
            });
        });

