﻿//For options, go to http://users.tpg.com.au/j_birch/plugins/superfish/#options
(function(j$) {
    j$(document).ready(function() {
								
							
	$('#fontsizer').jfontsizer({
		applyTo: '#main_content,#main_content_wide,#home_content',
		changesmall: '2',
		changelarge: '2',
		expire: 30
	});
	    j$('.superfish ul.L1').superfish({
            delay: 500,                            // one second delay on mouseout 
            animation: { opacity: 'show' },         // fade-in and slide-down animation 
            speed: 'fast',                          // faster animation speed 
            autoArrows: false,
            dropShadows: false
        }).css({ 'clear': 'left' });
        // Webkit: apply top border to tables with .list and .list-no_lines
        j$.each(j$.browser, function(i, val) {
            if (i == 'safari' && val == true) {
                j$('.list tr:first td').css("border-top", "2px solid #43848C");
                j$('.list-no_lines tr:first td').css("border-top", "2px solid #43848C");
            }
        });
        //Put in the word "Search" and remove it on focus.
        if (j$('.search_bar').get(0).value == '')
            j$('.search_bar').get(0).value = 'Search';
        j$('.search_bar').focus(function() {
            j$(this).get(0).value = '';
        });

        //Added by Michael for Lawyer Referral search page
        //set bgiframe to topten div
        j$('#topten').bgiframe();

        j$('table[border=1]')
			.attr('border', '0');

        //Added by Devin for Popup window code
        $('a').each(function() {
            var popupWindowRegex = /\{[\w\d\s:,&;/\."\[\]\-]*\}/g;
            if ($(this).attr('class').match('popUp')) {
                var paramsJson = $(this).attr('class').match(popupWindowRegex); 
                $(this).click(function() {
                    popUp(paramsJson);
                    return false;
                });
            }
        });	    
    });
})(jQuery);
