// Custom code
jQuery(document).ready(function () {
    // Used for executing code only on certain pages
    pathname = window.location.pathname;
    
	// Phone replacement
    if (phone != null)
    {
		if (jQuery('span[class^=ums_dynamicnumber]').length > 0)
    	{
			if (phone.split('|').length > 1)
			{
				phones = phone.split('|');
				jQuery('span[class^=ums_dynamicnumber]').each(function () {
					var class = jQuery(this).attr('class');
					var id = class.substr(17);
					jQuery('.' + class).text(phones[id]);
				});
			}
			else
			{
            	jQuery('span[class^=ums_dynamicnumber]').text(phone);
			}
        }	
    }
    
    if (pathname == '/business-law.html')
	{
		jQuery("input[name='submit']").click(function () { _gaq.push(['_trackPageview', 'appointment']); })
	}
	if (pathname == '/case.htm')
    {
        jQuery("input[value='Submit']").click(function () { _gaq.push(['_trackPageview', 'case']); })
    }
	if (pathname == '/attorneys-joshua.htm')
    {
        jQuery("a").click(function () {
			if (jQuery(this).text() == 'josh@lawmr.com')
			{
				_gaq.push(['_trackPageview', 'josh_email']);
			}
		});
    }
	
});
